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
if( A && B && C ) | |
{ | |
... | |
} | |
//=========================// | |
if( A ) | |
if( B ) | |
if( C ) |
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
private boolean initGL(SurfaceHolder surfaceHolder) { | |
mEgl = (EGL10) EGLContext.getEGL(); | |
mEglDisplay = mEgl.eglGetDisplay(EGL_DEFAULT_DISPLAY); | |
if (mEglDisplay == EGL_NO_DISPLAY) { | |
throw new RuntimeException("eglGetDisplay failed " + | |
GLUtils.getEGLErrorString(mEgl.eglGetError())); | |
} | |
int[] version = new int[2]; |
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 | |
ADB_DEVICE_COUNT=`adb devices | wc -l` | |
ADB_DEVICE_COUNT=`expr $ADB_DEVICE_COUNT - 2` | |
if [ $ADB_DEVICE_COUNT -gt 0 ] | |
then | |
echo rebooting into fastboot | |
adb reboot bootloader | |
fi |
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
export PATH=~/Apps/bin:~/bin:$PATH: | |
export PS1='$(if [[ $? == 0 ]]; then echo -e "\[\033[0;32m\]\xE2\x9C\x94"; else echo -e "\[\033[0;31m\]\xE2\x9C\x95"; fi )\[\033[0m\] $(date +%R) \[\033[1;34m\]$(date +"%g%V.%u")\[\033[0;31m\] \w\[\033[0m\]\$ '"\033]0;$WINDOWTITLE\007" |
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
unsigned int ReadWord(unsigned int *address) | |
{ | |
return *address; | |
} | |
int DumpMemory(char *fileName, void* address, size_t size) | |
{ | |
int file; | |
int ret = 0; |
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
root@PLF-CPU:~# ./cacheflush_mips | |
Cached memory writes: 90000 ticks | |
Uncached memory writes: 300000 ticks | |
Userspace flush: block=1, 1100000 ticks, 0.00% errors | |
Userspace flush: block=2, 530000 ticks, 0.00% errors | |
Userspace flush: block=4, 450000 ticks, 0.00% errors | |
Userspace flush: block=8, 380000 ticks, 0.00% errors | |
Userspace flush: block=16, 340000 ticks, 0.00% errors | |
Userspace flush: block=32, 310000 ticks, 0.00% errors | |
Userspace flush: block=64, 310000 ticks, 0.00% errors |
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 ; | |
import nme.display.Bitmap; | |
import nme.display.BitmapData; | |
import nme.display.Sprite; | |
import nme.display.StageAlign; | |
import nme.display.StageScaleMode; | |
import nme.display.Graphics; | |
import nme.events.Event; | |
import nme.Assets; |
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 | |
SIZE=`expr $1 \* 1024` | |
if [[ x$SIZE == x ]] | |
then | |
MEM=`free | grep Mem | sed -e "s/[^0-9]*\([0-9]\+\).*/\1/"` | |
SIZE=`expr $MEM + $MEM / 4` | |
echo "No size provided, using 125% of memory size (${SIZE}KB)" | |
fi | |
COUNT=`expr $SIZE / 4` |
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
# Stats about a single log | |
class Log | |
# Load a file and parse every line as a print. | |
def self.parse(file_path) | |
Log.new(file_path, File.readlines(file_path)) | |
end | |
# Number of lines in the file and number of lines that are valid CATS prints | |
attr_reader :linecount, :cats_linecount, | |
# Number of characters that are in the file, part of CATS prints and part of CATS header overhead, respectively |
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
Dir['*.log'].each do |fname| | |
log = Log.parse(fname) | |
symbol = log.symbols.values.sort_by { |s| -s.charcount }.first | |
line = log.lines.values.sort_by { |s| -s.charcount }.first | |
puts "#{log.cats_charcount}/#{log.charcount} in #{log.name}, most offensive: #{symbol.name} (#{symbol.charcount}), #{line.name} (#{line.charcount})" | |
end | |
# Output: | |
# 2169/21484 in regexp-info.log, most offensive: -/legacy/printf (983), -/legacy/printf:0000 (983) | |
# 212132/227923 in teraterm.log, most offensive: amApp/resmgmt (22885), amApp/resmgmt:0850 (16423) |