Recent Notes

Displaying keyword search results 1 - 5
Created by magnum on October 22, 2012 20:03:05    Last update: October 22, 2012 20:03:05
First, the test command that sleeps random number of seconds ( sleeper.sh ): #!/bin/bash stime=$[$RANDOM % 20] sleep $sti... As comparison, synchronous pipe code: #include <sys/wait.h> #include <stdio.h> #in... Asynchronous pipe code: #include <sys/wait.h> #include <stdio.h> #in...
Created by freyo on August 25, 2011 09:07:40    Last update: August 25, 2011 20:45:43
This is a list of built-in Android permission values: Permission Description Since API Level android.permission.ACCESS_CHECKIN_PROPERTIES Allows read/write access to the "properties" table in the checkin database, to change values that get uploaded. 1 android.permission.ACCESS_COARSE_LOCATION Allows an application to access coarse (e.g., Cell-ID, WiFi) location 1 android.permission.ACCESS_FINE_LOCATION Allows an application to access fine (e.g., GPS) location 1 android.permission.ACCESS_LOCATION_EXTRA_COMMANDS Allows an application to access extra location provider commands 1 android.permission.ACCESS_MOCK_LOCATION Allows an application to create mock location providers for testing 1 android.permission.ACCESS_NETWORK_STATE Allows applications to access information about networks 1 android.permission.ACCESS_SURFACE_FLINGER Allows an application to use SurfaceFlinger's low level features 1 android.permission.ACCESS_WIFI_STATE Allows applications to access information about Wi-Fi networks 1 android.permission.ACCOUNT_MANAGER Allows applications to call into AccountAuthenticators. Only the system can get this permission. 5 android.permission.AUTHENTICATE_ACCOUNTS...
Created by freyo on May 05, 2011 09:00:36    Last update: May 05, 2011 09:07:27
This example uses an Intent with Uri scheme tel: to invoke the phone dialer. Create a new project with: $ ~/android-sdk-linux_86/tools/android create proj... Update the layout res/layout/main.xml to add a text field and a button: <?xml version="1.0" encoding="utf-8"?> <LinearL... Update the Java class src/com/android/intenttest/CallPhone.java to handle button click and start the built-in phone dialer with Intent : package com.android.intenttest; import andr... Update AndroidManifest.xml to add CALL_PHONE permission: <?xml version="1.0" encoding="utf-8"?> <manifes... Install to the emulator and test: ant install The phone dialer will be invoked when you click the "Call" button. So how did this happen? The CallPhone activity creates an Intent with action Intent.ACTION_CALL and Uri tel:<a number> and sends it off to Android. Android starts the activity com.android.phone.OutgoingCallBroadcaster because the intent matches the...
Created by Dr. Xi on January 31, 2011 16:24:31    Last update: January 31, 2011 16:24:58
Perl file test operators are unary operators that takes one argument, which can be a file name, a filehandle, or dirhandle. If the argument is omitted, it tests $_ , except for -t , which tests STDIN. Syntax: -X FILEHANDLE -X EXPR -X DIRHANDLE -X where X is: Operator Meaning -r File is readable by effective uid/gid. -w File is writable by effective uid/gid. -x File is executable by effective uid/gid. -o File is owned by effective uid. -R File is readable by real uid/gid. -W File is writable by real uid/gid. -X File is executable by real uid/gid. -O File is owned by real uid. -e File exists. -z File has zero size (is empty). -s File has nonzero size (returns size in bytes)....
Created by Dr. Xi on October 26, 2010 04:47:37    Last update: January 11, 2011 20:00:36
The code presented here is a simple implementation of a tab set. It is used to demo how a tab set could be implemented. The code is stand alone and does not depend on any JavaScript libraries. Multiple tab sets within the same page is supported. The HTML markup is fairly simple: Tabs sets are contained within a DIV element with class name "tabsContainer". Define a UL list for the tabs. Follow the UL list with equal number of DIVs for the tab contents. The Nifty Corners Cube technique is used to draw the rounded corners (original form, not the enhanced JavaScript form). HTML, CSS and JavaScript: <!doctype html> <html> <head> <style typ...