Skip to content

Instantly share code, notes, and snippets.

View lessandro's full-sized avatar

Lessandro Mariano lessandro

View GitHub Profile

Keybase proof

I hereby claim:

  • I am lessandro on github.
  • I am lessandro (https://keybase.io/lessandro) on keybase.
  • I have a public key ASDhxiAC0EckDHutiCsE0OYWK4k_Rs-DjBqhettO7EO7PQo

To claim this, I am signing this object:

#include <functional>
#include <cstdio>
std::function<void (void)> func;
struct A
{
A(int n_) : n(n_)
{
printf("%p A()\n", this);
➜ ~ wget https://raw.github.com/mauke/poly.poly/master/poly.poly
➜ ~ zsh poly.poly
I'm a zsh script.
➜ ~ bash poly.poly
I'm a bash script.
➜ ~ python poly.poly
I'm a Python program (CPython 2.7.5).
➜ ~ ruby poly.poly
I'm a Ruby program.
➜ ~ make -f poly.poly
# PRAGGIT QUIZ # 123: CALCULATE THE TIME COMPLEXITY OF THESE FUNCTIONS
def f(n):
ls = []
for i in xrange(n):
ls.append(i)
# (1) AVERAGE CASE:
# (2) WORST CASE:
public static List<Person> filter_name(List<Person> list, final String name) {
return guava_filter(list, new Predicate() {
bool apply(Person p) {
return p.name == name;
}
});
}
// ----------------
class FilterName implements Predicate<Person>
# livescript:
<-! $ document .ready
twitter = new ctwitter.CTwitter()
stream <-! twitter.stream \statuses/filter,
lang: \en
track: <[ ruby rails obama ]>
#include <stdio.h>
int f(int a, int b)
{
return (int)&((char*)a)[b];
}
int main()
{
printf("%d\n", f(1, 2));
Write me a tic tac toe game.
The grid coordinates should be:
1 2 3
4 5 6
7 8 9
The program should run like this:

Problem

If you're not familiar with brazilian carnaval, we have these huge parades where traditional samba schools compete for fun and fame. Each school has 1 hour at the Sambadrome to do their thing, and while doing so they're being ruthlessly judged by 5 judges, who later have to assign 9 scores about the parade. They score specific things such as costumes, theme, evolution, harmony, battery, etc.

Write a program that reads these scores from a csv file and prints out the winner school.

Scoring

@lessandro
lessandro / newbot.gridc
Last active December 11, 2015 11:19
new bot
// GridC to GridLang compiler
// https://github.com/lessandro/gridc
int xs[30];
int ys[30];
int ds[30];
int num;
int starve;
void eat(dir) {