Posts

Showing posts from July, 2014

Is it possible to click "OK" on an invisible pop up frame in selenium? python -

i need click "ok" on pop sign in costar.com. when frame pops up, freezes rest of window , does't allow me @ developer tools see elements. after looking @ source code, found invisible frame. if want see yourself: -go costar.com -click login -click login button you see type of invisible frame i'm talking about. using chrome search source code, can find invisible frame information searching "invisible" or "certificate". is possible interact frame? thank help. what getting alert you have switch alert , accept it alert = driver.switch_to_alert() alert.accept()

date - MONYY7. and DATE9. operations -

i'm working on big data set, (more 100 variables , 11 millions observations). in data set, have variable named dtdsi (simulation date) in date9. format. (for example: 01apr2015 , 02mar2015...). have macro-program analyse data set comparing observations in 2 different months: %macro analysis (data_input , m , m_1); ..... %mend; the 2 macro-variables m , m_1 months want compare. format monyy7.(apr2015 , mar2015...). keep in mind cannot modify data_input (its data of company). in beginning of macro program, want create new data set observations of &m , &m_1 month. can creating new date variable dtdsi (real_month ex) in format monyy7. select observations real_month equal &m or real_month equal &m: data new; set &data_input; mois_real = input(dtdsi,monyy7); run; proc sql; create table new as; select * mois_real in ("&m" , "&m_1") new; .... the problem in first data statement, duplicated data_input; bad because took 30 minut

How to translate a Solr query into Elasticsearch -

i'm trying express solr (lucene) query in elastic search, i'm not sure how: q=field1:"value1"^10 or field2:("value2a"^20 or "value2b"^30) group=true group.field=fieldgroup is there way pass lucene query es, don't need first translate it? it's possible pass lucene query elasticsearch using query_string query. should plausible: get /_search { "query": { "query_string": { "query": "field1:\"value1\"^10 or field2:(\"value2a\"^20 or \"value2b\"^30)" } } } you can use aggregations mimic field collapsing: https://www.elastic.co/guide/en/elasticsearch/guide/current/top-hits.html

c# - Dynamically query entity framework with linq -

i need function key-value pair of id , description entity model populating fields on user control , i'd find way make dynamic in order avoid repeating code. my pseudo-code: public list<object> getdata(string modelname, string modelid, string modeldescription) { using(dbentities context = new dbentities()) { return (from d in context.modelname select new { id=d.modelid, description = d.modeldescription } ).tolist<object>(); } } a possible partial solution this , table needs dynamically defined too. in context have similar to public dbset<myentity> thepropertyname {get; set;} when call function modelname = "thepropertyname" so retrieve dbset via reflection run tolist on it. use foreach on entities , via reflection retrieve properties modelid , modeldescription.

shell - UNIX: redirect some commands with pipe -

i'm new unix. following command i'm executing. $ time ls | wget exampledomain.com > output.txt i command output time took retrieve information output.txt. command have creates output.txt it's blank document. thank you wget outputs stderr. use: wget exampledomain.com > out 2>&1 # or wget exampledomain.com 2>out # or wget exampledomain.com --output-file=log # or, redirect output both file , stdout wget exampledomain.com 2>&1 | tee log

bash - How to use ~/.bashrc aliases on IPython 3.2.0? -

i need use aliases ~/.bashrc on ipython. first i've tried didn't work %%bash source ~/.bashrc according this post should %%bash . ~/.bashrc f2py3 -v it takes 20 sec run on jupiter , get: bash: line 2: f2py3: command not found my ~/.bashrc file looks like alias f2py3='$home/python/bin/f2py' bash: line 2: type: f2py3: not found neither alias, source, nor %rehashx% work %%bash alias f2py3='$home/python/bin/f2py' i found problem python, can't execute alias command neither sh nor bash. can use alias ipython magics? you can parse bashrc file in ipython config , add custom aliases have defined: import re import os.path c = get_config() open(os.path.expanduser('~/.bashrc')) bashrc: aliases = [] line in bashrc: if line.startswith('alias'): parts = re.match(r"""^alias (\w+)=(['"]?)(.+)\2$""", line.strip()) if parts:

scala - Set#apply with argument `Unit` -

scala puzzlers presents "puzzler": scala> list("1", "2").toset() + "3" warning: there 1 deprecation warning; re-run -deprecation details res13: string = false3 the explanation notes above code de-sugars to: (list("1", "2").toset[any] apply ()) + "3" but why doesn't following return false ? scala> set("1")() <console>:11: error: not enough arguments method apply: (elem: string)boolean in trait gensetlike. unspecified value parameter elem. set("1")() ^ the compiler smart enough know makes no sense set[a] . set[a]#apply has signature: apply(elem: a): boolean i.e., must supply argument of a , , a invariant set . if try supply unit set[int] , type mismatch, not false . scala> set("1")(()) <console>:19: error: type mismatch; found : unit required: string set("1")(())

c# Help making values global -

so understand how make global values , fact 1. shouldn't , 2. cannot use value created in different "context" however, i'm not sure how correct problem in case. think make sense if read code //read in load query testcsv var sourcepath = @"d:\\load query test.csv"; //what inital csv var delimiter = ","; var firstlinecontainsheaders = true; //csv has headers //creates temp file takes less time loading memory var temppath = path.combine(@"d:", path.getrandomfilename()); var linenumber = 0; var splitexpression = new regex(@"(" + delimiter + @")(?=(?:[^""]|""[^""]*"")*$)"); using (var writer = new streamwriter(temppath)) using (var reader = new streamreader(sourcepath)) { string line = null; string[] headers = null; if (firstlinecontainsheaders)

wcf - Where is the request model in this vendor WSDL? -

i'm attempting create user accounts vendor tool in batches. asked vendor how turn on mex endpoint creating single account , adjusted config file accordingly. i able create service reference, have in visual studio client , 2 interfaces. can't tell how create request. client has invokeservice method, takes object. i replicated vendors class structure in code, service didn't type. so, updated classes use vendor's original namespace, service still didn't it. type 'life.businessservice.basebusinessdatamodel.businessrequest' data contract name 'businessrequest:http://schemas.datacontract.org/2004/07/life.businessservice.basebusinessdatamodel' not expected. consider using datacontractresolver or add types not known statically list of known types - example, using knowntypeattribute attribute or adding them list of known types passed datacontractserializer. here's wsdl service. i'm not strong in wcf, i'm hoping guidance. thanks! <

Selenium IDE : how to handle popup when popup name is dynamically generated -

how handle popup when name dynamically generating. please advice. usually, if it's new tab or window, using selectpopup trick. once you're done verifying want on popup, close | | selectwindow | null | to main window.

selenium - Practice webdriver , need application -

i need application practice selenium webdriver. can suggest me applications can work offline. note: please don't refer actitime. there issue installing it. for offline try https://github.com/eviltester/seleniumtestpages for online http://www.toolsqa.com/automation-practice-form/ http://www.way2automation.com/demo.html hope helps you..

java - adding a single backslash to ArrayList<String> -

Image
i have arraylist of strings storing values going print properties file. want append backslash end of each line can have multi-line values. put values in arraylist this: arraylistname.add(value + '\\'); it produces "value\\" in arraylist ends 4 backslashes in file. this: arraylistname.add(value + ''); produces "value", there no backslashes attached value. doing incorrectly? if you're viewing data in debug, you'll see 2 backslashes. but if print data out, there not 2 backslashes. public static void main(string[] args) throws exception { string data = "value\\"; system.out.println(data); } results: value\

Symbolic integration of Student's t density in MATLAB -

i want integrate student's t-density in matlab matlab seems fail , returns same expression without calculations. ideas on how proceed. know should evaluate 1 trick force matlab it. syms x s mu nu g = @(x) gamma(1/2*(nu+1))/(gamma(nu/2)*sqrt(pi*nu*s^2))*(1 + 1/nu*(x-mu)^2/s^2)^(-1/2*(nu+1)); int(g(x), x, -inf, inf) i tried in way: syms x nu mu s f = gamma(1/2*(nu+1))/(gamma(nu/2)*sqrt(pi*nu*s^2))*(1 + 1/nu*(x-mu)^2/s^2)^(-1/2*(nu+1)) int(f) and works! got answer: -(gamma(nu/2 + 1/2)*(mu - x)*hypergeom([1/2, nu/2 + 1/2], 3/2, -(mu - x)^2/(nu*s^2)))/(pi^(1/2)*gamma(nu/2)*(nu*s^2)^(1/2)) but if try definite integration doesn't works: int(f, 0, 1) ans = int(gamma(nu/2 + 1/2)/(pi^(1/2)*gamma(nu/2)*((mu - x)^2/(nu*s^2) + 1)^(nu/2 + 1/2)*(nu*s^2)^(1/2)), x, 0, 1) so went , read this: if matlab unable find answer integral of function f, returns int(f) . ( http://www.mathworks.com/help/symbolic/integration.html ) answer can't solved!

java - How to add to an ArrayList the data of a ResultSet? -

i want have arraylist data in postgresql database. for example: column1 column2 column3 column4 b c d j d s e arraylist.get(0) = (a, b, c, d) arraylist.get(1) = (j, d, s, e) i have this: public static arraylist<ordenes> selectinstruct (int a) throws sqlexception { string driver = "org.postgresql.driver"; string server = "jdbc:postgresql://localhost:5432/postgres"; string user = "usuario"; string pass = "contraseña"; arraylist<ordenes> ordenes = new arraylist<ordenes>(); ordenes ord = new ordenes(); try { class.forname(driver); connection conexion = drivermanager.getconnection(server, user, pass); statement dato = conexion.createstatement(); resultset rs = dato.executequery("select * \"ordenes\"" + "where \"opera

android - add a contact opening the address book app -

what should if want add contact without saving it? example: want populate fields of address book values received app. when add contact whatsapp (it fills field of phone number doesn't save contact). in advance , sorry bad english. update: i've tried this, directly save it! arraylist<contentprovideroperation> ops = new arraylist<contentprovideroperation>(); ops.add(contentprovideroperation.newinsert( contactscontract.rawcontacts.content_uri) .withvalue(contactscontract.rawcontacts.account_type, null) .withvalue(contactscontract.rawcontacts.account_name, null) .build()); // add contact name ops.add(contentprovideroperation.newinsert( contactscontract.data.content_uri) .withvaluebackreference(contactscontract.data.raw_contact_id, 0) .withvalue(contactscontract.data.mimetype,contactscontract.commondatakinds.structuredname.content_item_type)

javascript - Webflow Slider not working after wordpress installation -

i'm working on website , have slider list duplicate on website. html version works right once made changes wordpress second slider not working. the images being loaded correctly , using timthumb in both slides. actually, function load list items same both sliders list. the link below: http://artflexeventos.com/pacotes/aereos/#hoteis you have click in button (selecionar) in order second list of slides appear. the error can see in browser are: uncaught typeerror: cannot read property 'mask' of undefined (google chrome) typeerror: data undefined (firefox) i have no idea why works on first slides not in second one.

How to change ACE TypeGuessRows Registry Value for Access 2007 to Determine Field Data Type Properly When Importing From Excel File Using VBA -

i have access database imports data external excel spreadsheet contains column of data called date delivered . while data in column date type, entries 4/5/15,5/1/15 made indicate 2 delivery dates. this trips access when importing data using: docmd.transferspreadsheet acimport, 5, "delivery data", "\\file\path.xlsx", true this causes make column date type rather string drops value fields problematic. found appeared helpful solution here suggested changing typeguessrows registry value 0 make jet @ rows when determining field data type. i created , changed registry value using following code: dim regloc string dim myws object 'writes registry value make jet check rows (0) not first 25 (default value = 8) determine type regloc = "hkey_current_user\software\microsoft\jet\4.0\engines\excel\typeguessrows" set myws = createobject("wscript.shell") myws.regwrite regloc, 0, "reg_dword" unfortunately did not seem work prob

ruby on rails - ActiveRecord#execute vs PG#send_query memory usage for large result sets -

background i noticed our worker boxes spike in memory utilization whenever hit activerecord's #execute() large result set (>1m rows of data), memory stays relatively flat when connect pg using raw connection , use #send_query method instead. additionally, memory stays @ same high level after #execute has finished running, makes seem whatever temporary object(s) have been created sticking around, , not getting garbage collected. i'm not setting result of #execute or #send_query method variable in either case; being invoked execute sql passed in. questions is #execute temporarily storing result set in pg::result object, while send_query streams data without storing temporarily? why doesn't memory utilization return normal levels after sql has been executed using #execute method? responsible manually dumping objects created in memory? shouldn't gc take care of this? i did digging objectspace couldn't pinpoint memory bloat was. appreciated!

scala - Parallel operation on list with future -

i wondering general advise if following made sense. i have list, need filter according following criteria: let list contain things of type a, b, c , d , want take n0 elt of a, n1 elt of b, n2 elt of c , n3 elt of d , make 1 list out of it. the iterative approach pretty clean (i.e. going on list, using 4 counters, adding elt each list until each respective counter reached limit i.e. n1, n2, n3, n4), colleague @ work told me take advantage of multiple cpu , parallelize operation using future. in other words, launching 4 future operation filter list, , drop if applies (i.e.resultinglist > nx), "resultinglist.size - n0 or n1 or n2 or n3 or n4". await result , combine list. i think overkill use iteratively pretty easily. wonder people think that. yes can run test , compare speed, raise question of, when can ensure taking advantage of multiple cpu architecture. because indeed understand motivation behind suggestion. however, did not know how tell might counter produc

git - In VS2013 with TFS, a newly added file appears as Checked-In and does not appear in the Pending Changes list -

i have noticed on several occasions, , have not yet found suitable explanation or resolution issue. looking cause , solution. we using: vs2013 pro version 12.0.31101.00 update 4 team explorer visual studio 2013 microsoft git provider on occasion, add file branch in solution. can observe following: the file briefly appear new file glyph (the plus sign), , change checked in glyph (the lock icon). in changes tab in team explorer, file not appear in included changes, excluded changes, or untracked changes sections. git status reports file not displayed pending change, nor displayed untracked file. if view branch in repository, file not, in fact, checked in. the file exist in folder within solution's path. note file did not exist in repository. (this branch , repository few weeks old, , verified.)

android - Handle pinch zoom on recylerview -

i want achieve pinch, zoom on recylerview. have text views in recylerview. change text size on pinch. handle, pinch on empty activity using pinch zoom custom view. not working on recylerview. recylerview scroll instead of pinch event. handled separate touch event on textview not working! i found way achieve this. can use library https://code.google.com/p/android-zoom-view/downloads/list . library allow zoom recylerview image. can change library needs. there no wiki page associated project check wiki android-zoom-view.jar

Spring Boot Data Rest JPA - Entity custom create (User) -

i trying learn spring. created project spring boot using following tools: spring data jpa spring data rest spring hateoas spring security i trying create user entity. want user have encrypted password (+ salt). when post /api/users create new user. { "firstname":"john", "lastname":"doe", "email":"johndoe@example.com", "password":"12345678" } but have 2 problems: the password saved in clear-text the salt null +----+---------------------+-----------+----------+----------+------+ | id | email | firstname | lastname | password | salt | +----+---------------------+-----------+----------+----------+------+ | 1 | johndoe@example.com | john | doe | 12345678 | null | +----+---------------------+-----------+----------+----------+------+ the problem think default constructor used , not other 1 have created. new spring , jpa must missing something. here code.

how to increment like counter when post is shared in wordpress -

i want have button , share button on articles in website, want readers can article , if share's article should increment counter. so there plugin in wordpress can this? yes can achieve using kk star plugin. plugin link : https://wordpress.org/plugins/kk-star-ratings/

if statement - how to give nil parameter in if condition in swift? -

in objective-c: if (!myimageview) { nslog(@"hdhd"); } else { //do } but in swift: if (!myimageview) { println("somethin") } else { println("somethin") } this code giving me error: could not find overload '!' accepts supplied arguments' myimageview class variable uiimageview . what should do? usually, best way deal checking variables nil in swift going if let or if var syntax. if let imageview = self.imageview { // self.imageview not nil // can access through imageview } else { // self.imageview nil } but work (or comparison against nil either == nil or != nil ), self.imageview must optional (implicitly unwrapped or otherwise). non-optionals can not nil , , therefore compiler not let compare them against nil . they'll never nil . so if if let imageview = self.imageview or self.imageview != nil or self.imageview == nil giving errors, it's because self.imageview n

Java FasterXml(Jackson) Mixins and Inheritance -

there 2 simple calsses public class { private int propid; public int getpropid(){return this.propid;} } public class b extends { } and 2 mixins public interface amixin{ @jsonproperty("propida") int getpropid();} public interface bmixin{ @jsonproperty("propidb") int getpropid();} jsonobjectmapper = new objectmapper(); // register mixin jsonobjectmapper.addmixin(b.class, bmixin.class); jsonobjectmapper.addmixin(a.class, amixin.class); the following 2 calls same results: jsonobjectmapper.writevalue(writer, new a()); jsonobjectmapper.writevalue(writer, new b()); but expect propida first , propidb second one.

bash - Run 1 command to install 3 scripts from inside a script -

i'm using media server , each time when want reinstall items, have first script example get file make folder cmod files ./install then next file same, , on. is there way can add commands in 1 php file if run like: install 3 files, runs , cmods me?

Find elapsed time in javascript -

i'm new javascript , i'm trying write code calculates time elapsed time user logged in current time. here code:- function markpresent() { window.markdate = new date(); $(document).ready(function() { $("div.absent").toggleclass("present"); }); updateclock(); } function updateclock() { var markminutes = markdate.getminutes(); var markseconds = markdate.getseconds(); var currdate = new date(); var currminutes = currdate.getminutes(); var currseconds = currdate.getseconds(); var minutes = currminutes - markminutes; if(minutes < 0) { minutes += 60; } var seconds = currseconds - markseconds; if(seconds < 0) { seconds += 60; } if(minutes < 10) { minutes = "0" + minutes; } if(seconds < 10) { seconds = "0" + seconds; } var hours = 0; if(minutes == 59 && seconds == 59) { hours++; } if(hours < 10) { hours = "0" + hours; }

ggplot2 - R: How to spread (jitter) points with respect to the x axis? -

i have following code snippet in r: dat <- data.frame(cond = factor(rep("a",10)), rating = c(1,2,3,4,6,6,7,8,9,10)) ggplot(dat, aes(x=cond, y=rating)) + geom_boxplot() + guides(fill=false) + geom_point(aes(y=3)) + geom_point(aes(y=3)) + geom_point(aes(y=5)) this particular snippet of code produces boxplot 1 point goes on (in above case 1 point 3 goes on point 3). how can move point 3 point remains in same position on y axis, moved left or right on x axis? this can achieved using position_jitter function: geom_point(aes(y=3), position = position_jitter(w = 0.1, h = 0)) update : plot 3 supplied points can construct new dataset , plot that: points_dat <- data.frame(cond = factor(rep("a", 3)), rating = c(3, 3, 5)) ggplot(dat, aes(x=cond, y=rating)) + geom_boxplot() + guides(fill=false) + geom_point(aes(x=cond, y=rating), data = points_dat, position = position_jitter(w = 0.05, h = 0))

javascript - Tree node with expandable property set to true and no children does not render plus icon -

Image
tree node expandable property set true , no children not render expand/collapse icon. i need develop tree control loads sub-nodes on demand only. in other words, children should loaded on node expand event. i've found property 'expandable' set true supposed render expand/collapse icon regardless of whether children exist or not. please review code , point out made mistake 'expand/collapse icon' rendered nodes children. tree store , model declared follow: ext.define('entity', { extend: 'ext.data.model', fields: [ {name: 'name', type: 'string'}, {name: 'description', type: 'string'}, {name: 'clazz', type: 'string'}, {name: 'path;', type: 'string'}, {name: 'leaf', type: 'boolean'}, {name: 'expandable',type: 'boolean'}, {name: '

android - Skipping custom ViewGroup's child layout to improve perfomance -

i creating custom viewgroup manual (touch) , animated resizing of it's child views . resizing done re-calculating child view's sizes , calling requestlayout() , (on animation ): @override protected void applytransformation(float interpolatedtime, transformation t) { (int = 0; < childlist.size; i++) { newsize[i] = startsize[i] + (int)(delta[i] * interpolatedtime); } requestlayout(); } in onmeasure() , onlayout() apply calculated sizes. questions are: can skip child.measure() in onmeasure() and/or child.layout() in onlayout() if: child's size 0? child's size and/or position in viewgroup hasn't changed since last layout?

viewport height, whilst centralising the image within slider css -

i have slider on homepage working on. trying achieve full viewport height takes whole width screen. the way can achieve either stretching image, or image isn't centred. the image needs aligned centred horizontally , vertically, customers can see centre of image on width of browser, , without stretching image out of proportion. i have tried background-size: cover; on element no success not background img. containers have 100vh currently, width issue. the issue located here http://joeybox.info/ . realise menu , logo above image 100 viewport height rest under "fold", placing logo , menu on image eventually, once have figured out css. i have tried many solutions found within stack overflow forum , none work in scenario. my current css, after deleting in-correct code, is:- .bx-wrapper img {display: inherit; height: 100vh; max-width: inherit;} .ewic-wid-imgs {height: 100vh; max-width: unset; width: unset;} .bx-wrapper img {display: inherit;

c++ - Lifetime of rvalue bound to static const reference -

consider this: std::string foo(); void bar() { const std::string& r1 = foo(); static const std::string& r2 = foo(); } i know lifetime of string resulting first call foo() extended lifetime of r1 . what temporary bound r2 , though? live until end of scope or still there when bar() re-entered? note: not interested whether particular compiler so. (i interested in 1 use, , can test that.) want know standard has on this. the temporary extended the lifetime of reference . [c++14: 12.2/5]: the temporary reference bound or temporary complete object of subobject reference bound persists lifetime of reference except : a temporary bound reference member in constructor’s ctor-initializer (12.6.2) persists until constructor exits. a temporary bound reference parameter in function call (5.2.2) persists until completion of full-expression containing call. the lifetime of temporary bound returned value in function return statement (6.

c - Unable to change thread policy to SCHED_FIFO -

i have 2 threads, thread1 , thread2. created thread1 first , thread2. thread2 scheduled first. want schedule thread1 before thread2. changed policy of thread1 sched_fifo , policy of thread2 sched_rr. after thread2 scheduled before. declared 2 threads sched_fifo asssigned different priorities shown in below program. eventhough there no change. thought of checking policy in threads in returning 0. seems thread policy not getting changed. please me in solving isssue. #include <stdio.h> #include <pthread.h> #include <sys/types.h> pthread_t thread1, thread2; void * thread1_func (void *i) { struct sched_param p3; int i1 = 0; int policy; = pthread_getschedparam (thread1, (int *) &policy, &p3); printf ("in thread1 priority :%u policy: %u\n", p3.sched_priority, policy); } void * thread2_func (void *i) { struct sched_param p3; int i1 = 0; int policy; i1 = pthread_getschedparam (thread1,

php - Yii CActiveDataProvider generate SQL query -

cactivedataprovider generating auto query count total item count: select count(distinct `t`.`id`) `transaction` `t` left outer join `partner` `partner` on (`t`.`partner_id`=`partner`.`id`) this query slow, because contain join, how can set manualy total count, , disable auto query ? you may manualy set total item count cactivedataprovider prevent auto calculation. class model extends cactiverecord { public function search(){ $criteria = new cdbcriteria; // criteria here $data_provider = new cactivedataprovider($this, array('criteria'=>$criteria)); // replace $this->count( $criteria ) own condition or criteria $data_provider->settotalitemcount( $this->count( $criteria ) ); return $data_provider; } }

How can I find all the methods that contain a specific string within a Perl codeset? -

i've been given tricky task write log entry @ points within large million+ line code base. the points need log can found list of 500+ template types. template type string "end_assignment_affiliate" or "interview_accepted". i'm trying work out how write perl script take list of 500 templates , search through code find methods make use of each specific template string (i hope use list of methods find entry points system each template type). so example may have sub asub { my($arg) = @_ ... if ($template eq 'interview_accepted') { ... } i want determine method asub contains interview_accepted. interview_accepted may contained within multiple subroutines. it's quite easy grep code base message type , find line number in files message exists, i'm having hard time trying identify containing method. clearly if can programmatically more robust, repeatable , quicker. does know of modules or tricks can use achieve this? update

How do I use Dataflow to calculate the top unique value results per key? -

i'm relatively new dataflow , programming model , struggling problem requires calculating top 10 weeks customer has highest spend. apologise if seems silly question. the data have consists of customer ids use key , few million records containing timestamp , spend value. i've created extract method looks (excluding logging , date formatter). receives bigquery table row extract customer id, spend , timestamp week number: static class extractspend extends dofn<tablerow, kv<string, spendbyweek>> { private static final long serialversionuid = 0; @override public void processelement(processcontext c) { string custid = (string) row.get("customerid"); localdatetime date = localdatetime.parse((string) row.get("timestamp"), datetimeformatter); weekfields weekfields = weekfields.of(locale.getdefault()); int weeknumber = date.get(weekfields.weekofweekbasedyear()); double spend = (double) row.ge

Twitter REST API Vs Twitter Fabric - Twitter Core -

i see, have 2 options integrating twitter in andriod apps. 1. twitter rest api 2. twitter fabric - twitter core what difference between both. way access data different ?(twitter rest api calling request , response. , twitter core sdk, call methods , use it.) whether twitter continue support both rest api , twitter fabric. note: know twitter4j, external api in turn calls rest api. please don't provide info twitter4j. don't want info external library. little confusing 1 use. appreciated. update: i see single signon 1 useful difference. allows sync twitter accounts configured in twitter app, can't achieved using rest api. it depends on want use twitter fabric not integrating twitter,it platform provides other functionalities crash reports via crashlytics , monetization etc. still need network requests getting tweet , other data twitter , need integrate sdk in application increase size of app. if want data twitter , not want compromise app size may us

java - Simultaneous movement of two graphics with different and changing text -

the code wrote giving different output required. output got: in upper movement yellow rectangle moves left right in steps. in each step text changes 1 (signal 1, signal 2, signal 3 etc.) in lower movement text moves left right (at higher speed yellow rectangle above). text in both (above , below it) remains same i.e. if above "signal 1", below "signal 1", if above "signal 2" below same "signal 2". , on. output required: every thing should remain except: 1. in lower movement need text in green rectangle (same yellow rectangle above). 2. in lower movement need text of higher 2 in loop. in other words, if above "signal 1" below should "signal 3". if above "signal 2" below should "signal 4". if above "signal 3" below should "signal 5". if above "signal 4" below should "signal 6". if above "signal 5" below should &qu

wso2 - ELB with auto scaling -

want suggestion elb auto scaling (automatically start new instance when load more) wso2 esb. thanks. please use " wso2 private paas ". can have "auto scaling" wso2 esb instances wso2 private paas. as mentioned in previous answer , auto scaling load balancer not successful , that's why wso2 elb no longer recommended auto scaling. it's not mandatory use wso2 private paas auto scale wso2 products. can use preferred iaas features auto scaling. for example, can use amazon ec2 auto scaling . can create own amis wso2 products , use configuration management solution puppet configure products when new instance spawned. wso2 private paas uses puppet configure wso2 cartridge instances . in ec2, can dynamically scale using various metrics. more info, see auto scaling documentation . when use ec2, can use amazon elb . with wso2 private paas, wso2 cartridges readily available. (with puppet configurations etc , cartridges can auto scale accor

node.js - change the default output format mongoose nodejs -

my schema in node js var itemschema = new mongoose.schema({ name: { type: string, required: true }, value: { type: string } }); while doing find, following result comes, item.find().exec(callback); gives result [{"one":1},{"two":2},{"three":1},{"four":1}] but want result this, [{"one":1,"two":2,"three":3,"four":4}] is there way iterate , form result ? please suggest me!

iphone - Retrieve caller id in IOS 8.3 -

according ios caller id retrieve , have done retrieve caller info that: nsdictionary *info = (__bridge nsdictionary *)userinfo; ctcall *call = (ctcall *)[info objectforkey:@"kctcall"]; nsstring *caller = ctcallcopyaddress(null, call); but after ios 8.3, there no address returned ctcall. before ios 8.3, ctcall instance that: { kctcall = "<ctcall 0x17eb85e0 [0x38cb0700]>{status = 4, type = 0x1, subtype = 0x1, uuid = 0x17e89d90 [c5b34d1d-74b8-490a-8252-c9435a418290], address = 0x17e7f9f0, externalid = -1, start = 2.22507e-308, session start = 4.58346e+08, end = 2.22507e-308}"; kctcallstatus = 4; } ios 8.3 instance this: { kctcall = "<ctcall 0x16d85970 [0x3560c8b0]>{status = 4, type = 0x1, subtype = 0x1, uuid = 0x16d88f90 [f60c14dc-5288-41c1-a96f-c06f08e7757e], address = 0x0, externalid = -1, start = 2.22507e-308, session start = 4.58317e+08, end = 2.22507e-308}"; kctcallstatus = 4; } the address of ctcall 0. t

linq - C# Efficiently replacing -Infinity values in a dictionary -

i have code uses linq converts dictionary of string, ints string, doubles. following code works fine: public static void main(string[] args) { dictionary<string, int[]> ret = new dictionary<string, int[]>(); int[] = {1,2,0,4,5}; int[] b = { 0, 6, 9, 0, 12 }; int[] c = {2,0,3,5,0}; ret.add("al", a); ret.add("adam", b); ret.add("axel", c); dictionary<string, double[]> scores = ret.todictionary(r=> r.key, r => r.value.select((v, index)=> 3 * math.log10((double)v / 10) ).toarray()); foreach (var item in scores) { (int = 0; < item.value.length; ++) { console.writeline("key = {0}, value = {1}", item.key, item.value[i]); } } this code outputs: key = al, value = -3 key = al, value = -2.09691001300806 key = al, value = -infinity key = al, value = -1.19382002

c# - Dynamically fill a <td> with a control asp.net -

i got table: *formmaster x wide* <table> <tr> <td> <asp:label runat="server" id="lb_seq_header" text="sequence header: "/> </td> <td> <asp:textbox runat="server" id="tb_seq_header"/> </td> </tr> <tr> <td> <asp:label runat="server" id="lb_asm_instr" text="sequence instructions: "/> </td> <td> <asp:textbox runat="server" id="tb_asm_instr" textmode="multiline" rows="15" style="resize:none"/> </td> </tr> </table> how stretch textbox in td fill rest of body of formmaster

c++11 - What does "[&]" mean in C++? -

i reading source code , contains following lines. auto updateslack = [&](const char slack_type, const double s) { if (slack_type == 'e') { wns.early_slack = min(s, wns.early_slack); tns.early_slack += s; } else if (slack_type == 'l') { wns.late_slack = min(s, wns.late_slack); tns.late_slack += s; } }; i confused "[&]" symbol after "=" operator. can tell suggests? this statement uses lambda expression. auto updateslack = [&](const char slack_type, const double s) { if (slack_type == 'e') { wns.early_slack = min(s, wns.early_slack); tns.early_slack += s; } else if (slack_type == 'l') { wns.late_slack = min(s, wns.late_slack); tns.late_slack += s; } }; the compiler 2 things. first 1 compiler defines unnamed class contain function call operator corresponds body of lambda expression. the second 1 compiler creat