Posts

Showing posts from August, 2011

typescript - Angular2 setup with JSPM -

i'm try setup basic "hello-world" app test using jspm, going fine until try install reflect-metadata package(i recognized excluding packages installation string) jspm install angular2 reflect-metadata zone.js es6-shim this command gives me next error: typeerror: tomap.startswith not function jspm.config.js system.config({ baseurl: "/lessons/angular2/test/", defaultjsextensions: true, transpiler: "typescript", typescriptoptions: { "tsconfig": "tsconfig.json" }, paths: { "github:*": "jspm_packages/github/*", "npm:*": "jspm_packages/npm/*" }, packages: { "app": { "defaultextension": "ts" } } ...maps goes here }); package.json { "name": "test", "version": "1.0.0", "description": "", "main": "", "scripts"

r - apply a function to a subset of a data frame but retain the whole data frame -

i have data frame , vector identifying rows i'm interested in: col1 <- c("june","june","june 11","june 11, 2012","june 14, 2012") col2 <- c("september", "september", "october 8", "october", "sept 27, 2012") monthdf <- data.frame(cbind(col1, col2), stringsasfactors = false) v0 <- c(1, 2) i have 2 character vectors apply subset , specific columns. startmonthv <- paste(c(" 1, ", substr(sys.date(), 1, 4)), collapse = "") endmonthv <- paste(c(" 28, ", substr(sys.date(), 1, 4)), collapse = "") i've tried using variations of apply() function paste() being function want use, no avail. final result data frame of rows, looking - first 2 rows have been modified above startmonthv , endmonthv: col1 col2 1 june 1, 2016 september 28, 2016 2 june 1, 2016 september 28, 2016 3 june 11

svg - Changing Port Location in custom element in JointJS -

i able create custom element utilizing answers question: using predefined svg file creating custom jointjs shape ports after reviewing tutorials jointjs don't see how move ports different locations on element. thanks example code: http://jsfiddle.net/jshubert/9a8brrun/ var el1 = new joint.shapes.devs.model({ markup: '<g class="rotatable"><g class="scalable"><image class="body"/></g><text class="label"/><g class="inports"/><g class="outports"/></g>', size: { width: 100, height: 100 }, position: { x: 50, y: 75 }, attrs: { '.label': { text: 'sw_1', 'ref-x': .1, 'ref-y': .01}, '.body': { width: 1024, height: 768, 'xlink:href': 'data:image/svg+xml;utf8,' + encodeuricomponent(svgfile), preserveaspectratio: 'none' } }, inports: ['

Change origin of node in SceneKit Interface Builder -

Image
does know how change origin of node in scenekit interface builder? origin incorrect, moving moves model, want move origin it's in middle of object :-/ maybe need re-export model different origin? reposition node's pivot . example, trucknode.pivot = scnmatrix4maketranslation(13.4, 12.9, 28.9) you can change rotation of pivot appears interested in translational aspects above example satisfies. another option make node child of otherwise empty "container node". reposition node within container , subsequent translations , rotations on container node. another option using interface builder. select dae file. @ bottom of editor window, on left, square button bar on left. click open scene graph. show hierarchical list of nodes in file. in utilities panel right in xcode window, select "box" icon. can adjust nodes position numerically there. can drag axes directly in editor. not change pivot think want do. may have create new node act cont

angularjs - Angular app with stormPath java sdk -

i have angular app , have spring-boot app stormpath java sdk authentication. have endpoints created registration,receive token, refresh token etc. i have registration flow setup , able login user. these few questions having trouble handle on app. once have access_token, how make sure passed request api calls being made app. how automatically refresh token when new request made. how know access_token has expired can throw pop ask continue , refresh token. i have been trying read find proper solution tutorials explain login functionality either facebook,twitter etc. i donot have node.js/express in app yet if needed can incorporate need since have api endpoints created me info need. can provide more info if needed. any suggestions or inputs appreciated me rolling. i work @ stormpath . we use secure cookie strategy storing access , refresh token on client, allows transparently issue new access token when expires. makes easy authenticate requests angular app,

android - Casting ListAdapter to RecyclerView.Adapter fails -

i have recyclerview.adapter class , want cast listadapter returns error: "can not cast". public void setadapter() { recycleradapter adapter = new recycleradapter(context); listview.setadapter((listadapter) adapter); } recyclerview.adapter directly extends object therefore, you're going error. besides, don't think can use recyclerview adapter in listview anyways.

SQLite unique column based on foreign key -

this question has answer here: sqlite unique key combination of 2 columns 1 answer i have table this: create table a( _id integer primary key, name integer, message integer unique ); message column must unique when name columns same. how can achieve that? example: insert a(name, message) values (1, 5) this must throw error: insert a(name, message) values (1, 5) this must work: insert a(name, message) values (2, 5) insert a(name, message) values (1, 6) thanks in advance. you can set column unique click icon unique in tables list alter table table_name add constraint constr_id unique (user_id, game_id, date, time)

r - ggplot2 manual legend inside a plot -

Image
when run below code, density plot , histogram created. i've added 2 vertical line show mean , median. want display legend ("mean" dotted red , "median" green color) @ top-right corner of plot. can run code df available in r-studio. ggplot(usarrests,aes(x=murder)) + geom_histogram(aes(y=..density..),binwidth=.5,col="black",fill="white") + geom_density(alpha=.2,fill="coral") + geom_vline(aes(xintercept=mean(murder,na.rm=t)),color="red",linetype="dashed",size=1) + geom_vline(aes(xintercept=median(murder,na.rm=t)),color="green",size=1) my question shall use theme() or else display legend in plot? you're better off creating additional data.frame of summary statistics , adding plot instead of trying fiddle around manually creating each legend element. legend position can adjusted theme(legend.position = c()) library("ggplot2") library("reshape2") library(&q

css - How can I combine navbar and pagination? -

i want go new tab when click on each item of navbar using pagination (not sure if using correctly) , guides me expected page section in same page not in new tab. how can fix this? <div class="container"> <nav class="navbar navbar-dark bg-primary navbar-fixed-top pagination pagination-sm"> <div class="nav navbar-nav"> <a class="nav-item nav-link active page-item" href="#monajalal">mona jalal <span class="sr-only">(current)</span></a> <a class="nav-item nav-link page-item" href="#education">education</a> <a class="nav-item nav-link page-item" href="#experience">experience</a> <a class="nav-item nav-link page-item" href="#courseworks">courseworks</a> <a class="nav-item nav-link page-item" href="#teaching">teaching</a

php - Facebook Messenger API webhook trouble -

i trying setup webhook facebook messenger bot platform , receiving error: the url couldn't validated. response not match challenge, expected value = '892694233', received='892694233<link rel...' i using heroku host testing , callback url ssl, project on laravel 5.2 , code processs webhook setup if ($request->get('hub_verify_token') == config('services.bot.verification_token')) { return (new response())->setcontent($request->get('hub_challenge')); } return (new response())->setcontent('error: token mismatch'); i'm not familiarized lavarel, looks way extracting value of parameter hub.challenge giving wrong value: '892694233 if return number in response ('892694233') should work. maybe can clean result of calling $request->get('hub_challenge') in order remove text @ end?

maven - Can a module compilation happen before it's dependency tests are over? -

let's have multi module project in maven 2 projects , b. depends on b. if run parallel build (mvn -t 2c ...) module b compiled, tested , module compiled , tested. : b compile b tests compile tests to speedup things, start a's compilation (and maybe tests) before (well during...) b's tests. in other words, there option in maven allowing have phase granularity instead of module ganularity while doing parallel builds ? the simple answer this: no there exist no such option. a longer answer: it wouldn't make sense, cause running tests after code has compiled 1 of foundations here have reliable code. if think further that: lets possible such thing. you run compile of module b , in parallel let module run it's compilation well. questions comes @ point in module b tests fail ? mean? start of compilation module useless cause have counted on wrong code (failing tests).

file - Shiny R inputFile as FileChooser -

Image
note: application not meant deployed in remote server, in local machine. use shiny because it's easy create friendly user interface. in application need select file local machine. means found file.choose() , fileinput() . first option work isn't user friendly because file chooser won't appear on top of browser... not new element in task bar, user confused. 1) there way this? (not using fileinput filechooser) 2) if not, there way hide uploading bar? doesn't make sense filechooser. i don't know modify here in order hide upload bar. edit: use other progress bars in application, i'm not sure if hiding progress-bar class hide progress <- shiny::progress$new() as said in comment warmoverflow, that's needed. tags$style(type="text/css", ".shiny-file-input-progress { display: none }")

Google Chart Overlays using googleVis package in R -

Image
google charts has overlay functionality allows put image on plot @ specified position. possible in googlevis package or need edit chart html ad hoc include overlay? you can add overlay google map using googleway package. use google maps need valid api key library(googleway) map_key <- 'your_api_key' google_map(key = map_key) %>% add_overlay(north = 40.773941,south = 40.712216, east = -74.12544, west = -74.22655, overlay_url = "https://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg")

installation - TFS (high level) install process -

can explain high level process, of installing tfs? i've had server set "network guy". it's tfs 2010, , we're using vs 2010 , moving vs 2012. need install on client machine, or visual studio "hook" tfs automatically? also, i've been tasked moving our vss tfs. i've seen posts , don't need coverage of that, unless wanted point me best links of how to. when instructions mention installing team explorer or needing sql server express on machine doing migration on, mean workstation or server? the microsoft walk-throughs worse (imho)... well, followed http://tfsguide.codeplex.com/wikipage?title=how%20to%20-%20migrate%20source%20code%20to%20team%20foundation%20server%20from%20visual%20source%20safe and got installed. i'll post new question new issue.

postgresql - Efficient DB solution for system task tracking -

i'm working on data tracking system. system multiprocess application written in python , working in following manner: every s seconds selects n appropriate tasks database (currently postgres) , finds data it if there's no tasks, creates n new tasks , returns (1). the problem following - have approx. 80gb of data , 36m of tasks , queries tasks table begin work slower , slower (its populated , used table). the main bottleneck of performance task tracking query: lock table task in access exclusive mode; select * task line = 1 , action = any(array['find', 'get']) , (stat in ('', 'cr1') or stat = 'error' , (actiondate <= now() or actiondate null)) order taskid, actiondate, action desc, idtype, date asc limit 36; table "public.task" column | type | modifiers ------------+-----------------------------+---------------------------------

Serialize/Deserialize list of objects using json and python -

how serialize list of objects(person) json file , read json file , deserialize them objects? know how write json file i'm not clear on how convert objects json properly. below simplified snippet of code. have list containing 2 people , want serialize them , save json file. deserialize them objects of type people. thanks help. import json class person(object): def __init__(self, name, nickname): self.name = name self.age = 0 self.nickname = nickname # create few people = person('john', 'joker') b = person('marisa', 'snickerdoodle') # add people list peeps = [] peeps.append(a) peeps.append(b) # dummy data saving json testing data = { 'name' : 'acme', 'shares' : 100, 'price' : 542.23 } open('data.json', 'w') outfile: json.dump(data, outfile) the json module expects lists, dicts, strings, numbers, booleans, , none, not custom classes. need ma

dataframe - R: Remove rows with fewer than certain threshold non-zero values -

i know how remove rows data frame have fewer (let's 5) non-zero entries. the closest i've come is: length(which(df[1,] > 0)) >= 5 but how apply whole data frame , drop ones false? there function similar countif() function in excel can apply here? thank help. you can use boolean values in rowsums , in [ : df[ rowsums(df > 0) >= 5, ] there 3 steps hidden in expression: expression df > 0 produces matrix values true element > 0 function rowsums returns number of nonzero elements every line (when summing treats values true 1 , false 0) finally [ selects lines number of non-zero elements >= 5

javascript - Input Validation - How to allow backspace to work in my method -

i have function allow input field receive numbers , decimal point. how can allow backspace key ? function verifiercaracteres(event) { var keycode = event.which ? event.which : event.keycode; var touche = string.fromcharcode(keycode); var champ = document.getelementbyid('mon_input'); var caracteres = '.0123456789'; if(caracteres.indexof(touche) >= 0) { champ.value += touche; } } and html: <input type="text" name="patient_amount" id="mon_input" onkeypress="verifiercaracteres(event); return false;"/> use keycode == 8 in validation. 8 keycode backspace. really, job regex , replace. how typically go process. here example. function verifiercaracteres() { var inputele = document.getelementbyid("mon_input"); var value = inputele.value; inputele.value = value.replace(/([^0-9\.])+/g,''); } this remove characters input not 0-9 or .

html - Mobile scroll too long leaving white space below text -

http://www.cllrart.com/more in mobile browsers, page scrolls way below last text on page causing white space appear @ end. how possibly remove this? any appreciated it looks css .entry class has large bottom-margin. .entry { margin: 4.5em 0; // <-- reducing } you can try this: .entry { margin: 4.5em 0 0; // <-- doing might you're looking for. } i hope answers question.

function - Why mycourses[i].getGrade() doesn't return anything (C++)? -

i having problem getgrade() function in header file not returning letter grade based on marks entered user in main file. when compile , run program doesn't display letter grade according marks entered. header file (course.h) #include <iostream> #include <string> using namespace std; class course { private: int totalmarks; char grade; public: void marksinfo(int tm) { totalmarks = tm; } int getmarks(void) { return totalmarks; } void setgrade(char c) { if(totalmarks <= 39) c = 'e'; if(totalmarks >= 40 && totalmarks <= 49) c = 'd'; if(totalmarks >= 50 && totalmarks <= 64) c = 'c' } char getgrade(void) { return grade; } }; main file #include <iostream> #include <string> #include "course.h" using namespace std; int main() { i

javascript - Get all paths in JSON object -

been messing while , can't right. i'm trying create arrays every path json. [ { "webapp : calendar": { "count": 3151, "next": { "viewworkout": { "count": 521, "next": { "beginusersession": { "count": 12, "next": {} }, "editworkout": { "count": 134, "next": {} }, "webapp : expandoopened": { "count": 116, "next": {} }, "mobile : feed": { "count": 2, "next": {} }, "webapp : athleteloadedfromlibrary": { "count": 45, "next": {} }, "viewworkout": {

php - Custom Static Links For Specific Menu Right Before/Next The wp_nav_menu Function? -

i trying add custom links next/before wp built in menu, main_menu . have placed in functions.php , give (li)'s in nav-menu-after.php , before file, it's not working. add_filter('wp_nav_menu_items',do_wp_nav_menu_items); function do_wp_nav_menu_items($menu, $args=array()) { if( file_exists( templatepath . '/nav-menu-before.php' ) && $args->theme_location == 'main_menu' ) { ob_start(); @include templatepath . '/nav-menu-before.php'; $nav_menu_before = ob_get_clean(); } if( file_exists( templatepath . '/nav-menu-after.php' ) && $args->theme_location == 'main_menu' ) { ob_start(); @include templatepath . '/nav-menu-after.php'; $nav_menu_after = ob_get_clean(); } return $nav_menu_before . $menu . $nav_menu_after; } if delete part && $args->theme_locat

html - Alternative to <content> tag in HTML5? -

i reading today shadow dom, author used <content> tag pull in textcontent host. tutorial : http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom/ when looked up, found <content> tag has been deprecated , should avoided. should now? should learn use <content> tag or not? source : mozilla documentation the same documentation ( mozilla firefox ) states: it has been replaced <slot> element. use <slot> element. when deprecated, should no longer use it. ( mozilla states this.) deprecated means no longer approved of/disapproved.

java - Method to calculate sum of product of two consecutive numbers -

write java method calculate following summation: 2×3+3×4+4×5+...+97×98+98×99 or more generaly, sum = 2 98 of i*(i+1). can done recursion or for/while loop? well have 1 product starting each number (from 2 98) rather straight forward. need loop on numbers 2 98 (with loop) , in loop add product of counter variable , counter variable + 1 sum variable initialized 0 before loop. int sum = 0; (int = 2; < 98; i++) { sum += * (i + 1) } whenever have repeating pattern, have use loop. there approach this: sum i * (i + 1) same summing i ^ 2 + i , there formulas sum of first n numbers , first n square numbers (more on in this question ). when add formulas, 1/3 * n ^ 3 + n ^ 2 + 2/3 * n , give sum of first n squares , first n natural numbers added together. can set n 98 (as in question) , subtract 2 because don't start 1 2.

git - Error on using Go get -

after managing go get tensorflow repo ( as described in previous question ). i have right code in $gopath (the one go branch ), compilation generates error message: can't load package: package github.com/tensorflow/tensorflow/tensorflow/contrib/go: /home/arafat/go/src/github.com/tensorflow/tensorflow/tensorflow/contrib/go/lib.g‌​o: malformed #cgo argument: -i${srcdir}/../../../ how can solve compilation issue?

encoding - Java convert String text to base36 and from base36 to hex -

is there api in java convert simple string base36/base10 , base36/base10 hex representation. example: input: '-22eevx' encoding base36 output: f8 8d 33 23 use integer class , radix parameter of parseint , , tohexstring same class. integer.tohexstring(integer.parseint("-22eevx", 36)); for base10 shorter (you omit radix parameter, assumed 10 ): integer.tohexstring(integer.parseint("-22"));

python - Cannot get data from Queue -

i'm trying use joinable queue , didn't when join() called on queue from multiprocessing import joinablequeue,pool q = joinablequeue() def pat(i): q.put("hello"+str(i)) q.join() print(q.get()) pool(5) p: (p.map_async(pat,range(5))).get() res = q.get() print(res+"main") q.task_done() i data queue after process exits can me this .run() directly runs process target function in main process. use .start() fork new process.

java - Read data from excel and Write to List -

i want data list , display it.but out put display 4 times. excel file containing 4 data. want 1 record. code is public static list readdatafromexcel() throws ioexception{ string filename = "path"; list sheetdata = new arraylist(); fileinputstream fis = null; try { fis = new fileinputstream(filename); xssfworkbook workbook = new xssfworkbook(fis); xssfsheet sheet = workbook.getsheetat(0); iterator rows = sheet.rowiterator(); while (rows.hasnext()) { xssfrow row = (xssfrow) rows.next(); iterator cells = row.celliterator(); list data = new arraylist(); while (cells.hasnext()) { xssfcell cell = (xssfcell) cells.next(); string value=" "; switch (cell.getcelltype()) { case cell.cell_type_numeric:

initialization - Javascript : ReInitialize Global Variable without refreshing the page -

i have page containing form fields menus. on clicking button, form fields should validated , errors should displayed in row of table on modal window. i have declared global variable capture errors of different field. global variable string , error gets added rows shown below first initialize global variable var gerrortablerow = ""; the same variable keeps append table row based on errors of particular field name shown below. gerrortablerow += '<tr><td>'+sfieldname+'</td><td>enter non 0 value</td></tr>'; the table row shall displayed on modal window on clicking button. but variable gerrortablerow getting append errors again , again after re initialize if variable 'gerrortablerow = "" ;' after modal window show., on clicking button. how re initialize gerrortablerow variable without refreshing page. i re edited based on comments, hope clear now. you run code assigning new valu

basex - XQuery: declare a function returning nothing -

declare variable $testseq item()* := (); declare function local:insertseq($target item()*, $position xs:integer?, $inserts item()*) item()* (:might great if have keyword represent nothing:) { fn:insert-before($target, 1, $inserts) (:change global sequence:) () (:simulate returning nothing, empty sequence:) }; element test { attribute haha {"&amp;"}, local:insertseq($testseq, 1, ('a', 'b')), $testseq } i need collect global sequence while script running. @ end of script release sequence. function insertseq must return nothing. possible xquery? or there other tricks it? error basex: $ basex test.xqy stopped @ /users/jack/documents/shk/xsd2owl/workspace/xqy/test.xqy, 7/4: [xpty0004] item expected, sequence found: ("a", "b"). the answer on title of original question be: declare function local:f() empty-sequence() { () }; as want solve specific problem, think creating new question title , corresponding p

android - Unable to connect to device with Marshmallow for wireless debugging. Getting (10061) error -

i trying connect android device marshmallow wireless debugging. c:\...\sdk\platform-tools>adb connect 192.168.1.103:5555 unable connect 192.168.1.103:5555: cannot connect 192.168.1.103:5555: no connection made because target machine actively refused it. (10061) i tried adb connect "192.168.1.103:5556" , "adb connect 192.168.1.103" ended same result. the first command above used work fine on oneplus 2 before marshmallow update. any on how wireless debugging on marshmallow? i using 1 plus 2 , updated marshmallow 2 weeks ago . have same issue try kill adb sever try again . adb kill-server you should use 5556 port number not 5555 anymore if not working connect phone via usb cable restart adb wireless mode adb tcpip 5556 then try connect phone port no 5556 (eg ip:5556) after connected can remove usb cable it worked me

java - onClickListener in RecyclerView.ViewHolder -

i've got recyclerview.viewholder , recyclerview.adapter, need after click on item , send information item activity . placesadapter.java public class placesadapter extends recyclerview.adapter<placesviewholder> { private placesactivity placesactivity; context context; private int position; list<places> places; public placesadapter(list<places> places) { this.places = places;} @override public void onattachedtorecyclerview(recyclerview recyclerview) { super.onattachedtorecyclerview(recyclerview); } @override public placesviewholder oncreateviewholder(viewgroup viewgroup, int i) { view v = layoutinflater.from(viewgroup.getcontext()).inflate(r.layout.places_view, viewgroup, false); placesviewholder pvh = new placesviewholder(v); return pvh; } @override public void onbindviewholder(placesviewholder personviewholder, int i) { personviewholder.name.settext(places.

ios - Updating UICollectionView after deleting a Realm object -

when try delete item realm database unable update uicollection view appropriately. lets assume realm container children of type list<child> : var children = realm.objects(parent).first!.children when want remove child database by: try! realm.write { realm.delete(children[indexpath.row]) } updating collectionview collectionview.deleteitemsatindexpaths([indexpath]) gives following error: got error: *** terminating app due uncaught exception 'rlmexception', reason: 'object has been deleted or invalidated.' the way collectionview updated using collectionview.reloaddata() , not want since animation of cell deletion missing. however, when remove child container @ indexpath.row (without removing database) by: try! realm.write { children.removeatindex(indexpath.row) } updating collectionview collectionview.deleteitemsatindexpaths([indexpath]) works without problems. what best way update uicollectionview after removing item database?

Remove NA values in R -

this question has answer here: remove rows nas (missing values) in data.frame 12 answers how can remove rows include na values in subset of columns? for following data.frame, want remove rows have na in both columns id1 , id2: name id1 id2 na na b na 2 c 3 na i want receive one: name id1 id2 b na 2 c 3 na mydf[!(is.na(mydf$id1) & is.na(mydf$id2)),]

osx - Tmux pane switch causes displayed info to change -

Image
has idea going on here. i'm not 100% how word problem google searching has found nothing far. i using terminal on mac osx , started using tmux. when fire session first screen shot, when create new pane side side development <c-b>% new pane opens old 1 gets corrupted in way. see second image. when jump first pane <c-b>leftarrow returns show correct info, in right pane gets jumbled. any ideas? update: when edit files in vim in right pane (for example) text appears in left pane when hit return , move next line. colouring suggested using wrong width screen?

java - synchronized block is not working quite right -

i unable synchronized blocks in java i read following post didn't quite syn-blocks , locks synchronized block not working i don't know why below code not outputting uniform array of a's,b's,c's after synchronized it.. public class synchronizeblock { static stringbuffer s=new stringbuffer(); public static void main(string []args) { threading t1=new threading(s,'a'); threading t2=new threading(s,'b'); threading t3=new threading(s,'c'); t1.start(); t2.start(); t3.start(); } } class threading extends thread { stringbuffer sb; char ch; threading() { } threading(stringbuffer sb,char ch) { this.sb=sb; this.ch=ch; } public void run() { synchronized(this) // this(current instance) acts lock ?? { for(int i=0;i<20;++i) { system.out.print(ch

php - Split huge traffic data into multiple database VS multiple table/collection for mysql/mongodb -

i developing php web service http api write , read data to/from database database mysql/mongodb. has 3 select/find() queries , 2 insert queries single table/collection it called 10,000 times per second asynchronously different clients. i planing split data multiple table according user name start letter. mean if user name start d demouser, system store data table_d/collection-d , on. option 1 option 1 same database multiple table/collection database-table_a/collection-a table_b/collection-b table_c/collection-c option 2 multiple database single table/collection database-a table database-b table database-c table please advice me best way increse speed? thank help thanks

asp.net mvc - Passing a URL through jQuery with awkward routing -

i familiar how pass data through url through jquery, asp.net mvc controllers, writing code today , came upon interesting url cannot quite figure out how format... the route reads ... /////////////////////////////////////////// // route: /member/{0}/characters /////////////////////////////////////////// public actionresult characters(int member){ // list of member's characters } so url have 'parameter' right in middle. curious me, because i'm not sure how translates jquery "data" property on $.ajax . set .... $.ajax({ url: '/member/characters', datatype: 'json', data: { member: 1 } }).done(function (data) { viewmodel.set("player", data); }); but can't seem work in situation. suppose hokey string formatting, hoping bit more cleanly... does have suggestions handling odd routes this? you won't able use data parameter since sets query string attributes. value part of path, you'll need dif

bash - Store output of attached virtual interfaces for a particular bridge -

i want store interfaces output of brctl show <bridge-name> for example command below gives tabular output veths attaches in last column: brctl show lxcbr0 is there way store these veths in bash variable? variable can string or list/array. here output: lxcbr0 8000.fe2055f9d34c no veth2wdtux vethfegpix vethgami9b vethgqsypy vethkw3muf vethm7a3qn vethnc26f7 vethnw6o6u vethwpdu0u

ios - iCarousel AutoLayout Multiplier issue -

i trying use multipliers on icarousel layout not seem have affect @ all. code: _carousel = [[icarousel alloc]init ]; self.items = [nsmutablearray array]; (int = 0; < 10; i++) { [_items addobject:@(i)]; } _carousel.type = icarouseltypecylinder; _carousel.delegate = self; _carousel.datasource = self; _carousel.translatesautoresizingmaskintoconstraints = false; [self.view addsubview:_carousel]; [_carousel.centerxanchor constraintequaltoanchor:self.view.layoutmarginsguide.centerxanchor].active = true; [_carousel.bottomanchor constraintequaltoanchor:self.view.layoutmarginsguide.bottomanchor constant:-80].active = true; [_carousel.widthanchor constraintequaltoanchor:self.view.widthanchor multiplier:40.0/100.0].active = true; [_carousel.heightanchor constraintequaltoanchor:self.view.heightanchor multiplier:30.0/100.0].active = true; i have noticed if input constant value of -20 in: [_carousel.bottomanchor constraintequaltoanchor:self.view.layoutmarginsguide.bottomanchor

svg - How tweens matrices between keyframes CSS are made? -

how can change way make use key frames when transform-matrix perform, in circular interpolation matrix? the movement made 1 key frame not guara center if closely spaced key frames <svg version="1.1" id="capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="100%" height="800" viewbox="0 0 100% 800" enable-background="new 0 0 100% 800" xml:space="preserve"> <g id="todo"> <defs> <style type="text/css"> .a1621 { animation-duration: 35s; animation-iteration-count: 1; animation-direction: normal; animation-play-state: running; animation-name: a1621; transform-origin: 0px 0px 0px; } @keyframes a1621 { 0% { transform: matrix3d(1.94872, 0, 0, 0, 0,

android - How to maintain position of list view row/item? -

i have custom listview containing textview , imageview , checkbox . in listview , nothing should checked/unchecked have block based on conditions. tasks doing: if checkbox checked should show image in imageview . i don't want make checkbox checkable/enabled based on conditions. below code custom adapter. public class customadapter extends baseadapter { private context context; private arraylist<pojo> maindatalist; private layoutinflater inflater = null; public customadapter(context context, arraylist< pojo > maindatalist) { this.context = context; this.maindatalist = maindatalist; inflater = ( layoutinflater ) context.getsystemservice(context.layout_inflater_service); } @override public int getcount() { // todo auto-generated method stub return maindatalist.size(); } @override public long getitemid(int pos

html - css full width modal overlay below button -

Image
i have table this: i when press (button1) result this: and when press (button2) result this: hi level html mock-up: <div id="item-warapper"> <div id="item-header"> <label>entity title</label> </div> <div id="item-detail"> <table> <thead> <tr> <td>detail id</td> <td>detail quantity</td> <td>detail value</td> </tr> </thead> <tbody> <tr> <tr id="row1"> <td> 001 <button>open detail</button> </td> <td>5.00</td> <td>200.00</td>