Posts

osx - How to build files as root in sublime on mac? -

today after updated os x 10.9.5 , xcode on mac , encounter problem sublime text 2 when write hello world program in c++, , run build, says agreeing xcode/ios license requires admin privileges, please re-run root via sudo. agreeing xcode license outside sublime text may resolve issue. running sudo xcrun cc should bring cli version of xcode license agreement. option open xcode.app , agree in gui.

python pandas parse_dates column wildcard for sqlalchemy in pandas 0.14.1? -

i'm using sqlalchemy allows sql queries released 0.14.1 version of pandas. import pandas pd dateutil import parser sqlalchemy import create_engine import datetime a=[['datetime', 'now date', 'numbers', 'mixed'], ['1/2/2014', datetime.datetime.now(),6, 'z1'], ['1/3/2014', datetime.datetime.now(), 3, 'z1']] df = pd.dataframe(a[1:],columns=a[0]) df['datetime']=df['datetime'].map(lambda x: parser.parse(x)) engine=create_engine('sqlite:///:memory:') df.to_sql('db_table',engine, index=false) df_new=pd.read_sql_query("select * db_table ",engine) >>> df.dtypes datetime datetime64[ns] date datetime64[ns] numbers int64 mixed object dtype: object >>> df_new.dtypes datetime object date object numbers int64 mixed object dtype: object as can see, original datetime format lost when feeding engine. pandas gives w...

substr - Substract a part of a string considering some delimiters in php -

i have variable in php witch can have shape: $a = 'help&type=client'; $b = 'account#client'; $c = 'info&type=client#new'; i need create substract function work this: echo myfunction($a); //&type=client echo myfunction($b); //#client echo myfunction($c); //&type=client#new i rate more simplified answere. i think simplest way using strpbrk . $a = 'help&type=client'; $b = 'account#client'; $c = 'info&type=client#new'; echo strpbrk($a, '&#') . php_eol; //&type=client echo strpbrk($b, '&#') . php_eol; //#client echo strpbrk($c, '&#') . php_eol; //&type=client#new

windows phone 8 - Detect network roaming when there is no Internet connection -

i detect network roaming, while there not internet connection on windows phone 8 , 8.1. used code determine if user in roaming: connectionprofile profile = windows.networking.connectivity.networkinformation.getinternetconnectionprofile(); if (profile == null) return false; else return profile.getconnectioncost().roaming; with code easy find if phone in roaming when there internet access. problem occurs when there not connection , connectionprofile returns null. searched internet , stack overflow detecting network roaming, without results. suggested use mnc , mcc, windows phone doesn't provide such information or more detailed network info. didn't find either function android telephonymanager.isnetworkroaming(). is there function, api or method detect user in roaming, when internet connection down? you try this, using microsoft.phone.net.networkinformation; private void button1_click(object sender, routedeventargs e) {...

php - __autoload() vs include,will __autoload() output something? -

i developing programm , it's based on third-party.i write class , use __autoload() load class. program runs following: 1.i upload script remote server. 2.the third-party server request script param. 3.my script return str , third-party server check str,if str same param,it's valid,if not,it's not valid. now,the problem is: when use __autoload(),it raise error , when replace __autoload include/require run exactly. code following: wechat.class.php public function __construct($options){ $this->_token=isset($options['token'])?$options['token']:''; } public function test(){ var_dump($this->_token); } private function checksignature(){ $signature = isset($_get["signature"])?$_get["signature"]:''; $timestamp = isset($_get["timestamp"])?$_get["timestamp"]:''; $nonce = isset($...

c# - Row Command Event not fired for Dynamically created buttons inside gridView -

i have gridview in dynamically creating label , button on gv_rowdatabound. .cs label tagvalue = new label(); tagvalue.id = "lbltags_"+i; //tagvalue.cssclass = "tagbubble tagbubbledelete"; tagvalue.text = tag; button delete = new button(); delete.id = "btndelete_" + i; delete.tooltip = "delete"; delete.cssclass = "tagbubbledelete"; delete.commandname = "delete"; delete.commandargument = imageid.text; the problem "rowcommand" function not getting fired. not able reach e.commandname=="delete". what can done fire rowcommand event dynamically created button inside gridview. any appreciated. *******edit .aspx <asp:gridview runat="server" id="mygv" allowsorting="false" allowpaging="false" pagesize="20" autogeneratecolumns="false" datasourceid="ldsgv" ...

how to get the value from json in android -

hi getting following json pentaho server,how need date json "queryinfo":{ "totalrows":"1" }, "resultset":[ [ "09-09-2014" ] ], "metadata":[ { "colindex":0, "coltype":"string", "colname":"dt" } ] } the best way use gson deserilize string: create class in separate file. import java.util.list; import com.google.gson.annotations.serializedname; public class pentaho { public queryinfo queryinfo; public static class queryinfo { public list<result> metadata; public static class result { @serializedname("colindex") public string colindexstr; @serializedname("coltype") public string coltypestr; @serializedname("colname") public string colnamestr; } } } in activity ...