Posts

Showing posts from March, 2015

version control - Shared directories in Mercurial -

version control - Shared directories in Mercurial - i have development project in mercurial. in project have multiple directories scattered should contain same basic files (css, images, etc). i'd have of directories point same underlying directory, if edit file in 1 place, updated everywhere else. unix soft link directory, want work within mercurial (and i'm on windows). i've looked @ subrepos, seem either point existing directory or remote one. i'd rather not have network involved. in case point subrepos relative location in same project. what's best way accomplish (with to the lowest degree amount of pain)? going windows 2000 (but still on nt line), can utilize directory hardlinks ntfs. far mercurial concerned, however, different files happen updated simultaneously, , junction points not stored in repo. (i'd create script set them when cloning.) this incompatible cloning repo *nix environment. (or @ to the lowest degree don't see ...

github - Jenkins build is not triggered with git post-receive hook -

github - Jenkins build is not triggered with git post-receive hook - i have installed jenkins on windows machine, configured project git repo. goal automatically build project when commits github. accomplish goal, updated "post-receive" (no extn) file under .git/hooks directory. code looks this #!/bin/bash curl http://localhost:9090/job/myproject/build?token=mytoken when execute curl http://localhost:9090/job/myproject/build?token=mytoken command or sh post-receive , jenkins job trigger. jenkins job not triggered when force changes git repo (from machine). kindly share thoughts help me resolve issue. first, github supports webhooks, not post-receive hooks. you can configure webhooks in github repository settings: github.com/[owner]/[repository]/settings/hooks however, if you're trying fire off jenkins job, should existing services hooks jenkins. git github jenkins

php - How to get the specific string from the HTML tag code and check existence of tag in a string? -

php - How to get the specific string from the HTML tag code and check existence of <img> tag in a string? - i've 2 html codes. 1 of them going nowadays in variable $text follows : //first html code $text = <a class="comment_attach_file_link" href="https://www.filepicker.io/api/file/vuhoz3n8toyvqudq03zi">vuhoz3n8toyvqudq03zi</a> <a class="comment_attach_file_link_dwl" href="https://www.filepicker.io/api/file/vuhoz3n8toyvqudq03zi">download</a>; //second html code $text = <a title="" href="https://www.filepicker.io/api/file/xda3udwdtwydvk7islws"><img src="https://www.filepicker.io/api/file/xda3udwdtwydvk7islws" height="150px" width="150px"></a> <a href="https://www.filepicker.io/api/file/xda3udwdtwydvk7islws" class="comment_attach_image_link_dwl">download</a>; if first html code ...

dataflow diagram - Data flow chart without end is possible? -

dataflow diagram - Data flow chart without end is possible? - my programme infinite loop keeps checking whether motion sensor (pir) value 0 or 128. if 128 takes picture, checks if scheme armed, sends notification , starts top again. if pir value 0 or if scheme not armed, starts top well. made effort design create chart im not sure if ok have no end. think? dataflow-diagram

asp.net - How VS selects the namespace for a control when generates .designer.cs -

asp.net - How VS selects the namespace for a control when generates .designer.cs - for web application project, how vs picks namespace control, if have registered many assemblies same tagprefix? here simple of code(sorry cannot paste code here): <%@ register assembly="assemblya, version=x, culture=neutral, publickeytoken=xxx" namespace="assemblya.namespacea" tagprefix="mycontrol" %> <%@ register assembly="assemblyb, version=x, culture=neutral, publickeytoken=x" namespace="assemblyb.namespaceb" tagprefix="mycontrol" %> <mycontrol:mycontrola id="id", runat="server" /> i want know how vs picks namespace mycontrola when generates .designer.cs file page? thanks in advance! asp.net

html - Position not rendering with specific div in css -

html - Position not rendering with specific div in css - i have issue rendering position of specific element different screen resolutions. below code: class="snippet-code-css lang-css prettyprint-override"> li.dashboard > ul { display:none; position:absolute; left:15.5%; top:138px; z-index:9; vertical-align:top !important; } li.dashboard li .subnav { position:relative; margin: 0px; margin-top: 10px; margin-left: 0px; } class="snippet-code-html lang-html prettyprint-override"> <li class="dashboard active" id=dashboard jquery1428391652078="2"> <a id=hldashboard href="permanentreqfollowup.aspx?2=7"> <span></span> <small></small> </a> <ul> <li jquery1428391652078="4"> <div class="subnav_bg subnav"> <ul class=subnav_ul> <li jq...

scripting - Dynamic Web Pages -

scripting - Dynamic Web Pages - i reading on dynamic web pages , wanted clarify got meaning down. definitions got wikipedia , other sources pretty wordy , i'm sure more exact got out of basic understanding of it. got, dynamic web pages websites scripts in it? scripts languages such javascript, python. dynamic means changes based on utilize case or usage. if website looks same static. if website changes based on user dynamic. scripting dynamic-websites

java - Two Spring Controllers matching to the same URL result in wrong controller call -

java - Two Spring Controllers matching to the same URL result in wrong controller call - we have problem 2 spring controllers happen interfere each other. 1 controller matches via wildcard-prefix url suffix. controller matches url prefix. expect urls read left right, seems not case. consider next code (edited): @requestmapping(value = "/**/abcdefg") public class controller1 {...} @requestmapping(value = "/**/xyz") public class controller2 {...} @requestmapping(value = "/some/{path}") public class controller3 { @requestmapping(value = "/{page}", method = requestmethod.get) public string page(@pathvariable("page") final string page, final model model) { //do sth } } the problem now, if url "/some/path/abcdefg" called, controller1 kicks in. want controller3. unfortunately behavior not same other controllers! if url "/some/path/xyz" called, cont...

python - run .py files on server - getting error 500 -

python - run .py files on server - getting error 500 - i'm trying run simple python script in server (hostgator) , i'm getting error 500 when run in url. this .py file: (in public_html folder) chmod:755 #!/usr/bin/env python print "content-type: text/html\n\n"; print "<html><head>"; print "<title>cgi test</title>"; print "</head><body>"; print "<p>test page using python</p>"; print "</body></html>"; and .htaccess: (in public_html folder) addtype text/html py addhandler cgi-script .py couple of things might wrong: allowoverride fileinfo not set directory. 500 may indicate apache has issue "malformed" .htaccess no executable bit on file: $ chmod +x my.py suexec gets in way. simple test is: $ suexec=$(which suexec) $ mv ${suexec} ${suexec}.orig $ service httpd restart in case of suexec there several thi...

ios - Recalling didMoveToView without FBSDKShareButton -

ios - Recalling didMoveToView without FBSDKShareButton - in ios app not able login facebook. fbsdkcorekit/fbsdkcorekit.h fbsdkloginkit/fbsdkloginkit.h social/social.h -(void)didmovetoview:(skview *)view { fbloginview *loginview = [[fbloginview alloc] init]; loginview.delegate=self; loginview.readpermissions=@[@"public_profile",@"email",@"user_friends"]; [self.view addsubview:loginview]; fbsdksharelinkcontent *content = [[fbsdksharelinkcontent alloc] init]; content.contenturl = [nsurl urlwithstring:@"https://developers.facebook.com"]; fbsdksharebutton *button = [[fbsdksharebutton alloc] initwithframe:cgrectmake(0, 150, 200, 30)]; button.sharecontent = content; [self.view addsubview:button]; } ios objective-c facebook

ios - Use of unresolved identifier FBSession -

ios - Use of unresolved identifier FBSession - in swift project, integrating facebook sdk using bridging file. if fbsession.activesession().state == fbsessionstate.createdtokenloaded{ // whatever } i getting error message: fbsession unresolved identifier i not find fbsession.h in fbsdkcorekit.framework v4.0.1 naming has changed to fbsdksession ios facebook swift

java - How to compare values in different collections that need different type of iteration loops? -

java - How to compare values in different collections that need different type of iteration loops? - lets have iterator contains values need compare values located in separate list. iterator<map.entry<string, object>> = aobj.items(); while (it.hasnext()) { map.entry<string, object> item = it.next(); namevalue = item.getnamevalue(); keyvalue = item.getkeyvalue(); system.out.println("name: " + namevalue); system.out.println("value: " + keyvalue); } this outputs: name: header value: 22222 lets have separate list (in want compare above values with): list<items> items = new arraylist<>(); (item item : items) { itemnamevalue = item.getname(); itemkeyvalue = item.getkey(); system.out.println("name: " + itemnamevalue); system.out.println("value: " + itemkeyvalue); } this outputs: name: header value: 44444 since these different types of loops (one while loop ,...

jquery - Buttons inside Bootstrap Popover are not triggered -

jquery - Buttons inside Bootstrap Popover are not triggered - i'm tring trigger buttons within popover loaded ajax couldn't find solution. here tried: popover loaded ajax: $('.item-instances').popover({ trigger: 'click', placement: 'bottom', title: 'title', html: true, content: function(){ var toreturn = []; $.each(iteminstances($(this)), function(k, v){ toreturn[k] = '<a href="#" class="instance-image-'+ v.image_id +'">abc</a>'; }); homecoming toreturn; } }); and tried trigger link popover: $( document ).ajaxcomplete(function() { $('a[class^="instance-image-"]').each(function(index, el) { $(this).on('click', function(event) { event.preventdefault(); console.log('test'); }); }); }); any suggestion whould great. give thanks you. ...

using python and matplotlib to graph '1.888409001e+002;1.468905193e-002' -

using python and matplotlib to graph '1.888409001e+002;1.468905193e-002' - i have info within file need plot. info pretty much looks this: 1.988479004e+002;1.498905197e-002 i have changed text to: 1.988479004*10**+002;1.498905197*10**-002 . do need alter *10** else function matplotlib ? how plot data? python matplotlib graph scientific-notation

assembly - calculating mean in 8087 nasm programming? -

assembly - calculating mean in 8087 nasm programming? - i using next code calculate mean in nasm. section .data arr : dq 10000,10000,20000,10000,10000 cnt : dq 5 dec : dq 100000000 section .bss mean rest 1 section .text global _start _start: finit fldz mov rsi,arr mov cl,05 addloop: fadd qword[rsi] add together rsi,8 dec cl jnz addloop fld qword[cnt] fdiv st1,st0 fld qword[dec] fmul st0,st2 fbstp [mean] mov r15,[mean] exit: mov rax,60 mov rdi,0 syscall but when check r15 via gdb shows 0. when check r15 after add-on loop (by popping stack , moving r15) still shows 0. please tell me doing wrong. assembly nasm

d3.js - grouping a node within a projection -

d3.js - grouping a node within a projection - i trying create sphere of connected nodes using orthographic projection serve sort of navigation. have managed create basic thought fiddle but having problem figuring out how create grouping of node in order append text/circle can scale node on mouseover etc. i guess nodes part of projection 'points' rather appendages due nature of projection?! the code have far , fiddle: http://jsfiddle.net/unit60/oztw93cx/ var width = window.innerwidth, height = window.innerheight - 5, fill = d3.scale.category20(), nodes = [{x: width/2, y: height/2}], links = []; var projection = d3.geo.orthographic() .scale(height/2.5) .translate([width / 2, height / 2]) var path = d3.geo.path() .projection(projection) var forcefulness = d3.layout.force() .linkdistance([40]) .linkstrength([0]) .gravity(0.1) .size([width, height]) .charge([-400]); var svg = d3.select("svg") .attr(...

d3.js - dc.js linechart not showing anything -

d3.js - dc.js linechart not showing anything - i using dc.linechart generate line chart show frequenct vs time. next code var freqchart=dc.linechart("#chart1"); var ndx=crossfilter(data); var countbytime=ndx.dimension(function (d) { homecoming d.time; }); var dateformat=d3.time.format("%m-%d-%y"); var freqbytimegroup = countbytime.group() .reducecount(function(d) { homecoming d.time; }); freqchart.width(400).height(200).transitionduration(500) .dimension(countbytime).group(freqbytimegroup) .elasticy(true).x( d3.time.scale().domain([d3.min(data,function(d){return d.time}),d3.max(data,function(d){return d.time})])).on("filtered", onfilt).yaxislabel("frequency").xaxislabel('time'); but getting next blank thing without graph. why can't view graph. sort of alter needed in graph. wan show total events in particular time period. th...

PHP string - what's wrong with '<'? -

PHP string - what's wrong with '<'? - i'm working strings , somehow php decides ignore next string if there "<" inside. can't find that. see example: $str = 'foo<bar' // echoes foo, foo<bar expected are there string operators don't know about? strings wrapped within ' ' should not evaluated php, right? use this htmlspecialchars ("foo<bar"); php string concatenation

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable - i'm trying create rtsp server based on gstreamer 1.0 1.4.5 plugin. source code of illustration taken here. with_tls , with_auth flags not enabled. i'm compiling using visual studio 2013 community edition. project building , running successfully. when i'm trying play video using vlc on address rtsp://127.0.0.1:8554/test says can't open mrl. recorded traffic (using rawcap) of communication between compiled server , vlc player following: request: options rtsp://127.0.0.1:8554/test rtsp/1.0 cseq: 2 user-agent: libvlc/2.2.0 (live555 streaming media v2014.07.25) response: rtsp/1.0 200 ok cseq: 2 public: options, describe, get_parameter, pause, play, setup, set_parameter, teardown server: gstreamer rtsp server date: thu, 09 apr 2015 03:35:30 gmt request: describe rtsp://127.0.0.1:8554/test rtsp/1.0 cseq: 3 user-agent: libvlc/2.2.0 (live555 streaming media v2014.07.25) accept: applicat...

How to upload file in Selenium with Flash uploader -

How to upload file in Selenium with Flash uploader - i trying upload photos in selenium. uploader in flash, doesn't work. when utilize normal file uploader (by file input), works. can help? flash selenium-webdriver

c++ - Pass in-class initialized const member to Base constructor? -

c++ - Pass in-class initialized const member to Base constructor? - i have in-class initialized const fellow member in derived class i'd pass constructor of base of operations class. example: class base{ public: base(int a) : i(a){} private: int i; }; class derived : base{ public: derived() : base(a){} private: const int = 7; }; int main(){ derived d; } however spawns uninitialized error: field 'a' uninitialized when used here [-wuninitialized] i under impression const initializing set value straight allowing passed derived ctor in manner. doing wrong or under wrong impression? when const in-class initialized members initialized? your question, when const in-class initialized members initialized? is bit of reddish herring. "in-class initialized" doesn't mean anything; brace-or-equal initializer syntactic sugar , takes place of corresponding constructor initalizer list slot. const has no special beari...

jquery - Onclick is not working for chinese string -

jquery - Onclick is not working for chinese string - we facing issue in jquery in ios app. issue happening chinese strings. works fine english. the issue onclick event not triggering chinese language. have lookup window user can search business relationship , search results list user can click on business relationship selected. 1 time user selects account, lookup window should close , come parent screen. name of business relationship hyperlink user can click on select. when business relationship name in chinese click not triggering , lookup window not closing. any help in appreciated. **nsstring *sethrefsjs = @"jquery(\"a.datacell\", window.parent.frames[1].document).each(function(index) { jquery(this).attr('href', 'setlookup://' + jquery(this).attr('onclick')) })"; [webview stringbyevaluatingjavascriptfromstring:sethrefsjs];** this issue happening ipad. jquery ios ipad

c# - Rebuilding WCF Client/Service breaks Service Reference? -

c# - Rebuilding WCF Client/Service breaks Service Reference? - i have built wcf service/client solution, , have problem. my client series of web pages take input , phone call service. have 4 different pages similar searches on country table. first 2 work whenever build , debug, when build , debug, 1 of 2 remaining pages breaks, , gives me message: webforms unobtrusivevalidationmode requires scriptresourcemapping 'jquery'. please add together scriptresourcemapping named jquery(case-sensitive). i update service reference , , debug again, , broken page works, , other page (which worked before) breaks , gives me same message. ping-pong , forh between pages doing this, know pages work. suspect when debug, visual studio rebuilds service, , invalidates in service reference. is there advice on how overcome frustrating issue? have hunted on , found no references. c# web-services wcf visual-studio-2012

regex - Regular expression for anchor tag in c# -

regex - Regular expression for anchor tag in c# - this question has reply here: multiline regular look in c# 2 answers my anchor tag looks this:- <a href="/as" title="asd" page="as" name="asd" reference="yes" type="relativepath">as </a> i tried in way:- <a [^>]*?>(?<text>.*?)</a> it working fine when ending anchor tag </a> supposed in same line. in case ending anchor tag should come in next line. i need regular look should supports, if ending anchor tag in next line. suggestions welcome. you should utilize (?s) inline option: (?s)<a [^>]*?>(?<text>.*?)</a> see demo. in c#, can utilize regexoptions.singleline alternative next way: var input = "<a href=\"/as\" title=\"asd...

Need a Mod rewrite regex solution for .htaccess -

Need a Mod rewrite regex solution for .htaccess - i moved site different server since urls started showing 404 error. earlier urls mysite.com/title-of-url but such urls getting 404 error, disabled seo friendly url feature on site admin , can access same page on mysite.com/index.php/title-of-url i tired create regex .htaccess purpose rewriterule ^([^/.]+)/?$ /index.php/$1 [l] but working fine 1 depth of "/", mean working mysite.com/first not mysite.com/first/second i looking regex help regardng mysite.com/first/second should gets rewritten mysite.com/index.php/first/second mysite.com/something gets rewritten mysite.com/index.php/something.. looking forwards kind help thanks of course of study doesn't work more / . rule says: match beginning: ^ (start grouping $1 : ( ) match except slash: [^/]+ (end grouping: ) ) match optional leading slash /? match end $ if want match everything, utilize dot instead of character class, matching except...

pdfclown - How to set no border when drawing background colored rectange? -

pdfclown - How to set no border when drawing background colored rectange? - is there way set no border when drawing background-color filled rectangle? or create border color match background-color filled rectange? primitivecomposer primitivecomposer = new primitivecomposer(page); { blockcomposer blockcomposer = new blockcomposer(primitivecomposer); primitivecomposer.setlinewidth(0.0f); primitivecomposer.setfillcolor(devicergbcolor.get(system.drawing.color.darkgray)); primitivecomposer.drawrectangle(new rectanglef(_boxmarginx, _boxmarginy, (page.size.width - (_boxmarginx * 2)), 205f), 0f); primitivecomposer.fillstroke(); } you use primitivecomposer.fillstroke(); which command fill , stroke path. don't want borders, i.e. don't want stroke, use primitivecomposer.fill(); instead. by way, primitivecomposer.setlinewidth(0.0f); the pdf specification defines line width of 0 mean smallest line target device can render. pdf...

compiler errors - Undefined getTextContent() for SOAPElement java 8 -

compiler errors - Undefined getTextContent() for SOAPElement java 8 - did encounter issue ? i using javax.xml.soap.soapelement's gettextcontent() java 7. when utilize java 8 gives me compilation error "the method gettextcontent() undefined type soapelement". when browsed through javadoc java 8, see method exists. help me understand what's problem here ? java compiler-errors java-8 javax.xml

python - Django: NoReverseMatch at / --> Reverse for 'name' with arguments '()' and keyword arguments '{}' not found. 1 pattern(s) tried: ['$name/'] -

python - Django: NoReverseMatch at / --> Reverse for 'name' with arguments '()' and keyword arguments '{}' not found. 1 pattern(s) tried: ['$name/'] - http://127.0.0.1:8000/ error: noreversematch @ / reverse 'name' arguments '()' , keyword arguments '{}' not found. 1 pattern(s) tried: ['$name/'] request method: request url: http://127.0.0.1:8000/ django version: 1.7.5 exception type: noreversematch exception value: reverse 'name' arguments '()' , keyword arguments '{}' not found. 1 pattern(s) tried: ['$name/'] exception location: /usr/local/lib/python3.4/dist-packages/django/core/urlresolvers.py in _reverse_with_prefix, line 468 urls.py from django.conf.urls import patterns, include, url django.contrib import admin urlpatterns = patterns('', # examples: # url(r'^$', 'mydjapp.views.home', name='home'), # ...

java - How exactly works the Spring Security intercept-url's? -

java - How exactly works the Spring Security intercept-url's? - i studying spring security , finding difficulties understand intercept-url's concept , reply questiong find on study material: in order have write multiple intercept-url's? so, on study material, found practical example: <beans> <security:http> <security:intercept-url pattern="/accounts/edit*" access="role_admin" /> <security:intercept-url pattern="/accounts/account*" access="role_admin,role_user" /> <security:intercept-url pattern="/accounts/**" access="is_authenticated_fully" /> <security:intercept-url pattern="/customers/**" access="is_authenticated_anonymously" /> </security:http> </beans> and specified that: intercept-urls evaluated in order listed: first match used, set specific matches first. but exatly means...

unix - gawk/sed: find a line and replace the 3rd column -

unix - gawk/sed: find a line and replace the 3rd column - i have file: rs4648841 chr1 2365885 -- t 0.40095 0.228978043022122 chr1:2523811 rs4648843 chr1 2366316 -- t c 0.15694 0.5736208829426915 chr1:2523811 rs61763906 chr1 2366517 -- g 0.07726 0.5566728930776897 chr1:2523811 i need find "rs4648843" in first column , 1 time found line containing want edit 4th column in line "ads" (using sed, gawk doesn't matter) tried: (but of course of study did not work) sed '/rs4648843/p' input | sed 's//add/g' edit: need no new file created, want edit file have already. try this: awk '/^rs4648843/ {$4="ads"}1' file | column -t output: rs4648841 chr1 2365885 -- t 0.40095 0.228978043022122 chr1:2523811 rs4648843 chr1 2366316 ads t c 0.15694 0.5736208829426915 chr1:2523811 rs61763906 chr1 2366517 -- g 0.07726 0.5566728930776897 chr1:2523811 ...

python - Dictionary Python3. Updating value of dict -

python - Dictionary Python3. Updating value of dict - need help thought how update dictionary value represented dictinary. here 2 dictionaries: d1 = {'x': {'y': 5}} d2 = {'x': {'z': 6}} assume d1 + d2, dictionary = {'x': {'y': 5, 'z': 6}} thank you. it's rather simple... d1['x'].update(d2['x']) or keys: [d1[k].update(d2[k]) k in d1] python dictionary

Multiple Paths Traversed and Displayed Filed type in Maya Menu with Python -

Multiple Paths Traversed and Displayed Filed type in Maya Menu with Python - i'm new here bare in mind , hope questions asked lot help me out. trying alter brent tylers dropbox script able list python under python, mel under mel , on(eventually plugins , other files not now) ok directory so: 1. sf=c:/users/scripts/ a.py + b.mel pf=c:/users/scripts/python/c.py mf=c:/users/scripts/mel/d.mel (these folders scripts placed in) code : absolutefiles = [] relativefiles = [] folders = [] allfiles = [] currentfile = '' root, dirs, files in os.walk(sf): x in files: right = root.replace('\\', '/') currentfile = (correct + '/' + x) allfiles.append(currentfile) if currentfile.endswith('.mel'): relativefiles.append(currentfile.replace((mf + '/'), "")) if currentfile.endswith('.py'): relativefiles.append(currentfile.replace((pf + '/'), ...

Time series arima forecasting constant line -

Time series arima forecasting constant line - i have weekly info feb 2013 jan 2015 (104 weeks). tried using auto.arima find best fit.it came out arima(0,1,1). when forecasted next 4 points, produced same values points. pacf plots shows p should @ to the lowest degree 1. , acf graph gradually trending down, not closing zero. can explain me why produce constant line? coefficients: ma1 -0.3558 s.e. 0.1009 sigma^2 estimated 579288: log likelihood=-829.6 aic=1663.2 aicc=1663.32 bic=1668.47 below info week orders 201301 2974 201302 3221.3 201303 3295 201304 3750.5 201305 3542.8 201306 3238.3 201307 3246.3 201308 3265.5 201309 3551.6 201310 4019.4 201311 3369.7 201312 3675.1 201313 3717.3 201314 3621 201315 3607 201316 3752.4 201317 3834 201318 4218.7 201319 3850.8 201320 3881.2 201321 3825.2 201322 3398.2 201323 4104.1 201324 3769.7 201325 3700.5 201326 3839.6 201...

android - OnChildClick affecting other random children -

android - OnChildClick affecting other random children - i have custom expandablelistview , custom adapter. within each group, there's kid , have set when click on child, shows hidden layout (extending height of row). works, affects random kid in different group. should checking if kid right one? if yes, how so? my listener: this.listview.setonchildclicklistener(new onchildclicklistener() { @override public boolean onchildclick(expandablelistview parent, view v, int groupposition, int childposition, long id) { relativelayout hiddenbuttons = (relativelayout) v .findviewbyid(r.id.child_item_buttons_layout); if (hiddenbuttons.getvisibility() == view.gone) hiddenbuttons.setvisibility(view.visible); else hiddenbuttons.setvisibility(view.gone); homecoming true; } }); android...

jquery - JSON data retrieval using javascript -

jquery - JSON data retrieval using javascript - hello guys i'm working user login , when user submits login credentials api beingness called using ajax , if login credentails correct/ wrong i'm getting response , after stringifying info displayed in next format in console. if true {"$p_success":true} if false {"$p_success":false} now want read value true above string , want redirect user new page based on condition. i tried different options in vain. thanks help in advance. you can access property of object specifing name between [] (ex: object['name'] ). class="snippet-code-js lang-js prettyprint-override"> var redirect = json.parse('{"$p_success":true}') var success = redirect['$p_success']; // value of $p_success alert(success); javascript jquery ajax json

cakephp - Association between two models not working -

cakephp - Association between two models not working - using cakephp 3.0, have (amongst others) 2 models associated: <?php # src/model/table/informationtable.php namespace app\model\table; class informationtable extends apptable { public function initialize(array $config) { parent::initialize($config); $this->belongsto('contractor'); $this->belongsto('informationfield'); } } ?> and <?php # src/model/table/informationfieldstable.php namespace app\model\table; class informationfieldstable extends apptable { public function initialize(array $config) { parent::initialize($config); $this->hasmany('information'); } } ?> in contractors controller, related models, next works fine: $this->contractors->information but when seek access informationfields model, error: $this->co...

Serve files privately with JSP/Tomcat? -

Serve files privately with JSP/Tomcat? - i writing jsp app should allow users log in (authenticate against postgresql database simple username , password check), , upload photos. images should private in can accessed user while logged in. re-create of image url should not work after logout. how can done tomcat/jsp? i not want store blobs in database. you can utilize servlet filters. let's have url /images/ images stored, using filters can check whether session user live or not. some examples: example 1 example 2 file jsp tomcat private

tween - Convert CSS cubic bezier easing to Javascript -

tween - Convert CSS cubic bezier easing to Javascript - i'm looking way generate easing functions tweens, need them in javascript function format, standard t, b, c, d parameters. i've found great tool generate css easing: http://cubic-bezier.com/ output useless me. is there way convert format javascript easing function? are there improve tools straight build javascript easing functions? the desired format like: function(t, b, c, d){ var ts = (t /= d) * t; var tc = ts * t; homecoming b+c*(4.257575757575761*tc*ts + -7.9545454545454595*ts*ts + 0.6818181818181834*tc + 4.46969696969697*ts + -0.4545454545454546*t); } there library bezier curve based easing in javascript https://github.com/gre/bezier-easing you select desired parameters http://cubic-bezier.com , pass them function beziereasing. example: beziereasing(0.25, 0.1, 0.0, 1.0) here illustration documentation: https://jsfiddle.net/0x51ew2l/ javascript tween easing

javascript - Rewrite structure of a JSON Object -

javascript - Rewrite structure of a JSON Object - i need create lot of json files project. json comes google spreadsheets. using data-drive json looks this: { "custom_id": 1, "another_thing": "pizza", "step_1_message": "msg", "step_1_hint": "hint", "step_1_intent": "intent", "step_2_message": "msg", "step_2_hint": "hint", "step_2_intent": "intent" } now want steps object itself. so: { "custom_id": 1, "another_thing": "pizza", "steps": [ {"step_id": 1, "message": "msg", hint: "hint", "intent": "intent"}, {"step_id": 2, "message": "msg", hint: "hint", "intent": "intent"} ] } here working solution: var input = { "custom_id...

javascript - How do you make a portion of the image undraggable? -

javascript - How do you make a portion of the image undraggable? - i'm working on project has draggable content in it. of images draggable have portion transparent , overlap other content. i set illustration on jsfiddle: draggable example <body> <p>the background transparent, if grab anywhere in border can drag image around.</p> <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e1/jupiter_(transparent).png/484px-jupiter_(transparent).png"></img> </body> img{ border: solid black 1px; } in illustration can grab image holding downwards left mouse button anywhere within borders of image, if transparent. in illustration goal able drag image if grabbed visible portion of planet jupiter. is possible in html? based on clarification in comments above, might easiest draw images in canvas element. can add together draggability canvas explained in post: make image drawn on html5 canvas draggable ...

android - web view url goes to browser .how to do avoid and open in same web view? -

android - web view url goes to browser .how to do avoid and open in same web view? - here code...am implemented webviewclient concept.it works in web view..in app have content saring via fb,twitter,g+,,,fb login , open in webview...but when click share fb icon in app after process work on browser..but want process in webview only... oncreate webview = (webview) findviewbyid(r.id.webview1); webview.setclickable(true); webview.setfocusableintouchmode(true); webview.getsettings().setjavascriptenabled(true); webview.setwebviewclient(new mywebclient()); if (build.version.sdk_int < 8) { ... } else { webview.getsettings().setpluginstate(websettings.pluginstate.on); } webview.loadurl("www.example.com."); webviewclient public class mywebclient extends webviewclient { @override public void onpagestarted(webview view, string url, bitmap favicon) { super.onpagestarted(view, url, favicon); } public void onloadresource (webview view,...

android - Project import issue eclipse -

android - Project import issue eclipse - i have imported new library project. unfortunately, app_name of project becomes same project have imported. when import existing projects (depending on eclipse version) can give new name in import window. otherwise import normal , rename right clicking project in bundle explorer , going r efactor > rename . android eclipse

csv - Can a Batch File Tell a program to save a file as? (If so how) -

csv - Can a Batch File Tell a program to save a file as? (If so how) - i trying automate file transfer process work , not sure how have programme save file. currently have created working batch move log file point of creation right folder , rename include date. utilize start function open file. of works far. now need file opened go file>save as>save it doesn't need name changed. programme opens saves cvs , ultimate goal. unless knows easier way alter log file csv file, open alternative well. in batch file. windows 7 computer edit 1* renaming csv using ren command turns info garbage when opens in excel. going through programme create log csv makes info appear in right format. need know how tell programme save as. since there no shortcut think need way tell push: altf downwards down (arrow keys) come in enter i realize programs autoit capable of preforming function not going alternative due restraints company computers. further research l...

dom - How can I get an element's serialised HTML with PHP's DOMDocument? -

dom - How can I get an element's serialised HTML with PHP's DOMDocument? - this illustration script: $html = <<<html <div class="main"> <div class="text"> capture text 1 </div> <div class="date"> may 2010 </div> </div> <div class="main"> <div class="text"> capture text 2 </div> <div class="date"> june 2010 </div> </div> html; $dom = new domdocument(); $dom->loadhtml($html); $xpath = new domxpath($dom); $tags = $xpath->query('//div[@class="main"]'); foreach ($tags $tag) { print_r($tag->nodevalue."\n"); } this out put: capture text 1 may 2010 capture text 2 june 2010 but need output: <div class="text"> capture text 2 </div> <div class="date"> june 2010 </div> or atleast able in fore...

android - java.io.filenotfoundexeption :/storage/sdcard/app.apk open failed Eacces (permission denied) -

android - java.io.filenotfoundexeption :/storage/sdcard/app.apk open failed Eacces (permission denied) - i want re-create apk file de bundle of application external storage: class copy: package com.pfe.bls; import java.io.file; import java.io.fileinputstream; import java.io.fileoutputstream; import java.io.ioexception; import java.nio.channels.filechannel; import android.os.environment; public class copyapk { public static void copy() throws ioexception { string basedir = environment.getexternalstoragedirectory().getabsolutepath(); string filename = "app.apk"; fileinputstream instream = new fileinputstream("/data/data/com.pfe.bls/app.apk"); fileoutputstream outstream = new fileoutputstream(basedir + file.separator + filename); filechannel inchannel = instream.getchannel(); filechannel outchannel = outstream.getchannel(); inchannel.transferto(0, inchannel.size(), outchannel); instream....

database - Counting the number of rows that have a particular word in a column of blob data type in mysql -

database - Counting the number of rows that have a particular word in a column of blob data type in mysql - i have table in mysql. datatype of column 'file' blob. need count number of rows have word 'lumia' in column 'file' , 'display' in column 'attribute'. is, here rows 1 , 3. output has 2. how can in mysql? the multiple occurrence of word lumia in 3rd row need not counted twice. +------+----------------------------+------------+ | slno | file | attribute | +------+----------------------------+------------+ | 1 | 5inch 8mp lumia snapdragon | display | | | 2 | 8mp galaxy samsung android | photographic camera | | | 3 | nokia lumia reddish lumia | display | | | 4 | black samsung 8mp android | photographic camera | | | 5 | lumia windows 8mp reddish | model | in add-on stated in how count number of occurrence of particular word in mys...

mysql - SQL, Select group by count, on max number of columns -

mysql - SQL, Select group by count, on max number of columns - we have next sql. grouping product_id , count. limit 6. query , illustration output below. now, suppose want the group product_id , count. limit 6. based on last 1000 records in table? not whole table, group/count based on lastly 1000 records. can done? i using limit grab top 6. there way limit number of columns counted.grouped max? hope clear thx, sean select `t`.`product_id` `id`, count(*) `cnt` `sofreport_viewed_product_index` `t` (t.product_id != '24') , (t.store_id = '1') grouping `t`.`product_id` order `cnt` desc limit 6 id cnt 9 239 440 179 216 169 10 157 494 126 500 118 i think work that, select `t`.`product_id` `id`, count(*) `cnt` `sofreport_viewed_product_index` `t` (t.product_id != '24') , (t.store_id = '1') , t.product_id in (select id sofreport_viewed_product_index order ‘cnt‘ limit 1000 ) grouping `t`.`product_id` order `cnt` desc...

Accessing camera on a website in Windows Phone -

Accessing camera on a website in Windows Phone - have develop website tablets , mobile phones work on windows phone 8.1 (android , ios optional). website supposed scan qr codes camera in mobile device, proceed data. have problem accessing camera. aware of getusermedia works fine web browsers[1] not ie or opera mini (while firefox , chrome not available windows phone). have suggestions? [1] http://caniuse.com/#feat=stream windows-phone-8 camera website

r - How do I loop through strings like they're column names? -

r - How do I loop through strings like they're column names? - sample code df <- read.csv('datafile.csv') columnnames <- c('col1','col2') i want loop through columnnames , print values. basically, want same values i'd if entered console df$col1 or df$col2 . how do that? [ takes strings, $ doesn't. for (cname in names(mtcars)) { print(mtcars[, cname]) } see also: > fortunes::fortune(343) sooner or later r beginners bitten convenient shortcut. r newbie, think of r bank account: overuse of $-extraction can lead undesirable consequences. it's best acquire '[[' , '[' habit early. -- peter ehlers (about utilize of $-extraction) r-help (march 2013) as @buckminster points out, [ vectorized, might not need loop: cols = c("mpg", "disp", "cyl") mtcars[, cols] r

I have multiple set of data to insert at once, can i insert multiple rows in a single SQL statement -

I have multiple set of data to insert at once, can i insert multiple rows in a single SQL statement - this question has reply here: inserting multiple rows in single sql query? [duplicate] 4 answers i have multiple set of info insert @ once insert mytable values ("john", 123, "lloyds office"); insert mytable values ("jane", 124, "lloyds office"); insert mytable values ("billy", 125, "london office"); insert mytable values ("miranda", 126, "bristol office"); can insert multiple rows in single sql statement multi-row insert has been part of sql standard since sql-92, , many of modern dbms' back upwards it. allow like: insert mytable ( name, id, location) values ('john', 123, 'lloyds office'), ('jane', ...

PowerShell to send email -

PowerShell to send email - i running task scheduler execute powershell every 30 minutes. so $users = search-adaccount -lockedout -searchbase "ou=people,dc=example,dc=com" -searchscope subtree | select samaccountname this returns list of users. want create emailbody users $emailbody = foreach($user in $users) {"`r`n",$user} send-mailmessage -to $to -subject "locked accounts" -bodyashtml $emailbody -from $from -credential $cred -smtpserver $server -debug however current code send email if no 1 locked. there anyway can check see if $users has @ to the lowest degree 1 person? (i haven't tested $emailbody know if acceptable bodyashtml) ================ updated code if ($users) { if ($users.count -gt 0) {#even if there users, line false. # send email here foreach($user in $users) { $message = $message + " " + $user + " locked out" + "`r`n" ...

hyperlink - createElement("a") - FireFox JavaScript -

hyperlink - createElement("a") - FireFox JavaScript - i have problem. have iframe(editable) , when click button create link. that's not problem. but, after remain in "link" mode. have problem in firefox. what's wrong. thx lot. javascript function in index.php function insertlink(verlinkung,text) { var doc = document.getelementbyid("frame").contentwindow.document; var sel = doc.getselection(); if (sel.rangecount > 0) { var range= sel.getrangeat(0); myparent=document.getelementbyid("frame").contentwindow.document.body; alink=document.createelement("a"); text= document.createtextnode(text); alink.href = verlinkung; if (document.getelementbyid('check_underline').checked == false) { alink.setattribute("style","text-decoration: none;"); } ...

c - How to print 2d-array with comma and new line -

c - How to print 2d-array with comma and new line - int **arr; //for example: 4 3 array how can print 2d-array comma , new line below? 01, 02, 03, 04 // @ last, new line without comma 05, 06, 07, 08 09, 10, 11, 12 i need fastest method print it. a simple solution m x n matrix defined double pointer type is: /* print (m x n) matrix */ void mtrx_prn (size_t m, size_t n, float **matrix) { register size_t i, j; (i = 0; < m; i++) { char *pad = "[ "; (j = 0; j < n; j++) { printf ("%s%6.3f", pad, matrix [i][j]); pad = ", "; } printf ("%s", " ]\n"); } } output $ ./bin/mtrx_dyn_example [ 1.900, 2.800, 3.700, 4.600 ] [ 2.800, 3.700, 4.600, 5.500 ] [ 3.700, 4.600, 5.500, 6.400 ] just adjust info type (e.g. int , double , etc...) needed. c

winapi - how do i set an image in button win32 sdk -

winapi - how do i set an image in button win32 sdk - this question has reply here: win32: unable set bitmap button 1 reply how set image button in new dialog box(dialogbox2) opens after clicking button in dialog box(dialogbox1) case wm_initdialog: ha1 = getdlgitem(hdlg, idd_scorpio); hbitmap=loadimage(getmodulehandle(null),makeintresource(img_bitmaparies),image_bitmap,0, 0, lr_defaultcolor); if(hbitmap==null) messagebox(hdlg,"load fail","load",mb_ok); else messagebox(hdlg,"load pass","load",mb_ok); if(sendmessage(ha1,bm_setimage,image_bitmap,(lparam)hbitmap)) messagebox(hdlg,"set pass","set image",mb_ok); else messagebox(hdlg,"set fail","set image",mb_ok); the bitmap loads unable set ima...

Getting ANRs after terminating android service -

Getting ANRs after terminating android service - i've got activity launches local service using bindservice() method. works great while app running, when terminate app , unbind service in activity's ondestroy(), several seconds later see next errors show in logcat: 09-25 02:13:46.035: warn/activitymanager(60): timeout executing service: servicerecord{4401dfc0 net.kicksass.shootingstarbbs.streamstar/.streamstarservice} 09-25 02:13:46.055: info/process(60): sending signal. pid: 285 sig: 3 09-25 02:13:46.055: info/dalvikvm(285): threadid=3: reacting signal 3 09-25 02:13:46.103: info/dalvikvm(285): wrote stack traces '/data/anr/traces.txt' 09-25 02:13:46.103: info/process(60): sending signal. pid: 60 sig: 3 09-25 02:13:46.103: info/dalvikvm(60): threadid=3: reacting signal 3 09-25 02:13:46.203: info/dalvikvm(60): wrote stack traces '/data/anr/traces.txt' ... 09-25 02:13:46.683: error/activitymanager(60): anr in net.kicksass.shootingstarbbs.streamstar 09-25 ...

ruby on rails - How can I create a nokogiri case insensitive text * search? -

ruby on rails - How can I create a nokogiri case insensitive text * search? - currnetly doing words = [] words << "philip morris" words << "philip morris" words << "philip morris" words << "philip morris" word in words doc.search("[text()*='#{word}']") end when using hpricot found downcase results within gem maintain searchs lowercase, nokogiri has been quite hard find 1 that. aware of way this? give thanks much time the lower-case xpath function not available can utilize translate xpath 1.0 function convert text lowercase e.g. english language alphabet: translate(text(),'abcdefghijklmnopqrstuvwxyz','abcdefghijklmnopqrstuvwxyz') i couldn't seem utilize in combination *= operator can utilize contains substring search instead, making total thing: doc.search("//*[contains(translate(text(),'abcdefghijklmnopqrstuvwxyz','abcdefghijklm...

Core-plot grid lines with LabelingPolicyNone -

Core-plot grid lines with LabelingPolicyNone - i have custom labels used labelingpolicynone. labeling policy can't show grid lines. is there way show grid lines labelingpolicynone? the grid lines shown @ tick locations. set majorticklocations , majorgridlinestyle . if don't want tick marks @ same locations, set majorticklinestyle nil . core-plot

How to keep original program format when copying to vim? -

How to keep original program format when copying to vim? - this question has reply here: turning off auto indent when pasting text vim 13 answers there, i found every-time when re-create piece of code eclipse vim, format totally screwed up, , indentation broken adding lots of tabs in vim. has clues how maintain original programme format when copying vim? try enabling paste mode: set paste vim

sql - Java prepared statement is not working? -

sql - Java prepared statement is not working? - i writing database program. stuck java prepared statement. prepared statement doesn't seems working. spend several hours create work still same result. string sql = "insert edmsdatabase.message (title, subject, description, deadline) values (?, ?, ?, ?)"; seek ( preparedstatement statement = connection.preparestatement(sql, statement.return_generated_keys); ) { statement.setstring(1, bean.gettitle()); statement.setstring(2, bean.getsubject()); statement.setstring(3, bean.getdescription()); statement.setstring(4, bean.getdeadline()); int affectedrow = statement.executeupdate(); if(affectedrow == 1) homecoming "success"; } grab (sqlexception e) { } finally{ } note bean parameter ...

In Java what does >> or << mean? -

In Java what does >> or << mean? - this question has reply here: java “bit shifting” tutorial? [closed] 8 answers its been few years since have done java. trying write programme scratch calculates s-des encryption , decryption. looking @ current code online aide on how set program. not sure original author trying do... here piece of code..again its not mine, & i'm not copying it, i'm trying understand doing here? public class sdesproject { public static void main( string args[]) throws exception { scanner keyboard = new scanner(system.in); system.out.println("please come in 10 bit key :"); int k = integer.parseint(keyboard.nextline(),2); sdes = new sdes( k); system.out.println("enter 8 bit plaintext : "); int m = integer.parseint(keyboard.nextline(),2); system.ou...

java - AlarmManager is calling multiple times on Samsung devices -

java - AlarmManager is calling multiple times on Samsung devices - i'm facing troubles class alarmmanager on samsung devices. here's do. i have class updateservice extends intentservice , want start service every selected period of time (e.g. every 10 minutes). below code use: intent intent = new intent(context, updateservice.class); pendingintent pendingintent = pendingintent.getservice(context, 0, intent, 0); alarmmanager alarmmanager = (alarmmanager) context.getsystemservice(context.alarm_service); alarmmanager.setrepeating(alarmmanager.rtc_wakeup, system.currenttimemillis(), 600000, pendingintent); the point works fine on lg g2, old nexus s, emulator, on quite new samsung devices (tab s 8.4, s4) whenever service starts , stops, it's calling 1 time again immediately, 20-30 , 40 times draining battery , generating important info traffic (i utilize intentservice json object). what can prevent such behavior? java android android-intent alarmm...

javascript - Unwanted "Expand" link won't go away. Can't trace source. display:none; not working. (Wordpress) -

javascript - Unwanted "Expand" link won't go away. Can't trace source. display:none; not working. (Wordpress) - as seen on product @ alcapparel.com: http://www.alcapparel.com/shop/clothing/looter-crop-tee/ as can see word "expand" located in upper left of product image. i've reinstalled yith woocommerce magnifier plugin, reportedly patched 2 days ago, , can't find source of word anywhere in files. i've tried hiding .pp_expand {display: none !important;} but doesn't work either. i'm quite baffled. please help? updated: utilize css forcefully hide it. set in .css file .yith_magnifier_mousetrap { display:none !important; } old answer: html of the link can traced <a style="display: inline;" title="expand image" class="pp_expand" href="#">expand</a> change to <a style="display: none;" title="expand image" class="pp_ex...

python 2.7 - Why won't my nltk classification model persist with joblib? -

python 2.7 - Why won't my nltk classification model persist with joblib? - i've noticed others have had problems on different operating systems , i've heard there may within module disallows loading persistent classification model. i'm using mac python 2.7 , enthought canopy's editor. this i'm using export , appears work: joblib.dump(classifier, 'nbv1.pkl') and i'm using import via shell: joblib.load('nbv1.pkl') this error get: attributeerror: 'freqdist' object has no attribute '_n' i'm assuming means model not exporting properly. have not been able automate export process within programme , must shell. thank much advice. i believe due compatibility issue nltk classifiers. python-2.7 persistence nltk joblib

java - Input event app issues -

java - Input event app issues - i'm working through input event app. app has textfield , button. info entered sent receiver app handles action , must able write textview in main activity. explanation not confusing. this built main app from: http://developer.android.com/guide/topics/ui/ui-events.html this built receiver from: http://developer.android.com/training/sharing/receive.html the main app loads layout blank. receiver crashes on load. can't figure out why, assistance appreciated. mainactivity.java (main app) package com.miller.main; import java.util.list; import android.app.activity; import android.content.intent; import android.content.pm.packagemanager; import android.content.pm.resolveinfo; import android.os.bundle; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; public class mainactivity extends activity { protected void oncreate(bundle savedinstancestate, bundle savedva...