Posts

Showing posts from June, 2014

javascript - Angular does not seem to run -

Image
i'm new angular , experimenting bit. have rest api running locally (express app) , have angular code in public folder consumes rest api. code server , client running 1 codebase , works fine, can add, update, delete items in mongo db running locally (code here ) the idea run server api on heroku , split off angular code have html , js file in complete separate folder, not being part of express app. server part working i'm using postman add, update , delete items. when using angular ui, seems angular code not executed (cfr screenshot) the code here . any thoughts on why running html code not seem work? enabling or disabling cors in chrome browser not help. it looks there special character @ bottom of controller.js . controllers/controller.js: $scope.updatetodo = function() { console.log("completed" + $scope.todo.completed); $http.put(url + $scope.todo._id, $scope.todo).success(function(response) { console.log("new updated: " +

node.js - npm install sqlite3 takes forever -

i trying install sqlite3 use in node.js. however, installation takes forever , stuck @ bottom line below. i have waited @ least 15 minutes happen. i have tried installing --build-from-source appended, same same result. the device installing on raspberry pi, , rebooting not solve issue. other packages such socket.io has been installed previously. npm install sqlite3 npm warn package.json servergps@1.0.0 no description npm warn package.json servergps@1.0.0 no repository field. npm warn package.json servergps@1.0.0 no readme data / > sqlite3@3.0.8 install /home/pi/servergps/node_modules/sqlite3 > node-pre-gyp install --fallback-to-build child_process: customfds option deprecated, use stdio instead. child_process: customfds option deprecated, use stdio instead. make: entering directory '/home/pi/servergps/node_modules/sqlite3/build' action deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep release/obj/gen/sqlite-autoconf-3080900/sqlite3.c touch r

How to send https request with client certificate using Python programming language -

i have 2 jks files truststore.jks , keystore.jks use when sending rest request java based client , want use python didn't find way use them authenticate how can use them in python ? you didn't provide of info (e.g. tried before), answer not precise. i think looking urllib2.urlopen() (probably using request object tune request properties), note ssl-related function parameters. first you'll need convert jks files format accepted python (i guess it's openssl format).

ios - Post a notification within a NSOperationQueue -

i need nsnotificationcenter . have class called sensor , class called sensormanager . i'd send notification sensor sensormanager . in sensormanager write code: [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(receivetestnotification:) name:@"testnotification" object:nil]; and, clearly, have function: - (void) receivetestnotification:(nsnotification *) notification { if ([[notification name] isequaltostring:@"testnotification"]) nslog (@"successfully received test notification!"); } in sensor class have function starts sensor: -(void)worksensor{ self.motionmanager.accelerometerupdateinterval = 0.05; nsoperationqueue *queue = [[nsoperationqueue alloc]init]; [self.motionmanager startaccelerometerupdatestoqueue:queue withhandler:^(cmaccelerometerdata *data, nserror *error) { [[nsnotificationcenter defaultcenter] postnoti

c# - Execute Mail Merge and produce many docs. Type Mismatch error -

//instantiate worddoc , wordapp string pathdoc, datetemp = string.empty; datetime ddatetemp = new datetime(); ddatetemp = convert.todatetime(sdate); var ds = new dataset(); string textdate = ddatetemp.tostring("mm/dd/yy"); switch (msdatetype) { case "d": ssql = string.format(msquery+"'{0}'",textdate); break; case "w": ddatetemp = ddatetemp.adddays(4); datetemp = ddatetemp.month.tostring("mm") + "/" + ddatetemp.day.tostring("dd") + "/" + ddatetemp.year.tostring("yy"); ssql = msquery + " @textdate"; //ssql = msquery + " '" + textdate + "' , '" + datetemp + "'"; messagebox.show(ssql); break;

php - How come my SESSIONS aren't saving? -

<html> <head lang="en"> <meta charset="utf-8"> <link type="text/css" rel="stylesheet" href="bootstrap-3.2.0-dist\css\bootstrap.css"> <title>admin login</title> </head> <style> .login-panel { margin-top: 150px; </style> <body> <div class="container"> <div class="row"> <div class="col-md-4 col-md-offset-4"> <div class="login-panel panel panel-success"> <div class="panel-heading"> <h3 class="panel-title">sign in</h3> </div> <div class="panel-body"> <form role="form" method="post" action="admin_login.php"> <fieldset> <div cl

c++ - Qt setGeometry: Unable to set geometry -

why? setgeometry: unable set geometry 22x22+320+145 on qwidgetwindow/'widgetclasswindow'. resulting geometry: 116x22+320+145 (frame: 8, 30, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 22x22, maximum size: 16777215x16777215). the project is: project.pro qt += core gui greaterthan(qt_major_version, 4): qt += widgets target = untitled5 template = app sources += main.cpp\ widget.cpp headers += widget.h widget.h #ifndef widget_h #define widget_h #include <qwidget> class widget : public qwidget { q_object public: explicit widget(qwidget *parent = 0); ~widget(); private: }; #endif // widget_h widget.cpp #include "widget.h" #include <qvboxlayout> widget::widget(qwidget *parent) : qwidget(parent) { qvboxlayout *vlayout = new qvboxlayout(this); } widget::~widget() { } main.cpp #include "widget.h" #include <qapplication> int main(int argc, char *argv[]) { qapplication a

c# - How to deploy wpf application? -

i have wpf application contains wpf application. on click of button 2nd wpf application launches uses images stored in image folder in project. works fine in visual studio, when publish application using build>publish application stop working when click on button open 2nd wpf application. how deploy application contains images? didn't try installshield because there error in registration process.

c++ - How to find and replace an items in a ComboBox -

in c++ builder xe8, i'm using following methods insert item combobox: mycombobox->items->beginupdate(); mycombobox->items->insert(0, "title"); mycombobox->items->insert(1, "google"); mycombobox->items->insert(2, "yahoo"); mycombobox->items->insert(3, "127.0.0.1"); mycombobox->itemindex = 0; mycombobox->items->endupdate(); i want know how replace 3rd item, 127.0.0.1, "xxx.0.0.1". i've tried using stringreplace() , no luck. first, example should using add() instead of insert() (and try/__finally block or raii wrapper, in case exception thrown): mycombobox->items->beginupdate(); try { mycombobox->items->add("title"); mycombobox->items->add("google"); mycombobox->items->add("yahoo"); mycombobox->items->add("127.0.0.1"); mycombobox->itemindex = 0; } __finally { mycombobox->it

node.js - express router middleware: reference error "req is not defined" -

im working middleware authenticate token, probolem isn't snippet, problem stars when instantiate function. there code: router.use(authrequirer(req, res, next)); sure, here routing file: let router = express.router(); // middleware import authrequirer '../util/authrequirer'; // controllers import authctrl '../controllers/authctrl'; import userctrl '../controllers/userctrl'; let authctrl = new authctrl(); let userctrl = new userctrl(); router.get('/', (req, res) => { res.json({ message: "hey, im working" }); }); // login, register, setup admin router.get('/setup' , authctrl.setup); router.post('/register', authctrl.register); router.post('/login' , authctrl.login); // autenticacion requerida router.use(authrequirer(req, res, next)); router.route('/users') .get(userctrl.getall) .post(userctrl.create); router.route('/users/:username') .get(userctrl.getone) .put(userct

php - .htaccess - redirect individual urls to url with query string -

i'm looking opposite of common query .htaccess files. i want redirect standard url url query string, similar below: test.com/directory/pagename to: test.com/template?id=1 i don't require pattern matching of form, want write out separate redirect each one. example: test.com/colours/red = test.com/template?id=5 test.com/colours/yellow = test.com/template?id=3 hopefully makes sense. you can use code in document_root/.htaccess file: rewriteengine on rewriterule ^colours/yellow/?$ template?id=3 [l,nc,qsa] rewriterule ^colours/red/?$ template?id=5 [l,nc,qsa]

Multiple Dropdown in Visual Studio 2008 not filtering correctly -

i using visual basic 2008 ssrs , backend sql server 2008 create reports. trying create 2 parameterized dropdowns user can select in order filter data in reports. reason can't seem both parameters filter 1 filters correctly. when run report in visual studio 2008 choose dropdown1 equal 2 , dropdown2 equal 4. should show 1 row, reason second filter seems work. need modify sql maybe?? appreciated, thank you. **table 1** **table 2** **table 3** key1 key2 data1 key3 data2 data3 1 1 hi 2 green white 4 1 2 green white 2 hey 3 red black 3 hi 1 orange purple 1 hey 4 blue black 4 hey 4 blue purple **current result** **desired** data1 data2 data3 data1 data2 data3 hi orange purple hi orang

HTML5 Canvas Drawing App Issue -

i have implement function draw on canvas drawfree,line,triangle,star when selecting other tool,it draw previous figure ex:if have selected drawfree @ first working fine,and when select draw line tool draw straight line,it calls previous function too. javascript canvas.removeeventlistener('mousedown',draw_line); canvas.removeeventlistener('mouseup',stop_draw_line); canvas.removeeventlistener('mousemove',draw_dragging_line); canvas.removeeventlistener('mousedown',draw_free); canvas.removeeventlistener('mouseup',stop_draw); canvas.removeeventlistener('mousemove',draw_dragging); canvas.removeeventlistener('mousedown',draw_eraser); canvas.removeeventlistener('mousemove'

php - How to send data from database from model to controller codeigneter -

Image
model public function sign_in() { if (isset($_post)) { $this->load->library('session'); $email = $this->input->post('email'); $password = $this->input->post('password'); $this->db->select('id', 'name', 'password', 'email'); $this->db->from('users'); $this->db->where('email', $email); $this->db->where('password', md5($password)); $this->db->limit(1); $query = $this->db->get(); if ($query->num_rows() > 0) { $data = array(); foreach ($query->result() $row) { $data[] = array( 'name' => $row->name ); } return $data; } else { return false; } } } //controller public function index() { $this->load-

How can I get the context root of an application using a wsadmin jython script with -conntype NONE in WAS -

i trying create script prints out web urls of commonly used applications, having difficulty finding wsadmin command web context root application. i aware adminapp.view(app, '-ctxrootforwebmod') contains information, wondering if there call return context root. i use taskinfo mapping details: print adminapp.taskinfo('<filename>', '-ctxrootforwebmod')

android - How to install app as system app -

i want implement root functions (like restarting phone) in app , therefore app must install system app. is there programmatically way that? thanks lot how?? in method use script tour program execute root why script?? because need kill whole app transfer system why can't on installation?? we can't because system app should signed google ( like talkback ) so begin preparing script the script copying whole folder /system/app partition (just download system/app mover play store , watch scripts) executing you need start script root calling su -c " " congrats you got system

label - Cesiumjs - Rotate text -

i want add label doesn't face camera. instead, want follow defined path. similar how street names follow direction of streets in google maps (they aren't horizontal). i can think of 2 possible implementations rotating text haven't had luck. that label() or label : have rotation property haven't found. ie this: viewer.entities.add({ position : cesium.cartesian3.fromdegrees(-75.1641667, 39.9522222), label : { text : 'philadelphia' //rotation : cesium.math.toradians(-45) } }); or this var labels = scene.primitives.add(new cesium.labelcollection()); var l = labels.add({ position : cesium.cartesian3.fromradians(longitude, latitude, height), text : 'hello world', font : '24px helvetica' //rotation: cesium.math.toradians(-45) }); create pictures of each label in photoshop , import them image, rotate image (or use material , rotate entity). labor intensive if have

javascript - Save grid data to CSV file using Perl -

here grid data: "order","id","comment" "1.00","345.00","do this" "2.00","475.00","dont this" the first column column header order, id , comment. next 2 columns data. the above grid data collected , put in variable named data var data= \$("#jqxgrid").jqxgrid('exportdata', 'csv'); now transferring data via ajax @ backend. need ensure data goes through ajax. , gives me alert "success" when click on save button. here code save button onclick() \$(document).ready(function() { \$("#savefile").click(function() { var data= \$("#jqxgrid").jqxgrid('exportdata', 'csv'); console.log(data); \$.ajax({ type: "post", url: "http://apmqa.mcm.com/cgi-bin/test/web_editor.pl?action=savetocsv", datatype: "html", data:data,

c# - 16bit greyscale image to heatmap -

Image
i'm working on scientific imaging software university, , i've encountered major problem. scientific camera (apogee alta u57) @ lab provides images 16bpp array - it's 0-65535 values per pixel! want keep range, in fact can't display them on monitor (0-255 grayscale range). found way resolve problem - make use of colors, , display whole image heatmap (from black, blue, through green , red, pure white). i mean - example heatmap image want achieve my question is: how efficiently convert 16bpp array of pixel values complete heatmap bitmap in c#? there libraries doing that? if not, how achieve using .net resources? my idea create function maps 65536 values (255 r, 255g, 255b), it's tough job - without using hsv model. i obliged provided! your question consist of several parts: reading in 16 bit pixel data values mapping them 24 bit rgb colors writing them out image file i'll skip part 1 , 3 , give few ideas part 2. it in fact harder seem

Hiding text using Javascript / JQuery -

i developing chrome extension , trying hide part of page. new stuff apologies in advance if using wrong terms or question seems obvious! the page format appears below: <div class="wrapper"> <span class="loud" style="text-decoration: none;">...</span> <div class="leave-gap">...</div> <quote>...</quote> "*** can't figure how hide ***" <p></p> <span id="id_12345" class="none">...</span> <div class="block-footer">...</div> <div class="leave-gap">...</div> </div> as snippet suggests, cannot figure out how hide bit highlighted stars. i have function takes input variable first element in class "wrapper": function processcomment(commentstart) { $element = commentstart; while($element) { if(some condition) { $element.hide();

add in - Stuck for over 2 months getting an outlook addin to work -

this re-post of previous question, i've spent on 2 months stuck on same issue , haven't made progress of kind. long story short, fires , doesn't. loads once, outlook defaults "inactive" , there's nothing seem able it. when fire, hangs when trying send first email. so, have old appointments outside of date range i'm checking , messagebox appears those. when gets "new" appointments (within date range), pops first messagebox hangs trying send email. first "good" messagebox fails pop up. last advice got regarding issue build log file, couldn't figure out how/what going me or wasn't sure going need log, , gentleman suggested never responded me when asked. thank in advance help, 1 of frustrating things i've ever run in developer. using system; using system.threading; using system.collections.generic; using system.linq; using system.text; using system.xml.linq; using outlook = microsoft.office.interop.outlook; using office =

php - MySQL : select column values which do not repeat with both possible values 1 and -1 -

i have db table follows id | branch | allot 1 | comp | -1 2 | | -1 3 | comp | -1 1 | comp | 1 where allot=-1 means seat allotted , allot=1 means seat cancelled i want mysql query return id=2,3 only not id=1 has cancelled seat later on. your question says "later on". cannot done data format, because sql tables represent unordered sets. and, have no column specifies ordering. if want -1 values , exclude 1 , there several ways. 1 use not exists : select t.* dbtable t allot = -1 , not exists (select 1 dbtable t2 t2.id = t.id , t2.allot = 1 ); if later discover column have ordering records (such createdat ), can modify to: select t.* dbtable t allot = -1 , not exists (select 1 dbtable t2 t2.id = t.id , t2.allot = 1 , t2.createdat > t.createdat );

c++ - Setting up a server using Boost-ASIO for Wireshark to connect to and receive packets? -

i trying create simple server using asio in order send packets wireshark view them using remote interfaces feature. this code sets server , waits connection. void server(boost::asio::io_service& io_service, unsigned short port) { tcp::acceptor a(io_service, tcp::endpoint(tcp::v4(), port)); (;;) { auto psock = std::make_shared<tcp::socket>(io_service); auto handler = [psock](const boost::system::error_code& err) -> void { if (err) { psock->close(); return; } auto buf = connecttonamedpipe(); streamout(psock, buf); psock->close(); }; std::cout << "awaiting connection" << std::endl; a.async_accept(*psock, handler); io_service.run(); } } this code sends packet once client connects void streamout(std::shared_ptr<tcp::socket> psock, const std::pair<std

sql - ISNULL not replacing with NULL -

Image
i have following code - select br_csno [party_key], 'w' [phone_type_cd], isnull( ltrim( rtrim( fac_telno ) ), '0' ) [phone_num], null [update_dt], getdate() [batch_dt] base b i following result - it not replacing null . why? because of wrong placement or usage of ltrim(rtrim()) ? edit sorry limited knowledge of sql. want trim fac_telno , replace null if 0 i think wanted. sorry causing confusion! select br_csno [party_key], 'w' [phone_type_cd], nullif( ltrim( rtrim( fac_telno ) ), '0' ) [phone_num], null [update_dt], getdate() [batch_dt] base b

jquery - How to properly set Bootstrap's column classes to equal height -

consider markup: <div class="row"> <div class="col-xs-4"> <img src="somesource.png"> </div> <div class="col-xs-6"> <h1>some text</h1> </div> <div class="col-xs-2"> <span class="glyphicon glyphicon-chevron-right"></span> </div> </div> if image around 100px in height , rest less. how supposed set them equal height without setting hard coded valued height property on of them? the columns should able have absolute positioned elements inside them , still equal height rest of columns. i tried writing script this, however, no matter did height of columns never got correct value. script looks this: var highest = 0, columns = $('.row').find('> div[class*="col"]'); $.each(columns, function() { var height = $(this).height(); if (height > highest) { highest = height; } });

java - Google App Engine Modules + HttpServlet with static values; -

i developing application delivers notifications android , ios devices. using basic scaling , have implemented logic ( modifying example ) appropriate number of workers active @ given time without using resident instance. public class notificationworkerservlet extends httpservlet { /** * */ private static final long serialversionuid = 1l; private static final logger log = logger .getlogger(notificationworkerservlet.class.getname()); private static final int max_worker_count = 5; private static final int milliseconds_to_wait_when_no_tasks_leased = 2500; private static final int ten_minutes = (10 * 60 * 1000); // area of concern private static synccounter counter; /** * used keep number of running workers in sync */ private class synccounter { private int c = 0; public synccounter(){ log.info("sync counter instantiated"); } public synchronized void increment() { c++; log.info("increment sync counter, workers:&

node.js - convert a string to JSON Object with same name (Need this for some sort of dynamic code in js) -

var objname = "person"; //if assign "institute" need institute json object //i have global person json many attributes. var thisobj = objname.toobject(); //need of kind //i know eval can used, checking other better way this. please advise if there better way convert string object of name in nodejs, sails js it not technically possible in es5 javascript want without use of eval. have eluded to, not idea use eval in situation (or pretty all). alternative such david suggested go-to now.

java - How can I make my main if, elseIf and else to do the same thing as my main if does without getting "duplicate" errors? -

my main if statement asks input. if it's "february",it goes next steps. want these same steps main elseif , else after own part. want convert "february" "alluppercase" or "alllowercase" make insensitive. error when i'm writing ""if(s1.tolowercase("february"))"" thanks import java.io.bufferedreader; import java.io.inputstreamreader; import java.util.arrays; public class compare { public static void main(string[] args) { string[] months1 = {"january","march","april","may","june","july","augest","september","october","november","december"}; string s1 = getinput("enter month "); if(s1.equals("february")) { system.out.println("it's time go disneyland !"); string s2 = getinput("enter month: "); if(s2.equals("febru

mysql - docker 1.7 multiple port mapping at run failure -

background: ubuntu 14.04 lts - docker 1.7 - virtual interface own ip specfically use docker. running wordpress latest linked mysql 5.7 each own data containers. i need map ports 80 & 443 wordpress container enforce ssl site wide. this run string works perfectly: docker run --name web --link db-server:mysql -d -e wordpress_db_name=wp -e wordpress_db_user=admin -e wordpress_db_password=somepassword -p 172.31.25.94:80:80 --volumes-from wp-data wordpress when run string error: docker run --name web --link db-server:mysql -d -e wordpress_db_name=wp -e wordpress_db_user=admin -e wordpress_db_password=somepassword -p 172.31.25.94:80:80 —p 172.31.25.94:443:443 volumes-from wp-data wordpress:latest error message: unable find image '—p:latest' locally invalid repository name (—p), [a-z0-9-_.] allowed i have read docker documentation , googled issue , have found should work. there missing or not possible in 1.7?

java - Unsigned entry - JWS -

i trying learn how jws works , got stuck below error com.sun.deploy.net.jarsigningexception: found unsigned entry in resource: http://localhost:9292/testjnlp.jar @ com.sun.javaws.security.signinginfo.getcommoncodesignersforjar(unknown source) went thru lot of related post below got answers looking for. found unsigned entry in resource jars no longer seem signed. jarsigningexception: found unsigned entry https://stackoverflow.com/questions/30309730/javaws-keep-temporary-files-unchecked-%e2%87%92-found-unsigned-entry-in-resource question 1 : why jws application checking signing default , 2 components checked/verified signature ? in general when sign file (by sender), signature verified receiver or vice versa components here error ? question 2: how it(jar) can signed error can fixed ? question 3: setting disable ?

setinterval - Javascript wait until last event fired in callback before proceeding -

this pretty basic javascript question though involves chrome extension api. chrome.tabs.onupdated.addlistener(function(tabid, changeinfo, tab) { if (changeinfo.status == 'complete') { //complete may fire multiple times per page update var timer = 0, interval; console.log(changeinfo.status); clearinterval(interval); interval = setinterval(function() { if (timer == 5) { console.log('here'); clearinterval(interval); } timer++; }, 1000); } }); i think script right delay everything. want every time 'complete' status happens, want check 5 seconds go , log 'here'. if 'complete' fires, want rid of previous timer , start new one. wait until 'complete's fired...i need fixing interval logic... you have declare timer , , interval outside function scope, or it'll declare new 1 in scope, , clearinterval ca

c# - Wix can't add Custom Action to project -

Image
wix 3.9, visual studio 2013 update 4 i want add custom action setup project. list files wix. tried reinstall wix. tried install version 3.9 or 3.10. no results. well, project fails connect microsoft.deployment.windowsinstaller.dll , microsoft.deployment.windowsinstaller.package.dll   did wrong? you can't add customaction directly wix installer project. need create customaction project hold action , reference within installer project.

javascript - What's the difference between Node/Element/Object? -

it said, in many many places, they're both same thing. when start explaining refer each 1 of them differently without giving clear explanation what's difference? please try specific possible i'm still learning js not great yet. :) a node interface number of dom types inherit, , allows these various types treated (or tested) similarly. ref: https://developer.mozilla.org/en-us/docs/web/api/node the element interface represents object of document. interface describes methods , properties common kinds of elements. specific behaviors described in interfaces inherit element add additional functionality. example, htmlelement interface base interface html elements, while svgelement interface basis svg elements. ref: https://developer.mozilla.org/en-us/docs/web/api/element an object may represent anything. objects have properties, describe them, , methods actions can performed on them. putting together: you can create dom node in web page so: var node=d

javascript - Using '&' in ajax form submit -

i submitting form using .ajax() . the current script contains: data: datastring, datastring contains: var list = $('.listsummary').val() the class listsummary belongs textarea users fill in, or (partially) filled in dynamically through different script. the problem users of time use '&' sign, example: potato & patota blah blah blah this screws datastring allowing post written before first '&' found. how can achieve var list sent php handler in order store entire textarea content database use of '&'? you can encode string encodeuricomponent() var list = $('.listsummary').val(); var urlencoded = encodeuricomponent(list);

Wamp in LAN with a real domain name -

i have domain name , have set virtual host want know how connect domain name virtual host i'm new plz answer easy understandable answers http-vhosts.conf namevirtualhost *:80 <virtualhost *:80> documentroot "c:/wamp/www" servername localhost serveralias localhost <directory "c:/wamp/www"> order deny,allow deny allow localhost </directory> </virtualhost> <virtualhost example.com> documentroot "c:/wamp/www/example" servername example.com serveralias example.com options indexes followsymlinks <directory c:/wamp/www> order deny,allow allow </directory> </virtualhost> i want show website using domain name internal , external ok lets assume domain called mysite.com , need testing version of site, lets mysite.dev you have used apache 2.2 syntax assume using version of apache 2.2.x, howev

command - NameError when using input() with Python 3.4 -

i new python user , have been working through number of tutorials. has included running of code command prompt. worked fine when first tested code reason seems have stopped working , getting errors when using input(). have included code below , error message receiving. code: import sys print (sys.version) print("hello world") myname = input("what name?") print(myname) if (myname == "matt"): print("matt great!") elif (myname == "bob"): print("bob ok") else: print("hello world") input("press enter continue") error message: c:\users\matt.xxxx>cd c:\python34\scripts\projects c:\python34\scripts\projects>helloworld.py 2.7.7 (default, jun 1 2014, 14:21:57) [msc v.1500 64 bit (amd64)] hello world name?matt traceback (most recent call last): file "c:\python34\scripts\projects\helloworld.py", line 6, in <module> myname = input("what name?") fil

php - Insert data into database after jQuery validation. Button only works for validation -

i insert data database after jquery validation. however, submit button works validation , won't submit data. please me thanks~ this form <form id="myform" method="post"> <label for="username">username: </label> <input type="text" class="left" id="username" name="username"> <label for="name">name: </label> <input type="text" class="left" id="name" name="name"> <label for="password">password </label> <input type="password" class="left" id="password" name="password"> <label for="repassword">password </label> <input type="password" class="left" id="repassword" name="repassword"> <label for="email">email </label> <input type="email" class="left

css - How to make acts_as_list make the added item have the top position? -

i have group of items uses acts_as_list gem. of now, when new item added, acts_as_list give item lowest position, making show last item on list. there way make acts_as_list gives newly added item position number makes show 1st rather last? don't want flip positions of other items though. thanks! new entries in list by default added bottom. can specify add_new_at option have new entries added @ top: acts_as_list scope: :object, add_new_at: :top hope helps!

mysql - PHP login code error with mysql_query() -

i've been following login system tutorial. can find here . there 2 parts of coding c# , php. c# part working fine php part returning error. here php code: <?php $servername = getenv('ip'); $username = getenv('c9_user'); $passwordp = ""; $database = "game_database"; $dbport = 3306; // create connection mysql_connect($servername, $username, $passwordp, $dbport)or die("cant connect server"); mysql_select_db($database) or die("cant connect database"); // check connection $email = $_request["email"]; $password= $_request["password"]; if (!$email || !$password){ echo"email or password must used"; } else{ $sql = "select * 'users' email = '" . $email ."'"; $result_id = @mysql_query($sql) or die("database error"); $total = mysql_num_rows($result_id); if ($total){ $datas = @mysql_fetc

python - AxisSubplot , convert display coordiantes into real coordiantes -

Image
i'm trying use axissubplot object convert display coordinates real coordinates drawing shapes onto plot. problem can't find documentation or axissubplot anywhere , see axis can't figure out on earth contained in axissubplot object. my plot coordinates displayed time x altitude, display wise set may [ ['03:42:01', 2.3] , ['03:42:06', 3.4] , ...] in display function format axis of subplot so: fig.get_xaxis().set_major_locator(mpl.dates.autodatelocator()) fig.get_xaxis().set_major_formatter(mpl.dates.dateformatter('%h:%m:%s')) now when want display polygon using example set above, how can convert date string plot cooridnates? points = [['03:42:01', 1], ['03:43:01', 2.1], ['03:21:01', 1]] polygon = plt.polygon(points) fig.add_patch(polygon) and of course gives me error valueerror: invalid literal float(): 03:42:01 . know how this? here's example of plot axis looks like: yo

ios - Retrieving data in a Core Data Relationship -

i working on project provides way collect data rooms @ specific address. have set relationship in data model between rooms , address tables. project presents uitableview of addresses user able drill down via address uitableview view rooms. this clueless. if there no rooms, custom uiview presented enter room data. user enters data in uiview each data point , presses save. ibaction save button sets value each key in related table. assuming here need establish relationship between address , rooms, cannot find proper way this. have tried nsset setwithobject in setvalue method: [newroom setvalue:[nsset setwithobject:_address] roomname.text forkey:@"roomname"]; but xcode wants me insert colon between roomname , text. ultimately want user able choose address , manage room data address, unsure how establish relationship between address , rooms. any appreciated. it sounds address room relationship 1 many: each address can have many rooms , whereas each

php - AS2 Wait to Return -

i'm working on as2 project. have function links php packets. basically, packet sent, sends information based on argument. simple, really. the issue original function needs return data. need wait packet come in order return. except cannot attach "return" function listener. function handlereturnnicknamebyid(id) { nfunctioncomplete = 0; trace("api : handlegetswidbyid"); airtower.send(airtower.play_ext, "friends#getplayerinfobyid", [id], "str", shell.getcurrentserverroomid()); airtower.addlistener('getplayerinfobyid', handlereturnnickname); while(nfunctioncomplete < 700) { if(nickready == true) { nfunctioncomplete = 701; return(nicktoreturn); } nfunctioncomplete++; } } function handlereturnnickname(obj) { airtower.removelistener('getplayerinfobyid', handlereturnnickname); obj.shift(); nicktoreturn = obj[1]; nickready = tr

composer php - How to install laravel 5 in cpanel? -

so here issue host. trying install composer on remote ssh , response host. told me not blocking side. curl -ss https://getcomposer.org/installer | php not open input file: curl: (23) failed writing body (251 != 16384) can suggest how install on remote site ? try installing composer php or wget first. 1) php -r "readfile('https://getcomposer.org/installer');" | php 2) wget https://getcomposer.org/composer.phar ref: https://stackoverflow.com/a/22458659/1348344

html - xpath finds element in developers console but not in scrapy.response -

i'm trying scrape price first ticket here page using xpath: './/*[@class="price"]/text()' this works in developer's console, not when run in scrapy shell using response.xpath. have tried following in shell: './/*[@class="initial"]/div[@class="price"]/text()' and '//*[@id="tvb901769989"]/div[1]/div[4]' (although don't think id property can used in shell this). is there wrong xpaths i've used, or there thing different way page works? appreciated. thanks! this happens because checking @ different requests, page see doesn't have information need inside file, gets dynamically, in case from: www.vividseats.com/javascript/tickets.shtml?productionid=1771684 there can check prices on json format, think 1 item: { "s":"section 111", "r":"8-22", "q":"4", "p":"692.00", "i":"vb7

webrtc - Which ICE candidate am I using and why? -

[questions in bold below] i have setup kurento media server 5.1.3 in datacenter behind firewall running os ubuntu 14.04. has 2 network cards: 222.222.222.222 (eth0 - private ip) 111.111.111.111 (eth1 - public ip) attached below sdp (setremotedescription) when browser connected kurento media server type: answer, sdp: v=0 o=- 5487318114793304426 0 in ip4 0.0.0.0 s=kurento media server c=in ip4 0.0.0.0 t=0 0 a=group:bundle audio video m=audio 59068 rtp/savpf 111 0 c=in ip4 111.111.111.111 a=rtpmap:111 opus/48000/2 a=rtpmap:0 pcmu/8000 a=sendrecv a=rtcp:59068 in ip4 111.111.111.111 a=rtcp-mux a=ssrc:669011897 cname:user39019747@host-6e83e4c2 a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=mid:audio b=as:20 a=ice-ufrag:ymdk a=ice-pwd:lylifk5ueqzpwm91ddj37e a=fingerprint:sha-256 ff:0f:81:8c:41:4e:b4:b6:c6:d8:36:f3:d6:5f:09:fd:5f:af:13:b3:9d:fc:12:66:ac:f3:56:d6:5b:0a:73:5d a=candidate:1 1 udp 2013266431 111.111.111.111 55239 typ host a=candidate:2 1 udp