Posts

Showing posts from April, 2011

io - Sharing i/o between java programs -

io - Sharing i/o between java programs - this question regards redirection of input , output between 2 java programs. source code simplified illustration of problem below. this prog1: import java.io.*; public class prog1{ public static void main(string[] args) throws ioexception{ runtime rt = runtime.getruntime(); process prog2 = rt.exec("java prog2"); system.out.println("prog2 has executed."); } } on separate file, i've written prog2, execute net explorer verify execution successful: import java.io.*; public class prog2{ public static void main(string[] args) throws ioexception{ bufferedreader in = new bufferedreader(new inputstreamreader(system.in)); system.out.print("enter string: "); system.out.println("you entered " + in.readline() + ". starting explorer..."); runtime.getruntime().exec("c:\\program files (x86)\\internet explorer\\iexplo

C++ How can we insert std::set inside std::vector -

C++ How can we insert std::set inside std::vector<std::unordered_set> - if have std::set<int > a; std::vector<std::unordered_set<int>> b; and went insert a within b method 1: can do: std::set<int > a; std::vector<std::unordered_set<int>> b (a.begin(), a.end()); method 2, cannot this? std::set<int > a; std::vector<std::unordered_set<int>> b; b.insert(a.begin(), a.end()); what error means? error c2664: 'std::_vector_iterator,std::equal_to<_kty>,std::allocator<_kty>>>>> std::vector,std::equal_to<_kty>,std::allocator<_kty>>,std::allocator<_ty>>::insert(std::_vector_const_iterator,std::equal_to<_kty>,std::allocator<_kty>>>>>,unsigned int,const _ty &)' : cannot convert argument 1 'std::_tree_const_iterator>>' 'std::_vector_const_iterator,std::equal_to<_kty>,std::allocator<_kty&g

python - How can I call the metaclass's __call__? -

python - How can I call the metaclass's __call__? - given next illustration on instance of x class: class x(): def __call__(self, incoming_list): print incoming_list x()([x x in range(10)]) how can obtain same output using __call__ magic method class instead of instance? example: x([x x in range(10)]) calling directly, if passing __init__ . but, before calls __call__ calls __new__ passes arguments __init__ . how can access "metaclass __call__ " ? possible? just create easier understand, gives me same output there: class x: def __call__(self, incoming_list): print incoming_list x().__call__([x x in range(10)]) i want this: class x: def x.__call__(incoming_list): # syntax error print incoming_list x.__call__([x x in range(10)]) i think think complicated. probably want like class x: def __init__(self, incoming_list): self.data = incoming_list # maintain them later, if need

c# - Insert values for all 2nd columns of a 1st column of a 2D array -

c# - Insert values for all 2nd columns of a 1st column of a 2D array - i'm trying question says. (it might confusing) here code should create understand i'm trying do. classes = new string[14, 5]; classes[0] = {"value1 [0, 0]", "value2 [0, 1]", "value3 [0, 2]", "value4 [0, 3]", "value5 [0, 4]"}; some languages or environments(like matlab) allow such things work, c# doesn't provide such access rectangular arrays string[x, y]. with such arrays should alter each element individually: string[,] classes = new string[14, 5];classes = new string[14, 5]; int32 rowtochange = 0; for(int32 col = 0; col < classes.getlength(1); col++) { classes[rowtochange, col] = string.format("value{0} [{1}. {0}]", rowtochange , col ); } but utilize jagged arrays : string[][] string[][] classes = new string[14][]; int32 rowtochange = 0; classes[rowtochange] = new string[]{"value1 [0, 0]", &qu

jquery - Form fields are overlooked when loaded by ajax -

jquery - Form fields are overlooked when loaded by ajax - i have created little calendar, has input each date. want load monthly calendar using ajax, when seek navigate, input field in calendar not getting hooked form. $.ajax({ type: "post", url: "calendar.php", data: "&renderbydate=y&month=" + month + "&year=" + year, success: function(htmldata) { $("#calendar-content").html(htmldata); } }); <form action="calendar.manage.php" method="post" enctype="multipart/form-data" name="data" id="data" onsubmit="return vail();"> <input type="hidden" name="cmd" value="_calendar"> <div id="calendar-content"></div> </form> this sample htmldata receiving..

can't import-module Hyper-V by powershell 4 in windows server 2008 R2 -

can't import-module Hyper-V by powershell 4 in windows server 2008 R2 - i tried utilize next cmd @ powershell 4 in windows server 2008 r2. (hyper-v has been running normally) import-module hyper-v get-vm --> not recognized name of cmdlet. get-vm -servername "full server name" (from windows 8) --> "hyper-v" module not installed in remote server. please shed lite on how can command hyper-v using ps 4. give thanks answers in advance. i not sure 1 modules tied operating system. link hyper-v module suggests available on windows 2012, explain why not have on older server os: http://technet.microsoft.com/en-us/library/hh846767.aspx just installing newer version of powershell not plenty newer modules released version, need on minimum os released on. powershell hyper-v

java ee - Tomcat filter not invoked for files outside of WEB-INF folder -

java ee - Tomcat filter not invoked for files outside of WEB-INF folder - evrything fine on localhost!!! using tomcat 7.0.53, having css, js, images ressources out of web-inf folder. accessing them : ${pagecontext.request.contextpath}/resources/css/file.css in web.xml file have filter witch trying set response header ressource files <filter> <filter-name>thefilter</filter-name> <filter-class>packages.thefilter</filter-class> </filter> <filter-mapping> <filter-name>thefilter</filter-name> <url-pattern>/ressources/*</url-pattern> <url-pattern>*.png</url-pattern> <url-pattern>*.gif</url-pattern> <url-pattern>*.jpg</url-pattern> <url-pattern>*.jpeg</url-pattern> <url-pattern>*.css</url-pattern> <url-pattern>*.js</url-pattern> </filter-mapping> as said works fine on localhost. 1 time online filter caches declared servlet urls!

uinavigationcontroller - iOS 7 iAds with TabBar Controller and Navigation Controller -

uinavigationcontroller - iOS 7 iAds with TabBar Controller and Navigation Controller - i have uitabbarcontroller , uinavigationcontroller in app storyboards want utilize iads in. using bannerviewcontroller.h & .m files provided apple in iadsuite demo. in tabbed views without navigation controller, adbannerview loads fine. when switch tab nav controller, there black bar (window) on bottom of screen above tab bar. when adbannerview loads, moved on black bar , app looks fine. when fails load, black bar back. black bar on every view pushed onto nav controller stack when adbannerview isn't showing. how can remove black bar? this view when adbannerview hasn't loaded yet. has bluish background way downwards tab bar. black bar has started appear when using bannerviewcontroller w/ tab bar & nav controllers when adbannerview loads here code: in tabbarviewcontroller.m: //implement bannerviewcontrollers on views in tab bar cgrect screenbounds = [[uiscreen

spring - Explicitly declaring service gateway in Java configuration -

spring - Explicitly declaring service gateway in Java configuration - i have application using spring integration have multiple handlers (strategies) service gateway methods, , want deployment launcher able select specific handlers loaded. since component scanning pick of handlers indiscriminately, prefer explicitly declare javaconfig @bean s them. this works fine service objects themselves, can't find way load service interface in java without @integrationcomponentscan . current workaround include "one-liner" xml file <int-gateway> tag , @importresource it, i'd prefer more direct solution. is there straightforward way in javaconfig tell spring integration create proxy service interface specific class? gatewayproxyfactorybean you. class used populate bean definition <int:gateway> tag , messaginggateway annotation. so, can this: @bean public gatewayproxyfactorybean mygateway() { gatewayproxyfactorybean factorybean = new gate

unity3d - Moving object from one postion to another in unity -

unity3d - Moving object from one postion to another in unity - i have code here ,i trying move object 1 position ,on mouse click ,but everytime run it justs instantiate projectile object in specific position while had instantiate in ffor object position using unityengine; using system.collections; public class shoot : monobehaviour { public gameobject projectile; public gameobject foot; public gameobject mouse; void start() { } void update() { if (input.getmousebuttondown(0)) { vector2 target = input.mouseposition; vector2 pos1 = camera.main.screentoworldpoint(target); gameobject newobj = (gameobject)gameobject.instantiate(projectile); vector2 pos2 = foot.transform.position; transform.position=vector2.lerp(pos2,pos1,time.deltatime); } } there several issues here, i'll address them 1 @ time. fir

python-jenkins get_job_info - how do I get info on more than 100 builds? -

python-jenkins get_job_info - how do I get info on more than 100 builds? - i'm using python-jenkins api manage jenkins build servers. servers pretty loaded - scores of jobs , jobs have saved hundreds of builds. a basic goal have utilize api build count each job, , total build count across jobs. here's code: import jenkins jnk = jenkins.jenkins(myurl, myusername, mypassword) info = jnk.get_info() jobs = info['jobs'] totalbuildcount = 0 job in jobs: jobname = job['name'] jobinfo = jnk.get_job_info(jobname) builds = jobinfo['builds'] # never contains more 100 items print jobname + " build count: " + str(len(builds)) totalbuildcount += len(builds) print "total build count: " + str(totalbuildcount) what find - unfortunately - builds array in job info dictionary never contains more 100 entries, if job has stored many more builds that. have others seen limit, , there way around it, or api useless servers

python - how to concatenate two words from one string without spaces -

python - how to concatenate two words from one string without spaces - i have string name = 'one two' . want create 'onetwo' it. is there cool python shortcut .join() without space? you can name.replace(' ','') or ''.join(name.split()) python

c# - Create list of AJAX type links to be googled by appliance -

c# - Create list of AJAX type links to be googled by appliance - we have big collection of web content want create searchable google appliance have complex list of want , don't want included. because lot of content ajax like, having google searching isn't solution. instead, have classic asp page loops through of our directories , files using scripting.filesystemobject , excludes/includes files/folders , generates big list of hyperlinks in page google can query. process painfully slow (20 minutes or more) able move process on dot net server. i'm doing little bit of exploring wondering solutions people may have found useful kind of thing. we're exploring microsoft.web.administration , else create more efficient including writing resulting list html file. does experience have suggestions how approach this? thank in advance. according documentation https://developers.google.com/search-appliance/documentation/614/admin_crawl/preparing#robotscs, ap

backbone.js - BackboneJS - get specific value from Model using .max -

backbone.js - BackboneJS - get specific value from Model using .max - so have this: var competitionmodel = new competition.competitionmodel(); competitionmodel.contest_id = this.contest_id; this.insertview('.comp', new competition.view({model: competitionmodel})); competitionmodel.fetch(); so far good, model , (selected) values getting display in <div class="comp"> . now want specific value same model, in case profile_image , has max value model. read .max() -method dont know how utilize it i have structure: <div class="image"></div> <div class="comp"></div> 1) possible? 2) can utilize same methods? this.insertview('.image', blablab) so, help me out? ok, judging comment property array of things. you cannot utilize backbone max (which applies collections) can utilize underscore max (they same thing, in end, former wrapper latter let's not go details). can see collection

Changing Video src using jquery -

Changing Video src using jquery - this question has reply here: changing source on html5 video tag 13 answers i want alter video scr when play button click html is <video class="mvideo" controls autoplay="autoplay"> <source class="video" src="path.mp4" type="video/mp4" /> </video> <button class="button">play</button> and jquery is $(document).ready(function(){ $(".button").click(function(){ $(".video").attr("src","videos/funny cats.mp4"); }) }); the way dynamic sources going work if apply them straight video tag eg: <video class="mvideo" controls autoplay="autoplay"></video> <button class="button">play</button> $(document).ready(function(){

Swift array and dictionary immutability -

Swift array and dictionary immutability - what intended design of swift's 'immutable arrays' allow update operation. whereas, 'immutable dictionaries' lone exempted particular behavior. thoughts... let newarray = ["1","3","4"] // immutable <string> array 'newarray' newarray[1]="2"//update index 1 value 2 (no error) newarray[2]="3"//update index 2 value 3 (no error) allow newdictionary = [1 : "one", 2 : "third"]//immutable <int,string> dictionary 'newdictionary' newdictionary[2] = "second" // update 2 keyed value "third" (throws error) why immutable arrays lone allowing update operation, why immutable dictionary not allowed update operation. in documentation it's been written, optimal performance sake, specify fixed sized arrays immutable(constant) arrays. optimal things performed on immutable arrays. thoughts.... diction

php - mysql_insert_id() always returning 0 after successfully inserting the values -

php - mysql_insert_id() always returning 0 after successfully inserting the values - i have defined column auto increment.and have inserted value mysql database. values updated successfully. after inserting need lastly inserted id. using using mysql_insert_id lastly auto incremented value.but returning 0 always. php mysql

matlab - find root of vectorised function in python -

matlab - find root of vectorised function in python - i've been porting code matlab python. part of code finds root of vectorised function, expensive call. in matlab efficiently achieved using jacobpattern option. using alternative solver aware nth element of returned vector depends on nth element of argument vector. options = optimset('algorithm','trust-region-reflective','jacobpattern',speye(lengthofargument)); roots = fsolve(@vectorisedfunction, initialguesses, options); the vectorisation in matlab speeds things factor of 100 , expect similar achieved in python. have been looking @ scipy.optimization cannot find equivalent of jacobpattern. so ask: best approaches finding root of vectorised function in python? i'm not sure expensive function talking does, numpy broadcasts functions each element in array (vectorization done free). so homecoming expensive function if working on 0 element in sparse array. python m

android - Can not convert from Notification.builder to Notification -

android - Can not convert from Notification.builder to Notification - im having problems whole notification , notificationcompat stories, im using api 11, , im trying add together style() notification, code: notification noti = new notification.builder() .setcontenttitle("5 new mails " + sender.tostring()) .setcontenttext(subject) .setsmallicon(r.drawable.new_mail) .setlargeicon(abitmap) .setstyle(new notification.inboxstyle() .addline(str1) .addline(str2) .setcontenttitle("") .setsummarytext("+3 more")) .build(); this extact code developer.android has suggested @ site, when paste in own codes, says can not convert notification.builder notification. tried utilize notificationcompat seems method setstyle, undefined notificationcompat , or atleast mine says so, there way can manage this? or there compability library supports notification.setstyle() api 11? thanks use notificationcompat.builder instead. can ph

iOS Swift max(), min() -

iOS Swift max(), min() - in swift, trying utilize max() , min() functions. max<t : comparable>(x: t, y: t, rest: t...) -> t min<t : comparable>(x: t, y: t, rest: t...) -> t i trying utilize max() function in way: var paddlex: int = int(paddle.position.x) + int(location.x - previouslocation.x) max(paddlex, paddle.frame.x/2, nil) but getting error: cannot convert expression's type of '()' type 'niltype' is nil causing problem? rest: t... supposed be? don't pass @ there. it's variadic function, can phone call 2 or more parameters. ios swift

tsql - How to use SQL table pivot for a table with multiple aggregates -

tsql - How to use SQL table pivot for a table with multiple aggregates - i have procedure returns next table: and want pivot around each name returned, have row planned, actual , difference. for example: | key | name1 | name2 | name3 | name4 | planned | 0 | 0 | 0 | 0 | actual | 8957 | 5401 | null | null |difference| -8957 | -5401 | null | null i'm trying utilize pivot function, i've never used before , struggling head around it. how 1 accomplish similar above? without pivot, can utilize cross bring together instead note works if know how many names have everytime run , if each name appears 1 time in original table.(otherwise max function below not appropriate) create table #test(id int, name char(5), planned int, actual int, difference_between int) insert dbo.#test values (54, 'name1', 0, 8975, -8957), (54, 'name2', 0, 5401, -5401), (54, 'name3', 0, null, null), (54,

c# - lazyloading without using lazy -

c# - lazyloading without using lazy<t> - i have: category class public partial class category : baseentity { ... public string name { get; set; } private icollection<discount> _applieddiscounts; public virtual icollection<discount> applieddiscounts { { homecoming _applieddiscounts ?? (_applieddiscounts = new list<discount>()); } protected set { _applieddiscounts = value; } } } service: public ilist<category> getcategories() { // ado.net homecoming category entities. } public icollection<discount> getdiscount(int categoryid) { // ado.net . } i don't want utilize orm ef.. plain ado.net , don't want set in ugly lazy<t> in domain definition, e.g public lazy.... so how in case applieddiscounts automatically binded lazy getdiscount without using explicitly declaration of lazy<t> on category class ? i don't know why

sed - Change PHP tags with shell command -

sed - Change PHP tags with shell command - my problem this: seek alter tags ( <? <php? ) in several scripts next command: find . -name "*.php" -type f -print0 | xargs -0 sed -i -e 's/<? /<?php /g' the problem if have label <?echo'ble bla..'; ignores , not change. recommend doing? you utilize next sed command: find -type f -name "*.php" -exec sed -i ':a;n;$!ba;s/<?\([ \n]\|echo\)/<?php \1/g' {} \; it matching either space or newline or term echo after <? , replaces <?php<match_found> note don't need xargs call. can utilize find 's -exec option. -e alternative sed not necessary long using single expression. -type criteria should before -name option. otherwise find throw warning. php sed gnu-findutils

Why Eclipse p2site is asking for credentials? -

Why Eclipse p2site is asking for credentials? - i have p2site hosted on server provide eclipse update site. server running iis 7.5 i have same p2site content stored , provided both in production environment , in staging environment (two separate servers, identical characteristics). from couple of days, if connect staging environment p2site eclipse indigo instance, i'm required come in credentials, has never happened before. moreover, if manually download zip archive , install plugin local archive, i'm asked credentials too. i can guess, i'm not sure, problem can related following: in lastly days have added https enablement our web site, , installed our certificate in root certificates of windows server 2008 r2. anyone knows why eclipse (indigo, haven't tested other platforms yet) behaving in way? and how can prepare local zip archive / p2site overcome issue? thank much cghersi just sake of completeness, found solution on own: problem reason

java - ClassNotFoundException: org.apache.felix.dm.DependencyActivatorBase with Pax Exam -

java - ClassNotFoundException: org.apache.felix.dm.DependencyActivatorBase with Pax Exam - i using pax exam (3.5.0) osgi unit tests. have created test when run stacktrace: java.lang.noclassdeffounderror: org/apache/felix/dm/dependencyactivatorbase @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:800) @ org.apache.felix.framework.bundlewiringimpl$bundleclassloader.findclass(bundlewiringimpl.java:2279) @ org.apache.felix.framework.bundlewiringimpl.findclassorresourcebydelegation(bundlewiringimpl.java:1501) @ org.apache.felix.framework.bundlewiringimpl.access$400(bundlewiringimpl.java:75) @ org.apache.felix.framework.bundlewiringimpl$bundleclassloader.loadclass(bundlewiringimpl.java:1955) @ java.lang.classloader.loadclass(classloader.java:358) @ org.apache.felix.framework.bundlewiringimpl.getclassbydelegation(bundlewiringimpl.java:1374) @ org.apache.felix.framework.felix.createbundleactivat

android - Caused by: java.lang.IllegalStateException: package not installed? -

android - Caused by: java.lang.IllegalStateException: package not installed? - 06-26 05:07:17.890: e/androidruntime(3231): fatal exception: main 06-26 05:07:17.890: e/androidruntime(3231): process: com.sample.calendar, pid: 3231 06-26 05:07:17.890: e/androidruntime(3231): java.lang.runtimeexception: unable instantiate application android.app.application: java.lang.illegalstateexception: unable bundle info com.sample.calendar; bundle not installed? 06-26 05:07:17.890: e/androidruntime(3231): @ android.app.loadedapk.makeapplication(loadedapk.java:516) 06-26 05:07:17.890: e/androidruntime(3231): @ android.app.activitythread.handlebindapplication(activitythread.java:4317) 06-26 05:07:17.890: e/androidruntime(3231): @ android.app.activitythread.access$1500(activitythread.java:135) 06-26 05:07:17.890: e/androidruntime(3231): @ android.app.activitythread$h.handlemessage(activitythread.java:1256) 06-26 05:07:17.890: e/androidruntime(3231): @ android.os.handler.dispa

BIRT- converting table to grid -

BIRT- converting table to grid - currently i'm working on birt study table display data. now, want convert same thing grid, provides improve viewing , analysing capability. so, there easy way (in editing xml or something) convert whole table grid? meanwhile, finish info remains same. nb: havn't yet used bit grid, never ever! m bit newbie birt. pardon me if i'm spiting out rubbish. a table different element grid. there not button force convert 1 other. need add together grid element study , set want look. i uncertainty want though. grid display first record returned, unlike table display records returned. birt

Kivy: PyInstaller not including Kivy modules upon compiling spec file -

Kivy: PyInstaller not including Kivy modules upon compiling spec file - i've been next creating packages mac os kivy.org in order seek , create .app kivy .py file. however, despite next guide through, app never works, crashes instantly upon opening. pyinstaller's warning's concerning build dumped in .txt contained following: w: no module named kivy.graphics.clearbuffers (top-level import kivy.uix.screenmanager) w: no module named kivy.core.spelling.spellingbase (top-level import kivy.core.spelling.spelling_enchant) w: no module named kivy.core.image.imageloader (top-level import kivy.core.image.img_gif) w: no module named multiprocessing.rlock (top-level import multiprocessing.sharedctypes) and on . . . (full file long, can viewed here) it seems no kivy modules @ found, must have not been included reason. want inquire how fix. as of right now, have been using commands: kivy pyinstaller.py myapp.py kivy pyinstaller.py myapp.spec respectively create b

Raycasting in Three.js doesn't work -

Raycasting in Three.js doesn't work - i have seen tons of question subject, whenever seek adapt situation never work. why when click on sphere (saphi_mesh) ray.intersectobject(saphi_mesh) homecoming empty array ? what did miss here ? jsfiddle: http://jsfiddle.net/qzh59/ init function: container = document.createelement("div") document.body.appendchild(container) photographic camera = new three.perspectivecamera(70, window.innerwidth / window.innerheight, 1, 1000) camera.position. z = 500 scene = new three.scene() var ambientlight = new three.ambientlight(0xbbbbbb); scene.add(ambientlight); var floor_geo = new three.planegeometry(window.innerwidth, 5, 10, 10) var floor_color = new three.meshbasicmaterial({color: 0xffff00}) var floor_mesh = new three.mesh(floor_geo, floor_color) var saphi_material = new three.meshbasicmaterial({color: 0xfff000}) var saphi_geo = new three.spheregeometry(50, 50, 50) saphi_mesh = new three.mesh(saphi_geo, saphi_material

Android 4.4 Kitkat Won't Show SVGs in WebView -

Android 4.4 Kitkat Won't Show SVGs in WebView - i have app shows total screen svg image in webview. works fine in android 4.2 test device , in emulator. in android 4.4 svg image shows broken image. does have prepare problem or know why happening? thanks. browser=(clickablewebview)view.findviewbyid(r.id.my_browser); browser.setwebviewclient(new webviewclient()); browser.getsettings().setbuiltinzoomcontrols(true); browser.getsettings().setrenderpriority(renderpriority.high); browser.getsettings().setdisplayzoomcontrols(false); browser.getsettings().setloadwithoverviewmode(true); browser.getsettings().setjavascriptenabled(true); url = "<html><body style=\"margin: 0; padding: 0 \"><table align=\"center\" cellpadding=0 cellspacing=0 style=\"height:100%; width:100%; \"><tr><td align=\"center\" style=\"vertical-align:middle;\"><img src=\"file:///andr

polymer - Is there a way to specify an HTML5 custom element should be used only once per document? -

polymer - Is there a way to specify an HTML5 custom element should be used only once per document? - i searched around on google, here on stackoverflow, probably-now-outdated html5 spec's, , have not found answer. sense though i'm missing obvious. i'm wondering if there way specify when creating html5 custom element, users of new element should (or must, 'valid' element's spec) utilize 1 time per document? for illustration html's elements, 'head', 'body', 'main', etc., should used 1 time within document. have not been able find way custom elements. possible, either vanilla html5, polymer, or other means? thanks can help. use built-in callbacks track usage of custom element: var myelementprototype = object.create(htmlelement.prototype); myelementprototype.len = 0; myelementprototype.attachedcallback = function() { myelementprototype.len++; if (myelementprototype.len > 1) { alert('the document

junit - JUint - How to construct a Test Object -

junit - JUint - How to construct a Test Object - our test framework based on junit 3.x. i trying check current framework if can execute junit 4 test cases. there different ways execute test case in our framework command line or ui, testservlet 1)by passing testsuite - qualified name 2)by passing testsuite ( qualified name) , individual test case (to execute 1 test case suite).. i trying fit in juint4 tests in our proprietary framework using joint 3.x) i stuck 1 piece . new test cases in junit 4 , using junit4testadapter . question : how can build test object when know annotated junit 4 method. code class suiteclass = classutil.classforname(suitename); object o = classutil.newinstance(suiteclass); //the suite name passed contains junit4 tests if ( !(o instanceof testsuite)&& isjunit4testcase(o)) { // see if method exists in class method method; seek { method = suiteclass.getmethod(testname); } grab (nosuchme

Organize RubyMine favorites as links rather than subtrees -

Organize RubyMine favorites as links rather than subtrees - in rubymine 6.0.3 when folder added favorites, appears in favorites subtree. interested in not expandable link leads me corresponding source folder when double clicked. possible? is possible? unfortunately no -- not designed work way. but ... favourite folder can utilize ctrl+f1, 1 ( navigate | select in... | project view ) instead of clicking on select , focus location in project view panel. instead of adding folder favourites list ... use bookmarks. yes -- bookmark folder in project view panel (f11 -- navigate | bookmarks | toggle bookmark ). when click on such bookmark .. ide locate , focus folder in project view panel you. rubymine

jquery - Move Upload File from PHP to CGI -

jquery - Move Upload File from PHP to CGI - im trying pass post file info upload.php file , have info sent cgi script. there nil on net on how go doing can find, iv spent days. know there few people out there need this, help have legacy perl scripts. dataflow: jquery --> upload.php --> index.cgi my php: <?php if(isset($_files['file'])) { if(move_uploaded_file($_files['file']['tmp_name'], "../index.cgi" . $_files['file']['name'])){ echo "success"; exit; } } ?> post phone call cgi example: foobar.com/index.cgi?act=store&data=$filename any suggestions help greatly. give thanks you. from understanding, cgi script receiving parameter path of uploaded script. attempting pass uploaded script cgi script using function supposed move file 1 place without executing script. suggestion following <?php if(isset($_files['file'])) { $de

How can i decode html entities in php? -

How can i decode html entities in php? - i trying convert html entities not working. $string_with_bold_tag = "&lt;b&gt;hello world &lt;/b&gt"; $converted = html_entity_decode($string_with_bold_tag); echo $converted; its homecoming hello world bold tag. thought doing wrong? your string have issue in syntax, seek this: $string_with_bold_tag = "&lt;b&gt;hello world &lt;/b&gt;"; //you missed semi colon here $converted = html_entity_decode($string_with_bold_tag); echo $converted; at end of input string there no semicolon &gt -> &gt ; in order interpreted correctly need right syntax. php html decode

xml - Compare values on xslt transform -

xml - Compare values on xslt transform - i working xml this <!doctype catalogo scheme "catalogo.dtd"> <catalogo> <constelaciones> <constelacion situacion="boreal"> <nombrelatino>ursa major</nombrelatino> <nombrecomun>osa mayor</nombrecomun> <abreviatura>uma</abreviatura> <genitivo>ursae majoris</genitivo> <visibilidad>circumpolar</visibilidad> <imagen>img/uma.jpg</imagen> </constelacion> <constelacion situacion="boreal"> <nombrelatino>andromeda</nombrelatino> <nombrecomun>andromeda</nombrecomun> <abreviatura>and</abreviatura> <genitivo>andromedae</genitivo> <visibilidad>otonio</visibilidad> <imagen>img/and

ios - -[IgzHelper doneWithNumberPad]: unrecognized selector sent to instance 0x1923c230' -

ios - -[IgzHelper doneWithNumberPad]: unrecognized selector sent to instance 0x1923c230' - i created helper class, returns uitoolbar , issue error "terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[igzhelper donewithnumberpad]: unrecognized selector sent instance 0x1923c230'" //#igzhelper.h -(uitoolbar *)createdonefornumberpad:(sel)sel; //#igzhelper.m -(uitoolbar *)createdonefornumberpad:(sel)sel{ uitoolbar* numbertoolbar = [[uitoolbar alloc]initwithframe:cgrectmake(0, 0, 320, 50)]; numbertoolbar.barstyle = uibarstyleblacktranslucent; numbertoolbar.items = [nsarray arraywithobjects: [[uibarbuttonitem alloc]initwithbarbuttonsystemitem:uibarbuttonsystemitemflexiblespace target:nil action:nil], [[uibarbuttonitem alloc]initwithtitle:@"done" style:uibarbuttonitemstyledone target:self action:sel], nil]; numbertoolbar.tintcolor = [uicolor whi

postgresql - How can I create a foreign key constraint using Yesod/Persistent? -

postgresql - How can I create a foreign key constraint using Yesod/Persistent? - is there way create foreign key constraint using persistent's schema syntax postgres backend? or need manually sql? specifically, on delete cascade relationship such when hackday deleted, of kid project s deleted: hackday title text created utctime default=now() votingclosed bool default=false deriving show project hackday hackdayid title text creators text votes int default=0 created utctime default=now() deriving show persistent not have built-in back upwards triggers, though it's we've been wanting add together (simply lacking manpower). now, you'll have add together trigger manually. postgresql migration yesod persistent

javascript - datatable with json data using ajax request and use hyperlink -

javascript - datatable with json data using ajax request and use hyperlink - hi below datatable java script, $('#proj_emp_table').datatable({ "sajaxsource": "/projects/project_json/", "fnserverdata": function ( ssource, aodata, fncallback, osettings ) { osettings.jqxhr = $.ajax( { "datatype": 'json', "type": "get", "url": ssource, "data": aodata, "success": fncallback } ); } }); and html , <table id='proj_emp_table' class="display"> <thead> <tr> <th>employee id</th> <th>employee name</th> <th>experience prior asm</th> <th>joining date</th> <th>asm experience</th> <th>billing start date</th> <th>bill status</th> &l

java - Jackson JSON ObjectMapper.readvalue -

java - Jackson JSON ObjectMapper.readvalue - i'm going through code examples on converting java object json , came across this: hashmap<string, object> filters = new objectmapper().readvalue(filterstr, hashmap.class); where string filterstr; sorry, above line of code doing? went through other illustration here. can see readvalue() has been overridden how can string converted hashmap? shouldn't json object , not string? thanks. objectmapper().readvalue() is overloaded several types of conversions. if filterstr compatible converted hashmap method it. e.g. filterstr = "{\"name\":\"tom\", \"age\":\"25\"}"; give map key-value pairs {age=25, name=tom} java json jackson

c# - How to implement the MVVM pattern in a WPF project using GraphSharp / QuickSharp library -

c# - How to implement the MVVM pattern in a WPF project using GraphSharp / QuickSharp library - note: newbie in fields involved (wpf, mvvm pattern, graphsharp/quicksharp libraries). i trying display simple directed graph using graphsharp library. went through this demo, , wrote similar code (creating custom vertex, edge, graph , graphlayout types etc.). next, added status property custom vertex type , implemented info template , style resource in xaml code (somewhat similar demo linked above), applied various styles vertex controls based on status property. this, had implement inotifypropertychanged interface in custom vertex type. have other codes alter status property of vertexes @ runtime, triggering style changes. works, far, good. next read couple of articles how wpf code should organized model, view model , view layers: view (preferably xaml code) should talk view model classes (via bindings), latter implementing inotifypropertychanged , view model should talk "

angularjs - Is there a way to Expand All Nodes with breezejs? -

angularjs - Is there a way to Expand All Nodes with breezejs? - is there expand kid nodes on entity using breezejs query statement? maybe 2 deep? scenario i'm doing partial entity list page on edit of single entity want show data, have .expand('every', 'single', 'child', 'node', 'field') ? you have specify every leg economic scheme expressing long legs. for example, can write three-legged .expand("a.b.c.d, a.e, f.g.h") , you'll related a,b,c,d,e,f,g , h entities. if want clever, can generate expand clauses metadata. think i'd write expand myself. angularjs breeze

android - I don't get ACTION_DOWN on ScrollView -

android - I don't get ACTION_DOWN on ScrollView - i scroll view, , within linear layout imageview. <scrollview android:layout_weight="41" android:layout_width="0dip" android:layout_height="match_parent" android:background="@color/light_red_zone" android:id="@+id/scrl_pass" android:clickable="true" android:layout_gravity="center"> <linearlayout android:id="@+id/lytpass" android:background="@color/light_red_zone" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="left" /> </scrollview> i add together imageview dynamically within linearlayout, , has listener img1.setonclicklistener(new view.o

ios - How to make a FBSession with Facebook oauth token? -

ios - How to make a FBSession with Facebook oauth token? - i have used social framework login facebook , got token. know how set fbsession in facebook sdk ? want create session token, set fbsession.activesession , synchronize :). guys. acaccounttype *facebookaccounttype = [self.accountstore accounttypewithaccounttypeidentifier:acaccounttypeidentifierfacebook]; nsdictionary *options = @{ @"acfacebookappidkey" : @"123456789", @"acfacebookpermissionskey" : @[@"publish_stream"], @"acfacebookaudiencekey" : acfacebookaudienceeveryone}; // needed when write permissions requested [self.accountstore requestaccesstoaccountswithtype:facebookaccounttype options:options completion:^(bool granted, nserror *error) { if (granted) { nsarray *accounts = [self.accountstore

How to compare the Json responedata and sql data in java -

How to compare the Json responedata and sql data in java - i written code post info in webservice , sends response info , code. same info posting in sql using select query. scenario need check responsedata , sql info same or not. mysql.java public arraylist<disputesummaryarraylistobject> connectsqlconnectiondisputesummary() throws sqlexception, classnotfoundexception{ arraylist<disputesummaryarraylistobject> disputesummaryarraylistobjectlist = new arraylist<disputesummaryarraylistobject>(); string connectionurl = "jdbc:sqlserver://localhost:1433;" + "databasename=adventureworks;user=username;password=*****"; seek { class.forname("com.microsoft.sqlserver.jdbc.sqlserverdriver"); sqlconnection = drivermanager.getconnection(connectionurl); string sqlstatement = "enter sql statement"; statement = sqlconnection.createstatement(); r

vbscript - Specific Lines after first occurrence of keyword -

vbscript - Specific Lines after first occurrence of keyword - i have file in able find keyword using vbscript farther need maintain copying next 3-4 lines downwards it, until find occurrence of similar pattern of keyword. have written - ( newbee assume dumb ) set fso = createobject("scripting.filesystemobject") set infile = fso.opentextfile("filename", 1) set outfile = fso.opentextfile("filename", 8, true) outfile.writeline("this sample data.") stranswer = inputbox("please come in value:", _ "enter value") until infile.atendofstream line = infile.readline if instr(line, stranswer) outfile.writeline line ' re-create line , write output file sernum = left(line, 7) 'if not ((line = infile.readline()) 'take first 3 char , find next occurance of 'copy lines until line wscript.echo "found" end if loop outfile.close set fso = nil any suggestion appr

c# - Deleting Objects from any entities in WCF Data Service gives me an exception -

c# - Deleting Objects from any entities in WCF Data Service gives me an exception - i have wcf info service has multiple entities. have problem deleting objects entity exception. service hosted cloud service in azure. it gives me error message "401 - unauthorized: access denied due invalid credentials." by way works while running wcf info service on local host. ` system.data.services.client.dataservicerequestexception unhandled hresult=-2146233079 message=an error occurred while processing request. source=microsoft.data.services.client stacktrace: @ system.data.services.client.saveresult.handleresponse() @ system.data.services.client.basesaveresult.endrequest() @ system.data.services.client.dataservicecontext.savechanges(savechangesoptions options) @ system.data.services.client.dataservicecontext.savechanges() @ testodataclient.program.main(string[] args) in e:\learn\my projects\visual studio projects\testodataclient\

json - How can i get rss feed of multiple websites in a single page PHONEGAP? -

json - How can i get rss feed of multiple websites in a single page PHONEGAP? - i trying display feeds of different websites in single page in phonegap application. tried way yet not able find best solution. if done before please help me or guide me this. thanks. json html5 cordova rss feed

javascript - Preventdefault not working -

javascript - Preventdefault not working - hey guys new javascript web development.i have been through preventdefault() through code.but when used it returns error ..my code <html> <body> function preventdef(event) { event.preventdefault(); } document.queryselector('a').addeventlistener("click", preventdef(event),false); </script> <a href="www.google.com">click here</a> </body> </html> when utilize code , clicked on link redirects me google.com ..what need event must blocked preventdefault() function.. hope guys can help me out ..thanks you calling preventdef function instead of passing reference. document.queryselector('a').addeventlistener("click", preventdef, false); // ^^^ don't phone call function edit: issue running before dom ready. need move <script> tag downwards after <a> .