Posts

android - ListView getting displayed, but App crashes on Scrolling and clicking -

i have listview custom layout named custom_ listview.xml : <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <textview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:textsize="20dp" android:padding="5dp" android:id="@+id/file_name" /> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:textsize="18dp" android:id="@+id/file_path"/> </linearlayout> and customadapter class: public class customadapter extends baseadapter { arraylist<file> result; context context; private static layoutinflater inflater=null; public customadapter(activit...

jquery - slide on iphone safari causes toggle to fire bug -

on http://inigo.nu (temporary project) i use clicking div toggle display menu ul using html: <div id="toggle-menu" class="hover">menu</div> jquery: jquery(document).ready(function(jquery) { jquery('#toggle-menu').on('click', function() { jquery('nav ul').toggle('slow'); }); }); only on iphone safari strange bug occurs. sliding after opening menu click makes opened menu dissappear again. causes strange behavior , how can fix it? sadly post: safari browser (iphone simulator): how see/monitor events being triggered? never answered. cause see triggered events. i console.log ed slide event didn't clear things my. so side question how best debug such issue. i installed developer on safari desktop , have no js errors. on slide display set inline none onclick. there no padding or overlay issues going on. any appreciated. i found question when working on solving same iss...

java - Test CheckBox on NestedTree fails -

i built tree application based on nestedtree example www.wicket-library.com/wicket-examples , i'm struggling @ testing component using wickettester. with wickettester trigger ajax event on checkbox: tester.executeajaxevent("path:to:checkbox", "onclick"); the ajaxcheckbox onupdate event fired well, it's model doesn't change. a simple page ajaxcheckbox , propertymodel works fine, model changes expected: add(new ajaxcheckbox("check", new propertymodel<>(this, "checked"))); is impossible test component wickettester? you'll have set value checkbox, executing click won't send input in request: formtester.setvalue("path:to:checkbox", true);

go - Golang: terminating or aborting an HTTP request -

what's way abort api serving error message? link call service: http://creative.test.spoti.io/api/getvastplayer?add= {"json":json}&host=api0.spoti.io&domain=domain&useragent=useragent&mobile=true to call service client need send json , params. i want test if params correct, if not want send error message. the response should json code {"result":"result","error":"error message"} i tried log.fatal , os.exit(1) stop service, not call request. panic aborts call prevents me send http.responsewriter error message. i read panic, defer, recover don't know how can use them solve problem. return works: mobile :=query.get("mobile") if mobile=="mobile" { str:=`{"resultt":"","error":"no valide var"}` fmt.fprint(w, str) fmt.println("no successfull operation!!") return} ...

wordpress - PHP 5.3.3 _server['query_string'] ERROR -

i'm using wordpress on php server 5.3.3 , got error when try $_server['query_string'] . my code below: $query_string = $_server['query_string']; if($current_user->user_nicename == "admin"){ echo '<a class="button add_to_cart_button product_type_simple" href="#" target="_blank" >lista cursos</a>'; if(isset($_get['demo'])){ if (strpos($query_string,'&demo') !== false) $enlacesindemo = str_replace("&demo","",$query_string); } } ?> <a class="button add_to_cart_button product_type_simple" href="index.php?<?= $enlacesindemo ?>" target="_self">ver todos</a> and got link: index.php?<?= $query_string ?>&demo short_open_tags in not enabled server. try using <?php ?> instead of <? ?> and <?php echo $variable;?> in...

How to color the matlab plot -

Image
is there exist way color plot in matlab? example x , y coordinate between 0 , 1. want give red zone area x times y less 0.5 , yellow rest. thank you. you can use pcolor generate pseudocolor-plot. values of x*y appropriate matrix-multiplication m . m can compared 0.5 m<0.5 . returns logical-matrix converted double double -function , passed pcolor . set colormap containing red , yellow. can apply shading flat or shading interp (additionally interpolates), lines between patches disappear. x = linspace(0,1,1000); y = x; m = x'*y; pcolor(x,y,double(m<0.5)); colormap([1,1,0;1,0,0]); shading interp this result: edit: if want several areas different colors, add new color colormap , edit color-argument of pcolor accordingly. following code generates three-zone plot: x = linspace(0,1,1000); y = x; m = x'*y; c = double(m<0.5)+double(m<0.75); pcolor(x,y,c); colormap([0,1,0;1,1,0;1,0,0]); shading flat the result looks this:

javascript - Retrieving value of b with getElementByTagName and making it integer -

first of all, new javascript. have been pulling hair getting work. have tried lot of different approaches, cannot working. want do, pull value html document javascript, , save value from: <div class="sum">sum of order: <b>530 sek</b></div> . want grab integer, 530 , , strip of else. html: <div class="order"> <div id="departdate"> <div><b>departing:</b></div> <div>2015-08-08</div> </div> <div id="returndate"> <div><b>returning:</b></div> <div>2015-08-16</div> </div> <div><b>tickets</b></div> <table> <tbody><tr> <td class="first">adult(s)</td> <td>1 x</td> <td>530 sek</td> </tr> ...