Posts

Android - add fragment with custom dimensions -

Image
currently, adding fragment using following code. private void addfragment(fragment fragment, string fragmentname) { log.i("adder", "adding fragment " + fragmentname); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); fragmenttransaction.add(r.id.fragment_container, fragment, fragmentname); fragmenttransaction.commit(); } following code resizing added fragment. private boolean readjustfragment(fragment fragmenttobeadjusted, fragmentcoordinates fragmentcoordinates) { if (fragmenttobeadjusted != null) { view view = fragmenttobeadjusted.getview(); relativelayout.layoutparams params = new relativelayout.layoutparams(fragmentcoordinates.getwidth(), fragmentcoordinates.getheight()); params.leftmargin = fragmentcoordinates.getx0(); params.bottommargin = fragmentcoordinates.gety0(); view.setlayoutparams(params); view.requestlayout(); return true; } return...

r - Names Argument Plotly Barplot -

so using plotly in shiny create bar chart. x labels not unique example (dog twice): let df be: x y 1 dog 2 cat 3 dog 3 ant 4 bee i rows plotted won't work because of repeated variable dog in x column: p = plot_ly(df, x = df[,2], y = df[,1], type = "bar", marker = list(color = torgb("blue"))) p so thinking of getting past doing like: able plot 5 rows removing x argument. want able modify these names separately fill in x column variables. p = plot_ly(df, y = x, type = "bar", marker = list(color = torgb("blue"))) p how manually change x labels in plotly barplot? thank you straightforward official method: use tickmode , tickvals , , ticktext arguments in layout xaxis : library(plotly) plot_ly(df, y = x, type = "bar", marker = list(color = torgb("blue"))) %>% layout(xaxis = list(tickmode = "array", tickvals ...

javascript - How can I pass variable from one function to another in angularJS? -

$scope.openmodal = function (page, size) { console.log(page); // working $uibmodal.open({ animation: true, templateurl: 'app/pages/servers/newrole.html', size: size, resolve: { items: function () { return $scope.items; } } }); }; $scope.hello = function() { console.log(page); // need value of page above function var btn = document.createelement("button"); var t = document.createtextnode("abc"); btn.classlist.add("btn-primary", 'btn-xs', 'btn'); btn.appendchild(t); document.getelementbyid('id1').appendchild(btn); } i have tried using global variable , assigning page saying undefined . i can access variable calling hello(page) inside openmodal , won't work call hello() when it's not needed. i have 2 buttons , calling openmodal function on click of 'btn1', , passing page ...

filepath - Is it possible to get physical path of uploaded file using js/jquery? -

i trying getting uploaded files actual physical path using js or jquery. tried var tmppath = url.createobjecturl(file); proving temp path blob: http://fiddle.jshell.net/b298c63f-9501-4b09-b62e-c5eb01d4aaf3

javascript - Additional Navigation bar on click -

Image
i have navigation bar section "contracts" , wondering if possible, , how go adding additional navigation bar expand underneath when button tagged, (for example, on apple store site, when click product, adds bar) i can provide entire css style sheet if needed! think require javascript i'm trying keep pure css now! all appreciated! html code: navigation html <header> <div class="title"> <img src="img/logo2.png"/> </div> <div class="navbar"> <ul> <li style="float: left"><a href="#home">home</a></li> <li><a href="#contact">contracts</a></li> <li><a href="#about">about us</a></li> <li><a href="#other">other</a></li> <li> <a href="#release">rele...

python - Why is no result in this code? -

emp.csv index empno ename job mgr hiredate sal comm deptno 0, 7839, king, president, 0, 1981-11-17, 5000, 0, 10 1, 7698, blake, manager, 7839, 1981-05-01, 2850, 0, 30 2, 7782, clark, manager, 7839, 1981-05-09, 2450, 0, 10 3, 7566, jones, manager, 7839, 1981-04-01, 2975, 0, 20 4, 7654, martin, salesman, 7698, 1981-09-10, 1250, 1400, 30 5, 7499, allen, salesman, 7698, 1981-02-11, 1600 300, 30 6, 7844, turner, salesman, 7698, 1981-08-21, 1500, 0, 30 7, 7900, james, clerk, 7698, 1981-12-11, 950, 0, 30 8, 7521, ward, salesman, 7698, 1981-02-23, 1250, 500, 30 9, 7902, ford, analyst, 7566, 1981-12-11, 3000, 0, 20 10, 7369, smith, clerk, 7902, 1980-12-09, 800, 0, 20 11, 7788, scott, analyst, 7566 1982-12-22, 3000, 0, 20 12, 7876, ada...

Bootstrap v4 offsets within sass/scss -

how use offsets within own sass file using bootstrap v4? i using: @extend .col-sm-offset-2; after updated bootstrap v4 git, it's not working anymore. according documentation , work : @include make-col-offset(2) i suppose sm if column small already