Posts

Showing posts from June, 2015

uitableview - iOS Swift How to change or update UILabel attribute in custom UITableViewCell -

i want update/change uilabel attribute (background color,background shape,etc...) dynamically when data web service. i want dispaly label in difference type different lable text, update uilabel attribute according testdata got web server. : if testdata=[1,1,1,1] uilabel background color red , testdata=[2,2,2,2] uilabel background color blue.etc i doing following: in main.stroyboard: i add tableview , tableviewcell (choice custom) associated uitableviewcell named tvcell , add uilabel component. in tvcell import uikit class tvcell: uitableviewcell { @iboutlet weak var testlabel: uilabel! var testdata:testdatainfo?{ didset{ updateui() } } private func updateui(){ if let mfildata=testdata{ setstauteslabel() } } private func setstauteslabel(){ self.testlabel=uilabel(frame: cgrect(x: 50, y: 50, width: 100, height: 35)) self.testlabel.text = "thistestlabel" ...

php - Including external javascript in shopify page from the app installed using shopify api -

i new shopify , created 1 shopify development account, created 1 app. have provided option each user install app using shopify shop name. how can include 1 of javascript file(customized in app) in shopify page? want load javascript file in shopify page (this js file loading 1 popup subscription). there shopify api loading specific js file app shop page? i used following link reference, https://github.com/cmcdonaldca/ohshopify.php you can use scripttag resource: https://help.shopify.com/api/reference/scripttag this shopify website: if need add storefront use javascript. don't edit theme's files. add javascript using scripttag resource. when app uninstalled, javascript no longer used shop automatically, , beauty of using scripttag resource. merchant won't need edit theme bring way before app's installation.

javascript - mysql ajax table editor doesnt find primarycolvalue -

i using previous version of mysqlajaxtableeditor had upgrade new one, downloaded new mysqlajaxtableeditor there bug in it. need value of first column in javascript function when click on row, value isn't passed. does know should make work? or have alternative solution? this relevant part of code in initiateeditor function $tablename = 'tblklant'; $primarycol = 'idtblklant'; $errorfun = array(&$this,'logerror'); $permissions = $rights; $this->editor = new ajaxtableeditor($tablename,$primarycol,$errorfun,$permissions,$tablecolumns); $this->editor->setconfig('tableinfo','cellpadding="1" width="1200" class="matetable"'); $this->editor->setconfig('tabletitle','klanten'); $this->editor->setconfig('addrowtitle','klant toevoegen'); $this->editor->setconfig('editrowtitle','klant bewerken'); $this->editor->setconfig('paginat...

Call constructor of cls object in Python -

i trying call constructor of class object in python. managed work using following few lines: obj = cls.__new__(cls) n = (list of attribute names) v = (list of attribute values) s in n: setattr(obj, s, v[s]) i wondering if there way directly insert attribute value + name pairs constructor, cause arguments ignored if call following: obj = cls.__new__(cls, v) p.s.: using python3 the class looks similar this: class inheritingclass(baseclass): def __init__(self, basic_attribute, another_attribute=none): super().__init__(basic_attribute=basic_attribute) self.another_attribute= another_attribute class baseclass: def __init__(self, basic_attribute=1): self.basic_attribute= basic_attribute so nothing special there __init__ constructor of python class instead of __new__ . refer pythons use of new , init more information.

visual c++ - VS 2015 C++ compilation failed on "CodeTaskFactory load" -

i got strange error: c:\program files (x86)\msbuild\microsoft\visualstudio\v14.0\codeanalysis\microsoft.codeanalysis.targets(219,5): error msb4175: task factory "codetaskfactory" not loaded assembly "c:\program files (x86)\msbuild\14.0\bin\microsoft.build.tasks.core.dll". timed out waiting program execute. command being executed "c:\windows\microsoft.net\framework\v4.0.30319\csc.exe" /noconfig /fullpaths @"e:\buildagent\temp\buildtmp\dxr3ks1s.cmdline". i disabled code analysis: <runcodeanalysis>false</runcodeanalysis> <runcodeanalysisonthisproject>false</runcodeanalysisonthisproject> but see same error :(

android - What does this logcat line means? -

my app runs expected, except when select last option on navigation drawer. error i/process: sending signal. pid: 2062 sig: 9 ... , app crashes. help? when use code , when crash happen: binddictionary<listarecompensas> dictionary = new binddictionary<>(); dictionary.addstringfield(r.id.lrnivel, new stringextractor<listarecompensas>() { @override public string getstringvalue(listarecompensas listarecompensas, int position) { return listarecompensas.getname(); } }); dictionary.addstringfield(r.id.lrqty, new stringextractor<listarecompensas>() { @override public string getstringvalue(listarecompensas listarecompensas, int position) { return "" + listarecompensas.getqty(); } }); dictionary.addstringfield(r.id.lrexp, new stringextractor<listarecompensas>() { @override public string getstringvalue(listarecompensas listarecompensas, ...

php - Symfony returning error : some parameters are missing. Please provide them -

Image
i'm trying install symfony on wamp server, i'm installing through composer. tried below command in cmd $ composer create-project symfony/framework-standard-edition sym2 above command installing symfony latest version on wamp in end returning error or request edit something. creating "app/config/parameters.yml" file` i attached cmd screen shot reference, can on guide me how can solve issue. have update composer phar before installing symfony. it's not bug (error), it's feature. there's no error, information. cmd waits provide values these missing parameters. right here in command line, not directly parameters.yml file. currently on screen it's waiting provide database_host or press enter apply default value shown in brackets ( 127.0.0.1 ). this interactive management of parameters.yml file

cocoapods - Alamofire 4.0.0 erorr in Xcode 8 Beta 6 -

i'm using xcode 8 beta 6 swift 3 , installing alamofire 4.0.0 beta 1 cocoapods using code pod 'alamofire', :git => 'https://github.com/alamofire/alamofire.git', :branch => 'swift3' after installing, open xcworkspace file erorr , xcode ask converting code swift 2.2 3. set platform target ios 9.0 it's still not works. can help? thanks

java.lang.reflect.ArtMethod objects are leaked in the memory in Android -

Image
i got when checking memory leak leakcanary, there no info on it: and when tried make dump in android studio memory monitor, found this: could please give hint on "*.artmethod" class is? just update have solved problem. found is, if use publisheradview load adrequest, memory leak happens. then tried use applicationcontext context used when constructing publisheradview (it using activity context before), memory leak disappears. by way, have tried things following: adviewscontainer.removeallviews(); adview.setadlistener(null); adview.ondestroy(); adview = null; but memory leak still there when using activity context.

Delphi iOS IPv6 App Store Rejection -

we using rad studio 10.0 seattle build ios app gets data via web services. since apple requires apps support ipv6 1 jun 2016, our app update has been rejected. we using wsdl importer create web service class in rad studio , call web services. when app connects ipv6 network, throws socket error #51 network unreachable... . does know how fix issue? try func: function gethost(host: string): boolean; begin result := ''; try gstack.resolvehost(host, tidipversion.id_ipv6); result := '[' + host + ']'; except gstack.resolvehost(host, tidipversion.id_ipv4); result := host; end; end; add in uses "idstack" , "idglobal" you must pass host (www.google.com example) , func return result or without '['. now, must use it... 'http://' + gethost('www.google.com') if in ipv6 network final string ( http://[www.google.com] )

Uploading Build to Heroku too slow -

took long upload build, free plan affects uploading performance? uploading xxxxxxx.war -----> packaging application... - app: xxxxxx - including: webapp-runner.jar - including: target/xxxxxxx.war -----> creating build... - file: slug.tgz - size: 28mb -----> uploading build...

youtube api - 403 Forbidden when playing Google Drive mp4 url -

i have problem. put avi files on google drive, , encoded url api https://docs.google.com/get_video_info . example: https://docs.google.com/get_video_info?authuser=&docid=0b38hroqwzjhaaghxy05evgtseek&access_token=ya29.cjbia-lf_6wfvdrsqogxgbvgize7eeojipycflay8vpfpevxqe1psaof3gk1tfauafc then url encoded mp4 video file previous response, like: https://r5---sn-un57en7e.c.docs.google.com/videoplayback?requiressl=yes&id=a63c37855c89aa75&itag=18&source=webdrive&ttl=transient&app=explorer&ip=211.72.69.111&ipbits=0&expire=1471969935&cp=qvjmu0pfwflrrlhnokj0ymtfem5ongd0&sparams=requiressl,id,itag,source,ttl,ip,ipbits,expire,cp&signature=1015317ad77b0a23c3d8c216d83c0d0be6b96725.9d5ed9740e885b0fcacbdbf19257db4030dc1432&key=ck2&mm=30&mn=sn-un57en7e&ms=nxu&mt=1471954897&mv=u&nh=igpwcjaxlnrzytaxkgkxmjcumc4wlje&pl=24&sc=yes paste url vlc or firefox, none of them can play it. firefox tell me "403 forb...

non linear regression - R Error: parameters without starting value -

non linear real world data, n=2,600 sample x values 71.33 74.98 80 85.35 90.03 y values 119.17 107.73 99.72 75 54.59 i manually graphed formula starting point, formula: y = b/x^2+a manual: y = 800000/x^2-39.5 sum of residuals = 185 correlation forecast actual =0.79 using nls formula in r, error message: a_start = -39.5 b_start = 800000 m<-nls(y~b/(x^2)+a, start=list(a=a_start,b=b_start)) error in nls(y~ b/(x^2) + a, start = list(a = a_start, b = b_start)) : parameters without starting value in 'data': y, x not sure missing here. i can reproduce error. nls function missing argument data in it. m<-nls(y ~ b/(x^2)+a, start=list(a=a_start, b=b_start)) # error in nls(y ~ b/(x^2) + a, start = list(a = a_start, b = b_start)) : # parameters without starting value in 'data': y, x now data df created , passed nls function. make sure, insulated expression in i() intended one. df <- data.frame(x = c(71.33, 7...

vb.net - Error with parsing JSON using Json.Net -

i'm using code parse json string , throws exception, error is: an unhandled exception of type 'system.invalidcastexception' occurred in myapp.exe additional information: unable cast object of type 'newtonsoft.json.linq.jproperty' type 'newtonsoft.json.linq.jobject'. i have imported json.net , same code works in different sub , parses fine. here code: dim o jobject = jobject.parse(responsecontent) dim results list(of jtoken) = o.children().tolist each item jproperty in results item.createreader() select case item.name case "response" dim batterycharge string each subitem jobject in item.values batterycharge = subitem("battery_level") messagebox.show(batterycharge) next end select next the json string looks , need fetch battery_level if tell me how include more if need great. { "response": { "charging_state"...

node.js - Best practice for distributing a nodejs command line application -

how people expect nodejs commandline application organised when distributed via npm? would expect have build it? install locally or globally? should output bin.js? need kind of alias / script run (via bin.js?). use bin field in package.json specify entrypoint javascript file cli. add #!/usr/bin/env node top of entrypoint js file. specify files need packaged app, using files field of package.json in readme, provide npm install command line consumer can use install app, example point @ github repository, or package uploaded npm registry, can create npm pack . upon installing app locally or globally, script created in path (or locally in node_modules/.bin), let command line app run conveniently.

oracle - Forcing Excel (x86) VBA code to connect to ODBC (x86) on Win7 x64 -

we run vba script through excel update siebel database, works in x86 os not in x64. files x86. the code throwing error: [4096] oracle database error has occurred. possibly database name invalid. the correct connection referenced correctly (its loaded cfg file setup actual siebel applcation, works fine) the odbc connection shown in odbcad32 applications (the x86 version not x64) through siebel can force run x86 parameter, there anyway can force excel connect x86 connection? you have use 32bit version of excel. , have 32bit drivers database. using similiar vb macro in excel , still works me. years ago, based custom excel sheet on sel2xl.xls file , , modified on it. connects odbc via dsns, , still works till date. try , test on instance, can see macro code if works.

ios - Append text to a UITextField with custom keyboard made out of buttons -

i have static numeric-keyboard made out of bunch of buttons, have 3 uitextfields , textfield1, textfield2 , textfield3 i'm inputting text using static keyboard. here code i'm using detect textfield in focus , input content of buttons. kind of works don't fact have 3 if statements , i'm not sure how prevent keyboard appearing when textfield tapped. what best way implement functionality? @ibaction func appendkey(sender: anyobject) { let digit = sender.currenttitle! if(textfield1.isfirstresponder()){ textfield1.text = textfield1.text! + digit! }else if(textfield2.isfirstresponder()){ textfield2.text = textfield2.text! + digit! }else if(textfield3.isfirstresponder()){ textfield3.text = textfield3.text! + digit! } } thanks if standard keyboard displaying custom keyboard isn't setup properly. custom keyboard should inputview of each uitextfield . if that, standard keyboard won't appear , yours inste...

python 3.x - Problems with xpath on scrapy -

i'm using scrapy create crawler. i want extract title of links found. this current part of code it's important me: <a class="cor-produto busca-titulo" title="melhorar saúde, economia de tempo e dinheiro: veja os benefícios uso da bicicleta" href="//g1.globo.com/busca/click?q=economia&amp;p=0&amp;r=1472008380299&amp;u=http%3a%2f%2fg1.globo.com%2fma%2fmaranhao%2fjmtv-2edicao%2fvideos%2fv%2fmelhorar-a-saude-economia-de-tempo-e-dinheiro-veja-os-beneficios-do-uso-da-bicicleta%2f5256064%2f&amp;t=informacional&amp;d=false&amp;f=false&amp;ss=8bcd843f636c6982&amp;o=&amp;cat=a">melhorar saúde, economia de tempo e dinheiro: veja os benefíc...</a> i want extract title , need use xpath this. have suggestion? thank you! :) the xpath be: //a/@title being sel selector instance: sel.xpath('//a/@title').extract() or maybe response object: response.xpath('//a/@title').e...

ios - Apple Enterprise Distribution Certificate Revoked -

i managed accidentally revoke enterprise distribution certificate. apps deployed using mdm. these apps have stopped working. there way these apps working again without rebuilding using new certificate , redeploying. in real mess here , take me days recover. help, suggestions, assistance rewarded. this old post thought i'd answer in case helps others. know unfortunately once certificate has been revoked have create new certificate , either edit or create distribution profile point certificate. you'll have rebuild , deploy using updated/new provisioning profile.

python - Removing every third item from list (Deleting entries at regular interval in list) -

i want remove every 3rd item list. example: list1 = list(['a','b','c','d','e','f','g','h','i','j']) after removing indexes multiple of 3 list be: ['a','b','d','e','g','h','j'] how can achieve this? you may use enumerate() : >>> x = ['a','b','c','d','e','f','g','h','i','j'] >>> [i j, in enumerate(x) if (j+1)%3] ['a', 'b', 'd', 'e', 'g', 'h', 'j'] alternatively , may create copy of list , delete values @ interval. example: >>> y = list(x) # x list mentioned in above example >>> del y[2::3] # y[2::3] = ['c', 'f', 'i'] >>> y ['a', 'b', 'd', 'e', 'g', 'h', 'j']

ruby on rails - ActionView::Template::Error: unexpected token at '{{2+2}}' -

i'm having trouble integrating js tests rails/angular application. in particular, test setup choking on 8th , final occurrence of {{handlebars}} in html file, , cant' figure out what's special occurrence. the problem error comes @ line 784 of _form.html.erb : <textarea class="figures_json col-lg-11 col-md-10 col-xs-9" readonly="readonly" name="dance[figures_json]" id="dance_figures_json"> {{2+2}}</textarea> and error this: dm@red:~/contra$ rspec ./spec/features/dances/create_spec.rb:7 run options: include {:locations=>{"./spec/features/dances/create_spec.rb"=>[7]}} f failures: 1) creating dances creates new dance non-javascript data failure/error: json.parse figures_json actionview::template::error: 784: unexpected token @ '{{2+2}}' # ./app/models/dance.rb:10:in `figures' # ./app/views/dances/_bodyshow.html.erb:6:in `_app_views_dances__bodyshow_html_e...

wordpress - Fatal error: Cannot use object of type stdClass as array in.. functions.php -

found code online , worked of sudden 1 day "fatal error: cannot use object of type stdclass array in.. functions.php" on line $count = absint( $json[0]->total_count ); function ds_post_like_count( $post_id ) { // check transient if ( ! ( $count = get_transient( 'ds_post_like_count' . $post_id ) ) ) { // setup query arguments based on post permalink $fql = "select url, "; //$fql .= "share_count, "; // total shares //$fql .= "like_count, "; // total likes //$fql .= "comment_count, "; // total comments $fql .= "total_count "; // summed total of shares, likes, , comments (fastest query) $fql .= "from link_stat url = '" . get_permalink( $post_id ) . "'"; // api call $response = wp_remote_retrieve_body( wp_remote_get( 'https://api.facebook.com/method/fql.query?format=json&query=' . urlencode( $fql ) ) ); // if error in api call...

node.js - Server-side response caching with Hapi -

i need cache idempotent requests in redis expiration time. tutorials featured on hapi's website favors catbox . the tutorial recommends using server methods retrieving data. couldn't understand point of approach. need caching response data same url. what's point of creating new wrapper function? also, i'm running server nginx reverse proxy. seems have response caching functionality, should use that, if should how i? thank you. i say, if possible nginx, , can figure out how it, use nginx. tends fast. but, harder task in nginx config files in javascript. it's hard me imagine need eek out bit of performance, redis fast. if me, use catbox redis. if understand question, point of wrapper function deal creating key store , lookup cached value, , deal expiration. if want, think this config file how nginx: http { proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=static:10m inactive=24h max_size=1g; server { location ...

python - How do I set TensorFlow RNN state when state_is_tuple=True? -

i have written rnn language model using tensorflow . model implemented rnn class. graph structure built in constructor, while rnn.train , rnn.test methods run it. i want able reset rnn state when move new document in training set, or when want run validation set during training. managing state inside training loop, passing graph via feed dictionary. in constructor define the rnn so cell = tf.nn.rnn_cell.lstmcell(hidden_units) rnn_layers = tf.nn.rnn_cell.multirnncell([cell] * layers) self.reset_state = rnn_layers.zero_state(batch_size, dtype=tf.float32) self.state = tf.placeholder(tf.float32, self.reset_state.get_shape(), "state") self.outputs, self.next_state = tf.nn.dynamic_rnn(rnn_layers, self.embedded_input, time_major=true, initial_state=self.state) the training loop looks this document in document: state = session.run(self.reset_state) x, y in document: _, state = ...

search - ElasticSearch - query documents: All given labels appear at least one time in a nested document -

consider few indexed documents ( employees ) containing nested documents ( skills ) 1 property, let's " label ", each employee associated few skills. fetch employees (documents) elasticsearch index, master given set of skills, example " python " , " java ". i struggling find suitable query ensure all given skills ("python", "java") appear at least once in set of skills of employee, although do not have appear together! my mapping similar one: { "mappings": { "employee": { "_all": { "enabled": false }, "properties": { "id" : { "type": "integer" }, "first_name" : { "type": "string" }, "last_name" : { "type": "string" }, "skills": { "type": "nested", "properties": { ...

Error installing Pandas on Python 3.6 -

i using python 3.6 on windows 10. when try install pandas, error: command "python setup.py egg_info" failed error code 1 can me fix please ? step 1 :install pip step 2 : go terminal , enter pip install pandas

c# - How to change Game_Data folder in unity for windows -

i have unity project windows platform in unity , want change data folder name, example: if make project , name " thegame " after building, have: d:\\...\\thegame\\thegame.exe d:\\...\\thegame\\thegame_data\\ and how can rename " thegame_data " else? i tested , renamed folder data in caps. game still ran fine me. unity version 5.3.5f1. although, can't find page talks changing folders name should check link out. https://docs.unity3d.com/scriptreference/application-datapath.html i found trying change name data here: http://answers.unity3d.com/questions/321932/renaming-the-data-folder.html the problem here though after rebuilding game, folder gamename_data show again. since application.datapath read only, think stuck renaming folder after every build , deleting old renamed folder. hope helps.

Spark 1.5.2: NaN while calculating stddev -

i getting nan while calculating standard deviation (stddev). simple use case described below: val df = seq(("1",19603176695l),("2", 26438904194l),("3",29640527990l),("4",21034972928l),("5", 23975l)).todf("v","data") i have stddev defined udf: def stddev(col: column) = { sqrt(mean(col*col) - mean(col)*mean(col)) } i'm getting nan when call udf shown below: df.agg(stddev(col("data")).as("stddev")).show() it produces following: +------+ |stddev| +------+ | nan| +------+ what doing wrong? given data, both mean(col*col) , mean(col)*mean(col) larger maximum value of long . can try casting input columns double first: df.agg(stddev(col("data").cast("double")).as("stddev")) but in general won't particularly stable on large numbers.

c# - Bulk Update stored procedure with user input (WITHOUT A DATATABLE) -

can perform bulk update using stored procedure sends data temp table user input not in datatable. if have foreach loop takes user input such values checkboxlist , text boxes want know how parameterize separate values in stored procedure or if can in code. cannot use table-valued parameters since i'm using version of sql not support it. conn.open(); foreach(listitem item in checkboxlist1.items) { if(item.selected) { //handling parameters in loop. cmd.commandtype = commandtype.storedprocedure; cmd.commandtext = "update_account_table"; cmd.parameters["@seqnum"].value = amount.text; cmd.parameters["@seqdate"].value = datetime.parseexact(datepicker.text, "mmddyyyy", cultureinfo.invariantculture); cmd.parameters["@account_id"].checkboxlist1.selectedvalue; cmd.executenonquery(); } conn.close(); } stored procedure create table temptable ( seqnum i...

jquery - Insert contents of a .SVG file into an HTML element -

i have svg element in file my_ui_element.svg . want insert svg html element in index.html . how can this? html before insert: <div class="container"> <!-- insert svg here --> </div> html after insert: <div class="container"> <svg>...</svg> </div> note: using <img src="my_ui_element.svg"> not acceptable answer since not add svg element dom. this turned out trivial. svg file valid html. here jquery answer: $('.container').load('my_ui_element.svg');

Output sorted text file from Google Cloud Dataflow -

i have pcollection<string> in google cloud dataflow , i'm outputting text files via textio.write.to : pcollection<string> lines = ...; lines.apply(textio.write.to("gs://bucket/output.txt")); currently lines of each shard of output in random order. is possible dataflow output lines in sorted order? this not directly supported dataflow. for bounded pcollection , if shard input finely enough, can write sorted files sink implementation sorts each shard. may want refer textsink implementation basic outline.

xmi - How to "flow" tagged values in Enterprise Architect from one instance to another -

my questions bringing concept reality through technical availability of ea. i looking way connect instances @ object diagram through can transfer tagged values. let me explain background of project. purpose first have stereotypes specific roles in system, such "calculation", "transmission", "decision", "qualification", "abstraction" etc. each of these stereotypes have specific tagged values suitable purpose. then creating instances these stereotypes, eg. "motortorque:calculation" , "limitedtorque:abstraction" each of these instances have common tagged value, "criticality", boolean , want tagged value progress "motortorque:calculation" "limitedtorque:abstraction" through output port > sort of flow > input port kind of way. questions are: 1- approach technically achievable in ea? if correct way it? 2- purpose have "connection" readable in xmi export of d...

unity3d - Need Help regading Unity CN Controls Joystick -

i learning unity 2d games though video tutorials. video tutorial following has used older version of "cn controls joystick" ( https://www.assetstore.unity3d.com/en/#!/content/15233 ). current version of "cn controls joystick" different older version used in tutorial. so, have older version of "cn controls joystick". if have, please share me practice. thanks the older version not necesary, have know axis names of every joystick, think easier, , recomend open example scene, , scripts atached player... if need more help, can you. tell me want done , ill show how it.

android - Check that wifi direct is connected -

i need check phone connected wifi direct phone play, developed on framework of andengine. protected boolean conectadowifi(){ wifip2pmanager connectivity=(wifip2pmanager)activity.getsystemservice(context.wifi_p2p_service); final wifip2pmanager.channel channel = connectivity.initialize(activity, activity.getmainlooper(), new wifip2pmanager.channellistener() { @override public void onchanneldisconnected() { } }); connectivity.discoverpeers(channel, new wifip2pmanager.actionlistener() { @override public void onsuccess() { if (wifip2pmanager.wifi_p2p_state_enabled == 2) { // wifi direct mode enabled system.out.println("-----------wifi direct on-"); } if (wifip2pmanager.wifi_p2p_state_disabled==1){ system.out.println("-----------wifi direct off-"); } } @override public void onfailure(int i)...

c++ - Type conversion for std::strings -

is possible have global type conversion operator functions class? looking way expose const char* std::string . tried defining global operator doesn't compile. quick search , looking @ cpp reference these user defined conversion needs member http://en.cppreference.com/w/cpp/language/cast_operator . is there kind of clean (or hacks) way of passing std::string methods accepts const char* without using c_str() . background: i working on cross platform , windows. of classes uses atl::cstring . , changing them use std::string 's. invoking c_str fine, in unit test code there seem of call every line , every args, trying lazy here. just user-defined types can define own constructors, user-defined types can define whether implicitly convertible other types (or other types via non- explicit constructors). no, cannot force implicit conversion std::string const char* outside class.

java - How to catch passed data (between two fragments) at the right time? -

this might long one: i have 2 fragments, 1 includes google maps , other 1 ordinary fragment (called infofragment) filled textviews. on textview want next: 1. change infofragment map fragment (via tabs) 2. send textview id map fragment 3. zoom on marker same id (markers stored in hashmap) i implemented onclicklistener (in infofragment): linlayout.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { toast.maketext(getcontext(), "clicked" + id, toast.length_long).show(); tablayout tablayout = (tablayout) getactivity().findviewbyid(r.id.sliding_tabs); tablayout.gettabat(0).select(); } }); and working great, tabs switched , right id stored in variable. now, want send id map fragment, check hashmap, chose marker same id , zoom on it. know how zoom on it, not know how catch data? if use singleton class (which store id), in map fragment should catch data? edit: if call method zoom...

c# - Specflow+ Runner Error - Unable to find asseembly -

i decided use specrunner execute specflow/selenium tests. before change, test executed fine. change receive following error: system.reflection.reflectiontypeloadexception: unable load 1 or more of requested types. retrieve loaderexceptions property more information. we use page-object model in our selenium tests in pass name of page in step , code fetches appropriate .cs file test functions relates webpage. here function: protected static ienumerable<type> pages { { return _pages ?? (_pages = appdomain.currentdomain.getassemblies().selectmany(a => a.gettypes()).where( t => typeof(ipage).isassignablefrom(t)).tolist()); } } protected static type getpagetype(string page) { var pagetype = pages.where(p => p.name.equals(page, stringcomparison.invariantcultureignorecase)).firstordefault(); return pagetype; } we want implement parallel execution within our test suite. appreciated....

php - "Elasticsearch" search documents before index refresh -

i writing php application stores data in elasticsearch . want able search latest indexed data elasticsearch in realtime ( without index refresh time barrier ). how achieve such functionality? note : following never helped achieve real timeness $client->indices()->refresh(); nor 'refresh' => true -- elasticsearch v2.3 -- i using official php elasticsearch driver you can set refresh interval index using following query. . .but while indexing documents in bulk value changed -1, means never refresh , refresh manually. because low refresh rate may result in performance hits on indexing rate. go through following link more details https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html#bulk ` curl -xput localhost:9200/test/_settings -d '{ "index" : { "refresh_interval" : "1s" } }' `

Munin: Graphs for Processes priority are empty -

i have new ubuntu server (ubuntu 16.04.1 lts, server version without gui, running virtual server in remote server farm), , installed munin on (munin , munin-node). did not change standard installation, @ moment use 30 plugins part of standard installation. 28 of them worked fine beginning. the plugin "http load time of page" showed empty graph, found out package time missing. installed with apt install time and restarted munin-node. plugin fixed. but there still problem »processes priority« (plugin »proc_pri«). graphs of plugin (by day, week, ...) empty, , have idea start search reason of problem. please can give me hints fix problem? or isolate problem. check output of ps -eo stat command. munin plugin proc_pri simple shell script process output of ps , may fail after output format changing. upd: count lines symbols ">", "n" , "l" in ps -eo stat command output. therefore if command dont show full list of processes...

excel - How to combine multiple columns which may or may not contain the same information in spreadsheet? -

Image
okay, don't know how word show want do. | | | b | | c | | | bob | 1 | john | 4 | bob | 7 | | john | 3 | sally | 2 | john | 3 | | sally | 7 | | | sally | 3 | | chris | 3 | | | hana | 9 | | | | | | ruth | 6 | and want combine them names, making this... | | | b | c | | bob | 1 | 4 | 7 | | john | 3 | | 3 | | sally | 7 | 2 | 3 | | hana | | | 9 | | ruth | | | 6 | | chris | 3 | | | what easiest way this? have access openoffice calc, microsoft excel, , google spreadsheet. thank in advance. since don't want cut , paste, assume either: a) large volume of data, or b) you'll have often, or both. knowing me. in cases, first create single name list, copying location each column below other, using remove duplicates. 2) create 2 tables this: with these formulas copied down: i2: =vlookup(h2,$a$2:$b$7,2,false) j2: =vlookup(h2,$c$2:$d$7,2,false) k2: =vlookup(h2,$e$2:$f$7,...

asynchronous - C# Cancel Task with started List<> -

i started task lists , await task.whenall private async void btn_download_click(object sender, eventargs e) { . . . await downloadmultiplefilesasync(old_json); console.writeline("download completed."); } and that's code starting task list. private async task downloadmultiplefilesasync(list<media> doclist) { var token = canceltokensource.token; await task.whenall(doclist.select(doc => downloadfileasync(doc))); btn_download.enabled = true; } and download method private async task downloadfileasync(media media) { . . . console.writeline(media.no + media_ext + " started."); webclient.credentials = system.net.credentialcache.defaultnetworkcredentials; await webclient.downloadfiletaskasync(new uri(media.url), @downloadtodirectory); console.writeline(media.no + media_ext + " finished."); . . . } the output window thi...

swift - Displaying the speed the device is travelling at using CLLocationSpeed -

i able display speed device travelling @ in simple label. i have found on apples website: var speed: cllocationspeed { } source the code above puts speed in m/s , can therefore convert miles per hour etc. how can use code display speed? i know can done because snapchat has filter. i found here on @leo swift: exception while trying print cllocationspeed "unexpectedly found nil while unwrapping optional value" : import uikit import corelocation class viewcontroller: uiviewcontroller, cllocationmanagerdelegate { let locationmanager = cllocationmanager() override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. locationmanager.delegate = self if nsstring(string:uidevice.currentdevice().systemversion).doublevalue > 8 { locationmanager.requestalwaysauthorization() } locationmanager.desiredaccuracy=kcllocationaccuracybest } func locationmanager(manager: cllocation...

angularjs - Why angular-cli do not generate a shared folder when creating a component? -

Image
i using angular-cli, suppose create component sub folder called shared index.ts, not seeing that. this taken out addition of ngmodule of rc5. need nest components inside of shared directories against pattern of declaring them within given module.

python - Numpy "where" with multiple conditions -

i try add new column "energy_class" dataframe "df_energy" contains string "high" if "consumption_energy" value > 400, "medium" if "consumption_energy" value between 200 , 400, , "low" if "consumption_energy" value under 200. try use np.where numpy, see numpy.where(condition[, x, y]) treat 2 condition not 3 in case. any idea me please? thank in advance you can use ternary : np.where(consumption_energy > 400, 'high', (np.where(consumption_energy < 200, 'low', 'medium)))

angular - Can't make @ngrx/store works properly -

i have angular 2 app works. i'm trying add @ngrx/store app seem can't make work. here have far : product.component.ts import {component, input, changedetectionstrategy} "@angular/core"; import {productservice} "../index"; declare const module; @component({ selector: 'products', moduleid: module.id, providers: [productservice], templateurl: '_products.component.html', styleurls: ['_products.component.css'], changedetection: changedetectionstrategy.onpush }) export class _productscomponent { products; constructor(private productservice: productservice) { this.products = this.productservice.products$; this.productservice.loadproducts(); } } product.reducer.ts import {actionreducer, action} '@ngrx/store'; import {product} "./index"; export const products: actionreducer<product> = (state: = {}, action:action...

tableau - LOD (Level Of Detail) where Year = -

trying write calculation in tableau allows me fix level of detail on category year equal designated date. imagine looks like {fixed [report category] : avg(dollars paid)} year = 2015 you have couple of options. 1) add year dimension lod calculation , add year filter card , set '2015'. calculation this: since have no year , need create calculated field reference it. "year" : year(apcd paid accnts date) { fixed [report category], [year]: avg(dollars paid) } 2) can restrict aggregation specific year in calculation, so: { fixed [report category]: avg(if year([apcd paid accnts date]) = 2015 dollars paid end) } -- edit -- updated above because stated using date not number of year.

Generate sql server script that will only include certain objects? -

our database has tons of tables, there few tables & stored procedures need backed-up on weekly basis. to backup, right-click db, click generate scripts , , select objects want up. change script drop true , script data true , , few other changes. begin selecting tables , sps, , generate script. is there way automate this? way don't have change options or select same tables every time. not want (and cannot) backup database. i saw this link asking command-prompt version, not want mess vb or other 3rd-party language automate this. we use sql server 2008. thanks. i'm not dba, perhaps wise put few tables different filegroup , have weekly job filegroup up? read here how backup specific filegroup: sql server filegroup backups as stored procedures , other objects. use database versioning tool, such git, svn, tfs or else version objects. this question covers details how version db code using git: how use git source control provider sql server managemen...

sql - Unsure why this query is inserting duplicate records -

i have table customers has pk customerid , 2 date fields transdate , updateddate . i have table paymentplan has 3 date fields: startdate , enddate , updateddate . i need find customer records meet following criteria , insert them table. transdate not null , falls between 1 paymentplan record's startdate , enddate . transdate null , updatedon falls between 1 paymentplan record's startdate , enddate . regardless of whether or not transdate null , updatedon value of customers must older updatedon of paymentplan . the problem i'm having query returning duplicate customerid values. this procedure: create procedure usp_find_customers_for_recalc @adaysback int begin set nocount on; set @adaysback = @adaysback * -1; -- since we're looking "back" in time, want negative value of number passed procedure insert recalc (customerid, insertedon, recordstatus, processedon) select customerid, getdate() insertedon, 0 ...

ruby on rails - Convert mp3 to flac files -

i'm trying find way of converting mp3 flac files using ruby (preferably) server-side. have horde of audio transcribe using google speech api accepts flac. (among other things). can find flac2mp3 convertor work on laptop, went through code , unfortunately seems calling system command requires having codecs installed locally. . is there api maybe me? or easy way install codecs , run sort of command on heroku. @orde linked exiting question recommends following: ffmpeg -i input.mp3 output.flac this not ruby command, system command (i.e. unix or windows) to call system command ruby, can use backticks or system . for example, after you've installed ffmpeg system def convert_mp3_to_flac(mp3_path) flac_path = mp3_path.gsub(".mp3", ".flac") system("ffmpeg -i #{mp3_path} #{flac_path}") end

r - Aggregate entries in table by subset of column id characters -

i working on gene expression dataset using r. new coding please forgive me if not describe problem in adequate detail. my dataset looks looks this: geneid sample1 sample2 slc26a5-001 7 8 slc26a5-002 1 2 homer2-001 6 5 slc26a5-200 8 10 the gene name first part of id (slc26a5) , transcript number denoted (-001). need find way collapse of different transcript ids , sum respective rows @ same time. output following: geneid sample1 sample2 slc26a5 16 20 homer2 6 5 the aggregate function should work summing rows based on gene id. stuck because can not figure out how refer gene id's first part of name inside of aggregate function. does know how this? thanks help! the main thing remove tail part of geneid column standardize grouping. done below sub() . it's pretty standard aggregation. aggregate() , following it. aggregate(df[...

android - My app looks different scale when i change phone -

i've created android application. app complete it's problem: when install app in other smartphone, objects,that in screen, overlapping or not in original position. ide android studio 2.2 <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" > <pl.pawelkleczkowski.customgauge.customgauge android:id="@+id/gaugeph" android:layout_width="180dp" android:layout_height="180dp" android:paddingbottom="5dp" android:paddingleft="5dp" android:paddingright="5dp" android:paddingtop="5dp" app:gaugepointstartcolor="@color/md_red_900" app:gaugepointendcolor="@color/md_red_900" app:gaugepointsize="5" ...