Posts

plot - R: Graphing a table plan -

Image
general goal i placing guests around tables according set of rules. goal, in post, have handy function display names of these guests around respective tables on r graphic. input data guests describes position of each guest @ each table. note number of guests per table varies. guests = list( table_1 = c("jack", "christelle", "frank", "john s.", "lucia"), table_2 = c("george", "amanda", "alice", "laura", "john h."), table_3 = c("jeanette", "elizabeth", "remi", "fabian", "urs", "emma"), table_5 = c("roger", "marry", "henrique", "claire", "julia"), table_6 = c("alphonse", "marie", "dani", "rachel") ) table_positions indicate each table should positioned on graph. assume here each axis goes 0 10, point c(5,5) @ c...

How to Strip Time from Date Time and store in PSQL using Python? -

i have situation want strip time date time object , store in database (psql precisely) how do ? >>> print(datetime.now()) 2016-06-28 16:22:30.918715 what want 2016-06-28 and store psql database what best way handle ? i posting answer cause took me around hour find answer , hope helps someone. best solution of have found dt = datetime.today() 2016-06-28 16:22:30.918715 dt.strftime('%y-%m-%d') 2016-06-28 basically psql stores data in type string code dt.strftime('%y-%m-%d') strip off time , return string data type , can store it.

c# - How to connect the socket.io with backend -

i trying implement chat in ionic project have tried far connect socket.io backend (c#) below. here index.html <script src="http://192.xxx.x.xxx:8888/socket.io/socket.io.js"></script> and here created socketservice.js file looks var example = angular.module('starter.socketservice',[]) example.service('socketservice',function(socketfactory){ console.log("socketservice"); return socketfactory({ iosocket: io.connect('http://192.xxx.x.xxx:8888') }); console.log(socketfactory); }) finaly created folder called server have chat-server.js file in there. var io = require('socket.io')(8888); console.log(io); io.on('connection', function(socket){ console.log(socket); socket.on('send:message', function(msg){ console.log(msg); socket.emit('message', msg); console.log("succes...

recursion - Find all possible unique path in mXn matrix -

help me in finding possible path reach bottom right cell top left cell in mxn matrix. below restrictions, can not visit cell visited. should visit cell before reaching exit i.e. bottom right cell. tried few logic's not able paths. thanks the simplest idea recursively try every possible non-self-crossing path, , every time such path hits bottom-right corner check whether it's length equals number of cells. here comes naive [and slow , memory-consuming] implementation in js (judging profile know js), point algorithm in formal, unequivocal way. you're interested in "ok, let's this!" part, before helpers make example executable: function paths(m,n) { // given pos present in list of poss? var pos_member = fu...

javascript - Why datepicker is not working on 2 textboxes on the same page -

$(function() { $("#date1 , #date2").datepicker({ readonly_element: false, dateformat: 'y-m-d' }); }); try code $(function() { $("#datepicker1").datepicker(); $("#datepicker2").datepicker(); }); https://jsfiddle.net/dave17/squ5p6ak/ i hope helpful

softlayer - Detail information for Auto Scale in SL -

Image
i implementing detail information auto scaling using java api. how can detailed information of member configuration. please refer fields in red box in attached picture. detailed information. example, operation reference code, centos_6_64, how can long type of description centos 6.x - minimal install (64bit). try using object mask mask[id, name, status[name, keyname], regionalgroup[id, name, description], suspendedflag, terminationpolicy, cooldown, regionalgroupid, minimummembercount, maximummembercount, balancedterminationflag, networkvlans[ id, networkvlan[ id, name, vlannumber, networkspace, primaryrouter[id,hostname,datacenter[name,longname]],localdiskstoragecapabilityflag,sanstoragecapabilityflag]],virtualguestmembertemplate[hostname,domain,fullyqualifieddomainname,startcpus,maxmemory,hourlybillingflag,localdiskflag,operatingsystem,datacenter,privatenetworkonlyflag,networkcomponents.maxspeed,sshkeys,operatingsystemreferencecode,blockdevices[device,diskimage.capacit...

What is the difference between ad hoc and prepared query in sql server plan cache? -

i’m trying understand plan cache content of sql server. so questions are: 1. difference between ad hoc , prepared plans? 2.what should know when trying optimize sql server plan cache? what difference between ad hoc , prepared plans? adhoc query: select * t1 prepared query: queries substitute place holders in place of actual values called prepared statements. some examples: select * t1 id=@id one more example taken wikipedia: command.commandtext = "select * users username = @username , room = @room"; command.parameters.addwithvalue("@username", username); command.parameters.addwithvalue("@room", room); what should know when trying optimize sql server plan cache? there whitepapers written how optimize plan cache.so try keep little.. normally when query executed against sql ,sql compiles plan , stores in plan cache .this plan cache memory taken buffer pool , different versions have different restr...