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
--- | |
title: Thought Circus | |
--- | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} ^/$ | |
RewriteCond %{QUERY_STRING} ^(p|q|feed)=(.*)$ | |
RewriteRule ^(.*)$ simon-fortelny.com/r/%2? | |
{% for post in site.posts} | |
RewriteRule ^.*/r/{{post.wordpress_id}}$ http://simon-fortelny.com/{{post.url}} [R=301]{% endfor %} | |
RewriteRule ^.*/r/rss2$ http://simon-fortelny.com/atom.xml [R=301] |
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
//create object that partly conforms to the interfaces contract | |
document.writeln('<b>Create checking_orange_juice</b> <br/>'); | |
var checking_orange_juice = function() { | |
var that = {}; | |
//implement some of the interface functions/methods | |
that.cup_size = function () { | |
return "small"; | |
}(); | |
interfaceCheckerWithThrow(coffee_interface,that); | |
return that; |
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
<property> | |
<name>javax.jdo.option.ConnectionURL</name> | |
<value>jdbc:oracle:thin:@localhost:1521:oracle</value> | |
<description>JDBC connect string for a JDBC metastore</description> | |
</property> | |
<property> | |
<name>javax.jdo.option.ConnectionDriverName</name> | |
<value>oracle.jdbc.driver.OracleDriver</value> | |
<description>Driver class name for a JDBC metastore</description> |
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
customerData = LOAD 'CustomerData-020211' | |
USING PigStorage(',') AS (customerId:chararray, purchaseDate:long, itemId:long); | |
customersGroupByItem = GROUP customerData BY itemId; | |
numberOfCustomersWhoBoughtItem = FOREACH customersGroupByItem { | |
count = COUNT(customerData.customerId); | |
GENERATE group.itemId, count; | |
}; | |
ps.openIterator('numberOfCustomersWhoBoughtItem'); | |
customersGroupByPurchDate = GROUP customerData BY purchaseDate; | |
numberOfCustomersWhoBoughtDate = FOREACH customersGroupByPurchDate { |
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
ps.openIterator('numberOfCustomersWhoBoughtItem'); | |
ps.openIterator('numberOfCustomersWhoBoughtDate'); |
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
PigServer ps = getPigServer(); | |
ps.setBatchOn(); | |
. . | |
ps.openIterator("numberOfCustomersWhoBoughtItem"); | |
ps.openIterator("numberOfCustomersWhoBoughtDate"); | |
ps.executeBatch(); |
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
PigServer ps = getPigServer(); | |
ps.setBatchOn(); | |
. . | |
STORE numberOfCustomersWhoBoughtItem INTO 'numberOfCustomersWhoBoughtItemTmpFile' | |
USING BinStorage(); | |
STORE numberOfCustomersWhoBoughtDate INTO 'numberOfCustomersWhoBoughtDateTmpFile' | |
USING BinStorage(); | |
ps.executeBatch(); | |
ps.openIterator("numberOfCustomersWhoBoughtItem"); | |
ps.openIterator("numberOfCustomersWhoBoughtDate"); |
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
PigServer ps = getPigServer(); | |
ps.setBatchOn(); | |
ps.registerQuery("customerData = LOAD 'CustomerData-020211' | |
USING PigStorage(',') AS (customerId:chararray, purchaseDate:long, itemId:long);"); | |
//count the number of times the item was bought | |
ps.registerQuery("customersGroupByItem = GROUP customerData BY itemId;"); | |
ps.registerQuery("numberOfCustomersWhoBoughtItem = FOREACH customersGroupByItem { "+ | |
" count = COUNT(customerData.customerId); "+ | |
" GENERATE group.itemId, count;"+ | |
"};"); |
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
PS1="[[33[1;34m]u[33[1;37m]@[33[1;32m]h[33[1;37m] ${BRANCH} [33[1;36m]W [33[0m]]${PROMPT_SYMBOL} " |
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
try{ | |
//do SQL stuff | |
}catch(Exception e){ | |
if("-0955".equals(e.getSqlCode())){ | |
//ORA-00955: name is already used by an existing object | |
//tried to make a table that already existed ignore exception | |
}else { | |
//got an unexpected exception don't ignore it throw e; | |
} | |
} |
OlderNewer