Permalink
Browse files

initial import of android sources and resources

  • Loading branch information...
1 parent de20a93 commit 69dcce9149923e48254e5bbe5f33330a4a4e2b59 @mdykman committed Feb 5, 2012
Showing 2,174 changed files with 317,061 additions and 0 deletions.
View
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="output" path="bin/classes"/>
+</classpath>
View
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>j</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,5 @@
+#Fri Nov 25 13:51:12 EST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
View
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.dykman.j.android"
+ android:versionCode="1"
+ android:versionName="1.0" android:installLocation="internalOnly" >
+
+
+ <uses-sdk android:minSdkVersion="8" />
+ <uses-permission android:name="android.permission.INTERNET"/>
+ <uses-permission android:name="android.permission.PERSISTENT_ACTIVITY"/>
+ <uses-permission android:name="android.permission.BIND_INPUT_METHOD"/>
+ <uses-permission android:name="android.permission.READ_INPUT_STATE"/>
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+ <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
+
+ <application
+ android:name="org.dykman.j.android.JConsoleApp"
+ android:icon="@drawable/jgreen"
+ android:label="@string/app_name"
+ android:vmSafeMode="false"
+ android:enabled="true"
+ android:hasCode="true"
+ android:persistent="true">
+
+ <activity
+ android:label="@string/app_name"
+ android:name=".JActivity" >
+ <intent-filter >
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ <activity
+ android:label="@string/help_name"
+ android:name="org.dykman.j.android.HelpActivity" >
+ <intent-filter >
+ <action android:name="org.dykman.j.android.HELP" />
+ </intent-filter>
+ </activity>
+
+ <service android:name=".SoftKeyboard"
+ android:permission="android.permission.BIND_INPUT_METHOD"
+ android:exported="true"
+ android:enabled="true"
+ android:label="JKeyboard">
+ <intent-filter>
+ <action android:name="android.view.InputMethod" />
+ </intent-filter>
+ <meta-data android:name="android.view.im" android:resource="@xml/method" />
+ </service>
+
+ </application>
+</manifest>
@@ -0,0 +1,4 @@
+convert/jiconv - change history
+
+== 1.0.0/1 ==
+ * addon for j701
@@ -0,0 +1,124 @@
+NB. auto-detect and convert between different character encodings.
+
+NB. =========================================================
+NB.*jiconv v convert between encodings with auto-detecting
+NB. (from_encodings;to_encoding) jiconv text
+NB. from_encodings: space delimited of source encodings
+NB. to_encodings: target encoding
+NB. text: array of bytes (never wide characters)
+NB.
+NB. from_encodings = '' : 'UTF-8-BOM UCS-2-BOM UTF-8 GBK BIG5 LATIN1'
+NB. target_encoding = '' : 'UTF-8'
+NB.
+NB. return: encodng_detected ; array of bytes in target encoding (never wide characters)
+NB.
+NB. jiconv_win window implementation
+NB. jiconv_lnx linux/darwin implementation
+NB. jiconv cross-platform cover verb
+NB. expect some differences between jiconv_win and jiconv_lnx
+NB. always put latin1 (iso-8859-1,iso-8859-15) at the end for auto-detection
+
+cocurrent 'z'
+
+NB. =========================================================
+jiconv_win=: 4 : 0
+'encs to'=. x [ y=. ,y
+if. 0=#encs=. toupper deb encs do. encs=. 'UTF-8-BOM UCS-2-BOM UTF-8 GBK BIG5 LATIN1' end.
+if. 0=#to=. toupper to do. to=. 'UTF-8' end.
+encs=. <;._1 ' ', toupper deb encs
+CP_UTF7=. 65000
+CP_UTF8=. 65001
+MB_ERR_INVALID_CHARS=. 8
+enc=. r=. ''
+if. 0=#y do. enc;r return. end.
+for_fm. encs do.
+ y1=. y
+ cp=. 0
+ if. (0=2|#y1) *. fm e. 'UCS-2';'UCS2';'UTF-16';'UTF16' do. enc=. ,>fm [ r=. 6 u: y1 break.
+ elseif. (0=4|#y1) *. fm e. 'UCS-4';'UCS4';'UTF-32';'UTF32' do. enc=. ,>fm [ r=. 6 u: , 2}.("1)_4]\y1 break.
+ elseif. (0=2|#y1) *. ((255 254 { a.) -: 2 {. y1) *. fm e. 'UCS-2-BOM';'UCS2-BOM' do. enc=. _4}. ,>fm [ r=. 6 u: 2}.y1 break.
+ elseif. ((239 187 191 { a.) -: 3 {. y1) *. fm e. 'UTF-8-BOM';'UTF8-BOM' do. cp=. CP_UTF8 [ y1=. 3}.y1
+ elseif. fm e. 'UTF-8';'UTF8' do. cp=. CP_UTF8
+ elseif. fm e. 'UTF-7';'UTF7' do. cp=. CP_UTF7
+ elseif. fm e. 'LATIN1';'ISO-8859-1';'ISO-8859-15' do. cp=. 1252
+ elseif. fm e. 'BIG5';'BIG5-HKSCS';'BIG5HKSCS' do. cp=. 950
+ elseif. fm e. 'GBK';'GB18030' do. cp=. 936
+ elseif. fm e. 'SJIS';'SJIS-WIN' do. cp=. 932
+ elseif. 'CP'-:2{.>fm do. cp=. 0&". 2}.>fm
+ end.
+ if. 0~:cp do.
+ if. (0=#y1) *. '-BOM'-: _4{. ,>fm do.
+ enc=. _4}. ,>fm [ r=. '' break.
+ end.
+ if. 0<z=. 'kernel32 MultiByteToWideChar > i i i *c i *w i'&cd cp ; MB_ERR_INVALID_CHARS ; y1 ;(#y1) ; (<0) ; 0 do.
+ r=. (0{::rc) {. _2{:: rc=. 'kernel32 MultiByteToWideChar i i i *c i *w i'&cd cp ; 0 ; y1 ; (#y1) ; ((1+z)#u:0) ; 1+z
+ if. '-BOM'-: _4{. ,>fm do.
+ enc=. _4}. ,>fm
+ else.
+ enc=. ,>fm
+ end.
+ break.
+ end.
+ end.
+end.
+if. ''-:enc do. enc;_1 return. end.
+cp=. 0 [ z=. _1
+if. (<to) e. 'UCS-2';'UCS2';'UTF-16';'UTF16' do. z=. 1 (3!:4) 3 u: r
+elseif. (<to) e. 'UCS-4';'UCS4';'UTF-32';'UTF32' do. z=. 2 (3!:4) 3 u: r
+elseif. (<to) e. 'UTF-8';'UTF8' do. cp=. CP_UTF8
+elseif. (<to) e. 'UTF-7';'UTF7' do. cp=. CP_UTF7
+elseif. (<to) e. 'LATIN1';'ISO-8859-1';'ISO-8859-15' do. cp=. 1252
+elseif. (<to) e. 'BIG5';'BIG5-HKSCS';'BIG5HKSCS' do. cp=. 950
+elseif. (<to) e. 'GBK';'GB18030' do. cp=. 936
+elseif. (<to) e. 'SJIS';'SJIS-WIN' do. cp=. 932
+elseif. 'CP'-:2{.to do. cp=. 0&". 2}.>to
+end.
+if. (_1-:z) *. 0~:cp do.
+ if. 0<z=. 'kernel32 WideCharToMultiByte > i i i *w i *c i i i'&cd cp ; 0 ; r ; (#r) ; (<0) ; 0 ; 0 ; 0 do.
+ z=. (0{::rc) {. _4{:: rc=. 'kernel32 WideCharToMultiByte i i i *w i *c i i i'&cd cp ; 0 ; r ; (#r) ; ((1+z)#{.a.) ; (1+z) ; 0 ; 0
+ end.
+end.
+enc;z
+)
+
+NB. =========================================================
+jiconv_lnx=: 4 : 0
+'encs to'=. x [ y=. ,y
+if. 0=#encs=. toupper deb encs do. encs=. 'UTF-8-BOM UCS-2-BOM UTF-8 GBK BIG5 LATIN1' end.
+if. 0=#to=. toupper to do. to=. 'UTF-8' end.
+
+encs=. <;._1 ' ', toupper deb encs
+enc=. r=. ''
+if. 0=#y do. enc;r return. end.
+
+NB. iconv return _1 if failed
+libiconv=. ('Darwin'-:UNAME){::'libc.so.6';'libc.dylib'
+iconv_open=. (libiconv, ' iconv_open > x *c *c')&cd NB. tocode fromcode
+iconv_iconv=. (libiconv, ' iconv x x *x *x *x *x')&cd NB. des **inbuf *inbytesleft **outbuf *outbytesleft
+iconv_close=. (libiconv, ' iconv_close > i x')&cd NB. des
+
+ct=. (n3=. 4*#y)#{.a.
+ple=. 15!:6 <'ct' NB. pointer to local entry
+pa=. memr ple,(IF64{4 8),1 4 NB. ptr to array
+ict=. ''$pa+memr pa,0 1 4 NB. plus offset to data
+for_fm. encs do.
+ y1=. y
+ enc=. ,>fm
+ if. (0=2|#y1) *. ((255 254 { a.) -: 2 {. y1) *. fm e. 'UCS-2-BOM';'UCS2-BOM' do. enc=. _4}.enc [ y1=. 2}.y1
+ elseif. ((239 187 191 { a.) -: 3 {. y1) *. fm e. 'UTF-8-BOM';'UTF8-BOM' do. enc=. _4}.enc [ y1=. 3}.y1
+ end.
+ ple=. 15!:6 <'y1' NB. pointer to local entry
+ pa=. memr ple,(IF64{4 8),1 4 NB. ptr to array
+ iy1=. ''$pa+memr pa,0 1 4 NB. plus offset to data
+ if. _1~: uconv=. iconv_open to;enc do.
+ if. _1~: 0{:: urc=. iconv_iconv uconv;(,iy1);(,#y1);(,ict);(,n3) do.
+ enc; (n3-{._1{::urc){.ct [ iconv_close <uconv return.
+ end.
+ iconv_close <uconv
+ end.
+end.
+'';_1
+)
+
+NB. =========================================================
+jiconv=: jiconv_win`jiconv_lnx@.IFUNIX
@@ -0,0 +1,16 @@
+NB. convert/jiconv manifest
+
+CAPTION=: 'J iconv encoding conversion'
+
+DESCRIPTION=: 0 : 0
+auto-detect and convert between different character encodings.
+)
+
+VERSION=: '1.0.1'
+
+FILES=: 0 : 0
+jiconv.ijs
+history.txt
+)
+
+RELEASE=: 'j701'
@@ -0,0 +1,48 @@
+NB. convert/misc/ascii85
+NB. Convert to/from ascii85 representation
+NB. version: 1.0.0
+NB. The encoding does not begin with <~, though sometimes
+NB. this is allowed. However PDF files do not accept this prefix.
+NB. Decoding does support the prefix.
+
+NB. defines:
+NB.
+NB. toascii85 to ascii85 representation
+NB. fromascii85 from asci855 representation
+NB.
+
+NB. =========================================================
+NB.*toascii85 v Encode to ascii85 representation
+NB. returns lines of length no more than 75 + LF
+toascii85=: 3 : 0
+r=. ,y
+len=. #r
+r=. 256 #. _4[\ a.i.r
+m=. 0 (_1) } r = 0
+n=. 5 * I.m
+r=. a. {~ 33 + ,(5#85) #: r
+r=. 'z' n } r
+m=. 1 n } 5 # -. m
+r=. m # r
+r=. (- (4|len) { 0 3 2 1) }. r
+r=. }: ,(_75 [\ r),.LF
+('~>',LF) ,~ (r i: ' ') {. r
+)
+
+NB. =========================================================
+NB.*fromascii85 v Decodes an ascii85 representation
+fromascii85=: 3 : 0
+r=. ,y
+r=. a.i.r
+r=. (r > 32) # r
+r=. (2 * (a.i.'<~') -: 2 {. r) }. r
+r=. (-2 * (a.i.'~>') -: _2 {. r) }. r
+m=. r = a.i.'z'
+r=. r - 33
+r=. 0 (I.m) } r
+r=. (1+4*m) # r
+b=. 5 | #r
+r=. r,84 #~ b{ 0 4 3 2 1
+r=. a.{~ ,(4#256) #: 85 #. _5 [\ r
+r }.~ - b { 0 0 3 2 1
+)
@@ -0,0 +1,29 @@
+NB. convert/misc/base64
+NB. Convert to/from base64 representations
+NB. version: 1.0.1
+
+NB. main functions:
+NB. tobase64 to base64 representation
+NB. frombase64 from base64 representation
+
+BASE64=: (a.{~ ,(a.i.'Aa') +/i.26),'0123456789+/'
+
+NB. =========================================================
+NB.*tobase64 v To base64 representation
+tobase64=: 3 : 0
+res=. BASE64 {~ #. _6 [\ , (8#2) #: a. i. y
+res, (0 2 1 i. 3 | # y) # '='
+)
+
+NB. =========================================================
+NB.*frombase64 v From base64 representation
+frombase64=: 3 : 0
+pad=. _2 >. (y i. '=') - #y
+pad }. a. {~ #. _8 [\ , (6#2) #: BASE64 i. y
+)
+
+NB. =========================================================
+Note 'Testing'
+A=: '1';'12';'123';'1234';'12345';'123456';'hi there';'qwerty'
+(-: frombase64@tobase64) &> ,each A
+)
@@ -0,0 +1,21 @@
+CAPTION=: 'miscellaneous scripts'
+
+VERSION=: '1.1.0'
+
+RELEASE=: 'j701'
+
+FILES=: 0 : 0
+ascii85.ijs
+base64.ijs
+md5.ijs
+unicode.ijs
+vig.ijs
+)
+
+DESCRIPTION=: 0 : 0
+ascii85.ijs Convert to/from ascii85 representation
+base64.ijs Convert to/from base64 representations
+md5.ijs RSA Data Security, Inc. MD5 Message-Digest Algorithm
+unicode.ijs Unicode utilities
+vig.ijs Vigenère cipher with optional encoding
+)
Oops, something went wrong.

0 comments on commit 69dcce9

Please sign in to comment.