Posts

Showing posts from September, 2011

http - Synchronous Blocks in Node.js -

i want know if it's possible have synchronous blocks in node.js application. i'm total newbie node, couldn't find answers behavior i'm looking specifically. my actual application little more involved, want support request , post request. post request append item array stored on server , sort array. request return array. obviously, multiple gets , posts happening simultaneously, need correctness guarantee. here's simple example of code theoretically like: var arr = []; app.get(/*url 1*/, function (req, res) { res.json(arr); }); app.post(/*url 2*/, function (req, res) { var itemtoadd = req.body.item; arr.push(itemtoadd); arr.sort(); res.status(200); }); what i'm worried request returning array before sorted after item appended or, worse, returning array as it's being sorted. in language java use readwritelock. i've read node's asynchrony, doesn't appear arr accessed in way preserves behavior, i'd love proven wr

javascript - How to post text variable in angular to mysql trough php -

so have little bit tricky or rather odd situation. i have php , mysql database, frontend using angular.js so creating service, sends data, via post request php. so working when sending input values via name html attribute. but problem appears when trying send hardcoded text variable loop. i know it's hardcoded way doing don't know how differently. so here php <?php $conn = mysqli_connect('localhost','nemkeang','nemkic23','interventure'); if(!$conn) { die("connection failed: " . mysqli_connect_error()); } $text = $_post['first_name']; $text2 = $_post['last_name']; $text3 = $_post['date']; $text4 = $_post['author']; $text5 = $_post['note']; $text6 = $_post['skill']; $target = "/assets"; $target = $target . basename( $_files['cv_file_name']['name']); //this gets other information form $file_name= $_files['cv_file_name']['name

django - ImportError :No module named pandas -

i trying deploy app amazon web service ebs , when open it, keeps prompting me error. importerror @ /safeplace/location/ no module named pandas request method: request url: http://usafe2.epnjkefarc.us-west- 2.elasticbeanstalk.com/safeplace/location/?lat=-37.877010&lng=145.044267 django version: 1.10.6 exception type: importerror exception value: no module named pandas exception location: /opt/python/current/app/api/views.py in <module>, line 15 python executable: /opt/python/run/venv/bin/python python version: 2.7.12 python path: ['/opt/python/run/venv/lib64/python2.7/site-packages', '/opt/python/run/venv/lib/python2.7/site-packages', '/opt/python/current/app', '', '/opt/python/run/baselinenv/local/lib64/python2.7/site-packages', '/opt/python/run/baselinenv/local/lib/python2.7/site-packages', '/opt/python/run/baselinenv/lib64/python2.7', '/opt/python/run/baselinenv/l

java - unable to insert a row of data into a mysql table using and android application -

im making project in android studio uni can insert , receive data sql database hosted on godaddy. have been trying many tutorials little progress. project in current state capable of connecting , can query database existing inputs; unable perform insert action. believe issue lies java code rather php scripts. tutorial using is: http://easyway2in.blogspot.co.uk/2015/07/android-mysql-database-connect.html#comment-form appreciated. backgroundtask.java within backgroundtask.java file, method called register believe issue. import android.app.alertdialog; import android.content.context; import android.os.asynctask; import android.widget.toast; import java.io.bufferedreader; import java.io.bufferedwriter; import java.io.ioexception; import java.io.inputstream; import java.io.inputstreamreader; import java.io.outputstream; import java.io.outputstreamwriter; import java.net.httpurlconnection; import java.net.malformedurlexception; import java.net.url; import java.net.urlencoder; p

node.js - Mongoose: Running Scheduled Job Query by Date -

i want create scheduled job patients in hospital. patients informed every month reg_date . i'm using new date().getdate() inside scheduled jobs run @ 8.00 in morning send sms patients. meanwhile, had been using string format date save reg_date in mongodb. here snippets of mongodb docs : { customer: "john", reg_date: "2017-02-17t16:39:26.969z" } i've ben surfing solutions turns out nothing, decided post myself. here trying : customer.find({"reg_date.getdate()" : new date(2017, 03, 17).getdate()}) .then(function(data) { (var key in data.length) { sendthesms(key[data]); }; }); e.g: doing "i want every patient register @ 17th day of month , send them sms". any appreciated. :d for type of bit complex query need use aggregation method instead regular find method. $project project fields, here creating new temporary field day date of reg_date . query using new field day , resul

angularjs - Angular error, in npm build [$injector:nomod] Module 'testApp' is not available -

studying , practicing npm build, im trying compile script using npm run build , got error [$injector:nomod] module 'testapp' not available! either misspelled module name or forgot load it. if registering module ensure specify dependencies second argument. any advice. app.js import angular 'angular'; import 'angular-ui-router'; import './services/router.js'; angular.module('testapp', [ 'ui-router' ]); ----------------------------- roter.js 'use strict'; angular .module('testapp') .config([ '$urlrouterprovider', '$stateprovider', '$locationprovider', function($urlrouterprovider, $stateprovider, $locationprovider) { $locationprovider.html5mode(false).hashprefix(''); $urlrouterprovider.otherwise('/'); $stateprovider .state('home', { url: '/', templateurl: 'components/views/homepage.html',

How to delete files on the directory via MS SQL Server -

i trying delete file directory inside windows using following query, exec xp_cmdshell 'del "c:\root\sfd_devtracker\'+@deletefile + '"'; when execute command gives following error, incorrect syntax near '+'. in @deletefile variable have filename have delete. have done wrong here? xp_cmdshell requires literal string passed parameter. cannot construct value on fly. try this: declare @cmd nvarchar(max) = 'xp_cmdshell ''del "c:\root\sfd_devtracker\' + @deletefile + '"'''; exec (@cmd)

python - Iterate over Django custom Form -

i trying create dynamic form, varying number of charfields. want able display them @ in semi-arbitrary places in form. approach create iterable function fielded right self.fields[index]. however, when this, literally see this: <django.forms.fields.charfield object @ 0x80bae6be0> <django.forms.fields.charfield object @ 0x80bae6f98> <django.forms.fields.charfield object @ 0x80bae6da0> how make charfield() render expected? my code below: class implementationform(forms.modelform): """ specifies implementation of given control. """ class meta: model = implementation fields = ['implemented', 'scope', 'separate'] def __init__(self, *args, **kwargs): control = kwargs.pop('control') super(implementationform, self).__init__(*args, **kwargs) self.fields['separate'].widget.attrs.update({'class': 'separate'}) self.

java - Approaches to Deploy Rest and possible sets of client supported by it -

in java have multiple implementation of jax-rs jersey, resteasy, restlet etc. have seen there various ways deploy webservices using servlet 2.x container, http servers. want understand difference between these different types of deployment? , other types of deployment possible in rest services. second, how many ways can call service. possible list of java clients supported rest.

java - Jacoco code coverage report shows wrong coverage -

i have integrated jacoco maven project. when computing coverage particular class, report shows code coverage percentage each method in class close 40% - 50% though coverage 100%. case multiple other java classes well. any idea why happens? appreciate solve this.

extbase - TYPO3 powermail Datepicker - TYPO3 -

typo3 powermail date picker showing regular input field in mozilla firefox. field showing date field in chrome. how can fixed? firefox don't support native date fields. that's why javascript datepicker should rendered automatically (difference chrome) in powermail. of course javascript datepicker can rendered, if jquery included , if ordering of javascript correct. please check browser console on javascript errors. example working form can seen in powermail testparcours: http://powermail.in2code.ws/index.php?id=28 some information: https://docs.typo3.org/typo3cms/extensions/powermail/foreditors/addanewform/fielddate/index.html#date-formats

leaflet - clear overlay layer and put new polyline and markers on same layer -

i've been pulling hair out day trying figure 1 out. i'm writing thought simple leaflet app track aircraft movement historical gps plot data. idea able pick period of time display, display aircraft movement on map start , endpoints , polyline showing path aircraft took. want polyline own layer can turn on , off. first time through, works great. different polylines each flights tracked wanted. however, when want pick different aircraft on same or different days, can't clear off old ploylines , display new ones. i've tried deleting objects out of layergroup, clear layergroup , else i've found try end result can clear out old polylines, can never new ones display. here code creates map , layers: var basemaps = { "default": maplayer, "faa": faalayer, "satellite": satlayer, "hybrid": hybridlayer }; var polylayer = l.layergroup([]); var overlaymaps = { "trac

Can some one explain logging device placement in tensorflow tutorial ? -

link tf tutorial # creates graph. tf.device('/cpu:0'): = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a') b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b') c = tf.matmul(a, b) # creates session log_device_placement set true. sess = tf.session(config=tf.configproto(log_device_placement=true)) # runs op. print sess.run(c) in above example cpu:0 has assigned execution process. with log_device_placement true. solution above code have mentioned device mapping: /job:localhost/replica:0/task:0/gpu:0 -> device: 0, name: tesla k40c, pci bus id: 0000:05:00.0 b: /job:localhost/replica:0/task:0/cpu:0 a: /job:localhost/replica:0/task:0/cpu:0 matmul: /job:localhost/replica:0/task:0/gpu:0 [[ 22. 28.] [ 49. 64.]] now here place holders a, b , matmul operation c runs inside session inside device log cpu:o in log device description why matmul has been executed in gpu:0 ? that seems bug in documentation,

Workflow deployed as WCF service on azure is stuck -

we have deployed workflow wcf service on azure , throwing below error: the execution of instancepersistencecommand interrupted because instance has not yet been persisted instance store one thing noticed record getting inserted in below table, should not happen [system.activities.durableinstancing].[lockownerstable] and causing fields in workflow instancetable getting set null. fields isinitialized, blockingbookmark null.

angular - Angular2 - ViewChild from a Directive -

i have component name easyboxcomponent, , directive viewchild @viewchild(easyboxcomponent) mycomponent: easyboxcomponent; this.mycomponent undefined i thought corrent syntax.. my html is <my-easybox></my-easybox> <p myeasybox data-href="url">my directive</p> import { directive, afterviewinit, hostlistener, contentchild } '@angular/core'; import { easyboxcomponent } '../_components/easybox.component'; @directive({ selector: '[myeasybox]' }) export class easyboxdirective implements afterviewinit { @contentchild(easyboxcomponent) mycomponent: easyboxcomponent; @contentchild(easyboxcomponent) allmycustomdirectives; constructor() { } ngafterviewinit() { console.log('viewchild'); console.log(this.mycomponent); } @hostlistener('click', ['$event']) onclick(e) { console.log(e); console.log(e.altkey);

vector - R change value to another -

i have following vector: a <- c(true, true, false, false, true, false, false, false, true, na, false) i change false true when there @ n false values next each other. otherwise, values should not changed. example, when n = 2 , want obtain: c(true, true, true, true, true, false, false, false, true, na, true). what best solution of problem? rle()  and  inverse.rle()  can help: a <- c(true, true, false, false, true, false, false, false, true, na, false) r <- rle(a) r$values[r$values==false & r$lengths<=2] <- true inverse.rle(r) # > inverse.rle(r) # [1] true true true true true false false false true na true

apache poi - java.lang.NumberFormatException: For input string: " " -

this question has answer here: how resolve java.lang.numberformatexception: input string: “n/a”? [closed] 5 answers hello ,all trying save excel sheet data mysql database. using apache poi. getting cell values using dataformatter in apache poi. getting cell values string format, trying change string value long getting numberformatexception. trying below code. please try solve problem. thank you. fileinputstream inputstream = new fileinputstream(filename); xssfworkbook workbook = new xssfworkbook(inputstream); xssfsheet firstsheet = workbook.getsheetat(0); dataformatter formatter = new dataformatter(); for(int z=0;z<firstsheet.getlastrownum();z++) { cell upccell=firstsheet.getrow(z).getcell(0); string upcstring =formatter.formatcellvalue(upccell); long upc=long.valueof(upcstring); . . . } this error stack tr

asp.net - how to retrieve data from sql server based on kilometer or mile range use latitude longitude of the current location to near by 5 km away diameter -

Image
i have developed android mobile app need found current location nearest 5 km area people registered in our application. my location change so, time want retrieve current location through nearest 5 km area people registered in our application. mobile developer giving me user current location how can found particular location latitude longitude through nearest 5 km area people sql server. ( asp.net webapi developer). below image of table structure

machine learning - unable to use Adaboost with R's caret package -

i'm using r's caret package implementing adaboost technique. i'm getting error while executing it. > str(my_data) 'data.frame': 3885 obs. of 10 variables: $ date : factor w/ 12 levels "0","1","2","3",..: 3 3 3 3 3 3 3 3 3 3 ... $ japan : int 0 1 0 0 0 0 1 1 0 1 ... $ hongkong: int 0 1 0 1 0 0 0 1 1 1 ... $ china : int 1 0 1 1 1 1 0 1 1 0 ... $ india : int 0 0 0 1 0 0 1 1 0 1 ... $ germany : int 0 1 1 0 1 1 0 0 0 1 ... $ france : int 0 1 1 0 1 1 0 0 0 1 ... $ euro : int 0 1 1 0 1 1 0 0 0 1 ... $ london : int 0 1 1 0 1 1 0 0 0 1 ... $ dowjones: int 0 1 0 1 1 1 0 0 0 1 ... > train=my_data[1:3600,] #2015 > test=my_data[3601:3860,] there no problem when i'm implementing gbm caret #1 gradient boost set.seed(995) fitcontrol_1 <- traincontrol( method = "repeatedcv", number = 4, repeats = 5) gbm_model<- train(factor(india)~date+japan+hongkong+china+ge

r - Number of predictions in each run must be equal to the number of labels for each run -

i trying detect best auc using genetic algorithm in r . here code: library(ga) library(rocr) realresult <- sample( c(t,f), 350, replace=true, prob=c( 0.5, 0.5) ) aucfitness<-function(scores){ res<-prediction(scores, realresult, label.ordering = null) auc.tmp <- performance(res,"auc"); auc <- as.numeric(auc.tmp@y.values) # print(paste0("auc is: ",auc)) auc } min <- 0.000654226 max <- 9433.873 ga <- ga(type = "real-valued", fitness = aucfitness, min = min, max = max, monitor = false,popsize = 350) summary(ga) but in line ga complains : error in prediction(scores, realresult, label.ordering = null) : number of predictions in each run must equal number of labels each run. as see, have size of realresult 350 , popsize = 350 , shouldn't face error

sql - Subtract two columns -

i have following ms access table: itemid qty flag 1 2 0 1 1 1 2 5 0 2 4 1 i want write query balance ( qty-qty ) , group flag . as example: (sum of qty flag =0) - (sum of qty flag =1) my final output should be: 1=1 2=1 use conditional aggregation: select itemid, nz(sum(iif(flag = 0, qty, 0)), 0) - nz(sum(iif(flag = 1, qty, 0)), 0) difference yourtable group itemid

compilation - C segmentation fault with methods -

i trying work setup_diamond() , draw_game() functions , keep getting segmentation fault. have literally no idea why i'm having error, far aware, being stored correctly , initialized. //function preparing diamonds void setup_diamond() { //for loop, size of number of max diamonds (int = 0; < max_bd; i++){ //creates array stores values diamond x values rand_x_value[i] = rand() % (screen_width()-bd_width); //creates 10 big diamonds based on rand angle bdiamond[i] = sprite_create( rand_x_value[i], 3, bd_width, bd_height, bdiamond_image ); //creates random angle saved in array randangle[i] = rand() % 360; //set's diamonds speeds 0.1 sprite_turn_to (bdiamond[i], 0.1, 0); //points diamond in random direction saved in array sprite_turn (bdiamond[i], randangle[i] ); //draws diamond sprite_draw (bdiamond[i] ); //creates 20 medium sized diamonds (int q = 0; q &

c++ - cpp Qt Model not updating QML view -

i using custom model qml view , want able move items drag , drop. use list in cpp model set data , bind model qml view . however, when drop item in new position, the view ask model move item on new position . in purpose, update datalist function datalist.move(oldindexposition, newindexposition) . my datalist correctly updated doesn't refresh qml view . tried use signal emit datachanged() but still not refreshing view . i don't understand should do, suggestion ? here simple example of try do. notice there no drag , drop here, in order make easier understand: public: q_invokable void move(int oldindex, int newindex) { datalist.move(oldindex,newindex); emit datachanged(this->index(oldindex),this->index(newindex)); } signals: void datachanged(const qmodelindex & topleft, const qmodelindex & bottomright); model.h int main(int argc, char ** argv) { qguiapplication app(argc, argv); model model; model

java - Image transformation results in a red image? -

i trying transform image flipping horizontally , resizing it. problem when transformation done picture's colors weird, has gotten reddish tone. possible fix somehow, think read somewhere might bug in awt library not sure? here code: import java.awt.graphics2d; import java.awt.geom.affinetransform; import java.awt.image.affinetransformop; import java.awt.image.bufferedimage; import java.io.file; import java.io.ioexception; import javax.imageio.imageio; public class localimagesizeflip { public static void main(string[] args) { bufferedimage img = null; try { img = imageio.read(new file("c:\\picture.jpg")); affinetransform tx = affinetransform.getscaleinstance(1, -1); tx.translate(0, -img.getheight(null)); affinetransformop op = new affinetransformop(tx, affinetransformop.type_nearest_neighbor); img = op.filter(img, null); img = resize(img, 100, 75); file newfile = new file("newpicture.jpg")

android - How can I show the graph in recyclerview? -

public class myadapter extends snappingrecyclerview.adapter<myviewholder>{ @override public myviewholder oncreateviewholder(viewgroup parent, int viewtype) { view view = layoutinflater.from(parent.getcontext()).inflate(r.layout.adapter_recyclerview,parent,false); return new myviewholder(view); } @override public void onbindviewholder(myviewholder holder, int position) { holder.textviewtemperature.settext(items.get(position).gettemperature()); holder.textviewprecipitation.settext(items.get(position).getprecipitation()); holder.textviewhumidity.settext(items.get(position).gethumidity()); holder.textviewdirection.settext(items.get(position).getdirection()); holder.textviewwritetime.settext(items.get(position).getwritetime()); } @override public int getitemcount() { return items.size(); } } publ

excel - Import Emails from specific folder in Outlook -

i'm using following code in excel access folders in unmanned outlook mailbox other own. however there way can set folder in code rather using folder picker. sub launch_pad() dim olapp outlook.application dim olns outlook.namespace dim olfolder outlook.mapifolder set olapp = outlook.application set olns = olapp.getnamespace("mapi") set olfolder = olns.pickfolder n = 2 cells.clearcontents call processfolder(olfolder) set olns = nothing set olfolder = nothing set olapp = nothing set olns = nothing end sub sub processfolder(olfdstart outlook.mapifolder) dim olfolder outlook.mapifolder dim olobject object dim olmail outlook.mailitem n = 1 each olobject in olfdstart.items if typename(olobject) = "mailitem" n = n + 1 set olmail = olobject cells(n, 1) = olmail.subject cells(n, 2) = olmail.receivedtime cells(n, 3) = olmail.body end if next set olmail = nothing set olfolder = nothing set olo

xml - convert HTML entities -

i have xml file: <?xml version="1.0" encoding="utf-8"?> <field> <id><![cdata[&lt;table style=&quot;width: 700px;&quot; align=&quot;left&quot; border=&quot;0&quot;&gt;&lt;tbody&gt;&lt;]]></id> </field> i want convert xml xsl to: <?xml version="1.0" encoding="utf-8"?> <field> <id><![cdata[<table style="width: 700px;" align="left" border="0"><tbody><]]></id> </field> my xsl file is: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> how c

visual studio - How to make Nunit ignore a folder? -

Image
nunit picks tests of packages bower , npm. in wwwroot , alittle hard find own tests when there 3000+ tests external packages. so wonder if there way solve problem, either excluding folder in config or suggestions.

defined loss function in tensorflow? -

in project, negative instance far more positive instance, want give positive instance larger weight. target is: loss = 0.0 if y_label==1:loss += 100 * cross_entropy else:loss += cross_entropy how realizate in tensorflow[?] let losses vector (rank-1 tensor) of loss values examples in batch. , let y the vector of corresponding labels. achieve result want by weights = w_pos*y + w_neg*(1.0-y) loss = tf.reduce_mean(weights*losses) here, w_pos , w_neg constant scalar values ( w_pos=100.0 , w_neg=1.0 in example). vector weights has value of w_pos examples label equals 1 , w_neg equals 0. multiply weights element-wise losses weigh values in losses according corresponding labels , take mean.

javascript - In phonegap app, the scrolling is not happening when user tries to scroll on input fields -

in phonegap app, scrolling (scrolling gestures) working expected when user scrolls on non-editable elements. scrolling not happening in pages when user scrolls(scrolling gestures) on input/textarea field boxes. need add property allow scrolling on input fields , textareas?

Artifactory 5.2.0: managing non-incremental backups -

we have set test artifactory server. we tried edit pre-defined backup-daily plan unchecking incremental checkbox , clicking save . however, when going edit screen, check box remains checked . is there reason that? this happens when defining new (custom) plan. the incremental check box seems remain checked. here system info. here logs when going through process of unchecking incremental checkbox , clicking save . 2017-04-07 09:50:35,126 [http-nio-8081-exec-9] [info ] (o.a.c.centralconfigserviceimpl:394) - reloading configuration... 2017-04-07 09:50:35,127 [http-nio-8081-exec-9] [info ] (o.a.c.centralconfigserviceimpl:250) - saving new configuration in storage... 2017-04-07 09:50:35,154 [http-nio-8081-exec-9] [info ] (o.a.c.centralconfigserviceimpl:254) - new configuration saved. 2017-04-07 09:50:35,156 [http-nio-8081-exec-9] [info ] (o.a.s.artifactoryapplicationcontext:433) - artifactory application context set not ready reload 2017-04-07 09:50:36,561 [http-nio

python 2.7 - Can't test my api on local server, always redirect to google api. After migrate to endpoints 2.0 -

all had on endpoints 1.0. i've done steps @ migrating 2.0 google docs. update project successfully, , can run endpoints api explorer. when try run endpoints api explorer locally (localhost:8080/_ah/api/explorer) it's redirect me google api explorer. app.yaml application: graphofgroups version: 1 runtime: python27 threadsafe: true api_version: 1 handlers: - url: /static static_dir: static - url: / static_files: static/index.html upload: static/index\.html secure: - url: /js static_dir: static/js - url: /partials static_dir: static/partials - url: /.* script: main.app - url: /_ah/api/.* script: main.app libraries: - name: ssl version: latest - name: pycrypto version: latest - name: numpy version: "1.6.1" inbound_services: - mail builtins: - remote_api: on env_variables: endpoints_service_name: echo-api.endpoints.graphofgroups.appspot.com endpoints_service_version: [2017-04-06r0]

sql server - Getting a incorrect WHERE syntax with my sql statement -

hope can , keep getting incorrect "where" syntax following sql statement using (sqlcommand selectt = new sqlcommand("select [tr_regnumber] dbo.trailerdetail [tr_routes] = '" +trailersroutesallocations[i]+ "'" + " , [tr_classficiation] = '" +trailersvragclassification[i]+ "'", con)) i coding in c# (using visual studio) you have 1 more. write 1 here: select column1, column2, ... table_name condition1 , condition2 , condition3 ...; this copy https://www.w3schools.com/sql/sql_and_or.asp

java - Error while using deep copy in python, Jepp -

num = 6 sg=np.empty((num),dtype=object) sg=[0.001,0.002,0.003,0.004,0.005,0.006] sg1=np.empty((num),dtype=object) tempv in range(0,6): tempt in range(tempv+1,6): if sg[tempv]==sg[tempt]: sg[tempt]=sg[tempt]+0.000001 sg1=deepcopy(sg) while executing code. exception thrown jep.jepexception: jep.jepexception: <class 'copy.error'>: un(deep)copyable object of type <class 'jep.pyjnumber'>

javascript - Add class onscroll combined with onepage-scroll.js plug-in -

i'm using onepage-scroll.js ( https://github.com/peachananr/onepage-scroll ) plug-in on website scroll through homepage. when scrolling past first "slide" add class (sticky) header change css. i've tried code below, can't seem working , i'm kinda in dark here on how make solution work. var header = $("header"); $("#sliders").scroll(function() { var scroll = $('#sliders').scrolltop(); console.log(scroll); if (scroll >= 50) { header.addclass("sticky"); } else { header.removeclass("sticky"); } }); try make on document ready. down example worked code on onepage-scroll.js $(document).ready(function(){ $(".main").onepage_scroll({ sectioncontainer: ".sectionscroll", responsivefallback: 600, loop: true, aftermove:function (index){

Solr and Zookeeper Configuration -

in production environment, should solr setup on every server possible including 1 having zookeeper? talking external zookeeper total servers : 5 case 1: solr on 5 servers. zookeeper on 3 servers. case 2: solr on 2 servers. zookeeper on 3 servers. case 3: solr on 5 servers. zookeeper on 5 servers. what best practice? advantages of using 1 case on another? have read it's better have zookeeper in separate server. at point of time zookeeper instance should in 2n+1 count. in case can go maximum 5 since have 5 servers. i.e. solr on 5 servers , zookeeper on 5 solr servers. original sizing can determined based on index size,query complexity, approximate query hit count minute , compromised result time.

c++ - Delphi thiscall calling convention and class pointer -

i have dll uses thiscall calling convention. i've searched trough web , found answer question here: delphi thiscall calling convention problem have that answer never explains class pointer. i've tried calling "operator new" function in dll , seems return valid pointer, below solution doesn't work me: asm mov ecx, myclasspointer end; i'd more detailed response, including how obtain class pointer.

How can i add screenshot to allure-cucumber report with ruby? -

would kindly me there work provide support attaching add screenshot allure-cucumber report. using construction after |scenario| @browser.save_screenshot if scenario.failed? include allurecucumber::dsl attach_file("07apr2017114056.png",file.open("../../src/screen/07apr2017114056.png")) @browser.quit end but dont work , give me erorr msg: errno::enoent: no such file or directory @ rb_sysopen - ../../src/screen/07apr2017114056.png wrong? it wor comand --format allurecucumber::formatter --out

Acumatica event handle refresh page on time -

Image
i've added more 3 field on cases (screenid=cr306000) 1. usrhours 2. usrminutes 3. usrseconds code editor: crcasemaint (cases): private static int i; private static int j; private static int k; public pxaction<px.objects.cr.crcase> buttonstart; [pxbutton(imagekey = px.web.ui.sprite.main.process)] [pxuifield(displayname = "start")] protected void buttonstart() { var row1 = (crcase)base.case.current; crcaseext rowext1 = pxcache<crcase>.getextension<crcaseext>(row1); i++; if(i > 59){ i=0; rowext1.usrseconds = "00"; j++; if(j > 59){ j=0; rowext1.usrminutes = "00"; k++; if(k > 59){ k=0; rowext1.usrhours = "00"; } else if(k < 10){ rowext1.usrhours = "0" + k; } else{ rowext1.usrhours = k.tostring(); } } else if(j < 10){ rowext1.usrminutes = "0" +

android - How fast would this Firebase range query be -

i wonder search in firebase database , try understand if approche or how change it. "andromeda-planetgroup.123-local1001-1234548" below immutable id string , perform searches on list containing them. think problem if list of "property" have hundred miljons entries , performing range query. if create range query this: ref.startat("andromeda-planetgroup.123-local1001-1234548") .endat("andromeda-planetgroup.123-local1001-1234552~") what can expect in terms of speed if list have miljons of entries. understand if range query return miljons if entries slow because of data size, lets want return 10 entries in range query? "property" : { "andromeda-planetgroup.123-local1001-1234548" : { "id" : "-kgekdd94homnhghd4wc" }, "andromeda-planetgroup.123-local1001-1234549" : { "id" : "-kgekh28nifusaftu_gs" }, "andromeda-planet

angularjs - Angular Dart with Polymer and Service-Worker incompatibilty -

i'm trying build web app compatible google progressive web apps specs. use angular dart , polymer based webcomponents instead of angular components. far works expected. make app offline capable utilizing service-worker api use following dart lib: https://github.com/isoos/service_worker using either polymer or service-worker works fine combining booth exits error on app startup. this appcomponent startup routine: // ... other imports import 'package:service_worker/window.dart' sw; // <-- import alone causes error future main() async { await initpolymer(); // <-- causes error in combination import above bootstrap(appcomponent); if (sw.isnotsupported) { print('serviceworkers not supported.'); return; } //... initializing service worker } the error occurs if i'm not initializing service-worker, importing service-worker module enough cause error. building app works without errors. i'm new dart , polymer , angular eco sys

ios - How to send a notification with a category using Firebase -

Image
this question has answer here: how send actionable notifications ios firebase? 2 answers i'm implementing interactive remote notification in ios. i'm sending notifications via firebase. notification should contain "category" identifier associated concrete action. example tutorial: {
 aps : { alert : "notificationtext", category: "mycategory" } } but how use json , assign category notification in firebase? you can add custom data key value pair advance options tab

php - Updating an Object in Symfony Doctrine -

i stuck on project , want help. have 3 tables in database ( reviews , criteria , criteriascope ), showcase code below. in reviews table have 4 fields, id , review , score , total , score , total can null. score array , words saved if word in reviews matched word in criteria table , total count of positive or negative words in score field. in index view show reviews(without score , total) , have button , when pressed want 1) update database find matched words , set them in score field and, 2) update total field respectively words score field. here code: reviews entity class reviews /** * @var int * @orm\column(name="id", type="integer") * @orm\id * @orm\generatedvalue(strategy="auto") */ private $id; /** * @var string * * @orm\column(name="review", type="string", length=500) */ private $review; /** * @var array * * @orm\column(name="score", type="array", nullable=true) */ private $sc

php - session in login framework -

for school making login system. next step when user logged in button 'log out' wil appear on every page. know have $_session don't know how use in code. hope can me out?! loginmodel: function loginuser($username = null, $password = null){ $username = $_post["username"]; $password = $_post["password"]; $db = opendatabaseconnection(); $result1 = $db->prepare("select * login username = '$username' , password = '$password'"); $result1->execute(); if($result1->rowcount() > 0 ) { $_session['logged in'] = true; $_session['username'] = $username; $db = null; return true; } else { $db = null; return false; } } logincontroller: function login(){ if(isset($_post["username"]) && isset($_post["password"])) { if(loginuser($_post['username'], $_post['password'])) { header("location:" . url . "login/

c# - MVC website doesn't receive string from client -

client: webclient wc = new webclient(); try { string json = wc.uploadstring("http://localhost:50001/client/index", "1"); dynamic receiveddata = jsonconvert.deserializeobject(json); console.writeline("result: {0};",receiveddata.data); } catch (exception e) { console.writeline("oh bother"); console.writeline(); console.writeline(e.message); } basically sends "1" index action in client controller. here controller: [httppost] public actionresult index(string k) { debug.writeline(string.format("result: {0};", k)); return json(new { data = k}, jsonrequestbehavior.denyget); } the result client "result: ;". debug output controller "result: ;". means data lost somewhere between client , site. when debug, visual studio says there 1 request. by adding header , specifying parameter name, i've managed work (in calling method): static void main(string[] args)

c# - How to get dependency injection working with IAsyncAuthorizationFilter in ASP.NET Core -

i have implemented iasyncauthorizationfilter interface class; in addition, class derived attribute , can mark controller classes , action methods using it. works far; task onauthorizationasync(authorizationfiltercontext context) method called before action method, , if request not authenticated, http 401 returned response. [attributeusage(attributetargets.class | attributetargets.method)] public sealed class customauthenticationattribute : attribute, iasyncauthorizationfilter { public async task onauthorizationasync(authorizationfiltercontext context) { ... } } this attribute used follows... [customauthenticationattribute] public class somedatacontroller : controller { [httpget] public async task getdata() { ... } } now, want use application service (which obtains secret private key information required authentication database) , tried use property injection that. injecting dependencies via ctor not choice here since it´s impl

SQLite/FoxPro Update can't find record using = but finds it using LIKE -

i'm converting foxpro database sqlite, , migrating instructions update, found problem. if inside foxpro use update fact01 set motivo = 'asdfgh' tipodoc='fv' rows not updated. but if use update fact01 set motivo = 'asdfgh' tipodoc 'fv' rows changed. if first instruction inside sqlite engine, rows changed. field type tipodoc nchar(2). also, if select * fact01 tipodoc ='fv' statement inside foxpro works ok. any idea what's happening here? i'm not sure if it's due fact nchar can store unicode data or way data in general stored. wrapping alltrim around clause may correct problem. update fact01 set motivo = 'asdfgh' alltrim(tipodoc)='fv'

c# - Classes with disposable fields should be disposable -

the fxcop warning "classes disposable fields should disposable" confuses me. see contrived example below only 1 type creates , owns disposable resource, number of types can use (or "borrow") resource. have seen developes take fxcop warning on util1 , util2 indicate since have field of disposable type, must implement dispose , dispose field. that's not want here. is problem that making classes borrow disposable resources antipattern. disposable resource passed method argument util1 , util2, , problem go away. classes create disposable resource should ever have them fields, field indicates ownership. the warning isn't clever enough. should warning when types own disposable resources aren't disposable, , in scenario 1 class owns it, while others borrow it. fact injected constructor parameter have been used more clever rule detect warning should not raised borrowing class. something else? static class program { public static void mai

c# - Microsoft Graph: How to receive list of remote items for drive? -

how can receive list of drive items remote items (items links items on other drives, shared me items) ? of course can it: // universal version var res = new list<driveitem>(); var list = await client.me.drive.root.children.request().getasync(); while (list != null) { res.addrange(list.currentpage.where(i => (i.remoteitem != null))); list = (list.nextpagerequest != null) ? (await list.nextpagerequest.getasync()) : null; } return res; but slow, , requires parse items. can use filter resolve task? in other words, code below work on types of drives (onedrive personal, business, sharepoint ...)? // filtered version var res = new list<driveitem>(); var list = await client.me.drive.root.children.request().filter("remoteitem ne null").getasync(); while (list != null) { res.addrange(list.currentpage); list = (list.nextpagerequest != null) ? (await list.nextpagerequest.getasync()) : null; } return res; according onedrive documentation :

python - How to write multiple signature hints in PyCharm with Python3 -

Image
i written function argument on left, similar built-in range function the problem is, how write type hints can show 2 way should invoked. for example, when type command+p(ctrl+p) in range function in pycharm(range object in py3, not problem): self:range, stop: int ------------------------------------------------- self:range, start: int, stop: int, step: int=-1 but my_range : def my_range(start: int, stop: int = none, step: int=1): """ list_range(stop) list_range(start, stop, step) return list of integers start (default 0) stop, incrementing step (default 1). """ if stop none: start, stop = 0, start return list(range(start, stop, step)) after type command + p , got: start: int, stop: optional[int], step: int=-1 does knows how implement that? many help! try typing module! it's got lot of helpers type annotations, including typing.optional . use this: import typing def f(required_arg: int, optional_arg:typing.opt

ios - Object upload error using AWSS3TransferManager -

getting error while upload image aws using awss3transfermanager response: error = "error domain=nsurlerrordomain code=-1003 \"a server specified hostname not found.\" userinfo={nsunderlyingerror=0x608000058f30 {error domain=kcferrordomaincfnetwork code=-1003 \"(null)\" userinfo={_kcfstreamerrorcodekey=8, _kcfstreamerrordomainkey=12}}, nserrorfailingurlstringkey= https://cognito-identity.ap-southeast-1.amazonaws.com/ , nserrorfailingurlkey= https://cognito-identity.ap-southeast-1.amazonaws.com/ , _kcfstreamerrordomainkey=12, _kcfstreamerrorcodekey=8, nslocalizeddescription=a server specified hostname not found.}"; first time upload using awss3transfermanager singapore region giving above error, if change region else , again if change singapore upload properly. , again after time same region won't work. please tel me doing wrong. thank you.

javascript - Let Angular 2+ routing ignore unmatched paths -

our application legacy application old jquery, angular 1 , angular 2+. rewriting old code in angular 2 not option. on webpage, portions driven angular 1 routing, , have got angular 2 work on hashlocationstrategy . however, while possible access new routes angular 2 app, throws errors on trying load angular 1 route. error angular 2 side. how 1 make ignore unmatched paths? the error is: cannot match routes

pyspark - Join two data frames as input for Machine Learning with Spark -

i have 2 data frames in apache spark, each column named " joinvalue ". joinvalue numeric , has same semantics , meaning in both data frames. i need combination of both data frames input (training , test set) machine learning algorithm. correct first need combine both dataframes single dataframe before using in ml pipeline? example: df1.show() +---------+---------+ | a|joinvalue| +---------+---------+ |a value 0| 0| |a value 1| 5| |a value 2| 10| |a value 3| 15| |a value 4| 20| |a value 5| 25| |a value 6| 30| +---------+---------+ and > df2.show() +---------+---------+ | b|joinvalue| +---------+---------+ |b value 0| 0| |b value 1| 7| |b value 2| 14| |b value 3| 21| |b value 4| 28| +---------+---------+ an outer join followed orderby yields following results: > df1.join(df2, 'joinvalue', 'outer').orderby('joinvalue').show() +---------+---

annotations - excludeFilters for SchedulingConfiguration is not working in spring 4.1.6 -

i'm trying exclude schedulingconfiguration while component scan seems not excluding,i can see still scheduler trigered. please me resolve issue.. main class: public class storagedatareconcilebatchrunner { public static void main(string[] args) { new annotationconfigapplicationcontext(configclass.class).start(); } } configuration class @configuration @enableaspectjautoproxy(proxytargetclass = true) @componentscan(excludefilters = { @componentscan.filter(type = filtertype.assignable_type, value = reconcilebatchschedulerunconfig.class)}, basepackages = {"com.a.b.c.api"}) @enabletransactionmanagement public class configclass { } scheduler @component public class reconcilebatchschedulerunconfig { @resource private datareconcilebatch datareconcilebatch; @scheduled(fixeddelay = 10000) private void scheduledrec

reactjs - is there anyway to navigate in a React-Router V4 app from outside a react environment? -

i making app 2 libraries along react . using leaflet , marzipano . i using redux datasync. now, want change route on click of leaflet marker. using histroy.pushstate results in url change, don't route params in react components. so bypass global this.props.history history , use push method change state. is there better way this... using feels wrong... monkey patch. if use react-router-redux , there useful actions can use change location long have access store.

xml - xmllint failing to properly query with xpath -

i'm trying query xml file generated adium. xmlwf says it's formed. using xmllint's debug option following: $ xmllint --debug doc.xml document version=1.0 encoding=utf-8 url=doc.xml standalone=true element chat default namespace href=http://purl.org/net/ulf/ns/0.4-02 attribute account text content=foo@bar.com attribute service text compact content=msn text compact content= element event attribute type everything seems parse fine. however, when try query simplest things, don't anything: $ xmllint --xpath '/chat' doc.xml xpath set empty what's happening? running exact same query using xpath returns correct results (however no newline between results). doing wrong or xmllint not working properly? here's shorter, anonymized version of xml shows same behavior: <?xml version="1.0" encoding="utf-8" ?> <chat xmlns="http://purl.org/net/ulf/ns/0.4-02&qu