Recent Notes

Displaying keyword search results 1 - 7
Created by Dr. Xi on April 29, 2013 09:00:48    Last update: April 29, 2013 09:00:48
In the case proposed by Diony , signing multiple elements by id, simply change the newSignedInfo to: // Create the SignedInfo final List transforms0... I must admit that I don't understand transformations, so take my example code with a grain of salt. Also, signing a doc fragment by PATH does not work, simply because there's no way to identify the fragment with a URI without referring to it by id. Reference ode from org.jcp.xml.dsig.internal.dom.DOMURIDereferencer : // Check if same-document URI and register...
Created by magnum on November 03, 2012 08:57:35    Last update: November 03, 2012 08:57:35
Code snippet to check user name and password in C in Linux #include <sys/types.h> #include <pwd.h> #inc...
Created by freyo on July 21, 2011 15:53:47    Last update: July 21, 2011 15:53:47
Use SharedPreferences to persist an instance state. The state is saved even when the app is killed. public void onCreate(Bundle savedInstanceState) { ...
Created by freyo on July 21, 2011 15:31:11    Last update: July 21, 2011 15:31:11
Override onSaveInstanceState to save the state of an Activity instance. Restore the state in onCreate : @Override public void onCreate(Bundle savedInst... The state only exists while the application is still in the history stack. It is lost if the application is terminated (finalized).
Created by freyo on May 09, 2011 12:50:52    Last update: May 09, 2011 12:51:54
You can use the android.os.StatFs class to check for available space on the sd card. Example code: // import android.os.Environment; // import...
Created by jinx on April 29, 2011 13:43:13    Last update: April 29, 2011 13:44:34
List of functions testing variable type: Function Description is_bool Finds out whether a variable is a boolean is_double Alias of is_float() is_float Finds whether the type of a variable is float is_int Find whether the type of a variable is integer is_integer Alias of is_int() is_long Alias of is_int() is_null Finds whether a variable is NULL is_numeric Finds whether a variable is a number or a numeric string is_object Finds whether a variable is an object is_real Alias of is_float() is_scalar Finds whether a variable is a scalar is_string Find whether the type of a variable is string Test code: <?php class A { } $a = ar... Output: var_dump: int(1) ------------------------- i...
Created by freyo on April 18, 2011 14:14:29    Last update: April 18, 2011 14:15:48
For XML resources, Android returns an XmlPullParser reference. I tried the RSSReader example from xmlpull.org , it failed both on the Android emulator and with xpp3-1.1.4c . This is an example for XmlPullParser usage. Since the XmlPullParser is event based, a callback mechanism works better. Java code: import java.io.*; import java.net.*; import ... The XML file used: <?xml version="1.0" encoding="UTF-8"?> <catalog...