Posts

Showing posts from August, 2011

c++ - Abstract base member variable in base class -

i want specify interface requires abstract class have type member variable. i'll try replicate situation here: class blob { int data[32]; }; class worker { string name; abstract void workon(blob&) = 0; } class abstract { vector<shared_ptr<w>> workerlist; blob allthestuff; abstract void somethingelse() = 0; void doallthework() { (w : workerlist) { w->workon(allthestuff); } } }; class b_blob : public blob { int moredata[4096]; }; class bulbasaurtrainingcamp : public abstract { b_blob allthestuff; void somethingelse() {} // implemented // class accept bulbasaurs workerlist }; class bulbasaur : worker { bulbasaur(): name("fushigidane") {} void workon(blob& b) { // bulbasaurs cover *all* workspace crap (int i=0; i<sizeof(b.data[0])/sizeof(b.data); ++i) { b.data[i] = *((int*)&("crap")); } (i=0; i<sizeof(b.moredata[0])/sizeof(b.moredata); ++i) { b.moredata...

java - Specifying which subclass in super class constructor -

i trying first populate list of generic objects , later instantiate them, , when instantiating them, specify of objects each is. the use-case working on reading data file , constructing map, has various interactable objects. type of interactable each object is stored in it's own data file directed map's data file. code example: in reading map: if ((char)map[i][j] == '*') mapobjects.add(new mapobject()); and afterward: (int = 0 ; < mapobjects.size() ; i++) mapobjects.set (i, new mapobject(in.readline())); //in.readline gives path file in mapobject's constructor: public mapobject (string in){ try{ bufferedreader br = new bufferedreader(new filereader("src/data/" + in + ".txt")); int temp = integer.parseint(br.readline()); if (temp == 0) = new door (); //this apparently not allowed /*continue instantiate door's fields data fi...

Copy the Value upto specific range using regular expression extractor in JMeter -

i want capture range of values using regular expression extractor in jmeter. "sessionid": "15f36c8a123d4483935062dde73280cb\x2d0\x3a1", in above value need exclude \x2d0\x3a1 , capture value. you have define 2 regular expression, assuming x2 , x3 enough token separate these 2 fields. 1st : x2([0-9a-fa-f]+) 2nd : x3([0-9a-fa-f]+) update: misunderstood original post , gave solution exclude first part of session id , extract 2 values seems range.

java - Error with playing sounds -

i have faced error playing sounds on button click in java. have field of buttons , if button pressed application plays sound. application throws me exception: javax.sound.sampled.lineunavailableexception: unable obtain line method , called when button pressed: public void playsound() { try { file file = new file("sounds/sound.wav"); audioinputstream hitstream = audiosystem.getaudioinputstream(file); audioformat format = hitstream.getformat(); dataline.info info = new dataline.info(clip.class, format); clip clip = (clip) audiosystem.getline(info); clip.open(hitstream); clip.start(); } catch (exception e) { e.printstacktrace(); } } sound play @ beginning crashes. googled exception, found clip should closed after playing sound. thought should add lines after clip.start() if (!clip.isrunning()) { clip.stop(); clip.close(); } but sounds don't play , whole application sta...

javascript - extract the value of id as a string using jquery -

below code <div class="row-fluid" id="header"></div> <div class="tab-content"> <div class="tab-pane active" id="tab2"> <div class="row-fluid"> <div class="span9 offset1"> <header id="second"> <strong>users</strong> </div> <div class="span2"> <div class="tabbable" align="center"> <ul class="nav nav-pills"> <li class="active"><a href="#mobile" data-toggle="tab"><strong>mobile</strong> </a> </li> <li><a href="#bo" data-toggle="tab"><strong>bo...

jQuery should return to exact same vertical position in tab when changing from another tab -

if see fiddle demo, http://jsfiddle.net/zj2vq/1/ working scroll exact same position (in tab "one") left last time (so yellow/clicked line not first line). instead scrolling clicked line more context before showing active/clicked line. html: <div id="tabsmain"> <!-- menu line of 3 tabs --> <ul> <li id="tab_one"> <a href="#one">one</a> </li> <li> <a href="#two">two</a> </li> <li> <a href="#three">three</a> </li> </ul> <!-- tab "one" --> <div id='one'> <table> <tr><td><div data-id='1000' class='edit'>line 1</div></td></tr> <tr><td><div data-id='1001' class='edit'>line 2</div></td></tr> <tr><td><div...

c# - Check that program logic is deterministic -

don't know if right title need. need run program same input data few times , ensure every time program take same path , produced same output. need make sure iterator proccessed elements in same order. maybe there tools purpose? or maybe there standard way what-to-do in order check that? put c# in tags because need solution language (and i'm coding in vs2012 if can of help). edit: input of program consists of list of integers , output simple boolean. if i'll write tests - there can big difference in calculations , yet same result. need check program code taken same path every time. you can use test framework , use mocks excepts , asssert output

php - Wordpress all image's path change -

in wordpress site has changed , images of website , blogs not displaying instead image not found appearing. after checking images path found below single image. <img src="http://www.kasthuri.com/blog/wp-content/uploads/2012/02/mysql_logo.png" title="mysql_logo" alt="" data-imgh="340" data-imgw="930"> actually wrong, (path) should following http://www.azraar.com/wp-content/uploads/2012/02/mysql_logo.png ( /blog/ omitted ) then point correct image. wondering how can change entire images in website load without /blog section in image path. i checked db of wp.. found postmeta table contains these images paths info doesnt contain in entire paths.. has images.. 2012/02/mysql_logo.png any workaround ? i think site url changed from http://www.kasthuri.com/ to http://www.kasthuri.com/blog/ so, changing site url may solve problem. read http://codex.wordpress.org/changing_the_site_url in database foun...

jquery - Fancybox - Open another popup when closing a popup -

this js code jquery('.fancybox').fancybox({ beforeload: function(current, previous) { document.getelementbyid("petition-form").reset(); jquery('#petition-form').show(); jquery('.petition-message').html(""); jquery('.petition-message').hide(); }, afterclose: function() { jquery.fancybox.open('#cancelform'); } } ); the second popup open when closing first one, second 1 closed. using fancybox 2+ . js error typeerror: this.overlay null . i experienced same problem after upgrading latest version. quick fix not solution add short delay inside of 'afterclose'. seems free overlay in time. 'afterclose':function () { settimeout(func, 50); function func() { $.fancybox(); } },

android - How to update image of ImageView in Custom ListView -

i trying click on imageview of custom listview , want change image on onclick event. able click on success other operation images not reflected of imageview. here code reference. public class reminderadapter extends baseadapter { private activity activity; private static layoutinflater inflater=null; imageview firststar,secondstar,thirdstar,fourthstar,fifthstar; public reminderadapter(activity a, arraylist<hashmap<string, string>> d) { activity = a; data=d; inflater = (layoutinflater)activity.getsystemservice(context.layout_inflater_service); facebold = typeface.createfromasset(activity.getassets(), "fonts/eau_sans_bold.otf"); facenormal = typeface.createfromasset(activity.getassets(), "fonts/eau_sans_book.otf"); } public int getcount() { return data.size(); } public object getitem(int position) { return position; } public long getitemid(int position) { return positio...

mysql - Select table from database where value is X -

so far i've found out gives me list of tables has column name "store_id" - want select columns if "store_id" = 4, how this? right use find tables has "store_id" column. select distinct table_name information_schema.columns column_name in ('store_id') , table_schema='db1'; you can dynamic sql this set @sql = null; select group_concat(distinct concat('select ''', table_name, ''' table_name ', table_name, ' store_id = 4') separator ' union ') @sql information_schema.columns column_name = 'store_id' , table_schema = schema(); set @sql = concat(@sql, ' order table_name'); prepare stmt @sql; execute stmt; deallocate prepare stmt; sample output: | table_name | -------------| | table1 | here sqlfiddle demo now can simplify things on calling end wrapping stored procedure delimiter $...

How to automatically start Tomcat after starting an Amazon EC2 instance -

we have instance needs turned on during business hours. have scheduled times start/stop instances. problem facing that, once instance started, have manually log instance , start tomcat. i've tried to, start service in windows, no luck. tried go user data, not able head around that...can suggest way in can automate starting tomcat well??? your best bet (if want cut out lot of trial , error) reinstall tomcat .exe installer, , explicitly install run service. (you accomplish without reinstalling; suggest reinstalling merely because when all's said , done, it'll take less time, unless have lots of custom tomcat config.) once it's installed service, go services , make sure tomcat service's "startup type" "automatic". (you able control tomcat service's startup type apache service monitor in system tray well, without opening services.) note running tomcat service may conflict way schedule starting/stopping tomcat during business hou...

Selecting a position from a lists using Python -

i want create program selects team lists , display players name , postion. something this: enter team: enter position number: 1 then should print this: at postion 1 john this got far: def display_team(teamnum, team): print "team" + teamnum + ": " player in team: print player #main #lists used define teams teama = ["john", "peter", "philip", "ben"] teamb = ["bill", "tommy", "pete", "manny"] display_team('a', 'teama') display_team('b', 'teamb') team = raw_input("enter team: ") position = int(raw_input("enter position:")) raw_input("\npress enter continue") add end of code : if 'a' team: print 'team a\n', 'at position ', position , teama[position - 1] if 'b' team: print 'team b\n', 'at position ', position , teamb[position - 1] ...

python - unable to fetch elements from ie using selenium webdriver on WinServer 2012 -

i using selenium 2.33 iedriveserver on windows server 2012 in python. i unable fetch element using webdriver. for example: from selenium import webdriver driver=webdriver.ie() driver.get('http://www.google.com') driver.find_element_by_name('q') ie window opened fetching element not successful. getting error: unable find element name = q i tried find_element_by_id different pages. my script working on win7 , win8 not working ie10 on winserver2012 this example in java, think should work python well. got similar situation findelement xpath or id didn't work on ie9. tried using cssselector , worked great. not sure syntax python be, in java looks following, hope helps driver.findelement(by.cssselector(selector));

arrays - D3 ,update to a two level element -

i've stuck in problem several days, hope can me out here,thanks the things i'm trying i have bunch of links grouped according nodes related the svg <g class = "edge" > <path d="m 10,20l 176.04599778748948,300.5015249766384" ></path> <path d="m 30,40l 176.04599778748948,300.5015249766384" ></path> </g> <g class = "edge" > <path d="m 50,60l 176.04599778748948,300.5015249766384" ></path> <path d="m 70,80l 176.04599778748948,300.5015249766384" ></path> </g> and data set var nodes = [ [" start", null, 0, [ ["home", 1711, 1] ]], ["home", null, 4.279281698e9, [ [" stop", 1173, 1] ]], [" stop", null, 0, []] ]; var layout = [ [100, 200,10], [300, 300,50], [50, 50,10] ]; i try init edges: var svg_edges = svg.append("g").attr...

javascript - Highlighting in contenteditable div edge case -

i working on making contenteditable div text highlighted or unhighlighted. facing edge case in if drag mouse on text end end wild dragging, div getting selected. means if print range gives me parent element end container. <div class = "xyz"> <span class = "highlighted">abcd</span> </div> when log range.endcontainer prints xyz. also using range.setstart() , range.setend() methods adjust range means fail in following scenario : <div class = "xyz"> <span class = "unhighlighted">abcd</span> </div> range.setend(range.endcontainer, range.endcontainer.textcontent.length) i sure have made mistake in setting end part of range cannot figure out ... can help?

asp.net - download object from Google cloud storage using c# -

i want download bucket object's google cloud storage. stuck in differed scenario. our scenario : have 1 main admin account in created our bucket contains files dfa(doubleclick advertisers) files. , gave writes 2 accounts access bucket.but unable see admin's bucket here. in 1 account enabled billing , in account able download files (the file , bucket create manually testing).but bucket created admin unable see. using asp.net (c#) download.that download " https://github.com/acropolium/sharpgs/blob/master/sharpgsdemo/program.cs " the project working nice account contains 1 api project. in account have 2 different api projects both belongs different projects can see in( https://cloud.google.com/console#/project ). in current "sharpgs" project ,we have "restapiclient.cs" class in class have 1 method "createrequest" create request. here method want send project id request.headers.add(@"x-goog-project-id", " * ");** if...

java - Reading text from swf with StuartMacKay's transform-swf library -

i need extract texts swf files. i'm using java since have lot of modules developed language. thus, did search through web free java library devoted handle swf files. finally, found library developed stuartmackay . library, named transform-swf , may found on github clicking here . the question is: once extract glyphindex es textspan , how can convert glyps in characters? please, provide complete working , tested example. no theoretical answer accepted nor answers "it cannot done", "it ain't possible", etc. what know , did know glyphindex es built using texttable , constructed recurring integer represente font size , font description provided definefont2 object, when decode definefont2, have 0 length advance. here follows did. //creating movie object swf file. movie movie = new movie(); movie.decodefromfile(new file(out)); //saving decoded definefont2 objects. map<integer,definefont2> fonts = new hashmap<>(); (movietag object : lis...

php - Remove all blocks from Magento template -

i want remove default blocks template/layout file of custom magento module. have used individual removes like <module_cart_index> <remove name="head" /> <remove name="header" /> <remove name="footer" /> <remove name="right"/> <remove name="left"/> <remove name="cart_sidebar" /> <remove name="checkout.cart" /> <remove name="sale.reorder.sidebar" /> <reference name="content"> <block type="checkout/cart" name="cp.cart" template="module/cart.phtml" /> </reference> </module_cart_index> i want output cart.phtml should not contain code magento should contain code written in it. right when run http://127.0.0.1/mag/index.php/module/cart/ outputs complete html page <html>, <head>, <body> , other tags. how can remove these tags? wa...

javascript - Call custom tiles URL on Google Street View -

i learning how create custom street views , stuck custompanoramamethod . how call getcustompanoramatileurl() after zoom change? i've checked dozen of examples on internet (mostly same "google sydney office code") , none of them seem work. custom tiles downloaded on street view load no further connections set on zoom. firebug shows no resources after initial page load. is there way force google streetview high resolution tiles on demand? i've tried hook zoom_changed event can't figure out javascript function force refresh of presented tile. you try invoke setpano function on google.maps.streetviewpanorama object same pano displayed, should force refresh on getcustompanoramatileurl

java - flash file does not appear -

i want add flash file frame , works fine ,but when make frame using netbeans , flash file did not work more , when remove "initcomponent()" method works, not want remove method , why method make flash file not working or prevent add frame ?? this code : public class simpleflashexample_1 extends jframe{ public simpleflashexample_1() { initcomponents(); jflashplayer flashplayer = new jflashplayer(); flashplayer.load(getclass(), "/clientserver/fl.swf"); add(flashplayer, borderlayout.center); } private void initcomponents() { setdefaultcloseoperation(javax.swing.windowconstants.exit_on_close); javax.swing.grouplayout layout = new javax.swing.grouplayout(getcontentpane()); getcontentpane().setlayout(layout); layout.sethorizontalgroup( layout.createparallelgroup(javax.swing.grouplayout.alignment.leading) .addgap(0, 675, short.max_value) ); layout.setverticalgroup( layout.createparallelgroup...

html - Using JQuery .after method on an element generated by JQuery -

i have table rows generated jquery , since generated on fly use selector .live method bind events. after binding event want append more rows using .after method this. $("#additem").live("click", function (e, index) { $('#mytable tbody > tr:last').after('<tr><td>' + contenet + '</td></tr'>); }); the problem after method doesn't seem recognize table rows generated jquery works fine when test purely html rows. want know if there method live can use instead of after or workaround? live deprecated in jquery 1.7 , removed in jquery 1.9 . if using jquery 1.7 , above should use .on instead. snippet jquery's documentation: event handlers bound selected elements; must exist on page @ time code makes call .on(). ensure elements present , can selected, perform event binding inside document ready handler elements in html markup on page. if new html being injected page, sele...

android - Cannot access lighthttpd from computer -

i created app uses light httpd web server in android working should can access mobile typing localhost:8080 , when type ip:port on computer cannot access it. when connect phone's net computer using tethering. i can access it.please me.. this config file: ## !!!warning!!! ## careful changing configuration file! ## changes may result in incorrect function of program. ## make backups of configuration files before changes. ## -------------------------------------------------------------- var.app_dir = "%app_dir%" var.http_dir = "%http_dir%" var.server_port = "%port%" server.document-root = http_dir + "/www" dir-listing.activate = "enable" server.tag = "droidphp v 1.0.2 android" alias.url = ("/phpmyadmin" => http_dir + "/phpmyadmin") server.errorlog = http_dir + "/logs/lighttpd_sys.log" server.port = server_port index-file.names = ("index.xhtml", "index.html...

javascript - Parse query string into parameter names and values -

i have query string: isuser=0&tokenid=911b7ce6-0ddb-4739-9a02-cd7304a2w&emid=19&url=dfsjgh&roll=s&commid=0 i parse , end follows: var firstcharector=0; var secondcharector=911b7ce6-0ddb-4739-9a02-cd7304a2w; var thirdcharector=19; how can achieve this? java code giving java code because of 'java','jsp' tag in question string partialurl; // url in post partial string urlarray[] = string.split("&"); string temparray[] = new string[2]; // expected /* urlarray[0] = "isuser=0" urlarray[1] = "tokenid=911b7ce6-0ddb-4739-9a02-cd7304a2w" urlarray[2] = "emid=19" */ for(int i=0;i<urlarray.length;i++) { temparray = urlarray[i].split("="); urlarray[i] = temparray[1]; // after '=' sign } javascript : no idea

jsf 2 - JSF: ContextAwarePropertyNotFoundException/javax.el.PropertyNotFoundException -

i have jsf page home.xhtml jsf components / view , let's loaded in (firefox) browser popup window named test-popoup-win . try access same page/url, home.xhtml?query=jsf , additional url parameters, (firefox) browser window, supposed load different/new set of components, based on new search context (?query=jsf). , loads home.xhtml in same browser popup window, named test-popup-win , overriding previous jsf components / view. in backend servlet code, redirecting same page, home.xhtml?query=jsf. but instead of showing new view, throws following error. log shows property not found. can confirm property not found, belongs old view / bean. if click continue on custom error page, new view without issue. please help/advice, suggesting way clear previous view cleanly , load new view or other way issue fix. let me know if missing inputs. thank much. is there way debug kind of jsf issue ? update: 1 may-not-be-good temporary workaround (i dont call solution) ignore exception in ...

ios6 - Advertisement banner for iPhone application -

i want integrate advertisement in iphone application. client provide api it. can use iadd functionality? if client provide api show ad banner implemented custom ad banner. other ad services show , represent specific ad services . showcase own ads, while client wants own infer. suggest call api in custom made view , proceed.

c# - speech recogination exception "Cannot find the requested data item, such as a data key or value -

i trying work speech recognition in c#. trying code , gve me exception that cannot find requested data item, such data key or value here code using public partial class form1 : form { speechrecognizer rec = new speechrecognizer(); public form1() { initializecomponent(); rec.speechrecognized += rec_speechrecognized; } private void form1_load(object sender, eventargs e) { messagebox.show(speechrecognitionengine.installedrecognizers().count.tostring()); var c = new choices(); // doens't work must use english words add choices , // populate grammar. // //for (var = 0; <= 100; i++) // c.add(i.tostring()); c.add("one"); c.add("two"); c.add("three"); c.add("four"); c.add("hi"); c...

Joomla error. Illegal variable _files or _env or _get or _post or _cookie or _server -

i see error when open site home page. http://dis-industrial.com/ illegal variable _files or _env or _get or _post or _cookie or _server or _session or globals passed script. i saw questions on site same error , none of them applies site situation.

javascript - Ember Handlebars Templates in <head> tag -

is possible ember (specifically application template) operate inside head tag in order dynamically change things title tag, meta tags, external css stylesheets , favicon? if so, clean way of doing this? in order make work, did created handlebar helpers. example, if want change title views common, here helper. ember.handlebars.helper('headtitle', function(title) { ember.$('head').find('title').text(title); }, 'title'); now in view template can add helper {{headtitle 'view header'}} here jsbin check if working

jquery - proper accordian menu not opening after form submit -

i have $("#accordid").val() servlet , accordian id before form submit, want open same accordian. $(document).ready(function() { aid = $("#accordid").val(); alert(aid); if(aid =="") aid = 0; $("#accordioncategory").accordion({ collapsible : true, active : false, heightstyle : "content", navigation : true, active: aid }); }); the alert giving proper result, proper accordin menu not opening, please help $(document).ready(function() { aid = $("#accordid").val(); alert(aid); if(aid =="") { // here foreget "{" aid = 0; $("#accordioncategory").accordion({ collapsible : true, active : false, heightstyle : "content", navigation : true, active:...

maven-eclipse-plugin configuration of directories -

maven-eclipse-plugin configuration of directories hi, assigned add maven support existing eclipse project. source code in groovy. idea have pom.xml file specifying project parameters , dependencies , run mvn eclipse:eclipse generate necessary eclipse .project , .classpath files. important: project has directory structure want continue using, i.e. not want switch maven structure. i have tried solve following entries in pom file no success: <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-eclipse-plugin</artifactid> <version>2.9</version> <configuration> <sourcedirectory>src</sourcedirectory> <outputdirectory>bin</outputdirectory> <additionalprojectnatures> <projectnature>org.eclipse.jdt.groovy.core.groovynature</projectnature> </additionalprojectna...

c# - Concatenation of two string in razor view -

i have cshtml problem: have snippet: @for (int = 0; < 25; i++) { <tr> <td> <input class="mycell" type="text" name ="num"@i/> </td> <td> <input class="mycell" type="text" name="client"@i/> </td> <td> <input class="mycell" type="date" name ="reception"@i/> </td> <td> <input class="mycell" type="date" name="cloture"@i/> </td> </tr> } and i'd rename first inputs num0 , client0 ..... until last inputs num23 , client23 ..., try snippet above didn't work. why code didn't work? how can fix it? ...

Using JPQL(not HQL) with Hibernate -

i using jpa classes hibernate hence, making use of persistence.xml file database connectivity i want delete multiple rows database hence created below code entitymanager em = entitymanagerfactoryclass.getemf().createentitymanager(); try { entitytransaction transaction = em.gettransaction(); transaction.begin(); query query = em.createquery("delete node o " + "where o.building_name = :name , o.floor_no= :no"); query.setparameter("name", buildingname); query.setparameter("no", floorno); int deleted = query.executeupdate(); i following error java.lang.illegalargumentexception: org.hibernate.hql.internal.ast.querysyntaxexception: node not mapped [delete node o o.building_name = :name , o.floor_no= :no] @ org.hibernate.ejb.abstractentitymanagerimpl.convert(abstractentitymanagerimpl.java:1374) @ org.hibernate.ejb.abstractentitymanagerimpl.convert(abstractentitymanagerimpl.java:1310) @ org.hibernate.ejb.abstr...

c++11 - How to avoid unnecessary instances using rvalue references in C++ -

i create custom container container stores data in individual arrays. however, facilitate easy iterations on container, provide 'view' on container overloading operator[] , return single struct value holds container variables references actual container. got far: #include <iostream> using namespace std; struct value { value(int& data) : data_(data) { } int& data() { return data_; } int& data_; }; struct container { value makevalue(int i) { return value(data_[i]); } // edit 1 value&& operator[](int i) { // return std::forward<value>(value(data_[i])); return std::forward<value>(makevalue(i)); // edit 1 } int data_[5] = {1, 2, 3, 4, 5}; }; int main(int, char**) { // create , output temporary container c; cout << c[2].data() << endl; // output: 3 - ok! // create, modify , output copy value v = c[2]; cout << v.data() << endl; // output: 3 - ok! v.data() = 8; cout <...

python/flask TypeError: 'float' object is not callable -

i'm deploying simple api written in python (flask), weird error "typeerror: 'float' object not callable". however, object int type, confirmed. tried enforcing int type "for counter in range(int(additional_params_count)):" didn't help. below error message , source 1 <type 'int'> [20130826-16:14pm] [flats_api] [error] exception on /v1/closest_point [get] traceback (most recent call last): file "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app response = self.full_dispatch_request() file "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request rv = self.handle_user_exception(e) file "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception reraise(exc_type, exc_value, tb) file "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request ...

javascript - facebook get data without permission -

ok, have app, written in javascript, integrate facebook api working. make sure user logged in , app had permission dynamic list of permissions. code inside method use tell if user logged in , has permissions. know recursive, that's why have unsubscribe when returning true, has boolean subscribe once. uses jquery 1.5+ utilizing jquery deferred functionality. http://api.jquery.com/category/deferred-object/ fb.getloginstatus(function (response) { if (response.status === 'connected') { fb.event.unsubscribe('auth.authresponsechange'); dfd.resolve(true); } else if (response.status === 'not_authorized' || response.status === 'unknown') { if (facebookauthnotsubscribed) { facebookauthnotsubscribed = false; fb.event.subscribe('auth.authresponsechange', function () { repeat = false; self.valid().done(function (returnvalid) { if (returnvalid) { dfd.resolve(returnvalid); ...

java - args.length and command line arguments -

i got confused how use args.length, have coded here: public static void main(string[] args) { int [] = new int[args.length]; for(int = 0;i<args.length;i++) { system.out.print(a[i]); } } the printout 0 no matter value put in command line arguments, think confused args.length args[0], explain? thank you. int array initialized 0 (all members zero) default, see 4.12.5. initial values of variables : each class variable, instance variable, or array component initialized default value when created ... for type int, default value zero, is, 0 . you're printing value of array, hence you're getting 0 . did try this? for(int = 0;i<args.length;i++) { system.out.print(args[i]); } args contains command line arguments passed program. args.length length of arguments. example if run: java myjavaprogram first second args.length 2 , it'll contain ["first", "second"] .

c# - Scrolable Canvas with movable items inside ScrollViewer -

i've got scrollviewer contains canvas. there movable uielements @ canvas. here xaml code: <scrollviewer x:name="scroller" horizontalscrollbarvisibility="auto" background="white"> <canvas x:name="mapcanvas" width="4000" height="4000"> <button x:name="testbtn" content="my button" canvas.left="250" manipulationstarted="mapitem_manipulationstarted" manipulationdelta="mapitem_manipulationdelta" manipulationcompleted="mapitem_manipulationcompleted" /> </canvas> </scrollviewer> here code of event handlers: private void mapitem_manipulationdelta(object sender, system.windows.input.manipulat...

Oracle 10g PL/SQL Connect By Prior returning Child and Parent on same row -

table1: child parent bob chris 2 chris kate 1 shane lana 3 nala bob 4 table2: b talent 1 'something' 2 'nothing' 3 'something' 4 'nothing' select child table1 inner join table2 on (table1.a = table2.b) table2.talent = 'something' connect prior table1.child = table1.parent this code returns rows of parents chris if "where" clause not included, code return: bob chris kate chris kate shane lana etc what want return following in row, not in columns: bob chris where chris 1 talent , parent bob, code returns not parent, child originated query parent, in code: select child table1 inner join table2 on (table1.a = table2.b) table2.talent = 'something' connect prior table1.child = table1.parent i have child chris talent , previous child bob originated search chris, lets if bob ...

java - How retrieve a String from Webengine back to invoking class after page loading -

i'm java , javafx newbie. don't know how pass variable matched ( browser ) class implements webengine application ( myscene ) class. both classes listed below. understand (am right?) should done after variable updated, after page loaded. guess there 2 ways it: forcing myscene class wait seconds, retrieve method (like public string getmatched() in browser (not listed) class or notifying myscene class variable updated. don't know, how it. has suggestion? myscene.java : package mypackage; import javafx.application.application; import javafx.scene.scene; import javafx.stage.stage; import javafx.concurrent.task; public class myscene extends application { private scene scene; private static string address = "https://www.google.com"; @override public void start(stage stage) { // create scene stage.settitle("web view"); browser mybrowser = new browser(address); scene = new scene(mybrowser,750,500); ...

iphone - Using GPUImage, how would I split image into 4 and apply different filters to all 4 corners and recombine? -

Image
i want similar gpu logo, different filter on each corner. so far have managed achieve image size half of original. here simplification of code: _croptopleft = [[gpuimagecropfilter alloc] initwithcropregion:cgrectmake(0.0, 0.0, 0.5, 0.5)]; cgaffinetransform toplefttransform = cgaffinetransformmaketranslation(-1, -1); toplefttransform = cgaffinetransformscale(toplefttransform, 0.5, 0.5); _transformtl = [[gpuimagetransformfilter alloc] init]; _transformtl.affinetransform = toplefttransform; // set pipeline: image -> crop -> transform // don't apply effects corners now, // try recreate original image [imagesource addtarget:_croptopleft]; [_croptopleft addtarget:_transformtl]; // same other corners... tr, bl & br // recombine // can apply 2 inputs blend filter, combine using 3 filteres // blend filteres `gpuimagenormalblendfilter` instances [_transformtl addtarget:_blendfiltertop]; [_transformtr addtarget:_blendfiltertop]; [_transfor...