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
package com.foo.http | |
import scapps.http.BaseApp | |
import scapps.http.route.OptionKleisli._ | |
import scapps.http.route.Route._ | |
import scalaz._ | |
import scalaz.http.servlet.{HttpServletRequest} | |
import scalaz.http.response._ | |
import scalaz.http.request._ |
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
// OLD | |
- (NSDictionary *)parsePerks:(NSArray *)perks { | |
NSMutableArray *convertedPerks = [NSMutableArray arrayWithCapacity:[perks count]]; | |
for (NSDictionary *perk in perks) { | |
PLPerk *convertedPerk = [[PLPerk alloc] initWithProgramName:[perk objectForKey:@"program_name"] | |
shortDescription:[perk objectForKey:@"perk_title"] longDescription:[perk objectForKey:@"perk_desc"] | |
location:[self parseLocation:[perk objectForKey:@"locations"]]]; | |
[convertedPerks addObject:convertedPerk]; | |
[convertedPerk release]; |
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
module UserAgentHelper | |
def on_iphone_like_device? | |
request && (request.user_agent =~ /iPhone/ || request.user_agent =~ /iPod.*AppleWebKit.*Mobile.*Safari/) | |
end | |
end |
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/sh | |
NUM_CORES=2 | |
FJ_ARTIFACTS_DIR=/home/me/functionaljava/artifacts/latest | |
cd FJ_ARTIFACTS_DIR | |
javac -d /tmp/ -classpath functionaljava.jar demo/1.5/concurrent/Fibs.java | |
java -classpath /tmp/:functionaljava.jar concurrent.Fibs ${NUM_CORES} |
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
+ (FKEither *)doParseContent:(NSString *)rssContent { | |
PXRss20ParserDelegate *parser = [[PXRss20ParserDelegate alloc] initWithContent:rssContent]; | |
FKEither *maybeItems = [parser.parse.right map:[NSArray liftFunction:[FKFunction functionFromSelector:@selector(parseItem:)]]]; | |
[parser release]; | |
return maybeItems; | |
} | |
+ (PXRss20Item *)parseItem:(NSDictionary *)item { | |
return [PXRss20Item title:[item objectForKey:@"item"] link:[NSURL URLWithString:[item objectForKey:@"link"]] description:[item objectForKey:@"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
# sans destructive update | |
def f(rss, n) | |
rss.inject(0) {|acc, rs| rs.include?(n) ? acc + 1 : acc} | |
end | |
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
package com.googlecode.furnace.grid | |
import org.gridgain.grid.{GridTaskSplitAdapter, GridJobResult, GridJob} | |
import analyse.{AnalysisResult, SequenceIdentifier} | |
import java.util.{List => JavaList} | |
import java.util.{Collection => JavaCollection} | |
import sequence.GeneSequence | |
final class GeneSequenceGridTask extends GridTaskSplitAdapter[Iterator[GeneSequence], List[AnalysisResult]] { | |
def split(gridSize: Int, inputSequences: Iterator[GeneSequence]): JavaCollection[_ <: GridJob] = error("I'm not really a list") |
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="project.longname" value="Instinct Behaviour Driven Development (BDD) Framework"/> | |
<property name="project.shortname" value="instinct-core"/> | |
<property name="project.version.major" value="0"/> | |
<property name="project.version.minor" value="2.0"/> | |
<property name="version-status" value=""/> | |
<property name="project.version.full" value="${project.version.major}.${project.version.minor}${version-stat | |
us}"/> | |
<property name="project.jar" value="${project.shortname}-${project.version.full}.jar"/> | |
<property name="project.zip" value="${project.shortname}-${project.version.full}.zip"/> |
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
CmdUtils.CreateCommand({ | |
name: "showmore", | |
takes: {"url to shorten": noun_arb_text}, | |
preview: "Replaces the selected URL with ashowmore.info shortened URL.", | |
description: "Replaces the selected URL with a bit.ly-shortened URL.", | |
icon: "http://bit.ly/favicon.png", | |
execute: function( urlToShorten ) { | |
var baseUrl = "http://showmore.info/links/"; | |
var params = {link_url: urlToShorten.text}; | |
jQuery.get(baseUrl, params, function(shortenedUrl) { |
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
package com.googlecode.furnace.analyse.blast; | |
import static com.googlecode.instinct.expect.Expect.expect; | |
import com.googlecode.instinct.integrate.junit4.InstinctRunner; | |
import com.googlecode.instinct.internal.util.instance.ObjectFactory; | |
import com.googlecode.instinct.marker.annotate.BeforeSpecification; | |
import com.googlecode.instinct.marker.annotate.Dummy; | |
import com.googlecode.instinct.marker.annotate.Mock; | |
import com.googlecode.instinct.marker.annotate.Specification; | |
import com.googlecode.instinct.marker.annotate.Subject; |