Posts

Showing posts from July, 2014

java - HTTP Status 500 wrapper can not find servlet class -

i have created simple dynamic web project on eclipse. trying submit html form , passing request servlet. when click on submit exception: http status 500 wrapper can not find servlet class com.tcs.navigator.servlet.labservlet or class depends on in jsp form actoin tag had given same action path per web xml : action = "labservlet" content of web.xml : <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="webapp_id" version="2.5"> <welcome-file-list> <welcome-file>home.jsp</welcome-file> </welcome-file-list> <servlet> <description>to upload files processing</descri...

php - ffmpeg unable to initialize module windows 7 32 bit -

i have installed ffmpeg in window 7 32 bit in php extension.when start apache,i getting message "php startup: ffmpeg: unable initialize module" my xampp version: 2.5 php version : 5.3.8.0 how solve issue? 1.enter code here go apachefriends.org find link ffmpeg 0.6.0 php 5.3.1 there. 2.copy php_ffmpeg.dll xampp\php\ext. 3.copy ffmpeg.exe root of site or anywhere else long know (you have define path in php file)... 4.copy else windows/system32. 5.add "extension=php_ffmpeg.dll" or remove ";" on beginning of line in php.ini file (xampp\php\php.ini ) 6.restart apache server

node.js - Storing reference of a function in typed array -

i have huge list of functions , need store them typed array. list 10 millions function : var size = 10000000 * 4; var buffer = new arraybuffer( size); var int32view = new int32array(buffer); //how store function address in list? int32view[0]= addressof(myfunc); //how retrieve function list? myfunc = int32view[0] function; thanks

extjs - how to put html page into ext js panel? -

i want put html ext js panel. have panel , using panel.body.update('html code here') method. when page size bigger panel size there no scrollbars see whole page. can fix it? or there other ways put html in ext js components? try below :- { xtype : 'panel', id : 'agreement-content', html : "", cls : 'agreement-text' } then can set html in panel below. ext.getcmp('agreement-content').sethtml('your html content');

apache - mod_rewrite multiple question marks -

occasionally marketing department send out mailer contains links multiple question marks in them. http://www.acme.com/site-page.jsp?content=mainpage?utm_campaign=somecampaign&utm_source=email this results in application server interpreting mainpage?utm_campaign parameter instead of mainpage . there way intercept these erroneous urls in apache , replace second ? & . you can put code in htaccess (which has in root folder) rewriteengine on rewritecond %{query_string} ^(.+?)\?(.+)$ rewriterule ^site-page\.jsp$ /site-page.jsp?%1&%2 [r=302,l] this code redirect /site-page.jsp?content=mainpage?utm_campaign=somecampaign&utm_source=email to /site-page.jsp?content=mainpage&utm_campaign=somecampaign&utm_source=email now have params: content = mainpage utm_campaign = somecampaign utm_source = email note: feel free change 302 (temporary) redirect 301 (permanent) redirect edit rewritecond %{query_string} ^(.+?)\?(.+)$ rewrit...

character encoding - Bizarre fonts showing in .ppi when opened with notepad/notepad++ -

i've been looking solution quite while already, i'm asking here. i need change .ppi file enable auto-update configuration of sophos antivirus. .ppi iconfig.ppi, opening notepad , notepad++ shows bizarre characters, e.g.: mz ÿÿ ¸ @ 8 º ´ Í!¸lÍ!this program cannot run in dos mode. could suggest solution or point me source read myself? in advance , have great day. this binary file! cannot edit n++. it's exe one.

c - switch case isn't true than also its executing case which is inside the failed one -

#include<stdio.h> int main() { switch(2) { case 1: if(1) { case 2: printf("hello\n"); }; } return 0; } output = hello i'm passing 2 in switch case 1 not true enters , executes code inside case 2 . how come enters case 1 ? thanks. after switch(2) , jump case 2 label. fact within if block contained within case 1 irrelevant. case 2: functions no differently goto label, jump wherever is. not true case 1 somehow being entered. to clarify, indented looks thus: #include<stdio.h> int main() { switch(2) { case 1: if(1) { case 2: printf("hello\n"); } ; } return 0; }

osx - Pelican plugins not found -

i testing out pelican personal blog use stuck use of plugins. apparently, pelicanconf.py file not picking plugins. here's snippet of pelicanconf.py : theme = '/users/namely/public/mypersonalworkspace/static_blog/static-blog/pelican-themes/pelican-bootstrap3' plugins_paths = ["./plugins","plugins","./pelican-plugins","pelican-plugins","/users/namely/public/mypersonalworkspace/static_blog/static-blog/pelican-plugins"] plugins = ["sitemap"] my pelican setup theme correct since using theme correctly. somehow, not reading plugin directories. following folder structure: static-blog/ content/ output/ pelican-plugins/ sitemap/ __init__.py sitemap.py readme.rst plugins/ sitemap.py pelican-themes/ pelican-bootstrap3/ # , pelican-bootstrap3's files ...

c++ - How to remove vector of struct that contains vector of int -

i want delete val[i] follows: struct sstruct{ int v1; double v2; }; struct sstruct2{ std::vector<int> id; double a; std::vector<sstruct > b; }; std::vector <sstruct2> val; i tried code got error, using std::remove_if bool testfun(sstruct2 id1) { bool result= true; if ((id1.a< somevalue) { // fails result= false; } return result; } void delfun() { (int i= 0; i< val.size(); i++) { if (!testfun(val[i])) { **// here don't how search val[i] fails in condition** val.erase(std::remove_if(val.begin(), val.end(), val[i].id.begin()), val.end()); } } } error: c2064: term not evaluate function taking 1 arguments you don't have use loop loop, use following in delfun val.erase(std::remove_if(val.begin(), val.end(), []( const sstruct2& id) { // lambda c++11 use flag -std=c++11 r...

batch file - How to set and get variables when working in cmd -

i working in cmd send http , post requests curl . there many times sending requests same pages , typing them out every time huge pain. i'm trying figure out how use set= can save these urls each time want use them. i've tried c:\>set page = "http://www.mywebpage.com/api/user/friends" c:\>page 'page' not recognized internal or external command, operable program or batch file. c:\>echo %page% %page% but won't return page name. how can accomplish need? c:\windows\system32>set page="http://www.mywebpage.com/api/user/friends" c:\windows\system32>echo %page% "http://www.mywebpage.com/api/user/friends" c:\windows\system32>set page=http://www.mywebpage.com/api/user/friends c:\windows\system32>echo %page% http://www.mywebpage.com/api/user/friends don't use spaces around = . select version or without " according needs. variable value may contain spaces inside: c:\windows\system32...

Rendering Angularjs Template from within controller -

suppose have following angularjs template <script type="text/ng-template" id="tmp"> <li> {{firstname}} {{lastname}}</li> </script> and have 2 textboxes , save button like <input name="firstname" type="text"/> <input name="lastname" type="text"/> <button name="save" text="save"/> when user enters values in firstname , lastname textboxes , press on save button want these 2 values passed template , resultant html should appended existing ul . how can angular? you create directive dynamically compile template , append ul when hits save button, that's whole purpose of ng-repeat . here's how can work ng-repeat instead: angular.module('main', []); angular.module('main').controller('mainctrl', function ($scope) { $scope.names = []; $scope.save = function () { $scope.names.push({first: $scope.firs...

itunesconnect - How to add an icon for the new app in the NEW iTunes Connect -

i can't find way add icon new mac os x app in new itunes connect. see http://i.imgur.com/yb7uico.png no edit or choose file or upload link or button. use safari, latest version... and uploaded binary doesn't have icon: http://i.imgur.com/o78cnx1.png after reading https://devforums.apple.com/community/ios/distribution/itc realised have submit app review see icon. , indeed after icon appeared... ufff....

authentication - Laravel 4 filter group routes for different roles -

i have 3 roles , admin panel , want change links (and routes) on panel according roles , dont use packages ... have 1 common filter , 1 admin filter , 1 moderator filter , 1 different user filter. different user filter want change links in control panel . problem : route::group(array('before' => 'common'), function(){ route::controller('panel','admin_panelcontroller'); route::controller('phone','phnecontroller'); route::controller('internet','internetcontroller'); route::controller('message','messagecontroller'); // siteden gelen başvurular /* admin */ route::group(array('before' => 'admin'), function() { route::controller('useroptions','useroptionscontroller'); }); /* moderator */ route::group(array('before' => 'mod'), function() { route::controller('notifications','notificationscontroller'); }); }); /* differe...

php - Apache wamp, zend framework installation issue (permission issue and more) -

i trying install zend framework very naive looked in internet setting when apply settings doesn't work. following error forbidden you don't have permission access / on server. apache/2.4.9 (win64) php/5.5.12 server @ localhost port 80 let me go step step did installed zend framework added following line in file "c:\windows\system32\drivers\etc\hosts" file.. 127.0.0.1 test un-commented following 2 lines of code httpd.conf include conf/extra/httpd-vhosts.conf loadmodule rewrite_module modules/mod_rewrite.so add following few lines in httpd-vhosts.conf <virtualhost *:80> servername test documentroot "c:/workspace/zendy/public" setenv application_env "development" <directory "c:/workspace/zendy/public"> directoryindex index.php allowoverride order allow,deny allow </directory> </virtualhost> after when restart wamp server ...

angularjs - Can I create a javascript function in EcmaScript 5 with the new get and set in one declaration? -

i interested in es5 getters , setters use angular.js controllers. doing: var helloec5 = function(){ //constructor this.pants = "jeans"; }; helloec5.prototype = { firstname: 'seeya', lastname: 'latir', fullname() { console.log("get") return this.firstname + ' ' + this.lastname; }, set fullname (name) { console.log('set') var words = name.tostring().split(' '); this.firstname = words[0] || ''; this.lastname = words[1] || ''; } }; but there way in function() succinctly together? want (pseudo code) ; var helloec5 = function() { firstname: 'seeya', lastname: 'latir', fullname() { console.log("get") return this.firstname + ' ' + this.lastname; }, set fullname (name) { console.log('set') var words = name.tostring().split(' '); this....

java - Issues with Loading AdMob Ads on App -

i trying have ad banner display on app , seem having issue. anytime go activity, app crashes , mentions when trying load ad, null reference. not positive why though. here xml adview: <?xml version="1.0" encoding="utf-8"?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/res-auto" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/gamelayout"> <com.google.android.gms.ads.adview android:id="@+id/bannerad" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" ads:adsize="banner" ads:adunitid="my_adunitid" /> </framelayout> here java code using ads: //load ads adview adview = (adview)findviewbyid(...

sql - Actual vs Budget variance crystal report sap repeating columns -

i new crystal reporting . trying join multiple tables have working queries when try add them in sap cr editor . 1 of column shows fine others start repeating values. i using following tables budget a/c code -- oact, accname -- budget relevant a/c name current month actual -- ojdt join jdt1 -- pick je current month budget -- obgt join bgt1 -- pick budget current month variance -- jdt1 - bgt1 -- difference b/w current month actual , current month budget year date actual -- sum of jdt1 -- total pnl balance current fiscal year year date budget -- sum of bgt1 -- total budget balance current fiscal year year date variance -- actual - budget --difference b/w year date actual , year date budget report format list of columns want display . account names current month actual current month budget current month variance year date actual year date budget year date variance what ha...

ios - How to handle image scale on all the available iPhone resolutions? -

Image
what sizes best use images: background.png, background@2x.png , background@3x.png if want use image example cover full width , half height of screen on resolutions iphone portrait app? this have now: device points pixels scale physical pixels physical ppi size iphone x 812x375 2436x1125 3x 2436x1125 458 5.8" iphone 6 plus 736x414 2208x1242 3x 1920x1080 401 5.5" iphone 6 667x375 1334x750 2x 1334x750 326 4.7" iphone 5 568x320 1136x640 2x 1136x640 326 4.0" iphone 4 480x320 960x640 2x 960x640 326 3.5" iphone 3gs 480x320 480x320 1x 480x320 163 3.5" some people edge edge image (like banner on bottom left right edge of screen) iphone 6 plus prepare back@3x.png width 1242 , iphone 6 back@2x.png width 750 match iphone 6 screen size not thin...

Check for existence of a process in c++ using a thread -

i trying check existence of process in c++ using thread. tested without having thread , let main check existance. worked. when put part of code inside thread not work. puzzled see not working. please tell me why part of code not working when comes using in thread. my initial test program existance of process: compiled below: cc protest2.cc -o nothr int main(int argc, char **argv) { struct stat sts; string f=string("/proc/")+argv[1]; while(!(stat(f.c_str(), &sts) == -1 && errno == enoent)) { cout<<"process exists"<<endl; sleep(1); } cout<<"process not exist"<<endl; return 0; } a small process runs secs , exits. int main() { sleep(5); for(int i=0;i<5;i++) { sleep(2); } } my second test program existance of process using thread(this not work): compiled below: cc protest.cc -o thr extern "c" void *run(void *str){ struct stat sts; while(!(stat((char *)str, &sts) == -1 && errno == en...

twitter bootstrap - How to Reduce the font size of Morris Donut graph? -

here js fiddle link jsfiddle i have tried out using css..but not happening svg text{ font-size:10px!important /*but not reducing font size */ } include style svg text{ font-size:10px!important; } in end of html (after js includes). solve problem. p.s:this not best way solve morris.js default resizes text fit graph.

database - (DB/SQL) Performance-oriented way to manage map coordinates data -

i have function lets users either create new spot/marker on map using usual latitude & longitude paired value or modify existing spots. , these spots need saved table. scenario : table holds 6 set of coordinates, retrieved on map. let's 2 of existing spots modified, 3 of them removed, , finally, 4 new spots added map. now, being novice sql user, think of 2 approaches writing resulting coordinates database follows: remove existing data in table first, grab that's left on map , iterate through them , create each set of coordinates. update data modified spots. delete ones removed user. create new records new spots. for simplistic scenario, i'd think option #1 requires 1 delete query, , 6 create queries, result in total of 7 queries need executed. on other hand, option #2 requires 3 delete queries, 2 update queries, , 4 create queries, comes total of 9 queries. the whole point of posting question because i'm not sure kind of performance advantage or dis...

What method is there available to communicate 2 computers using Javascript & Ajax? -

the whole point understand how computers should communicate each other using javascript (no jquery framework) , ajax (by using xmlhttprequest). have memory game , add online option people can play friends. thinking peer 2 peer connection, didn't know how , why posted question (i sorry if question not meant here). had in mind: user 1: 1. click->sendaction server server: 1. receiveinfo->savedetailsindb 2. packreceivedinfo->send user 2 user 2: 1. receiveinfo->updatedetails edit: fstanis, know should use websocket method in order communicate users/computers each other. to answer question - there no way make 2 users communicate each other using ajax (xmlhttprequest) directly (e.g. without server relay messages them). xmlhttprequest requires 1 of users have http server running , it's impossible browser act http server. what you're looking websocket - allow build own client-server architecture independent on underlying http server.

python - How does process manage to keep running even though it receives SIGHUP despite being invoked with nohup? -

i testing if commands invoked nohup indeed not sighup signal. i confirmed if log centos box using putty, run nohup python foo.py & foo.py contains infinite loop , if kill putty, python program still keeps running. then wrote sig.py handles , logs signals receives sig.txt. import signal, os def handler(sig, frame): f = open('sig.txt', 'a') f.write('signal: ' + str(sig) + '\n') f.close() in range(1, 20): if in [9, 19]: continue print 'setting signal handler for', signal.signal(i, handler) f = open('sig.txt', 'w') f.write('start\n') f.close() while true: pass then run nohup python sig.py & in putty terminal. close putty terminal. i open new putty terminal , check content of sig.txt , find in it. $ cat sig.txt start signal: 1 so seems running process still receives sighup. if running process still receives sighup, how it manages stay alive when invoked sigh...

c# - How to retrieve clicked list view row data and hide id column -

i retrieve data clicked listviews row. hide id column if it's possible. tried use commands click event , pass id field commandparammeter no success. searched other approaches nothing. information, need functionality show detailed information each clicked user other listview data easier view other users. conclusion: need clicked row data , if possible, hide id column. xaml code: <listview x:name="lstusers" itemssource="{binding userlist,updatesourcetrigger=propertychanged}"> <listview.view> <gridview x:name="grdusers"> <gridviewcolumn header="hidden_id" displaymemberbinding="{binding id}"/> <gridviewcolumn header="name" displaymemberbinding="{binding name}"/> <gridviewcolumn header="surname" displaymemberbinding="{binding surname}"/> <gridviewcolumn header="age" displaymemberbinding="{binding a...

java - Returning multiple ints as a single value -

hey i'm working on method picks smallest digit ones, tens, hundreds, , thousands place on 2 passed integers , returns int made of smallest values each place. example if int a= 4321 , int b=1957 method return 1321. code far, think got cant find out how return new value integer. public static int biggestloser(int a, int b){ int first; int second; int third; int fourth; if(a>9999 || a<1000 || b>9999 || b<1000){ if(a>b) return b; else return a; } else{ if(a%10 < b%10) first=a%10; else first=b%10; if(a/1000<b/1000) fourth=a/1000; else fourth=b/1000; if(a/100%10<b/100%10) second=a/100%10; else second=b/100%10; if(a/10%10<b/10%10) third=a/10%10; else third=b/10%10; //int total=fourth,third,second,first;????? //re...

symfony - Change ES data on nested object changes automatically -

types: product: mappings: title: { search_analyzer: custom_search_analyzer, index_analyzer: custom_index_analyzer, type: string } status: brand.name: { search_analyzer: custom_search_analyzer, index_analyzer: custom_index_analyzer, type: string } brand: type: "nested" properties: status: ~ persistence: driver: orm model: mybundle\entity\product\product provider: query_builder_method: customproductquerybuilderelastica listener: ~ finder: ~ this mappings type product. customproductquerybuilderelastica contains code populates products have active status , have related brand status active. working if change products admin. what want when change brand st...

c# - LINQ to entites, query on entity then except from a list (composite key) -

i query entity (inscriptionecole) few filters. entity has composite key (inscriptionecolekey, 7 properties). in other side, have list of key (list). my goal remove query tuples key present in list. how can ? thank inscriptionecolekey : fkanneeanneescolaire fkcldegre fkcllecole fkcllformation fkcllversion fkelenumeleve numins example of query on inscriptionecole : var ins = datacontext.inscriptionecole.where( => i.fkanneannee == "20132014" && i.fkcllecole == "cifom" && i.valide == "o" ); can't filter so? datacontext.inscriptionecole.where(item => !otherlist.contains(item, customcomparer)); see documentation contains here update what needed nonequi join: datacontext.inscriptionecole.where(ecoleitem => !keys.any(key => key.fkelenumeleve == ecoleitem.fkelenumeleve && key.fkcllecole == ecoleitem.fkcllecole && ...));

javascript - Deconstructing an Open Layers 3 map -

so, using open layers 3 ember.js make dashboard, , i've made map load dynamically want destroyed when leave route, thing found map.destroy() old version of api , there don't seem 1 in new version. i used chrome debugger after going map page couple of times , found had 29 ol.map objects. this have far app.mapview = ember.view.extend({ map: null, didinsertelement: function() { this.map = new ol.map({ target: 'map', layers: [ new ol.layer.tile({ source: new ol.source.mapquest({layer: 'sat'}) }) ], view: new ol.view({ center: ol.proj.transform([37.41, 8.82], 'epsg:4326', 'epsg:3857'), zoom: 4 }) }); }, willdestroyelement: function() { // destroy this.map } }); i cant find in docs removing maps. thanks in advance. you should try this: app.mapview = ember.view.extend({ // if not using ember.get/set you'd better make "private...

javascript - How to return an object from a selector? -

i have code $( document ).ready(function() { $('#boxone') = new category(); $('#boxone').playfunction(); foo(); }) function category(el) { this.playfunction() { alert('bar') } } function foo() { $('#boxone').playfunction() } this first playfunction() works fine, foo() returns undefined. as understand category() class create game within element id = boxone .if true, create plugin .( http://learn.jquery.com/plugins/basic-plugin-creation/ ). doing code can changed - $('#boxone').category(); and functions playfunction() event based function- $('#boxone').trigger('play'); in plugin , listener attached on 'play' event handler playfunction();

ios - Event for when a view is no longer on top of the view stack -

is there way tell when view no longer on top of view stack? example modal view gets pushed on top of view stack? so have view table view, , there events cause modals shown. when modal dismissed want reload data in table. is there event can subscribe achieve this? maybe possible kvo? you can use nsnotification system. in uitableviewcontroller register nsnotification (let's assume nsstring *notifname = @"dismissmv"): [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(hasdismissed:) notifname object:nil]; and implement -(void)hasdismissed:(nsnotification *)notification then when dismiss viewcontroller you'll post notification: [self dismissviewcontrolleranimated:true completion:^{[[nsnotificationcenter defaultcenter] postnotificationname:notifname object:nil];}];

git - Bitbucket giving credit to wrong person for commits -

i use sourcetree , bitbucket version control. whenever commit , push sourcetree , @ on bitbucket under recent activity shows made commit. however, when go commit page of repository says different employee made commit. person claiming made commit instead of me used computer before did opened git command shell , typed git config user.name showed name. can't find trace of settings in bitbucket's account settings page or sourcetree's tools -> options menu , have no idea else look. i figured out. email address associated account.

datetime - HTML input default value -

the following sets empty initial value in input box. there way force null value if nothing entered? since datetime-local field, think empty string causing me other problems. <td><input id="1stintstart" value="" type="datetime-local"></td> do mean placeholder? <input type="text" placeholder="test"/>

python - Print nothing when number is None -

this script def p(t, n): if n == none: print "%s" % t else: print "%-10s %3d" % (t, n) p('a' , 4) p('bc' , 12) p('defgh', 876) p('ijk' ,none) prints a 4 bc 12 defgh 876 ijk when executed. can function p shortened output stays same? i had hoped define p as def p(t, n): print "%-10s %3d" % (t, n) but definition, script errors " typeerror: %d format: number required, not nonetype ". def p(t, n): print "%-10s %3d" % (t, n) if n else "%s" % t if want print n if n = 0 print "%-10s %3d" % (t, n) if n not none else "%s" % t if have multiple args can filter out none values , use str.format. def p(t, *args): args = filter(none, args) print t,("{} "*len(args)).format(*args) which outputs: in [2]: p('defgh', 876, none, 33,none,100) defgh 876 33 100 or re...

Workaround for Slow Java Swing Menus -

in java 7 , 8 there bug in swing menus causes slow when running application remotely on x11 while other x11 applications running. issue introduced in java 7 , has never been fixed. have suggestions on workaround. using nxclient addresses swing menu issue, introduces own unwelcome issues. the steps reproduce swing menu issue are: - run x11 application locally activity - log remote server using ssh -y someserver - execute java gui application (e.g. jvisualvm) running java 7 or 8 - select menu , observe several second delay in response just spent entire day trying solve same issue. there's barely info out there. local machines: linux fedoracore 20, kde desktop, nvidia geforce 7300 le linux fedoracore 20, kde desktop, nvidia geforce gt 720 running remote java gui on ssh, swing popups extremely slow pc2. desktop freezes until popup appears. on other hand, pc1 runs fast/smooth, no problems @ all. turns out, in case, problem pc2 has 2 monitors. closest bug report...

Oracle SQL - Not Exists - string does not exist in a list of values -

background: spriden_id, sprhold_hldd_code may have 1 or more of several values or no values. i need select sp.spriden_id, sp.spriden_last_name, sp.spriden_first_name, sr.shrdgmr_seq_no, sr.shrdgmr_program where (sh.sprhold_hldd_code = 'rh') not exist. so far, no records returned. i have found if put code not in list of possible values (such z) in sh.sprhold_hldd_code = 'z', return results. data: (column names abbreviated) spriden_id spriden_last spriden_first shrdgmr_seq_no shrdgmr_program sh.sprhold_hldd_code 100001 smith sue 1 alhe rh 100001 smith sue 1 alhe aa 100001 smith sue 1 alhe bb 100005 conners tim 1 busn rh 100008 occent mary 1 math cc 100008 occent mary 1 ...

visual studio - Imitating standard user input in c++ with command line arguments -

let's have following c++ code #include <iostream> int main() { int x,y; std::cout << "please enter first input." << std::endl; std::cin>>x; std::cout << "please enter second input." << std::endl; std::cin>>y; std::cout<<x/y<<std::endl; return 0; } i can compile file command line cl/ehsc sample.cpp what want display output(s) of program inputs given command line.how can this? x should it's value first command line argument, y should it's value second command line argument. following should work want avoid fiddling visual studio properties etc. piping input c++ program debug in visual studio edit: further clarification want use automated system receives input command line , not want modify original code the accepted answer of "piping input" question linked applies question well. don't have fiddle visual studio properties if use command ...

python - Please tell this newbie what the difference is between these two list outputs? -

i struggling , have tracked down difference between 2 lists inside code: python debugger: (pdb) values ['thing1', 'thing2', 'thing3'] (pdb) values2 [['thing1', 'thing2', 'thing3']] i do not want double brackets, mean , how rid of them? 'values' creation by: values = ['thing1','thing2','thing3'] 'values2' creation by: for report in report.objects.filter(id=id): values2.append([str(report.name), str(report.subject), str(report.description)]) why getting difference , how can values2 values ? don't think of "double brackets". think of 2 sets of single brackets, 1 inside other. set of brackets means have list. 2 sets of single brackets means have 2 lists. 1 set of single brackets inside means have list inside list. this because value appended list, because did values2.append([...]) . [...] list, appended list; is, put nested list inside values2 . ...

triggers - table adds the updates sql server -

i have table tab , , want create table history insert updates made in tab table . i've created trigger tr_update , doens't work correctly. create table tab ( id_tab char(5), data_tab int ) create table history (id_modify char(3), old_data int, new_data int, ) create trigger tr_update on tab after update declare @id char(3) declare @old int declare @new int select @id=id_tab, @new=data_tab inserted select @old=data_tab deleted insert history (id_modify,old_data,new_data) values (@id,@old,@new) triggers works sets of data, meaning sets inserted and deleted can contain more 1 row , simple assignments won't work. instead can use inserted and deleted as source tables (and join them if want both new , old data, in case). create trigger tr_update on tab after update insert history (id_modify,old_data,new_data) select i.id_tab, d.data_tab, i.data_tab inserted inner join deleted d on i.id_tab = d.id_tab on side note, seems ...

How to achieve Offline chat(Wifi chat) concept in android 2.2 and above? -

i'm new android. achieve "offline chat" concept in android(2.2 , above). know possible in android 4.0(and above) because wifidirect (wifi p2p) function available. how can achieve in android 2.2 without using wifi direct? possible chat in tethering network? if question connectivity between 2 devices, i'd think should able use bluetooth that. you'll find information how use bluetooth here: http://developer.android.com/guide/topics/connectivity/bluetooth.html most of api's used there have been added in api level 5, corresponds android 2.0 (eclair) , should sufficient needs.

subset data based on particular values in oracle -

i trying make copy of file particular columns appears twice. need both entries in separate file. attached below code written not able read list of id on needs subset create table duplicateclientid_avox select * nodup_avox_data_v1_nr client_id =(select client_id (select client_id, count(client_id) clientcount nodup_avox_data_v1_nr group client_id having count(client_id) > 1)); perhaps try using in() so: create table duplicateclientid_avox select * nodup_avox_data_v1_nr client_id in ( select client_id nodup_avox_data_v1_nr group client_id having count(client_id) > 1 );

python - Ipython and FreeBSD failed to compiled -

i'm trying install ipython on freebsd server (9.3) using ports. when launched make && make install clean @ end, have error message: i/o error : attempt load network entity http://docbook.sourceforge.net/release/docbook.xsl warning: failed load external entity " http://docbook.sourceforge.net/release/xocbook.xsl " compilation error: file /tmp/xmlto-xsl.nu8pkc line 4 element import xsl:import : unable load http://docbook.sourceforge.net/release/xsl/current/ma * [zmq_bind.3] error code 1 1 error * [all-recursive] error code 1 1 error ===> compilation failed unexpectedly. try set make_jobs_unsafe=yes , rebuild before reporting failure maintainer. * [do-build] error code 1 stop in /usr/ports/net/libzmq4. * [install] error code 1 stop in /usr/ports/net/libzmq4. * [lib-depends] error code 1 stop in /usr/ports/net/py-pyzmq. * [run-depends] error code 1 stop in /usr/ports/devel/ipython. * [stage] er...

How to open facebook app user-timeline page for a specific id from my android app? -

i trying open facebook app specific user profile. code opening facebook intent: try{ toast.maketext(getactivity().getapplicationcontext(), facebook_id, toast.length_short).show(); intent intent = new intent(intent.action_view, uri.parse("fb://profile/" + facebook_id)); startactivity(intent); }catch(exception e){ startactivity(new intent(intent.action_view, uri.parse("http://www.facebook.com/usernamepage"))); } this how received user_id: user.getid(); (the user graphuser object facebook sdk) correct way user id , use openning inetnt? because not worked me. if using graph api 2.x, user id have app-scoped user id, , there's no support getting user profile app-scoped id in facebook app.

Tree menus in JavaScript and css/html -

i'm using tree menu javascript. i'd category link in menu remain open after click link , load linked page. want improve code because when load page or refresh it, can see categories open , close , don't want see this. css menu: /*css del menu*/ div#nav{width:230px;background: #00005a;font: 14px arial, helvetica, sans-serif} div#nav h3{font-size: 100%;margin: 0;padding: 4px 10px; border-top: 1px solid #fff;color: #000;background-color: #7ba5e7} div#nav ul,div#nav li{margin: 0;padding: 0;list-style-type: none} div#nav a{display: block;padding-left: 15px;height: 18px;line-height: 18px; border-top: 1px solid #fff;background-color: #bdbdbd;color: #000; text-decoration: none;font-weight: bold} div#nav a:hover{color: #00005a;background-color: #0099ff} div#nav ul ul a{color: #333; background-color: #aecdff;font-weight: normal} css javascript div.jsenable h3{cursor: pointer} div.jsenable ul ul{display:none} div#nav li.hide ul{display:none} div#nav li.show u...

json - print and echo commands from php - view when activated remotly for debugging purposes -

i have app use android json php , mysql setup. question is: in php file have various print , echo commands see output in order see going on. the php file in web , server debian 7 how go debugging php , check json statements? what or of recommended ways. excuse me no code example edit later when ill infront of more capable device. solved running php server php command. gives more detailed , accurate error messages php fileuwanttocheck.php

python - Django Update Form? -

i have form users enter in information on locations. i'm trying make update form users can click update button on location , update form comes populated data thats there location. have followed django docs getting blank screen. unsure how reference location update. here have far. models.py class location(models.model): # details on location views.py def locations(request): return render_to_response('locations/locations.html', {'locations': location.objects.all() }) def location(request, location_id=1): return render_to_response('locations/location.html', {'location': location.objects.get(id=location_id) }) def create(request): if request.post: form = locationform(request.post, request.files) if form.is_valid(): form.save() return httpresponseredirect('/accounts/loggedin/locations/all/') else: form = locationform()...

asp.net mvc 4 - Cookies not clearing after closing browser in Mac OS -

my web application build in mvc4 clearing cookies when opening in chorme in windows. same application not clearing cookies when run in mac os. ie working fine expected in chrome not clearing. can please tell me how happening? under mac os have no permission clear or delete cookie. can reset cookie null values. way kill cookie on user interaction.

c# - Timer is triggering event on another instance of my Form -

i have multiple instances of same dialog. pass in enum dialog knows information display. have timers within form trigger actions (in case button click example). however, when these timers trigger, caught 1 (and last form created) , not other forms. form triggered timer catch it. missing? public partial class form1 : form { public enum animal { cat, dog, pig }; public form1() { initializecomponent(); form2 f21 = new form2(animal.cat); f21.show(); form2 f22 = new form2(animal.dog); f22.show(); form2 f23 = new form2(animal.pig); f23.show(); } public partial class form2 : form { int buttoncount = 0; form1.animal animal; private static system.threading.timer refreshlistviewtimer; public form2(form1.animal theanimal) { initializecomponent(); animal = theanimal; text = theanimal.tostring(); refreshlistviewtimer = new system.threading.timer(onrefreshlistti...

c++ - QT 5.3 Location of Configure Command -

i trying compile qt statically. unable run configure command following. 'configure' not recognized internal or external program. i assume because looking in wrong location it. have tried using windows command prompt , 1 included qt. i've tried following instructions in post no luck. where can found qt 5.3.0 command prompt in command prompt, need cd location configure.exe executable is. should able search in search bar of root qt directory. build, located under c:\qt\qt-5.3.1-x64-msvc2010-opengl\qt-everywhere-opensource-src-5.3.1\qtbase\configure.exe

sql - MySQL dynamic transpose/pivot of a table -

i've been trying pivot sample table: type | count ___________________ 'chains' | '38' 'indep' | '64' 'super' | '25' yup, it's simple. i've been reading tutorials, stackoverflow answers , i've been looking tutorial transposing table. can't understand , haven't been able accomplish following result: chains | indep | super _______________________ 38 | 64 | 25 i know there other questions similar one, can't point reading. examples use multiple tables explain or have code no explanmation, , can't undestrand what's needed this. can please explain me in detail how can accomplish pivoted table?? thanks lot!! edit 1: with tutorials i've read, i've manage following: chains | indep | super _______________________ 38 | null | null null | 64 | null null | null | 25 i'd data in single row without null. know there tutorials , answers don't under...

ios - How to fetch squared thumbnails from PHImageManager? -

has idea how fetch squared thumbs phimagemanager? phimagecontentmodeaspectfill option has no effect. [[phimagemanager defaultmanager] requestimageforasset:(phasset *)_asset targetsize:cgsizemake(80, 80) contentmode:phimagecontentmodeaspectfill options:nil resulthandler:^(uiimage *result, nsdictionary *info) { // sadly result not squared image imageview.image = result; }]; update: the bug in cropping images retrieved phimagemanager fixed in ios 8.3, version of ios , later, original example works, follows: seems bugs still there , including ios 8.4, can reproduce them standard iphone 6s camera images, taking full size square crop. fixed in ios 9.0, large crops of 63 megapixel panorama work fine. the approach apple defines pass cgrect in co-ordinate space of image, origin (0,0) , maximum (1,1). pass rect in phimagerequestoptions object, along resizemode of phimagerequestoptionsresizemodeexact , , should cropp...