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
If mydate Like "*[abcdefghijklmnopqrstuvwxyz/-" & Chr(150) & "]*" Then | |
mydate = Replace(Replace(mydate, "January", "01"), | |
"Jan", "02") | |
mydate = Replace(Replace(mydate, "Feburary", | |
"02"), "Feb", "02") | |
mydate = Replace(Replace(mydate, "March", "03"), | |
"Mar", "03") | |
mydate = Replace(Replace(mydate, "April", "04"), | |
"Apr", "04") | |
mydate = Replace(mydate, "May", "05") |
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
1 kilo whole wheat flour | |
700 g water | |
2 tbsp sugar/honey | |
1/2 cup starter | |
3 tsp salt | |
Measure out and mix the ingredients together in a mixing bowl. You | |
probably want to mix the dry ingredients together, then dissolve the | |
starter in the water, then pour the starter-water mixture in, as is | |
often done when making sourdough bread. Notice that the hydration |
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/sh | |
# rename pre-commit.sample in the hooks directory to pre-commit and replace its content with this | |
set_traces=`git grep "pdb.set_trace()"` | |
if [ ! -z "$set_traces" ] ; then | |
echo "You have pdb.set_trace() in your code! Commit aborted!" | |
echo $set_traces | |
exit 1 |
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 | |
IFS=" | |
" | |
echo | |
for FRAME in \ | |
"B :^)" \ | |
" B :^)" \ | |
" B :^)" \ | |
" 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
library(ggplot2) | |
eurusd <- read.table("/home/warren/Downloads/EURUSD_Candlestick_1_D_BID_01.03.2007-16.03.2013.csv", sep=",", header=T) | |
eurusd$Time <- as.Date(eurusd$Time, "%d.%m.%Y %H:00:00.000") | |
long_trades = read.table(textConnection( | |
"Open, Close | |
2009-02-02, 2009-02-10 | |
2009-04-05, 2009-06-07 | |
2013-01-01, 2013-01-25"), sep=',', |
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
# resulting image: http://i.imgur.com/E5CsReh.png | |
# create a 1680x1050 image using Arial, 12pt | |
set terminal pngcairo enhanced font "arial,12" fontscale 1.0 size 1680, 1050 | |
# write to the file 'multiplot_test.png' | |
set output 'multiplot_test.png' | |
# turn key off since we will be plotting many different |
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
# See http://www.zerocater.com/challenge/#mathy-challenge for details of what | |
# this code does | |
# | |
# The approach I took was to Google 'primal sums' and get most of the solution | |
# directly: | |
# | |
# http://oeis.org/A007506 | |
# | |
# I also use pre-computed lists of primes to avoid having to implement a sieve | |
# in order to get lists of primes. |
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 RentalCar | |
attr_accessor :miles_travelled | |
def check_maintenance | |
if @miles_travelled > 60000 | |
puts "Give it a tuneup!" | |
end | |
end | |
end |
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
final CountDownLatch localLatch = latchOne(); | |
final MultiThreadAsserter localAsserter = new MultiThreadAsserter(); | |
StackMobObjectOnServer<UserOnServer> user = doLoginLogout(StackMob.OAuthVersion.Two, false); | |
List<HashMap<String, String>> chores = new ArrayList<HashMap<String, String>>(); | |
HashMap<String, String> todo1 = new HashMap<String, String>(); | |
todo1.put("action", "related object 1"); | |
HashMap<String, String> todo2 = new HashMap<String, String>(); |
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
> a <- array(1:20, dim=c(4:5)) | |
> a | |
[,1] [,2] [,3] [,4] [,5] | |
[1,] 1 5 9 13 17 | |
[2,] 2 6 10 14 18 | |
[3,] 3 7 11 15 19 | |
[4,] 4 8 12 16 20 | |
> a[1,] | |
[1] 1 5 9 13 17 | |
> a[,2] |