Posts

python - django-nonrel for AppEngine on Windows -

i'm having trouble should relatively simply- getting django-nonrel project off ground on windows machine. have downloaded , unzipped required files http://djangoappengine.readthedocs.org/en/latest/installation.html , added required modules projects root folder c:\djangoapp, such folder hierarchy (note each module contains correct files, , have been omitted sake of brevity) djangoapp/ autoload/ dbindexer/ django/ djangoappengine/ djangotoolbox/ now when cd c:\djangoapp, need know command run. given command: pythonpath=. python django/bin/django-admin.py startproject \ --name=app.yaml --template=djangoappengine/conf/project_template myapp . is *nix os , won't work on windows. doing, python django/bin/django-admin.py startproject \ --name=app.yaml --template=djangoappengine/conf/project_template myapp returns error: traceback (most recent call last): file "django/bin/django-admin.py", line 2, in <module> django.core impo...

send and receive a file in python sockets -

this has part been answered here have been trying modify server (to send) , client (to receive) feedback server upon receipt of entire file. below client server code; presently both client , server hang. ie. indefintely go "busy" state (both client , server nothing, until ctrl-c on server reports failure here "l = sc.recv(1024)" , ctrl-c on client reports failure here "reply =s.recv(1024)") import socket import sys s = socket.socket() s.bind(("localhost",3000)) s.listen(10) i=1 while true: sc, address = s.accept() print address f = open('tranmit.jpg",'wb') #open in binary l = 1 while(l): l = sc.recv(1024) while (l): f.write(l) l = sc.recv(1024) f.close() sc.send("received") # send response sc.close() s.close() ------------------------------------------------------------ #client s = socket.socket() s.connect(("localhost"...

ios - Populate a UITableView with videos in my Vimeo account -

how can populate uitableview videos in vimeo account using swift? i haven't tried yet since don't know start. start looking through documentation: vimnetworking sample app code can found here: pegasus after authenticate , connect, make api call grab videos, display them json response uitableview. (there plenty of tutorials on how populate uitableview json response (etc)...

Weird Function Object Behavior in Scala - Mutable Function Variables are Resetting -

this functor represents act of moving associated (mutable) x-position , y-position: final class moving(var xpos: int, var ypos: int) extends function2[int, int, unit] { override def apply(dx: int, dy: int): unit = { xpos += dx ypos += dy println("xpos: " + xpos + " ypos: " + ypos) } } the problem not behave expected. when run code: def move = new moving(0, 0) def main(args: array[string]) { move.apply(1,1) move.apply(2,2) move.apply(3,3) } i output: xpos: 1 ypos: 1 xpos: 2 ypos: 2 xpos: 3 ypos: 3 the x-position , y-position appear going initial value before being modified. want output this: xpos: 1 ypos: 1 xpos: 3 ypos: 3 xpos: 6 ypos: 6 why isn't function behaving expected? * solution * val motion = new moving(0, 0) def move = motion // returns function object def main(args: array[string]) { move.apply(1,1) move.apply(2,2) move.apply(3,3) } it's because declare move ...

r - ggplot2: Save individual facet_wrap facets as separate plot objects -

Image
i big fan of facet_wrap . though fast split big data frame , plot several plots , explore within r, it's not best tool presenting in paper or power point. find myself wasting lot of time scales, binwidths , font sizes , modifying on inkscape plot. sometimes subset data frame many data frames , plot individually each one. later join them multiplot or hand. i wondering if there might way of making ggplot call in same way (one big df factor column used faceting) or way make ggplot read list-like data frame separated faceting factor. ideal output should multiple single plots i'll edit later on inkscape (and use free_y scales make less painful) to clear, df<-mtcars ggplot(df,aes(df$mpg,df$disp,color=factor(cyl)))+ geom_point(aes(df$mpg,df$disp))+ facet_wrap( ~cyl) produces 1 plot. desired output in case 3 plots, 1 each facet. you can use lapply create list 1 plot each value of cyl : # create separate plot each value of cyl, , store each plot in...

javascript - Parsing JSON array into Google Charts DataTable -

i've done quite bit of searching , have found solutions issues similar problem nothing has worked far. appreciated. i attempting create google line chart data querying database , parsing json. query , json looks when insert datatable web page blank. this json output have: [["date","percentage"],["0000-00-00 00:00:00",28.18],["2015-01-06 06:00:01",93.65],["2015-01-07 06:00:01",85.9],["2015-01-08 06:08:43",89.25],["2015-01-09 06:08:42",99.26],["2015-01-10 14:50:37",99.48],["2015-02-06 06:00:01",93.88],["2015-02-07 06:00:01",89.15],["2015-02-08 06:08:51",89.55],["2015-02-09 06:09:25",98.94],["2015-02-09 17:26:50",98.94],["2015-02-10 06:10:55",99.06],["2015-03-07 06:11:32",85.7],["2015-03-08 06:07:58",89.86],["2015-03-10 06:11:04",99.06],["2015-04-06 14:19:26",82.17],["2015-04-07 06:11:47"...

jquery - Javascript array elements not being displayed in div tag -

i've created program reads json data concert event. json file has 1 object named global has band name , venue. there tickets object containing of available tickets concert, getting ticket price, section, , row (for seats). when using console.log() print out specific attributes parsed json, getting correct output. have function reads parsedjson object different arrays (one ticketinfo , general event info). in function, use jquery functionality add contents of arrays div on page, nothing being displayed when page loads. i'm new jquery have simple mistake causing problem can tell code wrong? the relevant code below: <div id="container"> container div </div> <script> var concertdata = {}; var eventinfo = {}; var ticketinfo = {}; function makeinvite() { var metainfo = concertdata['global'][0]; eventinfo['venue'] = metainfo['maptitle']; eventinfo['band'] = metainfo['productionname']; (var...