This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| main | |
| adfadfasdf | |
| asdfa | |
| sdfas | |
| df | |
| asd | |
| f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <wtkbuild | |
| destdir="${outputclasses}" | |
| encoding="${src.encoding}" | |
| source="1.3" srcdir="${src.dir}:${rim.src.dir}" | |
| preverify="false"> | |
| <classpath location="${rimlib.loc}"/> | |
| </wtkbuild> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def reverse_string(s) | |
| s.reverse().scan(/[\w]+/).collect { |w| w.reverse()} | |
| end | |
| r = reverse_string("The quick brown fox jumped over the lazy dog") | |
| puts r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SudokuSolver | |
| def initialize(puzzle) | |
| @@p = puzzle.split(//) | |
| end | |
| #Algorithm to solve the sudoku puzzle | |
| def solver | |
| #81 times for each block in the puzzle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <target name="blackberry-pre-debug" depends="blackberry-load-setings" if="blackberry.trigger"> | |
| <copy todir="${platform.home}/simulator"> | |
| <fileset dir="${dist.dir}" includes="${name}.*"/> | |
| <fileset dir="${dist.dir}" includes="*.debug"/> | |
| </copy> | |
| <condition property="jpda.port" value="${JDWPPort}" else="8000"> | |
| <isset property="JDWPPort"/> | |
| </condition> | |
| </target> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <target name="clean-blackberry" if="blackberry.trigger"> | |
| <delete file="${dist.dir}/${name}.cod" failonerror="false"/> | |
| <delete file="${dist.dir}/${name}.cso" failonerror="false"/> | |
| <delete file="${dist.dir}/${name}*.debug" failonerror="false"/> | |
| <delete failonerror="false"> | |
| <fileset dir="${platform.home}/simulator"> | |
| <include name="**/${name}*.*"/> | |
| </fileset> | |
| </delete> | |
| </target> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <target name="create-cod" if="blackberry.trigger"> | |
| <exec dir="${dist.dir}" executable="java" failonerror="true"> | |
| <arg value="-cp"/> | |
| <arg value="${platform.home}/bin/rapc.jar"/> | |
| <arg value="net.rim.tools.compiler.Compiler"/> | |
| <arg value="import=${platform.bootclasspath}"/> | |
| <arg value="codename=${name}"/> | |
| <arg value="-cldc"/> | |
| <arg value="jad=${basedir}/${dist.dir}/${dist.jad}"/> | |
| <arg value="${basedir}/${dist.dir}/${dist.jar}"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var F = function() {}; | |
| F.prototype.a = 'b'; | |
| F.prototype.a; // b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var s = new F(); // s get the F.prototype | |
| s.a; // return 'b'; | |
| s.prototype; // return undefined | |
| var string = new String(); //get String.property | |
| var array = new Array(); //get Array.property | |
| var num = new Number(); // get Number.property |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var F = function() {}; | |
| F.prototype.a = 'b'; | |
| var s = new F(); | |
| print(s.a); | |
| print(s.hasOwnProperty('a')); //false | |
| s.a = 'c'; // object s will create its new property 'a' | |
| print(s.a); // c | |
| print(s.hasOwnProperty('a')); // true; |
OlderNewer