Skip to content

Instantly share code, notes, and snippets.

View chancila's full-sized avatar

Cristian Hancila chancila

  • Snap
  • San Francisco
View GitHub Profile
#include <boost/filesystem.hpp>
#include <bin/dart_io_api.h>
#include <cstdio>
#include <dart_api.h>
#include <string_view>
#include <type_traits>
using namespace std::literals;
@chancila
chancila / test.cpp
Created May 26, 2019 03:05
Hello Dart
#include <forge/logging.h>
#include <forge/utility/assert.h>
#include <boost/filesystem.hpp>
#include <bin/dart_io_api.h>
#include <cstdio>
#include <dart_api.h>
#include <random>
#include <spdlog/sinks/stdout_color_sinks.h>
package forcomp
import common._
object Anagrams {
/** A word is simply a `String`. */
type Word = String
/** A sentence is a `List` of words. */
def mostRetweeted: Tweet = {
val potentialTweets = filterAcc(x => x.retweets > elem.retweets,new Empty)
if(!potentialTweets.isEmpty) {
potentialTweets.mostRetweeted
} else {
elem
}
}
package funsets
import common._
/**
* 2. Purely Functional Sets.
*/
object FunSets {
/**
* We represent a set by its characteristic function, i.e.
package funsets
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
/**
* This class is a test suite for the methods in object FunSets. To run
* the test suite, you can either:
package recfun
import common._
object Main {
def main(args: Array[String]) {
println("Pascal's Triangle")
for (row <- 0 to 10) {
for (col <- 0 to row)
print(pascal(col, row) + " ")
println()
import XMonad
import XMonad.Util.Run
import XMonad.Util.EZConfig (additionalKeys)
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ICCCMFocus
import XMonad.Config.Gnome
myManageHook = composeAll (
[ className =? "Unity-2d-panel" --> doIgnore
, className =? "Unity-2d-launcher" --> doFloat
public interface ICallback<T> {
public onComplete(Bitmap b);
public onError();
}
interface IRemoteBitmapService {
public void <T> getBitmap(String url, ICallback<T> cbk);
}
@chancila
chancila / dialyze.bash
Created July 19, 2012 21:39
Dialyze a rebar based erlang project easily
#!/bin/bash
DIRNAME=`pwd`
PROJNAME=`basename $DIRNAME`
if [[ ! -f "$HOME/.dialyzer_otp.plt" ]];
then
echo "OTP plt not found"
exit -1
fi