Posts

angularjs - Can i populate specific form when a item is selected from the combobox -

when select item combobox, want populate appropriate form user input. possible? e.g. if user selects 'address' combo box, want populate form address fields else if user selects phone, want populate form enter phone details. you should able detect selected option in combobox , load appropriate form inside div. <select ng-model="combo"> <option value="address">address</option> </select> <div id='form-area'></div> <script> // inside angularjs controller if($scope.combo === 'address') { $('form-area').html('form code here...'); } </script>

android - What is return value of Locale.getDefault() if two locales are set? -

with localelist apis, there rule on of added locales returned locale.getdefault() ? documentation localelist mentions localelist.getdefault() - "the result guaranteed include default locale returned locale.getdefault() , not @ top of list." not clear locale returned locale.getdefault() . there option of ordering locales priority. return value of locale.getdefault() is primary locale set on device.

Java Switch Case Error -

i'm here trying switch case send data jtable althoug runs case x, doesn't send table. put code here , apreciate if guys me. function switch case private void gerar(int x) { defaulttablemodel model = (defaulttablemodel) jtable1.getmodel(); model.setrowcount(0); connection conn = null; statement stmt = null; switch (x) { case 1: system.out.println("case 1"); jtable1.setmodel(new javax.swing.table.defaulttablemodel( new object[][]{}, new string[]{ "utilizador", "password" } ) { boolean[] canedit = new boolean[]{ false, false }; public boolean iscelleditable(int rowindex, int columnindex) { return canedit[columnindex]; ...

c# - DataSet Saving Changes -

Image
i have visual studio c# forms project. in project smartcon.mdf. can see below dataset created. for reason data not saving. when add player dataset code follows. smartcondataset.playersrow newplayer = mydata.players.newplayersrow(); newplayer.id = guid.newguid().tostring(); newplayer.guid = newguid; newplayer.firstseen = datetime.now; newplayer.kills = 0; newplayer.deaths = 0; newplayer.totalscore = 0; mydata.players.addplayersrow(newplayer); smartcondataset.namesrow newname = mydata.names.newnamesrow(); newname.id = guid.newguid().tostring(); newname.name = name; newname.playerid = newplayer.guid; newname.active = 1; mydata.names.addnamesrow(newname); //update database mydata.acceptchanges(); why isn't data saving database? update: can confirm data getting added dataset, not transfering database. update 2: may need connection string database???? update 3: var playertableadapter = new smartcondatasettableadapters.playerstableadapter(); smartcondataset.pl...

macros - VBA Powerpoint How to know which shape is clicked during a presentation -

in powerpoint can link command button macro. but in powerpoint 2013 such macro cannot have parameters; in popup list link button macro subroutines without parameters visible. (in previous versions of powerpoint possible link button sub dosomethingto(osh shape) osh shape clicked) in subroutine (macro) want know shape clicked. this still works in ppt 2013 , later public subroutines. when assign macro action setting, won't see private subroutines or subs @ in modules private (ie, have option private module @ start).

r - plot bipartite graph created with Networkx using igraph -

i have trouble reading bipartite matrix in igraph. created bipartite graphs using networkx , exported them biadjacency matrix: bipartite.biadjacency_matrix(graph[i],row_order=bipartite.sets(stockgraph[i])[0], column_order=bipartite.sets(stockgraph[i])[1],format='csr') then import 10x10 matrix in r using igraph : data <-readmat("graphtomatlab1.mat") data1 <- data$graphtomatlab[[1]][[1]] graph <- graph_from_adjacency_matrix(data1, mode="undirected") here sparse matrix: data1 10 x 10 sparse matrix of class "dgcmatrix" [1,] 1 . . . . . . . . . [2,] . . . . 1 . . . . . [3,] . . 1 . . 1 . . . . [4,] . . . . 1 . 1 1 . . [5,] . . . . . . . . . 1 [6,] . . 1 1 . . 1 . 1 . [7,] . . 1 1 1 2 . . . . [8,] . . 1 . . 1 . . . . [9,] . . 1 1 . . . 1 . . [10,] . 2 . . . . . . . . graph igraph u--- 10 21 -- + edges: [1] 1-- 1 2-- 5 2--10 2--10 3-- 3 3-- 6 3-- 7 3-- 8 3-- 9 4-- 5 4-- 6 4-- 7 4-- 8 4-- 9 5...

c++ - I want to input character and integers by scanf into a structure -

ok, i'd input one-letter character , 3 numbers structure using scanf, , want print 4 of them using function prints it. everytime run errors saying can't run it, or prints right except character part, go blank.. possibly wrong this?? #include <stdio.h> struct score { char a; float x, y, z; }; void main(void) { void avg(char *a, float x, float y, float z); char a1 = 'b'; float x1 = 0, y1 = 0, z1 = 0; printf("enter alphaber\n"); fflush(stdin); scanf_s("%c", &a1); printf("enter 3 numbers (ex:1,2,3)\n"); fflush(stdin); scanf_s("%f,%f,%f", &x1, &y1, &z1); struct score s1 = { a1, x1, y1, z1 }; avg(s1.a, s1.x, s1.y, s1.z); } void avg(char *a, float x, float y, float z) { printf("%c (%f,%f,%f) \n", a, x, y, z); } the signature of avg() wrong. first argument should not char* char . because hate msvc-specific code, code sh...