Posts

c# - Extending an application and accessing its functions -

i'm trying design lightweight service performs scheduled tasks. since want able add new\different tasks, i've been reading lot reflection , inversion of control\dependency injection. different options , frameworks though, i'm lost in simplest question: how access new functions can executed? most design/patterns adding extensibility application , frameworks based on them encourage, force use well-defined interfaces in parts need extend application, unified interfaces, accessing new functions should done through these well-defined interfaces , managing , calling new methods , execution flow should considered internal implementation of plugin/extension. so believe first step find requirements , unified them extension point, after implementing extensions based on framework of choice.

android - Delay while launching activity from service -

i have broadcast receiver receives screen off broadcast, , when screen turned off, launches activity. i've named activity lockscreenactivity. i've added getwindow().addflags(windowmanager.layoutparams.flag_show_when_locked); in oncreate() of activity, appears on top of android lockscreen, want. works enough, mostly. problem happens whenever press home button send any app background. when press home button return home screen app, , press power button turn off screen, , press power button in second turn in on, shows android lock screen. activity gets created 3-4 seconds later. huge delay , unacceptable. in other scenarios, delay not happen. if i've been in home screen time, or other app open, , click power button twice in quick succession, see lockscreenactivity before seeing android lockscreen. my app has few other normal activities (launched app drawer) , service shows persistent notification. same lockscreenactivity launched whenever notification clicked. inter...

BigQuery loading batch folders error -

i'm trying load group of folders files in 1 time when set sourceuri = 'gs://ybbi/bi_landing_zone/files_to_load/app/reports/app_network_analytics_report/201409011*' all folders i'm want load start 20140911 but error: error: invalid path: gs://ybbi/bi_landing_zone/files_to_load/apn/reports/appnexus_network_analytics_report/20140901191111_3bab8ec0_092a_43de_a157_db35d1555ea0/ 20140901191111_3bab8ec0_092a_43de_a157_db35d1555ea0 1 of these folders(don't know why it's print folder name of specific folder) in other folder tree cases it's works, in specific folder tree it's return same error . i know cloud storage don't have real folders , it's part of name of object, understand mean. is bug? without more information, looks have object file called gs://ybbi/bi_landing_zone/files_to_load/apn/reports/appnexus_network_analytics_report/20140901191111_3bab8ec0_092a_43de_a157_db35d1555ea0/ not csv/json file. tools may create thes...

Button click event not fire properly in <include> tag in ANDROID -

i have 3 xml files 1) header 2) firstactivity 3) secondactivity. header.xml <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent"> <button android:text="button 1" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onclick="first1" > </button> <button android:text="button 2" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onclick="second" > </button> </linearlayout> firstactivity.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="h...

java - Null resultsets when calling Sybase stored procedure through JDBC -

i'm calling sybase stored procedure returns multiple resultsets through jdbc. need specific result set has column named "result" code : callablestatement cs = conn.preparecall(sqlcall); cs.registeroutparameter(1, types.varchar); cs.execute(); resultset rs=null; int count = 1; boolean flag = true; while (count < 20000 && flag == true) { cs.getmoreresults(); rs = cs.getresultset(); if (rs != null) { resultsetmetadata resultsetmetadata = rs.getmetadata(); int columnscount = resultsetmetadata.getcolumncount(); if (resultsetmetadata.getcolumnname(1).equals("result")) { // action code resultset found flag = false; // loop on resultset , add elements returned array list while (rs.next()) { int x = 1; while (x <= columnscount) { result.add(rs.getstring(x)); x++; } } ...

regex - how to transforming pseudo xml into flat structure? -

i'm trying parse file looks xml not. actualy readable version of crd transformed asn1 format. looks this: <pin rownum="1"> <cgpa tag="3100.2.960.51" value="1"> <data tag="3100.2.962.56" name="cgpasubscriberidentifier" value="50212000000089804"/> <data tag="3100.2.962.60" name="cgparoaming" value="1"/> </cgpa> <aaa_common tag="3100.2.960.1" value="1"> <data tag="3100.2.962.12" name="sigsleeid" value="watbf102"/> <data tag="3100.2.962.34" name="scpaddress" value="48602888950"/> </aaa_common> <evt tag="3100.2.134.28" name="unsupported" value="0"/> <data tag="3100.2.112.1" name="eventdatetime" value="07/05/2014 19:45:18"/> <data tag="3100.2.137.4" name="intriggeringkey...

vim - Load gtags with given gtags root -

i have log file(in /home/logs) file names , line numbers. want files in project rooted @ /x/projects/project12/ . how use gtags files while log file opened in vim ? 1 clumsy way copy log file in project directory. is there better way, while log file opened in vim set gtagsroot /x/projects/project12/ , lookups happen in project ? edit: gtags created gtags command in project root. the gtags-scope.vim plugin uses global -pq find location of gtags file. easiest solution set current working directory project directory via :cd ~/project . but there better way! use gf . can add project root 'path' option , gf , <c-w>f , :find , , friends work. doing following: :set path+=~/project or if want adjust 'path' option buffer do: :setlocal path+=~/project for more see: :h 'path :h gf :h :cd