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
# Install deps | |
package "libfuse-dev" | |
package "libcurl4-openssl-dev" | |
package "libxml2-dev" | |
# Download & Install | |
wget http://s3fs.googlecode.com/files/s3fs-r177-source.tar.gz | |
tar xvzf s3fs-r177-source.tar.gz |
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 MagickImage resized(int width, int height){ | |
MagickImage result = new MagickImage(width, height); | |
int originalWidth = this.getWidth(); | |
int originalHeight = this.getHeight(); | |
int maxSize = Math.max(width, height); | |
float scaleFactor = 1.0f; | |
if (originalWidth > originalHeight) | |
scaleFactor = ((float) maxSize / (float) originalWidth); |
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
~/Documents/Involver/logs/9_30_2009/app1 ➔ pl_analyze production.log | |
Request Times Summary: Count Avg Std Dev Min Max | |
ALL REQUESTS: 5782 311.692 1365.725 0.000 14965.000 | |
FacebookTabsController#twitter_feed: 1276 198.113 1107.842 2.000 14476.000 | |
FacebookTabsController#coupon: 662 164.992 933.120 0.000 13507.000 | |
FacebookTabsController#rss_feed: 623 399.506 1694.646 29.000 14399.000 | |
FacebookTabsController#you_tube_config: 583 359.669 1313.025 31.000 13855.000 | |
FacebookTabsController#signup_config: 410 75.054 130.416 25.000 2301.000 | |
FacebookTabsController#cross_promotion: 257 298.339 1432.134 27.000 13849.000 |
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
~/Documents/Involver/logs/9_30_2009/app1 ➔ pl_analyze production.log | |
Request Times Summary: Count Avg Std Dev Min Max | |
ALL REQUESTS: 5782 311.692 1365.725 0.000 14965.000 | |
FacebookTabsController#twitter_feed: 1276 198.113 1107.842 2.000 14476.000 | |
FacebookTabsController#coupon: 662 164.992 933.120 0.000 13507.000 | |
FacebookTabsController#rss_feed: 623 399.506 1694.646 29.000 14399.000 | |
FacebookTabsController#you_tube_config: 583 359.669 1313.025 31.000 13855.000 | |
FacebookTabsController#signup_config: 410 75.054 130.416 25.000 2301.000 | |
FacebookTabsController#cross_promotion: 257 298.339 1432.134 27.000 13849.000 |
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
Taken from: https://cs.stanford.edu/wiki/admissions/FAQ/ApplicationRequirements | |
Letters of Recommendation: Please have your recommender write candidly about your | |
qualifications, potential to carry on advanced study in the field specified, intellectual | |
independence, capacity for analytical thinking, ability to organize and express ideas clearly, | |
and potential for teaching. In describing such attributes as motivation, intellect, | |
and maturity, specific examples are more useful than generalizations. | |
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
>> s = Satisfaction.new | |
=> #<Satisfaction:0x25d90559 @options={:root=>"http://api.getsatisfaction.com", :autoload=>false, :request_token_url=>"http://getsatisfaction.com/api/request_token", :access_token_url=>"http://getsatisfaction.com/api/access_token", :authorize_url=>"http://getsatisfaction.com/api/authorize"}, @identity_map=#<Sfn::IdentityMap:0x59e4abb6 @pages={}, @records={}>, @loader=#<Sfn::Loader:0x33c567d5 @options={:cache=>:hash}, @cache=#<Sfn::Loader::HashCache:0x193a5460 @cached_responses={}>>> | |
>> s.set_consumer("f96r2nvoer7m", "trqk9ktsw7rdy8h7l1t8s0a1v2htg37t") | |
=> #<OAuth::Consumer:0xeac2918 @key="f96r2nvoer7m", @options={:signature_method=>"HMAC-SHA1", :request_token_path=>"/oauth/request_token", :authorize_path=>"/oauth/authorize", :access_token_path=>"/oauth/access_token", :proxy=>nil, :scheme=>:header, :http_method=>:post, :oauth_version=>"1.0"}, @secret="trqk9ktsw7rdy8h7l1t8s0a1v2htg37t"> | |
>> s.people.page(1, :facebook_id => "1234").load | |
=> [:unauthorized, "Access Denied |
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
# Purely experimental exercise in exploring ideas for a JRuby gem for Netty -- http://jboss.org/netty | |
# Based on TimeClient example in Netty docs | |
require "java" | |
require "netty" | |
require "unix_time" | |
TimeClient = TcpNioClient.new do |pipeline| | |
pipeline.insert :frame_decoder do |
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
# Seen lots of code that uses === in favor of is_a? to do type checking | |
# Just discovered a subtle bug from the lack of symmetry of this method | |
irb(main):001:0> String === "Foo" | |
=> true | |
irb(main):002:0> "Foo" === String | |
=> false | |
# May not seem intuitive at first but the ordering is significant because === is a method! | |
# The first uses Class#=== and the second uses String#===, only the former has the type checking semantics |
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
<target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run"> | |
<scalaProject1:java classname="scala.tools.nsc.MainGenericRunner"> | |
<customize> | |
<classpath> | |
<path path="${javac.test.classpath}"></path> | |
</classpath> | |
<arg line="org.scalatest.tools.Runner -p ${build.test.classes.dir}" /> | |
</customize> | |
</scalaProject1:java> | |
</target> |
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
I. Map/Reduce, GeoSpatial Indexing & other cool features | |
* Client features | |
Safe Inserts - Batches a subsequent write and read together to ensure order preservation when using connection pooling in a multi-threaded client | |
Replication ACK - Can configure minimum acknowledgment level of slave writes. Client will raise exception if replication level not met during a write | |
GetMore operation - receive data from server in chunks |