Posts

asp.net - on click for asp:textbox? -

asp.net - on click for asp:textbox? - im looking way have textbox contain bit of text until users clicks come in own text. search field , client wants textbox have "search stock" in textbox, when users clicks in it, becomes null can come in own criteria. cant see onclick or similar in designview textbox though, hints? thanks <asp:textbox runat="server" value="search stock" id="textbox1" onfocus="if (this.value == 'search stock') this.value = ''; " onblur="if (this.value == '') this.value ='search stock'; " /> asp.net visual-studio-2010

Why is my android device resetting itself? -

Why is my android device resetting itself? - i have semc x10 mini pro, has tendency randomly reset no apparent reason. i inspect android scheme log file prior reset, unsure how this. i have tried app "log collector", however, logs produced app contain info lastly start-up, ie don't contain logging i'm interested in - before "last start-up", around "last shutdown". any advice out there? you improve luck on android stack exchange, unless looking programmatically. in case take through log collector source code , see if can modify save txt file persist through restart can go through 1 time device rebooted. android

matlab - plot matrices in desired colors -

matlab - plot matrices in desired colors - how possible assign color value matrix. illustration have 10by10 matrix values 0 9. afterwards i'd "chess board" 0 = white, 1 = black, 2 = blue...etc... 2nd question if run operations matrices alter each loop , run let's 10 lops (k = 10) - possible create video out of 10 plot pictures i'll getting after each loop. (i'm programming kind of cellular automaton, i'd see how situation changes on time). thanks consider example: %# lets create 10-by-10 matrix, of values in range [0,9] m = fspecial('gaussian',10,2.5); m = (m-min(m(:))) ./ range(m(:)); m = round(m*9); %# prepare video output vid = videowriter('vid.avi'); vidobj.quality = 100; vid.framerate = 5; open(vid); %# display matrix h = imagesc(m); axis square caxis([0 10]) colormap(jet(10)) colorbar %# capture frame writevideo(vid,getframe); %# iterate changing matrix i=1:50 m = rem(m+1,10); %# circular increme...

Java inheritance in Android -

Java inheritance in Android - i trying utilize code depicted in thread android: software keyboard shown? as can see author using class inherits linearlayout. , later initialize new instance follows: linearlayoutthatdetectssoftkeyboard mainlayout = (linearlayoutthatdetectssoftkeyboard)findviewbyid(r.id.main); is possible?i getting classcastexception. , explains here downcasting first need reference parent child. yes thats possible. did declare custom linearlayout correctly in main.xml layout? like: <com.yourpackage.linearlayoutthatdetectssoftkeyboard></com.yourpackage.linearlayoutthatdetectssoftkeyboard> java android inheritance casting

php - Cakephp Minimum value query -

php - Cakephp Minimum value query - i have issue cakephp can retrieve min value score field cannot seem id same row using grouping aswell. below code. doing wrong? function index() { $this->leaderboard->recursive = 0; $this->set('leaderboards', $this->paginate()); $min = $this->leaderboard->find('all', array( 'fields' => array('min(leaderboard.score) min_score') )); $minimum = $min[0][0]['min_score']; pr($min); echo $minimum; if (!empty($this->data)) { $this->leaderboard->create(); if($this->data['leaderboard']['score'] > $minimum){ if ($this->leaderboard->save($this->data)) { $this->session->setflash(__('the leaderboard has been saved', true)); $this->leaderboard->delete($min[0]['leaderboard']['id']); } else { ...

java - Enforcing security on broadcast receiver without access to calling package -

java - Enforcing security on broadcast receiver without access to calling package - i've been working on android app receives intents several known applications. question whether there way calling bundle when broadcastreceiver receives intent? the situation don't have access calling bundle , cannot manipulate bundle manifest in way. familiar enforcing security using signature or permission phone call receiver isn't possible in instance. is there way this? help appreciated. may not elegant solution start logcat filter in code , start listening sending broadcast events, can retreive bundle info that. java android security broadcastreceiver

c# - using extension methods on int -

c# - using extension methods on int - i'm reading extension methods, , monkeying around them see how work, , tried this: namespace clunk { public static class oog { public static int doubleme(this int x) { homecoming 2 * x; } } class programme { static void main() { console.writeline(5.doubleme()); } } } and worked expected, extending int doubleme method, printing 10. next, beingness old c guy, wondered if this: namespace clunk { public static class boollikec { public static bool operator true(this int i) { homecoming != 0; } public static bool operator false(this int i) { homecoming == 0; } } class programme { static void main() { if ( 7 ) { console.writeline("7 true"); } } } } i think if former work, latter ought work create such int used in boolean context phone call extension metho...