Posts

Showing posts from January, 2010

java - How do I move two parallel arrays from one method to another, by returning to the main method then entering the second one? -

i need both string , double arrays go inputaccept table: inputaccept(); table(names, costs); public static void inputaccept() { scanner scan = new scanner(system.in); string[] names = {"","","","","","","","","",""}; double[] costs = new double[10]; (int = 0; < 10; i++) { system.out.println("enter name of item " + (i + 1) + ": "); names[i] = scan.nextline(); system.out.println("enter item cost: "); costs[i] = scan.nextdouble(); } } public static void table(string[] names, double[] costs) { //insert code using arrays } i know wrong, don't know fix it. you can create 2 arrays in main method, first pass them inputaccept method, pass 2 arrays table method: public static

osx - Use C++ as Model Layer in Cocoa application -

i have existing framework command line application built c++, want use model layer particular button in cocoa application. gui application in cocoa , constructed, @ moment buttons don't interact exclusively gui nothing result. have been using swift 4 days , find far convoluted , poorly designed. likewise objective-c makes little sense me. the majority of programs have written in c++ rely entirely on if / and / else checks , reading/writing files via fstream . has worked me, have never needed more achieve want each program do, , have been able make complex jobs entirely automated using simple goto statement (yes know people find them bad practice, have had few issues them , job done). achieve same results in obj-c or swift seems unconditionally require gross amount of excess code. 1 of programs goes 56 lines entire source in c++ on 150 lines 1/5th of total source when rewritting in swift, , couldn't work in obj-c. all need gui run automated c++ executable in background

php - yii2: How to load relative path,action,view ... in module -

i'm start working yii2. ------------- problem number 1: load view error ----------------- have site module sitecontroller , it's views. actionindex(){ $this->render('index'); } it show error: view root_path/views/site/index.php not found (note: root_path driectory in local). in init() function in root_path\modules\site\module.php file: added statement test: echo $this->getviewpath(); result: root_path\modules\site\views i want ask : why not load index.php in /modules/site/views folder ??? (it load index.php in root_path\views folder not found view file) ------------- problem number 2: load action error -------------- when add root_path\modules\site\module.php file: yii::$app->setlayoutpath($this->getlayoutpath()); can load correct view actionindex. links view not working: $menuitems = [ ['label' => 'about', 'url' => ['/site/about']] ] html generaated on front-end: <a hr

xml - Android TextView Right Side -

Image
i trying set imageview in left side , text view right side in linearlayout. not able set textview end of linearlayout. how can ? i want name on end of linearlayout in line of imageview. my xml below. <linearlayout android:layout_gravity="center_horizontal" android:layout_marginbottom="12dp" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1"> <imageview android:id="@+id/action_qod_save" android:src="@android:drawable/ic_menu_save" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <textview andro

c - fread() returns incorrect data -

i trying read 128kb binary file in chunks of 256 bytes. first 20-40 bytes of 256 bytes seems correct. after data gets corrupted. tried reading file , writing binary file , compared. more half of data corrupted. here code uint8_t buffer[256] read_bin_file = fopen("vtest.bin", "r"); if (read_bin_file == null) { printf("unable open file\n"); return false; } test_bin = fopen("test_file.bin", "w"); if (test_file == null) { printf("unable open file\n"); return false; } fflush(stdout); (i = 0; <=0x1ff; i++) { file_read_pointer = * 256; fseek(read_bin_file, file_read_pointer, seek_set); fread(buffer, 256, 1, read_bin_file); fseek(test_file, file_read_pointer, seek_set); fwrite(buffer, 256, 1, test_file); } what missing? when try increase bytes read 256 1024 ( i<0x7f) error seems decrease significantly. file 90% matching if binary data you're reading , writing, should o

firebase - How can I add button on notification FCM Android -

Image
how add button on notification fcm , how add click event on buttons. need 2 buttons on notification how add click event on button on notification fcm android image dismiss , answer public class myfirebasemessagingservice extends firebasemessagingservice { private static final string tag = "fcm service"; @override public void onmessagereceived(remotemessage remotemessage) { // todo: handle fcm messages here. log.d(tag, "from: " + remotemessage.getfrom()); log.d(tag, "notification message body: " + remotemessage.getnotification().getbody()); createnotification(remotemessage.getnotification().getbody()); } private void createnotification( string messagebody) { intent intent = new intent( , resultactivity. class ); intent.addflags(intent.flag_activity_clear_top); pendingintent resultintent = pendingintent.getactivity( , 0, intent, pendingintent.flag_one_shot); in

ios - MPSCNN Weight Ordering -

the metal performance shader framework provides support building own convolutional neural nets. when creating instance mspcnnconvolution requires 4d weight tensor init parameter represented 1d float pointer. init(device: mtldevice, convolutiondescriptor: mpscnnconvolutiondescriptor, kernelweights: unsafepointer<float>, biasterms: unsafepointer<float>?, flags: mpscnnconvolutionflags) the documentation has 4d tensor the layout of filter weight arranged can reinterpreted 4d tensor (array) weight[outputchannels][kernelheight][kernelwidth][inputchannels/groups] unfortunately information doesn't tell me how arrange 4d array 1 dimensional float pointer. i tried ordering weights bnns counterpart requires it, without luck. how represent 4d tensor (array) 1d float pointer (array)? ps: tried arranging c array , getting pointer flat array, didn't work. update @rhythmicfistman: that's how stored in plain array, can convert usafepoin

javascript - How to use data-manual in prism.js -

i'm using prism.js syntax highlighter website, want items not te rendered, operators , punctuation. now, manual of prism.js states: if want prevent elements being automatically highlighted, can use attribute data-manual on element used prism , use api. example: <script src="prism.js" data-manual></script> but that's it. no further examples. link api shows javascript functions, nothing further on data-manual . als if google site:prismjs.com "data-manual" , no helpful occurances show up. can me on how illusive data-manual -attribute needs used? i didn't understand how use data-manual documentation--i had @ source. use 'data-manual' when want directly call prism's api adding syntax highlighting. checkout api reference . if don't set data-manual, prism set timeout or listener call highlightall (here relevant source ). highlight every element matched following selector: 'code[class*="lang

android - How write a new line in file using PhoneGap? -

i can write file , append content, can't create new lines. example: need put 1 number per line 31/08/2016 00:01,0 31/08/2016 00:02,4 31/08/2016 00:03,0 31/08/2016 00:04,8 31/08/2016 00:05,0 31/08/2016 00:06,0 i try use \n , \r (before , after of line) return not work, content write in 1 line. i'm using plugin cordova-plugin-file write files, function writefile them, how new line?

sql server - How to convert DateTime to VarChar with specific format, without using string functions? -

this question has answer here: how format datetime m/d/yyyy in sql server? 3 answers i wanna convert datetime varchar. it seams dublicated question but wait minute. the next link awesome: how convert datetime varchar but not effect question. my output neer format 101 convert(varchar(10), [mydatetimecolumn], 101) output: 04/21/2000 i wanna output without 0 in month requested output 4/21/2000 is applicable, without using string function (like substring, replace, ... etc) ? updated requested code should runnable on sqlserver2005 , sqlserver2012 & sybase if using sql 2012 or higher can achieve using format function native sql. format(yourdate, 'm/dd/yyyy')

android - permissions are gone when app is removed from background -

i asking permissions on android app on runtime on marshmallow , above devices. permissions granted killed app (remove background not force stop)the permissions gone , asks permissions again when again open app. boolean granted=checkpermission(); log.d("permission there","---"+granted );// returns false if (build.version.sdk_int >= 23) { system.out.println("build version is"+build.version.sdk_int); if(!granted){ requestpermission(); } } private void requestpermission() { activitycompat.requestpermissions(activity,new string[]{ manifest.permission.access_fine_location, manifest.permission.record_audio, manifest.permission.call_phone, manifest.permission.camera, manifest.permission.write_external_storage, manifest.permission.read_contacts, manifest.permission.get_accounts, },requestpermissioncode); } @ove

angular - how to do an Angular2 Master Detail with firebase -

im getting error : caused by: this.todoservice.getkidsdetails(...).subscribe not function typeerror: this.todoservice.getkidsdetails(...).subscribe not function here's routing here detailinfocomponent master detail component import { modulewithproviders } '@angular/core'; import { routes, routermodule } '@angular/router'; import { workerscomponent } './components/workers/workers.component' import { admincomponent } './components/admin/admin.component' import { kidsprofcomponent } './components/kidsprof/kidsprof.component' import { homecomponent } './components/home/home.component'; import { appcomponent } './app.component' import { contentmanagercomponent } './components/content-manager/content-manager.component' import { detailinfocomponent } './components/detailinfo/detailinfo.component' const approuts: routes = [ { path: ''

wordpress - get_query_var don't working although it's in $wp->query_vars -

i try use get_query_var new parameter "forumid". see parameter when print ($wp->query_vars), array ( [forumid] => 23 ) but get_query_var("forumid") return null add_filter( 'query_vars', 'wpse9870_query_vars' ); function wpse9870_query_vars( $query_vars ) { $query_vars[] = 'forumid'; return $query_vars; } add_action( 'parse_request', 'wpse9870_parse_request' ); function wpse9870_parse_request( &$wp ) { if ( array_key_exists( 'forumid', $wp->query_vars ) ) { echo get_query_var('forumid'); require 'wp-content/plugins/forum/2.php'; exit(); } return; } in file wp-content/plugins/forum/2.php null get_query_var('forumid') the action hook parse_request to early . read here -> action_reference the hook parse_request run's before parse_query query variables ben setted. i think should use parse_query

angularjs - Angular2 : How to communicate from parent component to child? -

i'm loading of div in between tag. bellow. here index.html <html> <script> system.import('app').catch(function(err){ console.error(err); }); </script> </head> <!-- 3. display application --> <body> <my-app>loading...</my-app> </body> </html> app.module.ts @ngmodule({ imports: [ browsermodule, formsmodule, approutingmodule ], declarations: [ appcomponent, logincomponent, homecomponent, newsfeedcomponent, topbarcomponent, sidemenucomponent ], providers : [ authgaurd ], bootstrap: [ appcomponent ] }) export class appcomponent {} home.component.ts @component({ selector: 'home', moduleid: module.id, templateurl: 'home.component.html', providers : [ loginservice ] }) export class homecomponent implements oninit{ isloggedin : boolean; constructor (private loginservice : loginservice) { } ngoninit(): void { this.

javascript - Having trouble why the split function does not work -

i trying split salesdata , want split() comma after each object. this homework.i trying store in object map , calculation there. cant past split function failing me. i have provided code below show end result profitable department is. var salesdata = [ {department : 'hardware', sales : 4500, day : 'monday'}, {department : 'outdoor', sales : 1500, day : 'monday'}, {department : 'carpentry', sales : 5500, day : 'monday'}, {department : 'hardware', sales : 7500, day : 'tuesday'}, {department : 'outdoor', sales : 2505, day : 'tuesday'}, {department : 'carpentry', sales : 1540, day : 'tuesday'}, {department : 'hardware', sales : 1500, day : 'wednesday'}, {department : 'outdoor', sales : 8507, day : 'wednesday'}, {department : 'carpentry', sales : 8009, day : 'wednesday'}, {department : 'hardware', sales : 12000, day : 'thursd

xml - scrolling toolbar is not hiding when i scroll in android -

im trying hide toolbar on scroll down , cant able find problem have used android.support:design:24.2.1 android.support:appcompat-v7:24.2.1 can find bug in code code helpful <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:context="com.mako.movietake.mainactivity"> <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/apptheme.appbaroverlay"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:l

excel - Python - XLSXWriter writes character per column -

assuming have following code snippet , ordered_list containing values appended together, 1 row of contents printed out on test in format: [text:u'lt4974', text:u'mrnameid', number:14, number:121] if didn't enclose row in str() method, different error occur. result output file writes every character per column... wrong. how correctly write in such way following contents in respective columns? col1 || col2 || col3 || col4 lt4974 || mrnameid || 14 || 121 new_workbook = xlsxwriter.workbook() sheet = new_workbook.add_worksheet('test') row_index, row in enumerate(ordered_list): #for col_index, cell_value in enumerate(row): sheet.write_row(row_index, 0, str(row)) new_workbook.save('output.xlsx') 1.) if try uncommenting for col_index, cell_value in enumerate(row) , change str(row) str(cell_value) still write per character , time not getting values falls text. 2.) if try directly give row in : sheet.write_row(r

Ruby on rails Cassandra cequel search by regex -

i trying use rails cassandra database , cequel gem. need find record in database regular expression. looks not work cassandra. model class keywordname include cequel::record key :pg_id, :text column :name, :text, :index => true end keywordname.new(name: 'some_name', pg_id: '2').save! cql (12ms) insert keyword_names (pg_id, name) values ('2', 'some_name') => #<keywordname pg_id: "2", name: "some_name"> now want find record regex query keywordname.where(name: /.*/).first cql (2ms) select * keyword_names name = '(?-mix:.*)' limit 1 => nil but request generate wrong cql query. what correct way create correct regex query cequel or create raw cql query search records regular exprations?

jquery - Cant pass php variable into ajax function -

i'm trying pass php variable ajax function (as below) dynamically change url used post request cant seem work, know i'm doing wrong? <?php $site_url = "http://www.example.com/"; ?> <script> function refresh_div() { jquery.ajax({ url: '<?php echo $site_url ?>'; datatype: 'json', type:'post', success:function(data) { jquery("#data").html(data.today_data); } }); } </script>

android - How to store a Light sensor value in an array for a long time ? 1 sample / 2sec -

i'm developing app personal project , , need process data later on on matlab (for power requirements). hence, goal "store" value of light sensor every 2 second, in array ? right now, able correctly show value of sensor in real time, displayed on screen based on default frequency of smartphone ! i'm quite novice in android, , i'm learning everyday haha ! i'm stuck there... final goal send data database , create graph of later on .. showing light intensity of place in term of time .. best storage please? best regards, private final sensoreventlistener lightsensorlistener = new sensoreventlistener() { @override public void onsensorchanged(sensorevent event) { if(event.sensor.gettype() == sensor.type_light){ textlight_reading.settext("light : " + event.values[0]); } } @override public void onaccuracychanged(sensor sensor, int accuracy) { } }; and here other part of code : textlight_available

How to fix the rounding issue in kendo grid for column. -

i using kendo grid binding string value 723086288701357234 in column rounded `723086288701357200'. thought issue because of bounding int type model column change string issue still exists. bellow grid binding. @(html.kendo().grid<assets>().name("rgdsearchtrackingdevices").htmlattributes(new { @style = "text-align:left;font-size:8pt;;width:99%;visibility:hidden;" }).columns(columns => { columns.imagecolumn("<span class='spirtgrid sprite-search' title='view' onclick=\"viewmanagedevicedetails('#=assetid#') \"></span>").filterable(false).groupable(false).sortable(false).htmlattributes(new { @style = "width:30px; text-align:center;" }).headerhtmlattributes(new { @style = "width:30px;" }).title("view"); columns.imagecolumn("<span class='spirtgrid sprite-controls' title='control' onclick=\&quo

java - Spring MVC - session and multi-thread -

reading spring mvc - session came across quote under sessions: session access may not thread-safe, in particular in servlet environment. consider setting requestmappinghandleradapter's "synchronizeonsession" flag "true" if multiple requests allowed access session concurrently. 1.where can find example on how set requestmappinghandleradapter cover multi-thread ? 2.how synchronizeonsession works exacly? thanks.

deep learning - understanding deconv layer math -

i need help. trying understand how math of deconv layer works. let's talk layer: layer { name: "decon" type: "deconvolution" bottom: "conv2" top: "decon" convolution_param { num_output: 1 kernel_size: 4 stride: 2 pad: 1 } } so layer supposed "upscale" image factor of 2. if @ learned weights, see e.g. this: -0,0629104823 -0,1560362280 -0,1512266700 -0,0636162385 -0,0635886043 +0,2607241870 +0,2634004350 -0,0603787377 -0,0718072355 +0,3858278100 +0,3168329000 -0,0817491412 -0,0811873227 -0,0312164668 -0,0321144797 -0,0388795212 so far, good. i'm trying understand how apply these weights achieve upscaling effect. need in own code because want use simple pixel shaders. looking @ caffe code, "deconvolutionlayer::forward_cpu" internally calls "backward_cpu_gemm", "gemm", followed "col2im". understanding of how works this: gemm takes input image, , multip

html - Angular2 - Is it possible to use variable string for HostListener? -

i don't think possible prefer ask (just in case): possible : @directive({ selector: '[apptag]' }) export class tagdirective { @input() apptag: tagevent; private _tagtriggerevent = 'click'; @input() set tagtriggerevent(triggerevent: string) { this._tagtriggerevent = triggerevent || this._tagtriggerevent; } constructor(private el: elementref, private renderer: renderer) { } @hostlistener(this._tagtriggerevent) ontriggerevent() { if (this.apptag) { this.sendtag(this.apptag); } } sendtag(tagparam: tagevent) { ... } } and call : <div [apptag]="mytagparam">watch click on div</div> <div [apptag]="mytagparam" [tagtriggerevent]="mouseenter">watch mouseenter on div</div> that's not supported. these decorators evaluated @ build time. you can use constructor(private renderer:renderer, private elementref:elementref) {} private tagtriggereventregistra

animation - JavaFX Marquee go out of my node -

Image
i have issue marquee animation javafx. have hbox 3 nodes , in second node have text node inside need marquee transformation, when text goes out of second node need doesn't visible. i'll go set picture show issue (the text visible in white area). my hbox code: hbox bill = new hbox(0); bill.getchildren().addall(logopane,product,total); bill.setbackground(new background(new backgroundfill(color.web("#ffffff"), cornerradii.empty, insets.empty))); bill.sethgrow(product, priority.always); animation: timelineanimation = new timeline(); final keyvalue kv = new keyvalue(productlabel.translatexproperty(), -1000); final keyframe kf = new keyframe(duration.millis(2000), kv); timelineanimation.getkeyframes().add(kf); and how define product node: productlabel.setfont(new font("times new roman",30)); product = new stackpane(); product.setmaxwidth(2000); product.setmaxheight(100); product.setminwidth(574);

php - phpMyAdmin SQL Error Unrecognized keyword near FIELDS -

i'm trying execute mysql import data csv file. select * purchase purchase.po_date >= '1-1-2016' outfile "d:\\reports\\jan.csv" fields terminated ',' enclosed '"' lines terminated '\n' but i'm receiving output static analysis: 11 errors found during analysis. unrecognized keyword. (near "fields" @ position 99) unrecognized keyword. (near "terminated" @ position 106) unrecognized keyword. (near "by" @ position 117) unexpected token. (near "','" @ position 120) unrecognized keyword. (near "enclosed" @ position 125) unrecognized keyword. (near "by" @ position 134) unexpected token. (near "'"'" @ position 137) unrecognized keyword. (near "lines" @ position 142) unrecognized keyword. (near "terminated" @ position 148) unrecognized keyword. (near "by" @ position 159

ios - Centering image with Title Label in Navigation Bar -

Image
i adding custom title label , custom image navigation bar. can correctly add title label in position want cannot center horizontally image label. adding screenshot , code use can help. -(void)addiconinnavbar { cgsize imagesize = cgsizemake(lblheight, lblheight); cgfloat marginx = (self.navigationcontroller.navigationbar.frame.size.width) - (imagesize.width / 2); cgfloat marginy = (self.navigationcontroller.navigationbar.frame.size.height / 2) - (imagesize.height / 2); imageview.frame = cgrectmake(marginx, marginy , imagesize.width, imagesize.height); [self.navigationcontroller.navigationbar addsubview:imageview]; } please update centerx as cgfloat marginx = (self.navigationcontroller.navigationbar.frame.size.width - imagesize.width) / 2; or cgfloat marginx = (self.navigationcontroller.navigationbar.frame.size.width/2) - (imagesize.width / 2);

ElasticSearch replica shard unassigned -

Image
i using elasticsearch 2.4. have configured cluster following configuration : 3 data nodes , 1 master node. i have 5 indices each primary shard 1 , replica shard 1 . still cluster health in yellow . 2 of replica shards unassigned . have enough space available. following disk space usage : since don't have enough experience elasticsearch , not able understand problem. according me should work fine because have 3 data nodes primary shard can on 1 node , secondary can on of other 2 nodes. not able understand behaviour. please explain doing wrong here , reason such behaviour , steps should take in order recover this. thank you.

java - ResteasyHandlerMapping Resource Not Found for Swagger base url -

i trying integrate swagger project api documentation. resteasy unable map swagger base url inspite of config being provided. i not sure if missing part of or not. have been doing research regarding few days , following documentation swagger integration documentation . my web.xml <context-param> <param-name>contextconfiglocation</param-name> <param-value>classpath:applicationcontext.xml</param-value> </context-param> <listener> <listener-class>org.jboss.resteasy.plugins.spring.springcontextloaderlistener</listener-class> </listener> <servlet> <servlet-name>spring</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <init-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/spring/spring-servlet.xml</param-value> </init-param> <load-on-s

c# - Why does .NET use int instead of uint in certain classes? -

i come across code uses int things .count , etc, in framework classes, instead of uint . what's reason this? uint32 not cls compliant might not available in languages target common language specification. int32 cls compliant , therefore guaranteed exist in languages.

sql - How to get Data from Monday to today's Date -

i have sample data declare @t table (id int,name varchar(10),dob date) insert @t (id,name,dob) values (1,'mohan','2016-11-13') insert @t (id,name,dob) values (6,'manasa','2016-11-10') insert @t (id,name,dob) values (2,'raj','2016-11-07') insert @t (id,name,dob) values (3,'manny','2016-10-30') insert @t (id,name,dob) values (4,'kamal','2016-11-01') insert @t (id,name,dob) values (5,'raj','2016-11-08') query : select * @t dob >= dateadd(wk, datediff(wk,0,getdate()), -1) , dob <= dateadd(wk, datediff(wk,0,getdate()), 5) here i'm unable monday today's date means 2016-11-10.i'm covering dates coming in week . i want data id name dob 6 manasa 2016-11-10 5 raj 2016-11-08 suggest me best way datename() solve problem. declare @t table (id int,name varchar(10),dob date) insert @t (id,name,dob) values (1,'mohan','2016-11-13'

azure - ARM template - depending on resources from the outside of resource group -

here's have on azure: resource group: 'microservice-1' app service: 'app-service-1' database: 'database-1' resource group: 'microservice-2' app service: 'app-service-2' database: 'database-2' resource group: 'shared-infrastructure' database: 'shared-database-1' both microservices use shared-database-1 . every microservice contain arm template script create/update resource group used when microservice deployed. in arm scripts can define dependencies (dependson) resources updated proper order work within resource group. here's scenario want run: there's nothing in azure , want release microservice-1 . there mechanism in azure / arm can use, shared-infrastructure release (arm template) run prior microservice-1 ? no, unless include in arm template. dependon check if resource there, won't magically create you. but include in template , if exists, won't anything, unless specify deploy

javascript - Is it possible to get the DOM element of a vuejs element? -

vue.js supplies variable $el return whole template dom element. possible "sub-element", in other words, dom element inside whole template element? for example, want show floating window position depends on current "mouse-over" element. <div v-for="..." v-on:mouseover="showfloating(current_element)"> is possible dom element "current_element"? try this <div v-for="..." v-on:mouseover="showfloating"> methods:{ showfloating(event){ console.log(event); } } this give current element attributes`

c - Android NDK compiling a few libraries -

so today i've tried use c code in android(part 2). i've tried use android ndk compiler, i'm stumbling across problem. when put source files in settings of android.mk, gives me undefined references while exact same piece of code worked on lets windows , dll's , exact same piece of code worked on compiler of ubuntu. question is, how can make error codes go away, how reference dependencies? following error me : c:/android-ndk-r13b/samples/package/app/src/main/jni/package/ilcore/src/interfaces/../authentication/session.c:44: error: undefined reference 'sb_memset' c:/android-ndk-r13b/samples/package/app/src/main/jni/package/ilcore/src/interfaces/../authentication/session.c:54: error: undefined reference 'il_connection_init' c:/android-ndk-r13b/samples/package/app/src/main/jni/package/ilcore/src/interfaces/../authentication/session.c:69: error: undefined reference 'sb_free' c:/android-ndk-r13b/samples/package/app/src/main/jni/package/ilcore/src/i

javascript - Flagging simulated data -

consider typical list app, written in meteor. when user adds new item list, meteor run method on client , server enable ui update quickly. there way of telling whether item in list simulated, client-side data or data has been stored server-side? my use case in example apply different styling new list items until had been ran server-side. what's best way of achieving different appearance depending on status of data in question? many thanks. you can use collection-hooks before.insert ( https://github.com/matb33/meteor-collection-hooks ) in order add insertedat date example (or flag) on client side, long not have 'flag' means it's in pending insert status, can apply different display on object. hope help. regs.

matplotlib - Updating a plot after show -

say have created plot , show it fig1 = plt.figure() ax = fig1.add_subplot(111) lt.plot(mat0[21:27,1],mat0[21:27,4],marker='s', label = "21") lt.plot(mat0[21:27,1],mat0[21:27,3],marker='s', label = "23") plt.plot(mat0[21:27,1],mat0[21:27,2],marker='s', label = "28") pl.show() i realize have missed lines plot, how can update graph without going through process of plotting every single line again?

javascript - DeprecationWarning process.EventEmitter is deprecated -

Image
already applied require('events') still warning keep showing, doing wrong here? why process.eventemitter keep showing not used? node v6.7.0 works, v6.9.1 happening on centos 7.2 var pro = require('events'); var port = parseint(config.server.port, 10); var io = require('socket.io').listen(port); // line causing it??? output warning: dev environment detected info - socket.io started (node:32708) deprecationwarning: process.eventemitter deprecated. use require('events') instead. edit: i used $ npm install package.json had following: { "name": "test", "description": "test", "version": "0.0.2", "dependencies": { "getconfig": "0.3.0", "node-uuid": "1.2.0", "socket.io": "0.9.16", "yetify": "0.0.1" }, "main": "test.js", "repository"

android - Firebase Push - Key google.sent_time expected String but value was a java.lang.Long -

when android application using gcm service receives firebase push following: w/bundle: key google.sent_time expected string value java.lang.long. default value <null> returned. i know different services, application is able receive push notification , can't find information on web error log. why getting java.lang.classcastexception ? complete stacktrace 11-10 10:51:33.536 31712-31712/abcd.com.abcd e/firebaseinstanceid: failed resolve target intent service, skipping classname enforcement 11-10 10:51:33.536 31712-31712/abcd.com.abcd e/firebaseinstanceid: error while delivering message: serviceintent not found. 11-10 10:51:33.546 31712-32529/abcd.com.abcd w/bundle: key google.sent_time expected string value java.lang.long. default value <null> returned. 11-10 10:51:33.546 31712-32529/abcd.com.abcd w/bundle: attempt cast generated internal exception: java.lang.classcastexception: java.lang.long cannot cast java.lang.string

csv - Proper Python Pandas read_csv Encoding for '\u2116', the 'Numero Sign' -

i'm working file has couple numero signs in it. here top 3 lines copied , pasted directly csv file: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 № summer 01 ! 02 ! 03 ! total № winter 01 ! 02 ! 03 ! total № games 01 ! 02 ! 03 ! combined total afghanistan (afg) 13 0 0 2 2 0 0 0 0 0 13 0 0 2 2 when try import file in anaconda using python 3.5 using pandas read_csv following error: unicodeencodeerror: 'charmap' code can't encode character '\u2116' in position 104: character maps <undefined> this happens when try: df=pd.read_csv('myfile.csv', encoding='utf_8') i tried standard english codecs listed here same error code: https://docs.python.org/3/library/codecs.html#standard-encodings does have suggestions on should try differently? thank help, me for future readers, went in csv file , deleted 'numero sign' file , u

dependencies - How to build a client-server dist with separated directories using maven-assembly? -

i want build single dist separates server , client dir. every dir contains lib folder , bin folder: dist +----client | +-----bin | \-----lib \----server +-----bin \-----lib the pom.xml contains dependencies section: <dependencies> <dependency> <groupid>dummy</groupid> <artifactid>client</artifactid> <version>1.7.0-snapshot</version> </dependency> <dependency> <groupid>dummy</groupid> <artifactid>server</artifactid> <version>1.7.0-snapshot</version> </dependency> </dependencies> client , server libs using dumy.base artificat dependendy tree displays server dependency. dummy:dist:pom:1.7.0-snapshot +- dummy:server:jar:1.7.0-snapshot:compile | \- dummy:base:jar:1.7.0-snapshot:compile +- dummy:client:jar:1.7.0-snapshot:compile when use maven-assembly plugin assembly using dependen

c# - Inject IProgress<string> to a method passed by parameter -

i develop simple windows forms form, contaning text area, ok button , 1 cancel button. receive method constructor parameter, know has both iprogress<string> , cancellationtoken parameters, alongside parameters. however, both iprogress<string> handler (that write progress messages on text area mentioned above) , cancellationtoken (that bound cancel button) inside form , not accessible outside. how "inject" both iprogress , cancellationtoken method, before starts? should make both public , tie them before showing form, without passing function constructor parameter? something that: var progressform = new myprogressform(); // not working. pseudo-algorithm. progressform.functiontoexecute = myfunction(param1, param2, progressform.progressreporter, progressform.cancellationtoken); progressform.show();

javascript - Get the N elements from array based on the position -

i want function returns sub array takes position & no. of elements want. think there may algorithm find pivot point or & can sub array, totally forgot it. example: = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] want 6 elements if position = 0, want [1, 2, 3, 4, 5, 6] if position = 1, [1, 2, 3, 4, 5, 6] if position = 2, [1, 2, 3, 4, 5, 6] if position = 3, [1, 2, 3, 4, 5, 6] if position = 4, [2, 3, 4, 5, 6, 7] if position = 5, [3, 4, 5, 6, 7, 8] if position = 6, [4, 5, 6, 7, 8, 9] if position = 7, [5, 6, 7, 8, 9, 10] if position = 8, [5, 6, 7, 8, 9, 10] if position = 9, [5, 6, 7, 8, 9, 10] middle of n elements based on position pass. i can write own loop contain multiple if-else conditions done. feel there may easy way it. i didnt include incomplete code snippet because feel there must algorithm this. what want : array.prototype.slice(...) it's neatly documented here : https://developer.mozilla.org/en-us/docs/web/javascript/reference/global_objects/array/slice va

xml - XSL FO: Print Just A Single Blank Line Between Paragraphs -

i have xml data , xsl fo stylesheet format xml. have following xml document: <content> <para>paragraph one.</para> <para /> <para>paragraph two.</para> <para /> <para>paragraph three.</para> </content> the desired output after styling fo stylesheet be: paragraph one. paragraph two. paragraph three. the actual output getting below, there 2 blank lines. paragraph one. paragraph two. paragraph three. the stylesheet code using is: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:fo="http://www.w3.org/1999/xsl/format"> <xsl:variable name="newline"> <xsl:text>&#10;&#10;</text> </xsl:variable> <xsl:template match="/"> <fo:root> <fo:layout-master-set> <fo:simple-page-master master-name="pagesetup">