Posts

Showing posts from September, 2012

jquery - Javascript: Multiple buttons, 1 class, cannot use ids. Pressing 1 button changes THEM ALL -

i hoping can please me out here. i've been struggling 3 days. :) i new wordpress-woocommerce & php, theme using not show "signs" when item added cart ajax cart. not programming, created javascript try , conquer issue. unfortunately, right if click 1 button, buttons change. i code apply button actively being clicked. the main criteria: the buttons cannot have separate ids. must use class alone buttons dynamically generated each product, , number of products-per-page unpredictable something like, "onclick="this.innerhtml='hi stack!'" cannot used think (it breaks category page) this pen of have far including html, css, , js: http://codepen.io/xkurohatox/pen/enbmkb html <a href="#" class="button add_to_cart_button product_type_simple added" onclick="birds()">add cart</a> <a href="#" class="button add_to_cart_button product_type_simple added" onclick="bird...

node.js - Updating mongodb and rendering it -

i learning mongodb , node.js , mongoose , want update mongodb , display on browser. code displays results prior update though know database has been updated. so example have 2 students called john , tom, when update third student called fred , try render results, gives me john , tom's details. here code: create: function(req, res) { console.log('creating model'); var newstud = new models.student({ surname: req.body.surname, firstname: req.body.firstname, } ); console.log('saving model'); newstud.save(); console.log('rendering model'); models.student.find({}, function(err,result){ console.log('finding results'); if (err) { throw err;} else { console.log('returning results'); res.send(result);...

AngularJS: Nested Controllers and Models -

i'm learning how use angularjs building small app. i'm little confused controllers , models. have 3 controllers, 2 of nested. <div ng-controller="controller1 ctrl1"> <div ng-controller="controller2 ctrl2"> <div ng-controller="controller3 ctrl3"> </div> </div> </div> i using different model each controller display data. of data related in 1 way or another, wondering if should using 1 model instead. , if so, should defined? for example, 1 controller might like (function() { angular .module('app') .controller('controller1', controller1); function controller1() { this.data = data; } var data = [ { name: 'data 5', }, { name: 'data 6', }, { name: 'data 7', } ]; })(); where model defined in data . other c...

message queue - Is it possible to join two password protected Disque instances? -

let's have 2 disque instances: one instance running on port 7711 ip address 12.34.567.890 , password foo. another instance running on port 7712 ip address 98.76.543.210 , password bar. i'm able connect either instance typing: ./disque -h 12.34.567.890 -p 7711 -a foo or ./disque -h 98.76.543.210 -p 7712 -a bar if want join these instances using cluster meet command, possible? i noticed smilar thread relating redis cluster . i'm hoping run disque in docker container other services on single server, i'd have keep password protected. it possible join them because inter node communication happens on ports not password protected. if use different passwords won't easy client reconnect different node in case node fails. reason, work better if use same password nodes in cluster.

ember.js - Route not working on Ember -

i'm trying learn ember following instructions guides. i've created route called favorites ( http://guides.emberjs.com/v1.13.0/concepts/naming-conventions/ ) can access url http://localhost:port/favorites . am missing something? here router.js: import ember 'ember'; import config './config/environment'; var router = ember.router.extend({ location: config.locationtype }); router.map(function() { this.route('favorites'); }); export default router; and favorites.hbs: <ul> {{#each favorites |item|}} <li>{{item.name}} - {{item.email}}</li> {{/each}} </ul> i've pushed project github repo . you missing {{outlet}} helper in application.hbs template. ember.js render favorites template {{outlet}} in application template. set instance of controller:favorites controller template.

javascript - How to clear file input without lose event listeners and expanded properties? -

i want clear file input in form i'm using angularjs , other jquery components , can't lose event listeners , expanded properties. there way without removing or using jquery replacewith or clone functions? what setting it's value property empty string? function clearfile() { document.getelementbyid("file").value = ""; } <input type="file" name="" id="file" /> <input type="button" value="clear" onclick="clearfile();" />

xml - How to make one of two optional tag dependent on the other? -

i have 2 tags in xsd: <xsd:element name="tag1" minoccurs="0"> <xsd:element name="tag2" minoccurs="0"> they both optional , can omitted. want add restriction if tag2 given, tag1 should given (as tag2 dependent on tag1). how achieve xsd? edit: there mandatory tags between them. sequence not work. e.g. <xsd:element name="tag1" minoccurs="0"> <xsd:element name="tag3" minoccurs="1"> <xsd:element name="tag4" minoccurs="1"> <xsd:element name="tag2" minoccurs="0"> here solutions: use choice this long solution repeats parts of model works if need mandatory tags between optional tags , tags not inside xs:all : <xsd:choice> <!-- choice option 1: optional tags present --> <xsd:sequence> <xsd:element name="optionaltag1"/> <xsd:element name="complul...

serialization - Django REST Framework show multiple forms on HTML view -

i have viewset using django rest framework has both standard , custom routes. serializer each route different. example: class userviewset(viewset): model = user serializer_class = userserializer @decorators.detail_route(methods=['put']) def change_password(self, request, pk, *args, **kwargs): serializer = userchangepasswordserializer(data=request.data) ... @decorators.detail_route(methods=['put']) def update_prefs(self, request, *args, **kwargs): serializer = userpreferencesserializer(data=request.data) ... i have working such can perform standard get, post, put, delete actions on user object , 2 routes work. however, can't figure out how make html forms custom routes display when using browsableapirenderer . handy developers able see forms demonstrating fields expected on above put methods, example. i tried adding methods 2 routes, non-sensical first one. regardless, don't see right serializ...

publish subscribe - How to change subscriber affiliation without owner intervention with XMPP PubSub -

i using xmpp pubsub (xep-0060). application has following requirements: users can create pubsub nodes: working fine. users can subscribe created nodes , automatically become publishers without owner intervention. in situation need on node both publisher , subscriber. the problem have after subscribe new user pubsub node, have "none" affiliation default. there no way change affiliation client application owner can change affiliations. am missing setting in xep-0060 can achieve behavior? if control client create node, can consider looking publish_model option of pubsub node. the default publish_model publishers , there other options available such subscribers , open . setting publish_model option of pubsub node subscribers should achieve need. depending on actual xmpp server using, feature may or may not available. should work ejabberd latest version configured use node type hometree .

linux - MySQL (MariaDB - 10.0.16-MariaDB-1 (Debian) strange performance issues -

i running version 10.0.16-mariadb-1 (debian gnu/linux 8.1 (jessie)) on dual xeon cpu, total 32 cores 128 gb of ram. dedicated db server , has been migrated on percona db server. configuration looks this, ################################################################################ # date: 19-01-2014 # description: mysql config # ram: 128gb ram dedicated server # connections: 1000 connections ################################################################################ [mysql] # client # port = 1979 socket = /var/run/mysqld/mysqld.sock [mysqld] ## files back_log = 300 open-files-limit = 8192 #open-files = 1024 # general # user = mysql default-storage-engine = innodb port = 1979 socket = /var/run/mysqld/mysqld.sock pid-file = /var/run/mysqld/mysql.pid # data storage # datadir ...

objective c - NSDecimalNumber unit test struggle -

this question has answer here: xctassertequal fails compare 2 string values? 2 answers i trying write unit test method doing operations on nsdecimalnumber. simplicity prepared simple unit test snippet: - (void) testtmp { nsdecimalnumber* val = [nsdecimalnumber decimalnumberwithstring:@"0"]; xctassertequal([val stringvalue], @"0"); } unfortunately fails , can't work. doing wrong? how test if nsdecimalnumber's value equals other value? xctassertequal() compares object references. should use xctassertequalobjects() . - (void) testtmp { nsdecimalnumber* val = [nsdecimalnumber decimalnumberwithstring:@"0"]; xctassertequalobjects([val stringvalue], @"0"); } btw: should not compare string representation of number, number …: - (void) testtmp { nsdecimalnumber* val = [nsdecimalnumber decimalnumb...

html - centering inline-block elements when flexbox and classic techniques don't work -

in page here: https://irfan.io i have tried centring smaller circles every-way can think of , either don't centred or centring not responsive-- meaning fails when viewport changed. they of class .small , children of #main. i have tried flexbox: #main{ display:flex; align-items:center; justify-content:center; } .small{ display:flex; } i have tried giving wrapping .small elements in container , giving fixed width , centring -0.5 of width: #smallcontainer{ width:500px; margin-left:-250px; position:relative; left:50%; } i figured since inline-block elements use text-align:center; on .small element, didn't work. #small{ text-align:center; } i can't seem figure out how centre 3 small circles middle 1 in vertical-middle bigger circle ( .big ), centred using 2nd technique. does have ideas on how this? you can try this: html: <div id="main"> <div id="smallcontainer"> ...

svn update VS git merge -

svn update command automatically resolves conflicts if 2 developers have modified same files. if appended line @ bottom while collegue inserted line in middle. when try update remote repository, change still @ bottom updated file. how can handled in git? everytime merge, have conflicts because of simple changes multiple developers on same files. svn , git apply incoming changes in same way: non-overlapping changes (local , remote) applied without conflict, overlapping changes produce merge-conflicts. both tools calculate context-aware chunks of changes . not examine text single-lines. if width of context in git bigger of svn (default svn 3 lines), you'll different results same sources. otherwise merging in git , svn should give same results.

objective c - Non-screenview events with Google Tag Manager on iOS -

Image
we're trying use gtm on ios track non-screenview events using data layer , cannot work. first, here's our call gtm: nslog(@"voted!"); nslog(@"question: %@, answer: %@",self.question.question,selectedanswer.answer); [[atitracking instance] trackeventwithtagmanager:@"didvote" parameters:@{@"questionvalue":self.question.question,@"votevalue":selectedanswer.answer}]; we have 2 data layer variables set in gtm questionvalue , votevalue. see: https://www.dropbox.com/s/jru5a06vs1bfmm3/variables.jpg?dl=0 and here's our trigger event set didvote: https://www.dropbox.com/s/0ydxml4yemji2f5/trigger.jpg?dl=0 and our event tag uses trigger above (cannot post link due rep limit.) has seen non-screenview event tracked in ios using gtm? in advance. events working me no problems. modified code gtm ios sdk example -(void) logevent:(nsstring*) event withproperties:(nsdictionary*) properties { nsmutabledictionary* eve...

c++ - Error: error MSB8020: The builds tools for v120 (Platform Toolset = 'v120') cannot be found -

i have both vs 2012 , 2013 installed in computer , projects need 2012 version. using msbulid in shell command have following error: c:\program files (x86)\msbuild\microsoft.cpp\v4.0\v110\microsoft.cpp.platform.targets(44,5): error msb8020: builds tools v120 (platform toolset = 'v120') cannot found would please let me know how change msbuild option use vs 2013? please not ask me uninstall vs 2012 version, because crucial other projects.

svg - Snapsvg - get height and width of text element -

i altering elements contents using svgtextlines[name].node.innerhtml = line.val(); svgtextlines[name].node.textcontent = line.val(); and trying height , width of element after content has changed cant seem find property in elemement.node object gets updated. element has not transformed can understand why there way can information? regards i'm using snapsvg , had same problem. can use getboundingclientrect object parameter. var s = snap("#svg"); snap.load("mascot.svg", function (f) { s.append(f); var rect = s.searchall("g")[0]; var dimens = rect.node.getboundingclientrect(); console.log(dimens.width) });

mysql - Database design for a tv series app -

i'm developing web application tv shows. , need database design. i made list of need, can't figure out how design it. have basic tables. series, episodes, seasons etc. can't how relate people episodes/series. here list: there should multiple people type. actor/director/writer/guest etc. i don't think creating seperate table each type idea. there should 1 people table. , need store type somewhere. a person may in 1 or many series. this can done people_serie table foreign keys people , series tables. need way relate person episodes too. an actor may play 1 or many roles. this can done person_role table. this getting complicating. a role may in 1 or many episodes in serie. a person may belong more 1 type in serie. ex: actor , director i hope make clear problem is. well, you're correct not split people table. the first thing add roles table, contain role id , role title (each column should unique - don't want 2 differen...

angularjs - Unknown syntax [[:Book:{{{Pages}}}|Pages]] and the purpose thereof -

i saw expression, looks angularjs expression on web site , i've been trying find out purpose of is, trying replicate in ng, doesn't seem anything. the syntax similar to: [[:book:{{{pages}}}|pages]] has seen syntax , know represents?

mono - C# Duplicati Interface restore single file -

i'm trying use duplicati api restore single file. about scenario: whole thing runs on linux compiled mono. backup contains 2 source folders, if run interface.listsourcefolders() array of two. desired result: want restore 1 single file (or folder) backup current result: if run code below restores backed files (so folder 1 , folder 2) path in //comment1 . list<string> files = new list<string>(); files.add("path"); //comment1 dictionary<string,string> options = new dictionary<string,string>(); options["passphrase"] = mysettings.password; options["restore-time"] = date; //comment2 interface = new interface("file:///path/to/archives", options); string result = i.restore(files.toarray()); what tried: tried set path @ //comment1 absolute path ( /desired/file/to/restore ) or using index of source folder ( 0/file/to/restore ) , played around @ //comment2 . e.g. added options["restore-path"] = ...

Get reference to some class field via reflection in C# -

class mapper { list<int> l; static dictionary<string, string> legend = new dictionary<string, string>(){{"list1", "my_fancyugly_n4medlst777"}} public mapper(mainwindow w) { l = w.(legend["list1"]); //how refference? } } in other words, want refference field (or method, property etc) name don't know until runtime. know can value of field, that's not want. possible , how that? you can use fieldinfo fi = typeof(mainwindow).getfield("fieldname"); fieldinfo object. call fi.getvalue(w); value. same principle applies sorts of members , operations on them. this slow @ runtime , makes harder catch errors @ compile time, make sure have reason use reflection here!

java - Why won't my fishes turn around? -

i'm having trouble moving fishes place , turn around when reach right or left edge. window 600 x 400. in method void swim(); , whatever change fish goes same spot (the fish past right edge of window). how can move fish , when reaches right edge or left , turn around , move left edge of window? note: using gwindow , class provided school. import java.awt.color; import java.util.random; import uwcse.graphics.*; /** * fish in graphics window */ public class fish { public static final int left_moving = 0; public static final int right_moving = 0; // graphics window fish belongs private gwindow window; // location of fish private int x; private int y; // scale of drawing of fish private double scale; private color color; private int direction; private oval o1; oval o2; private triangle tail1; triangle tail2; private line eye1; line eye2; /** * draws fish in graphics window * * @param x ...

Excel - How to sum all hours that match one condition in another plan? -

Image
i trying worksheet save work-logs. by now, problem: i have these 2 plans: my table in activities-plan : and trying in results-plan : how sum [@[total (hours)]] where [@[year-month]] matches [@[year-month]] of both plans ? thanks in advance. edit the results based on @amit answer: new test: the results: use formula cell: =sumif(table1[year-month],[@[year-month]],table1[total (hours)])

php - Using database class with PDO -

the classic first liner - have seen similar questions on none me understand crossroads at. a little background before code - not new php or pdo (though not expert either), complete newbie object oriented php , trying balance right of when use classes , when possibly overkill. the answer i'm hoping in 2 parts. firstly, practice create wrapper database class when using pdo - connection, basic queries etc. secondly, if not - there better ways speed query writing? edit whilst questioning code below, question pdo wrapper class approach overall - class below larger this, there need/benefit? see following code; note : class file called via spl_autoload_register() in config.php class_database.php class database { private $conn; public function __construct() { $this->openconnection(); } public function openconnection() { try { $this->conn = new pdo('mysql:host=' . db_server . '; dbname=' . db_name, db_use...

html - DIV tag not following height -

i have header, made of image on left, , text on right. text made of 2 parts: line 1 (top) , line 2 (bottom). both of these need occupy 50% of height of header. height has no set height, not changing. code: http://jsfiddle.net/olivermurfett/pamkeov5/ perhaps adding height: auto; might help. update 1: illisation of desired outcome: header http://www.shckyneton.catholic.edu.au/_sharedimg/header.jpg is trying do: #header-text-container { float: left; height: 100%; min-height: 100%; width: 90%; } #text-sacred-heart-college { float:left; font-size: 25px; } #text-a-vibrant-life { float:right; font-size: 20px; } #text-kyneton { width: 100%; float: left; } here jsfiddle demo

c - Same address for static variable but different for local variable -

i trying learn operating systems. @ present in virtual addressing. book says if have 1 static variable , 1 local variable , update them , sleep time , try print addresses across multiple such processes running 1 same memory address. this because each process feel has whole memory , has no control of physical memory address remain same among various process running @ same time. understand when run program getting same address across static variables different across local variables. little operating systems knowledge not able understand why happening. code int staticvar = 0; int main(int argc, char const *argv[]) { int localvar = 0; staticvar += 1; localvar += 1; sleep(10); printf("static address: %x, value: %d\n", &staticvar, staticvar ); printf("static address: %x, value: %d\n", &localvar, localvar ); return 0; } this output when run 3 different processes simultaneously. ./a.out static address: 60104c, value: 1 static address: ...

rest - Capture HTTP response & Header in Loadrunner -

we using rest in our apis. trying capture http response , http response header data in hp loadrunner perform load test. kindly tell how can acheived ? regards amit please take @ this blog post

Convert a ruby nested hash in array of hashes -

i'm trying flat nested hash. hash has structure: { "errordescription":"", "message":"", "resultcode":"ok", "resultobj":{ "categorylist":[ { "asnew":"n", "categoryid":40000000, "categorylist":[ { "asnew":"n", "categoryid":40000007, "categorylist":[ ], "categoryname":"catalogo", "categorytype":"type_node", "contentid":40000007, "contenttitle":"catalogo", "contenttype":"category_node", "orderid":0, "urlpictures":"" ...

android - Initializing Camera with a button results in blank screen, initializing in onCreate works fine -

i working on app needs control camera, i've run issue when try initialize it. if call function safeopencamera() inside oncreate() works fine , can see camera preview. if try call when press button, area preview should goes blank. in both cases "camera started" gets logged, , no exceptions. i've tried figure out few days can't find cause. need activate button user can choose camera use and, hopefully, swap them while app running. main activity: public class mainactivity extends actionbaractivity { private camera mcamera; private camerapreview mpreview; private view mcameraview; private button ulbutton; private int current_camera=1; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); ulbutton= (button) findviewbyid(r.id.ul_button); ulbutton.setonclicklistener(new view.onclicklistener() { ...

How to select individual rows from duplicates based on the highest median in R? -

i have dataframe containing gene expression data looks following: row.names symbol sample1 sample2 sample3 sample4 probe1 gene1 1.5 2.8 1.8 3.2 probe2 gene2 2.7 4.5 3.2 5.1 probe3 gene3 1.1 4.7 2.3 5.3 probe4 gene2 1.2 0.9 0.8 1.1 probe5 gene1 3.1 6.1 6.2 4.2 i want subset data unique genes remain, , in each case probe highest median retained i.e. data above become following: row.names symbol sample1 sample2 sample3 sample4 probe2 gene2 2.7 4.5 3.2 5.1 probe3 gene3 1.1 4.7 2.3 5.3 probe5 gene1 3.1 6.1 6.2 4.2 the dataframe has ~40,000 individual probes , ~100 samples. does have idea commands in r suitable task? i wouldn't calculate media...

Delphi XE8: TEdit TextHint Disappears When Receiving Focus -

basically, want texthint of tedits disappear when first character entered , not when receive focus, edits on microsoft page: sign in microsoft account . can please walk me through on how achieve this? thank in advance. based on uwe raabe's answer, here procedure (for delphi 2007, should work newer versions of delphi well): type tcuebannerhideenum = (cbhhideonfocus, cbhhideontext); procedure tedit_setcuebanner(_ed: tedit; const _s: widestring; _whentohide: tcuebannerhideenum = cbhhideonfocus); const em_setcuebanner = $1501; var wparam: integer; begin case _whentohide of cbhhideontext: wparam := 1; else // cbhhideonfocus: ; wparam := 0; end; sendmessage(_ed.handle, em_setcuebanner, wparam, integer(pwidechar(_s))); end; you call this: constructor tform1.create(_owner: tcomponent); begin inherited; tedit_setcuebanner(ed_hideonfocus, 'hide on focus', cbhhideonfocus); tedit_setcuebanner(ed_hideontext, 'hide on text', cb...

MSBuild property set in target is not visible in parent target -

here targets file <?xml version="1.0" encoding="utf-8"?> <project defaulttargets="buildapp" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" toolsversion="12.0"> <propertygroup> <testinitresult>false</testinitresult> </propertygroup> <target name="buildapp"> <calltarget targets="testinit" continueonerror="true"/> <message importance="high" text="2 value of flag: $(testinitresult)"/> <calltarget targets="target2" /> <calltarget targets="runbuild" condition="'$(testinitresult)'=='true'"/> </target> <target name="testinit"> <propertygroup> <testinitresult>true</testinitresult> </propertygroup> <message importance="high" text="1 value of flag: $(testinitresult)"/> </ta...

Using Global Contrast Normalization - Python pylearn2 -

im attempting input image method, when try draw image, comes totally black. i tried inputing 1 image , inputing whole mnist dataset. same result. https://github.com/lisa-lab/pylearn2/blob/master/pylearn2/expr/preprocessing.py if gcn true: trainingfolder = "../inputdata/converted_training/gcn/" testingfolder = "../inputdata/converted_testing/gcn/" img0 = (data[1,1:]).reshape((28,28)).astype('uint8')*255 im = image.fromarray(img0) im.show() #gcn# img_gcn = global_contrast_normalize(data) img_gcn_1 = image.fromarray(img_gcn[1,1:].reshape((28,28)).astype('uint8')*255) img_gcn_1.show() the second image, img_gcn_1 comes blacked. what doing wrong? have tried visualize image without multiplying 255? i.e., import matplotlib.pyplot plt img = img_gcn[:, 0] img = img.reshape(28, 28, order='f') plt.imshow(img, cmap=plt.get_cmap('gray')) i think procedure should work.

java - text from url, but it gets copied 3 to 4 times -

when execute code, raw data website getting written, gets written 3-4 times same content..i not sure how resolve this..can me out.. i use jsoup.. public static void main(string a[]) { try { //url url=new url("https://in.yahoo.com/?p=us"); document doc = jsoup.connect("http://www.businessinsider.in/").get(); elements contents = doc.select("div") ; printwriter out = new printwriter(new filewriter("e:/outputtext.txt")); for(element p : contents) { out.print(p.text()); } catch(exception e) { e.printstacktrace(); } } content website gets saved in .txt file, content gets copied 3-4 times in same file... with selector doc.select("div") pick div elements of document, ones inside other div elements, resulting in duplication. maybe should differentiate , select ones need. if want full content, not need jsoup parser @ all. still can use jsoup net access,...

javascript - remove dash in phone number within razor -

i need call javascript method , using razor print parameters... getnumber(@html.displayfor(model => model.phone1)"> however, javascript treats dash in phone number subtraction operator. i tried regular expression remove dash, can't figure out right syntax. still performs subtraction operation , gives me javascript error [subtration result].replace not function getnumber((@html.displayfor(model => model.phone1)).replace(/[^0-9.]/g, ''))"> you should treat phone numbers strings, make sure javascript knows number string enclosing in quotes: getnumber('@html.displayfor(model => model.phone1') this should rendered this: getnumber('1-800-call-me')

c# - How to know what host is being called -

i have web app in c# , want redirect app depending on host being called on site... example if call www.domain.com want app redirected folder called site1 if call www2.domain.com want app redirected site2. these example names.. it's same site different operations. dns stuff being taken care of, no worries. must www , ww2 pointing same server ip address. thanks lot guys.. (sorry if title not clear, didn't knew how ask question properly) your code should inspect httpcontext.current.request.url.host . example: string host = httpcontext.current.request.url.host switch (host.tolower()) { case "www.domain.com": httpcontext.current.response.redirect("~/site1"); break; case "www2.domain.com": httpcontext.current.response.redirect("~/site2"); break; default: httpcontext.current.response.statuscode = 500; }

jquery - CSS transitions and javascript -

here's situation: i've got hidden popup, want show on click javascript , animate css transition. what i've noticed if popup handler looks 1 below has no transition - flashes in immediately. $('.popup-link').on('click', function(){ $('.popup').show().addclass('popup-visible'); }); but if add timeout - doesnt matter 1 ms or 1000 ms it's good. $('.popup-link').on('click', function(){ $('.popup').show(); /* if don't use timeout has no transition */ window.settimeout(function(){ $('.popup').addclass('popup-visible'); },1) }); jsfiddle link here: https://jsfiddle.net/ueggj9hu/ so i've got 2 questions here: why happening , okay use method or there cleaner way? edit: don't take jquery animate function 'cleaner' way because slower css animation. fiddle url: https://jsfiddle.net/ueggj9hu/1/ this work (without need of timer fun...

php - Undefined index errors -

when run code on browser, error message saying there undefined index. i've spent couple hours trying work don't know why keep getting same exact error. <?php if ($dbsuccess) { $companyid = $_post['id']; $prename = $_post['prename']; $companyname = $_post['name']; $regtype = $_post['regtype']; $streeta = $_post['streeta']; $streetb = $_post['streetb']; $streetc = $_post['streetc']; $town = $_post['town']; $county = $_post['county']; $postcode = $_post['postcode']; $country = $_post['country']; } $tcompany_sqlupdate = "update tcompany set "; $tcompany_sqlupdate .= "prename = ".$prename.", "; $tcompany_sqlupdate .= "name = ".$companyname.", "; $tcompany_sqlupdate .= "regtype = ".$regtype.", "; $tcompany_sqlupdate .= "streeta = ".$streeta.", "; $tcompany_sqlupdate .= "streetb = ".$stre...

javascript - Cordova app crashes with Dialog onPause -

i have built cordova app org.apache.cordova.dialogs plugin installed. after starting (ondeviceready) show dialog using navigator.notification.alert\prompt . then if press home button return home screen following error: the app crashes: unable add window — token android.os.binderproxy not valid; activity running? how can overcome this? have done research on topic found no ideas on how implement using cordova.

c++ - Makefile does not find object file -

i want object files created in subdirectory , not makefile lives. so, saw answer , couldn't apply case, tried this: objs = main.o io.o alloc.o communication.o objsdir = obj source = main.cpp src/io.cpp src/alloc.cpp src/communication.cpp header = headers/io.h headers/alloc.h headers/communication.h out = test cxx = ../../mpich-install/bin/mpic++ cxxflags = -i../../intel/mkl/include -wl,--start-group -wl,--end-group -lpthread -lm -ldl -wall ldflags = ../../intel/mkl/lib/intel64/libmkl_scalapack_lp64.a -wl,--start-group ../../intel/mkl/lib/intel64/libmkl_intel_lp64.a ../../intel/mkl/lib/intel64/libmkl_core.a ../../intel/mkl/lib/intel64/libmkl_sequential.a -wl,--end-group ../../intel/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm -ldl all: $(objsdir) $(out) $(objsdir): mkdir $(objsdir) $(out): $(objs) $(cxx) $(objs) -o $(out) $(cxxflags) $(ldflags) # make ...