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
package week1 | |
object pascalTriangle { | |
def pascal(c: Int, r: Int): Int = { | |
if (r == 0 && c == 0) 1 | |
else if (c < 0 || c > r + 1) 0 | |
else pascal(c - 1, r - 1) + pascal(c, r - 1) | |
} //> pascal: (c: Int, r: Int)Int |
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
package week1 | |
import scala.annotation.tailrec | |
object parenthesesBalancing { | |
def balance(chars: List[Char]): Boolean = { | |
def analyse(c: Char) = | |
if (c == '(') 1 |
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
import sys | |
from datetime import datetime | |
import paramiko | |
import gzip | |
import gnupg | |
import MySQLdb | |
# apt-get install: | |
# python-paramiko | |
# python-mysqldb |
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
package akkaActors | |
import akka.actor.{ Actor, ActorSystem, Props, PoisonPill } | |
import akka.pattern.ask // enable the use of ? or ask that return a future from an actor | |
import akka.util.Timeout | |
import scala.concurrent.Await | |
import scala.concurrent.Future | |
import scala.concurrent.ExecutionContext.Implicits.global // import global execution context (implicit way) | |
class HelloActor extends Actor { |
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
package akkaActors | |
import scala.concurrent.Await // enable awaiting a future | |
import scala.concurrent.duration._ // enable convert in to ms n.seconds | |
import scala.concurrent.Future // Future function | |
import scala.concurrent.ExecutionContext.Implicits.global // import global execution context (implicit way) | |
object futureTest extends App { | |
// Create and begin execution of the Future |
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
name := "Akka actors" | |
version := "1.0" | |
scalaVersion := "2.10.1" | |
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/" | |
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.1.2" |
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
// This sample will guide you through elements of the F# language. | |
// | |
// ******************************************************************************************************* | |
// To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click | |
// and select "Execute in Interactive". You can open the F# Interactive Window from the "View" menu. | |
// ******************************************************************************************************* | |
// | |
// For more about F#, see: | |
// http://fsharp.net | |
// |
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
using System; | |
using System.Linq; | |
using System.Linq.Expressions; | |
namespace Data.GenericRepo { | |
public interface IRepository<T> : IDisposable where T : class { | |
T[] GetAll(); | |
IQueryable<T> Query(Expression<Func<T, bool>> predicate); |
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
using System; | |
using System.Collections.Generic; | |
using System.Reflection; | |
namespace Vkobel.ExtensionMethods { | |
public static class GenericPropertyMethods { | |
public static PropertyInfo GetProperty(this object obj, string name) { | |
return obj.GetType().GetProperty(name); | |
} |
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
git rm -r --cached . | |
git add . | |
git commit -m ".gitignore is now working" |
OlderNewer