Recent Notes
Displaying keyword search results 1 - 10
Created by zhidao on April 25, 2012 14:56:38
Last update: April 25, 2012 14:56:38
Lacking better alternatives, this is how I render a global validation error:
<spring:bind path="changePasswordForm">
<c:if ...
<form:errors> without path attribute seems to work too:
<form:errors cssClass="ui-error"/>
Created by Dr. Xi on March 14, 2012 14:23:14
Last update: March 14, 2012 14:23:14
If forgotPasswordForm.error is a String and not null, you cannot test the error condition with:
<!-- This does not work! -->
<c:if test="${forg...
You have to use "not empty":
<c:if test="${not empty forgotPasswordForm.error}"...
Created by mee2 on November 20, 2011 20:26:05
Last update: November 20, 2011 20:26:34
Stack trace:
Caused by: org.alfresco.error.AlfrescoRuntimeExcep...
Cause:
Location of Alfresco keystore changed via shared/classes/alfresco-global.properties but keystore files not exist.
Solution : copy keystore files from alfresco.war :
cp -R webapps/alfresco/WEB-INF/classes/alfresco/ke...
Created by magnum on September 25, 2011 21:51:23
Last update: September 26, 2011 20:49:22
A simple socket client in C.
#include <stdio.h>
#include <stdlib.h>
#incl...
Created by voodoo on August 14, 2011 15:42:43
Last update: August 14, 2011 15:42:43
When I ran this code snippet with strace :
f = fopen("TZ", "rb");
fseek(f, 0, SEEK_END);
...
I saw ENOTTY error with uClibc :
open("TZ", O_RDONLY|O_LARGEFILE) = 3
ioc...
With the normal gnu libc , there's no such error:
open("TZ", O_RDONLY) = 3
fstat64...
There was no error running the program. But for some reason, uClibc did a ioctl call when it opened a file, and handled it appropriately.
Created by voodoo on August 12, 2011 14:43:57
Last update: August 14, 2011 15:19:21
#include <stdio.h>
#include <stdlib.h>
i...
Created by Dr. Xi on February 17, 2011 12:34:58
Last update: August 10, 2011 09:04:32
String comparison operators: Operator Meaning -n str the length of str is nonzero. -z str the length of str is zero (0). str1 = str2 str1 and str2 are the same (note one equal sign, not two!). str1 != str2 str1 and str2 are not the same. str str is not a null string Examples:
# empty string is not null if [ '' ]; then ... Numerical comparisons ( integer expressions only! ): Operator Meaning int1 -eq int2 int1 and int2 are numerically equal int1 -ne int2 int1 and int2 are numerically NOT equal int1 -gt int2 int1 is greater than int2 int1 -ge int2 int1 is greater than or equal to int2 int1 -lt int2 int1 is less than int2 int1 -le...
Created by freyo on June 30, 2011 11:15:48
Last update: June 30, 2011 11:15:48
Install APK with adb :
$ platform-tools/adb install out/target/product/ge...
Error message in logcat:
D/PackageParser( 60): Scanning package: /data/ap...
The error was created by android.content.pm.PackageParser , which compares the android:minSdkVersion and android:targetSdkVersion attributes of the uses-sdk element of AndroidManifest.xml in the APK file against the SDK version of the device or emulator. The SDK version on the device has to be greater than that required by android:minSdkVersion .
In my case, since I built the package with AOSP, the target emulator has to be AOSP also. This is the relavant section in AndroidManifest.xml :
<uses-sdk android:minSdkVersion="AOSP"
...
And the relevant section in android.content.pm.PackageParser :
if (minCode != null) {
if (!minCode.equals(...
Created by freyo on May 17, 2011 11:13:17
Last update: May 17, 2011 11:13:17
This is an odd-ball content provider in that it doesn't provide database records, but provides a resource as a stream. It can be used to provide media files or XML resources. Start the project with:
tools/android create project --package com.android... Create assets directory and add an XML file ( assets/demo.xml ): <? xml version="1.0" encoding="UTF-8"?> <people... Edit the layout ( res/layout/main.xml ): <?xml version="1.0" encoding="utf-8"?> <LinearL... Edit src/com/android/cptest/Dummy.java : package com.android.cptest; import java.io.... Add content provider ( src/com/android/cptest/XmlResource.java ): package com.android.cptest; import java.io.... Update AndroidManifest.xml : <?xml version="1.0" encoding="utf-8"?> <manifes... Add this section to the end of build.xml : <target name="-package-resources"> <ech... Build and install: ant install Screenshot: Remove the Dummy activity ( AndroidManifest.xml ): <?xml version="1.0" encoding="utf-8"?> <manifes... Create a new project for...
Created by jinx on May 03, 2011 11:43:26
Last update: May 03, 2011 11:43:26
The PHP function strval returns the string value of a variable. It does the same thing as casting a variable to string, or automatic conversion where string is expected.
Conversion rules:
Type String Value
Boolean TRUE '1'
Boolean FALSE '' (empty string)
integer of float string representing the number
Array The string 'Array'
Object Result of __toString() if defined, error otherwise
Resource 'Resource id #n' , where n is a number assigned to the resource.
NULL '' (empty string)
Example:
<?php
set_error_handler(function($errno, $errst...
Results:
bool(true)
---------------------
strval: '1'...