Posts

Showing posts from January, 2015

asp.net - Pass GridView column value to Javascript function - OnClientClick -

i have grid view this: <asp:sqldatasource id="sqlpersistentoffenders" runat="server"></asp:sqldatasource> <asp:gridview id="gvpersistentoffenders" runat="server" datasourceid="sqlpersistentoffenders" allowpaging="true" autogeneratecolumns="false"> <columns> <asp:templatefield headertext="personid" visible="false"> <itemtemplate> <asp:label id="labcreuser" runat="server" text='<%# bind("creuser")%>'></asp:label> </itemtemplate> </asp:templatefield> <asp:templatefield> <itemtemplate> <asp:button id="buttonsendemail" runat="server" commandname="sendemail" commandargument="<%# ctype(container,gridviewrow).rowindex %...

java - Draw text on Canvas with custom Height - Android -

Image
i'm drawing text on canvas code: @override protected void ondraw(canvas canvas) { super.ondraw(canvas); canvas.drawcolor(color.white); paint paint = new paint(); rect bounds = new rect(); paint.setcolor(color.black); paint.settextsize(50); paint.gettextbounds(first, 0, first.length(), bounds); canvas.drawtext(first, (canvas.getwidth() - bounds.width()) / 2, 50, paint); } here result: but want text have bigger height, want this: i don't want change font size, height of text. how can ? i found solution this: // closing hardware acceleration setlayertype(layer_type_software, paint); paint.gettextbounds(first, 0, first.length(), bounds); float posx = (canvas.getwidth() - bounds.width()) / 2; // center float posy = ((canvas.getheight() - bounds.height()) / 2); // center canvas.scale(1, 10, posx, posy); canvas.drawtext(first, posx, posy, paint);

python - Calculating all possible combinations using a list of random numbers and ALL simple math operators to reach a given target -

i writing simple python script generates 6 numbers @ random (from 1 100) , larger number (from 100 1000). goals script to: calculate of possible combinations using @ least 2 numbers , of simple math operations (adding, subtracting, multiplying , dividing) output of combinations total within 10 above or below larger number 'matches' the list of numbers need not exhausted, repeating numbers isn't accepted. plus don't care if code efficient or not (if decides post - can post mine far if needs - preferably post in python); long works, i'm happy optimize it. i have attempted myself, fail program ended runtime error. tried putting in counter stop loop after x passes (where x small number such 50), makes matters worse keeps on going infinitely. i've done research, , found ( computing target number numbers in set - second last answer) closest found meet requirements hasn't got quite there yet. thanks help! :-) edit: here code: import random, ti...

php - Add Web form input to an Array -

i cannot figure out how go keeping data saved on $myarray after hitting save. everytime that, replaces other input. i need able save user enters , save in text file. keep saving data on array , update file well. any suggestions? <!doctype> <html> <body> <form action="list.php" method="post"> name: <input type="text" name="name[]" /><br /> email: <input type="text" name="name[]" /><br /> <input type="submit" name="save" value="submit" /><br /> <?php $myarray = array(); if (isset($_post['save'])) { array_push($myarray,$_post['name']); } print_r($myarray); ?> </body> </html> every time user hits submit, there new request sent script. varia...

javascript - SVG Select color map -

i'm working in game in js. it's war game. if hover on country/select gives border , color want, if own country has own color. can see if select country , click on "selecteren" on left. select country other usa, brazil, russia, china, canada , india. had green border want country colered. http://w0w.eu html code of country: <g data-name="indonesia"> <path id="kalimantan" d="m781.68,324.4l-2.31,8.68l-12.53,4.23l-3.75-4.4l-1.82,0.5l3.4,13.12l5.09,0.57l6.79,2.57v2.57l3.11-0.57l4.53-6.27v-5.13l2.55-5.13l2.83,0.57l-3.4-7.13l-0.52-4.59l781.68,324.4l781.68,324.4z"/> <path id="sumatra" d="m722.48,317.57l-0.28,2.28l6.79,11.41h1.98l14.15,23.67l5.66,0.57l2.83-8.27l-4.53-2.85l-0.85-4.56l722.48,317.57l722.48,317.57z"/> <path id="java" d="m753.17,358.32l-2.75,1.88l0.59,1.58l8.75,1.98l4.42,0.79l1.87,1.98l5.01,0.4l2.36,1.98l2.16-0.5l1.97-1.78l-3.64-1.68l-3.14-2.67l-8.16-1.98l753.17,358.32l75...

swift - Objective-C Nullability: Qualifying Constant Strings -

i have gotten pretty habit of declaring , using constant strings things nsnotification names. declare them so: extern nsstring * const abcawesomethinghappenednotification; with introduction of xcode 6.3 , swift 1.2, i'm going , auditing objective-c classes interop swift using new nonnull , nullable , , null_unspecified qualifiers. when adding qualifiers header has externally visible static strings, receive following warning: warning: pointer missing nullability type specifier (__nonnull or __nullable) hmm. that's confusing / interesting. can explain reasoning behind message? when using abcawesomethinghappenednotification in swift, never suggests it's optional string or implicitly unwrapped string. in implementation, define: nsstring * const abcawesomethinghappenednotification = @"abcawesomethinghappenednotification"; in case pointer nonnull . however, valid: nsstring * const abcawesomethinghappenednotification = nil; which mus...

sql server - Multiple SQL or Case statements in Scalar function -

i struggling sql function report writing. function polls audit table original value of particular field (secondaryschoolcode). if finds value in audit table current row should return value, if there no value current row original parameter supplied function should returned instead. have tried using case statement not returning parameter if there no match in audit table. suggestions on how accomplish this? alter function [dbo].[fn_auditoriginalhsattendingcode] ( @studentid varchar(255), @secondaryschoolcode varchar(255), @columnname varchar(255) ) returns varchar(255) begin declare @result varchar(255); return (select top (1) case when @columnname <> 'secondaryschoolcode' @secondaryschoolcode else dbo.gdsauditdetail.valuebeforechange end dbo.gdsauditdetail inner join dbo.studentschool inner join dbo.student on dbo.studentschool.studentid = dbo.student.id inner join dbo.secondaryschool on dbo.studentschool.secondaryschoolid = dbo.secondaryschool.id in...

javascript - Using a variable inside document.getElementById -

i'd use php variable instead of #particles in below given code. i tried using: $(" . json_encode($paramnameid) . ").particleground({ but didn't work. $script = "<script type='text/javascript'> document.addeventlistener('domcontentloaded', function () { particleground(document.getelementbyid('#particles'), { dotcolor: " . json_encode($dotcolor) . ", linecolor: " . json_encode($linecolor) . " }); }, false); </script>"; how can this?

php - One option to display as dropdown and select in opencart -

i have option named color. of type choose > image. assigned many products each product containing different option values. there way can create exact copy of option , display different name. example: current option name color, want exact copy of option named second color. every product containing color should have second color. and once copy , assign there way can display both these options dropdown well? thanks

multithreading - Python Socket causes accept to be called too many times -

i trying write simple multithreaded web server in python. when new client socket connects server socket, create new thread handle client socket, so: (clientsock, (ip, port)) = self.sock.accept() newthread = clientthread(ip, port, clientsock) newthread.start() where clientthread class has run method, in turn calls following bit of code: data_string = '' bytes = self.socket.recv(2046) bytes_str = bytes.decode('utf-8') data_string += bytes_str where self.socket clientsock referenced above. this code works expected: 1 thread created when server socket accepts connection client socket, , receives client socket request. but if change above code in order loop while there more data, such as: data_string = '' bytes = self.socket.recv(2046) while len(bytes) > 0: bytes_str = bytes.decode('utf-8') data_string += bytes_str print 'data received: %s' % (bytes_str) bytes = self.soc...

PHP video playback -

i trying video play play database. have form following code: <form action="abs3xvideos.php" method="post" enctype="multipart/form-data"> <input type="file" name="id" /> <input type="submit" name="submit" value="upload!" /> <form action="abs3xvideos.php"> search abs3x: <input type="search" name="googlesearch"> <input type="submit"> </form> i have page form linked following code: <?php error_reporting(e_all); ini_set('display_errors', 1); define('db_name', 'gaufensr_abs3x'); define('db_user', 'gaufensr_owner'); define('db_password', 'password'); define('db_host', 'localhost'); $link = mysql_connect(db_host, db_user, db_password); if (!$link) { die('could not connect:' . mysql_error()); } $db_selected = mysql_select_db(...

Camunda BPM 7.2: register engine-plugin in processes.xml -

according docs, can register plugin in processes.xml. (see http://docs.camunda.org/latest/guides/user-guide/#process-engine-process-engine-plugins-configuring-process-engine-plugins ). the xsd says element 'process-engine' complex-type , has attribute 'name' (see http://camunda.org/schema/1.0/processapplication.xsd ). but when deploy process-application following processes.xml camunda-bpm-wildfly-7.2.0, error: 19:16:08,547 error [org.jboss.msc.service.fail] (msc service thread 1-5) msc000001: failed start service jboss.deployment.unit."firsttestproject-0.0.1-snapshot.war".post_module: org.jboss.msc.service.startexception in service jboss.deployment.unit."firsttestproject-0.0.1-snapshot.war".post_module: jbas018733: failed process phase post_module of deployment "firsttestproject-0.0.1-snapshot.war" @ org.jboss.as.server.deployment.deploymentunitphaseservice.start(deploymentunitphaseservice.java:166) [wildfly-server-8.1.0.final.jar...

jquery - So I have an HTML link that needs one attribute which exists in MVC input -

<a href="https://yourwater.oregon.gov/dcoliform.php?pwsno=$('#pws').val()" target="_blank" id="dataonline">data online</a> the mvc input is: @html.textboxfor(model => model.pws) i've referenced input in sorts of javascript document.onload(). not sure how send in url name/value pair url correct. won't send 5 digit number. should like in webpage when gets it: href="https://yourwater.oregon.gov/dcoliform.php?pwsno=99999 (99999 water system number used example) if have html - <a href="https://yourwater.oregon.gov/dcoliform.php?pwsno=" target="_blank" id="dataonline">data online</a> <input type="text" id="pws" value="99999" /> you can write script this. can in click handler or on page load or onchange, depends on requirement. var hreftxt = $("#dataonline").attr("href"); $("#dataonline").att...

html - Firefox not reading css -

basically title, tried opening page on firefox, localhost (wamp) has external css file , not loading. here header info: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <link type="text/css" rel="stylesheet" href="..\include\site.css" id="style"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> </head> the css has been validated has html file, both have no errors. css works in ie , chrome. looked solutions elsewhere couldnt find helped. any suggestions? thank-you! try replacing slashes: <link type="text/css" rel="stylesheet" href="..\include\site.css" id="style"> to: <link type="text/css" rel="stylesheet" href="../include/site.css" id="style">

mongodb java driver 3.0: how to store JSON document -

looks basic , simple: have json string , want store in mongodb json document. in java driver 2.xx use com.mongodb.util.json.parse(string jsonstring) dbobject , store in collection. in driver 3.0 json.parse still gives dbobject , rest of api uses org.bson.document class looks incompatible dbobject . how in driver version 3.0? for document use parse() static helper: document mydoc = document.parse(jsonstring)

Passing Android Java Strings to Node.js Server and then into PostgreSQL -

problem : strings in java use double quotes " ". i'm unable insert these strings database, postgresql uses single quotes in ' ' strings. in postgresql, double quotes used identifiers. i have poor solutions i've seen online such using $$ strings entail me taking each variable converting it. don't want surround strings dollar signs , have strings in database have quotes around them on. thanks in advance help! adding dollar signs in node.js file around strings won't add double quotes or dollar signs database unnecessarily.

asp.net mvc - Why do .net 4.5 MVC projects have so many binding redirects? -

visual studio 2013, .net 4.5, new mvc project , in web.config there is... <runtime> <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentassembly> <assemblyidentity name="microsoft.owin" publickeytoken="31bf3856ad364e35" /> <bindingredirect oldversion="1.0.0.0-3.0.0.0" newversion="3.0.0.0" /> </dependentassembly> <dependentassembly> <assemblyidentity name="microsoft.owin.security.oauth" publickeytoken="31bf3856ad364e35" /> <bindingredirect oldversion="1.0.0.0-3.0.0.0" newversion="3.0.0.0" /> </dependentassembly> <dependentassembly> <assemblyidentity name="microsoft.owin.security.cookies" publickeytoken="31bf3856ad364e35" /> <bindingredirect oldversion="1.0.0.0-3.0.0.0" newversion="3.0.0....

apache - Apache2 and mod_wsgi: Truncated or oversized response headers received from daemon process -

my application running apache 2 server using mod_wsgi, flask, , python 2.7. oddly enough, application crashes when page refreshes. me, happens on every other refresh. can see here . furthermore, in chrome, if open web inspector tool, program not crash. in logs, see: [tue apr 14 13:45:29.137444 2015] [wsgi:error] [pid 32713] [client 146.203.54.32:58816] truncated or oversized response headers received daemon process 'localhost:80': /etc/g2e/htdocs/g2e [tue apr 14 13:45:29.671493 2015] [core:notice] [pid 28845] ah00052: child pid 640 exit signal segmentation fault (11) [tue apr 14 13:45:29.671520 2015] [wsgi:info] [pid 28845] mod_wsgi (pid=640): process 'localhost:80' has died, deregister , restart it. [tue apr 14 13:45:29.671524 2015] [wsgi:info] [pid 28845] mod_wsgi (pid=640): process 'localhost:80' terminated signal 11 [tue apr 14 13:45:29.671527 2015] [wsgi:info] [pid 28845] mod_wsgi (pid=640): process 'localhost:80' has been deregistered , no...

google analytics - What is the source of this "No Hits" GA notification when using GTM? -

Image
i have done following: added gtm tracking snippet set ga (ua) tag of type 'pageview' published version i getting data in, (users, sessions , pageviews , real-time) but, receiving notification in ga ui: " no hits property [mypropertyid] not receiving hits." all have been able find suggests maybe tracking code somehow "broken", code on page seems identical given gtm. also, mentioned, data seems coming in fine. how can beat error? there have neglected in workflow leaving ga unsatisfied (such additional ga tag of kind)? did create account or property in google analytics? may take 24 hours before data processed, explain notification.

email - PHP can't find class 'GhostMailer' -

so trying call functions of mailer class.. in phpstorm when type ghostmailer::setsender(); i can navigate file when click scroll button on ghostmailer:: text ghostmailer into, whenever run program says class ghostmailer not found.. code calling ghostmailer::setsender(input::get('emailfrom')); ghostmailer::addrecipient(input::get('emailto')); ghostmailer::setsubject(input::get('subject')); ghostmailer::sethtml(true); ghostmailer::setmessage(input::get('email')); ghostmailer::setreturnaddress(input::get('emailfrom')); ghostmailer::getheaders(); ghostmailer::send(); how fix this? this sounds me class (file) not loaded , therefore class doesn't exist @ runtime. add "app/classes" , classmap array in composer.json , run composer dump-autoload , should go

Regex to match time ranges involving am/pm like 7am-10pm -

i have written following regex (1[012]|[1-9])(am|pm)\-(1[012]|[1-9])(am|pm) to match following kind of time formats: 7am-10pm (matches correctly , creates 4 match groups 7, am, 10, pm) 13am-10pm (this should not matched, matches , creates 4 match groups 3, am, 10, pm) 10pm (this doesn't match expected because doesn't specify time range end) 111am-10pm (this should not matched, matches , creates 4 match groups 11, am, 10, pm) how can improve regex such don't need repeat digits , am/pm pattern , following things: it captures time range components in 7am-10am there should 2 match groups 7am, 10am. it matches proper hours e.g. 111am or 13pm etc should considered no-match. i don't know if possible regex can make regex match correct time ranges e.g. 7am-1pm should match, 4pm-1pm should considered no match? note: using ruby 2.2.1 thanks. first let's see did wrong : 13am-10pm (this should not matched, matches , creates 4 match groups 3, a...

activerecord - Rails: Get phone_number of persons in city -

i need phone numbers of people in 1 city, have db this: class city < activerecord::base has_many :persons end ... class person < activerecord::base belongs_to :city has_many :phones end ... class phone < activerecord::base belongs_to :person end ... so neet phones in 1 city this: city.find(1).persons.phones any help? currently use this: ids=city.find(1).persons.ids phones=phones.where(id: ids) join nested has_many associations , apply clause this: phone.joins(person: :city).where(cities: {id: 1})

.htaccess 301 Redirects and Special Character Issue -

i have url ends /presentation/item?k=zw52axjvbm1lbnrhbc1ozwfsdggtc2fmzxr5lxnly3vyaxr5lwvuz2xpc2g=& which need redirect http://domain.co.uk/films/ehss/ but when use following; doesn't work; i've tried escaping special characters ? adding \ before still no joy. if of use being added beginning of htaccess file on wordpress site. this i've been trying: redirect 301 /presentation/item\?k=zw52axjvbm1lbnrhbc1ozwfsdggtc2fmzxr5lxnly3vyaxr5lwvuz2xpc2g=& http://domain.co.uk/films/ehss/ i've looked see if of other characters special characters , aren't. also, don't think can use regex either have 50 urls in same format above need redirected seo friendly urls. you can parse query_string using mod_rewrite rewriteengine on rewritecond %{query_string} ^k=zw52axjvbm1lbnrhbc1ozwfsdggtc2fmzxr5lxnly3vyaxr5lwvuz2xpc2g=&$ [nc] rewriterule ^presentation/item$ http://domain.co.uk/films/ehss/? [r=301,l]

Porting a Perl Skript to Python get wrong result with big numbers and modulo -

at moment port script perl python, somehow, strange behaviour modulo calculation. 32185864684058608501682550623 % 62 in perl 6 result , python 25l. is there somehow way number 6? also python3 same result. perl's built-in support large numbers not great. answer of 6 due overflow. compare $ perl -e 'print 32185864684058608501682550623 % 62, "\n"' 6 $ perl -mbignum -e 'print 32185864684058608501682550623 % 62, "\n"' 25

php - JQuery Ajax - Dynamic created input elements want to be able to upload with Ajax submit -

i have jquery file dynamically creates input elements. 1 of elements uploading image file. when user clicks save add database via ajax. want ability able upload on same save click. not able file element submit. below jquery: var trcopy; var editing = 0; var tdediting = 0; var editingtrid = 0; var editingtdcol = 0; var inputs = ':checked,:selected,:text,textarea,select,:hidden,:checkbox,:file'; var nothidden = ':checked,:selected,:text,textarea,select,:file'; $(document).ready(function(){ // set images edit , delete $(".eimage").attr("src",editimage); $(".dimage").attr("src",deleteimage); // init table blankrow = '<tr valign="top" class="inputform"><td></td>'; for(i=0;i<columns.length;i++){ // create input element per definition //first elements in array hidden fields if(columns[i] == '_fk_po_req_id'){ input = c...

XPages: Embed PDF and possibly Office files -

i need embed pdf files in xpage application. using ie11 x64 , cannot changed. eventually, i'll need embed ms office files (word, excel, power point). i have looked @ lot of pages , couldn't working solution this... have code works if force ie11 in ie10 mode, dojo starts acting weird (cannot close dialog boxes, ...). the code have right in computed field looks this: var id:string = pagedocument.getdocument().getuniversalid(); var attnames = @attachmentnames(); var url = getattachmenturl(id,attnames); '<object data="' + url + '#view=fit&pagemode=none&statusbar=0&messages=0"' + 'type="application/pdf" width="100%" height="100%" > ' + '<p>it appears web browser not configured display pdf files. ' + 'no worries, <a href="' + url + '">click here download file.</a></p>'+ '</object>' i need free solution. ibm, s...

javafx 8 - Can you specify minor jdk version for travis ci -

is possible specify minor version of jdk jobs running on travis? have javafx project failing because jdk 1.8.0_31 being used perform build project uses classes shipped in java 1.8.0_40 (specifically alert , spinner). currently .travis.yml file looks below: language: java jdk: - oraclejdk8 here's link failed build in case it's useful. i got working. solution not reccommended uses linuxbrew install oracle jdk 8.0_40. zrcoder on github ended .travis.yml : language: java branches: only: - master notifications: email: false before_install: - rm -rf ~/.linuxbrew - yes | ruby -e "$(curl -fssl https://raw.githubusercontent.com/homebrew/linuxbrew/go/install)" - export path="$home/.linuxbrew/bin:$path" - export manpath="$home/.linuxbrew/share/man:$manpath" - export infopath="$home/.linuxbrew/share/info:$infopath" - brew install jdk - export java_home=/home/travis/.linuxbrew/cellar/jdk/1...

c++ - Find point of interest on image -

Image
i'm trying track little white dots on edges table. in of case works. i'm using cornerharris function it's used in tutorial : http://docs.opencv.org/doc/tutorials/features2d/trackingmotion/harris_detector/harris_detector.html . sometimes, have got problem : reflection of light on edges creates point of interest have not consider. example : i'm searching 2 nearest points of top corners, can see on right edges, have find dots(red , green dots) , on left edges, light noise problem (cyan , blue dots). does knows method keep dots white on picture ? thankyou , sorry english on purely image processing part, recommend using kind of shape feature analysis (like comparing histogram in 8x8 around examined point of interest precomputed ones of features want . this mean first points harris corners, compare features dismiss unwanted ones ( euclidian distance in 8x8 = 64d ?). of course assumes existence of strong feature (read "taking time find one") assu...

Base64 decode gives no results -

i copy , paste text web base64 encoded site https://www.base64decode.org/ , other site provides base64 decoder, gives no result @ all. may ask... why so? happens other texts well... the text http://paste.ofcode.org/cgtfwhttmvprvqzf4lttdd had quick play on size listed , if change char set result, got below using cp1256. also tried following online decoder got me bit cleaner. luar��“ ��������� ����@�a@��@�@@�e��� @�پ@@�e@�� @€پ@@�€€���‚�€�������class����tracker����__init� ���updateweb����countinghowmuchusersihave��������������l�@�أ�€�a��]@�f€@�¥���]@��€���� ���updateweb�������@���addbugsplatcallback�������������������@�ƒ���ء@��@��€���� ���updateweb�������@�����������@obfuscated.lua��������������������������������self���������@obfuscated.lua����������������������������������self��������������_env�������� ���ئ�@�a��ف€�پ@�gءہ]€�پ��laءa�‚�]a�[���€€lءaء���ab�ضa‚]a€@€lءaءپ���ab�ضa‚]a€lپcءء�]پہپ†€†@پ…ld]a��€�������require����socket����assert����tcp����connect����maikie61...

sql - Gridview Calculated Field in Row -

i using visual studio 2010 , visual basic linked sql database. have gridview in want have calculated field, let's call nohoursoff, based on fields in row - begintimeoff , endtimeoff. after doing research, learned should use templatefield. don't understand how works. have tried no success: <asp:templatefield headertext="total hours" > <itemtemplate> <asp:label id="label1" runat="server" text='<%# "endtimeoff" - "begintimeoff" %>' width="100px"></asp:label>> </itemtemplate> </asp:templatefield> i have tried replacing text value "endtimeoff".subtract("begintimeoff") works on webpage. don't understand how calculated field! please or can direct me tutorial explain me. you need create function in codebehind this public string getvalue(object begintimeoff, object endtimeoff) { ...

Download multiple images to folder using javascript/jquery -

i created webpage fetches image urls using external api , displays them on page. want end user able download these images @ once. since these images not exist on sites server, looking way via javascript/jquery. i able in chrome using this , way prompt firefox , other browsers same. thanks!

php - Add array with unknown size into database -

i need build page user can enter name of categories of products of webstore. created page dynamic input fields user able add categories (which don't know ammount). have name of categories , put database. got script online , made few changes dont know how proceed further on. need php script, how array , insert database. this form script: <form method="post" action="setup3.php"> <div class="input_fields_wrap"> <button class="add_field_button">add more fields</button> <div> <input type="text" name="mytext[]"> </div> </div> <div> <input type="submit" value="next" /> </div> </form> i think point in right direction: <?php if (! empty($_post['mytext'])) { foreach ($_post['mytext'] $entry) { // perform insert here. } } i recom...

Xcode playgrounds can't access swift files in Sources folder -

i upgraded xcode 6.3 , offered new playgrounds. if make new playgrounds , open project navigator, see sources folder , inside there "supportcode.swift" file. @ top of file reads this file (and other swift source files in sources directory of playground) precompiled framework automatically made available <playground_name>.playground. i tried putting function in there , not available playground. doing wrong? have manually compile supportcode.swift file manually? how? you have add public access attribute classes, methods , properties in source folder make them accessible main playground file treated separate module compiler

Cloud-based Meteor with Velocity -

being meteor on windows not support velocity/jasmine, use cloud-based solution running meteor velocity. far have not had success. have tried nitrous, codeanywhere, koding, , cloud9. i use meteor windows preview , same issue. see so: easiest way create mobile apps on official meteor windows i had additional constraint want compile mobile apps not supported windows preview. i've not had success cloud-based solutions either beyond basic test apps. whole chain fragile, there's need configure can't @ in cloud solution. basically, options are: vagrant dual-boot (thanks @sbking) buy mac i recommend 3 because save time (and therefore money). first 2 fiddly, adding more sys admin work when should coding :) alternatively switch testing tools laika. see related so: laika vs velocity on meteor tdd laika (apparently) still works moment, though no longer officially supported. using current project in next few weeks. i'd interested hear solutio...

c - Not sure why I am getting an undefine refence to gss_str_to_oid error -

i using gssapi in c first time. trying reconstruct example on oracle doc http://docs.oracle.com/cd/e19683-01/816-1331/sampleprogs-1/index.html . in .c file call gss_str_to_oid(&min_stat, &tok, oid); , undefined reference error. included #include "gssapi.h" @ top of .c file. in gssapi.h there function call om_uint32 krb5_callconv gss_str_to_oid( om_uint32 *, /* minor_status */ gss_buffer_t, /* oid_str */ gss_oid *); so doing wrong? thought if included #include "gssapi.h" give me access function in gssapi. both files in src folder. doing wrong. using eclipse , in makefile under targets says all: gss-api. including of code below. main #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <error.h> #include <sys/...

javascript - Load all tabs into DOM on app startup (using Ionic) -

i have app tabbed interface, consists of 3 tabs. when user takes actions on tab1, dynamically creates elements should appear on second tab. problem when try dynamically create content within javascript, i'm getting cannot set attribute of "null", i'm assuming because second tab isn't loaded dom yet. if first navigate second tab, first tab, works fine. i'm not using angular way it's used. done in javascript. have barebones app.js underlying ui. essentially, want have 3 tabs loaded dom on app startup can dynamically modify contents of tab other tab. not sure how this. here's app.js looks like: var myapp = angular.module('starter', ['ionic','ngcordova']) myapp.run(function($ionicplatform) { $ionicplatform.ready(function() { // hide accessory bar default (remove show accessory bar above keyboard // form inputs) if(window.cordova && window.cordova.plugins.keyboard) { cordova.plugins.keyboard.hide...

mule - Mulesoft XSLT Streaming Large xml files -

i using mulesoft 3.6 ce. have large xml file, split small xml elements , push jms queue. trying explore xslt options achieve using mule's out of box streaming functionality without writing code. for example have incoming file <books> <book> <isbn>1</isbn> <title>book 1</isbn> </book> <book> <isbn>2</isbn> <title>book 2</isbn> </book> .... </books> and want write each element jms queue following snippet <book> <isbn>1</isbn> <title>book 1</isbn> </book> any highly appreciated. regards, srinivas since mule support xslt 2.0/3.0, try this, assuming isbns unique <?xml version="1.0" encoding="utf-8" ?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/xsl/transform" version="2.0"> <xsl:output method="xml" encoding="utf-8" ind...

After upgrading to Xcode 6.3, newly built iOS app archives can't be submitted -

Image
after upgrading 6.3 , building archive ios app, archive appears under "other items" , "submit app store" grayed out. my archives built prior upgrading listed correctly under name of app. i noticed works correctly mac version of app. i tried changing ios version's target name , scheme name match name under ios apps in organizer didn't (if things simple!). resolution apple for example, app "tripla" has 1 main project , 1 sub-project (google-api-client: gtl.xcodeproj). in main project, has 1 main target , 4 sub-targets, , in gtl.xcodeproj, has 4 targets. skip-install in tab "build setting" in main project setting yes, no in sub-project , sub-targets. skip-install in tab "build setting" in main target of main project yes, no in rest of sub-targets. it did solve issue of app "tripla". apple troubleshoot technotes tn2215

userscripts - Obtain and check the value of an input text with javascript -

i new javascript , need script obtain value of input text , check value if equal 0 (zero). if need alert message notifying me text input 0. thanks. <input id="txtval" type="text" name="txtval" value="0" maxlength="10"> the short answer: if(txval.value==0) alert('please enter number.'); is not best answer: var v=document.getelementbyid('txtval'); v=parseint(v,10); if(v<=0) alert('please enter positive integer.'); of course not best answer either fix couple of common mistakes. although can refer element using id variable name not recomended. the value property of input (ie txtval.value ) string (even if contains digits) if try compare number may unexpected results. in case comparing 0 problems less if ever change code compare number run problems, best make actual number before it. if want allow decimals use parsefloat instead.

uitableview - How to find out if a UITableViewCell has scrolled away and is invisible -

i have uitableviewcell observes (via kvo ) properties. makes sense if cell visible. want remove observer when cell scrolls away, , before prepareforreuse called. how can this? your table view delegate can implement - (void)tableview:(uitableview *)tableview didenddisplayingcell:(uitableviewcell *)cell forrowatindexpath:(nsindexpath *)indexpath and in there can call method on cell perform cleanup want.

javascript - Trying to post data from an angular html page to a php page for processing and email -

i've been working angular short time , i'm trying contact form submit php file @ domain route that's set mail us. i've gotten php mail none of date being carried on angular application. here's code: angular.module('demoapp') .controller('contactctrl', function ($scope, $http, $templatecache) { var method = 'post'; var url = 'contact.php'; $scope.codestatus = ''; $scope.add = function() { $http({ method: method, url: url, data: $.param({'data' : formdata}), headers: {'content-type': 'application/x-www-form-urlencoded'}, cache: $templatecache }). success(function(response) { $scope.codestatus = response.data; }). error(function(response) { $scope.codestatus = response || 'request failed'; }); return false; }; }); <script src="https://ajax.googleapis.com/ajax/libs...

python - PyDev tab alignment in inline comments -

i'm sure there easy fix this, i've scoured preferences , haven't been able find option appropriate sounding name. here's simple example, top line isn't in code, there illustrate every 4th character position: # # # # # # # # = 2 # 2 b = "ab" # else foo between "something" , "two" hit <tab> twice, between "something else" , "foo" hit <tab> twice. my expectation using tab inside comment insert necessary spaces next tabstop (the way tab outside of comment works) instead, pressing tab inserts 4 spaces, regardless of column you're in. this doesn't happen in eclipse inside java project, leaves me believe it's pydev thing. just clear, expected hitting tab twice on first line , once in second produce: # # # # # # # # = 2 # 2 b = "ab" # else foo thanks in advance simple fix. p.s. hesitant tagging...

python - How to get these shapes to line up for a numpy matrix -

i'm trying input vectors numpy matrix doing: eigvec[:,i] = null however keep getting error: valueerror: not broadcast input array shape (20,1) shape (20) i've tried using flatten , reshape , nothing seems work the shapes in error message clue. in [161]: x = np.zeros((10,10)) in [162]: x[:,1] = np.ones((1,10)) # or x[:,1] = np.ones(10) in [163]: x[:,1] = np.ones((10,1)) ... valueerror: not broadcast input array shape (10,1) shape (10) in [166]: x[:,1].shape out[166]: (10,) in [167]: x[:,[1]].shape out[167]: (10, 1) in [168]: x[:,[1]] = np.ones((10,1)) when shape of destination matches shape of new value, copy works. works in cases new value can 'broadcasted' fit. not try more general reshaping. note indexing scalar reduces dimension.

c++ - using bool to quit from commanline -

i have following requirement 1 of program using quit():- quit (1) when quit command received, mainpart() function of statdata should return main() (2) in addition, if eof reached, regardless of whether there quit command, mainpart() should return (3) in turn, main() main return , program terminate (4) not call exit() so program looks :- main() should this... #define bool done; int main() { statdata statdata; statdata.mainpart(); return 0; } and mainpart() looks like... void statdata::mainpart() { while (!cin.eof() && !done) processcommand(); } void rbapp::processcommand() { string command; cin>>command; if(command == "quit") { processquit(); } bool statdata::processquit() { if(command=='quit') { done=true; return main(); } else { done=false; return done; } } i don't know going wrong. logic not working per specifications given. cannot use exit() in logic. please me. in ad...

survival analysis - fminsearch censored MATLAB -

edit found y(c) in script gives error: subscript indices must either real positive integers or logicals. but in example script y(c) prints values of y censored. i trying use script found analysis of censored data. script works fine when try use own data error. this example code: % have (x,y) data n = 100; x = 10*rand(n,1); y = 5 + .5*x + randn(n,1); plot(x,y,'o','color',[.8 .8 .8]); % it's censored, can't observe values larger 8 c = y>8 o = min(y,8); line(x,o,'marker','o','color','b','linestyle','none') % if fit line data observe, no b = polyfit(x,o,1) s = norm(o-polyval(b,x))/sqrt(n) xx = linspace(0,10); line(xx,polyval(b,xx),'color','r') % instead need likelihood function taket censoring account nloglik = @(p) - sum(log(normpdf(o(~c),p(1)*x(~c)+p(2),p(3)))) ... - sum(log(1-normcdf(o(c),p(1)*x(c)+p(2),p(3)))); nloglik = @(p) - sum(log(normpdf(tof(~c),p(1)*z(~c)+p...

Android Youtube API: how to play video when YoutubeView is invisible -

i'm trying play youtube video android youtube api . use youtubeplayerfragment , add view container. works when view container visible. tried make view container invisible. stops working , throws error "youtube video playback stopped because player's view not visible". i'm wondering there anyway can play video view invisible? it's not possible , if try tricks. this because sdk monitors view tree current window , therefore able see if placed on youtube video container.

while uploading a image using php and mysql: Warning: file_get_contents(): Filename cannot be empty -

when trying upload image photos folder having type of warning msg dont know to.. this php file if (!isset($_files['image']['tmp_name'])) { echo ""; }else{ $file=$_files['image']['tmp_name']; $image= mysql_real_escape_string(addslashes(file_get_contents($_files['image']['tmp_name']))); $image_name= addslashes($_files['image']['name']); move_uploaded_file($_files["image"]["tmp_name"],"photos/" . $_files["image"]["name"]); $location="photos/" . $_files["image"]["name"]; $save=mysql_query("insert add values('$location')") or die("can not insert"); exit(); } this html code <form method="post" action='ap.php' enctype="multipart/form-data"> <input name="image" id=...

python - Variables in PHP String -

so i'm trying execute python function php, reason doesn't work when want add variable. it works fine when shell this: python -c 'import smtp; smtp.email("email body")' but when run php won't work if add variable: exec("python -c 'import smtp; smtp.email({$email})'"); i'm python right, why won't work? every post see shows variables inserted this. seems forgot use \" email body. exec("python -c 'import smtp; smtp.email(\"$email\")'");

bash - How to make awk ignore the field delimiter inside double quotes? -

this question has answer here: escaping separator within double quotes, in awk 4 answers i need delete 2 columns in comma seperated values file. consider following line in csv file: "abc@xyz.com,www.example.com",field2,field3,field4 "def@xyz.com",field2,field3,field4 now, result want @ end: "abc@xyz.com,www.example.com",field4 "def@xyz.com",field4 i used following command: awk 'begin{fs=ofs=","}{print $1,$4}' but embedded comma inside quotes creating problem, following result getting: "abc@xyz.com,field3 "def@xyz.com",field4 now question how make awk ignore "," inside double quotes? from gnu awk manual ( http://www.gnu.org/software/gawk/manual/gawk.html#splitting-by-content ): $ awk -vfpat='([^,]*)|("[^"]+")' -vofs=, '{print $1,$4}...

lua table - Lua 5.2 metatables and environment -

i've got structure this: context = { pi = math.pi, sin = math.sin, cos = math.cos, tan = math.tan, print = print } modules = { m1 = { variables = { x = 1 }, update = function(self) local _env = self.variables x = 2 m2.x = 2 end }, m2 = { variables = { x = 1 }, update = function(self) local _env = self.variables end } } setmetatable(modules.m1, {__index = modules.m1.variables}) setmetatable(modules.m1.variables, {__index = context}) setmetatable(modules.m2, {__index = modules.m2.variables}) setmetatable(modules.m2.variables, {__index = context}) setmetatable(context, {__index = modules}) the idea users enter code ui , code pasted update functions of different modules, after local _env set. user-entered code should sandboxed. should able access few functions (the ones in context table) , contents of other modules. code in m1:update should able refer variables in m1.variables without qualifying them;...

Ads services in android app -

i seen advice seniors here. as stated write ups there ads services collect user data without user knowledge. true? i looked couple of ads services nothing state info whether collect user data without knowledge. what ads services recommend safe user of app without information been collect? my primary purpose protect user's data. you should check privacy policies, every ad services have privacy policy, , tell information collect users , purpose do. chartboost's privacy policy.

Simple HTML Dom get href that begins with -

i using simple html dom extract information remote source. href links contain particular piece of text (not on page). have tried ->find('a[href*="/place"]') and ->find('a[href="/place"*]') and ->find('a[href="/place*"]') but returns empty results. the href trying must begin text "/place". any suggestions? thanks match elements have specified attribute , starts value, use [attribute^=value] . ->find('a[href^="/place"]') ref: http://simplehtmldom.sourceforge.net/manual.htm#frag_find_attr