Posts

javascript - kendo UI Uncaught TypeError: e.bind is not a function -

i using kendo mvvm , kendo observable extend object bind data ajax call. in object setting data property in ajax call after ajax call has succeeded. can data bind , show up. but, in console, error "uncaught typeerror: e.bind not function". have looked everywhere see if has experienced issue before or might know might triggers error, no luck... here of javascript code: (function (global) { kendo.data.observableobject.extend({ serviceplans : "", getserviceplans: function () { var = this; $.ajax({ url: 'services-data.json', type: 'get', datatype: 'json', error: function(response){ console.log('error') }, success: function(response){ that.set("serviceplans", response.splans); } }); } app.servicesplansdata = { viewmodel:...

actionscript 3 - Custom Event Listener not working -

i new as3 , saw creation of custom events in as3 in tutorial , wanted incorporate in game. when did tutorial, seemed project. doesnt seem work new project. here code : package { import flash.display.movieclip; import flash.utils.timer; import flash.events.timerevent; public class fashionfrenzy extends movieclip { public var buyer_mc:buyer; public var buyers:array; public var gametimer:timer; public function fashionfrenzy() { gametimecontroller(); generatebuyers(); addeventlistener(reachmalldoorevent.check, onreachmalldoor); } public function gametimecontroller() { gametimer = new timer( 25 ); gametimer.start(); } public function generatebuyers() { buyers = new array ; buyer_mc = new buyer(533.2,0) ; addchild(buyer_mc); gametimer.addeventlistener( timerevent.timer, buyerenter ); if(buyer_mc.y==377.25) { dispatchevent( new reachmalldoorevent( reach...

How do you access assets in a Pakyow app on heroku? -

problem: pakyow app deployed heroku , js , css sourced/linked in template head 404. i assume problem stemming heroku, rather not 1 aware of. far know, heroku allows static assets in public directory. anyway, looking helpful pointers pakyow users. the app (currently) @ http://pakyow-go.herokuapp.com , repo can found @ http://github.com/jphager2/pakyow-go . this unfortunate default config option in released version. around it, add production configuration block in app.rb : app.static = true the reason works way out of box in production cases don't want app serving static files. instead responsibility of http server. on heroku though, want app server serve static files unless host them cdn.

javascript - How come I cant add code after changing the css of button with jquery? -

function test() { //allows code here $("#h1").css("background-color", "yellow").replace("px", "") * 2; //denys code here } below im trying archieve: function test() { $("#h1").css("background-color", "yellow").replace("px", "") * 2; $("#h2").css("background-color", "black").replace("px", "") * 2; } any or input how deal highly appreciated, thanks! edit: got here border-left-width returns nan in jquery create code change $("#h1").css("background-color", "yellow").replace("px", "") * 2; $("#h2").css("background-color", "black").replace("px", "") * 2; to $("#h1").css("background-color", "yellow"); $("#h2").css("background-color", "black"); you repl...

primary key - MySQL update an AUTO_INCREMENT pk to preserve row ordering -

i have table 3 columns: id , foreign_id , , tag . queries on table ordered first foreign_id , tag , want deprecate tag column in favor of more reliable , auto-generated id . in doing so, need preserve ordering data stored in tag column without keeping tag around. ordering makes sense within scope of foreign_id column. to solve problem, we've decided update id s within scope of each foreign_id such order of ids preserves tag order information. how 1 update auto_increment primary key column such gets assigned next value in counter without changing rest of row? alternatively, how 1 copy entire row (minus pk) new row , delete old row? select max(id) @maxid the_table; update the_table set id = id + @maxid; set @i := 0; update the_table set id = (@i := @i + 1) order foreign_id, tag; i not 100% positive work; don't kind of things update statements. alternatively, replace last update with: insert the_table(id, foreign_id, tag) select (@i := @i + 1) `new_i...

c - Unnamed semaphore POSIX IPC -

i allocated shared memory segment of size of integer. the expected outcome on stdout should be: p: 1 c: 2 but instead is: c: 1 p: 2 why child process not being blocked until parent done , has unlocked shared memory segment? #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/ipc.h> #include <sys/shm.h> #include <sys/wait.h> #include <unistd.h> #include <semaphore.h> #define shmsegsize sizeof(int) int main(void){ pid_t pid; int shmid; int *shared_mem; /* initializing shared memory */ shmid = shmget(ipc_private, shmsegsize, ipc_creat | 0644); shared_mem = (int *)shmat(shmid, 0, 0); *shared_mem = 0; /* initializing semaphore */ sem_t sem; int pshared = 1; // !=0 processes, =0 threads int value = 1; // number of processes @ time sem_init(&sem, pshared, value); // initialize semaphore pid = fork(); if(pid>(pid_t)0){ // parent sem_wait(&...

javascript - Save an array of objects in mongoDB and escape double quotes -

i trying save array of objects node mongodb . i use: _id: objectid(request.body.connectionid) }, { $set: { status: accepted, networks: connectedprofiles } but @ mongodb record get: "networks": "\"(\\n {\\n netowrk = twitter;\\n \\\"profile_name\\\" = primary;\\n }\\n)\"" any idea why escape quotes? thanks responses. fixed issue stringify request before sending node js, , after parse it. solved problem.