Posts

Showing posts from June, 2015

jquery - Load external content in div & manipulate dom -

jquery - Load external content in div & manipulate dom - what want load external content ( different domain name ) div , manipulate dom of external loaded content. exemple load in div bbc.com , want able select "a" tag link in page. here exemple have done in jscribble $(document).ready(function(){ $('#wrap').contents().find('iframe').mouseenter(function() { $('a').hide(); }); }); in jscribble, have seek create "a" tag react using .hide() function in order see if 'tag' found. seems not found because of cross-domain security. so i'm not sure anymore iframe solution. is there other way load external content within div , manipulate dom ? ( external content have different domain name ) you cannot perform manipulations cross domain iframe because of same origin policy. can fetch iframe content server side , serve coming own domain. these links might help cors,phantom jquery dom iframe cross-do...

ios - CoreLocation: Fence: onClientEventRegionState, invalid state -

ios - CoreLocation: Fence: onClientEventRegionState, invalid state - i testing app viewing logs in xcode > window > devices , found lines: apr 1 17:09:33 myiphone locationd[2763] <error>: fence: requestregionstate, com.myapp.demo/regionid, not found apr 1 17:09:39 myiphone demo[3601] <error>: corelocation: fence: onclienteventregionstate, invalid state, 0 these logs don't appear in console if run app xcode. also, app works fine, it's disturbing. has found similar logs? what's meaning of these logs? thank all. ios xcode core-location

angularjs - Angular directive watch not updating -

angularjs - Angular directive watch not updating - html of view <div class="container-fluid" ng-controller="searchcontroller search"> <pretty-print displayfilecontents="search.displayfilecontents"></pretty-print> </div> directive setup app.directive("prettyprint", function() { return{ restrict: "e", scope: { displayfilecontents: "=" }, template: '<pre id="code" class="prettyprint linenums">{{displayfilecontents}}</pre>', link: function(scope, element, attrs) { scope.$watch("displayfilecontents", function () { element.html(scope.displayfilecontents); prettyprint(); },true); }} }) for reason watch on "displayfilecontents" comes undefined scope.displayfilecontents search.displayfilecontents has value in searchcontroller...i can print html in view , outputs code, ...

c++ - Parsing data, scanf? -

c++ - Parsing data, scanf? - i quite new progamming, parse info in format this: 4 ((182, 207), (385, 153), (638, 639), (692, 591)) first number states number of pairs occur. want save first number of each pair x axis , sec number of each pair y axis. in head wanted save entire line via scanf , seek work around amount of brackets , commas not sure if right method or how implement properly. not want utilize built in containers or string. tried straight away via scanf doing like for(int i= 0; < pair_count;i++){ scanf("(%d, %d)",tabx[i],taby[i]) } but not work :(. don't know how format scanf correctly guess or thought on how wrong. you have input matching characters. it's bit tricky, because , not nowadays after lastly pair of numbers. following sample code solves problem. #include <cstdio> #include <cstdlib> int main() { // 4 ((182, 207), (385, 153), (638, 639), (692, 591)) int pair_count; scanf("%d...

xml - SAPUI5 Table total row at bottom -

xml - SAPUI5 Table total row at bottom - i using sap.ui.table display columns of data. there 12 rows of info - info loaded ajax phone call database. total row @ bottom of columns. can't find examples show totals columns. here little snippet of table in xml view. <table:table id="comprecs" visiblerowcount="12" visible="true" rows="{ path:'/yearinfo/' }" navigationmode="paginator"> <table:toolbar> <toolbar> <label id="rectext" text="comparing " ></label> <input id="startyear" width="15%" value="{/startyear}"/> <label id="seltext" text=" "></label> <input id="endyear" width="15%" value="{/endyear}"/...

java - What is a Null Pointer Exception, and how do I fix it? -

java - What is a Null Pointer Exception, and how do I fix it? - what null pointer exceptions ( java.lang.nullpointerexception ) , causes them? what methods/tools can used determine cause stop exception causing programme terminate prematurely? when declare reference variable (i.e. object) creating pointer object. consider next code declare variable of primitive type int: int x; x = 10; in illustration variable x int , java initialize 0 you. when assign 10 in sec line value 10 written memory location pointed x. but, when seek declare reference type different happens. take next code: integer num; num = new integer(10); the first line declares variable named num , but, not contain primitive value. instead contains pointer (because type integer reference type). since did not yet point java sets null, meaning "i pointing @ nothing". in sec line, new keyword used instantiate (or create) object of type integer , pointer variable num assigned ob...

c - How do I make the MinGW cross compiler use the same libraries as gcc? -

c - How do I make the MinGW cross compiler use the same libraries as gcc? - my programme uses gnu multiple precision arithmetic library deal numbers of arbitrary size. compile using gcc with: gcc main.c -o diff -g -lgmp however, when seek utilize mingw crosscompiler compiler, next error: i686-w64-mingw32-gcc main.c -o diff.exe -g -lgmp main.c:3:46: fatal error: gmp.h: no such file or directory #include <gmp.h>//for files of arbitrary size i tried tell header file was: i686-w64-mingw32-gcc main.c -o diff.exe -i/usr/include -g -lgmp /usr/lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld: cannot find -lgmp collect2: error: ld returned 1 exit status ok, figure found header, cant find library. tried again: i686-w64-mingw32-gcc main.c -o diff.exe -i/usr/include -g -l/usr/lib -lgmp /usr/lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld: cannot find -lgmp collect2: error: ld returned 1 exit status i guess need specify e...

ios - TableView deselectRowAtIndexPath does not call setHighlighted -

ios - TableView deselectRowAtIndexPath does not call setHighlighted - i'm trying alter states of label in table view cell. want maintain cell selected while force different view controller , move view controller tableview. when select row want remove highlight of selected row's lable (deselect selected row) , highlight current row's label. - (void)deselectrowatindexpath:(nsindexpath *)indexpath animated:(bool)animated supposed phone call - (void)sethighlighted:(bool)highlighted animated:(bool)animated highlighted 'no' cell ? note: i'm not uitableviewcontroller. keep cell selected: -(void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { uitableviewcell *cell = [tableview cellforrowatindexpath:indexpath]; cell.selected = yes; //other code } ensure class cell don't have selected = none in interface builder. unselect lastly row: - (nsindexpath *)tableview:(uitableview *)tableview wil...

c++ - Private template classes/structs visibility -

c++ - Private template classes/structs visibility - i don't understand why in next code, allowed create function print_private_template while compiler complains print_private_class : #include <cstdio> class { private: template <unsigned t> struct b { }; struct c { }; public: template <unsigned t> b<t> getab() { homecoming b<t>(); } c getac() { homecoming c(); } }; template<unsigned t> void print_private_template(const a::b<t> &ab) { printf("%d\n", t); } void print_private_class(const a::c &ac) { printf("something\n"); } int main(int, char**) { a; print_private_template(a.getab<42>()); print_private_class(a.getac()); homecoming 0; } is expected behaviour? compiler bug/extension? just clear, goal create compiler...

flex - combobox perfoming different formulas based on user selection -

flex - combobox perfoming different formulas based on user selection - i have datagrid users set in different numbers 3 different columns. these values calculated after user puts in each value each column. have combobox component within datagrid. want combobox perform different mathematical formula based on user selects. example, in combobox if user selects 'long'(the first alternative in combobox) performs column1*(col2-col3)-col4=total column or if user selects 'short'(the sec alternative in combobox) performs col1*(col3-col2)+column4=total column. how that? i've tried different ideas none have seemed work examples or suggestions appreciated. public function gettotal(item:object, column:datagridcolumn):string { switch(combobox) { case "long": var sum:int = item.quantity*(item.exit-item.entry)-item.commission; homecoming currencyformatter.format(sum); case "shor...

jquery - How to create a animate to specific LI in an UL? -

jquery - How to create a animate to specific LI in an UL? - i using jquery .animate scroll ul , downwards can see elements, how create if else statement said. if first li item in ul @ top, dont scroll anymore, , if lastly item @ bottom of visible portion of screen dont scroll more down, else scroll 510 px. right code looks this: $('#down').click(function() { $(".project_thumbs").stop().animate({"top": "-=510px"}); }); $('#up').click(function() { if (".project_thumbs" (top = 0)){ $(".project_thumbs").stop().animate({top:0}); } else{ $(".project_thumbs").stop().animate({"top": "+=510px"}); } remy sharp wrote plugin jquery deals scrolling , whether or not element visible in viewport or not, can find here: http://remysharp.com/2009/01/26/element-in-view-event-plugin/ if @ first comment on page there code adds selector jquery checking whether element visib...

.net - VB6 ActiveX Controls in a C#/ASP.NET Based Website -

.net - VB6 ActiveX Controls in a C#/ASP.NET Based Website - we have website based on c# , asp.net, have barcode scanner .dll file command can work in vb6. before dig deeper in how wanted quick reply on if possible want first. can write activex command in vb6 allow me command barcode scanner , implement activex command in our .net based website? just clear, not asking how it, asking if can done. haven't done activex programming before , haven't touched vb6 in long time. thanks! i believe should possible; need implement javascript , activex objects. require user's browser setup allow web site interact activex objects. simple illustration of this, using link start programme (like remote desktop client): <script type="text/javascript"> function runmstsc() { var command="mstsc.exe /v:127.0.0.1 /w:1024 /h:768"; var scripthost = new activexobject("wscript.shell"); scripthost.run(file); ...

Is everything in Ruby can be used in Rails? -

Is everything in Ruby can be used in Rails? - it might silly question, in ruby works in rails? i mean rails did not overwrite anything, added new things ruby, right? (sorry silly question. learnt rails 4 months , no experience in ruby yet (except rails ;d)). rails framework written in ruby, in principle should able utilize library, class or module want to. not makes sence, gui frameworks etc. the ruby implementation , platform you're running on may have limitations, may not work on windows server, or on macruby or jruby etc. ruby-on-rails ruby

In sharepoint, how to list all webpartzones of a specific page from object model approach? -

In sharepoint, how to list all webpartzones of a specific page from object model approach? - i'm using sharepoint object model , after spending hours problem, looks splimitedwebpartmanager doesn't have "zones" property (available in spwebpartmanager). cannot believe splimitedwebpartmanager able retrieve webparts on specific page (an spfile), each 1 respective webpartzone assigned, , not able retrieve webparzones of file! any ideas? thanks in advance! nuno alas, spwebpartzone bit of mysterious topic in sharepoint object model. far know, there no way identify zones using splimitedwebpartmanager. sharepoint

Paypal Cart Discount -

Paypal Cart Discount - how add together code give discount of $19.99 if paypal cart total on $ 99.00? <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="hnsabc@mail.com"> <input type="hidden" name="lc" value="us"> <input type="hidden" name="item_name" value="apex creatine .47lbs"> <input type="hidden" name="item_number" value="91037 97366 promo"> <input type="hidden" name="amount" value="35.99"> <input type="hidden" name="currency_code" value="usd"> <input type="hidden" name="button_subtype" value="services"> <input type="hidden...

rdp - WPF MediaElement on Remote Desktop -

rdp - WPF MediaElement on Remote Desktop - i have simple wpf application has media element: <mediaelement name="themedia" stretch="fill" loadedbehavior="play"/> i initialize source in code behind: public mainwindow() { initializecomponent(); string file = string.format(@"{0}\{1}", environment.currentdirectory, "movie.mp4"); uri uri = new uri(file); themedia.source = uri; } when run on computer works when run on remote desktop 1 of 2 things dependent on rd sesion host configuration -> rdp-tcp -> properties -> client settings -> sound , video playback: if checked, see video no sound if not checked, hear video no display any ideas? wpf rdp

iphone privateapi - Enable mobile data on non-jailbroken iOS -

iphone privateapi - Enable mobile data on non-jailbroken iOS - i want create tweak can set in notification center deed replacement sbsettings on non-jailbroken phone. as me, utilize private apis accomplish this. i have arrangement of different settings, wi-fi, mobile data, ... now have found an answer says how can done on jailbroken ios version, , how can achieved through using notify_post , guess notify_post either jailbroken function, or removed one. how can alter global settings within app? how ios' settings.app it? can re-create way? ios iphone-privateapi

java - How to find classes by annotation on classpath? -

java - How to find classes by annotation on classpath? - this question has reply here: scanning java annotations @ runtime 15 answers on startup of spring-boot application want perform scan @entitiy classes on classpath. moreover, i'd filter entities @customannotation . i want create kind of auto configuration, , utilize bundle of entities found in: entitymanagerfactorybuilder .datasource(ds) .packages(getpackages())) but don't want explicit define bundle there appropriate entities found, find them on startup. possible @ all? i don't know reply in order have annotations on compiled class files, must defined follows @retention(retentionpolicy.runtime) java spring spring-boot

asp.net - Method to import excel to sql thru aspnet without using OleDB -

asp.net - Method to import excel to sql thru aspnet without using OleDB - hi there ui/controllers aspnet(either c# or vb) or method read/dump excel sql without using openrowset(''microsoft.jet.oledb.4.0')? suggestion highly appreciated...thanks... not sure if help but. utilize connection string vb.net form application. sconnectionstring = "provider=microsoft.ace.oledb.12.0;data source=" & sfilename & ";extended properties = ""excel 12.0 xml;hdr=no""" ssql = "select * [sheet1$] f1 not null , f1 <> ''" dim oleconn new oledbconnection(sconnectionstring) dim cmd = new oledbcommand(ssql, oleconn) dim oleadapter new oledbdataadapter(cmd) oleadapter.fill(dt) then utilize sql mass re-create write dt sql table bulkcopy.columnmappings.add(0, 0) bulkcopy.destinationtablename = "sometable" bulkcopy.writetoserver(dt) if don't utilize oledb, assume need utilize excel appl...

c++ - undefined reference to `xdo_new(char const*)' -

c++ - undefined reference to `xdo_new(char const*)' - this question has reply here: position of compiler flag -l 2 answers i seek invoke libxdo in cpp following: #include <xdo.h> int main() { xdo_t *xdo = xdo_new(null); homecoming 0; } and run g++ /home/roroco/dropbox/try/c/try/main.cpp -lxdo , raise /tmp/ccwh9hhs.o: in function `main': main.cpp:(.text+0xe): undefined reference `xdo_new(char const*)' collect2: error: ld returned 1 exit status please tell me happen? update: have install libxdo still error. your compilation flags in wrong order. write -lxdo after main.cpp . c++ g++

javascript - Highlight all text between two elements -

javascript - Highlight all text between two elements - given next illustration html, highlight text between 2 image tags (by adding css background property). have tried using jquerys .nextuntil() uses sibling nodes of first element , in case not work. edit: image tags below intended invisible placeholders denoting start , end points comment corresponding id within text editor, in-between focus comment. <div> <p> lorem ipsum dolor <img class="commentboundarystart data-commentid="1" src="img.png"/> sit down amet," </p> <p> consectetur adipiscing elit. </p> <h2>header</h2> <p> sed maximus laoreet augue <img class="commentboundaryend" data-commentid="1" src="img2.png"/> , in ultrices sapien lobortis eu. </p> <p> loremmmmm </p> </div...

Build some sort of workflow in JavaFX -

Build some sort of workflow in JavaFX - i'm trying build sort of visual workflow in javafx. want application have 1 main screen next , previous buttons, installer. when user clicks next, elements of next screen appear in same element. previous choices of user have saved. when user clicks on previous button of choices still there. how go on this? i found these links on google, don't seem help me. bit direction want go, code in tutorial isnt't scene's lot of elements. the datafx framework provides flow api can used define workflows. doing can navigate between mvc groups using annotations or configurations. can find examples of api here: http://www.guigarage.com/2014/06/datafx-tutorial-5/ http://www.guigarage.com/2015/02/quick-overview-datafx-mvc-flow-api/ http://www.guigarage.com/2015/01/datafx-tutorial-6/ javafx-8

security - Is it possible to have a one way socket.io connection? -

security - Is it possible to have a one way socket.io connection? - my application needs socket.io send info server client. prevent denial of service attacks, want disconnect client if tries emit data. possible? i've looked @ stackoverflow questions: force client disconnect server socket.io , nodejs how protect against distributed denial-of-service attacks in node.js socket.io? but i've not been able find working solution. there alternative cache events (from here socket.io client: respond events 1 handler?). then on event disconnect client on server side. var socket = io.connect(); var globalevent = "*"; socket.$emit = function (name) { if(!this.$events) homecoming false; for(var i=0;i<2;++i){ if(i==0 && name==globalevent) continue; var args = array.prototype.slice.call(arguments, 1-i); var handler = this.$events[i==0?name:globalevent]; if(!handler) handler = []; if ('function...

asp.net - resource cannot be found VB.NET -

asp.net - resource cannot be found VB.NET - i have vb.net web project. when i'm clicking on menu item attached error comming. folder there. other menu items there no issue. can this? asp.net vb.net vb.net-2010

In Ocaml, how to get stdout string from subprocess? -

In Ocaml, how to get stdout string from subprocess? - i'm working ocaml , need start new process , communicate it. if subprocess terminated 1 time it's called , produced output, how retrieve strings in it's stdout? what if subprocess never terminates? is, everytime given string stdin, produce result stdout, how fetch result? use unix.open_process_in function. spawn process , homecoming input channel, allow read info process. if want wait process terminate, can read info (i.e., wait until process pipe returns eof), , close channel, e.g., (* [run cmd] runs shell command, waits until terminates, , returns list of strings process outputed *) allow run cmd = allow inp = unix.open_process_in cmd in allow r = in_channel.input_lines inp in in_channel.close inp; r working non-terminating process easier. you may find interesting lwt library has descent interface multiprocessing. , async library asynchronous library provide first-class ...

swift - Type [SubscriptType] does not conform to protocol StringLiteralConvertible error -

swift - Type [SubscriptType] does not conform to protocol StringLiteralConvertible error - type [subscripttype] not conform protocol stringliteralconvertible // jsonrequest.swift class jsonrequest { var title: string? var postbody: string? var coverimage: string? init(json: nsdictionary){ self.title = json["title"] as? string self.postbody = json["body"] as? string self.coverimage = json["img_url"] as? string } } // viewcontroller.swift file var posts = [jsonrequest]() allow feedurl = nsurl(string: "http://example.com/json") // 2 if allow jsondata = nsdata(contentsofurl: feedurl!) { // 3 var jsonresult = nsjsonserialization.jsonobjectwithdata(jsondata, options: nsjsonreadingoptions.mutablecontainers, error: nil) nsdictionary var myjson = json(jsonresult) allow arraylength = myjson["dump"].array?.count if arraylength != 0 { postindex in 0...arrayle...

android - Contextual ActionBar not showing on ListView with EditTexts -

android - Contextual ActionBar not showing on ListView with EditTexts - my listview contains edittext part of each row , cab won't show when long press row. it show if i: change edittext textview or set focusable="false" in edittext or set descendantfocusability="blocksdescendants" in parent view (a linearlayout) it didn't help to: set descendantfocusability="beforedescendants" (or after) in parent view. how can have cab , working edittext @ same time? cab on long press isn't default behavior. have tried registering list context menu? http://stackoverflow.com/a/17207576/850734 android focus contextual-action-bar

oracle11g - BPEL 2.0 Dynamic Partnerlink error: fromValue is not a sref:service-ref element -

oracle11g - BPEL 2.0 Dynamic Partnerlink error: fromValue is not a sref:service-ref element - i want invoke web service bpel 2.0 dynamically, seek update partnerlink endpointreferencetype, when compile there warning warning(107): from-spec of "ns4:endpointreferencetype" not compatible to-spec of "ns1:process" and when test request web service got error <env:fault xmlns:ns0="http://docs.oasis-open.org/wsbpel/2.0/process/executable"> <faultcode>ns0:selectionfailure</faultcode> <faultstring>fromvalue not sref:service-ref element</faultstring> <faultactor/> <detail> <exception/> </detail> </env:fault> the assign script is: <copy> <from>$endpointreference</from> <to partnerlink="service1"/> </copy> it's running on bpel 1 next script <copy> <from v...

Cannot run a Grails Application on the Linux Server - Tomcat and H2 database -

Cannot run a Grails Application on the Linux Server - Tomcat and H2 database - i want run grails application on linux server embeded h2 database, tomcat , gradle. specs below grails 2.4.4 groovy 2.3.7 gradle 2.2.1 tomcat 7.0.59 linux centos 6 the buildconfig.groovy below dependencies { test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4" } plugins { build ":tomcat:7.0.55" compile ":scaffolding:2.1.2" compile ':cache:1.1.8' compile ":asset-pipeline:1.9.9" runtime ":hibernate4:4.3.6.1" runtime ":database-migration:1.4.0" runtime ":jquery:1.11.1" } the detasourece.groovy below datasource { pooled = true jmxexport = true driverclassname = "org.h2.driver" username = "sa" password = "" } hibernate { cache.use_second_level_cache = true cache.use_query_cache = false // cache.region.factory_class...

java - Slick2D updating text/click options -

java - Slick2D updating text/click options - hey im working on little project in slick2d, im trying add together interaction between player , npc can click select reply. public class house extends basicgamestate { image house; image message; int msgid = 0; ... public house(int state) { } public void init(gamecontainer gc, statebasedgame sbg) throws slickexception { ... } public void render(gamecontainer gc, statebasedgame sbg, graphics g) throws slickexception { house.draw(playerpositionx, playerpositiony); player.draw(shiftx, shifty); if (exithouse == true){ g.drawstring("would exit house? y/n", 520, 270); } if (msgid == 1){ message.draw(0, 570); mollerface.draw(39, 610); ttf.drawstring(46,588, "moller"); ttf.drawstring(180, 609, "'ello fella, interested in russian dolls?"); ttf.drawstring(908, 613, "- russian dolls?" );//option 1 ...

php - Get most recent record from MySQL - this have many duplicate records -

php - Get most recent record from MySQL - this have many duplicate records - i trying fetch recent record db. table looks below. ticket_id| date| comments ewu-752-84170| 4/10/2015 13:26|bla hcx-943-86125| 4/10/2015 13:39| ola ikw-626-96314| 4/10/2015 13:42| jkj ewu-752-84170| 4/10/2015 13:28| blo ewu-752-84170| 4/10/2015 13:37| ala hcx-943-86125| 4/10/2015 15:11| kbdkj ewu-752-84170| 4/10/2015 13:43| cla and output should send recent records below. ticket_id| date| comments ewu-752-84170| 4/10/2015 13:43| cla hcx-943-86125| 4/10/2015 15:11| kbdkj ikw-626-96314| 4/10/2015 13:42| jkj this select tickets ticket later date not exist (therefore selects latest tickets) select * mytable t1 not exists ( select 1 mytable t2 t2.ticket_id = t1.ticket_id , t2.date > t1.date ) php mysql sql

osx - How to open a symlink without the terminal window popping up? -

osx - How to open a symlink without the terminal window popping up? - how can open symlink without terminal window popping up? moreover, when close terminal window, application quits well. tried using nohup open symlink1 without results. have made symlink itunes executable (the 1 within contents package, not itunes.app) want able open double clicking link, without terminal window popping up. why not create hfs+ alias? command-option-drag itunes app anywhere want on machine, , should work want to. osx terminal symlink nohup

api - CURL can't connect? Just hangs and doesn't respond. PHP has it enabled -

api - CURL can't connect? Just hangs and doesn't respond. PHP has it enabled - i have simple php function on friend server i've checked , has php curl enabled. the function is: function sw_fetch_code($apikey='',$email=''){ $url = "http://www.domain.com/xxx/api.php?getcode=1&apikey=".$apikey."&email=".$email.""; $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_header, 1); $result = curl_exec($ch); curl_close($ch); $obj = json_decode($result); if(!empty($obj)){ if($obj->status == 200){ homecoming $obj->code; }else{ homecoming $obj->status; } } } as can see simple , i've tested , works on localhost , internal own server. url returns expected. doesn't give response when function called on friends server. any ideas cause this? first : check "friend" server if...

actionscript 3 - Action Script: Call corresponding functions on button click -

actionscript 3 - Action Script: Call corresponding functions on button click - i have been trying add together buttons dynamically , assign event listeners them. code is, var i=0; var step=50; each (var child:xml in coursexml.footer.tray.elements()) { var thumbclip:thumb = new thumb(); //set name thumbclip.name = "mc_thumb" + (i + 1); trace("thumbclipname:: "+thumbclip.name); //set x , y values thumbclip.x = 620 + (i * step); thumbclip.y = 560; //attach newly created instance container addchild(thumbclip); trace("thumbclip:: "+thumbclip); //attach icon image xml path thumbclip.thumbloader.source = child.icon; trace("thumbclip.thumbloader.source: "+thumbclip.thumbloader.source); //add listeners trace("node name "+ child.localname()); if(child.localname().tolowercase() == ...

java - Reading words and numbers out of a text file -

java - Reading words and numbers out of a text file - i writing programme reads text file , adds unique words , numbers arraylist. used delimiter nosuchelementexception when run program. delimiter wrong or did create mistake? here program: import java.util.*; import java.io.*; public class indexer { public static void main(string[] args) throws filenotfoundexception { scanner filescanner = new scanner(new file("file.txt")).usedelimiter("[.,:;()?!\" \t]+~\\s"); int totalwordcount = 0; arraylist<string> words = new arraylist<string>(); while ((filescanner.hasnext()) && (!words.contains(filescanner.next()))) { words.add(filescanner.next()); totalwordcount++; } system.out.println("there " + totalwordcount + " unique word(s)"); system.out.println("these words are:"); system.out.println(words.tostring()); filescanner.close...

fonts - JavaFx 8 - Changing CSS style property values at runtime -

fonts - JavaFx 8 - Changing CSS style property values at runtime - i have scale/change button's text size dynamically default values in css .button { -fx-font-size: 20; } in javafx button.getstyleclass().add("button"); now have scale fonts factor 2 there no way find existing font size multiply factor button.setstyle("-fx-font-size:"+oldval*2); how existing font size ? it's easy using button.getfont().getsize(); it works after stage shown. css fonts javafx javafx-8

java ee - How to display a jsp with over 64k bytes -

java ee - How to display a jsp with over 64k bytes - i'm trying dispaly jsp page (generated @ runtime) in app , when take button on main page dispaly results of operation generates jsp, next error: org.apache.jasper.jasperexception: unable compile class jsp: error occurred @ line: [38] in generated java file: [c:\users\tom\programming ides\workspace-eclipse-java-web\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\work\catalina\localhost\laeweb\org\apache\jsp\web_002dinf\test_jsp.java] code of method _jspservice(httpservletrequest, httpservletresponse) exceeding 65535 bytes limit how display jsp pages on 64k of data? jsp has numbers info on 16,800 lines 5 numbers per line. if possible split jsp page more 1 page , utilize jsp include directive.it work. jsp java-ee

cloud - How can I identify Ip Address , which is downloading unnecessary data? -

cloud - How can I identify Ip Address , which is downloading unnecessary data? - we using 4 different networks net access in our building. wants know ip address downloads taking place (eg. movies,songs etc.), slows downwards net speed , hamper our work cloud based. thanks in advance valuable suggestions!! cloud

osx - Use CIColorCube for histogram normalization -

osx - Use CIColorCube for histogram normalization - as understand, cicolorcube specifies general mapping color values color values. seems utilize cicolorcube adjust contrast normalizing v value in hsv space. below histogramnormalizer class colorcube property returns repopulated cicolorcube object. apply ciimage. const nsinteger kcolorcubesize = 64; @implementation histogramnormalizer -(id)initwithimage:(ciimage *)image { self = [super init]; if (self) { civector *extent = [civector vectorwithcgrect:image.extent]; cgrect extentrect = image.extent; cifilter *maxfilter = [cifilter filterwithname:@"ciareamaximum" keysandvalues:@"inputimage", image, @"inputextent", extent, nil]; self.maxvalue = [self getvaluefromimage:[maxfilter valueforkey:@"outputimage"]]; cifilter *minfilter = [cifilter filterwithname:@"ciareaminimum" keysandvalues:@"inputimage", image, @"inputext...

java - Map reduce: how to implement a custom writable with a whole file input reader -

java - Map reduce: how to implement a custom writable with a whole file input reader - some background: facing problem of analyzing big info of little text files. * let's each text file contains lot numbers , want able read whole file in order access of it, within mapper class. * also, want create profile each text file. - mapper input single file. - mapper output next pair: when profile writable object. - reducer input be: - reducer output: these requirements.. know whole file reading isn't efficient, of import me that. i wrote code, run time error in bold line. (tripprofile = values.next() - within reducer class). i don't think it's writable issue, think writable profile fine, fields writable , has 2 methods of read , write.. suspect has "wholefilereader". thanks lot, public class examplefileinputformat extends configured implements tool { /** * class: "input format" responsible validating input * configuration. * 2. spl...

playframework - securesocial 3.0-M3 get current user in view templates -

playframework - securesocial 3.0-M3 get current user in view templates - i used utilize object method extracts user request.but in securesocial 3.0-m3 playframework 2.3.8, requestwithuser doesnt work anymore. there other way user or have pass user controller in 3.0? userinfo object userinfo { def getcurrentuser(implicit request: requestheader): option[identity] = { request match { case r: securedrequest[_] => some(r.user) case r: requestwithuser[_] => r.user case _ => none } } } view.scala.html @(title: string)(content: html)(implicit request: requestheader) @import app.auth.userinfo <html> <head></head> <body>welcome @userinfo.getcurrentuser !</body> </html> playframework playframework-2.3 securesocial

android - Is there an easy way to prompt the user for his preferred notification tone? -

android - Is there an easy way to prompt the user for his preferred notification tone? - i'm trying create notification uses different sound notification.default_sound. there easy way can pop sound picker user can take from? , how utilize sound picked notification? like things in android, can broadcast intent. example. here total intent description in android docs. android notifications

c# - Regex to detect incomplete HTML -

c# - Regex to detect incomplete HTML - i'm trying write search , replace regex observe whether html has been returned web request complete. have had cases when server returns incomplete html (half of page), want observe in client , request page again. i thinking regex presence of <html[^>]*> , , absence of </html> . replace part replace whole html bit of special text. i can't check absence of </html> because returned info might text file, , can't check mime types. any ideas? can't wrap head around look-behinds require. i'm not trying parse html, searching bits of text, regexes for, right? edit: the regexes run c#, write them in regex editor. can utilize search , replace regex solve this, nil else. oded correct. cannot parse html regex. of course of study can see whether (multiline) string contains <html> not followed </html> . if sure whatever web request returns consistent , not contain weird things ht...

jetty - Bayeux code example for Resin 4 -

jetty - Bayeux code example for Resin 4 - anyone have working (simple) illustration source code of bayeux + comet back upwards in resin 4? thanks. (or if not, jetty?) i have jetty, sample app called jaye. here's url it: http://jaye.felipera.cloudbees.net it uses raphael js map, maven, comet, bayeux, java, usual suspects. can checkout blog post it: http://geeks.aretotally.in/thinking-in-reverse-not-taking-orders-from-yo. inside blog find info source code , everything. let me know if can help anything. thank you, felipe jetty comet resin cometd bayeux

c - Is int ever needed on x64? -

c - Is int ever needed on x64? - c code targeting x64, has been discussed, should utilize size_t instead of int things counts , array indexes. given that, arguably simpler , less error prone standardize on size_t (typedef'd shorter) instead of int usual integer type across entire code base. is there i'm missing? assuming don't need signed integers, , you're not storing big arrays of little integers (where making them 32 bits instead of 64 bits save memory), there reason utilize int in preference size_t? i in contrary, prefer prepare size of integers, uint8_t ... uint64_t (and sometime unit128_t ), , these base of operations types. know get. and other typedef size_t aliasing these. inspect typedef uintprt_t , deduce address width, e.g. and also, people need signed types sure. relation clarified. in standard, signed types sort of deduced unsigned types. made explicit forcing prefix signed . sure later wouldn't happen, people much emoti...

javascript - Can't use React.findDOMNode function -

javascript - Can't use React.findDOMNode function - for reason, i'm not able utilize react.finddomnode function. browser complains type error, saying react.finddomnode not function. code happens: class="snippet-code-js lang-js prettyprint-override"> var react = require('react'); var backbone = require('backbone'); var auto = require('models/car'); var newcarform = react.createclass({ handlesubmit: function(e) { e.preventdefault(); var brand = react.finddomnode(this.refs.brand).value.trim(); ... this.props.handlenewcar(new car({brand: brand, model:model, name:name, kmtraveled:odometer, litresspent:litres})); return; }, render: function() { console.log("inside newcarform"); homecoming ( <form classname="contentsection" onsubmit={this.handlesubmit}> <input type="text" placeholder="car brand" ref="brand" /...

java - Using AnkhSVN with Visual Studio & CentOS CSVN Repo -

java - Using AnkhSVN with Visual Studio & CentOS CSVN Repo - my goal connect csvn on centos server through ankhsvn on msvs. question occurs problems i've ran through setting csvn. here's i've done far. i've installed openjdk-7 on centos server i've installed jdk-7u_45 oracle website , unpacked rpm i've set export /usr/java/jdk-7u_45/ in nano ~/.bash_profile i've set java_home=/usr/java/jdk-7u_45/ in nano csvn/data/conf/csvn.conf after running ./csvn start csvn/bin/csvn next error: unable start csvn console: minimum java version not found please create sure java_home points jdk of @ to the lowest degree version 1.6 running echo $java_home terminal output: /usr/java/jdk1.7.0_75/bin/java what issue? , how prepare can ./csvn start on centos server can connect repository through ankhsvn on msvs2012 platform? java svn centos collabnet

javascript - Absolute center with jquery return margin-left 0 -

javascript - Absolute center with jquery return margin-left 0 - i have designed jquery plug-in website, purpose of helping center element absolute position, using pixels , not percentage. when page starts, elements centered vertically not horizontally (margin-left=0). when utilize same script in console, apply element , works. code append function : $(document).ready(function() { $(element).psfcenter(); }); function : (function ($){ // center element $.fn.psfcenter=function(orientation){ homecoming this.each(function() { var widthparent=$(this).parent().width()/2; var heightparent=$(this).parent().height()/2; var widthelement=$(this).width()/2; var heightelement=$(this).height()/2; var left=widthparent-widthelement; var top=heightparent-heightelement; console.log(orientation) switch(orientation){ case"x": $(this)...

Sending an email via perl script -

Sending an email via perl script - i next course of study of perl , have received task send myself email perl@perlrocks using mail::sendmail module. though have read documentation, still don't understand how it. example, utilize gmail normal email, should configure gmail smpt protocol in script? please give me hint on how start? it depends on environment. if you're running script on linux server, create sure sendmail utility installed (most distributions have pre-installed). if you're on non-linux machine, install mailserver on or utilize external smtp server. although specific mail service module does not back upwards smtp authentication, external smtp servers (like google/gmail) require. if have mailserver allow smtp connections machine perl script runs on, can simple as: use mail::sendmail qw(sendmail %mailcfg); %mail = ( => 'you@example.com', => 'me@example.com', message => "hello wo...

javascript - Highlight Text plugin breaks when using with array string -

javascript - Highlight Text plugin breaks when using with array string - i trying utilize jquery based text highlight plugin, works single word highlight breaks when pass array, syntax seems right the documentation http://bartaz.github.io/sandbox.js/jquery.highlight.html example: http://jsfiddle.net/yyaxp/6/ //$('#article').highlight("me"); $("#article").highlight(["me","highlight","plugin"]); i need pass several keywords function highlight of them. solved: it seems script had bug resolved utilize next fiddle finish script array based search highlight script source fiddle: http://fiddle.jshell.net/ogyyvvog/2/ it gets error when running code pat.touppercase not function pat should array, maybe can prepare in way? return this.length && pat && pat.length ? this.each(function () { for(var i=0;i<pat.length;i++) innerhighlight(this, pat[i].touppercase()); ...

java - Uploading is not working in selenium using Robot in Chrome Broswer -

java - Uploading is not working in selenium using Robot in Chrome Broswer - i using robot class upload file it's not working. file explorer appearing uploading robot class not working: driver = new firefoxdriver(); driver.get("http://www.toolsqa.com/automation-practice-form"); driver.manage().window().maximize(); driver.findelement(by.id("photo")).click; thread.sleep(2000); stringselection stringselection = new stringselection("c:\\users\\desktop\\bug\\ui_1.png"); toolkit.getdefaulttoolkit().getsystemclipboard().setcontents(stringselection, null); robot robot = new robot(); robot.keypress(keyevent.vk_enter); robot.keyrelease(keyevent.vk_enter); robot.keypress(keyevent.vk_control); robot.keypress(keyevent.vk_v); robot.keyrelease(keyevent.vk_v); robot.keyrelease(keyevent.vk_control); robot.keypress(keyevent.vk_enter); robot.keyrelease(keyevent.vk_enter); how ever robot working fine using chrome browser. facing issue firefox. ther...

java - ClassNotFoundException when compiling JRXML with Maven -

java - ClassNotFoundException when compiling JRXML with Maven - i utilize in jrxml object of application a : <jasperreport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="resporttest" pagewidth="842" pageheight="595" orientation="landscape" whennodatatype="allsectionsnodetail" columnwidth="802" leftmargin="20" rightmargin="20" topmargin="20" bottommargin="20"> <property name="ireport.zoom" value="1.5394743546921226"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <import value="com.test.app.enumone"/> <import value=...

python - Why is multiprocessing's apply_async so picky? -

python - Why is multiprocessing's apply_async so picky? - sample code works without issue: from multiprocessing import * import time import random def myfunc(d): = random.randint(0,1000) d[a] = print("process; %s" % a) print("starting mass threads") man = manager() d = man.dict() p = pool(processes=8) in range(0,100): p.apply_async(myfunc, [d]) p.close() p.join() print(d) print("ending multiprocessing") if alter p.apply_async(myfunc, [d]) p.apply_async(myfunc, (d)) or p.apply_async(myfunc, d) pool not work @ all. if add together arg myfunc , pass in none it'll work p.apply_async(myfunc, (none, d)) — why? the documentation apply_async says following: apply(func[, args[, kwds]]) call func arguments args , keyword arguments kwds . blocks until result ready. given blocks, apply_async() improve suited performing work in parallel. additionally, func executed in 1 of workers of pool. thu...

ios - magical record delete one to many relationship all children -

ios - magical record delete one to many relationship all children - i have 1 many relationship teacher students. want delete students of given teacher. utilize code this: [student mr_deleteallmatchingpredicate:[nspredicate predicatewithformat:@"teacher == %@" argumentarray:@[teacher]]]; ... deletes given teacher. how prepare this? i fixed changing delete rule "cascade" "no action". ios objective-c core-data magicalrecord

websocket - PHP socket_read only reading 8192 bytes of data -

websocket - PHP socket_read only reading 8192 bytes of data - i have 2 parts of code below. 1 sending info , 1 reading out of socket whatever set 3rd parameter in socket_read read 8192 bytes of info when total length of info 14329 bytes , i've set buffer 102400 bytes. //sending $this->ip = "10.0.6.65"; $this->port = 10003; $fp = fsockopen($this->ip, $this->port, $errno = '', $errstr = '', 120); fputs($fp, $_message, strlen($_message)); //reading $socket=socket_create(af_inet,sock_stream,0); socket_bind($socket,$config['host'],$config['port']); socket_listen($socket, $config['max_client']; $comsocket = array('socket'=>$socket); $comsocket[$i]['socket'] = socket_accept($socket); do{ $this->socketinput .= socket_read($comsocket[$i]['socket'], 102400); if ($this->socketinput == '') { socket_close($comsocket[$i]['socket']); break;...

javascript - Why is document.getElementById() returning a null value when I know the ID exists? -

javascript - Why is document.getElementById() returning a null value when I know the ID exists? - i'm working on custom javascript cms template @ work. want able create <li> element on page receive class of "current" page only. in global page head have this: <script type="text/javascript"> function makecurrent(id) { var current = document.getelementbyid(id); current.setattribute("class", "current"); // browsers current.setattribute("classname", "current"); // ie } </script> then in each individual page <head> , have this: <script type="text/javascript">makecurrent("undergraduate")</script> on page have nav <ul> , like: <li id="undergraduate"><a href="...">undergraduate program</a></li> <li id="graduate"><a href="...">graduate program</a...

java - How to get Map values? -

java - How to get Map values? - i have defined clusters variable shown below in java. hashmap<double[],string> clusters = new hashmap<double[],string>(); my question how can access string values 1 1 clusters? ex. string name=clusters."?"; you can iterate values using map.values() : for (string value : clusters.values()) { // ... whatever. } java hashmap

event sourcing - Passing around complete objects when applying CQRS/ES -

event sourcing - Passing around complete objects when applying CQRS/ES - through research i've done implementing cqrs/es (i'm aware aren't tied each other), haven't yet seen total object passed command. for example, why shouldn't take in parameters bug in bug-tracking api so: [httppost] public iactionresult createbug([frombody] bug bug) { if (!modelstate.isvalid) { homecoming new httpstatuscoderesult(400); } else { commandhandler.handle(new openbug(bug)); homecoming new httpstatuscoderesult(201); } } where openbug command: public class openbug : icommand { public guid id { get; set; } public models.bug newbug { get; set; } public openbug(models.bug bug) { id = guid.newguid(); newbug = bug; //create bugopened event here (and add together event sequence?) } } from i've seen, it's handled more this: commandhandler.handle(new openbug(bug.description, bug....