87 |92 | 93 | Explore it 94 | -- 95 | * Please read more example code in the project. 96 | * Also please see this project: 97 | https://github.com/m0ver/mobile1.0 98 | http://ingod.asia 99 | 100 | 101 | License 102 | -- 103 | 104 | Licensed under the Apache License, Version 2.0 (the "License"); 105 | you may not use this file except in compliance with the License. 106 | You may obtain a copy of the License at 107 | 108 | http://www.apache.org/licenses/LICENSE-2.0 109 | 110 | Unless required by applicable law or agreed to in writing, software 111 | distributed under the License is distributed on an "AS IS" BASIS, 112 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 113 | See the License for the specific language governing permissions and 114 | limitations under the License. 115 | 116 | 117 | [](https://bitdeli.com/free "Bitdeli Badge") 118 | -------------------------------------------------------------------------------- /bin/dispatcher: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | ROOT="$(pwd)" 3 | VERSION="1.4.5" 4 | cd "$(dirname "$0")" || exit 5 | cd "../" 6 | # Navigate to the root directory 7 | cd "$ROOT" || exit 8 | 9 | # Java options initialization 10 | JAVA_OPTS="" 11 | 12 | # Arguments initialization 13 | args="" 14 | 15 | # Loop through each argument 16 | for arg; do 17 | # Extract the first two characters of the argument 18 | # str=${arg:0:2} 19 | str=$(echo "$arg" | awk '{ string=substr($0, 0, 2); print string; }' ) 20 | 21 | # Check if it starts with '-D' or '-X' 22 | if [ "$str" = "-D" ] || [ "$str" = "-X" ]; then 23 | JAVA_OPTS="$JAVA_OPTS $arg" 24 | else 25 | args="$args $arg" 26 | fi 27 | done 28 | 29 | # Check if the JAR file exists 30 | JAR_FILE="$ROOT/lib/tinystruct-$VERSION-jar-with-dependencies.jar" 31 | [ -f "$JAR_FILE" ] && JAR_FILE="$JAR_FILE:" 32 | 33 | # Check if additional JAR files exist and add them to the classpath 34 | # shellcheck disable=SC2043 35 | for jar_file in "$ROOT"/lib/tinystruct-"$VERSION".jar; do 36 | [ -f "$jar_file" ] && JAR_FILE="$JAR_FILE$jar_file:" 37 | done 38 | 39 | # OS specific support. $var _must_ be set to either true or false. 40 | cygwin=false; 41 | darwin=false; 42 | mingw=false 43 | case "`uname`" in 44 | CYGWIN*) cygwin=true ;; 45 | MINGW*) mingw=true;; 46 | Darwin*) darwin=true 47 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 48 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 49 | if [ -z "$JAVA_HOME" ]; then 50 | if [ -x "/usr/libexec/java_home" ]; then 51 | export JAVA_HOME="`/usr/libexec/java_home`" 52 | else 53 | export JAVA_HOME="/Library/Java/Home" 54 | fi 55 | fi 56 | ;; 57 | esac 58 | 59 | if [ -z "$JAVA_HOME" ] ; then 60 | if [ -r /etc/gentoo-release ] ; then 61 | JAVA_HOME=`java-config --jre-home` 62 | fi 63 | fi 64 | 65 | if [ -z "$M2_HOME" ] ; then 66 | ## resolve links - $0 may be a link to maven's home 67 | PRG="$0" 68 | 69 | # need this for relative symlinks 70 | while [ -h "$PRG" ] ; do 71 | ls=`ls -ld "$PRG"` 72 | link=`expr "$ls" : '.*-> \(.*\)$'` 73 | if expr "$link" : '/.*' > /dev/null; then 74 | PRG="$link" 75 | else 76 | PRG="`dirname "$PRG"`/$link" 77 | fi 78 | done 79 | 80 | saveddir=`pwd` 81 | 82 | M2_HOME=`dirname "$PRG"`/.. 83 | 84 | # make it fully qualified 85 | M2_HOME=`cd "$M2_HOME" && pwd` 86 | 87 | cd "$saveddir" 88 | # echo Using m2 at $M2_HOME 89 | fi 90 | 91 | # For Cygwin, ensure paths are in UNIX format before anything is touched 92 | if $cygwin ; then 93 | [ -n "$M2_HOME" ] && 94 | M2_HOME=`cygpath --unix "$M2_HOME"` 95 | [ -n "$JAVA_HOME" ] && 96 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 97 | [ -n "$CLASSPATH" ] && 98 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 99 | fi 100 | 101 | # For Migwn, ensure paths are in UNIX format before anything is touched 102 | if $mingw ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 107 | # TODO classpath? 108 | fi 109 | 110 | if [ -z "$JAVA_HOME" ]; then 111 | javaExecutable="`which javac`" 112 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 113 | # readlink(1) is not available as standard on Solaris 10. 114 | readLink=`which readlink` 115 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 116 | if $darwin ; then 117 | javaHome="`dirname \"$javaExecutable\"`" 118 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 119 | else 120 | javaExecutable="`readlink -f \"$javaExecutable\"`" 121 | fi 122 | javaHome="`dirname \"$javaExecutable\"`" 123 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 124 | JAVA_HOME="$javaHome" 125 | export JAVA_HOME 126 | fi 127 | fi 128 | fi 129 | 130 | if [ -z "$JAVACMD" ] ; then 131 | if [ -n "$JAVA_HOME" ] ; then 132 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 133 | # IBM's JDK on AIX uses strange locations for the executables 134 | JAVACMD="$JAVA_HOME/jre/sh/java" 135 | else 136 | JAVACMD="$JAVA_HOME/bin/java" 137 | fi 138 | else 139 | JAVACMD="`which java`" 140 | fi 141 | fi 142 | 143 | if [ ! -x "$JAVACMD" ] ; then 144 | echo "Error: JAVA_HOME is not defined correctly." >&2 145 | echo " We cannot execute $JAVACMD" >&2 146 | exit 1 147 | fi 148 | 149 | if [ -z "$JAVA_HOME" ] ; then 150 | echo "Warning: JAVA_HOME environment variable is not set." 151 | fi 152 | 153 | # For Cygwin, switch paths to Windows format before running java 154 | if $cygwin; then 155 | [ -n "$M2_HOME" ] && 156 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 157 | [ -n "$JAVA_HOME" ] && 158 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 159 | [ -n "$CLASSPATH" ] && 160 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 161 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 162 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 163 | fi 164 | 165 | # Check if M2_HOME is not set or is equal to the current project path 166 | if [ -z "$M2_HOME" ] || [ "$M2_HOME" = "$(pwd)" ]; then 167 | # Set M2_HOME to the .m2 folder under the user's home directory 168 | M2_HOME="$HOME/.m2" 169 | fi 170 | 171 | # Add all JAR files under the lib folder to the classpath 172 | for jar_file in "$ROOT"/lib/*.jar; do 173 | CLASSPATH="$CLASSPATH:$jar_file" 174 | done 175 | 176 | # Java execution 177 | $JAVACMD \ 178 | $JAVA_OPTS \ 179 | -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/ \ 180 | -cp "$ROOT/target/classes:$JAR_FILE$CLASSPATH:$ROOT/WEB-INF/lib/*:$ROOT/WEB-INF/classes:$M2_HOME/repository/org/tinystruct/tinystruct/$VERSION/tinystruct-$VERSION-jar-with-dependencies.jar" org.tinystruct.system.Dispatcher "$@" 181 | -------------------------------------------------------------------------------- /bin/dispatcher.cmd: -------------------------------------------------------------------------------- 1 | @rem *************************************************************************** 2 | @rem Copyright (c) 2023 James Mover Zhou 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem http:\\www.apache.org\licenses\LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem *************************************************************************** 16 | @echo off 17 | 18 | @REM Check if JAVA_HOME is set and valid 19 | if "%JAVA_HOME%" == "" ( 20 | echo Error: JAVA_HOME not found in your environment. >&2 21 | echo Please set the JAVA_HOME variable in your environment to match the location of your Java installation. >&2 22 | exit /B 1 23 | ) 24 | 25 | if not exist "%JAVA_HOME%\bin\java.exe" ( 26 | echo Error: JAVA_HOME is set to an invalid directory. >&2 27 | echo JAVA_HOME = "%JAVA_HOME%" >&2 28 | echo Please set the JAVA_HOME variable in your environment to match the location of your Java installation. >&2 29 | exit /B 1 30 | ) 31 | 32 | set "JAVA_CMD=%JAVA_HOME%\bin\java.exe" 33 | 34 | @REM Consolidate classpath entries, initialize ROOT and VERSION 35 | set "ROOT=%~dp0..\" 36 | set "VERSION=1.4.5" 37 | set "classpath=%ROOT%target\classes;%ROOT%lib\tinystruct-%VERSION%-jar-with-dependencies.jar;%ROOT%lib\*;%ROOT%WEB-INF\lib\*;%ROOT%WEB-INF\classes;%USERPROFILE%\.m2\repository\org\tinystruct\tinystruct\%VERSION%\tinystruct-%VERSION%-jar-with-dependencies.jar" 38 | 39 | @REM Run Java application 40 | %JAVA_CMD% -cp "%classpath%" org.tinystruct.system.Dispatcher %* 41 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 |Praise to the Lord!
88 | Praise to the Lord! 89 | true 90 |你知道全世界最畅销的书是哪一本书吗?
91 |
8 | :) 9 |
10 |11 |34 | 35 | 36 | -------------------------------------------------------------------------------- /src/main/resources/themes/reading.view: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |12 | //5?Array(i).join(' '): Array(10 - i).join(' ')) + String.fromCharCode(96+i));\n\ 21 | }\n\ 22 | "); 23 | 24 | println('What the result will be? see the below result.'); 25 | println(Array(10).join('--')); 26 | for(var i=1;i<10;i++) { 27 | println((i>5?Array(i).join(' '): Array(10 - i).join(' ')) + String.fromCharCode(96+i)); 28 | } 29 | println(Array(10).join('--')); 30 | 31 | //]]> 32 | 33 |
Welcome to use smalltalk application!
658 |{%topic%}
659 |