Posts

python - Stopping ipcluster engines (IPython Parallel) -

how stop engines have been started with: ipcluster engines --n=8 --daemonize the running processes like: /usr/bin/python /usr/local/bin/ipcluster engines --n=8 --daemonize /usr/bin/python -m ipython.parallel.engine --profile-dir /home/ubuntu/.ipython/profile_default --cluster-id --log-to-file --log-level=20 i not want run killall python . from client, can call shutdown : import ipython.parallel ipp rc = ipp.client() # shutdown specific engines rc.shutdown([1, 5]) # shutdown engines: rc.shutdown() # shutdown everything, including hub rc.shutdown(hub=true)

model view controller - Trying to Delete Message from List with Rails -

so have simple list of messages users can submit. i'm trying put delete button (that works) each message. can see here error entirely different action if click button. i'm not totally sure went wrong. guess i'm out of depth in controller area. here applicable files. routes.rb: rails.application.routes.draw root 'messages#index', as: :home '/new' => 'messages#new', as: :edit resources :messages post '/new' => 'messages#create', as: :create delete 'messages/:id' => 'messages#destroy', as: :delete the relevant controller: class messagescontroller < applicationcontroller def index @messages=message.all end def new @messages=message.new end def destroy @messages=message.find(params[:id]) @messages.destroy end def create @messages = message.new(message_params) if @messages.save redirect_to '/' ...

Azure Mobile Service requires authentication for SignalR HTML/Javascript Client -

i have fresh azure mobile service running locally @ localhost:52253. installed latest signalr nuget package: azure mobile services .net backend signalr extension 1.0.450 i have test html/javascript client served localhost:54697/ after working out cors issues, still cannot connect signalr hubs because negotiation requests signalr javascript client mobile service @ localhost:52232/signalr/negotiate result in http/1.1 401 unauthorized. i have not enabled authentication on server, default. confirmed webapi controller works without authentication. i've tried decorating hub , hub methods with: [authorizelevel(authorizationlevel.anonymous)] public class chathub : hub { public apiservices services { get; set; } [authorizelevel(authorizationlevel.anonymous)] public string send(string message) { return "hello signalr chat hub!"; } } the exact request via fiddler is: http://localhost:52253/signalr/negotiate?clientprotocol=1.4&connect...

php - Zend Framework 2 Application inside Zend Framework 1 Application and Session Sharing -

before explaining situation, here small briefing of system running , overall experience web programming: development environment: ubuntu server 4.14 64-bit, apache 2, php , mysql database. experience: not have experience php, main language using current project (it has been 3 years since last worked web programming; these last few years focus on development of desktop apps). i developing new website company , of application code ready. application developed in zend framework 2 (php) + doctrine 2. few aspects missing, are: 1 - client has website works educational social network focused on providing platform students , teachers interact , share knowledge , ideas. work related development of new interface defined 'relational-modular interface' consisting in new way of displaying information users of platform. website client has developed in zend framework 1, , need new application coexist old application in same domain. far good. the question is: these frameworks have ...

javascript - unable to print parameters from url -

i'm trying read 4 parameters js request django app. how i'm doing js request: site = "http://127.0.0.1:8000/products/loginfo/" + account + "?userid=" + userid + "&sessionid=" + sessionid + "&url=" + url; httpget(site); this url in urls.py: url(r'^loginfo/(?p<siteid>[0-9])/(?p<userdid>)/(?p<sessionid>)/(?p<url>)/$', 'log_info', name='log_info'), and view in views.py: def log_info(request,siteid,userdid,sessionid,url): print 'siteid' + str(siteid) print 'userid ' + str(userid) print 'sessionid ' + str(sessionid) print 'url ' + str(url) return render_to_response("products/all.html", locals(), context_instance=requestcontext(request)) but, i'm nothing being printed on terminal, what's wrong? the problem url pattern in url.py doesn't match url entered. you can use request.get dictionary directly read que...

haskell - How to parse a tree-like structure using PArrows? -

i'm trying learn arrows, how parrows can replace parsec, there nonexistent number of tutorials. believe benefit lot simple examples, so, given binary tree: data tree = node tree tree | | b deriving show how can parrow used parse string similar to: "((a b) (a (b a)))" so becomes: node (node b) (node (node b a)) this not cleanest answer, managed with: import text.parsercombinators.parrow import control.arrow data tree = node tree tree | | b deriving show text = "((b a) (a b))" fromtoken :: char -> tree fromtoken 'a' = fromtoken 'b' = b token = anyof "ab" >>> arr fromtoken node = arr (uncurry node) <<< ((char '(' >>> token <+> node) -- left side >>! white -- whitespace &&& ((token <+> node) >>! char ')')) -- right side main = print $ runparser node text mind i'm still working on ar...

Storing a lambda function in the Google App Engine Datastore (python 2.7) -

i creating bunch of foo objects in gae. i want each foo have function called fooify(). calling fooify(object) should return object, transformed in way. for example, fooify([2,3]) might return: [1,2] (fooify = lambda x: [n-1 n in x]) [2,3] (fooify = lambda x: x) [2,4] (fooify = lambda x: [x[0],x[1]+1]) i want able define fooify when create objects, preferably like: foo1=foo() foo1.fooify=lambda x: [n^2 n in x] foo1.put() the foo class looks like: from google.appengine.ext import ndb class foo(ndb.model): name=ndb.stringproperty(default="generic foo", indexed=true) fooify=ndb.somethingproperty(indexed=false) # contains function i know isn't datastore made for, still it. option can see following: class foo(ndb.model): name=ndb.stringproperty(default="generic foo", indexed=true) fooify_str=ndb.stringproperty(indexed=false) # contains "lambda x: [n+3 n in x]" def fooify(self,obj): func = eval(self...