Posts

C# how add icon into .exe -

how can import .ico .exe in c# ? (i want have 1 file) in resources file have: icon.ico when click on icon, in properties have: "embedded resource" what shoud do(change)? trayicon.icon = new icon("c:\\users\\wulp\\documents\\visual studio 2013\\projects\\wifiswitch\\wifiswitch\\resources\\icon.ico"); and, how have use relative path ? thanks you have add icon resource. see: https://msdn.microsoft.com/en-us/library/7k989cfy(v=vs.80).aspx when you've added resource can point it.

asp.net - Can I use System.Web.UI.Page in console application? -

i want test function in web page. have way use system.web.ui.page in console application , put in session , test way? i created test class , inherit page not put session in it. when type "mypage." show below, not see come out after "." <testclass()> public class unittest2 inherits system.web.ui.page dim mypage = new system.web.ui.page mypage. end class please help! update: below code seemed pass compiler <testclass()> public class unittest2 <testmethod()> public sub testcheckrules() dim mypage testwebpage = new testwebpage mypage.testsession() end sub end class public class testwebpage inherits system.web.ui.page public sub new() end sub public sub testsession() dim firstname string = "john" dim lastname string = "smith" dim city string = "seattle" session("firstname") = firstname session("la...

php - How to convert a string of numbers into an array? -

i have string e.g. 1398723242 . trying check string , odd numbers out in case 13973 . i facing problem on how put string array. after putting string array know have loop through array, this: foreach($array $value){ if($value % 2 !== 0){ echo $value; } } so can body please on first part on "how put above string array can evaluate each digit in above loop?" this should work you: just use str_split() split string array. can use array_filter() filter numbers out. e.g. <?php $str = "1398723242"; $filtered = array_filter(str_split($str), function($v){ return $v & 1; }); echo implode("", $filtered); ?> output: 13973

android - Wearable.DataApi.putDataItem(GoogleApiClient, PutDataRequest) leaks when used in working thread -

i using task repeatedly executed sync data between wearable , handheld. therefore service started starts postdelayed runnable. in run() method putdatarequest created , send via wearable.dataapi.putdataitem(googleapiclient, putdatarequest); after new run of task schedulead via postdelayed() method. that works fine, however, line: wearable.dataapi.putdataitem(googleapiclient, putdatarequest); somehow leaks , therefore after time app crashes. know why? or bug of api? my code of runnable follows: private static class weakrunnable implements runnable{ private weakreference<wearmanagerwearable> weakwearmanager; private weakreference<hashmap<integer,mysensoreventlisteners>> weaklistenerlist; private weakreference<handler> weakhandler; protected weakrunnable(wearmanagerwearable wearmanager, hashmap<integer,mysensoreventlisteners> listenerlist , handler handler ){ weakwearmanager = new weakreference<>(wearmanager)...

android - Change background colour of listview items based on cursor results -

i have following listview.. private void populatekpilistview(string storedstaffid, view view, string id){ //list 1 cursor cursor = db.getallrows("*", dbtables.table_kpis, "where projectid=" + id); int count = db.getrowcount("*", dbtables.table_kpis, "where projectid=" + id); textview empty = (textview)view.findviewbyid(android.r.id.empty); if(count > 0){ empty.setvisibility(view.gone); string[] fromfieldnames = new string[] {dbtables.key_kpiheader, dbtables.key_target, dbtables.key_actual}; int[] toviewids = new int[] { r.id.card_title, r.id.card_target, r.id.card_actual}; mycustomadaptor = new customlistadapter(getactivity(), r.layout.kpi_list_item_card, cursor, fromfieldnames, toviewids, 0); kpilist = (listview)view.findviewbyid(android.r.id.list); kpilist.setadapter(mycustomadaptor); kpilist.setonitemclicklistener(new onitemclicklistener...

asp.net - MVC Action giving IIS access denied error -

i have strange issue affecting 1 of actions in specific controller. all other actions in controller post fine, when post view of 1 particular action error: http error 403.0 - modsecurity action not have permission view directory or page. this confuses me views post in similar fashion , use same web.config files. my view: <form action="/admin/editmenus" method="post" class="form-horizontal"> ....standard form controls in here..... </form> my controller: [httppost] public actionresult editmenus(string mondayweek1regulardescription, string mondayweek1regularcost, string mondayweek1vegetariandescription, string mondayweek1vegetariancost, string mondayweek1nocarbdescription, string mondayweek1nocarbcost, string mondayweek1kiddiesdescription, string mondayweek1kiddiescost, string tuesdayweek1regulardescription, string tu...

migrate tomcat 6 to 7; JSF; java.lang.NoClassDefFoundError: com/sun/enterprise/InjectionException -

Image
i need migrate tomcat 6 project (java 6) tomcat 7 server (java 7). right receive following error(s) server: console: information: tld skipped. uri: http://java.sun.com/jsp/jstl/xml defined jul 09, 2015 9:47:38 com.sun.faces.config.configurelistener contextinitialized information: mojarra 2.2.11 ( 20150505-0732 https://svn.java.net/svn/mojarra~svn/tags/2.2.11@14688) für kontext '/cm-tool' wird initialisiert. jul 09, 2015 9:47:39 com.sun.faces.config.configurelistener contextinitialized schwerwiegend: critical error during deployment: java.lang.noclassdeffounderror: com/sun/enterprise/injectionexception @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:274) @ com.sun.faces.util.util.loadclass(util.java:364) @ com.sun.faces.spi.injectionproviderfactory.getproviderfromentry(injectionproviderfactory.java:317) @ com.sun.faces.spi.injectionproviderfactory.findproviderclass(injectionproviderfactory.java:285) @ com.sun.faces....