יום שבת, 29 בדצמבר 2012

Best (hebrew supporting) E-reader for android

I have found the best E-reader for android:

ideal group reader, it is still in beta stages but it is awesome!
has the following:
  1. javascript support
  2. hebrew support
  3. epub3 support
  4. hebrew ordered list support!!
    but that is interesting only to those who like me , are trying to read epubs in hebrew on their android devices :)


    יום שבת, 1 בדצמבר 2012

    the best way to learn BFS


    best BFS and DFS lecture ever, made this ruby BFS implementation as a tribute :P

    יום שבת, 17 בנובמבר 2012

    makefile cheatsheet

    kinda chaotic i know, but i made it for myself :P

    under binsem.a
     "gcc -c binsem.c"  creates the binsem.o 
    binsem.o is then inserted by ar into libbinsem.a
    then ranlib does some indexing (not a must afaik)

    libbinsem.a is then used by the first gcc command where you see -lbinsem.
    if you want to use a static lib that doesnt have the lib prefix -lbinsem can be replaces with binsem.a for example if you want to call it binsem.a 

    like so:

    ph: ph.c binsem.a
        gcc ${FLAGS} ph.c binsem.a -lut -o ph
    binsem.a:
        gcc $(FLAGS) -c binsem.c
        ar rcu binsem.a binsem.o
        ranlib binsem.a


    here is the makefile itself:

    #all: binsem.a ut.a ph
    FLAGS = -Wall -Werror  -L./


    ph: ph.c binsem.a
        gcc ${FLAGS} ph.c -lbinsem -lut -o ph


    binsem.a:
        gcc $(FLAGS) -c binsem.c
        ar rcu libbinsem.a binsem.o
        ranlib libbinsem.a


    ut.a:
        gcc $(FLAGS)  -c ut.c
        ar rcu libut.a ut.o
        ranlib libut.a

    clean:
        rm -f *.o
        rm -f a.out
        rm -f *~
        rm -f ph
        rm -f *a

    יום שישי, 24 בפברואר 2012

    Php Old spice Joke


    //hello, programmers, look at your string
    // now back to mine
    // now back to your string
    // now back to mine
    $foo = "0";  
     // sadly it isnt mine
    // but if you stopped using strict typing it could look like mine
    // look down , back up , where are you
    // you're on a site , with the string your string could look like
    //whats in your Text Editor now back at me  
    $foo += 2;
    // its a 2 Integer made from the string you love
    $foo = $foo + 1.3;  //(3.3)
    // look again the Integer is now a FLOAT
    // anything is possible when you are using weakly typed languages...
    // and not ADA
    $foo = "I'm on a horse"


    יום שבת, 7 בינואר 2012

    תוכנת חקר טקסט SEO (חזרת ביטויים)

    כתבתי איזה תוכנה קטנה ברובי שבודקת חזרה של ביטויים בטקסט , נגיד יש לי את הטקסט הבא....
    "משה הלך לגן, קנה לו פנקס צ'קים. כחלון הלך לגן , קנה לו פרחים"
    התוצאה:
    הלך לגן 2
    קנה לו 2

    אפשר להגדיר כמה מילים שבא בביטויים , אבל בטקסטים ממש גדולים תהיה איטיות
    הרצתי את התוכנה על טקסט של 6000 מילים כשהיא בודקת את כל הביטויים מ6 מילים ומטה וזה לקח 1.8 שניות (הרבה בזמן מחשב, למי שמעוניין לדעת I3 4G-RAM)

    הלינק לתוכנה שכתבתי:
    https://github.com/solekiller/Programming/blob/master/ruby/ngrams.rb

    מה שהאלגוריטם שלי עושה הוא, שהוא בצורה יעילה עושה טבלאות גיבוב מהביטויים שבטקסט ולכל שדה של ביטוי מעלה את הקאונטר פעם אחת כשהוא נפגש איתו בטקסט... אנשים אחרים היו מנסים שיטות אחרות, אבל בעולם האמיתי הן איטיות מאוד.
    נראה לי (תקנו אותי אם אפשר יותר מהר) שזו השיטה הכי מהירה לחקור טקסט.

    לדעתי זה האלגוריטם הכי מהיר שאפשר לפתח (לפחות ברובי), מי שיש לו הצעות אני אשמח לשמוע, ומי שרוצה שאני אצור ממשק משתמש ולא רק ממשק למתכנתים יכול לבקש ממני אני אשמח להוסיף משהו קטן ודבילי :)