Posts

Showing posts from March, 2012

optimization - Best way to check if there is a 0 in an integer -

what best way check if there's 0 (zero) in integer for example: 505 -> true 555 -> false 44444032 -> true 0000 -> true i have tried this public bool has0(int no) { if(no==0)return true; while(no!=0) { if(no%10==0)return true; no=no/10; } return false; } this works,but takes time specially on large numbers given fact need call method 1 billion times on large numbers for(int i=0;i<1000000000;i++)has0(i); so,what best way check if 0 exist in number using bit level operators | , & , ^ or other way. thanks.. modulo expensive integer operation (similar integer divides). eliminate half of possible answers in test seeing if number even. no odd number has modulo 10 equal zero. if (((no & 0x1) == 0x00) && ((no % 10) == 0)) return true; you pay little more on numbers, lot less on odd ones. hence, if it's numbers, won't (it hurt), if it's 50/50 or 20/80 (20 percent odd), you...

android - JSON Store fails intermittently in MobileFIrst hybrid app -

we're trying store list of tasks in jsonstore , retrieve user clicks on fetch button. observed behavior: see intermittently, jsonstore throws exception , won't fetch stored tasks @ all. same source code, when re-deployed works fine. meaning, tasks stored , fetched expected. exception thrown message {"src":"find","err":22,"msg":"invalid_search_field","col":"collectiontasksname","usr":"jsonstore","doc":{},"res":{}} our writing , reading functions below: /** * function add data jsonstore collection * @param collname: collection name add * @param datatostore: data store * @param flag: flag operation, if clear, collection cleared before adding new data * @param returnfunc: callback function results handling */ function storage_add(collname,datatostore,flag,returnfunc) { wl.logger.debug('su: storage add function called.'); console.log('su: storage...

jquery - Magic-Zoom interfering with Fotorama? -

i've got zen cart 1.53, magic-zoom, , tried adding fotorama image display automatic thumbnails. magic-zoom seems auto zooming thumbnails on normal product thumbnails. image slider on main page , don't want images zoomed, interferes ability use them image nav-buttons in slider. there way inhibit zooming? this sounds conflict between 2 scripts easy resolve. may due name of thumbnail style. however, it's not possible identify exact cause of issue based upon details you've given. please submit url of page or send login support team @ magic toolbox https://www.magictoolbox.com/contact/ , identify cause of conflict , how resolve it. or try magic zoom plus api & callbacks advanced control of how zooms behave on page. 11 api methods , 6 callbacks include: magiczoom.start(node) magiczoom.stop(node) magiczoom.refresh(node)

cmake - Replace ctest command with "ctest --output-on-failure" permanently for a specific project in CMakeLists.txt -

i have found generic ctest command doesn't give information tests, add ctest --output-on-failure not have users worry flag. want them cmake , make project , run ctest , should run ctest with --output-on-failure flag. possible in cmakelists.txt? edit: output of env ctest_output_on_failure=1 make test 4/13 test #4: test_sssp ........................***failed required regular expression not found.regex=[correct ] 0.00 sec loading matrix-market coordinate-formatted graph ... input graph file /home/muhammad/gunrock/dataset/small/chesapeake.mtx not exis output of set_property(test testname property environment "ctest_output_on_failure=1") 4/13 test #4: test_sssp ........................***failed required regular expression not found.regex=[correct ] 0.00 sec the flag in set_property not working. i went make check per solution: cmake: setting environmental variable ctest (or otherwise getting failed test output ctest/make test automaticall...

c# - Databound list box not updating to correct values from observable collection WPF -

i new wpf simple i've missed. i have list box holding databound class properties static observablecollection<myclass> . collection being updated several times second network stream source , can tell debugging, collection being updated properly. declaration follows: static observablecollection<pumpitem> pumpcollection = new observablecollection<pumpitem>(); pumpitem name of class. that not listbox isn't displaying however, updating display new values added collection these ever reflect properties of first moment enter collection. the values of listbox bound such: <listbox x:name="pumplistbox" itemssource="{binding pumpcollection}" grid.issharedsizescope="true" margin="0,0,153,0"> <listbox.itemtemplate> <datatemplate> <grid> <grid.columndefinitions> <columndefinition sharedsizegroup="id"...

php function script not getting called in joomla -

i have created carousel html page call php functions getting run <?php function getpicturetype($ext) { if ( preg_match('/jpg|jpeg/i', $ext) ) { return 'jpg'; } else if ( preg_match('/png/i', $ext) ) { return 'png'; } else if ( preg_match('/gif/i', $ext) ) { return 'gif'; } else { return ''; } } function getpictures($id) { global $max_width, $max_height; $dir="../../images/albums/album".$id."/"; $i = 0; if (is_dir($dir)) { if ($dh = opendir($dir)) { echo '<ul >'; while (($file = readdir($dh)) !== false) { if ( !is_dir($file) ) { $absolute_path = $dir.'thumbs'; $split = explode('.', $file); $ext = $split[coun...

android - EXTRA_START_PLAYER cannot be resolved or is not a field -

package com.example.tictactoemain; import com.example.tictactoelib.gameactivity; import com.example.tictactoelib.gameview.state; import android.os.bundle; import android.app.activity; import android.view.menu; import android.content.intent; import android.view.view; import android.view.view.onclicklistener; import com.example.tictactoelib.gameactivity; public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); return true; } private void startgame(boolean startwithhuman) { intent = new intent(this, gameactivity.class); i.putextra(gameactivity.extra_start_player, startwithhuman ? state.player1.getvalue() : state.pla...

Copy files between nodes with ansible -

i found this post copying files between nodes ansible. here's ansible task: - name: copy pipeline files synchronize: mode=pull src=/home/ec2-user/nlp/nlp_test/all_data/test/ dest=/opt/nlp-ml/rate/pipeline dirs=yes delegate_to: "{{ ml_ip }}" i tried out playbook failed message: msg: warning: identity file /users/me/me.pem not accessible: no such file or directory. permission denied (publickey). this makes sense identity file stored locally , not on remote machine. however, source node's public key has been distributed target node. how can around this? edit: tried adding destination node's public key source node. added use_ssh_args=yes synchronize task. after added ssh_args = -i /home/ec2-user/.ssh/id_rsa (the location of private key on both source , destination nodes) ansible.cfg. same issue. so in order requires combination of things tried. @vvchik suggested try removing mode=pull, didn't work initially. however, when combined use...

Where to use SAS Token in Xamarin.Android -

i'm making android app connect azure storage account save information in table. when run app in simulator, , press button opens page connects database exception stating "shared key not supported using pcl. please use sas token." so followed steps generate sas token i'm not sure string. can suggest should place string? namespace undergroundsports { [activity] public class austinbowlingsignuppage : activity { protected override async void oncreate (bundle savedinstancestate) { base.oncreate (savedinstancestate); setcontentview (resource.layout.austinbowlingsignuppage); edittext austinbowlingfullnameentry = findviewbyid<edittext> (resource.id.austinbowlingfullnameentry); edittext austinbowlingemailentry = findviewbyid<edittext> (resource.id.austinbowlingemailentry); button austinbowlingsubmitbutton = findviewbyid<button> (resource.id.austinbowlingsignupbutton); string sas = ...

c# - Sending large strings through TCP - Windows Phone -

i developed simple tcp client on windows phone, shown here on msdn this working expected. now, want send large base64 strings though client (for transferring images). but, when try send base64 strings client, receive portion of string @ server, due i'm not able generate entire image @ server. the server side code receiving strings is: (edited) ipaddress ipad = ipaddress.any; console.write("port no. (leave blank port 8001): "); string port; port = console.readline(); if (port == "") port = "8001"; /* initializes listener */ tcplistener mylist = new tcplistener(ipad, int.parse(port)); /* start listeneting @ specified port */ mylist.start(); console.writeline("\nthe server running @ port " + port); console.writeline("the local end point :" + ...

http - Unable to unmarshal JSON array in Golang -

i getting below response in url , want unmarshal it, unable so. kind of response i'd unmarshal. [ {"title": "angels , demons", "author":"dan brown", "tags":[{"tagtitle":"demigod", "tagurl": "/angeldemon}] } {"title": "the kite runner", "author":"khalid hosseinei", "tags":[{"tagtitle":"kite", "tagurl": "/kiterunner"}] } {"title": "dance of dragons", "author":"rr martin", "tags":[{"tagtitle":"ironthrone", "tagurl": "/got"}] } ] i trying unmarshal sort of response not being able so. code trying write. res, err := http.get(url) if err != nil { log.withfields(log.fields{ "error": err, }).fatal("couldn't html response") } defer res.body.close() b, err := ioutil.readall(res...

asp.net - Kentico Bizform in a transformation -

one of companies clients uses kentico cms (a proprietary cms written in asp.net kentico.com ) i embed bizform transformation of custom table. reason need depending on multiple choice option in custom table, transformation display different version of bizform. if possible efficient way of accomplishing need done. i pretty new kentico cms , it's proving not devloper friendly, input or suggestions great. a transformation in kentico has possibility usercontrol. if use transformation type : ascx, can use asp.net control want. including predefined kentico usercontrols. <cms:bizform runat="server" id="bizform" formname="yourbizformcodename" enableviewstate="false" alternativeformfullname="bizform.yourbizformcodename.yourbizformalternativeformname"/> you can give alternativeformfullname specify alternative form wish use.

javascript - Is there a better way to handle window properties & child components in React/Redux? -

so have <layout> component. based on page, loads in different child components. in those, might have tabs , might not. this changes way want scrolling work, , therefore markup of scrolling. i ended making sure each child component had element <div id="scroll-container"> then within <layout> component did this: componentdidmount() { this._updateheight(); window.addeventlistener('resize', this._updateheight, false); }, componentdidupdate() { this._updateheight(); }, _updateheight() { var container = document.getelementbyid('scroll-container'); if (container ) { let height = window.innerheight - container.getboundingclientrect().top; container.style.height = height + 'px'; } }, i know there helpers things getboundintclientrec , going use later. right wondering general flow. i thinking can make component scroll-container wraps wherever need that, i'd need <scrollcontainer {...this.props}...

How do I export data from a datagridview/data set into an Access Database? [C#] -

so title pretty self explanatory, far have read microsofts documentation , watched youtube videos regarding issue here. firstly project code here: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; using system.data.oledb; namespace application { public partial class form1 : form { public form1() { initializecomponent(); } private void label1_click(object sender, eventargs e) { } private void label2_click(object sender, eventargs e) { } private void button1_click(object sender, eventargs e) { foreach (datarow r in dsequipment.tables[0].rows) { datarow dr = sqtdbdataset.tblequipment.newrow(); dr[0] = r[0]; dr[1] = r[1]; ...

scala - How to select values from one field rdd only if it is present in second field of rdd -

i have rdd 3 fields mentioned below. 1,2,6 2,4,6 1,4,9 3,4,7 2,3,8 now, above rdd, want following rdd. 2,4,6 3,4,7 2,3,8 the resultant rdd not have rows starting 1, because 1 in second field in input rdd. ok, if understood correctly want do, there 2 ways: split rdd two, first rdd contains unique values of "second field" , second rdd has "first value" key. join rdds together. drawback of approach distinct , join slow operations. val r: rdd[(string, string, int)] = sc.parallelize(seq( ("1", "2", 6), ("2", "4", 6), ("1", "4", 9), ("3", "4", 7), ("2", "3", 8) )) val uniquevalues: rdd[(string, unit)] = r.map(x => x._2 -> ()).distinct val r1: rdd[(string, (string, string, int))] = r.map(x => x._1 -> x) val result: rdd[(string, string, int)] = r1.join(uniquevalues).map {case (_, (x, _)) => x} result.collect.foreach(pr...

c++ - How Do I Get mciSendString to Work With Both Variables and Spaces? -

i have created program plays music in music directory , supports spaces, of google. however, don't want keep hard-coding song names, i'm wondering if can replace file name variable, , std::cin variable when program run. however, i want able play songs have spaces in names . made wrapper function (i think count one?) mcisendstring, , i'm trying able pass "name" parameter play. however, due complications lpcwstr , std::string, among other things, i'm having difficulty implementing this. here's current music function: void music(std::string strsongname,dword dwextraflag) { mcierror me = mcisendstring(text("open \"d:\\windows.old\\users\\myname\\desktop\\sounds\\music\\song name.mp3\""" type mpegvideo alias song1"), null, 0, 0); /* note want able play songs spaces in name */ if (me == 0) { me = mcisendstring(text("play song1 wait repeat"), null, 0, 0); mcisends...

bash - How can I delete my user data programmatically in Safari | OSX? -

i've found out how in firefox sudo rm -rf ~/library/application\ support/firefox/ this command deletes history, bookmarks, cookies, , more. i tried sudo rm -rf ~/library/safari/ for safari still logged in ( cookies still there ) after running it. i prefer not use gui. all comments below answer has provided right answer. im collecting pieces , placing here others can benefit , have full answer if having same question. this post supply answer. safari caches cookies in memory, if delete files while it's still running , quit, they'll written disk. you must have safari closed in order sure cookies deleted. once safari closed can delete following folders: # delete current user cookies /users/shortusername/library. # or path same above. both %home% directory # of current user ~/library should work. # other folders remove well: ~/library/safari/localstorage/ ~/library/webkit/localstorage/ $tmpdir/com.applewebkit.webcontent+com.apple.safari ...

android - Can't instantiate Coordinate Resource System java.lang.NoClassDefFoundError: org.geotools.factory.Hints -

i trying use geotools java library in project of mine built using gradle , version 14.3: compile 'org.geotools:gt-shapefile:14.3' compile 'org.geotools:gt-epsg-hsql:14.3' basically, time try instantiate coordinateresourcesystem, such as: coordinatereferencesystem crs; try { crs = crs.decode("epsg:4326"); //also tried defaultgeographiccrs.wgs84_3d } catch (factoryexception e) { e.printstacktrace(); } i error @ runtime: java.lang.noclassdeffounderror: org.geotools.factory.hints @ org.geotools.referencing.crs.<clinit>(crs.java:181) all of advice i've received until has had enabling multidex , have tried every single 1 of combinations of gradle prescribed, no avail. tried cleaning , building dozens of times. no matter receive pesky error @ runtime. thoughts why be? can see class in jar. i have noticed dependency imports several jars, similar package names. these package names causing confusion? really @ loss here , can't...

java - How to skip a part of the file then read a line? -

i have code reads file using buffered reader , split, said file created via method automatically adds 4kb of empty space @ beginning of file, results in when read following happens: first code: bufferedreader metaread = new bufferedreader(new filereader(metafile)); string metaline = ""; string [] metadata = new string [100000]; while ((metaline = metaread.readline()) != null){ metadata = metaline.split(","); (int = 0; < metadata.length; i++){ system.out.println(metadata[i]); } } this result, keep in mind file exists , contains values: //4096 spaces first actual word in document --> testtable2 name java.lang.string true no reference is there way skip first 4096 spaces, , straight actual value within file can result regularly? because i'll using metadata array later in other operations, , i'm pretty sure spaces mess number of slots within array. suggestions appreciated. ...

Internet Explorer 11 does not close after Selenium Test -

we have multiple windows server 2012 machines setup on google cloud running selenium tests. running mocha in nodejs. chrome , firefox starting, running, , closing expected ie 11 not close. result, selenium server stops responding , tests in ie begin fail. here code before , after each hooks // launches browser, opens homepage, , closes popup. exports.beforeeach = function(capability) { driver = utils.driver.launch(capability); utils.driver.open(driver); utils.driver.closepopup(driver); } exports.aftereach = function() { driver.quit(); } the capabilities have set following { browsername: browser, version: version, screenresolution: resolution, requirewindowfocus: true, unexpectedalertbehaviour: "dismiss", ignoreprotectedmodesettings: false, ignorezoomsetting: false, nativeevents: true, handlesalerts: true, javascriptenabled: true, enableelementcachecleanup: true, cssselectorsenabled: true, useperprocessproxy: false, elements...

unit testing - Deleted tests persist in Xcode test navigator -

Image
i removed old test classes project , deleted files. expected, files moved trash , showed removed in git. unfortunately, test classes , test cases define continue appear in test navigator. i've tried usual suspects cleaning & rebuilding, , quitting & reopening xcode. the remaining tests run fine; @ end of all-tests run, navigator shows phantom tests no indicated status. i've begun think there erroneous state in project file that's keeping these phantom test cases around, don't know enough internals debug further. my problem distinct scenario described here because of test cases stick around in test navigator, rather disappearing. delete deriveddata directory. apparently xcode parses test classes , writes test definition files of sort deriveddata. uses definition files populate test navigator. unfortunately, deleting test class within xcode not cause cache invalidated , rebuilt. instead, 1 must clear cache manually. i had incorrectly as...

authentication - ldapsearch: Invalid credentials -

Image
i trying authenticate against our institutional ldap server command ldapsearch . user info in ldap shown in following image i used command below search dn: ldapsearch -x -h ldap://ldap.mdanderson.edu:389 -d "cn=djiao,ou=institution,ou=people" -b dc=mdanderson,dc=edu -w xxxyyyzzz however got error: ldap_bind: invalid credentials (49) additional info: 80090308: ldaperr: dsid-0c0903a9, comment: acceptsecuritycontext error, data 52e, v1db1 what wrong ldapsearch command? the bind dn not complete in command. should end dc=mdanderson,dc=edu. so, should be: cn=djiao,ou=institution,ou=people,dc=mdanderson,dc=edu in active directory, though, users typically under cn=users tree (i don't see tree hiearchy). so, bind dn (the dn after -d argument) may have be: cn=djiao,ou=institution,cn=users,dc=mdanderson,dc=edu

sql server - SQL Reporting Services 2016 Publisher Error -

i'm getting following error when trying connect sql report publisher rc3 on laptop reporting services 2016 i'm running on azure: unexpected character encountered while parsing value <. path '', line 0, position 0. i have basic authentication enabled, can log in browser on different machine. report builder 3.0 not connect either. here's authentication block copy of rsreportingserver.config : <authentication> <authenticationtypes> <rswindowsnegotiate/> <rswindowsbasic> <logonmethod>3</logonmethod> <realm></realm> <defaultdomain></defaultdomain> </rswindowsbasic> </authenticationtypes> <rswindowsextendedprotectionlevel>off</rswindowsextendedprotectionlevel> <rswindowsextendedprotectionscenario>proxy</rswindowsextendedprotectionscenario> <enableauthpersistence>true</ena...

javascript - Show the paused frame in the Android HTML5 player -

i'm creating video player in html5 , javascript in 1 has step through frames paused @ accuracy of 100ms . use video time display specific frames. player works on computer , ipad-mini. on android when use line: video.currenttime = x the html5 android player moves video, not show frame content. content shows when video plays! me this? test on computer , android tablet/phone paused video: http://codepen.io/kvbyte/pen/wgxeym <video id="video" controls="" preload="auto"> <source src="https://media.w3.org/2010/05/sintel/trailer.mp4" type='video/mp4; codecs="avc1.42e01e, mp4a.40.2"' /> <p>your user agent not support html5 video element.</p> </video> <br /> <button onclick="document.getelementbyid('video').currenttime-=3">currenttime-=3s</button> <button onclick="document.getelementbyid('video').currenttime+=3">c...

java - Embed openVpn client in my own android application -

i want provide openvpn client config app, client connect android system.i ve checked ics-openvpn project in github, don t know how start see doc/readme in repository starting. make sure understand implications of gpl.

selenium - what is this driver = WebDriverManager.startDriver(browser, useragent) means? -

for line of code in selenium : driver = webdrivermanager.startdriver(browser, useragent) browser = context.getcurrentxmltest().getparameter("browser"); , useragent = context.getcurrentxmltest().getparameter(useragent); does know line doing? , use webdriver manager ? i assume "where", "and" stuff setting parameters function, cucumber type coding. pulling parameters kind of context configuration. it looks webdrivermanager helps set type of driver want. making easy change firefox, chrome, ie hiding configuration class.

What types of javascript functions should I use, and what functions should I stay away from -

i've been reading , different types of functions can use in javascript. many developers seem agree object literal functions: var hotel = { name: "quay", rooms: 40, booked: 25, checkavailability: function() { return this.rooms - this.booked; } }; and function getarea(width, height) { return width * height; } are best functions use. of seasoned javascript developers on stack on flow feel sam? i've read should not create global variables, , global functions. my last question is, how know function should implement in code? i'm kind of confusued, , use help. thank you.

node.js - Solve captcha with spookyjs (casperjs) -

i'm trying write test site, logging , performing actions. i've got script close working there 1 key flaw haven't been able circumvent. see logic below var phantom = require('phantom'); var rl = require('readline-sync'); var spooky = require('spooky'); // go login page spooky.start(url); // generate image of captcha spooky.then(function () { this.capture('captcha.png'); }); // fill in login form spooky.then([{ captcha: new captcha() }, function () { this.fill('form#login-form', { 'username': 'username', 'password': 'password', 'recaptcha_response_field' : captcha.phrase }); }]); spooky.wait(5000, function() { this.capture('afterlogin.png'); }); spooky.run(); function captcha() { return { phrase: ask("enter captcha phrase: ") } } function ask (msg, options){ return rl.question(msg, options) } so, generates ...

uinavigationcontroller - navigationController is nil in swift -

i have 2 storyboard (main , sb2) i have 1 view controller in storyboard in main , 1 in sb2 perform let sb2 = uistoryboard(name: "sb2", bundle:nil) let vc : uiviewcontroller = self.sb2.instantiateviewcontrollerwithidentifier("vc2") self.showviewcontroller(vc, sender: self) after second viewcontroller loads , command run, prints nil: print(self.navigationcontroller) // prints nil in sb2 (second storyboard) clicked on viewcontroller (vc2) , clicked on editor > embed in > navigation controller. placed navigation controller storyboard , root view controller vc2. triple checked this. first sign of being connected gray navigation bar on top. second being there segue connecting navigation controller vc2 , last place have checked in navigation controller utilities. i thinking maybe shouldn't transition vc1 vc2 directly rather vc1 navigationcontroller don't know how or if possible. i don't know when sb2 prints nil when in face navigation co...

c# - Write Custom driver for Excel to OLAP Communication in .Net -

i working excel , want use olap cubes in excel. need write custom oledb provide communication olap server excel. i come know there interface implementing them can built bridge can communicate olap cubes. can 1 tell me how can start write driver or idea. how can communicate external data source excel an faster approach using open source xmla connect. can see video of how works here: https://www.youtube.com/watch?v=-m64vsovvkw . if find useful, can download latest version here: http://sourceforge.net/projects/xmlaconnect

ios - Tips on how to diagnose a view controller losing reference to parent view controller -

i have class someviewcontroller has gesture recognizer on 1 of it's views, , double-tapping triggers handler gesture, creates , throws uinavigationcontroller, wraps irpimageviewerviewcontroller. irpimageviewerviewcontroller lone content controller inside uinavigationcontroller. have nslog statement shows following result @ given point. <irpimageviewerviewcontroller: 0x84689690>'s parentviewcontroller <uinavigationcontroller: 0x7ca31800> then @ point later, double-tap gesture, triggering code again, , nslog statement logs message. <irpimageviewerviewcontroller: 0x84689690>'s parentviewcontroller (null) how on earth uinavigationcontrollers content controller lose it's connection it's containing uinavigationcontroller. i'm not doing mysterious or weird, trying reference or use content controller, maintaining it's lifetime manually. also in log, i'm not putting there, disturbing tidbit... warning: attempt present <ui...

actionscript 3 - Error #1009: Cannot access a property or method of a null object reference.on camera -

im working on augmented reality application augmented object can touched hands. has motion detection in it. build using flartoolkit , away3d. i made augmented reality , motion detection part. problem combined them, i class motion detection http://blog.soulwire.co.uk/code/actionscript-3/webcam-motion-detection-tracking whenever try run program, error #1009: cannot access property or method of null object reference.on camera from analyze, code cant differentiate camera use. if can show hot fix it, me lot here's initialization camera in augmented reality part this.flarmanager.removeeventlistener(event.init, this.onflarmanagerinited); this.camera3d = new flarcamera_away3d(this.flarmanager, new rectangle(0, 0, this.stage.stagewidth, this.stage.stageheight)); this.view = new view3d({x:0.5*this.stage.stagewidth, y:0.5*this.stage.stageheight, scene:this.scene3d, camera:this.camera3d}); this.addchild(this.view); this.light = new directiona...

reactjs - firefox issue webpack dev server hot reloading Firefox can't establish a connection to the server /websocket -

i have simple react, redux application uses webpack dev server hot reloading. it works fine in chrome, safari, opera, not work @ in firefox. giving following error message: firefox can't establish connection server @ ws://localhost:5050/sockjs-node/044/0lchvqev/websockert this strange , hard debug keeps trying reload page, , gives error message

javascript - How to check two parametrs in li:contains metod -

i using metod change css $("#allproducts li:contains('" + product + "')").css("background", "white"); this works fine need check 2 parametrs when chagne css think this $("#allproducts li:contains('" + product + "')&&('" + icategory + "') ").css("background", "white"); but not working.i cant check if contains product , if icategory need them bee in same object. i think looking like this . short answer, try this: $("#allproducts li:contains('" + product + "'):contains('" + icategory + "') ")

ios - UIImage size is changing -

currently have split , want split 2 different images. i have working, isn't getting frame correctly. // @property of uiimage self.splitimage = [_displaylastphoto image]; nslog(@"split image %f %f", self.splitimage.size.width, self.splitimage.size.height); [self setviewshow:self.successfulmessage]; cgimageref tmpimgref = self.splitimage.cgimage; cgimageref leftimgref = cgimagecreatewithimageinrect(tmpimgref, cgrectmake(0, 0, self.splitimage.size.width / 2.0, self.splitimage.size.height)); uiimage *leftimage = [uiimage imagewithcgimage:leftimgref]; nslog(@"left image %f %f", leftimage.size.width, leftimage.size.height); cgimagerelease(leftimgref); cgimageref rightimgref = cgimagecreatewithimageinrect(tmpimgref, cgrectmake(self.splitimage.size.width / 2.0, 0, self.splitimage.size.width / 2.0, self.splitimage.size.height)); uiimage *rightimage = [uiimage imagewithcgimage:rightimgref]; nslog(@"right image %f %f", rightimage.size.width, rightimage...

regex - Parse Wikipedia Infobox with Go? -

i trying parse infobox wikipedia articles , cannot seem figure out. have downloaded files , albert einstein , attempt parse infobox looks this : package main import ( "log" "regexp" ) func main() { st := `{{redirect|einstein|other uses|albert einstein (disambiguation)|and|einstein (disambiguation)}} {{pp-semi-indef}} {{pp-move-indef}} {{good article}} {{infobox scientist | name = albert einstein | image = einstein 1921 f schmutzer - restoration.jpg | caption = albert einstein in 1921 | birth_date = {{birth date|df=yes|1879|3|14}} | birth_place = [[ulm]], [[kingdom of württemberg]], [[german empire]] | death_date = {{death date , age|df=yes|1955|4|18|1879|3|14}} | death_place = {{nowrap|[[princeton, new jersey]], u.s.}} | children = [[lieserl einstein|"lieserl"]] (1902–1903?)<br />[[hans albert einstein|hans albert]]...