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
import static org.junit.Assert.*; | |
import java.io.File; | |
import java.io.IOException; | |
import org.junit.Before; | |
import org.junit.Test; | |
import com.google.common.base.CharMatcher; | |
import com.google.common.base.Charsets; |
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
doMatch(expr,0) | |
/doMatch | |
doMatch(decimal,0) | |
/doMatch | |
doMatch(operator,0) | |
/doMatch | |
doMatch(group,0) | |
/doMatch | |
doMatch(optional(string('-')),0) | |
/doMatch |
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
doMatch(expr,0) | |
/doMatch | |
doMatch(decimal,0) | |
/doMatch | |
doMatch(operator,0) | |
/doMatch | |
doMatch(group,0) | |
/doMatch | |
doMatch(optional(string('-')),0) | |
/doMatch |
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 Main { | |
public static void main(String[] args) { | |
Student jimmy = new Student(null, null, 0); | |
jimmy.setQuizScore(95, 0); | |
jimmy.setQuizScore(73, 1); | |
jimmy.setQuizScore(100, 2); | |
jimmy.setQuizScore(55, 3); |
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
property blueutilPath : "/usr/local/bin/blueutil power" | |
if execBlueutil("") ends with "0" then | |
-- Toggle BT on | |
execBlueutil("1") | |
set btStatus to true | |
else | |
-- Toggle BT off | |
execBlueutil("0") | |
set btStatus to false |
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
property blueutilPath : "/usr/local/bin/blueutil power" | |
if execBlueutil("") ends with "0" then | |
-- Toggle BT on | |
execBlueutil("1") | |
set btStatus to true | |
else | |
-- Toggle BT off | |
execBlueutil("0") | |
set btStatus to false |
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
#!/bin/bash | |
# | |
# source: https://groups.google.com/d/msg/prey-security/vBv3BGI8Qeg/5xIy0LZjzXAJ | |
# | |
# Mount the recovery partition | |
/usr/bin/sudo /usr/sbin/diskutil mount Recovery\ HD | |
# | |
# Backup the recovery boot image | |
/usr/bin/sudo /bin/cp /Volumes/Recovery\ HD/com.apple.recovery.boot/BaseSystem.dmg ~/Desktop/ | |
# |
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
program = clCreateProgramWithSource(context, 1, | |
new String[] { SOURCE }, null, null); | |
clBuildProgram(program, 0, null, null, null, null); | |
final int vertexCount = graph.getVertexCount(); | |
final int edgeCount = graph.getEdgeCount(); | |
final int[] vertexArray = graph.getVertexArray(); | |
final int[] edgeArray = graph.getEdgeArray(); |
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
--This script MUST be named "Switch to <User>.scpt", where <User> is the name of the user to switch to. | |
--You must first make a password item (a.k.a. a key) for the other user's password using Keychain Access, | |
--and call it "<user>", where "<user>" is the other user's name.the field "Kind" must be "User Login" (without quotes). | |
--The script assumes that you make this key in your login.keychain, which is the default one. | |
--The first time you run this script, you will be prompted to allow Keychain Scripting to access the password of the key. | |
--This script requires "Enable access for assistive devices" to be enabled in the Universal Access system preference pane. | |
set username to word -1 of my findReplace(".scpt", "", (path to me as text)) | |
-- Invoke Fast User Switching. The `id -ur username` part gets the uid number that corresponds to the username and substitutes it at the end of the CGSession command |
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
/* | |
* Adapted from <a | |
* href="http://www.movable-type.co.uk/scripts/latlong.html">JavaScript | |
* version</a> created by <a href="http://www.movable-type.co.uk/">Chris | |
* Veness<a/> under the <a | |
* href="http://creativecommons.org/licenses/by/3.0/">Create Commons Attribution | |
* 3.0</a> licencse. | |
*/ | |
package com.oschrenk.humangeo.calc; |