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
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
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.truward.polymer.util; | |
import com.google.common.collect.ImmutableList; | |
import com.google.common.collect.ImmutableMap; | |
import com.google.common.collect.ImmutableSet; | |
import javax.annotation.Nonnull; | |
import java.util.*; | |
/** |
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
var http = require("http"), | |
url = require("url"); | |
var port = process.argv[2] || 8888; | |
// Sample redir link: http://docs.oracle.com/javase/7/docs/api/java/lang/String.html | |
http.createServer(function(request, response) { | |
var urlOptions = url.parse(request.url); | |
var pathname = urlOptions.pathname; |
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
#include <stdio.h> | |
#define N (100000000) | |
double arr[] = { 8, 0.125, 4, 0.25 }; | |
int main() { | |
double d = 1.0; | |
for (int i = 0; i < N; ++i) { | |
d *= arr[i % 4]; |
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.alexshabanov.kotwebdemo.service.radio | |
import java.util.Collections | |
import java.util.ArrayList | |
// prototype of non-AOP based approach to service exposure | |
// | |
// Public API | |
// |
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
class Ratio(num : Int, denom : Int) { | |
val numerator: Int | |
val denominator: Int | |
{ | |
val theGcd = gcd(num, denom) | |
numerator = num / theGcd | |
denominator = denom / theGcd | |
} | |
} |
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
Stevey's Google Platforms Rant | |
I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it. | |
I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't really have SREs and they make engi |
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.exports = function(grunt) { | |
function prepareSkeleton() { | |
grunt.file.mkdir('target/web/js'); | |
grunt.file.mkdir('target/web/tmp/js'); | |
} | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), |
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.alexshabanov.neocharseq | |
trait Str { | |
/** Appends the contents of this stream. */ | |
fun appendTo(stream: Appendable) | |
fun charAt(pos: Int): Char | |
fun length(): Int |
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
final Object o1 = jdbcOperations.query("SELECT book_id, series_id, pos FROM book_series", new RowMapper<Object>() { | |
@Override | |
public Object mapRow(ResultSet rs, int i) throws SQLException { | |
final Map<String, Object> result = new HashMap<String, Object>(); | |
result.put("book_id", rs.getLong("book_id")); | |
result.put("series_id", rs.getLong("series_id")); | |
result.put("pos", rs.getInt("pos")); | |
return result; | |
} | |
}); |
OlderNewer