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
| #include "Sample1.h" | |
| #include <ctype.h> | |
| #include <string.h> | |
| // Mutate array to uppercase | |
| void uppercase(char* str) { | |
| size_t n = strlen(str); | |
| for (size_t i = 0; i < n; i++) { | |
| str[i] = toupper(str[i]); | |
| } |
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
| /* DO NOT EDIT THIS FILE - it is machine generated */ | |
| #include <jni.h> | |
| /* Header for class Sample1 */ | |
| #ifndef _Included_Sample1 | |
| #define _Included_Sample1 | |
| #ifdef __cplusplus | |
| extern "C" { | |
| #endif | |
| /* |
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 Sample1 { | |
| // --- Native methods | |
| @native def intMethod(n: Int): Int | |
| @native def booleanMethod(b: Boolean): Boolean | |
| @native def stringMethod(s: String): String | |
| @native def intArrayMethod(a: Array[Int]): Int | |
| } | |
| object Sample1 { |
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
| public class Sample1 { | |
| // --- Native methods | |
| public native int intMethod(int n); | |
| public native boolean booleanMethod(boolean bool); | |
| public native String stringMethod(String text); | |
| public native int intArrayMethod(int[] intArray); | |
| // --- Main method to test our native library |
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
| function s = jdbcquery(conn, sqlstr) | |
| % Connect to database, execute SQL string, and pass back structure array. | |
| % | |
| % Usage: | |
| % s = jdbcquery(conn, sqlstr) | |
| % | |
| % Input | |
| % conn: A java.sql.Connection object. See Also database | |
| % sqlstr: SQL string, i.e. 'SELECT * FROM Observation WHERE ConceptName LIKE ''Pandalus%''' | |
| % |
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
| function c = database(url, user, password, driverName) | |
| % DATABASE - connect to a SQL database | |
| % | |
| % Usage: | |
| % c = database(url, user, password, driverName) | |
| % | |
| % Inputs: | |
| % url = The database URL. e.g. jdbc:jtds:sqlserver://solstice.shore.mbari.org:1433/EXPD | |
| % user = The user name to connect to the database | |
| % password = THe password for user |
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
| % DATABASE - connect to a SQL database | |
| % | |
| % Usage: | |
| % c = database(url, user, password, driverName) | |
| % | |
| % Inputs: | |
| % url = The database URL. e.g. jdbc:jtds:sqlserver://solstice.shore.mbari.org:1433/EXPD | |
| % user = The user name to connect to the database | |
| % password = THe password for user | |
| % driverName = the name of the JDBC driver to use for the connection. |
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
| [alias] | |
| #Show all branches | |
| branches = branch -a | |
| # Show conflicted files after a merge | |
| conflicted = grep --name-only --full-name '<<<<<<< HEAD' | |
| # Grep - search for occurence of term in all git managed files | |
| gr = grep -Ii |
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
| PS1=$'\n\[\033[35m\]\u@\h:$PWD`git branch 2> /dev/null | grep -e ^* | sed s/"* "// | sed s/^/"\[\033[31\]m ⏣ \[\033[0;32m\]"/`\n\[\033[35m\] \[\033[m\]' |
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
| export PS1=$'\n\[\033[35m\]\u@\h:$PWD`git branch 2> /dev/null | grep -e ^* | sed s/"* "// | sed s/^/"\[\033[31\]m ⏣ \[\033[0;32m\]"/`\n\[\033[35m\] \[\033[m\]' |