Posts

android - Keep service running in background even user clear memory -

i have service follows: public class service extends service { private static final string tag = "myservice"; @override public void oncreate() { super.oncreate(); log.d(tag, "oncreate"); } @override public ibinder onbind(intent intent) { return null; } public void ondestroy() { toast.maketext(this, "my service stopped", toast.length_long).show(); log.d(tag, "ondestroy"); } @override public int onstartcommand(intent intent, int flags, int startid) { intent intents = new intent(getbasecontext(),mainactivity.class); intents.setflags(intent.flag_activity_new_task); startactivity(intents); toast.maketext(this, "my service started", toast.length_long).show(); log.d(tag, "onstart"); return start_not_sticky; } } it worked well, , can check service running when go application setting. howe...

java - liferay portlet spring mvc form is empty -

i have problem. form submit empty. public class customer implements serializable{ private static final long serialversionuid = 1l; private string firstname; private string middlename; private string lastname; private int age; private string address; public string getfirstname() { return firstname; } public void setfirstname(string firstname) { this.firstname = firstname; } public string getmiddlename() { return middlename; } public void setmiddlename(string middlename) { this.middlename = middlename; } public string getlastname() { return lastname; } public void setlastname(string lastname) { this.lastname = lastname; } public int getage() { return age; } public void setage(int age) { this.age = age; } public string getaddress() { return address; } public void setaddress(string address) { thi...

excel - Go up one folder level -

i have macro gets sub folder data. want main folder. i looked @ how current working directory using vba? need change activeworkbook path: application.activeworkbook.path might "c:\parent\subfolder" i want "c:\parent\" using excel 365 vba as path may not current working directory need extract path string. find last \ , read characters left: parentpath = left$(path, instrrev(path, "\")) if working around current directory chdir ".." jump 1 level, new path can returned currdir .

hadoop - Accessing HDFS Remotedly -

i have hadoop server runs on server, let's on ip 192.168.11.7 , have core-site.xml follows : <configuration> <property> <name>fs.defaultfs</name> <value>hdfs://localhost:9000</value> </property> i run hdfs, i.e. command : sbin/start-dfs.sh now, want access hdfs local computer browser. possible? i tried http://192.168.11.7:9000 or http://192.168.11.7:50075 , no avail. i.e. site can’t reached thank much edited : this content of hdfs-site.xml : <configuration> <property> <name>dfs.replication</name> <value>1</value> </property> <property> <name>dfs.webhdfs.enabled</name> <value>true</value> </property> <property> <name>dfs.namenode.http-address</name> <value>0.0.0.0:50070</value> </property> and core-site.xml : <configuration> <property> ...

angular - How to extract type out of observable<type> in typescript -

i trying create utility class have common functions used among components. below code import { component, oninit } 'angular2/core'; import { commonservice } './services/common.service'; import { observable } 'rxjs/observable'; @component({ providers: [commonservice] }) export class utils { constructor(private _commonservice: commonservice) { } getcolumnnames(database: string, tablename: string): string[] { return this._commonservice.getcolumnnames(database, tablename).subscribe(data => this.promise(data)); } private promise(data: string[]) { return data; } } the common service return observable<string[]> , want extract string[] out of observable<string[]> . know can create private promise retrieve how send calling function in components.

python - Jinja range raises TemplateSyntaxError in Django view -

in django jinja2 tempate code {% in range(10) %} foo {{ }}<br> {% endfor %} a templatesyntaxerror raised error message could not parse remainder: '(10)' 'range(10)' what need in order loop on range in jinja2 template. i found link in django documentation explaining because django intentionally limits amount of logic processing available in template language, not possible pass arguments method calls accessed within templates. data should calculated in views, passed templates display. but don't think applies range function. django not using jinja2, django template language. there no range function in django template language.

sql - Transpose Columns to Rows - Teradata -

i have 2 tables following data tablea types columna columnb columnc dart 8.00 9.00 10.00 tableb types descp acnt dart columna 14000 dart columnb 15000 dart columnc 16000 my expected output types amt acnt dart 8.00 14000 dart 9.00 15000 dart 10.00 16000 i have written following code output select x.types, case when descp='columna' columna when descp='columnb' columnb when descp='columnc' columnc else null end amt, b.acnt tablea x join tableb y on x.types=y.types these sample data , there around 10 types , more 10 columns. there other option apart writing case statements including columns achieve this? thanks use teradata td_unpivot it's purpose need.