Posts

How to see what mapping for a particular key in vim? -

i know <leader>a mapped in vim. there command know this? use :map <leader>a list of mappings having specific prefix. from :h :map list key mappings modes map command applies. note ":map" , ":map!" used often, because include other modes.

java - ArrayList sent to server: Data retrieval -

in android application have arraylist is: [1, 2, 8] i sending array list in job backed django view, need process further. so calling tostring() method convert string , send server. inside view on getting parameter request , on trying print have received get: [1, 2, 8] . but on trying 1st element, calling varialble[0] getting: [ , on calling variable[1] getting 1 . i want extract numbers variable , use them further processing. going wrong? when convert arraylist values string, '[' treated string in convesrsion. u may use json kind of object using javascript , append request parameters. in django, can use dictionaries parse json data key-value pairs.

java - Transactional error while commiting -

i trying solve error in payara41 server java ee 7, sample works on wildfly-9 java 7 ee , on glassfish-3.1 java ee 6 (without @transactional , @transactionalmanagement ) @stateful @transactional //default txtype.required @transactionmanagement(transactionmanagementtype.bean) public class improvementdaoimpl extends abstractbasedaoclass implements improvementdao { /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @persistencecontext(unitname = "pu", type = persistencecontexttype.extended) private entitymanager em; @resource private usertransaction tx; ... } here's stacktrace, apperas after executing tx.flush(); : javax.transaction.transactionalexception: managed bean transactional annotation , txtype of required encountered exception during commit javax.transaction.rollbackexception: transaction marked rollback. (...) caused by: javax.transaction.rollbackexception: transaction mar...

php - How to add multiple limits in mysql query? -

i want select sum of last 200,100 , 50 rows of close price table in single query. given below query 200 rows. select sum(close_price) tot200 cash_data order date_added limit 0,200 can me this. you can use sub queries - select (select sum(close_price) cash_data order date_added limit 0,200) tot200, (select sum(close_price) cash_data order date_added limit 0,100) tot100, (select sum(close_price) cash_data order date_added limit 0,50) tot50

In R, how do I use stub to create names (of data frames, variables & plots) in a loop? -

i'm working set of results of inla package in r. these results stored in objects meaningful names can have, instance, model_a , model_b ... in current environment. each of these models i'd several processing tasks including extracting of data separate data frame, can used merge spatial data create map, etc. turning simpler, reproducible example let's assume 2 results ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group <- gl(2, 10, 20, labels = c("ctl","trt")) weight <- c(ctl, trt) model_a <- lm(weight ~ group) model_b <- lm(weight ~ group - 1) i can handle steps individual model, instance: model_a_sum <- data.frame(var = character(1), model_a_value = numeric(1)) model_a_sum$var <- "intercept" model_a_sum$model_a_value <- model_a$coefficients[1] png("model_a_plot.png") plot(model_a, las = 1) dev.off() now, i'd reuse...

javascript - typed.js doesn't work for the second attempt -

the first attempt hover div.logo finish , typed.js types sentence. after that, when hover again on div.logo doesn't work , doesn't type anything. <script type="text/javascript"> $( ".logo" ).hover(function() { $(this).toggleclass("clicked"); if ($('.logo').hasclass('clicked')){ $(function(){ $('.logo').css('background-position','-20vmin center'); console.log("n"); $(".logo h3").typed({ strings: ["phoenix ^250 programming ^250 team"], typespeed: 75 }); }); } else{ $('.logo').find( "h3" ).text(""); $('.logo span').remove(); $('.logo').css('background-position','center left+1.5vmin'); } })...

c# - How to use session in apicontroller in asp.net mvc 4 -

i working on application using asp.net mvc 4 . here want use autocomplete extender using jquery want populate location of cityid stored in session. here function creating session: public string create(string city) { try { //httpsessionstatebase session["c"]=city; //httpcontext.current.session["city"] = city; system.web.httpcontext.current.session["city"] = city; long cityid = convert.toint64(system.web.httpcontext.current.session["city"].tostring()); return city; } catch (exception ex) { throw (ex); } } this function called when user select city city dropdownlist . my jquery calling autocomplete extender is: <script type="text/javascript"> var url = '@url.routeurl("defaultapi", new { httproute = "", controller = "productapi" })'; $('#txtlocation').autocomplete({ source: function (request, resp...