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
Machine: | |
PowerPC G5 Mac OS X 10.5.8 | |
Symptoms: | |
1. Spotlight completely non-functional. | |
2. Running `sudo mdutil -i on /` results in error code -1. | |
3. No 'mds' or 'mdworker' running in Activity Manager. | |
Solution: | |
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist |
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
#!/usr/bin/perl -w | |
use 5.0100; | |
use strict; | |
use warnings; | |
# Read in the list of US states attached to the end of this source file. | |
my %US_STATES = (); | |
while(<DATA>) { |
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
[INFO 2011-08-29 14:38:22,517 bulkloader.py] Logging to bulkloader-log-20110829.143822 | |
[INFO 2011-08-29 14:38:22,518 bulkloader.py] Throttling transfers: | |
[INFO 2011-08-29 14:38:22,518 bulkloader.py] Bandwidth: 250000 bytes/second | |
[INFO 2011-08-29 14:38:22,518 bulkloader.py] HTTP connections: 8/second | |
[INFO 2011-08-29 14:38:22,518 bulkloader.py] Entities inserted/fetched/modified: 20/second | |
[INFO 2011-08-29 14:38:22,518 bulkloader.py] Batch Size: 10 | |
[INFO 2011-08-29 14:38:23,649 bulkloader.py] Opening database: bulkloader-progress-20110829.143822.sql3 | |
[DEBUG 2011-08-29 14:38:23,656 adaptive_thread_pool.py] [WorkerThread-0] WorkerThread: started | |
[DEBUG 2011-08-29 14:38:23,657 adaptive_thread_pool.py] [WorkerThread-1] WorkerThread: started | |
[DEBUG 2011-08-29 14:38:23,657 adaptive_thread_pool.py] [WorkerThread-2] WorkerThread: started |
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
#!/usr/bin/python | |
import urllib | |
tableid = 1344517 # A dummy but public fusion table I created | |
sql = "SELECT * FROM %d" % tableid | |
file = urllib.urlopen("https://www.google.com/fusiontables/api/query?sql=" + urllib.quote_plus(sql)) | |
print file.read() | |
# Expected output: |
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
#!/usr/bin/perl | |
use 5.0100; | |
use strict; | |
use warnings; | |
# Load the SeqIO module. | |
use Bio::SeqIO; |
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
Atom Zombie Smasher | |
Commander: Gaurav | |
Start date: April 26, 2011 | |
Zeppelin: Five Howling Zeppelin | |
Codename: OperationProngLightning135 | |
---------------------------------- | |
JANUARY 1961: AURORA AUSTRALIS. | |
Shorter daytime. |
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
#!/usr/bin/perl | |
# This is the program I wrote to crack this fun little cipher: http://keiththomsonbooks.com/cipher-02022012.html | |
# The clue clearly indicates that this is just a simple substitution cipher [1]; even better, it looks like ROT13 [2], | |
# except that you clearly don't move every letter along by exactly 13 places. So how many letters do you need to move | |
# it along by? There's only 26 letters in the English alphabet: let's try every possible value! | |
# | |
# [1] http://en.wikipedia.org/wiki/Substitution_cipher | |
# [2] http://en.wikipedia.org/wiki/ROT13 |
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
" Activate pathogen. | |
call pathogen#infect() | |
call pathogen#helptags() | |
" These are a few of my favourite settings. | |
syntax on | |
set background=dark | |
set hlsearch | |
set incsearch | |
set smartindent |
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
Index: plugins/python/naturepreceedings.py | |
=================================================================== | |
--- plugins/python/naturepreceedings.py (revision 581) | |
+++ plugins/python/naturepreceedings.py (working copy) | |
@@ -107,7 +107,7 @@ | |
abs = abstract.renderContents().strip() | |
abs = re.sub(r'<[^>]+>','',abs) | |
abs = unescape(abs) | |
- print "abstract\t%s" % abs | |
+ print "abstract\t%s" % abs.encode('utf-8') |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
# This is intended as an easy-to-use cookbook example to getting started | |
# uploading files on Perl. Please let me (gaurav at ggvaidya dot com) know | |
# if you have any comments or suggestions for this example. | |
# | |
# It is made available under the same license terms as the Perl interpreter. |