Posts

Showing posts from February, 2011

unit testing - C# mock-stub generation automation -

i replace drivers layer c# application simple stubs or mocks. based on search have done on web there several tools supporting feature e.g.(microsoft fakes, nsubstitute...). my question if tools able auto find , auto replace every function call drivers library replaced. sum feedback experts on how capable such tools auto generate functionality.

oracle adf - Common application toolbar or header -

in application in adf there requirement should have common header or toolbar whole application (having 8 ten .jspx files) buttons enable/disabled based on functionality of specific page. we have implement toolbar each , every page? (ie, have buttons in each , every page , have actions individually). if yes best solution? if not there mechanism achieve this? i did not found solution above scenario on net, why, don't know or confusing simple thing, "novice" not getting. look page templates in adf - example: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/24-generic-toolbar-component-169163.pdf

java - Data from JSON does not refresh -

i'm developing json parsing app in android, have php script on server fetch data mysql database , encode json, app contact server , populate listview data json using asynctaskloader . it's worked if drop database records, start app again, listview still shows old data. press refresh button call asynctaskloader still old data. don't know why please me. thank p/s: sorry bad english ^^ sorry, forgot code. here go tvschedfragment.java public class tvschedfragment extends listfragment { private tvschedadapter adpt; listview lview; // json node names private static final string tag_schedule = "sched"; private static string url = "http://192.168.20.205/dom/app/json.php"; string jsonstr; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_tvsched, container, false); l...

html - How to Get particular child node class name using javascript? -

i want particular child node(i.e. class name). how can this. code <div id="mess"> <h1>bhashyam school</h1> <p>ac nagar main road, nellore <br/>ho, nellore - 524001 </p> <p class="tel">telephone: +(91)-9603444376 </p> <p class="email">email: <a href="mailto:info@citydeal.in">info@citydeal.in</a></p> <p class="web">website: <a href="http//citydeal.in" target="new">http//citydeal.in</a></p> <p class="description">hours of operation : monday, tuesday, wednesday, thursday, friday, saturday: 09:30 10:00 pm<br> sunday: closed , modes of payment : cash </p> <form name=...

RabbitMQ "arguments" documentation -

when create queue, can specify time-to-leave of messages, deletion of queue if has not been used time etc. those parameters passed via dictionary ; there place can find proper key-values list accepted ? “arguments” amqp basicproperties http://www.rabbitmq.com/releases/rabbitmq-java-client/v3.2.4/rabbitmq-java-client-javadoc-3.2.4/com/rabbitmq/client/amqp.basicproperties.html some amqp broker use basicproperties implement extensions, example time-to-live extension rabbitmq extension. if change broker lose functionality. read http://www.rabbitmq.com/extensions.html see rabbitmq extensions. anyway can use properties prefer, example can add custom key value. the class http://www.rabbitmq.com/releases//rabbitmq-java-client/current-javadoc/com/rabbitmq/client/messageproperties.html contains pre-built basicproperties.

How can I make a custom 503 page on OpenShift? -

i change default openshift 503 page occurs when deploying app. did find this solution, not sure put python script. i have php 5.4 application running (no cartridges), if matters. there not way create custom 503 error message page. other tutorial doing starting secondary web server when primary 1 shuts down show custom page while application deploying, not custom 503 error page.

combobox rightclick file deletion (vb.net) -

im trying delete item combobox ussing rightclick event can seam code it what have following: private sub combobox1_rightclick(byval sender system.object, byval e system.eventargs) handles combobox1.rightclick dim deleteitem string= combobox1.text system.io.file.delete( "c:\" & deleteitem & ".txt" ) msgbox("file deleted") end sub if trying delete file name, try this: private sub combobox1_mousedown(sender object, e mouseeventargs) handles combobox1.mousedown if e.button = mousebuttons.right dim deleteitem string= combobox1.text kill("c:\" & deleteitem & ".txt") msgbox("file deleted") end if end sub

javascript - How to hide the # in the base URL using Angular? -

is possible hide # in url when using angular routing, base url ? i know it's possible use $locationprovider.html5mode(true) remove # , want keep # others routes. for exemple, following angular module : var sampleapp = angular.module('sampleapp', ['ngroute']); sampleapp.config(function($routeprovider) { $routeprovider. when('/', { templateurl: '/templates/index.html' }). when('/additem', { templateurl: '/templates/additem.html' }). otherwise({ redirectto: '/' }); }); currently, when go mysite.com , url mysite.com/#/ , want clean url without # . i cant use html5mode because want have url mysite.com/#/additem also.

c# - Nested classes lists LINQ -

i have following classes: public class serializeddelegate { public list<goentry> goentries = new list<goentry>(); } public class goentry { public string go; public list<mbentry> mbentries = new list<mbentry>(); } public class mbentry { public string mb; public list<methodentry> methodsentries = new list<methodentry>(); } public class methodentry { public string method; } and data: var sd = new serializeddelegate(); var ego1 = new goentry { go = "player1" }; var ego2 = new goentry { go = "player2" }; var emb1 = new mbentry { mb = "mb1" }; var emb2 = new mbentry { mb = "mb2" }; var em1 = new methodentry { method = "target1" }; var em2 = new methodentry { method = "target2" }; var em3 = new methodentry { method = "target3" }; var em4 = new methodentry { method = "target4" }; emb1.methodsentries.add(em1); emb1.methodsentries.add(em2); emb2.me...

php echo within javascript possible? -

i trying add php echo within javascript (for translation reasons). seems though cannot echo javascript? this initial code: else if(o.thumbplacement=='bottom'){$outer.append('<div style="padding-top:4px; text-align:center; font-family:arial, helvetica, sans-serif; font-size:11px; color: #999; "><img src="images/magnify.png" alt="enlarge" /> click , move zoom</div><ul class="thumbs">'+cont+'</ul>');} this how edited it: else if(o.thumbplacement=='bottom'){$outer.append('<div style="padding-top:4px; text-align:center; font-family:arial, helvetica, sans-serif; font-size:11px; color: #999; "><img src="images/magnify.png" alt="enlarge" /> <?php echo text_click_to_enlarge; ?></div><ul class="thumbs">'+cont+'</ul>');} i tried <?php echo "test"; ?> returns nothing well....

javascript - When data fails first validation, all subsequent submissions fail, even if valid data is submitted -

i working older jsp application. there custom build dojo using modaldialog. user enters application , types information form. when new student needs added enter modal dialog box can add edit list populated database. once changes made can save, (saved database before modal dialog close.) providing pass validation. when original form completed submit form additional validation. user bypassing validation on edit students page closing modal dialog without saving. pulled updated information (dojo.xhrget) , stored in hidden elements updated/un-altered student information validated on submit. the div populated hidden html input elements , validate fine. unless user hits submit before viewing/adding/altering information within modaldialog page , receive errors preventing submit. if return modal dialog unable submit, checkboxes not validate true or checked on either page after first failed submit. can add/edit students to/on list , list of students 1 minimum needs "must sign" ...

ios - Activity Indicator doesn't stop in the same method -

in method viewdidload initialize activityindicatorview.then, in following method sent activity indicator start. when start app , runs if statement, activity indicator starts, when operations in dispatch queue performed, activityindicator not stopped. here method: -(void) tableview:(uitableview *)tableview willdisplaycell:(uitableviewcell *)cell forrowatindexpath:(nsindexpath *)indexpath { if([indexpath row] == [_myarray count]-2){ [_activityindicator startanimating]; dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_background, 0), ^{ //here perform operations [self.tableview reloaddata]; [_activityindicator stopanimating]; }); } } i wish activity indicator stopped after execution of operations in dispatch queue! you should perform ui operations on main thread. try refactor: dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_background, 0), ^{ //here perform op...

c# - "The namespace 'console' already contains a definition for 'Circle'" -

i'm working on code school project, have class defining circle , method draws, code far returns "the namespace 'console' contains definition 'circle' here code: using system; using system.collections.generic; using system.linq; using system.text; namespace console { class program { static void main(string[] args) { console.write("what circle’s radius: "); double radius = convert.todouble(console.readline()); circle ans = new circle(radius); console.writeline("the area of circle " + ans.getarea); console.writeline("the diameter of circle " + ans.getdiameter); console.writeline("the circumference of circle " + ans.getcircumference); console.write("enter character quit program. "); double stop = console.read(); } } } that's method , class: using system; using syste...

c++ - Illegal else without matching if -

i'm getting error message says illegal else without matching if. think wrong else statement, don't see where. have unneeded bracket? it's on line 78 column 2. thank you #include "stdafx.h" #include <iostream> #include <iomanip> #include <string> using namespace std; int main() { string service_code, //hold service code account_number; //hold account number double final_amount = 0, // hold final amount final_damount, //hold amount day minutes minutes = 0, //hold amount minutes day_minutes = 0, // hold amount fay minutes night_minutes = 0, //hold amount night minutes final_namount = 0; //hold amount night minutes cout << "please enter account number: "; cin >> account_number; //entering account number cout << "please enter service code (r or r regular service , p or ...

eclipse - pydev Google App run Path for project must have only one segment -

i had trouble run pydev google app run on eclipse. can't create new run configuration , error message: path project must have 1 segment. ideas how fix it? running eclipse kepler on ubuntu 13.10 this bug, there's possible workaround: in .py file in project, right-click , go "run as." then, select "python run" (not custom configuration). let run , crash or whatever particular module does. now, go @ run configurations - you'll see 1 run. can customize if had made anew.

c# - Reading contents of CSV file -

i have loaded csv file here sample of content available in csv file name,address,address1,landmark,user_location,city,state,phone1,phone2,email,category sriram electricals , plumbing contractors,no 12, vinayakar koil street easa,"back side of therasa school,",pallavaram,chennai,tamil nadu,(044) 66590405,,sriram@gmail.com,electrican i've tried convert file list public actionresult usercsv(httppostedfilebase uploadfile) { using (var sr = new streamreader(uploadfile.inputstream, encoding.utf8)) { var reader = new csvreader(sr); //csvreader read whole file enumerable ienumerable<usercsvmodel> records = reader.getrecords<usercsvmodel>(); } } unable correct output. try article: http://www.codeproject.com/articles/415732/reading-and-writing-csv-files-in-csharp or q on stack on flow: reading csv file , storing values array hope helps.

vim - Is it possible to always overwrite a specific built-in command with a particular mapped command? -

i have following mapping in .vimrc . " scroll arbitrary function scrolltopercent(percent) let movelines=winheight(0)*a:percent/100 if has("float") && type(movelines)==type(0.0) let movelines=float2nr(movelines) endif let oldso=&so execute ":set so=" . movelines execute "normal! zt" execute ":set so=" . oldso endfunction nnoremap zz :call scrolltopercent(25)<cr> this mapping causes command zz move line under current cursor 25% of way down top of screen, instead of usual behavior of moving 50% of way down. i have observed that, if type second z greater delay after first z , mapping ignored , default behavior of zz kicks in. in particular, line under cursor move 50% of way down instead of 25% of way down. based on answer this question , set timeoutlen high value, not want because mess other mappings should not kicked off if small delay separates keys. is possible ma...

c# - Static member and lock -

i have class static member: static mayclass s_member; it can accessed multiple threads. should use static lock object it? if wish prevent concurrent access, need protect lock. if concurrent access presents no problems, there no need lock. only knowledge of member can answer 1 way or another. threads access concurrently ever read? if so, not need lock. otherwise, if writing shared data, lock needed.

php - Combine two mysql results -

this situation.. while($row = mysql_fetch_assoc($sql)){ $name = $row['name']; $class = $row['class']; $result = $row['phone']; $data .= '<td>'.$name.'</td><td>'.$class.'</td><td>'.$result.'</td>'; } echo "<table><tr>'.$data.'</tr><table>" $name , $class occur once $result occur more once. want show them in single html row..like this kevin | ix | 5343634,3565656 melvin | x | 54534,3778,54434 one possible approach: collect results in associative array first, indexed name *as seem unique), whatever want results. example: $results = array(); while ($row = mysql_fetch_assoc($sql)) { $name = $row['name']; $results[$name]['class'] = $row['class']; $results[$name]['phone'][] = $row['phone']; } echo '<table>'; foreach ($results $name => $result) { echo '<tr>...

java - how to send checkbok state from included JSP page to another JSP page -

i have 3 jsp pages first 1 contains checkbok created using boucle. page1.jsp : for(int i=0; i<5; i++){ %> <input type="checkbox" name="selection" value="box"+<%=i %> /> %> the second 1 (page2.jsp) includes first 1 , send state of checkbox third 1 (page2.jsp). page2.jsp : <jsp:include page="page1.jsp"> <jsp:param name="type1" value="<%=request.getparametervalues(\"selection\")%>" /> </jsp:include> page3.jsp <%string valuebd=request.getparameter("type1"); thank you firstly, recommend don't use scriptlets. litter code throughout jsp pages , makes application extremely difficult manage. should use el (expression language). allows add functionality jsp page without using java code, example: <c:if test="${parametervalue}"> <p>${parametervalue}</p> </c:if> onto problem. recommend passing va...

ios - Sprite Kit - Do not allow node to move out of screen -

i creating game not want player able move out of screen. node follows players moving touch. code have "under construction" player can't move out on top or right side, not want player able move out on of sides. - (void)movementplayer { skaction * actionmovex = [skaction movetox:min(location2.x - playerpositionx, self.size.width - (_player.size.width/2)) duration:0]; skaction * actionmovey = [skaction movetoy:min(location2.y - playerpositiony, self.size.height - (_player.size.height/2)) duration:0]; [_player runaction:[skaction sequence:@[actionmovex, actionmovey]]]; } you should create physics world , add border rectangle around screen. border must have physics body set collide physics body collision category given player node. if player node starts inside border, player cannot leave screen , no additional coding required (besides setting collision categories each physics body) raywenderlich.com has easy understand game tutorials show...

ios - Naming pattern for the class used by your ViewControllers and contains the business logic -

i see lot of folks (including apple's sample code) putting of business logic in viewcontroller classes. however, in effort create lighter view-controllers, want put business logic own class, encapsulation, separation of concerns, , unit testability intended side-effects effort. but what's naming convention use these kinds of classes hold business/application logic , used uiviewcontroller derived class? hypothetically, let's have poker game class called gamedetailviewcontroller. of business logic of show or whether move valid or not placed in separate class, used gamedetailviewcontroller. what's name it? i've seen term "service" , "manager" appended class name. there better term? gamedetailservice? gamedetailmanager? the problem 'service' it's overloaded whatever remote (aka cloud) service you'd talking to. manager: eh.. becomes manager , manage? i design patterns way @ loss find name. i name does, if ...

How to retrieve an output of a Python script using a Java program -

i having problem code. have java class calls python script gps data. problem can call script want return data string on java side can use in array later. want take data python script , bring java string , place in array. python code #! /usr/bin/python import os gps import * time import * import time import threading gpsd = none #seting global variable os.system('clear') #clear terminal (optional) class gpspoller(threading.thread): def __init__(self): threading.thread.__init__(self) global gpsd #bring in scope gpsd = gps(mode=watch_enable) #starting stream of info self.current_value = none self.running = true #setting thread running true def run(self): global gpsd while gpsp.running: gpsd.next() #this continue loop , grab each set of gpsd info clear buffer if __name__ == '__main__': gpsp = gpspoller() # create thread try: gpsp.start() # start while true: #it...

mysql - Need to fix a sub-query and can't figure what went wrong -

i used sub-query returns orders placed on last day of activity can found in orders table. here came with: select orderid, orderdate, customerid, employeeid orders orderdate = max(orderdate); this received: msg 147, level 15, state 1, line 3 aggregate may not appear in clause unless in subquery contained in having clause or select list, , column being aggregated outer reference. where did go wrong? your error translates to: cannot use max() unless use group by or like. so here's quick way rewrite query: select orderid, orderdate, customerid, employeeid orders orderdate = (select top 1 orderdate orders order orderdate desc); but orderdate potentially timestamped, add well: select orderid, orderdate, customerid, employeeid orders orderdate = dateadd(dd, 0, datediff(dd, 0, (select top 1 orderdate orders order orderdate desc))); i realize isn't mysql, hope or else able rewrite solution mysql you.

php - laravel 4: Route to controller when error occurred -

i have problem laravel 4 . want handle occurred errors like, 404 not found or other errors. want call controller when such errors occurs. i've tried this: app::missing(function($exception) { return response::view('errors.404', array('error'=>$exception), 404); }); but above code not purpose, want this: //i know code doesn't work, i've wanted show claim app::missing('homecontroller@error'); app::error('homecontroller@error'); // or ... is there way handle errors within calling specific controller's method? no, can't use app::missing('controller@method') directly because missing method calls error method , is: public function error(closure $callback) { $this['exception']->error($callback); } it accepts closure may call controller -> method closure. so. declare handler using closure usual , call controller's method within closure. as side note, don't see importance ...

css - Hide 'option' element in iphone -

Image
here html: <select> <option style="display:none;">1</option> <option>2</option> <option>3</option> <option>4</option> </select> here result on chrome - desktop and here result in iphone - safari jsbin you disable or remove using jquery demo http://jsfiddle.net/fa8xx/1728/ <select> <option class="targetthis">1</option> <option>2</option> <option>3</option> <option>4</option> </select> jquery function isiphone(){ return ( (navigator.platform.indexof("iphone") != -1) || (navigator.platform.indexof("ipod") != -1) ); } if(isiphone()){ $(".targetthis").attr('disabled', true); }

java - possible combination in binary counting -

consider sequence of digits 1 through n (n<=9) in increasing order:   1 2 3 4  … n insert either ‘+’ (for addition) or ‘-‘ (for subtraction) between each of digits resultant sum zero. print possible combinations sum zero. you can choose between 2 operations. n-1 times. gives 2^(n-1) possible combinations. loop on combinations simple integer. decide wether choose plus or minus looking @ nth bit of iterating number. int n = ...; int max = 1 << (n-1); // 2^(n-1) (int = 0; < max; ++i) // loop on + , - combinations { // start @ 1, since can't put - in front of first digit int sum = 1; (int k = 2; k <= n; ++k) { if (((i >> (k - 2)) & 1) == 1) // @ bit (k-2) { sum += k; } else { sum -= k; } } if (sum == 0) { // found solution, print binary output: // 1 means +, 0 means - // read right left! system.out.println(integer.tostring(i, 2)); } } ...

Requirement of telemetry and application usage in ASP.NET MVC.Looking for third party tools if any? -

we have asp.net mvc web site have developed 1 of our customers. there new requirement introduce telemetry in application .we looking buy licenses off shelf product requirement instead of implementing scratch.we open extend oob feature if @ possible meet our extended requirements using active directory.i have listed down of requirements have.any suggestions full. primary need - general report (xls or tabular online report) includes: · alias (email alias of windows authenticated user, site intranet facing , supports windows authentication). · gal title (title retrieved exchange server, may require customization believe) · sub-region, region, subsidiary, area(based on geographic location.) · time/date stamp of access · tab of access · nice have: new date/time stamp each click of "go"(click on few searches have in application ) , possibly "export"(think of controller) · integrating custom application information (like users role , title available in ap...

Scilab error at unexisting line -

i error on line 43 saying undefined variable: b but, method in throwing error has 40 lines... anyone has idea why might be? most often, observed when version of binary files (classes, jar files) , source code version not match. check if looking @ source code of version running.

Using a random number generator in MIPS? -

so reading few threads on site , found 1 on how make one.. can't find link explains more how code it.. textbook course didn't provide information rng @ no there. the code li $a1, 4 li $v0, 42 add $a0, $a0, 1 is correct asking range between 1-3? tried outputting random number gave me same number constantly. #sw $a0, 0($s0) li $a1, 4 li $v0, 42 add $a0, $a0, 1 #syscall li $v0, 4 la $a0, checking syscall li $v0, 1 move $t0, $a0 syscall i saw sw $a0, 0($s0) i'm not sure -- needed output? (i took out because after pushed key go rng, said program crashed) keep getting output of 268501267 i'm not sure means edit: started giving me 268500992 time can explain little more in depth? logically speaking -- understand 42 comes , why need add +1 (this won't value of 0) from there, have no clue on why code won't output number in range gave. as stated mars documentation (help > syscalls): random int 41 $a0 = i.d. of pseudorandom numb...

mocha - How to skip the afterEach hook if the current test case fails and continue to run the next test case after? -

describe("test1", function() { before("at start", function() { console.log("at begining of test case"); setup(); } beforeeach("before test case", function() { console.log("at begining of test case"); testsetup(); } aftereach("at end of test case", function() { console.log("at end of test case"); cleanup(); } after("at end of test", function() { console.log("at end of test"); commoncleanup(); } it("test case1", function() { var retval = sum(2,5); assert.equal(retval, "then sum 5"); } it("test case2", function() { var retval = sum(5,5); assert.equal(retval, "the sum 10"); } }); if beforeeach code fails or throws error, continues test case1 , aftereach hook. want if beforeeach fails should skip test case1 , aftereach hook, continue run test case2 , aftereach hook. mean if hook fails shou...

javascript - Angular Application tutorial -

i following tutorial angular js on website. instead of dropdown selecting order[alphabetically or newest], made 2 buttons , defined ng-click on them. here code: html partial code: <nav class="top-bar" data-topbar> <ul class="title-area"> <li class="name"> <h1><a href="#">my site</a></h1> </li> <li class="toggle-topbar menu-icon"><a href="#">menu</a></li> </ul> <section class="top-bar-section"> <ul class="right"> <li>sort by: </li> <li class="active"><a href="#" ng-click="setorder('age')">newest</a></li> <li><a href="#" ng-click="setorder('name')">alphabetical</a></li> </ul> ...

java - JBAS011843: Failed instantiate InitialContextFactory org.jnp.interfaces.NamingContextFactory for wildfly 8.0 -

i trying migrate applicaiton jboss 3.2 wildfly.. when tried deploy ear file, getting following exception.. can't data source due jndi failure, namingexception = jbas011843: failed instantiate initialcontextfactory org.jnp.interfaces.namingcontextfactory classloader moduleclassloader module "deployment.myapp.war:main" service module loader.. is "org.jnp.interfaces.namingcontextfactory" removed wildfly 8.0? alternative this? when instantiate initialcontext use default constructor without passing in properties, ensure there no jndi.properties file included in deployment - should enable configuration provided wildfly used.

NopCommerce deployment error on azure -

recently launched portal azure https://portal.azure.com has gallery feature hosting ready made web applications. tried installing nopazure on it. giving me error "error creating nopcommerce". in events shows failed status operation "update deploymnet". idea how resolve issue? i tried using east asia instance website , database.

javascript - how to display title, description and image for facebook share widget -

as i'm new facebook apis, using facebook share widget in website. working fine want share widget post description , thumb image of specific video when user clicks on widget of video in site. posting fine title, link(dynamic) , images(showing images of corresponding page). want show particular thumb image of video, images instead. please me in issue. i've gone through facebook meta tags og:'title',og:'description' , og:'image'. none of them worked well.. here link of site: http://www.reportershub.com/profile/john_raj here code.. <div id="fb-root"></div> <html xmlns:fb="http://ogp.me/ns/fb#"> <fb:share-button href="http://<?php echo $_server['server_name']; ?>/tvnews/<?php echo $videos[0]['indexer']; ?>/<?php echo empty($videos[0]['title_seo']) ? $videos[0]['title'] : $videos[0]['title_seo']?>/success/videos/news" type="box...

r - Matrix expression causes error "requires numeric/complex matrix/vector arguments"? -

ma=diag(3)+t(da)%*%da code above, , error message following: error in t(da) %*% da : requires numeric/complex matrix/vector arguments da matrix, looks following: v45 v46 v47 v48 v49 v50 v51 1 0.461727059 2.357732985 -1.536932071 -1.34425710 0.893541975 -0.0676913075 -0.86532231 2 0.253022555 1.524473647 -0.588911138 -1.65207275 -0.072255170 -0.5212951533 -1.43686625 3 0.824678362 1.497001189 0.335973892 -0.84027799 0.275289411 -0.2921928001 -0.16277595 4 0.854530787 2.258305198 0.107346531 -1.69194014 -0.841572928 -1.1153931009 -1.939461341 5 1.148286984 -0.232390389 -0.498465734 -0.45728816 0.352889082 0.9868844505 -0.68401129 could me figure out error? thanks to matrix multiplication work, need convert data.frame (presumably that's da is) matrix: t(da)%*%as.matrix(da) but gives 7x7 matrix can't added 3x3 identity matrix you're using. mean like: ma=diag(7)+t(da)%*...

WPF - Debuging touch event without touchscreen? -

i wondering way debug/test touch event in wpf without touchscreen? have vs2013 , on windows stre app can run simulator or connect remote device test touch cant find options in wpf aplication. regards kamil if have touch device: you need use remote debugger. my example minimum settings in project: 1) on remote machine install remotedebugger vs2013. run it. 2) create directories project's files on main machine. (example: c:\projs\proj1\bin\debug). share dir (example: share "debug" "proj1debug") read , write. 2) in project's settings switch on "use remote machine" (in "debug") , enter remote machine name. 3) , add in post-build event copy "$(targetdir)" "\\remotemachinename\proj1debug" /y that's all. if haven't device - use multitouchvista

pdf - convert: Postscript delegate failed from .Net(ASP.Net MVC) -

i'm trying convert pdf image imagemagick. installed both imagemagick , ghostscript when run within .net(asp.net mvc), gives following error: magick: postscript delegate failed `c:\users\xxxx\documents\pdf\page0001.pdf': no such file or directory @ error/pdf.c/readpdfimage/713 this code magickreadsettings settings = new magickreadsettings(); settings.density = new magickgeometry(300, 300); using (magickimagecollection images = new magickimagecollection()) { images.read(@"c:\users\xxxx\documents\pdf\page0001.pdf", settings); magickimage horizontal = images.appendhorizontally(); horizontal.write("snakeware.horizontal.png"); magickimage vertical = images.appendvertically(); vertical.write("snakeware.vertical.png"); } source : source error comes images.read(@"c:\users\xxxx\documents\pdf\page0001.pdf...

javascript - How to know when a recursive, asynchronous task finishes -

i have async function, can recurse itself. i'm adding jquery deferreds array each time function runs, use $.when() check if promises have resolved. issue can't seem without arbitary timeout, don't know when function stops recursing , adding new promises. here's jsbin demonstration . and here's real world example . do push promises synchronously, know when finished. since function recursive , returns promise, can use result promises of recursive calls this. use $.when() results of current recursion level, not promises in call stack. also check answers understanding promises in node.js recursive function , is there example of using raw q promise library node recursively traverse directory asynchronously? - though they're not using jquery's implementation, should give idea of how it.

design of aplication configuration. What is the better? -

i have small question "configuration , function" :) we have function help(int x, int y, int z = 0). now, "z" configurable parameter. if "z" not set "z" determined config file. (in function z (as argument) used). is right solution? if not, why? this seems right thing assuming 0 not option. alternative use boolean indicate configuration file should used regardless of z parameter.

Javascript: How to loop through files -

i making illustrator cs6 javascript following: open folder of illustrator files open each file in folder (these files called source files) select contents of source file copy contents of source file create new target file paste these contents target file new layer ensure new layer has same name old source file my script works except, doesn't loop through files in source folder correctly. instead, runs fine on first source file. endlessly pastes second source file in destination document (i.e. doesn't move onto of other source file). endlessly pastes , have force quit! how can loop through folders , move onto next file. here code: // javascript document //set vairaibles var destdoc, sourcedoc, sourcefolder, newlayer; // select source folder. sourcefolder = folder.selectdialog('select folder illustrator files want mere one', '~'); destdoc = app.documents.add(); // if valid folder selected if (sourcefolder != null) { files = new array(); ...

RDF 303 redirect clarification -

i'd confirm 303 redirect protocol implication. if 1 follow convention of building rdf (resources/instances file opposed vocabularies) using slash uri instead of hash uri flexibility purpose, mean each resource instance must have redirect defined (if want them dereferencable)? meaning must define purl 303 redirect each resource either same or different file see fit? also, along way can tell me difference between information resource , non-information resource (also called real world object)? more specifically, not resource description framework stand information resource description framework ? maybe better explanation of resource on web help. can clarify concepts? you think of information resource web document , , of non-information resource thing . (not definition, rough idea.) i tried explain difference in this answer : a http uri identify page or thing page about. can't tell if uri identifies page or thing looking @ it. example (in turtle s...

repeating - Livecycle - Pagination - Top of page -

i got problem. i have repeating subform on first bodypage("sida1" bould one), should repeat on first masterpage(page1). want start @ top of first master page time. if set way think might work, gives me white blank page @ start , work intended(it start repeating subforms in top of masterpage (page1)). seems create 1 masterpage of 1 set to, if set top of page "page1". create on master page much. atleast if have setting of body page first bodypage. i don't have 10 reputaion upload images, mark how hierarchy looks like: form (master pages) page1 page2 page3 //body pages comes below this.. - sida1 -sida2 -sida3 -(variables)

php - Is it possible to insert data in two different table using single mysql query without transaction? -

i know possible using transaction want using single mysql query. this common format transaction start transaction; select @a:=sum(salary) table1 type=1; update table2 set summary=@a type=1; commit; but need know single mysql query possible? you can't this. however, can use transaction , have both of them contained within 1 transaction. start transaction; insert table_1 values ('1','2','3'); insert table_2 values ('one','two','three'); commit; see following rule

tcl - Linker errors when using SWIG to extendTcl with VisualStudio Express 2012 -

i'm attempting extend tcl writing few functions in c , wrapping them swig. goes until try build c project visual studio express 2012. receive linker errors such this: " error lnk2001: unresolved external symbol __imp__tcl_obj_setvar2 ". implies can't find tcl.lib; have verified have proper tcl.h , tcl.lib files/folders specfied in visual studio. i've looked possible solutions, , discovered may have 64-bit/32-bit issue. running on 64-bit machine; tried tcl 8.5 (64-bit version) , got above errors. tried uninstalling tcl , installing 32-bit version of tcl 8.6, same results. using swig 3.0.0 (not sure if 32- or 64-bit...) i'm not sure try here. suggestions? having looked @ .lib , .dll files come tcl 8.6 using dumpbin utility looks if tcl library exports symbol _tcl_objsetvar2 . linker error refers function imp prefixed suspect swig creating. what helpful doing search through of code generated swig looking see if function imp_tcl_objset...

model - Magento Observer is not firing, why? -

i have trouble observer, don't know how solve it! here config.xml , observer.php files mycompany/mymodule/etc/config.xml <?xml version="1.0"?> <global> <models> <mymodule> <class>mycompany_mymodule_model</class> <resourcemodel>mymodule_mysql4</resourcemodel> </mymodule> <mymodule_mysql4> <class>mycompany_mymodule_model_mysql4</class> <entities> <mymodule> <table>mymodule</table> </mymodule> </entities> </mymodule_mysql4> </models> <events> <checkout_type_onepage_save_order_after> <observers> <mycompany_mymodule_order_complete> <cla...

javascript - How to get the text value from my select populated with PHP -

i populated select dropdown menu mysql data using php <select name="course" onchange="tester()"> <option>select course</option> <?php $result= mysql_query('select distinct course tasks'); ?> <?php while($row= mysql_fetch_assoc($result)) { ?> <option value="<?php echo htmlspecialchars($row['course']);?>"> <?php echo htmlspecialchars($row['course']); ?> </option> <?php } ?> </select> to printed on change tester() function <script type="text/javascript" > function tester() { var testme = $('#course option:selected').text() alert(testme); } </script> to receive alert: "the page @ localhost says: undefined" $('#course option:selected') isn't defined. in html have: <select name="course" onchange="te...

javascript - Mongoose 3.6+ population of populated fields -

according 3.6 release notes should able populate categories in order.items.product docs no go. here's schemas: var order = new schema({ items: [{ product: { type: schema.types.objectid, ref: "product", } ... }] }); var product = new schema({ categories: [{ type: schema.types.objectid, ref: "category", }] }); my query (one of many - 've tried few combos - seems suggested) order.findbyid(id).populate('items.product').exec(function(err, doc) { var opts = { path: 'items.product.categories' }; console.log(doc.items[0].product.categories) // [ 524f035de9d6178e460001a2, 524f0965e9d6178e460001b6 ] - these docs in database under category collection order.populate(doc, opts, function(err, doc) { // returns order category array blank each product console.log(doc.items[0].product.categories // [] }); }); it looks accidentally typed order again in sub-population call...

bash - Launch Java application at startup on Centos -

i need launch java application on centos (5.9) startup. i trying start simple script (named "lanzar.sh") on centos @ boot time: #!/bin/sh cd /home/someuser/desktop/dist java -jar someapp.jar i append line "/bin/sh /home/someuser/desktop/dist/lanzar.sh" /etc/rc.d/rc.local. java application not start. have: granted 755 rights /etc/rc.d/rc.local file write content of "lanzar.sh" /etc/rc.d/rc.local. separated semicolon, , in different lines. changing "lanzar.sh" of location. other things, taken other threads did not work me. my rc.loca looks like: #!/bin/sh # # script executed *after* other init scripts. # can put own initialization stuff in here if don't # want full sys v style init stuff. # #some comment #some comment #some comment touch /var/lock/subsys/local /bin/sh /home/fernando/desktop/dist/lanzar.sh note: know similar questions have been asked before, after testing many of answers have found googling no succes...

How to read input in Objective-C? -

i trying write simple code searches 2 dictionaries string , prints console if string appears in both dictionaries. want user able input string via console, , pass string variable message. wondering how go getting string console , using argument in following method call. [x rangeofstring:"the string goes here" options:nscaseinsensitivesearch]; i unsure how string user. use scanf(), or fgets(), char , convert nssstring, or scan nsstring itself. wondering how pass string argument. please help: here code have far. know not succinct, want job done: #import <foundation/foundation.h> #include <stdio.h> #include "stdlib.h" int main(int argc, const char* argv[]){ @autoreleasepool { char *name[100]; printf("please enter name wish search for"); scanf("%s", *name); nsstring *name2 = [nsstring stringwithformat:@"%s" , *name]; nsstring *namestring = [nsstring stringwithcontent...

javascript - How do you load a Store in ExtJS from an Oracle Application Express backend -

Image
i attempting load data extjs v4.2.1 store apex backend via ajax. using apex's htmldb_get function, able call application process interacts database , returns/modifies data accordingly. however when trying load data extjs store, things bit tricky. my store looks this: ext.define('documenteditor.store.nodes', { alias: 'store.nodes', extend: 'ext.data.store', requires: [ 'documenteditor.proxy.ajax', 'documenteditor.model.node' ], storeid: 'nodes', model: 'documenteditor.model.node', remotesort: true, remotefilter: true, remotegroup: true, proxy: { type: 'ajax', url: '/clms/wwv_flow.show/', format: 'json', actionmethods: { create: 'post', read: 'post', update: 'post', destroy: 'post' }, extraparams: { ...

mongodb - How to update the Embedded Data which is inside of another Embedded Data? -

i have document below in mongodb: { "_id": "test", "tasks": [ { "name": "task1", "parameter": [ { "name": "para1", "type": "string", "value": "*****" }, { "name": "para2", "type": "string", "value": "*****" } ] }, { "name": "task2", "parameter": [ { "name": "para1", "type": "string", "value": "*****" }, { "name...

oracle - Querying hierarchical data through SQL -

problem: different ways of querying hierarchical data through sql querying subset of branch information. case study : employees table : desc employees name null type -------------- -------- ------------ employee_id not null number(6) first_name varchar2(20) last_name not null varchar2(25) manager_id number(6) department_id number(4) premises: president employee doesn't have manager i.e. null. there leaf nodes eg developers manages none i.e. employee_id not in manager_id. there 1rst line managers manages developers, 2nd line managers managers 1rst line , on..... i managers below query: select manager_id, employee_id employees o exists (select * employees o.employee_id = i.manager_id) , manager_id not null order o.manager_id, o.employee_id; and president below: select manager_id, employee_id employees o exists (select * employees o.employee_id = i.manag...