This file contains 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 | |
### Add or edit worklog entry -- uses VSCode in PATH | |
### Usage: wlog [dateString] | |
function wlog { | |
local wlogFolder="/d/Workspace/Worklog" | |
if [ -z "$1" ]; then | |
local curdate=$(date +"%Y-%m-%d %a") | |
else | |
local curdate=$(date -d "$1" +"%Y-%m-%d %a") |
This file contains 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 java.util.ArrayList; | |
import java.util.Scanner; | |
public class EditDistance { | |
private static final int INSERT_COST = 1; | |
private static final int DELETE_COST = 1; | |
private static final int SUBST_COST = 2; | |
private static int[][] distances; | |
private static String fromString; |
This file contains 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
exp = raw_input() | |
# assuming exp is balanced | |
stack = [] | |
justClosed = False # did we just close a paren in the last operation | |
for ch in exp: | |
if ch != ')': | |
stack.append(ch) |
This file contains 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 MainActivity extends AppCompatActivity implements SensorEventListener { | |
Socket socket; | |
SensorManager sensorManager; | |
Sensor accelerometer; | |
TextView textView; | |
String ip_addr; | |
String y_value; | |
boolean isRunning=true; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
/* | |
Shameless port of a shameless port | |
@defunkt => @janl => @aq | |
See http://github.com/defunkt/mustache for more info. |