Posts

javascript - Bootstrap carousel zoom transition -

i have images in bootstrap carousel , transition effect want zoom active image , show next image. - http://cssdeck.com/labs/solitary-css3-slider-zoom-transition , zoom of active slide. i tried change bootstrap's css, doesn't scale active slide, next one. .carousel-inner .item{ transition-property: transform; transform: scale(1); } .carousel-inner .item.active{ transform: scale(1.5); } /* turning off default transition effect */ .next, .prev, .active.left, .active.right { left: 0; transform: translate3d(0, 0, 0); } the problem when slide.bs.carousel event occures next slide active 1 , want zoom effect before switching carousel's slide. maybe triggering effect js before next slide shown help. how can achieve this? here need : http://codepen.io/statix/pen/dnlmxb simply create carousel-item responsive image inside , transition : .carousel-holder .carousel-item { position: absolute; left: 0; top: 0; -webkit-transition: 1s e...

python - error in printing a N-Dimensional Numpy Matrix -

im having problems printing numpy 6-dimentional matrix. import numpy np qmatrix = np.zeros((((((5,6,10,12,10,8)))))) i used , after populating matrix tried print matrix using print (qmatrix) then comes bunch of zeros. when search value in matrix gives me correct value. print (qmatrix[1][2][4][2][5][7]) >>> 12.45 do have convert matrix in sort before printing matrix here full code used class q_matrix_base(object): def __init__(self, leadvehspd,leadvehipos,estdisctime,folvehspeed,folvehpos,rgt): self.leadvehspd = leadvehspd self.leadvehipos = leadvehipos self.estdisctime = estdisctime self.folvehpos = folvehpos self.folvehspeed = folvehspeed self.rgt = rgt # initialize matrix , fill zeroes self.qmatrix = np.zeros((((((leadvehspd,leadvehipos,estdisctime,folvehspeed,folvehpos,rgt)))))) #self.qmatrix.fill(0) def setitem (self ,leadvehspd,leadvehipos,estdisctime,folvehspeed,folvehpos...

java - How to avoid nested ActionListeners? -

in program, want user to: pick/open database (like access) on own pick table database select column(s) table in code, have class this: mntmopendatabase.addactionlistener(new actionlistener() { public void actionperformed(actionevent e) { //open database //display tables buttons tablebutton.addactionlistener(new actionlistener() { // select table public void actionperformed(actionevent e) { //display columns of table selected buttons colbutton.addactionlistener(new actionlistener() { public void actionperformed(actionevent e) {// add list of columns exported } and results big block of code. there cleaner, simpler way this? the solution refactor: create separate , separately testable class code open database. and separate , separately testable class display of data. in actionlistener, either create instances of these classes, or interact them, if exist. learn...

javascript - Node js error handling with callbacks in nested functions -

i know kind of error handling not right, promises should used instead, wondering if work is: router.get('/main', function(req, res, next) { var mycallback = new function(err, data){ if(err) { res.status(500).send({ error: "error (best handling ever)" }); return; } res.send("success"); return; }; mainprocess(mycallback); }); function mainprocess(callback){ request.post(requestparams, function(error, response, body) { if (error) { console.log(error.message); callback.return(error, ""); } else { request.post(requestparams, function(error, response, body) { if (error) { console.log(error.message); callback.return(error, ""); } else { // success callback.return(null, "success"); }...

python - Pandas new column from groupby averages -

i have dataframe >>> df = pd.dataframe({'a':[1,1,1,2,2,2], ... 'b':[10,20,20,10,20,20], ... 'result':[100,200,300,400,500,600]}) ... >>> df b result 0 1 10 100 1 1 20 200 2 1 20 300 3 2 10 400 4 2 20 500 5 2 20 600 and want create new column average result corresponding values 'a' , 'b'. can values groupby: >>> df.groupby(['a','b'])['result'].mean() b 1 10 100 20 250 2 10 400 20 550 name: result, dtype: int64 but can not figure out how turn new column in original dataframe. final result should this, >>> df b result avg_result 0 1 10 100 100 1 1 20 200 250 2 1 20 300 250 3 2 10 400 400 4 2 20 500 550 5 2 20 600 550 i looping through combinations of 'a' , 'b' slow , u...

ios - Autogrowing UITextView inside UITableView cell -

i have static uitableview , 1 of cell contains text view , want make text view autogrowable, , make cell grow @ same time. wrapping text instead of cutting it. in isoalted text view dont face issue due have fixed size , show long texts have scroll inside textview, in case doesnt want scroll, uitextview set nonscrolable because parent (uitableview) have scroll , want avoid nested scrolls. my approach sort out overrayde height.... , reload view every time user types using sizethatfits(size: cgsize) know requerid size, , set uitextview cell size, , show text correctly. but cell grows bit, , not enough, researched sizethatfits know if understand it, method mesure of object fit inside objets, or there other parameters care paddings, margins, or constriant , i'm not able find things explained. then have questions, did missunderstood method? how shoud use it? in correct path reach goal? or there better way it? thank much. override func tableview(tableview: ...

javascript - NVD3 Chart responsive issue -

Image
nvd3 responsive issue i have code second page used same chart here. on page responsive , trying figure out why chart not responsive here. var colors = ["rgba(74, 210, 255, .8)", "rgba(85, 172, 238, .8)", "rgba(205, 32, 31, .8)"]; d3.scale.colors = function() { return d3.scale.ordinal().range(colors); }; var colors = d3.scale.colors(); /*var colors = d3.scale.category20();*/ var keycolor = function(d, i) {return colors(d.key)}; var chart; nv.addgraph(function() { chart = nv.models.stackedareachart() .useinteractiveguideline(true) .x(function(d) { return d[0] }) .y(function(d) { return d[1] }) .showcontrols(false) .showyaxis(true) .showlegend(false) .rightalignyaxis(true) .controllabels({stacked: "stacked"}) .color(keycolor) .duration(500); ...