Posts

Showing posts from March, 2013

c - strcpy Seg Fault -

according ddd i'm getting seg fault strcpy can't quite figure out i'm doing wrong (still quite new c). appreciated, in advance. int compare_people(person* first, person* second) { char firstname[32]; char secondname[32]; strcpy(firstname, first->name); strcpy(secondname, second->name); int returnval = strcmp(firstname, secondname); return returnval; } it seems either first or second equal null or first->name or second->name equal null or has non-zero terminated data due using strcpy exceeds 32 characters. other reason can first->name or second->name has invalid pointer example pointer local data destroyed. insert check in function. example assert( first != null && second != null && first->name != null && second->name != null && strlen( first->name ) < 32 && strlen( second->name ) < 32 ); or can split assert in several separate asserts

javascript - Strange object member behaviour with node.js -

currently i'm trying set properties of object using square bracket notation. code follows var obj = {}; obj['c9c4d17a698ace65c80416112da3ff66e652ec013222f5b458a1dd4950580e77'] = 'one'; obj['8d207abeb95e36abfa2cdae6ac700e776c982ec64bcbfd501cb48fec55a13a77'] = 'two'; if console.log(obj) or console.dir(obj) result is { c9c4d17a698ace65c80416112da3ff66e652ec013222f5b458a1dd4950580e77: 'one', '8d207abeb95e36abfa2cdae6ac700e776c982ec64bcbfd501cb48fec55a13a77': 'two' } what want know why 1 property key set unquoted literal , other set string. both being set in same way. falling victim escape sequence within key? node --version v0.10.33 on os x yosemite 10.10.1 any time object key starts number, appear quoted when inspected in console. this doesn't affect internal representation. these keys strings, as-assigned. it's when inspect them, they'll quoted if need (such when contain reserved charac

python - Trouble with "IF @@TRANCOUNT > 0 COMMIT TRAN" -

Image
i'm building flask application sqlalchemy query , sql server database storage. noticed in sql server activity monitor there lot of open sessions this: i did search , not able find reason. wonder if know what's causing issue? note: background, requests managed directly under flask context seem ok(so clicking around on website , running query not cause this). happens when run backend celery task. is possible caused code structure? this how defined session connection(use scoped_session): engine = create_engine('connection string here') db_session = scoped_session(sessionmaker(autocommit=false, autoflush=false, bind=engine)) base = declarative_base() base.query = db_session.query_property() any appreciated, thanks! i think happening in application , have written code .... begin transaction -- code here if @@trancount > 0 begin commit transaction; end but if code after have opened transaction has not affected rows? you have not

java - Bug in Path's .relativize() documentation or am I doing something blatantly wrong here? -

ok well, here fun. note "elements" here instance of pathelements , , these .resolve() , .relativize() fully tested , known work ... links relevant method implementations path.resolve() , path.relativize() extract of test method fails: /* * test part of path's .relativize() method: * * <p> 2 {@link #normalize normalized} paths <i>p</i> , * <i>q</i>, <i>q</i> not have root component, * <blockquote> * <i>p</i><tt>.relativize(</tt><i>p</i><tt>.resolve(</tt><i>q</i><tt>)) * .equals(</tt><i>q</i><tt>)</tt> * </blockquote> * * unfortunately, turns out not true! whether p absolute or * relative, indeed case path elements (root, names) * same filesystem differs. * * path's .equals() requires 2 filesystems equal in * order 2 paths equals, contract can not obeyed; or * doing wrong. */ @test(enabled = fal

c# - WebClient GET/POST without blocking UI -

i make non blocking , post requests. i've managed solve backgroundworker , need achieve using tasks. public task<string> post(uri uri, string data) { return _webclient.uploadstringtaskasync(uri, data); } public task<string> get(uri uri) { return _webclient.downloadstringtaskasync(uri); } i need requests run sequentially. what's proper way implement this? flag methods async , await them? wait each task using task.waitall() ? an example of i'm after: task<string> logintask = post("login", data); // wait webrequest complete , make use of response string // use data first request in new request: task<string> someotherrequest = get("details"); you can use await task.run() : await task.run(()=> { run_ui_blocking_function(); }); for example: in post() function, can add this: await task.run(()=> { poststring = post(new uri("url"), "data"); }); and in 'get()' fu

node.js - Get the id of a saved object using Sails -

if save object that: pet.create({name:'pinkie pie',color:'pink'}).exec(); how can retrieve id of saved object without perform query? i solved passing anonymous function callback: pet.create({name:'pinkie pie',color:'pink'}).exec(function createcb(err,pet) { console.log(pet.id); }

angularjs - adding values from firebase -

{ "-jc6dpvcnncafhnkxauu" : { "amount" : 2, "body" : "dsfsdvsd", "from" : "angular" }, "-jc6fwfxkenc0amyzss_" : { "amount" : 2, "body" : "massage", "from" : "angular" } } this example of data i'm trying parse through i trying grab items , add "amount" values. example want total 4. want in angularjs i'm not sure how reference objects , add "amount" values. one way (with firebase's web/javascript api): var ref = new firebase('https://your.firebaseio.com/'); ref.on('value', function(snapshot) { var total = 0; snapshot.foreach(function(childsnapshot) { total += childsnapshot.val().amount; }); console.log(total); }); doing in angular not make different. unless share of your code/markup, hard see problem is. hint : if having pro

XPages onclick event not submitting on NEW document -

i have xpage upon exists checkbox group control. have code defined onclick event submit value of checkbox managed bean on server, , trigger partial refresh of element. this works fine when editing existing document. however, when working new document, submit never fires. here code: <xp:checkboxgroup id="cztypes1" value="#{document1.cztypes}" required="true" layout="pagedirection"> <xp:this.validators> <xp:validaterequired message="you must select @ least 1 employee type" /> </xp:this.validators> <xp:selectitem itemlabel="office" itemvalue="o" /> <xp:selectitem itemlabel="non-office" itemvalue="n" /> <xp:selectitem itemlabel="sub contractors" itemvalue="s" /> <xp:eventhandler event="onclick" submit=

android - Synchronous image loading on a background thread with Picasso - without .get() -

i have custom viewgroup (that contains picasso-loaded images) can reused in 2 places: displayed user in application (on ui thread) drawn canvas , saved .jpeg (on background thread) my code drawing canvas looks this: int measurespec = view.measurespec.makemeasurespec(width, view.measurespec.exactly); view.measure(measurespec, measurespec); bitmap bitmap = bitmap.createbitmap(view.getmeasuredwidth(), view.getmeasuredheight(), bitmap.config.argb_8888); canvas canvas = new canvas(bitmap); view.layout(0, 0, view.getmeasuredwidth(), view.getmeasuredheight()); view.draw(canvas); the problem there no time image load before draw view canvas. i'm trying avoid coupling as possible here i'd prefer not add picasso callback because class that's doing drawing doesn't know view it's drawing. i'm working around issue changing image loading code .get() rather .load() , using imageview.setimagebitmap() . unfortunately, adds ton

java - What's wrong with For Loop? -

package mygradeloops; import java.io.ioexception; public class mygradeloops { public static void main(string[] args) throws ioexception { char x = 'a'; (x='0';x<'9';x++){ system.out.println("please enter in 1 of grades."); system.in.read(); system.out.println("keep going!"); } } } this code keeps double printing after first "grade". know why double prints? have done "for loop" wrong? it's "double printing" because when enter character pressing return, you're writing 2 characters: character typed, , \n (newline character). add second system.in.read(); call read newline character: for (x='0';x<'9';x++){ system.out.println("please enter in 1 of grades."); system.in.read(); // character system.in.read(); // newline system.out.println("keep going!"); } also,

openssl - package ssl cert, private key, and intermediate certs into single pfx? -

i have kit of files: 1.crt: certificate 2.key: private key 3.crt: intermediate cert auth (from godaddy) 4.crt: root cert or intermediate cert (from godaddy) n.crt: others godaddy how package of these single pfx web server app? (this needs portable , in 1 file, deploy purposes) thanks! make chain.pem file appending pem formated 1.crt, 3.crt , 4.crt. then run command openssl pkcs12 -export -inkey 2.key -in chain.pem -name some_name -out final_result.p12 you asked define encryption password archive (it mandatory able import file in iis). may asked private key password if there one! more info here , here

twiml - twilio: need to initiate a transcription of recorded calls after the call has ended -

i have small python program using api dials voicemail, records call, , transcribes results. the program checks @ set intervals, e.g., 1 hour, 3 hours, etc., , checks recorded twilio. i know recording less 25 seconds result of not having new voicemail messages, , not want transcribe recording unless longer 25 seconds. (this lower cost: checking 8 times without transcribing have minimum cost of $0.14/day if there no new message. if have transcribe everything, rises minimum of $0.54/day. i not see method initiate transcription recording after call has ended. possible? twilio presently not offer ability transcribe audio after call has ended. have considered using twiml <pause> tag wait 25 seconds before starting transcription recording? if call disconnects before 25 seconds, record tag not executed , no transcription made. example: <?xml version="1.0" encoding="utf-8" ?> <response> <play digits="wwwwww#ww1234ww

jquery - Passing data from jsp to javascript -

i have ajax call returns html, call $("#my-div").html(data) in javascript. however, using twbspagination requires setting element through javascript. the html element defined as <input type="hidden" name="totalpagecount" id="totalpagecount" value="${totalpagecount}"/> <ul id="pagination" class="pagination-sm"></ul> and javascript is: callingfunction() { data = doajaxcall().done(myfunction); } myfunction(data) { $('#pagination').twbspagination({ totalpages: $("#totalpagecount").val(), visiblepages: 5, onpageclick: function (event, page) { ... } }); $("#my-div").html(data); } even though have confirmed hidden field totalpagecount has right value, $("#totalpagecount").val() returns empty string. i'm guessing because it's looking element exists

c++ - Qt Read XML File -

Image
i trying read xml file in qt, generated using different method. here xml file: <?xml version="1.0" encoding="utf-8"?> <project> <editortheme>null</editortheme> <modules> <module> <name>module_renderer</name> <position>471,164</position> <size>200,100</size> <locked>true</locked> <visible>true</visible> </module> <module> <name>module_console</name> <position>200,229</position> <size>256,192</size> <locked>true</locked> <visible>false</visible> </module> <module> <name>module_resourcetoolkit</name> <position>1049,328</position> <size>200,100</size>

css - How to style a WordPress cusom field? (Wordpress User Front End Pro) -

i trying add custom css edit download link generated wordpress custom field. the plugin wp front end pro. here page looks now: http://i.imgur.com/twgpvsl.png here backend of form creator: http://i.imgur.com/ve1sukv.png thanks in advance!!!!! without actual @ back-end, hard tell how add custom css class download link. can style link other means. on page, can ul.wpuf_customs li>a{your style}

java - Read JSCON file with PHP -

i'm trying read json php array. json file using format not familiar , don't know how write php array read file. json file in question can found here: http://nhlwc.cdnak.neulion.com/fs1/nhl/league/teamroster/ana/iphone/clubroster.json the format giving me hard time because 1) starting time stamp array cannot read , 2) file separated between value position, means have closing statement ' }] ' before end of file - seems separated category my php array work more standard array : function myfunction(response) { var arr = json.parse(response); var i; var out = "<table>"; for(i = 0; < arr.length; i++) { out += "<tr><td>" + arr[i].position + "</td><td>" + arr[i].weight + "</td><td>" + arr[i].height + "</td></tr>"; } out += "</table>" document.getelementbyid("id0

windows - Daily upload of file automation using batch script and WinSCP -

so have file generate weekly server using crontab in linux side , transfer pc. however, having problem when try send file generate different server on windows side using task scheduler. your command-line syntax wrong. i'm assuming \ftpbinverlog_%yyyy%-%mm%-%dd%.txt file, want download. it won't work, if specify on command-line did. also neither windows scheduler, nor command-interpreter, nor winscp understand syntax %yyyy% . the path remote file not either. *nix systems use forward slashes, not backslashes. so keep /script , /log arguments: /script=c:\batchrun\binver\script.tmp /log="c:\bin verification\ftplog" and make sure script.tmp looks like: open sftp://user@example.com /ftpbinverlog_%timestamp#yyyy-mm-dd%.txt c:\target_path\ exit references: guide automating file transfer sftp server %timestamp syntax .

gradle - When are two artifacts considered equal? -

are 2 artifacts considered same dependency resolution if have 2 different values respective groups? example, com .example: artifact and org .example: artifact resolve same version of artifact on classpath (where gradle default choose latest)? or 2 copies of artifact (because gradle considers artifacts different , puts both on classpath)? gradle considers dependencies unique if have matching group, name , version. in example, 2 dependencies not considered same since have different groups, , therefore duplicated. if know in advance such duplication exists, can declare module replacement . dependencies { modules { module("com.example:artifact") { replacedby("org.example:artifact") } } }

c++ - Qt QMainWindow Control Dropshadow and its Color -

Image
i wondering, there way @ control drop-shadow effect around active qmainwindow? here picture: i able control color of shadow, , possibly change size of it, too. there way this? adding css tag because i'm pretty sure might require using skinning system.

html - Internet Explorer 9 Not Displaying Text Properly -

i working on website , doing testing in ie9. i have slideshow section. (correctly displayed): http://i.stack.imgur.com/dbcp5.jpg , others this: http://i.stack.imgur.com/wxemu.jpg the button cut off , last name quote doesn't display. have narrowed down issue due amount of words used in h2. in other browsers such chrome somehow makes words fit , keeps same font-size. how make work in ie9? this may due varying default user agent stylesheets. using css reset, normalize.css , may achieve consistency, else being equal. you may want use old 1.1.3 branch of normalize because require ie7 support. note ie7 usage basically nil , recommend dropping support it.

javascript - Why <a> tag replaces spaces with %2520? how to solve the issue? -

in case, suppose explaining problem scenario best way explain it. i have search box in page called a.html , parameters passed page should replaced value of search box. problem that, when pass parameters spaces replaced %2520 therefore wrong value added search box. need solve it. <a href="www.example.com/a.html?value=here , there">link</a> following address put address bar: www.example.com/a.html?value=here%2520and%2520there this value replaced value of search box: here%2520and%2520there . need have value "here , there" in search box. (without %2520 ) what seems have happened here url double encoded (see below); while can't explain why happens, may because url not url encoded: <a href="www.example.com/a.html?value=here , there">link</a> it should be: <a href="www.example.com/a.html?value=here+and+there">link</a> or: <a href="www.example.com/a.html?value=here%20and%20

asp.net mvc 4 - Code generator tools for creating UOW and Repository classes for Entity Framework 4? -

i using visual studio 2010 mvc 4 installed along entity framework 4. there development tools generate repository , uow classes ef4? there ef4 dbcontext generator, did not see else dated ef4. there nuget package created: https://www.nuget.org/packages/repositorygenerator/ this targeted ef6 should give starting point, it's lot easier change few statements ef4 compatibility create 1 scratch. i'm working on supporting ef4 in future.

asp.net mvc - Type 'ASP._Page_Views__ViewStart_cshtml' does not inherit from 'System.Web.WebPages.StartPage' -

after publishing app remote host, start getting error message. locally works fine , it's been working fine on remote server before. it's update made. suggestion? similar posts suggested having viewstart on view folder. it's been there , never moved there. i figured out. publishing issue , maybe missing file or that. published same project again , worked

sql server - Column specified multiple times in dynamic pivot table -

i have following table records in it. example : table : ffortest create table ffortest ( col1 int, col2 int ) insertion of records : insert ffortest values(1,2); insert ffortest values(3,4); insert ffortest values(5,6); insert ffortest values(7,8); insert ffortest values(9,2); insert ffortest values(1,2); pivot table query : declare @stuffcolumn varchar(max) declare @sql varchar(max) select @stuffcolumn = stuff((select ','+quotename(col1) ffortest xml path(''), type ).value('.', 'nvarchar(max)') ,1,1,'') print(@stuffcolumn) set @sql = ' select col2,'+ @stuffcolumn +' ( select col1,col2 ffortest )x pivot ( count(col1) col1 in( '+@stuffcolumn +') )p' print(@sql) exec(@sql) error : column '1' specified multiple time in p. expected res

excel - vba changing $c$3 to $d$3 -

can me? actually looking vba script in excel: i want change cell location $c$3 $d$3 in each iteration i trying use chr method not working. dashboard sheet name activechart.seriescollection(2).name = "=dashboard!$c$8" 'changes,in next iteration should change $d$8 , on till j activechart.seriescollection(2).values = "=dashboard!$c$9:$c$22" 'changes,in next iteration should change $d$9:$d$22 , on till j dim integer dim j integer dim k integer dim t integer dim associatedchar t = 67 = 1 2 j = 1 8 k = 1 8 if (check(i, j, k) = true) activesheet.chartobjects("chart 1").activate activechart.chartarea.select activechart.seriescollection(1).name = "=dashboard!$c$8" activechart.seriescollection(1).values = "=dashboard!$c$9:$c$22" associatedchar = chr(67) 'this trying use associate valu

javascript - radio buttons and passing values -

if(document.getelementbyid('3w').checked) { alert('3w'); }else if(document.getelementbyid('6w').checked) { alert('6w'); } <input type="radio" name="pnltype" id="3w" value="3w" /> 3w <input type="radio" name="pnltype" id="6w" value="6w" checked /> 6w my problem: run in firefox. example, if tick 3w , choose "reload", alert '3w' not in chrome. in chrome although check 3w, , manually "reload" page, 'the alert '6w'. reason? in previous versions used onclick option in radio buttons , function: function radioclick() { window.location.reload(); } , again - in firefox behave expected, not in chrome thanks help. remove checked attribute in second input. i feel using jquery easy kind of things. give try http://code.jquery.com/jquery-1.11.1.min.js <input type="radio

yocto - Connection refused error while cloning from Git -

i have seen many posts related error on stack overflow other forums unfortunately not solution. executing following command on ubuntu 14.04 machine git clone git://git.yoctoproject.org/poky yoctoproject and getting error. cloning 'yoctoproject'... fatal: unable connect git.yoctoproject.org: git.yoctoproject.org[0: 140.211.169.56]: errno=connection refused replacing git:// https:// not resolve issue. can suggest different ??

laravel - phpmyadmin user interface repeating all clickable links -

pretty click-able links in interface repeated twice. life of me can't understand why or how fix it. else working fine. appreciated! running digitalocean ubuntu 14.04 nginx w/ laravel 4 http://i.stack.imgur.com/ddbhw.jpg side note: on top of installation had edit sites-available/default file inserting manually phpmyadmin location give priority in order bypass laravel wanting override. addition made >> location ^~ /phpmyadmin { try_files $uri =404; root /usr/share/; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param script_filename $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } [solution] i did not have proper code in nginx config file wasn't pulling proper file extentions pma dependencies. able running normal adding following code nginx config file. note* fastcgi_pass along other variables may differ depending on server. location ^~/phpmyadmin { root /usr/share/;

javascript - Getting error in VS2008 No source code available for the current location -

i using vs2008. have asp button trying call javascript function on "onclientclick" event , .cs code in "onclick event". when run project gets build successfully, throws error "no source code available current location". i noticed when remove javascript code, project works properly. please suggest.

swing - KeyEvent working with Java 1.7 but not with 1.6 -

we have developed plugin project developed on java 1.7(in eclipse) , build on java 1.6(build tool on java 1.6, upgraded java 1.7 soon). we using key listener in our code running fine when core application running on java 1.7 not when core application running on java 1.6(current production environment running on java 1.6 further migrated java 1.7). any idea, can issue? txtinput.addkeylistener(new keyadapter() { @override public void keypressed(keyevent e) { setadjusting(cbinput, true); keyevent = false; if (e.getkeycode() == keyevent.vk_enter || e.getkeycode() == keyevent.vk_up || e.getkeycode() == keyevent.vk_down ) { selectionallowed = true; e.setsource(cbinput); cbinput.dispatchevent(e); keyevent = true; if (e.getkeycode() == keyevent.vk_down || e.getkeycode() == keyevent.vk_up ) {

Creating a view (cakePHP noob) -

i've been reading until eyes swollen, , having troubles finding should simple answer. i not new php, new cakephp. please bear me, , have patience ignorance of lack of knowledge of terminology. i have been asked make fixes on cakephp developed site, created. the site missing page " http://domain.com/logout ". can see functions need access in usercontroller, not sure put .ctp file generate view. let's want logout.ctl file simple as: echo "hello world"; under app/view folder have sub-folders home, & user have tried place file into. assuming have else well, have not been able locate is. any assistance appreciated. reading! 1.by default, should link view , controller creating views/controller/action.ctp . since url linked controller routes, views not associated directly. for example, if have set router::connect('/logout/', array('controller' => 'user', 'action' => 'logout'

java - Unable to get data from Elasticsearch -

i'am working on couchbase , elasticsearch spring data . have replication started couchbase elasticsearch. can save data in couchbase using spring data, data saved , gets replicated elasticsearch. while trying read elasticsearch shows null, id values show in result. when save directly in elasticsearch it's possible read correctly. guess it's because of structural change data. how can solve this? data in elasticsearch after replication: { "_index": "streams", "_type": "couchbasedocument", "_id": "e8c7999c-67c8-47a4-b235-726d89102f83", "_score": 1, "_source": { "meta": { "id": "e8c7999c-67c8-47a4-b235-726d89102f83", "rev": "3-000007c43e1293830000000000000000", "expiration": 0, "flags": 0 }, "doc": { "createdon": "20141201183646786",

html - Horizontally align UL items within parent div with no space on either side? -

i'm making navigation menu , have run common problem of needing horizontally align ul equal spacing around each list item. however, list inside of div set width of 1100px , need there no space on left or right-hand sides of div -- first , last list items need reach side of div. here's unordered list have right now: ul{ width:100%; display:table; list-style-type:none; padding:0; border-spacing:5px; li{ display:table-cell; padding:0 30px; } } and said, unordered list inside of div has width set 1100px. should make list stretch full width of div? 1) set text-align:justify on container 2) use pseudo element stretch list items 100% of width of list fiddle ul { width: 800px; text-align: justify; list-style-type: none; padding: 0; background: yellow; } ul:after { content: ''; display: inline-block; w

github - How do I switch a git(hub) repository to point one level up? -

i have project called foo . on machine, project resides subfolder of non-git folder called foo_container (i.e, in foo_container/foo ). foo git folder, , have synced github, , made several changes. later, added more content in other folders under foo_container (like foo_container\foo_docs ), , want check in foo_container repo on. not want lose git history foo , , of course, ok changes of foo_container being recorded on. what cleanest way this? here couple of options considered: option #1: cd /path/to/foo_container git init <rename repository on github foo foo_container> <some git-remote command - don't know should switch existing repo> option #2 (may work, suspect lose git history of foo directory) delete old foo repo on github, create new repo called foo_container , git init in foo_container , git-remote add origin <...foo_container.git> i not sure if either of these approaches work, , better do. the first approach good, can declar

Scheduling jobs in Quartz as a process -

is jobs in quartz executed process or thread? if executed thread effect performance of quartz scheduler when heavy jobs or time consuming jobs executed. if please suggest solution. if execute 10 time consuming jobs simultaneously effect? i read tutorials didnt find solution. please suggest solution. thanks. read documentation regarding configuring thread pool explains how quartz thread pool can suited needs. more org.quartz.threadpool.threadcount configuration property can set according needs documentation explains: the number of threads available concurrent execution of jobs. can specify positive integer, although numbers between 1 , 100 practical. if have few jobs fire few times day, 1 thread plenty. if have tens of thousands of jobs, many firing every minute, want thread count more 50 or 100 (this highly depends on nature of work jobs perform, , systems resources). in specific example mentioned regarding 10 jobs firing simultaneously, if

css - Centering main wrapper with dynamic width -

i have searched , searched. fiddled , tweaked. spent hours trying different suggestions , code ideas... how can have content on webpage, centered horizontally regards browsers view port. no matter do, end uneven margins , quite noticeable. the closest far is: #mystylename { margin: 0 auto; width: 90%; } however, because using percentage, no matter margins/alignment defaults being on left edge of page. extra info: issue relates top-level, outer page element. first or holds content of else. i not sure asking, here example of af centered <div> percentage with. i added border-sizing: border-box enables use padding. #mystylename { margin: 0 auto; width: 90%; display:block; background:red; /* testing */ box-sizing:border-box; padding: 10px; } <div id="mystylename"> hi! </div>

c# - Process.Start leaves streams empty -

i have code run console command/utility, monitor live output using 'debug.writeline' , write final output log file when needed. edit: not work praatcon.exe analysis command line utility. can downloaded from here . invoke praatcon.exe without argument, should write on 'stdout' usage. code wont catch it. the issue is, works utilities , can see debug output log in file. utilities, see empty commands, though when run commands through cmd window, see output. capturing both streams output , error. can me ? full code can found here here how trying it initialization of processstartinfo var info = new processstartinfo(command, parameters) { workingdirectory = workingdirectory, useshellexecute = false, redirectstandardoutput = true, redirectstandarderror = true, createnowindow = true }; running process , initializing string builders output , error streams. var proces

Error while making requests to Quickbooks-Online -

we unable make requests quickbooks online. while trying communicate quickbooks api keep on getting general io error while proxying request; errorcode=006003 some sample requests: https://quickbooks.api.intuit.com/v3/company/386413351/query?query=select+*+from+companyinfo&requestid=1a91078d661245dc809f31870c4ccdb9&minorversion=1& https://quickbooks.api.intuit.com/v3/company/1280984235/query?query=select+count%28*%29+from+item&requestid=a4569163846943379801926b21c21e81&minorversion=1& all of them ending in same error message. helpful, if has clue this. {"fault":{"error":[{"message":"message=general io error while proxying request; errorcode=006003;statuscode=500","code":"6003"}],"type":"service"},"requestid":"e803880ca8d1448a9e2d87d194b08541","time":"2014-12-02t07:12:42.955z"}

android - Not able to access getPreferences method -

i not able access getpreferences method of sharedpreferences interface in method.i used getpreferences method in method logintofacebook gives me error private_mode how can solve problem. this edited code. public class facebookutils { private static final dialoglistener default_auth_activity_code = null; private static string app_id = "783826255024540"; public facebook facebook = new facebook(app_id); private asyncfacebookrunner masyncrunner; string filename = "androidsso_data"; private sharedpreferences mprefs; button btnfblogin; button btnfbgetprofile; context mcontext; public facebookutils() { // todo auto-generated constructor stub } public void authorize(activity activity, string[] permissions, final dialoglistener listener) { authorize(activity, permissions, default_auth_activity_code); } public facebookutils(context context) { } @suppresswarnings("unused") public void logintofacebook() { sharedpreferences sha

cordova - Yeoman + EmberJS + Phonegap -

i'm developing app using yeoman + emberjs. i'm decided deploy on ios , android using phonegap. so how wrap 'prebuilt' yeoman + ember project in phonegap? i tried using phonegap build according document , there requirement in building structure. android.apk i've downloaded won't work. and theres no yeoman generator 3 combos. i'm sure isn't best method @ least it's working. i manually copy 'compiled-templates.js' , 'combined-scripts.js' generated grunt , copy dependencies newly created phonegap project. include files in index.html, , use "phonegap build ios" in terminal generate xcode file , deploy ios platform through xcode. ps: compiled-templates.js contain ember.js templates. combined-scripts.js contain javascripts.

ASP.Net C# and JavaScript textfield expiration date -

i looking textbox user can enter expiration date his/her license. user can enter expiration date between today's date , 12/31/2099. this have now: function rangevalidation(dt) { var startrange = new date(date.parse("12/02/1900")); var endrange = new date(date.parse("12/31/2099")); var lblmesg = document.getelementbyid("<%=lblmesg.clientid%>") ; if (dt<startrange || dt>endrange) { lblmesg.style.color="red"; lblmesg.innerhtml = "date should between 12/01/2014 , 12/31/2099"; } } <asp:textbox id="txtrange" runat="server" maxlength = "10" onkeyup = "validatedate(this, event.keycode)" onkeydown = "return dateformat(this, event.keycode)"></asp:textbox> is there easier way that? running date issues, exampele dd/mm/yyyy , on, simple in

apache - Implementing nonlinear optimization with nonlinear inequality constraints with java -

how implement nonlinear optimization nonlinear constraints in java? using org.apache.commons.math3.optim.nonlinear.scalar.noderiv, , have read none of optimizers (such 1 working with, simplexoptimizer) take constraints default, instead 1 must map constrained parameters unconstrained ones implementing multivariatefunctionpenaltyadapter or multivariatefunctionmappingadapter classes. however, far can tell, using these wrappers, 1 can still implement linear or "simple" constraints. wondering if there way include nonlinear inequality constraints? for example, suppose objective function function of 3 parameters: a,b,and c (depending on them non-linearly) , additionally these parameters subject constraint ab any advice solve problem using apache commons great, suggestions extending existing classes or augmenting package welcome of course. my best attempt far @ implementing cobyla package given below: public static double[] optimize(double[][] contractdatamatrix,double

sql - Change dynamically color line chart -

Image
i have report reportingservices, have linechart. 1 series of chart have write expression color column of dataset. =iif((sum(fields!productionactual.value, "chartdataset")-sum(fields!productionplanned.value, "chartdataset"))>0,"lightgreen","red") but see 1 color "red". this query use create chart declare @temporarytable table ( workcenter nvarchar(100), time numeric, min datetime, max datetime, stopinminutes numeric, workingtime numeric ) -- po start , end time , linkupid declare @data_start datetime declare @data_end datetime declare @machine nvarchar(100) declare @date datetime declare @dateend datetime set @date = '2014-11-24' set @dateend ='2014-11-26' declare @productionline nvarchar(100) set @productionline =

jsf 2 - Alternative to Deltaspike Multi-Window Handling in Seam 3 Applikation -

i have problems multi-window handling in appliacation. using conversation scope enable multi window / tab handling in case user opens link (button) in new tab conversation shared between old , new tab. apache deltaspike has solution ( http://deltaspike.apache.org/documentation/#_module_overview ) using seam 3 (and jsf 2.1) , don't want migrate deltaspike. so i'm searching alternative solution without deltaspike or possible use deltaspike , seam 3? i build solution p:remotecommand , answer: in javascript, how can uniquely identify 1 browser window under same cookiedbased sessionid i added js template creates unique id each browswer tab stores in window.name. calls p:remotecommand check guid: $(window).load(function() { // ---------------------- var guid = function() { // ------------------ var s4 = function() { return (math.floor(math.random() * 0x10000 /* 65536 */ ).tostring(16)); }; return (s

visual studio 2010 - SSRS Add Months in current date with last day of month -

i want add months last day in current date using =dateadd(dateinterval.month, +4, dateadd("d",-(day(today)), today)) expression. output is current_date = 12/02/2014 finish_date = 03/30/2014 the problem finsih_date month 03(march) , last day of march 31 parameter showing 30. it may like: =dateadd("d", -1, dateserial(datepart("yyyy", finish_date), datepart("m", dateadd("m", 1, finish_date)), 1)) for every day in given month calculates last day of given month. 03/30/2014 03/31/2014. calculation works like: build new date set first day of following month of given date. substract 1 day. last day of month before. added 1 month last day of month of given date. edit code finished_date = today + 4 month (finished_date + 1 today + 5) =dateadd("d", -1, dateserial(datepart("yyyy", dateadd("m", 5, today())), datepart("m", dateadd("m", 5, today())), 1))

visual c++ - When will _ATL_ALLOW_UNSIGNED_CHAR work? -

i'm migrating visual c++ project uses atl/mfc vs2010 vs2013. project compiles /j ("assume char unsigned"), , there code may or may not rely on fact remove compiler flag. under vs2013, /j causes compiler error in atldef.h: atl doesn't support compilation /j or _char_unsigned flag enabled . can suppressed defining _atl_allow_unsigned_char . microsoft mention in msdn documentation /j , along vague statement: "if use compiler option atl/mfc, error might generated. although disable error defining _atl_allow_char_unsigned, workaround not supported , may not work." does know under circumstances safe or unsafe use _atl_allow_char_unsigned ? microsoft struggles keep ancient codebases, atl, compatible changes in compiler. principal trouble-maker here atlgethexvalue() function. had design mistake: the numeric value of input character interpreted hexadecimal digit. example, input of '0' returns value of 0 , input of 'a' return

vba - Dreaded "Excel found unreadable content in..." message after adding custom icons -

i've been working on excel addin makes use of ribbon. fine until attempt add custom 16 x 16 icons. here in office, have excel 2007, is microsoft office excel 2007 (12.0.6683.5002) sp3 mso (12.0.6683.5000) my winzip is winzip 15.0 (9334) when open .xlam file zip file, have customui\_rels , customui\images subdirectories. contents of customui.xml.rels file is <?xml version="1.0" encoding="utf-8" standalone="yes"?> <relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"> <relationship id="nbinsert" type="http://schemas.openxmlformats.org/officedocument/2006/relationships/image" target="images/nbinsert.png" /> <relationship id="nbchange" type="http://schemas.openxmlformats.org/officedocument/2006/relationships/image" target="images/nbchange.png" /> <relationship id="nbdelete" type="http://schemas.openx

Upload documents from Amazon s3 to CloudSearch using AWS Java SDK -

Image
how upload document amazon s3 cloud search using aws java sdk , make indexable well? i not found direct way within sdk index document s3 cloud search. use this.

Instagram API Angularjs Login without redirect -

i make form username/password in angularjs app. , when user fills form , submits want log him in instagram , receive instagram id, access_token etc. saw website in js way, , know how this. know? if instagram support resource owner password credentials oauth authorization type, accomplish that. or can refer oauth.io provides mature solution no-redirection oauth authorization.

Getting a complete object via $max in mongodb aggregation -

i have collection of objects need grouped masterid or id if masterid absent. of group of objects same masterid need find 1 highest pos attribute ( $max: "$pos" ). however, struggle complete object pos maximized, seems via aggregation can pos attribute, not whole object. here sample aggregation use, lacking $ifnull masterid : > db.tst.aggregate([{ "$group": { "_id": "$masterid", "pos": { "$max": "$pos" } } }]) sample objects be: > db.tst.find() { "_id" : objectid("547d6bd28e47d05a9a492e2e"), "masterid" : "master", "pos" : "453", "id" : "hallo" } { "_id" : objectid("547d6bda8e47d05a9a492e2f"), "masterid" : "master", "pos" : "147", "id" : "welt" } { "_id" : objectid("547d6be68e47d05a9a492e30"), "masterid" : &q

sagepay not working after moving site -

i new magento , sagepay. have tranfered customers site 1 server server. customer's can't process payments. on front end seeing message when select sage pay payment method an error occurred sage pay: 4020 : information received invalid ip address. i have added ip addresses @ sage page still not working. ip address need add. ip address of domain name? also when log in magento control panel if click on sage page dashboard see error message error occurred: valid value required. : teste : doing first time no idea if message on board normal or have done wrong. the site used work fine on previous server. have copied whole site new server , rest works fine. any suggestion/idea appreciated. thanks add domain's ip in valid ip's list under settings tabs in sage pay account

sql - How to add 'Hosts' as a seperate row despite information being displayed on same table as users -

in our db structure, have users. within table stated whether user host or not. through field 'ishost' (boolean). want run query shows users not hosts in 1 row (visitors) , row states name of host visit. i'll copy in select , parts of query out. select [user].firstname + [user].lastname 'visitors name', user.firstname + user.lastname 'host name', company.name 'company name', vut.autocheckouttime, vud.expectedtime 'expected time on site' [user] inner join visituser on [user].userid = visituser.userid inner join visit on visituser.visitid = visit.visitid inner join visitusertype vut on [user].defaultvisitusertypeid = vut.visitusertypeid , visituser.visitusertypeid = vut.visitusertypeid inner join visituserdate vud on visituser.visituserid = vud.visituserid left outer join company on [user].companyid = company.companyid s'okay, remembered how this. added ho

php - Destroying embeded objects when destroying the main object -

i'd destroy object , intern objects in it. why example below not working: <?php class { public $elt = 'hello world!!'; public function __destruct() { var_dump('i: destroyed'); } } class { public $val1=1; public $val2=2; public $val3=3; public $val4=4; public $i; public function __construct($i) { $this->i = $i; } public function __destruct() { var_dump('a destroyed'); unset($this->i); } } $i = new i(); $a = new a($i); unset($a); var_dump($i); output: string(11) "a destroyed" object(i)#1 (1) { ["elt"]=> string(13) "hello world!!" } string(12) "i: destroyed" how come didn't notice undefined variable: i ? , how come message of destructor of class displayed after var_dump of $i? update the thing have main object, object has purge/refresh nested objects @ end of each iteration of loop.

python - What is the proper way to deploy the same application/code to Elastic Beanstalk server and worker environments? -

so have web service (flask + mysql + celery) , i'm trying figure out proper way deploy on elastic beanstalk separate web server , worker environments/tiers. have working launching worker (using this answer ) on same instance web server, want have worker(s) running in separately auto-scaled environment. note celery tasks rely on main server code (e.g. making queries, etc) cannot separated. it's app 2 entry points. the way can think having code/config-script examine env variable (e.g. env_type = "worker" or "server") determine whether launch standard flask app, or celery worker. other caveat here have "eb deploy" code 2 separate environments (server , worker), when i'd like/expect them deployed simultaneously since both use same code base. apologies if has been asked before, i've looked around lot , couldn't find anything, find surprising since seems common use case. edit: found this answer, addresses concern deploying twice (