Posts

c# - TreeViewItem to notify ViewModel when it is hovered -

i using code this blogpost in order have treeview highlight items, hovered mouse. working intended, want treeviewitems notify attached viewmodels when hovered / not hovered. however i'm @ loss on how can achieve this. corresponding xaml code looks following: <style targettype="{x:type treeviewitem}"> <style.triggers> <trigger property="controls:treeviewhelper.ismousedirectlyoveritem" value="true"> <setter property="background" value="green" /> </trigger> </stile.triggers> </style> how can bind property viewmodel, named treenodemodel.ishovered treeviewitem (or attached dependency property ismousedirectlyoveritem) can react on changes within code? all examples found via google explained how set background color. in advance time on trivial answer. in style , try adding setter binds ismousedirectlyoveritem ishovered , , use onewaytosour...

java - Calculating the connection count of a network -

the question calculate connection count of connected mesh topology network. total number of connections can calculated formula (n x (n-1)) / 2. implement public class connectioncount method recursively , else given us. problem can't compile. trying figure out how call method on later program compile i'm confused. please help, have far: public class connectioncount { private int n; public int connectioncalc(int n){ if(n > 0){ return(n-1) + connectioncalc(n-1); return connectioncalc(n); } else{ return 0; } } public static int connectioncount(int n) { return 0; } public static void main(string [] args) { (int = 0; < 20; i++) { system.out.println("connectioncount(" + + ") returns " + connectioncount(i)); } } } just remove second return in code. it's unreachable, compiler undoubtedly telling you.

javascript - How can I fix custom Kendo UI theme CSS which causes an IE 8 glitch? -

trying: kendo ui mendu demo custom theme ( kendo ui custom themes or modified theme css) i've customized bootstrap theme, , encountered glitch in ie 8 when mousing on menu item, when using custom theme css. customized bootstrap theme example: http://jsbin.com/ovufef/1/edit (glitch in ie 8) original bootstrap theme example: http://jsbin.com/urinev/1/edit (works expected) kendo ui menu: <ul id="menu"> <li> stores <ul> <li> <div style="padding: 50px;"> <h2>around globe</h2> </div> </li> </ul> </li> </ul> <script> $(document).ready(function() { $("#menu").kendomenu(); }); </script> view css in jsbins, long include here since kendo themes. basically glitch when mouse on item, not drop sub item down immediately, must move mouse on sub item disp...

java - SWT Button Dropdown Control -

Image
is there standard swt control resembles button displays arrow , opens dropdown menu when pressed , not toolbar-only control ? it this: it similar combo box control, except "button" area act more actual button - text not change based on selection, appear depressed when clicked, , items used actions or navigational purposes instead of selection. it's similar control available toolbars, need use on regular composite instead. this doable using regular button , popup-menu controls - however, not believe can display arrow next text on button way. anyway, since kind of control seems common, assumed there standard way use these 2 things one. i think, should drop down menu behavior create menu style swt.drop_down create menuitems on menu if want button create button style swt.arrow | swt.down add selectionlistener in selectionlistener , create menu style swt.pop_up , position menu @ button location. //code public static void main(stri...

php - Insert nested array from json response into mysql -

i have following json response received client: { "name": "joel", "cities_visited": [{ "city1": "chicago", "city2": "seattle" }], "active": true } i using json_decode results having problems inserting cities_visited 1 single set of data mysql. have tried json_decode($json, true) no luck. can give me insight how data formatted prepared can insert db? i need somehow cities_visited array 1 entry row on mysql , able out , return same json_encode if have 1 column cities_visited , need put multiple values it, need serialized somehow. since you're dealing json might turn json send database. $user = json_decode($input); $user->cities_visited = json_encode($user->cities_visited); something that. isn't best solution though, want create many-to-man relationship between users , cities users id (int) name (string) status (string) citie...

android - Wrap buttons ontop and in middle using Relative Layout -

Image
i have layout similar kinda feel guilty because asked question layouts had no idea needed this(nor did know hard), have researched view layouts , i've tried use layout.torightof etc etc. have left/right arrows, need add , down buttons <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:game_view="http://schemas.android.com/apk/res/pap.crowslanding" android:layout_width="fill_parent" android:layout_height="wrap_content" > <framelayout android:id="@+id/flayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_above="@+id/button1" android:orientation="vertical" > <pap.crowslanding.gameview android:id="@+id/game_view" android:layout_width="fill_parent" android:layout_height=...

java - Is this possible with regular expression? -

() [] {} these valid matches ({)} false, eg.: () - true ()[]- true ()[]{} - ture ([]) - false (){[}] - false. can use regular expression compute this? no, 1 of known limitations of regular expressions can't tell whether parentheses formed.