Posts

גיקון 2013 - רחפנים רוקדים - GeekCon 2013 - Making Drones Dance

Image
בגיקון 2013 כתבנו, רם נתנאל, אורי אבוניל, משה קפלן ואנכי, כנען אביב תכנת Python שגורמת לרחפנים לרקוד. השתמשנו ב - Quad Copters מסוג CrazyFlie של חברת BitCraze . לרחפנים שלחנו פקודות ממחשב לפטופ שבתורו זיהה סאונד או טיפוף והרקיד את הרחפנים באוויר. הדגמתי ביחד עם אחי את הרחפנים רוקדים בכנס Reversim Summit 2014 . לקריאה נוספת, על גיקון - GeekCon Reversim Summit . להורדת הקוד המלא.

Can't see video (mp4 / mpeg) thumbnail on gThumb

Can't see video (mp4 / mpeg) thumbnail on gThumb ? Install thumbmailer: sudo apt-get install libxine1-ffmpeg sudo apt-get install ffmpegthumbnailer Convert to mpeg: ffmpeg -i video-2014-02-28-16-57-10.mp4 video-2014-02-28-16-57-10.mp4.mpg  for f in *.mp4; do ffmpeg -i "$f" "${f%.wav}.mpg"; done

Select Newset or Most Updated Records from a MySQL Table - Two options

Select Newset or Most Updated Records from a MySQL Table - Two options CREATE TABLE ttt(    id      MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,    date    DATETIME NOT NULL,    aid     MEDIUMINT UNSIGNED NOT NULL,    status  ENUM('ac', 'na') NOT NULL,    PRIMARY KEY(id) ) ENGINE InnoDB; INSERT INTO ttt SET id=1, date='2014-03-10', aid=1, status='ac'; INSERT INTO ttt SET id=2, date='2014-03-11', aid=1, status='na'; INSERT INTO ttt SET id=3, date='2014-03-11', aid=2, status='ac'; INSERT INTO ttt SET id=4, date='2014-03-12', aid=1, status='ac'; INSERT INTO ttt SET id=5, date='2014-03-12', aid=2, status='na'; SELECT ttt.* FROM ttt LEFT JOIN ttt t2 ON t2.aid=ttt.aid AND t2.id>ttt.id WHERE t2.id IS NULL; SELECT ttt.* FROM ttt INNER JOIN (SELECT MAX(id) as maxid, aid FROM tttGROUP BY aid) t2 ON ttt.id = t2.maxid; And the results: mysql> SELECT ttt.* FROM ttt L...

Most Popular Programming Languages of 2014 — CodeEval

Most Popular Programming Languages of 2014 — CodeEval לא הייתי מנחש את המקום הראשון, אבל כן את השני.  

הוספת BOM UTF-8 לקבצים ב - PHP

$csv_file  = fopen("barvaz/barvazon.csv", 'w') or die("can't create bar baz"); fwrite($csv_file, "\xEF\xBB\xBF");

גרף על ציר הזמן של איחוד נתונים - אפליקציה לבניית ציר זמן והצגתם

Image
משהו קטן שכתבתי, אפליקציה לבניית ציר זמן של משאבים ומראה מתי הם היו ביחד ואיפה כל אחד מהם היה. זה נחמד לייצר כרף לדוגמא של " ענקי הזמר העבר י" ולראות מי מהם היה ביחד בלהקת הנח"ל או היכן נמצאות הדמויות בעונה השלישית של " משחקי הכס ". צרו בעצמכם timeline של הטיול שלכם או כל דבר שעולה על רוחם. http://www.timeandline.com וייצרתי גם אפליקצית כרום לאפליקציה הנ"ל.

count של כמה ערכים בשאילתא אחת ב - SQL

לעיתים אנחנו רוצים לספור כמה ערכים שונים בשאילתא אחת ב - MySQL. שליפה של סט נתונים מתוך טבלא בבסיס הנתונים, ומתוך הספירה הכללית COUNT(*)  לספור תתי נתונים. שיטה חמודה לעשות זא, באמצעות CASE WHEN ב- MySQL. SELECT          date(stime),      COUNT(salesid),      SUM(CASE status WHEN 'done' THEN 1 ELSE 0 END) as TotalDone,      SUM(CASE status WHEN 'remaining' THEN 1 ELSE 0 END) as TotalRemaining,      SUM(CASE status WHEN 'cancelled' THEN 1 ELSE 0 END) as TotalCancelled FROM  sales GROUP BY date(stime) mysql multiple count in single query - stack overflow