Recent Notes

Displaying keyword search results 1 - 10
Created by Dr. Xi on March 08, 2013 11:40:49    Last update: March 08, 2013 11:40:49
From Version Control with Subversion, Chapter 4. Branching and Merging In Subversion, a global revision number N names a tree in the repository: it's the way the repository looked after the N th commit. It's also the name of an implicit changeset: if you compare tree N with tree N-1 , you can derive the exact patch that was committed. For this reason, it's easy to think of revision N as not just a tree, but a changeset as well. If you use an issue tracker to manage bugs, you can use the revision numbers to refer to particular patches that fix bugs—for example, “this issue was fixed by r9238.” Somebody can then run svn log -r 9238 to read about the exact changeset that...
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 zhidao on January 25, 2012 19:27:53    Last update: January 25, 2012 19:28:47
The spring MVC annotation-driven declaration: <?xml version="1.0" encoding="UTF-8"?> <beans x... does the following magic : Among others, registers: RequestMappingHandlerMapping RequestMappingHandlerAdapter ExceptionHandlerExceptionResolver in support of processing requests with annotated controller methods using annotations such as @RequestMapping , @ExceptionHandler , etc. Enables Spring 3 style type conversion through a ConversionService instance in addition to the JavaBeans PropertyEditors used for Data Binding. Enables support for formatting Number fields using the @NumberFormat annotation through the ConversionService . Enables support for formatting Date, Calendar, Long, and Joda Time fields using the @DateTimeFormat annotation, if Joda Time 1.3 or higher is present on the classpath. Enables support for validating @Controller inputs with @Valid , if a JSR-303 Provider is present on the classpath. Enables HttpMessageConverter support for @RequestBody method parameters and...
Created by mee2 on October 20, 2011 16:52:33    Last update: October 20, 2011 16:54:17
Alfresco RESTful URLs provided by Web Scripts are extensively documented, but examples are hard to come by. This makes it hard to ramp up for beginners. Here are some examples I tested on 3.4.4 enterprise edition and 4.0a community edition, with the results documented. To list the available scripts: http://localhost:8081/alfresco/service/index There's a Refresh Web Scripts button at the bottom of the page. If you add a Web Script, you need to click that button in order for the system to know about your addition. To get information about the root folder ( Company Home ): http://localhost:8081/alfresco/service/cmis/p To get information about the folder Data Dictionary : http://localhost:8081/alfresco/service/cmis/p/Data... To get information about the folder Data Dictionary/Space Templates : http://localhost:8081/alfresco/service/cmis/p/Data... You get the idea. To list the children...
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 October 28, 2010 23:00:48    Last update: August 23, 2011 08:51:42
Running " adb shell procrank ": root@android:/ # procrank ... Column Name Meaning VSS Virtual Set Size: how much virtual memory associated with process RSS Resident Set Size: how much physical pages allocated for the process. Pages shared between processes are counted multiple times PSS Proportional Set Size. Take the RSS number but evenly distribute shared pages among the sharing processes. For example, if three processes are sharing 3MB, each process gets 1MB in PSS. USS Also known as Private Dirty, which is basically the amount of RAM inside the process that can not be paged to disk (it is not backed by the same data on disk), and is not shared with any other processes. Reference: How to discover memory usage of my application...
Created by freyo on July 27, 2011 13:28:07    Last update: July 27, 2011 13:28:07
From Android doc : Content providers store and retrieve data and make it accessible to all applications. They're the only way to share data across applications; there's no common storage area that all Android packages can access. Android ships with a number of content providers for common data types (audio, video, images, personal contact information, and so on). You can see some of them listed in the android.provider package. You can query these providers for the data they contain (although, for some, you must acquire the proper permission to read the data). Well, maybe not the only way, but definitely the only recommended way.
Created by alfa on May 04, 2011 12:08:57    Last update: July 15, 2011 12:31:41
To read a whole file at once into a byte array: File theFile = new File("test.bin"); byte[] byt... It is important that the total number of bytes read is used for the while condition. Changing the loop to the following may result in an infinite loop ! int m = 0, n = 0; while (n >= 0) { n = i...
Created by Dr. Xi on March 30, 2011 13:43:05    Last update: March 30, 2011 13:45:27
Method 1 - use javap with verbose flag: $ javap HelloWorld -verbose | head Compiled fro... Method 2 - use a utility class: import java.io.*; import java.nio.ByteBuffer; ... According to the VM Spec , a Java class file has this structure: ClassFile { u4 magic; ...
Created by Dr. Xi on March 28, 2011 11:11:33    Last update: March 28, 2011 11:13:21
grep is a versatile command with many variations (grep, egrep, fgrep, then various implementations). It uses a regula expression (regex) pattern to filter input. But then there are basic and extended flavors of regex - leading to even more confusion. And, beware that there are lots of bad examples of regex in the wild... There are two critical questions to ask when you use grep: which grep implementation are you using? what is the flavor of the regex? Here are some examples for gnu grep v2.7: # Find all numbers (no decimal point), basic regex... Use the -o flag to show only the matching part instead of the whole matching line: grep -o -E '\b[0-9]{2}\b' The good thing about the gnu grep is that it...
Previous  1 2 Next