Skip to content

Instantly share code, notes, and snippets.

View csenol's full-sized avatar

Cagdas csenol

  • Yozgat, Turkey
View GitHub Profile
@csenol
csenol / run_sikko_latte.js
Last active August 29, 2015 14:20
Turkiye'den nadide kod parcalari
//view-source:http://www.bilgi.edu.tr/
function run_sikko_latte(){
var delay_start = 2,
delay_end = 3600; // seconds
$.fancybox.init();
$("#sikkobox").fancybox({
// 'showCloseButton': false,
'transitionIn': 'fade',
'transitionOut': 'fade',
@csenol
csenol / Bilye.scala
Last active December 11, 2015 02:18 — forked from fehmicansaglam/Bilye.scala
object Bilye extends App {
def onbellekliSpragueGrundy(a: Int, b: Int) = {
val fy = Y { f:((Int, Int) => Boolean) => (p: Int, q:Int) =>
if (p == 0) true
else if (2 * q < p) {
(q + 1 to 2 * q).foldLeft(true)((a, b) => a & !f(p - b, b))
} else false
}
fy(a,b)
@csenol
csenol / pl-hindex.rst
Created November 1, 2012 14:58
Programming Languages and H-Index of Creator/Inspirer
LANG PERSON H-INDEX
PHP Rasmus Lerdorf 1
C# ANDERS HEJLSBERG 2
RUBY YUKIHIRO MATSUMOTO 9
RUBY | YUKIHIRO MATSUMOTO | 9|
@csenol
csenol / Turkce.scala
Created September 30, 2012 14:19
Scala Türkçe Kontrol Yapıları
package turkce
class Kere(val n:Int){
def kere(y: => Unit):Unit = for(i <- 1 to n ) y
}
trait Kosullu{
def kosul:Boolean
def dogruyken(y: => Unit) = while(kosul) y
def olanakadar(y: => Unit) = while(!kosul) y
class BadActor(val x:Int) extends Actor {
def act() = {
receive {
case q:Queue => q.put(x)
}
}
}
class BadActor(q:Queue) extends Actor {
def act() = {
receive {
case x:Int => q.put(x)
}
}
}
@csenol
csenol / DPLL.scala
Created October 16, 2011 22:50
Scala SAT Solver
//Çağdaş Şenol2
//csenol
import scala.collection.immutable.Map
object DPLL {
def getUnits(cList : List[List[Int]]) = {
cList filter (_.length == 1) map (_.first)
}
@csenol
csenol / Cont.scala
Created July 26, 2011 20:52
Continuation i Actor e yollamak
import scala.util.continuations._
import scala.actors.Actor
import scala.actors.Actor._
class BeklemeYapma extends Actor {
def act() {
while(true) {
@csenol
csenol / as
Created July 8, 2011 08:01
teset
asa