This file contains hidden or 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(larray). | |
-include_lib("eunit/include/eunit.hrl"). | |
-export([intersection/2]). | |
intersection(ListA, ListB) -> | |
[X || X <- ListA, lists:member(X, ListB)]. |
This file contains hidden or 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(larray). | |
-include_lib("eunit/include/eunit.hrl"). | |
-export([intersection/2]). | |
intersection(ListA, ListB) -> | |
Numbers = lists:foldl( fun(N, Ranking) -> dict:update_counter(N, 1, Ranking) end , dict:new(), ListA ++ ListB), | |
lists:usort([Unique || Unique <- dict:fetch_keys(Numbers), dict:fetch(Unique, Numbers) > 1]). | |
%% helper functions to create big lists of random integers | |
large_random_array(N, MaxValue) -> |
This file contains hidden or 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
$(document).ready(function() { | |
$('body').empty(); | |
document.title = "REDDIT IS A WASTE OF TIME"; | |
}); |
This file contains hidden or 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
// Initial version w/ explicit types: | |
Dictionary<string, string> users = db.Users.Where(u => u.Account.Id == accountID).ToDictionary<User, string, string>(u => u.Id.ToString(), u => u.Login.Username); | |
// Without explicit type info. | |
var users = db.Users.Where(u => u.Account.Id == accountID).ToDictionary(u => u.Id.ToString(), u => u.Login.Username); |
This file contains hidden or 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 EzekielTemplin | |
def initialize | |
@birthdate = Date.parse('1983-06-29') | |
@gender = "male" | |
end | |
def age | |
#still derp | |
Date.today.year - @birthdate.year | |
end |
This file contains hidden or 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
if ( response && response.Status ) { | |
if ( response.Status.Status == 'OK' ) { | |
this.reloadBrowser(); | |
} else { | |
console.log( response ); | |
console.log( status ); | |
this.reloadBrowser(); | |
} | |
} else { | |
console.log( response ); |
This file contains hidden or 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 have heard of an emulator of Peregrinos, a post-war writer who, after having finished his first book, committed suicide to attract attention to his work. Attention was in fact attracted, but the book was judged no good. |
This file contains hidden or 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
0011011000110001001101110011001100110111001100110011011100110000001101100011010100110110011001010011011001100101001101100011100100110110001101010011011100110011 |
This file contains hidden or 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
Meta about Tour of Go | |
Use of packages is nice. | |
Import syntax with quotes, as in Ruby. I don't like this. You quote the package name but then refer to the imported thing with a plain identifier? Why not omit the quotes so it is uniform? | |
Types after identifiers is weird, but I get the motivation. Should have gone all the way so everything works uniformly though. | |
Pointer syntax didn't have to be a star. Other options available. | |
Result parameters are interesting. But why do I have to say "return" at all? |
This file contains hidden or 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
(From Slashdot Q&A http://science.slashdot.org/story/13/05/13/1410230/interviews-freeman-dyson-answers-your-questions) | |
How has your education helped or hindered you? You are the "ideal" educated man. In our (American) culture, we don't seem to be producing people devoted to learning, discovering, thinking, inventing, etc. What in your opinion can an educational system do to foster what you've become? | |
Dyson: I was extremely lucky because I came through the British education system during the war when everything was screwed up. The whole system depended on written examinations and we did not have enough ships to import paper. So there was no paper and no exams. Also there was a high shortage of teachers since all the young people were away fighting the war. As a result, I was in class only seven hours a week. A wonderful time to get an education. We had maximum freedom, and the kids learned more from one another than we would have learned from teachers. | |
The kids today spend far too much time in class and a |