This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Please Add: | |
* LOCAL_LDLIBS := -llog | |
* to Android.mk | |
*/ | |
#ifndef __ANDROID_APP_LOG__ | |
#define __ANDROID_APP_LOG__ 1 | |
#include <android/log.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source build/envsetup.sh | |
lunch xxxxx | |
LOG_DIR=clog | |
CPU_NUM=10 | |
mkdir -p $LOG_DIR | |
(make -j${CPU_NUM} | tee ${LOG_DIR}/buildresult.std) 3>&1 1>&2 2>&3 | tee ${LOG_DIR}/buildresult.err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include <sys/types.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <errno.h> | |
int main() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Copy from http://codeseekah.com/2012/09/12/compiling-objective-c-without-a-gui/ | |
CC=clang # or gcc | |
FRAMEWORKS:= -framework Foundation | |
LIBRARIES:= -lobjc | |
CFLAGS=-Wall -Werror -g -v | |
LDFLAGS=$(LIBRARIES) $(FRAMEWORKS) | |
SRC=src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/system/xbin/busybox sh | |
PREINSTALL_RECORD_FILE=/data/system.notfirstrun | |
if [ ! -e $PREINSTALL_RECORD_FILE ]; then | |
echo "do preinstall job" | |
for i in `/system/xbin/busybox find /system/etc/property/app/ -type f -name '*.apk'`; | |
do | |
/system/bin/sh /system/bin/pm install $i | |
done | |
/system/xbin/busybox touch $PREINSTALL_RECORD_FILE | |
echo "preinstall ok" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo 'Error' > /abc.txt | |
echo $? #1 | |
echo 'Pass' | |
echo $? #0 | |
echo 'Pass' && echo 'Error' > /adc.txt && echo 'After Error' | |
echo $? #1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONFIG_LAST_TIME_FILE := $(srctree)/.compile.project.time | |
CONFIG_STAT_TIME:=$(if $(wildcard $(CONFIG_FILE)),$(shell stat -c %Y $(CONFIG_FILE)),) | |
TMP_CONFIG_LAST_TIME:=$(if $(wildcard $(CONFIG_LAST_TIME_FILE)),$(shell cat $(CONFIG_LAST_TIME_FILE)),) | |
# ...... | |
ifneq ("$(CONFIG_STAT_TIME)","$(TMP_CONFIG_LAST_TIME)") | |
$(warning "merge config and defaut config:") | |
OUT_CONFIG := $(srctree)/.config | |
xxx_config := $(call config.generate-auto-rules) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Subject: [PATCH] Fix DB linking encoding to utf8 | |
--- | |
Gemfile | 2 +- | |
Gemfile.lock | 4 ++-- | |
config/application.rb | 2 ++ | |
config/database.yml | 12 ++++++------ | |
config/environment.rb | 2 ++ | |
5 files changed, 13 insertions(+), 9 deletions(-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'java' | |
//repositories { | |
// mavenCentral() | |
// maven { | |
// url 'https://repo.eclipse.org/content/groups/releases/' | |
// } | |
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// similar to Matt Aimonetti's example, read his blog! | |
// http://matt.aimonetti.net/posts/2012/11/27/real-life-concurrency-in-go/ | |
func concurrently(integers []int) []int { | |
// make a channel to talk to the goroutines | |
ch := make(chan int) | |
// prepare a slice with all the results | |
responses := []int{} |
OlderNewer