├── README.md
├── Scrambled Net
├── lint.xml
├── res
│ ├── raw
│ │ ├── pop.wav
│ │ ├── win.ogg
│ │ ├── click.ogg
│ │ ├── start.ogg
│ │ ├── turn.ogg
│ │ └── connect.ogg
│ ├── drawable
│ │ ├── empty.png
│ │ ├── server.png
│ │ ├── blip_t01.png
│ │ ├── blip_t03.png
│ │ ├── blip_t05.png
│ │ ├── blip_t07.png
│ │ ├── blip_t08.png
│ │ ├── blip_t09.png
│ │ ├── blip_t10.png
│ │ ├── blob_14.png
│ │ ├── blob_15.png
│ │ ├── blob_16.png
│ │ ├── blob_17.png
│ │ ├── blob_18.png
│ │ ├── blob_19.png
│ │ ├── blob_20.png
│ │ ├── nothing.png
│ │ ├── server1.png
│ │ ├── background.png
│ │ ├── blob_g_14.png
│ │ ├── blob_g_15.png
│ │ ├── blob_g_16.png
│ │ ├── blob_g_17.png
│ │ ├── blob_g_18.png
│ │ ├── blob_g_19.png
│ │ ├── blob_g_20.png
│ │ ├── cable0001.png
│ │ ├── cable0010.png
│ │ ├── cable0011.png
│ │ ├── cable0100.png
│ │ ├── cable0101.png
│ │ ├── cable0110.png
│ │ ├── cable0111.png
│ │ ├── cable1000.png
│ │ ├── cable1001.png
│ │ ├── cable1010.png
│ │ ├── cable1011.png
│ │ ├── cable1100.png
│ │ ├── cable1101.png
│ │ ├── cable1110.png
│ │ ├── cable1111.png
│ │ ├── computer1.png
│ │ ├── computer2.png
│ │ ├── menu_button.png
│ │ ├── netscramble.png
│ │ ├── ic_menu_help.png
│ │ ├── ic_menu_info.png
│ │ ├── ic_menu_pause.png
│ │ ├── ic_menu_play.png
│ │ ├── ic_menu_solve.png
│ │ ├── ic_menu_stop.png
│ │ ├── ic_menu_revert.png
│ │ ├── ic_menu_volume.png
│ │ ├── netscramble_512.png
│ │ ├── background_locked.png
│ │ ├── ic_menu_show_list.png
│ │ └── ic_menu_preferences.png
│ ├── drawable-long-land
│ │ ├── scores_bg.jpg
│ │ └── splash_bg.jpg
│ ├── drawable-long-port
│ │ ├── scores_bg.jpg
│ │ └── splash_bg.jpg
│ ├── drawable-notlong-land
│ │ ├── scores_bg.jpg
│ │ └── splash_bg.jpg
│ ├── drawable-notlong-port
│ │ ├── scores_bg.jpg
│ │ └── splash_bg.jpg
│ ├── menu
│ │ ├── scores_menu.xml
│ │ └── main_menu.xml
│ ├── layout
│ │ └── main.xml
│ ├── layout-land
│ │ └── play.xml
│ ├── layout-port
│ │ └── play.xml
│ ├── layout-large-land
│ │ └── play.xml
│ ├── layout-large-port
│ │ └── play.xml
│ ├── values-zh-rTW
│ │ └── strings.xml
│ ├── values-zh-rCN
│ │ └── strings.xml
│ ├── layout-notlong-port
│ │ └── score_layout.xml
│ └── layout-long-port
│ │ └── score_layout.xml
├── SVG icons
│ ├── promo.xcf
│ ├── Make
│ └── README
├── README
├── project.properties
├── .gitignore
├── src
│ └── com
│ │ └── silentservices
│ │ └── netscramble
│ │ └── Help.java
└── AndroidManifest.xml
├── HermitAndroid
├── res
│ ├── raw
│ │ ├── hmlu.ogg
│ │ └── chirp_low.ogg
│ ├── drawable-hdpi
│ │ ├── timepicker_up_normal.9.png
│ │ ├── timepicker_up_pressed.9.png
│ │ ├── timepicker_down_disabled.9.png
│ │ ├── timepicker_down_normal.9.png
│ │ ├── timepicker_down_pressed.9.png
│ │ ├── timepicker_down_selected.9.png
│ │ ├── timepicker_input_normal.9.png
│ │ ├── timepicker_input_pressed.9.png
│ │ ├── timepicker_up_disabled.9.png
│ │ ├── timepicker_up_selected.9.png
│ │ ├── timepicker_input_disabled.9.png
│ │ ├── timepicker_input_selected.9.png
│ │ ├── timepicker_up_disabled_focused.9.png
│ │ └── timepicker_down_disabled_focused.9.png
│ ├── drawable-ldpi
│ │ ├── timepicker_up_normal.9.png
│ │ ├── timepicker_up_pressed.9.png
│ │ ├── timepicker_down_disabled.9.png
│ │ ├── timepicker_down_normal.9.png
│ │ ├── timepicker_down_pressed.9.png
│ │ ├── timepicker_down_selected.9.png
│ │ ├── timepicker_input_normal.9.png
│ │ ├── timepicker_input_pressed.9.png
│ │ ├── timepicker_up_disabled.9.png
│ │ ├── timepicker_up_selected.9.png
│ │ ├── timepicker_input_disabled.9.png
│ │ ├── timepicker_input_selected.9.png
│ │ ├── timepicker_up_disabled_focused.9.png
│ │ └── timepicker_down_disabled_focused.9.png
│ ├── drawable-mdpi
│ │ ├── timepicker_up_normal.9.png
│ │ ├── timepicker_up_pressed.9.png
│ │ ├── timepicker_down_disabled.9.png
│ │ ├── timepicker_down_normal.9.png
│ │ ├── timepicker_down_pressed.9.png
│ │ ├── timepicker_down_selected.9.png
│ │ ├── timepicker_input_normal.9.png
│ │ ├── timepicker_input_pressed.9.png
│ │ ├── timepicker_up_disabled.9.png
│ │ ├── timepicker_up_selected.9.png
│ │ ├── timepicker_input_disabled.9.png
│ │ ├── timepicker_input_selected.9.png
│ │ ├── timepicker_up_disabled_focused.9.png
│ │ └── timepicker_down_disabled_focused.9.png
│ ├── values
│ │ ├── ids.xml
│ │ ├── strings.xml
│ │ └── cwac_touchlist_attrs.xml
│ ├── layout
│ │ ├── timeout_picker_dialog.xml
│ │ ├── main.xml
│ │ ├── number_picker.xml
│ │ └── timeout_picker.xml
│ └── drawable
│ │ ├── timepicker_up_btn.xml
│ │ ├── timepicker_input.xml
│ │ └── timepicker_down_btn.xml
├── doc
│ ├── resources
│ │ └── inherit.gif
│ ├── package-list
│ ├── org
│ │ └── hermit
│ │ │ └── android
│ │ │ ├── sound
│ │ │ └── package-frame.html
│ │ │ ├── io
│ │ │ └── package-frame.html
│ │ │ ├── provider
│ │ │ └── package-frame.html
│ │ │ ├── widgets
│ │ │ └── package-frame.html
│ │ │ ├── test
│ │ │ └── package-frame.html
│ │ │ ├── instruments
│ │ │ └── package-frame.html
│ │ │ ├── notice
│ │ │ └── package-frame.html
│ │ │ ├── core
│ │ │ └── package-frame.html
│ │ │ └── net
│ │ │ └── package-frame.html
│ ├── stylesheet.css
│ ├── index.html
│ └── overview-frame.html
├── lint.xml
├── src
│ ├── org
│ │ └── hermit
│ │ │ └── android
│ │ │ ├── core
│ │ │ └── package.html
│ │ │ ├── utils
│ │ │ └── package.html
│ │ │ ├── sound
│ │ │ └── package.html
│ │ │ ├── widgets
│ │ │ ├── NumberPickerButton.java
│ │ │ └── LinedEditText.java
│ │ │ ├── provider
│ │ │ └── DbRow.java
│ │ │ └── notice
│ │ │ └── ErrorDialog.java
│ └── overview.html
├── project.properties
├── AndroidManifest.xml
└── .gitignore
├── HermitLibrary
├── doc
│ ├── resources
│ │ └── inherit.gif
│ ├── package-list
│ ├── net
│ │ └── goui
│ │ │ └── util
│ │ │ └── package-frame.html
│ ├── org
│ │ └── hermit
│ │ │ ├── geometry
│ │ │ ├── voronoi
│ │ │ │ └── package-frame.html
│ │ │ ├── spline
│ │ │ │ └── package-frame.html
│ │ │ ├── cluster
│ │ │ │ └── package-frame.html
│ │ │ ├── package-frame.html
│ │ │ └── generator
│ │ │ │ └── package-frame.html
│ │ │ ├── utils
│ │ │ └── package-frame.html
│ │ │ ├── dsp
│ │ │ └── package-frame.html
│ │ │ ├── astro
│ │ │ └── package-frame.html
│ │ │ └── geo
│ │ │ └── package-frame.html
│ ├── stylesheet.css
│ ├── index.html
│ ├── ca
│ │ └── uol
│ │ │ └── aig
│ │ │ └── fftpack
│ │ │ └── package-frame.html
│ └── overview-frame.html
├── src
│ ├── org
│ │ └── hermit
│ │ │ ├── dsp
│ │ │ └── package.html
│ │ │ ├── utils
│ │ │ ├── package.html
│ │ │ └── Bitwise.java
│ │ │ ├── geometry
│ │ │ ├── generator
│ │ │ │ ├── package.html
│ │ │ │ ├── Generator.java
│ │ │ │ └── RandomGenerator.java
│ │ │ ├── package.html
│ │ │ ├── cluster
│ │ │ │ ├── package.html
│ │ │ │ └── Clusterer.java
│ │ │ ├── voronoi
│ │ │ │ ├── package.html
│ │ │ │ ├── Event.java
│ │ │ │ ├── DataNode.java
│ │ │ │ └── VoronoiEdge.java
│ │ │ ├── spline
│ │ │ │ └── Cubic.java
│ │ │ └── MathTools.java
│ │ │ ├── astro
│ │ │ ├── AstroError.java
│ │ │ ├── CalcError.java
│ │ │ ├── package.html
│ │ │ └── Util.java
│ │ │ └── geo
│ │ │ ├── package.html
│ │ │ ├── Azimuth.java
│ │ │ └── GeoConstants.java
│ ├── ca
│ │ └── uol
│ │ │ └── aig
│ │ │ └── fftpack
│ │ │ ├── Complex1D.java
│ │ │ ├── package.html
│ │ │ └── RealDoubleFFT_Odd_Odd.java
│ ├── overview.html
│ └── net
│ │ └── goui
│ │ └── util
│ │ └── package.html
├── .gitignore
└── test
│ └── org
│ └── hermit
│ └── test
│ ├── astro
│ ├── TestObliquity.java
│ ├── TestParallax.java
│ └── TestRiseSet.java
│ ├── utils
│ └── BitwiseTests.java
│ ├── NumericAsserts.java
│ └── cluster
│ └── SimpleTest.java
└── .gitignore
/README.md:
--------------------------------------------------------------------------------
1 | Scrambled-Net
2 | =============
3 |
--------------------------------------------------------------------------------
/Scrambled Net/lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
A library of foundation classes for Android applications.
4 | 5 | 6 | -------------------------------------------------------------------------------- /HermitAndroid/src/org/hermit/android/utils/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |A library of utility classes for Android applications.
4 | 5 | 6 | -------------------------------------------------------------------------------- /Scrambled Net/res/drawable/ic_menu_revert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/Scrambled Net/res/drawable/ic_menu_revert.png -------------------------------------------------------------------------------- /Scrambled Net/res/drawable/ic_menu_volume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/Scrambled Net/res/drawable/ic_menu_volume.png -------------------------------------------------------------------------------- /Scrambled Net/res/drawable/netscramble_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/Scrambled Net/res/drawable/netscramble_512.png -------------------------------------------------------------------------------- /Scrambled Net/res/drawable/background_locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/Scrambled Net/res/drawable/background_locked.png -------------------------------------------------------------------------------- /Scrambled Net/res/drawable/ic_menu_show_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/Scrambled Net/res/drawable/ic_menu_show_list.png -------------------------------------------------------------------------------- /Scrambled Net/res/drawable-long-land/scores_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/Scrambled Net/res/drawable-long-land/scores_bg.jpg -------------------------------------------------------------------------------- /Scrambled Net/res/drawable-long-land/splash_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/Scrambled Net/res/drawable-long-land/splash_bg.jpg -------------------------------------------------------------------------------- /Scrambled Net/res/drawable-long-port/scores_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/Scrambled Net/res/drawable-long-port/scores_bg.jpg -------------------------------------------------------------------------------- /Scrambled Net/res/drawable-long-port/splash_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/Scrambled Net/res/drawable-long-port/splash_bg.jpg -------------------------------------------------------------------------------- /Scrambled Net/res/drawable/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/Scrambled Net/res/drawable/ic_menu_preferences.png -------------------------------------------------------------------------------- /HermitAndroid/src/org/hermit/android/sound/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |These classes provide functions to help apps manage their sound effects.
4 | 5 | 6 | -------------------------------------------------------------------------------- /Scrambled Net/res/drawable-notlong-land/scores_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/Scrambled Net/res/drawable-notlong-land/scores_bg.jpg -------------------------------------------------------------------------------- /Scrambled Net/res/drawable-notlong-land/splash_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/Scrambled Net/res/drawable-notlong-land/splash_bg.jpg -------------------------------------------------------------------------------- /Scrambled Net/res/drawable-notlong-port/scores_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/Scrambled Net/res/drawable-notlong-port/scores_bg.jpg -------------------------------------------------------------------------------- /Scrambled Net/res/drawable-notlong-port/splash_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/Scrambled Net/res/drawable-notlong-port/splash_bg.jpg -------------------------------------------------------------------------------- /HermitAndroid/res/drawable-hdpi/timepicker_up_normal.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/HermitAndroid/res/drawable-hdpi/timepicker_up_normal.9.png -------------------------------------------------------------------------------- /HermitAndroid/res/drawable-hdpi/timepicker_up_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/HermitAndroid/res/drawable-hdpi/timepicker_up_pressed.9.png -------------------------------------------------------------------------------- /HermitAndroid/res/drawable-ldpi/timepicker_up_normal.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/HermitAndroid/res/drawable-ldpi/timepicker_up_normal.9.png -------------------------------------------------------------------------------- /HermitAndroid/res/drawable-ldpi/timepicker_up_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/HermitAndroid/res/drawable-ldpi/timepicker_up_pressed.9.png -------------------------------------------------------------------------------- /HermitAndroid/res/drawable-mdpi/timepicker_up_normal.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/HermitAndroid/res/drawable-mdpi/timepicker_up_normal.9.png -------------------------------------------------------------------------------- /HermitAndroid/res/drawable-mdpi/timepicker_up_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SilentServices/Scrambled-Net/HEAD/HermitAndroid/res/drawable-mdpi/timepicker_up_pressed.9.png -------------------------------------------------------------------------------- /HermitAndroid/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |A small library of digital signal processing (DSP) utilities.
6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /HermitAndroid/doc/package-list: -------------------------------------------------------------------------------- 1 | org.hermit.android.core 2 | org.hermit.android.instruments 3 | org.hermit.android.io 4 | org.hermit.android.net 5 | org.hermit.android.notice 6 | org.hermit.android.provider 7 | org.hermit.android.sound 8 | org.hermit.android.widgets 9 | -------------------------------------------------------------------------------- /HermitLibrary/src/org/hermit/utils/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |A library of basic data types used in other packages. 6 | Not very well developed at present.
7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /HermitLibrary/doc/package-list: -------------------------------------------------------------------------------- 1 | ca.uol.aig.fftpack 2 | net.goui.util 3 | org.hermit.astro 4 | org.hermit.dsp 5 | org.hermit.geo 6 | org.hermit.geometry 7 | org.hermit.geometry.cluster 8 | org.hermit.geometry.generator 9 | org.hermit.geometry.spline 10 | org.hermit.geometry.voronoi 11 | org.hermit.utils 12 | -------------------------------------------------------------------------------- /Scrambled Net/res/menu/scores_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /HermitLibrary/src/org/hermit/geometry/generator/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |Data set generators for cluster analysis.
6 | 7 |See the 8 | Clusterer application for examples of how this package can be used.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /HermitLibrary/src/org/hermit/geometry/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |Some basic geometric utilities, geared towards graph analysis.
6 | 7 |See the 8 | Clusterer application for examples of how it can be used.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /HermitAndroid/res/layout/timeout_picker_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |Utilities for experimenting with cluster analysis, including an 6 | implementation of K-Means and other clustering algorithms.
7 | 8 |See the 9 | Clusterer application for examples of how this package can be used.
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /HermitLibrary/src/org/hermit/geometry/voronoi/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |A Voronoi diagram generator.
6 | 7 |This is my Java transcription of bentools, 8 | which in turn is Benjamin Dittes' C# implementation of Fortune's 9 | algorithm.
10 | 11 |See the 12 | Clusterer application for examples of how this package can be used.
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /HermitLibrary/src/overview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |HermitLibrary is a collection of useful classes for 4 | geodetic, astronomical and other types of calculation, in a generic 5 | Java library which can be used on any OS. It has been used by me 6 | mainly on Android, but I've deliberately kept any dependency on 7 | Android out of the code.
8 | 9 |For information on getting the code, see 10 | the 11 | project home page on Google Code. 12 | 13 | 14 | -------------------------------------------------------------------------------- /HermitAndroid/src/overview.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |HermitAndroid is a collection of useful classes for 4 | Android applications, in a library which can be linked into Android 5 | projects.
6 | 7 |This library is structured as an Android library project, using the 8 | new Android libraries feature introduced in Android SDK tools revision 9 | 6. This allows HermitAndroid to have its own resources, such as 10 | icons or internationalized strings.
11 | 12 |For information on getting the code, see
13 | the
14 | project home page on Google Code.
15 |
16 |
17 |
--------------------------------------------------------------------------------
/HermitAndroid/res/values/cwac_touchlist_attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Contains a copy of MTRandom, David Beaumont's Java implementation of 6 | the Mersenne Twister random number generator. I included it here for 7 | use in various projects.
8 | 9 | 10 |
11 | This software is licensed under the CC-GNU LGPL.
A Java translation of fftpack by Baoshe Zhang.
4 | 5 |jfftpack is a Java version of fftpack. jfftpack is based 6 | on Paul N. Swarztraubre's Fortran code and Pekka Janhuen's 7 | C code. It is developed as part of my official duties as 8 | lead software engineer for 9 | SCUBA-2 FTS projects.
10 | 11 |The original fftpack was public domain, so jfftpack is 12 | public domain too. This software is in no way certified or 13 | guaranteed.
14 | 15 |Please send any comments or bug reports to baoshe.zhang at 16 | uleth.ca or baoshe_zhang at hotmail.com.
17 | 18 |Notes: 19 | Please read the documents 20 | for FFT formula
if necessary. 21 | 22 | 23 | -------------------------------------------------------------------------------- /Scrambled Net/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Indicates whether an apk should be generated for each density. 14 | split.density=false 15 | android.library.reference.1=../HermitAndroid/ 16 | # Project target. 17 | target=android-19 18 | apk-configurations= 19 | android.library.reference.2=../../../Documents/workspace/android-support-v7-appcompat 20 | -------------------------------------------------------------------------------- /Scrambled Net/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 ||
24 | Classes
25 |
26 | 27 | MTRandom |
28 |
|
24 | Classes
25 |
26 | 27 | Fortune |
28 |
|
24 | Classes
25 |
26 | 27 | Effect 28 | 29 | Player |
30 |
|
24 | Classes
25 |
26 | 27 | AudioReader 28 | 29 | AudioReader.Listener |
30 |
|
24 | Classes
25 |
26 | 27 | Cubic 28 | 29 | CubicSpline |
30 |
|
24 | Classes
25 |
26 | 27 | Angle 28 | 29 | Bitwise 30 | 31 | CharFormatter 32 | 33 | TimeUtils |
34 |
|
24 | Classes
25 |
26 | 27 | Clusterer 28 | 29 | FuzzyClusterer 30 | 31 | KMeansClusterer |
32 |
|
24 | Classes
25 |
26 | 27 | DatabaseHelper 28 | 29 | DbSchema 30 | 31 | TableProvider 32 | 33 | TableSchema |
34 |
|
24 | Classes
25 |
26 | 27 | HScrollView 28 | 29 | LinedEditText 30 | 31 | MultistateImageButton 32 | 33 | TimeZoneActivity |
34 |
|
24 | Classes
25 |
26 | 27 | Edge 28 | 29 | Graph 30 | 31 | MathTools 32 | 33 | Point 34 | 35 | Region 36 | 37 | Vector |
38 |
|
24 | Classes
25 |
26 | 27 | FFTTransformer 28 | 29 | SignalPower 30 | 31 | Window |
32 |
|
39 | Enums
40 |
41 | 42 | Window.Function |
43 |
35 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
36 |
37 | Link toNon-frame version.
38 |
|
24 | Interfaces
25 |
26 | 27 | Generator |
28 |
|
35 | Classes
36 |
37 | 38 | NuclearGenerator 39 | 40 | RandomGenerator |
41 |
|
23 | Classes
24 |
25 | 26 | AndroidTest 27 | 28 | R 29 | 30 | R.attr 31 | 32 | R.drawable 33 | 34 | R.id 35 | 36 | R.layout 37 | 38 | R.raw 39 | 40 | R.string |
41 |
|
24 | Classes
25 |
26 | 27 | Complex1D 28 | 29 | ComplexDoubleFFT 30 | 31 | RealDoubleFFT 32 | 33 | RealDoubleFFT_Even 34 | 35 | RealDoubleFFT_Even_Odd 36 | 37 | RealDoubleFFT_Odd 38 | 39 | RealDoubleFFT_Odd_Odd |
40 |
This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation (see COPYING). 8 | * 9 | *
This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | *
You should have received a copy of the GNU General Public
15 | * License along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 | * 02111-1307, USA.
18 | */
19 |
20 |
21 | package org.hermit.geometry.generator;
22 |
23 | import org.hermit.geometry.Point;
24 | import org.hermit.geometry.Region;
25 |
26 |
27 | /**
28 | * A generic interface to a data generating algorithm.
29 | */
30 | public interface Generator {
31 |
32 | /**
33 | * Create a set of data points within the given region.
34 | *
35 | * @param region The region of the plane in which the points
36 | * must lie.
37 | * @param num The desired number of points.
38 | * @return The generated data points.
39 | */
40 | public Point[] createPoints(Region region, int num);
41 |
42 |
43 | /**
44 | * Get reference points, if any, associated with the most recently
45 | * generated data set.
46 | *
47 | * @return The reference points, if any, used to generate
48 | * the most recent data set. null if none.
49 | */
50 | public Point[] getReferencePoints();
51 |
52 | }
53 |
54 |
--------------------------------------------------------------------------------
/HermitLibrary/src/org/hermit/astro/AstroError.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * astro: astronomical functions, utilities and data
4 | *
Copyright 2009 Ian Cameron Smith
5 | *
6 | *
References: 7 | *
Note that the formulae have been converted to work in radians, to 20 | * make it easier to work with java.lang.Math. 21 | * 22 | *
This program is free software; you can redistribute it and/or modify 23 | * it under the terms of the GNU General Public License version 2 24 | * as published by the Free Software Foundation (see COPYING). 25 | * 26 | *
This program is distributed in the hope that it will be useful,
27 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 | * GNU General Public License for more details.
30 | */
31 |
32 |
33 | package org.hermit.astro;
34 |
35 |
36 | /**
37 | * This exception is used to indicate an invalid request from the caller.
38 | */
39 | public class AstroError
40 | extends Exception
41 | {
42 |
43 | /**
44 | * Create an exception with no message.
45 | */
46 | public AstroError() {
47 | super();
48 | }
49 |
50 | /**
51 | * Create an exception with a message.
52 | *
53 | * @param msg Error message.
54 | */
55 | public AstroError(String msg) {
56 | super(msg);
57 | }
58 |
59 | private static final long serialVersionUID = 7246431317624145407L;
60 |
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/HermitLibrary/src/org/hermit/astro/CalcError.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * astro: astronomical functions, utilities and data
4 | *
Copyright 2009 Ian Cameron Smith
5 | *
6 | *
References: 7 | *
Note that the formulae have been converted to work in radians, to 20 | * make it easier to work with java.lang.Math. 21 | * 22 | *
This program is free software; you can redistribute it and/or modify 23 | * it under the terms of the GNU General Public License version 2 24 | * as published by the Free Software Foundation (see COPYING). 25 | * 26 | *
This program is distributed in the hope that it will be useful, 27 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | * GNU General Public License for more details. 30 | */ 31 | 32 | 33 | package org.hermit.astro; 34 | 35 | 36 | /** 37 | * This exception represents an error within the Astro package; i.e. 38 | * something that shouldn't happen. 39 | */ 40 | public class CalcError 41 | extends RuntimeException 42 | { 43 | 44 | /** 45 | * Create an exception with no message. 46 | */ 47 | public CalcError() { 48 | super(); 49 | } 50 | 51 | /** 52 | * Create an exception with a message. 53 | * 54 | * @param msg Error message. 55 | */ 56 | public CalcError(String msg) { 57 | super(msg); 58 | } 59 | 60 | private static final long serialVersionUID = 7246431317624145407L; 61 | 62 | } 63 | 64 | -------------------------------------------------------------------------------- /HermitAndroid/doc/org/hermit/android/instruments/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 ||
24 | Classes
25 |
26 | 27 | AudioAnalyser 28 | 29 | Gauge 30 | 31 | Instrument 32 | 33 | InstrumentSurface 34 | 35 | PowerGauge 36 | 37 | SpectrumGauge 38 | 39 | TextGauge 40 | 41 | WaveformGauge |
42 |
|
24 | Interfaces
25 |
26 | 27 | TextInputDialog.OnOkListener 28 | 29 | YesNoDialog.OnOkListener |
30 |
|
37 | Classes
38 |
39 | 40 | ErrorDialog 41 | 42 | InfoBox 43 | 44 | TextInputDialog 45 | 46 | YesNoDialog |
47 |
This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License as 8 | * published by the Free Software Foundation (see COPYING). 9 | * 10 | *
This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | *
You should have received a copy of the GNU General Public 16 | * License along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 18 | * 02111-1307, USA. 19 | */ 20 | 21 | 22 | package org.hermit.test.utils; 23 | 24 | 25 | import junit.framework.TestCase; 26 | 27 | import org.hermit.utils.Bitwise; 28 | 29 | 30 | /** 31 | * Test bitwise utility functions. 32 | * 33 | * @author Ian Cameron Smith 34 | */ 35 | public class BitwiseTests 36 | extends TestCase 37 | { 38 | 39 | // ******************************************************************** // 40 | // Test Framework. 41 | // ******************************************************************** // 42 | 43 | private void runBitrev(int val, int n, int expect) { 44 | int res = Bitwise.bitrev(val, n); 45 | assertEquals("bitrev", String.format("0x%08x", expect), String.format("0x%08x", res)); 46 | } 47 | 48 | 49 | // ******************************************************************** // 50 | // Tests. 51 | // ******************************************************************** // 52 | 53 | public void testSixteen() { 54 | runBitrev(0xfda91235, 2, 0x00000002); 55 | runBitrev(0xfda91235, 3, 0x00000005); 56 | runBitrev(0xfda91233, 3, 0x00000006); 57 | runBitrev(0xfda91235, 16, 0x0000ac48); 58 | } 59 | 60 | 61 | public void testCorners() { 62 | runBitrev(0xfda91234, 0, 0x00000000); 63 | runBitrev(0xfda91235, 1, 0x00000001); 64 | runBitrev(0xfda91235, 32, 0xac4895bf); 65 | } 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /HermitAndroid/doc/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 || 23 | | 24 |
|---|
| All Classes
30 |
31 |
32 | Packages
33 | |
51 |
55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /HermitAndroid/doc/org/hermit/android/core/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 ||
24 | Classes
25 |
26 | 27 | AppUtils 28 | 29 | Errors 30 | 31 | HelpActivity 32 | 33 | MainActivity 34 | 35 | MainActivity.ActivityListener 36 | 37 | OneTimeDialog 38 | 39 | SplashActivity 40 | 41 | SurfaceRunner |
42 |
|
49 | Enums
50 |
51 | 52 | AppUtils.Detail |
53 |
This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation (see COPYING). 8 | * 9 | *
This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | *
You should have received a copy of the GNU General Public 15 | * License along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 17 | * 02111-1307, USA. 18 | */ 19 | 20 | 21 | package org.hermit.geometry.generator; 22 | 23 | 24 | import org.hermit.geometry.Point; 25 | import org.hermit.geometry.Region; 26 | 27 | 28 | /** 29 | * A data generator which generates evenly-distributed random points. 30 | */ 31 | public class RandomGenerator 32 | implements Generator 33 | { 34 | 35 | // ******************************************************************** // 36 | // Data Generator. 37 | // ******************************************************************** // 38 | 39 | /** 40 | * Create a set of data points within the given region. 41 | * 42 | * @param region The region of the plane in which the points 43 | * must lie. 44 | * @param num The desired number of points. 45 | * @return The generated data points. 46 | */ 47 | public Point[] createPoints(Region region, int num) { 48 | Point[] points = new Point[num]; 49 | for (int i = 0; i < num; ++i) 50 | points[i] = region.randomPoint(); 51 | 52 | return points; 53 | } 54 | 55 | 56 | /** 57 | * Get reference points, if any, associated with the most recently 58 | * generated data set. 59 | * 60 | * @return The reference points, if any, used to generate 61 | * the most recent data set. null if none. 62 | */ 63 | public Point[] getReferencePoints() { 64 | return null; 65 | } 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /HermitLibrary/src/org/hermit/astro/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |A library of astronomical calculations, providing positions, rise 6 | and set times, magnitudes, and other information for the Sun, Moon 7 | and planets. The code is based on "Astronomical 8 | Algorithms", by Jean Meeus, ISBN-10: 0-943396-61-1. Implemented 9 | directly in Java by Ian Cameron Smith.
10 | 11 |The key class is {@link org.hermit.astro.Observation}. It's used like this: 12 | 13 |
The {@link org.hermit.astro.Observation} and 36 | {@link org.hermit.astro.Body} computes the requested data on 37 | demand. However, the data is cached, so that if it is referred to from 38 | multiple places (which is often true in the internal calculations), it is 39 | only calculated once. Changing the circumstances of the observation 40 | (position, time, etc.) automatically clears all cached data.
41 | 42 |See the 43 | On Watch application for an example of how it can be used.
44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /HermitAndroid/doc/org/hermit/android/net/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 ||
24 | Interfaces
25 |
26 | 27 | WebFetcher.Listener |
28 |
|
35 | Classes
36 |
37 | 38 | CachedFile 39 | 40 | CachedFile.Entry 41 | 42 | FileFetcher 43 | 44 | TableFetcher 45 | 46 | WebBasedData 47 | 48 | WebFetcher |
49 |
|
56 | Exceptions
57 |
58 | 59 | WebFetcher.FetchException |
60 |
The only license info I can see: "If you ever need a voronoi 7 | * clustering in C#, feel free to use my solution here." See 8 | * http://bdittes.googlepages.com/ 9 | * 10 | *
This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 | */
14 |
15 |
16 | package org.hermit.geometry.voronoi;
17 |
18 | import java.util.ArrayList;
19 | import java.util.HashSet;
20 |
21 | import org.hermit.geometry.MathTools;
22 | import org.hermit.geometry.Point;
23 |
24 |
25 | /**
26 | * @author clint
27 | *
28 | */
29 | abstract class Event implements Comparable This program is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU General Public License as
7 | * published by the Free Software Foundation (see COPYING).
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public
15 | * License along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 | * 02111-1307, USA.
18 | */
19 |
20 |
21 | package org.hermit.geometry.spline;
22 |
23 |
24 | /**
25 | * Representation of a cubic polynomial.
26 | */
27 | public final class Cubic {
28 |
29 | // ******************************************************************** //
30 | // Constructor.
31 | // ******************************************************************** //
32 |
33 | /**
34 | * Create a cubic polynomial of form a + b*x + c*x^2 + d*x^3.
35 | *
36 | * @param a A coefficient.
37 | * @param b B coefficient.
38 | * @param c C coefficient.
39 | * @param d D coefficient.
40 | */
41 | public Cubic(double a, double b, double c, double d) {
42 | this.a = a;
43 | this.b = b;
44 | this.c = c;
45 | this.d = d;
46 | }
47 |
48 |
49 | // ******************************************************************** //
50 | // Evaluation.
51 | // ******************************************************************** //
52 |
53 | /**
54 | * Evaluate the polynomial for a given value.
55 | *
56 | * @param x X value to evaluate for.
57 | * @return The value of the polynomial for the given X.
58 | */
59 | public double eval(double x) {
60 | return ((d * x + c) * x + b) * x + a;
61 | }
62 |
63 |
64 | // ******************************************************************** //
65 | // Private Data.
66 | // ******************************************************************** //
67 |
68 | // The coefficients.
69 | private final double a, b, c, d;
70 |
71 | }
72 |
73 |
--------------------------------------------------------------------------------
/Scrambled Net/res/layout-large-port/play.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
31 |
32 | Packages
33 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/HermitLibrary/src/org/hermit/geo/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | A library of various geodetic utilities for handling positions,
6 | directions and distances over the surface of the Earth, with a choice
7 | of algorithms from the fast and simple Haversine formula,
8 | to the super-accurate Vincenty formula. Usage is pretty simple. Two rules to remember: For example, positions on the Earth are represented by the
18 | {@link org.hermit.geo.Position} class. You can create a Position
19 | in either of these ways: You can then easily calculate the distance between Positions: Abstract representations are used to avoid issues of units, as, for
33 | example, with the {@link org.hermit.geo.Distance} class used above.
34 | Having got a Distance,
35 | you can, when you need to, get its value in whatever units you like
36 | using provided accessors. Multiple algorithms for calculating distances etc. are supported. The
39 | simplest, the Haversine formula, assumes a spherical Earth; it is fast
40 | and easy to use, but has an error of about 0.5%. The class
41 | {@link org.hermit.geo.GeoCalculator} allows you to set what algorithm is in use. Note
42 | that the more complex calculators are based on an ellipsoidal Earth; since
43 | multiple ellipsoid approximations are (or have been) in use internationally,
44 | you need to say which one you want to use. For example: You can, if you wish, use the individual calculator classes directly;
52 | this is not the canonical model, but may be useful if you wish to work
53 | with several different calculators. The {@link org.hermit.geo.PointOfInterest} class provides (somewhat)
56 | interesting textual
57 | descriptions of points on the Earth's surface. For example: See the
65 | On Watch application for an example use of this package. This program is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU General Public License as
8 | * published by the Free Software Foundation (see COPYING).
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public
16 | * License along with this program; if not, write to the Free Software
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 | * 02111-1307, USA.
19 | */
20 |
21 | package org.hermit.utils;
22 |
23 |
24 | /**
25 | * A set of bit-twiddling utilities.
26 | *
27 | * @author Ian Cameron Smith
28 | */
29 | public class Bitwise
30 | {
31 |
32 | // ******************************************************************** //
33 | // Constructors.
34 | // ******************************************************************** //
35 |
36 | /**
37 | * This class is not constructible.
38 | */
39 | private Bitwise() {
40 | }
41 |
42 |
43 | // ******************************************************************** //
44 | // Number Properties.
45 | // ******************************************************************** //
46 |
47 | /**
48 | * Returns true if the argument is power of 2.
49 | *
50 | * @param n The number to test.
51 | * @return true if the argument is power of 2.
52 | */
53 | public static final boolean isPowerOf2(int n) {
54 | return n > 0 && (n & (n - 1)) == 0;
55 | }
56 |
57 |
58 | // ******************************************************************** //
59 | // Bit Order Reversal.
60 | // ******************************************************************** //
61 |
62 | /**
63 | * Reverse the lowest n bits of j. This function is useful in the
64 | * Cooley–Tukey FFT algorithm, for example.
65 | *
66 | * @param j Number to be reversed.
67 | * @param n Number of low-order bits of j which are significant
68 | * and to be reversed.
69 | * @return The lowest n bits of the input value j, reversed.
70 | * The higher-order bits will be zero.
71 | */
72 | public static final int bitrev(int j, int n) {
73 | int r = 0;
74 | for (int i = 0; i < n; ++i, j >>= 1)
75 | r = (r << 1) | (j & 0x0001);
76 | return r;
77 | }
78 |
79 | }
80 |
81 |
--------------------------------------------------------------------------------
/HermitLibrary/test/org/hermit/test/astro/TestParallax.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * astro: astronomical functions, utilities and data
4 | *
5 | * This package was created by Ian Cameron Smith in February 2009, based
6 | * on the formulae in "Practical Astronomy with your Calculator" by
7 | * Peter Duffett-Smith, ISBN-10: 0521356997.
8 | *
9 | * Note that the formulae have been converted to work in radians, to
10 | * make it easier to work with java.lang.Math.
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License version 2
14 | * as published by the Free Software Foundation (see COPYING).
15 | *
16 | * This program is distributed in the hope that it will be useful,
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 | * GNU General Public License for more details.
20 | */
21 |
22 |
23 | package org.hermit.test.astro;
24 |
25 |
26 | import static java.lang.Math.toDegrees;
27 | import static org.hermit.test.NumericAsserts.assertDegrees;
28 | import static org.hermit.test.NumericAsserts.assertTolerance;
29 | import junit.framework.TestCase;
30 |
31 | import org.hermit.astro.AstroError;
32 | import org.hermit.astro.Body;
33 | import org.hermit.astro.Instant;
34 | import org.hermit.astro.Observation;
35 | import org.hermit.astro.Planet;
36 | import org.hermit.astro.Body.Field;
37 | import org.hermit.geo.Position;
38 |
39 |
40 | /**
41 | * Test code.
42 | */
43 | public class TestParallax
44 | extends TestCase
45 | {
46 |
47 | // ******************************************************************** //
48 | // Test Code.
49 | // ******************************************************************** //
50 |
51 | private static void testParallax(Body b, double cα, double cδ) throws AstroError {
52 | String n = b.getId().toString();
53 | String lab = "Topo Position " + n;
54 |
55 | // double α = toDegrees(b.get(Field.RIGHT_ASCENSION_AP));
56 | // double δ = toDegrees(b.get(Field.DECLINATION_AP));
57 | double αt = toDegrees(b.get(Field.RIGHT_ASCENSION_TOPO));
58 | double δt = toDegrees(b.get(Field.DECLINATION_TOPO));
59 |
60 | assertDegrees(lab + " α", αt, cα, 0.001);
61 | assertTolerance(lab + " δ", δt, cδ, 0.001);
62 | }
63 |
64 |
65 | public void testParallax() throws AstroError {
66 | // From Meeus chapter 40.
67 | Instant instant = new Instant(2003, 8, 28.0 + (3.0+17.0/60.0)/24.0);
68 | Observation o = new Observation(instant);
69 | o.setObserverPosition(Position.fromDegrees(33.3561111, -116.8625));
70 | o.setObserverAltitude(1706);
71 | Planet mars = o.getPlanet(Planet.Name.MARS);
72 | testParallax(mars, 339.530208 + 0.0053917, -15.7750000);
73 | }
74 |
75 | }
76 |
77 |
--------------------------------------------------------------------------------
/HermitLibrary/src/org/hermit/geometry/cluster/Clusterer.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * cluster: routines for cluster analysis.
4 | *
5 | * This program is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU General Public License as
7 | * published by the Free Software Foundation (see COPYING).
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public
15 | * License along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 | * 02111-1307, USA.
18 | */
19 |
20 |
21 | package org.hermit.geometry.cluster;
22 |
23 | import org.hermit.geometry.Point;
24 | import org.hermit.geometry.Region;
25 |
26 |
27 | /**
28 | * A generic interface to a clustering algorithm.
29 | */
30 | public abstract class Clusterer {
31 |
32 | /**
33 | * Prepare a clustering pass on the indicated data.
34 | *
35 | * Subclasses can override this to do their own preparation, but
36 | * must call through to this method.
37 | *
38 | * @param points The array of points to be clustered.
39 | * @param ids Array of cluster numbers which this call will
40 | * fill in, defining which cluster each point
41 | * belongs to. The caller must leave the data here
42 | * intact between iterations.
43 | * @param means Array of x,y values in which to place centroids
44 | * of the clusters.
45 | * @param region The region of the plane in which the points lie.
46 | */
47 | public void prepare(Point[] points, int[] ids, double[][] means, Region region) {
48 | }
49 |
50 |
51 | /**
52 | * Runs a single iteration of the clustering algorithm on the stored data.
53 | * The results are stored in the arrays that were passed into
54 | * {@link #prepare(Point[], int[], double[][], Region)}.
55 | *
56 | * After each iteration, the cluster IDs and cluster means should
57 | * be consistent with each other.
58 | *
59 | * @return true if the algorithm has converged.
60 | */
61 | public abstract boolean iterate();
62 |
63 |
64 | /**
65 | * Calculate a quality metric for the current clustering solution.
66 | * This number is available after each call to {@link #iterate()}.
67 | *
68 | * @return Quality metric for this solution; small is better.
69 | */
70 | public abstract double metric();
71 |
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/HermitLibrary/src/org/hermit/geometry/voronoi/DataNode.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * bentools: Voronoi diagram generator. This is Benjamin Dittes'
4 | * C# implementation of Fortune's algorithm, translated to Java
5 | * by Ian Cameron Smith.
6 | *
7 | * The only license info I can see: "If you ever need a voronoi
8 | * clustering in C#, feel free to use my solution here." See
9 | * http://bdittes.googlepages.com/
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | */
15 |
16 |
17 | package org.hermit.geometry.voronoi;
18 |
19 |
20 | import org.hermit.geometry.Point;
21 |
22 |
23 | /**
24 | * @author clint
25 | *
26 | */
27 | class DataNode extends Node {
28 |
29 | public DataNode(Point DP) {
30 | DataPoint = DP;
31 | }
32 |
33 |
34 | public DataNode(Event P) {
35 | DataPoint = new Point(P.getX(), P.getY());
36 | }
37 |
38 |
39 | public Point DataPoint;
40 |
41 |
42 | CircleEvent CircleCheckDataNode(double ys) {
43 | final DataNode l = Node.LeftDataNode(this);
44 | final DataNode r = Node.RightDataNode(this);
45 | if (l == null || r == null || l.DataPoint == r.DataPoint
46 | || l.DataPoint == DataPoint || DataPoint == r.DataPoint)
47 | return null;
48 | if (ccw(l.DataPoint, DataPoint, r.DataPoint) <= 0)
49 | return null;
50 |
51 | final Point Center = CircumCircleCenter(l.DataPoint,
52 | DataPoint, r.DataPoint);
53 | final CircleEvent VC = new CircleEvent(this, l, r, Center);
54 | if (VC.getY() >= ys)
55 | return VC;
56 |
57 | return null;
58 | }
59 |
60 |
61 | private static int ccw(Point P0, Point P1, Point P2) {
62 | double dx1, dx2, dy1, dy2;
63 | dx1 = P1.getX() - P0.getX();
64 | dy1 = P1.getY() - P0.getY();
65 | dx2 = P2.getX() - P0.getX();
66 | dy2 = P2.getY() - P0.getY();
67 | if (dx1 * dy2 > dy1 * dx2)
68 | return +1;
69 | if (dx1 * dy2 < dy1 * dx2)
70 | return -1;
71 | if (dx1 * dx2 < 0 || dy1 * dy2 < 0)
72 | return -1;
73 | return 0;
74 | }
75 |
76 |
77 | // ******************************************************************** //
78 | // Utilities.
79 | // ******************************************************************** //
80 |
81 | /**
82 | * Convert this instance to a String suitable for display.
83 | *
84 | * @return String representation of this instance.
85 | */
86 | @Override
87 | public String toString() {
88 | return super.toString() + DataPoint;
89 | }
90 |
91 | }
92 |
93 |
--------------------------------------------------------------------------------
/HermitAndroid/src/org/hermit/android/widgets/NumberPickerButton.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * widgets: useful add-on widgets for Android.
4 | *
5 | * This program is free software; you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License version 2
7 | * as published by the Free Software Foundation (see COPYING).
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | */
14 |
15 |
16 | package org.hermit.android.widgets;
17 |
18 |
19 | import org.hermit.android.R;
20 |
21 | import android.content.Context;
22 | import android.util.AttributeSet;
23 | import android.view.KeyEvent;
24 | import android.view.MotionEvent;
25 | import android.widget.ImageButton;
26 |
27 |
28 | /**
29 | * This class exists purely to cancel long click events, that got
30 | * started in NumberPicker
31 | */
32 | class NumberPickerButton extends ImageButton {
33 |
34 | private NumberPicker mNumberPicker;
35 |
36 | public NumberPickerButton(Context context, AttributeSet attrs,
37 | int defStyle) {
38 | super(context, attrs, defStyle);
39 | }
40 |
41 | public NumberPickerButton(Context context, AttributeSet attrs) {
42 | super(context, attrs);
43 | }
44 |
45 | public NumberPickerButton(Context context) {
46 | super(context);
47 | }
48 |
49 | public void setNumberPicker(NumberPicker picker) {
50 | mNumberPicker = picker;
51 | }
52 |
53 | @Override
54 | public boolean onTouchEvent(MotionEvent event) {
55 | cancelLongpressIfRequired(event);
56 | return super.onTouchEvent(event);
57 | }
58 |
59 | @Override
60 | public boolean onTrackballEvent(MotionEvent event) {
61 | cancelLongpressIfRequired(event);
62 | return super.onTrackballEvent(event);
63 | }
64 |
65 | @Override
66 | public boolean onKeyUp(int keyCode, KeyEvent event) {
67 | if ((keyCode == KeyEvent.KEYCODE_DPAD_CENTER)
68 | || (keyCode == KeyEvent.KEYCODE_ENTER)) {
69 | cancelLongpress();
70 | }
71 | return super.onKeyUp(keyCode, event);
72 | }
73 |
74 | private void cancelLongpressIfRequired(MotionEvent event) {
75 | if ((event.getAction() == MotionEvent.ACTION_CANCEL)
76 | || (event.getAction() == MotionEvent.ACTION_UP)) {
77 | cancelLongpress();
78 | }
79 | }
80 |
81 | private void cancelLongpress() {
82 | if (R.id.increment == getId()) {
83 | mNumberPicker.cancelIncrement();
84 | } else if (R.id.decrement == getId()) {
85 | mNumberPicker.cancelDecrement();
86 | }
87 | }
88 | }
89 |
90 |
--------------------------------------------------------------------------------
/HermitLibrary/doc/org/hermit/astro/package-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | This program is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU General Public License as
8 | * published by the Free Software Foundation (see COPYING).
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public
16 | * License along with this program; if not, write to the Free Software
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 | * 02111-1307, USA.
19 | */
20 |
21 | package org.hermit.geo;
22 |
23 |
24 | import static java.lang.Math.toRadians;
25 |
26 | import org.hermit.utils.Angle;
27 |
28 |
29 | /**
30 | * This class represents a geographic azimuth -- ie. a compass heading
31 | * from or to a given geographic position.
32 | *
33 | * @author Ian Cameron Smith
34 | */
35 | public final class Azimuth
36 | extends Angle
37 | {
38 |
39 | // ******************************************************************** //
40 | // Public Constructors.
41 | // ******************************************************************** //
42 |
43 | /**
44 | * Create an Azimuth from an azimuth given in radians.
45 | *
46 | * @param radians Source azimuth in radians, clockwise from north.
47 | */
48 | public Azimuth(double radians) {
49 | // Normalize to the range 0 <= radians < 2 * PI.
50 | super(modTwoPi(radians));
51 | }
52 |
53 |
54 | // ******************************************************************** //
55 | // Accessors and Converters.
56 | // ******************************************************************** //
57 |
58 | /**
59 | * Create a Azimuth from an azimuth given in degrees.
60 | *
61 | * @param degrees Source azimuth in degrees, clockwise from north.
62 | * @return The new Azimuth.
63 | */
64 | public static Azimuth fromDegrees(double degrees) {
65 | return new Azimuth(toRadians(degrees));
66 | }
67 |
68 |
69 | // ******************************************************************** //
70 | // Azimuth Arithmetic.
71 | // ******************************************************************** //
72 |
73 | /**
74 | * Calculate the azimuth which is the given angular offset from this one.
75 | *
76 | * @param radians Offset to add to this Azimuth, in radians;
77 | * positive is clockwise from north, may be
78 | * negative.
79 | * @return Azimuth which is equal to this Azimuth plus
80 | * the given offset. Overflow is taken care of.
81 | */
82 | @Override
83 | public Azimuth add(double radians) {
84 | // The constructor takes care of normalization.
85 | return new Azimuth(getRadians() + radians);
86 | }
87 |
88 | }
89 |
90 |
--------------------------------------------------------------------------------
/HermitLibrary/src/org/hermit/geometry/voronoi/VoronoiEdge.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * bentools: Voronoi diagram generator. This is Benjamin Dittes'
4 | * C# implementation of Fortune's algorithm, translated to Java
5 | * by Ian Cameron Smith.
6 | *
7 | * The only license info I can see: "If you ever need a voronoi
8 | * clustering in C#, feel free to use my solution here." See
9 | * http://bdittes.googlepages.com/
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | */
15 |
16 |
17 | package org.hermit.geometry.voronoi;
18 |
19 | import org.hermit.geometry.Edge;
20 | import org.hermit.geometry.Point;
21 |
22 |
23 | /**
24 | * @author clint
25 | *
26 | */
27 | class VoronoiEdge
28 | {
29 |
30 | // ******************************************************************** //
31 | // Building.
32 | // ******************************************************************** //
33 |
34 | void AddVertex(Point V) {
35 | if (VVertexA == Point.UNKNOWN)
36 | VVertexA = V;
37 | else if (VVertexB == Point.UNKNOWN)
38 | VVertexB = V;
39 | else
40 | throw new RuntimeException("Tried to add third vertex!");
41 | }
42 |
43 |
44 | // ******************************************************************** //
45 | // Accessors.
46 | // ******************************************************************** //
47 |
48 | /**
49 | * Determine whether this edge is infinite.
50 | *
51 | * @return True if both vertices are infinite; false else.
52 | */
53 | boolean isInfinite() {
54 | return VVertexA == Point.INFINITE && VVertexB == Point.INFINITE;
55 | }
56 |
57 |
58 | /**
59 | * Determine whether this edge is partly infinite.
60 | *
61 | * @return True if either vertex is infinite; false else.
62 | */
63 | boolean isPartlyInfinite() {
64 | return VVertexA == Point.INFINITE || VVertexB == Point.INFINITE;
65 | }
66 |
67 |
68 | // ******************************************************************** //
69 | // Conversion.
70 | // ******************************************************************** //
71 |
72 | /**
73 | * Convert this VoronoiEdge to an immutable Edge.
74 | *
75 | * @return An Edge equivalent to this object.
76 | */
77 | Edge toEdge() {
78 | return new Edge(VVertexA, VVertexB, LeftData, RightData);
79 | }
80 |
81 |
82 | // ******************************************************************** //
83 | // Package-Visible Data.
84 | // ******************************************************************** //
85 |
86 | boolean Done = false;
87 |
88 | Point RightData = Point.UNKNOWN, LeftData = Point.UNKNOWN;
89 |
90 | Point VVertexA = Point.UNKNOWN, VVertexB = Point.UNKNOWN;
91 |
92 |
93 | }
94 |
95 |
--------------------------------------------------------------------------------
/HermitLibrary/src/org/hermit/geo/GeoConstants.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * geo: geographical utilities.
4 | * This program is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU General Public License as
8 | * published by the Free Software Foundation (see COPYING).
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public
16 | * License along with this program; if not, write to the Free Software
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 | * 02111-1307, USA.
19 | */
20 |
21 | package org.hermit.geo;
22 |
23 |
24 | /**
25 | * Global constants for geodetic calculations.
26 | *
27 | * @author Ian Cameron Smith
28 | */
29 | public interface GeoConstants
30 | {
31 |
32 | // ******************************************************************** //
33 | // Public Constants.
34 | // ******************************************************************** //
35 |
36 | /**
37 | * An approximation of the mean radius of the Earth in metres.
38 | * For spherical-Earth formulae, this is good enough.
39 | */
40 | public static final double MEAN_RADIUS = 6371000.0;
41 |
42 | /**
43 | * The equatorial radius of the Earth in metres.
44 | */
45 | public static final double EQUATORIAL_RADIUS = 6378137.0;
46 |
47 | /**
48 | * The polar radius of the Earth in metres.
49 | */
50 | public static final double POLAR_RADIUS = 6356755.0;
51 |
52 |
53 | /**
54 | * Selectable ellipsoids, for geodetic calculations.
55 | */
56 | public enum Ellipsoid {
57 | /** Pseudo-ellipsoid for an assumed spherical Earth. */
58 | SPHERE("Sphere", MEAN_RADIUS, 0.0),
59 |
60 | /** WGS 84 ellipsoid. */
61 | WGS84("GRS80 / WGS84 (NAD83)", 6378137, 1.0 / 298.25722210088),
62 |
63 | /** Clarke 1866 (NAD27) ellipsoid. */
64 | NAD27("Clarke 1866 (NAD27)", 6378206.4, 1.0 / 294.9786982138),
65 |
66 | /** Airy 1858 ellipsoid. */
67 | AIRY1858("Airy 1858", 6377563.396, 1.0 / 299.3249646),
68 |
69 | /** Airy Modified ellipsoid. */
70 | AIRYM("Airy Modified", 6377340.189, 1.0 / 299.3249646),
71 |
72 | /** NWL-9D (WGS 66) ellipsoid. */
73 | WGS66("NWL-9D (WGS 66)", 6378145, 1.0 / 298.25),
74 |
75 | /** WGS 72 ellipsoid. */
76 | WGS72("WGS 72", 6378135, 1.0 / 298.26);
77 |
78 | Ellipsoid(String n, double a, double f) {
79 | name = n;
80 | axis = a;
81 | flat = f;
82 | }
83 |
84 | /** User-visible name of this ellipsoid. */
85 | public final String name;
86 |
87 | /** Equatorial semimajor axis of this ellipsoid (in metres). */
88 | public final double axis;
89 |
90 | /** Flattening of this ellipsoid. */
91 | public final double flat;
92 |
93 | }
94 |
95 | }
96 |
97 |
--------------------------------------------------------------------------------
/Scrambled Net/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
25 |
26 | This program is free software; you can redistribute it and/or modify
10 | * it under the terms of the GNU General Public License version 2
11 | * as published by the Free Software Foundation (see COPYING).
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | */
18 |
19 |
20 | package org.hermit.android.provider;
21 |
22 |
23 | import android.content.ContentValues;
24 | import android.database.Cursor;
25 | import android.database.DatabaseUtils;
26 |
27 |
28 | /**
29 | * Utility class for managing a row from a content provider.
30 | */
31 | public abstract class DbRow {
32 |
33 | // ******************************************************************** //
34 | // Constructor.
35 | // ******************************************************************** //
36 |
37 | /**
38 | * Create a database row instance from a Cursor.
39 | *
40 | * @param schema Schema of the table the row belongs to.
41 | * @param c Cursor to read the row data from.
42 | */
43 | protected DbRow(TableSchema schema, Cursor c) {
44 | this(schema, c, schema.getDefaultProjection());
45 | }
46 |
47 |
48 | /**
49 | * Create a database row instance from a Cursor.
50 | *
51 | * @param schema Schema of the table the row belongs to.
52 | * @param c Cursor to read the row data from.
53 | * @param projection The fields to read.
54 | */
55 | protected DbRow(TableSchema schema, Cursor c, String[] projection) {
56 | tableSchema = schema;
57 |
58 | rowValues = new ContentValues();
59 | DatabaseUtils.cursorRowToContentValues(c, rowValues);
60 | }
61 |
62 |
63 | // ******************************************************************** //
64 | // Public Accessors.
65 | // ******************************************************************** //
66 |
67 |
68 | // ******************************************************************** //
69 | // Local Accessors.
70 | // ******************************************************************** //
71 |
72 | /**
73 | * Save the contents of this row to the given ContentValues.
74 | *
75 | * @param values Object to write to.
76 | */
77 | void getValues(ContentValues values) {
78 | values.putAll(rowValues);
79 | }
80 |
81 |
82 | // ******************************************************************** //
83 | // Private Data.
84 | // ******************************************************************** //
85 |
86 | // Schema of the table this row belongs to.
87 | @SuppressWarnings("unused")
88 | private final TableSchema tableSchema;
89 |
90 | // The values of the fields in this row.
91 | private final ContentValues rowValues;
92 |
93 | }
94 |
95 |
--------------------------------------------------------------------------------
/Scrambled Net/res/values-zh-rTW/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | This program is free software; you can redistribute it and/or modify
10 | * it under the terms of the GNU General Public License version 2
11 | * as published by the Free Software Foundation (see COPYING).
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | */
18 |
19 |
20 | package org.hermit.android.notice;
21 |
22 |
23 | import android.app.AlertDialog;
24 | import android.content.Context;
25 | import android.content.DialogInterface;
26 |
27 |
28 | /**
29 | * This class implements a popup error box (a subclass of AlertDialog)
30 | * which can be used to display an error message.
31 | */
32 | public class ErrorDialog
33 | extends AlertDialog
34 | {
35 |
36 | // ******************************************************************** //
37 | // Constructor.
38 | // ******************************************************************** //
39 |
40 | /**
41 | * Create an error dialog.
42 | *
43 | * @param parent Parent application context.
44 | * @param button The resource ID of the text for the OK button.
45 | */
46 | public ErrorDialog(Context parent, int button) {
47 | this(parent, parent.getText(button));
48 | }
49 |
50 |
51 | /**
52 | * Create an error dialog.
53 | *
54 | * @param parent Parent application context.
55 | * @param button The text for the OK button.
56 | */
57 | public ErrorDialog(Context parent, CharSequence button) {
58 | super(parent);
59 |
60 | setIcon(android.R.drawable.ic_dialog_alert);
61 | setButton(button, new OnClickListener() {
62 | @Override
63 | public void onClick(DialogInterface dialog, int which) {
64 | okButtonPressed();
65 | }
66 | });
67 | }
68 |
69 |
70 | // ******************************************************************** //
71 | // Dialog control.
72 | // ******************************************************************** //
73 |
74 | /**
75 | * Start the dialog and display it on screen. The window is placed in
76 | * the application layer and opaque.
77 | *
78 | * @param title Title for the dialog.
79 | * @param text Text to display in the dialog.
80 | */
81 | public void show(String title, String text) {
82 | setTitle(title);
83 | setMessage(text);
84 | show();
85 | }
86 |
87 |
88 | /**
89 | * Start the dialog and display it on screen. The window is placed in
90 | * the application layer and opaque.
91 | *
92 | * @param text Text to display in the dialog.
93 | */
94 | public void show(String text) {
95 | setMessage(text);
96 | show();
97 | }
98 |
99 |
100 | // ******************************************************************** //
101 | // Input Handling.
102 | // ******************************************************************** //
103 |
104 | /**
105 | * Called when the OK button is clicked.
106 | */
107 | void okButtonPressed() {
108 | dismiss();
109 | }
110 |
111 | }
112 |
113 |
--------------------------------------------------------------------------------
/HermitAndroid/src/org/hermit/android/widgets/LinedEditText.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * widgets: useful add-on widgets for Android.
4 | *
5 | * This program is free software; you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License version 2
7 | * as published by the Free Software Foundation (see COPYING).
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | */
14 |
15 |
16 | package org.hermit.android.widgets;
17 |
18 |
19 | import android.content.Context;
20 | import android.graphics.Canvas;
21 | import android.graphics.Paint;
22 | import android.graphics.Rect;
23 | import android.util.AttributeSet;
24 | import android.widget.EditText;
25 |
26 |
27 | /**
28 | * A custom EditText that draws lines between each line of text
29 | * that is displayed.
30 | */
31 | public class LinedEditText extends EditText {
32 |
33 | // ******************************************************************** //
34 | // Constructors.
35 | // ******************************************************************** //
36 |
37 | /**
38 | * Construct a widget from a given attribute set. This is required to
39 | * allow this widget to be used from XML layouts.
40 | *
41 | * @param context Context we're running in.
42 | * @param attrs Attributes for this widget.
43 | */
44 | public LinedEditText(Context context, AttributeSet attrs) {
45 | super(context, attrs);
46 |
47 | drawRect = new Rect();
48 |
49 | // Initialise the painter with the drawing attributes for the lines.
50 | drawPaint = new Paint();
51 | drawPaint.setStyle(Paint.Style.STROKE);
52 | drawPaint.setColor(LINE_COLOUR);
53 | }
54 |
55 |
56 | // ******************************************************************** //
57 | // Drawing.
58 | // ******************************************************************** //
59 |
60 | /**
61 | * Overridden onDraw method. Draw the text, with lines.
62 | *
63 | * @param canvas Canvas to draw into.
64 | */
65 | @Override
66 | protected void onDraw(Canvas canvas) {
67 | Rect r = drawRect;
68 | Paint paint = drawPaint;
69 |
70 | // Draw a line under each text line.
71 | int count = getLineCount();
72 | for (int i = 0; i < count; i++) {
73 | // Get the bounds for this text line, and draw a line under it.
74 | int baseline = getLineBounds(i, r);
75 | canvas.drawLine(r.left, baseline + 1, r.right, baseline + 1, paint);
76 | }
77 |
78 | super.onDraw(canvas);
79 | }
80 |
81 |
82 | // ******************************************************************** //
83 | // Private Constants.
84 | // ******************************************************************** //
85 |
86 | // Colour for the text lines.
87 | private static final int LINE_COLOUR = 0x600000ff;
88 |
89 |
90 | // ******************************************************************** //
91 | // Private Data.
92 | // ******************************************************************** //
93 |
94 | // Rect used for storing bounds.
95 | private Rect drawRect;
96 |
97 | // Paint used for drawing the lines.
98 | private Paint drawPaint;
99 |
100 | }
101 |
102 |
--------------------------------------------------------------------------------
/HermitLibrary/src/ca/uol/aig/fftpack/RealDoubleFFT_Odd_Odd.java:
--------------------------------------------------------------------------------
1 | package ca.uol.aig.fftpack;
2 | /**
3 | * sine FFT transform with odd wave numbers.
4 | * @author Baoshe Zhang
5 | * @author Astronomical Instrument Group of University of Lethbridge.
6 | */
7 | public class RealDoubleFFT_Odd_Odd extends RealDoubleFFT_Even_Odd
8 | {
9 | /**
10 | * norm_factor can be used to normalize this FFT transform. This is because
11 | * a call of forward transform (ft) followed by a call of backward transform
12 | * (bt) will multiply the input sequence by norm_factor.
13 | */
14 |
15 | /**
16 | * Construct a wavenumber table with size n.
17 | * The sequences with the same size can share a wavenumber table. The prime
18 | * factorization of n together with a tabulation of the trigonometric functions
19 | * are computed and stored.
20 | *
21 | * @param n the size of a real data sequence. When n is a multiplication of small
22 | * numbers (4, 2, 3, 5), this FFT transform is very efficient.
23 | */
24 | public RealDoubleFFT_Odd_Odd(int n)
25 | {
26 | super(n);
27 | }
28 |
29 | /**
30 | * Forward FFT transform of quarter wave data. It computes the coeffients in
31 | * sine series representation with only odd wave numbers.
32 | *
33 | * @param x an array which contains the sequence to be transformed. After FFT,
34 | * x contains the transform coeffients.
35 | */
36 | @Override
37 | public void ft(double x[])
38 | {
39 | sinqf(ndim, x, wavetable);
40 | }
41 |
42 | /**
43 | * Backward FFT transform of quarter wave data. It is the unnormalized inverse transform
44 | * of ft.
45 | *
46 | * @param x an array which contains the sequence to be tranformed. After FFT, x contains
47 | * the transform coeffients.
48 | */
49 | @Override
50 | public void bt(double x[])
51 | {
52 | sinqb(ndim, x, wavetable);
53 | }
54 |
55 | /*-----------------------------------------------
56 | sinqf: forward sine FFT with odd wave numbers.
57 | ----------------------------------------------*/
58 | void sinqf(int n, double x[], double wtable[])
59 | {
60 | int k;
61 | double xhold;
62 | int kc, ns2;
63 |
64 | if(n==1) return;
65 | ns2=n / 2;
66 | for(k=0; k This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public
15 | * License along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 | * 02111-1307, USA.
18 | */
19 |
20 |
21 | package org.hermit.geometry;
22 |
23 |
24 | /**
25 | * Mathematical utilities for geometric calculations.
26 | *
27 | * This package provides mathematical comparisons which ignore the
28 | * lowest bits of the provided values. This is useful when comparing
29 | * values which should be equal, except for floating-point representability
30 | * and rounding.
31 | */
32 | public class MathTools {
33 |
34 | // ******************************************************************** //
35 | // Configuration.
36 | // ******************************************************************** //
37 |
38 | /**
39 | * Set the precision for calculations. The precision is given
40 | * as a scaling factor; values are scaled by this value and rounded to 1.
41 | *
42 | * @param val The precision as a scaling factor.
43 | */
44 | public static final void setPrecision(double val) {
45 | precision = val;
46 | }
47 |
48 |
49 | // ******************************************************************** //
50 | // Comparisons.
51 | // ******************************************************************** //
52 |
53 | /**
54 | * Return the given value rounded according to the current precision.
55 | *
56 | * @param val The value to round.
57 | * @return The rounded value.
58 | */
59 | public static final double round(double val) {
60 | return Math.rint(val * precision) / precision;
61 | }
62 |
63 |
64 | /**
65 | * Determine whether two values are equal to within the current precision.
66 | *
67 | * @param a One value to compare.
68 | * @param b The other value to compare.
69 | * @return True if the values do not differ within the
70 | * current precision.
71 | */
72 | public static final boolean eq(double a, double b) {
73 | return Math.abs(a - b) * precision < 1.0;
74 | }
75 |
76 |
77 | /**
78 | * Determine whether a value is less than another to within the current precision.
79 | *
80 | * @param a One value to compare.
81 | * @param b The other value to compare.
82 | * @return True if a < b by at least the current precision.
83 | */
84 | public static final boolean lt(double a, double b) {
85 | return (b - a) * precision > 1.0;
86 | }
87 |
88 |
89 | // ******************************************************************** //
90 | // Private Class Data.
91 | // ******************************************************************** //
92 |
93 | // The required precision for comparisons, expressed as a
94 | // scaling factor; values are scaled by this value and rounded to 1.
95 | private static double precision = 10000000000.0;
96 |
97 | }
98 |
99 |
--------------------------------------------------------------------------------
/Scrambled Net/res/layout-notlong-port/score_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | This program is distributed in the hope that it will be useful,
6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8 | */
9 |
10 |
11 | package org.hermit.test.cluster;
12 |
13 |
14 | import java.util.Arrays;
15 |
16 | import junit.framework.Assert;
17 | import junit.framework.TestCase;
18 |
19 | import org.hermit.geometry.Edge;
20 | import org.hermit.geometry.Point;
21 | import org.hermit.geometry.Graph;
22 | import org.hermit.geometry.voronoi.Fortune;
23 |
24 |
25 | /**
26 | * Simple Voronoi test scenario. This class runs a simple Voronoi test,
27 | * and does a rough check of the results.
28 | */
29 | public class SimpleTest
30 | extends TestCase
31 | {
32 |
33 | /**
34 | * Input test points, basically random.
35 | */
36 | private static final Point[] INPUT_MEANS = {
37 | new Point(235,366),
38 | new Point(60,96),
39 | new Point(208,194),
40 | new Point(67,350),
41 | new Point(192,48),
42 | };
43 |
44 | /**
45 | * The edges we expect; generated by observation from a test run. This
46 | * array doesn't include the slopes of the semi-infinite lines, so
47 | * it's just a rough test.
48 | */
49 | private static final Point[][] EXPECT_EDGES = {
50 | { new Point(82.70175581206308,222.47081775321087),
51 | new Point(157.47133220910624,290.0510118043845) },
52 | { new Point(145.97125748502995,126.92095808383233),
53 | Point.INFINITE },
54 | { new Point(82.70175581206308,222.47081775321087),
55 | Point.INFINITE },
56 | { new Point(157.47133220910624,290.0510118043845),
57 | Point.INFINITE },
58 | { new Point(145.97125748502995,126.92095808383233),
59 | new Point(3626.5218487394955,-254.50924369747895) },
60 | { new Point(145.97125748502995,126.92095808383233),
61 | new Point(82.70175581206308,222.47081775321087) },
62 | { new Point(3626.5218487394955,-254.50924369747895),
63 | Point.INFINITE },
64 | { new Point(157.47133220910624,290.0510118043845),
65 | new Point(3626.5218487394955,-254.50924369747895) },
66 | };
67 |
68 |
69 | /**
70 | * Run a test on the simple test data.
71 | */
72 | public void testSimple() {
73 | Graph graph = Fortune.ComputeVoronoiGraph(INPUT_MEANS);
74 |
75 | // Convert the expected edges to an array. Sort for comparison.
76 | int nedges = EXPECT_EDGES.length;
77 | Edge[] refEdges = new Edge[nedges];
78 | for (int i = 0; i < nedges; ++i) {
79 | Point v1 = EXPECT_EDGES[i][0];
80 | Point v2 = EXPECT_EDGES[i][1];
81 |
82 | // TODO: we're making up fake datum points here. Should do this
83 | // based on the reference line equation.
84 | refEdges[i] = new Edge(v1, v2, new Point(0, 0), new Point(0, 1));
85 | }
86 | Arrays.sort(refEdges);
87 |
88 | // Convert the generated edges to an array and sort.
89 | Edge[] vEdges = graph.getEdgeArray();
90 | Arrays.sort(vEdges);
91 |
92 | // Compare the non-infinite edges. Note that we're only checking
93 | // the position of the vertices as yet; this is not a complete
94 | // check in the case of semi-infinite or infinite edges.
95 | assertEquals("number of edges", refEdges.length, vEdges.length);
96 | for (int i = 0; i < refEdges.length; ++i)
97 | if (refEdges[i].compareTo(vEdges[i]) != 0)
98 | Assert.fail("edge " + i + ": expected " + refEdges[i] + "; got " + vEdges[i]);
99 | }
100 |
101 | }
102 |
103 |
--------------------------------------------------------------------------------
/HermitLibrary/src/org/hermit/astro/Util.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * astro: astronomical functions, utilities and data
4 | * References:
7 | * Note that the formulae have been converted to work in radians, to
20 | * make it easier to work with java.lang.Math.
21 | *
22 | * This program is free software; you can redistribute it and/or modify
23 | * it under the terms of the GNU General Public License version 2
24 | * as published by the Free Software Foundation (see COPYING).
25 | *
26 | * This program is distributed in the hope that it will be useful,
27 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 | * GNU General Public License for more details.
30 | */
31 |
32 |
33 | package org.hermit.astro;
34 |
35 |
36 | /**
37 | * This class contains an implementation of Meeus' interpolation methods.
38 | *
39 | * @author Ian Cameron Smith
40 | */
41 | public class Util
42 | implements AstroConstants
43 | {
44 |
45 | // ******************************************************************** //
46 | // Constructors.
47 | // ******************************************************************** //
48 |
49 | /**
50 | * No instances allowed.
51 | */
52 | private Util() {
53 | }
54 |
55 |
56 | // ******************************************************************** //
57 | // Interpolation Utilities.
58 | // ******************************************************************** //
59 |
60 | /**
61 | * Interpolate in a table to find a good interpolated value.
62 | *
63 | * From AA chapter 3.
64 | *
65 | * @param args The arguments of the table. Each element is
66 | * an index in the table (e.g. a time).
67 | * @param values The values of the table. Each element is
68 | * the value for the corresponding argument in args[].
69 | * @param index The argument for which we want the
70 | * interpolated value.
71 | * @return The value of the table at index, interpolated
72 | * from the point values.
73 | */
74 | public static double interpolate(double[] args, double[] values, double index) {
75 | int tablen = args.length;
76 | if (tablen != values.length)
77 | throw new IllegalArgumentException("Both tables for interpolate()" +
78 | " must be the same length.");
79 | if (tablen != 3)
80 | throw new IllegalArgumentException("interpolate() can only handle" +
81 | " tables of length 3. Sorry.");
82 |
83 | // Compute the differences between subsequent elements.
84 | // (This part is generic on the table size.)
85 | double[][] diffTable = new double[tablen - 1][];
86 | for (int col = 0; col < tablen - 1; ++col)
87 | diffTable[col] = makeDiffs(col == 0 ? values : diffTable[col - 1]);
88 |
89 | // Calculate the interpolating factor.
90 | double n = index - args[1];
91 |
92 | // And interpolate.
93 | double sum = diffTable[0][0] + diffTable[0][1] + n * diffTable[1][0];
94 | return values[1] + n / 2 * sum;
95 | }
96 |
97 |
98 | /**
99 | * Make a table of differences for the given table.
100 | *
101 | * @param values
102 | * @return
103 | */
104 | private static double[] makeDiffs(double[] values) {
105 | int n = values.length - 1;
106 | double[] diffs = new double[n];
107 | for (int i = 0; i < n; ++i)
108 | diffs[i] = values[i + 1] - values[i];
109 | return diffs;
110 | }
111 |
112 | }
113 |
114 |
--------------------------------------------------------------------------------
/Scrambled Net/res/layout-long-port/score_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
26 |
27 |
22 |
25 |
23 |
24 |
28 |
59 |
60 |
29 |
58 | All Classes
30 |
57 |
34 | ca.uol.aig.fftpack
35 |
36 | net.goui.util
37 |
38 | org.hermit.astro
39 |
40 | org.hermit.dsp
41 |
42 | org.hermit.geo
43 |
44 | org.hermit.geometry
45 |
46 | org.hermit.geometry.cluster
47 |
48 | org.hermit.geometry.generator
49 |
50 | org.hermit.geometry.spline
51 |
52 | org.hermit.geometry.voronoi
53 |
54 | org.hermit.utils
55 |
56 |
13 |
16 |
17 |
22 | pos1 = new Position(latRadians, lonRadians);
23 | pos2 = Position.fromDegrees(latDegrees, lonDegrees);
24 |
25 |
26 |
29 | Distance dist = pos1.distance(pos2);
30 |
31 |
32 |
47 | GeoCalculator.setAlgorithm(GeoCalculator.Algorithm.VINCENTY,
48 | GeoConstants.Ellipsoid.AIRY1858);
49 |
50 |
51 |
60 | currentLocMsg = PointOfInterest.describePosition(currentPos);
61 | --> "The Southern Tropics, 3.9 nm north of The Tropic of Capricorn"
62 |
63 |
64 |
Copyright 2004-2009 Ian Cameron Smith
5 | *
6 | *
22 |
30 |
31 |
32 |
23 |
29 |
24 | Interfaces
25 |
26 |
28 |
27 | AstroConstants
33 |
53 |
54 |
55 |
34 |
52 |
35 | Classes
36 |
37 |
51 |
38 | Body
39 |
40 | Instant
41 |
42 | Moon
43 |
44 | Observation
45 |
46 | Planet
47 |
48 | Sun
49 |
50 | Util
56 |
68 |
69 |
70 |
57 |
67 |
58 | Enums
59 |
60 |
66 |
61 | Body.Field
62 |
63 | Body.Name
64 |
65 | Observation.OField
71 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/HermitLibrary/src/org/hermit/geo/Azimuth.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * geo: geographical utilities.
4 | *
72 |
80 |
73 | Exceptions
74 |
75 |
79 |
76 | AstroError
77 |
78 | CalcError
Copyright 2004-2009 Ian Cameron Smith
5 | *
6 | *
Copyright 2004-2009 Ian Cameron Smith
5 | *
6 | *
22 |
30 |
31 |
32 |
23 |
29 |
24 | Interfaces
25 |
26 |
28 |
27 | GeoConstants
33 |
65 |
66 |
67 |
34 |
64 |
35 | Classes
36 |
37 |
63 |
38 | AndoyerCalculator
39 |
40 | Azimuth
41 |
42 | Distance
43 |
44 | GeoCalculator
45 |
46 | HaversineCalculator
47 |
48 | PointOfInterest
49 |
50 | PointOfInterest.BAND
51 |
52 | PointOfInterest.LAT
53 |
54 | PointOfInterest.LON
55 |
56 | PointOfInterest.POS
57 |
58 | Position
59 |
60 | Vector
61 |
62 | VincentyCalculator
68 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/HermitAndroid/src/org/hermit/android/provider/DbRow.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * org.hermit.android.provider: classes for building content providers.
4 | *
5 | * These classes are designed to help build content providers in Android.
6 | *
7 | *
69 |
77 |
70 | Enums
71 |
72 |
76 |
73 | GeoCalculator.Algorithm
74 |
75 | GeoConstants.Ellipsoid
Copyright 2010-2011 Ian Cameron Smith
8 | *
9 | *
Copyright 2009-2010 Ian Cameron Smith
8 | *
9 | *
Copyright 2009 Ian Cameron Smith
5 | *
6 | *
8 | *
17 | * The primary reference for this version of the software is AA.
18 | *
19 | *