Silly Little Pomodoro Timer using Tkinter

Saturday, May 13th, 2017

https://en.wikipedia.org/wiki/Pomodoro_Technique
Seems to work ūüôā

import Tkinter
from Tkinter import *
import time
import math
import tkMessageBox

tickCount = 0
divisions = 25

def drawClock( clockArea ):
     global tickCount
     global divisions
     tetha = ( 2 * math.pi ) / divisions
     tickCount = tickCount + 1
     clockArea.create_oval(10,10,190,190,width=10,fill="blue")
     clockArea.create_line(  100, 100, 100 + 60 * math.sin(tetha * ( tickCount - 1 ) ), 100 - 60 *  math.cos(tetha * ( tickCount - 1) ),width =3 )
     print ( tickCount)
     if ( tickCount  == divisions):
         tkMessageBox.showinfo("Time up!", "Time up!")
         tickCount = 0
         return
     clockArea.after(1000 * 60 , lambda: drawClock(clockArea) )
def reset(clockArea):
    global tickCount
    global divisions
    tickCount = 0
    divisions = 25
    drawClock(clockArea)

def takeBreak(clockArea):
    global divisions
    tickCount = 0
    divisions = 5
    drawClock(clockArea)

if __name__ == "__main__":
    root = Tk()
    root.resizable(0,0)
    root.title("Pomodoro Timer")
    clockArea = Canvas(root,width=200,height=200)
    clockArea.create_oval(10,10,190,190,width=10,fill="blue")
    clockArea.create_line ( 100,100, 100, 20, width = 3 )
    clockArea.pack()
    clockArea.after(1000 * 60 , lambda: drawClock(clockArea))
    resetButton = Button(root,    text="Reset",width=25,command=lambda:reset(clockArea) )
    resetButton.pack()
    takeBreakButton = Button(root,text="TakeBreak",width=25,command=lambda:takeBreak(clockArea) )
    takeBreakButton.pack()
    root.mainloop()

Homebrew Console -Baby Steps

Sunday, February 28th, 2016

WIN_20160227_12_47_57_Pro

 

This is my second attempt at creating a  game console. This makes use of laser cut palstic parts for the enclosure, it makes use of a raspberry pi and mame.  The game play is not very good. However it feels good :).   But I am still learning and after many attempts РI will finally build an awesome game console.  Nividia Jetsons dev board is very powerful but expensive at the same time.  May be I will get one when get a deal somewhere.

Humble Beginnings

Wednesday, February 10th, 2016

This is my first attempt at creating a game console.  It is a PIC based design.  I used an existing kit, studied the circuit and assembled it together.  This  video game console is essentially a microprocessor/ micro controller based circuit with few resistors for interfacing with the video and few switches which work as input to the game console.  You can get an idea on how it is done using  Cornell University Final Projects and  Video game console design course.   Adafruit  industries and  XGameStation provide game console kits.  Meanwhile I will be looking at Ben Nanonote and Open Pandora Hardware design to learn how to design my own awesome little game console.

 

WIN_20160209_21_02_49_Pro

 

I will 3d print my own console enclosure for this tiny little project of mine and its going to look awesome!.

Mindmapping with Vim!

Thursday, December 3rd, 2015

 

 

I have used several tools mind mapping before ( freemind, xmind, vym and their likes), but vim is my favorite editor and wanted to do everything from vim itself. To do mind mapping in vim, my solution is to use the DrawIt!  plugin.

Concurrent Android Programming

Friday, June 26th, 2015

My brief notes on concurrent programming facilities available in android. I will update it i find something interesting, do comment if you think that I missed something.

The passionate programmer ?

Sunday, June 21st, 2015

I just finished reading the book the passionate programmer by Chad Fowler ( No! , he is not related to Martin Fowler!) .  Although i do not necessarily agree with all his views. Here are the few take away points for me.

 

  • Try to understand business domain which you are working for ! – I am a typical techie who considered business meetings to be a complete waste of time, from now on i will at least make an effort to understand it better
  • Do not stagnate keep learning something new everyday!
  • “Whoever can be trusted with very little can also be trusted with much, and whoever is dishonest with very little will also be dishonest with much.” – Even if the job is boring and trivial try to do a good job instead of avoiding¬† or procrastinating.¬† I was very immature at my first job at Microsoft – this is a key thing!.¬†¬† Employers do not want a super hero, but some one who can execute well and is pleasant to others.
  • Take some more risks!¬†

How do i actually write an operating system ?

Monday, February 23rd, 2015

This my answer to quora query. I thought it is good to archive it here.

 

How do I actually start writing an Operating System?

I want to know the baby steps to be followed. I have read all the introductory articles on http://wiki.osdev.org.
I want to know how do I actually start writing code which can be executed independently of any Operating System. How do I write the assembly code which will enable my machine to execute it directly? What all do I need to learn for that? Also, what are the prerequisites and what are the tools needed for writing an Operating System?
I have read the theoretical concepts of Operating Systems and I have also gone through the Linux source code but I couldn’t understand much.
was at your place initially therefore I hope I can help. First thing you want to do is finalize on what you want to do. Most of the operating system tutorials start with a simple boot loader.  Read the intel manuals and learn them well . I believe it is easier to start with a real mode operating system because bios does lot of work for you .
Answer :
Yes you should have a moderate knowledge of x86 assembly to write an os .

Resoures for Learning x86 Assembly

EMU8086 is one of the easiest way to get started with x86 assembly it comes with an os development tutorial too.

1) IBM PC assembly langage programming Peter Abel: IBM PC Assembly Language and Programming: Peter Abel: 9780137566105: Amazon.com: Books
2) Assembly language step by step¬† : http://www.amazon.com/Assembly-Language … 0471578142
3) Assembly Language Master Book : http://www.amazon.com/Assembly-Language … 0471578142
4)Art of Assembly : Art of Assembly Language Programming and HLA by Randall Hyde
5) emu8086 : EMU8086
6) ketmans assembly tutorial : BT’s free web hosting service is now closed
7) Buch of tutorials from programmers My Bible
8 ) Knuths book¬† – Art of computer programming – volume 1¬† Fundamental Algorithms — Excellent
9) PC Assembly Language Programming : PC Assembly Language by Paul A. Carter
10 ) Programming from the ground up : Programming From The Ground Up
11) Advanced 386 programming Techniques –¬† James Turley

Interesting Projects and Pages

Mike os is a good starting place.

simple x86 assembly language operating system

I am compiling a set of resources that might help you on the way.

Operating System Engineering
Bona Fide OS Developer
Pintos Projects: Introduction
JamesM’s kernel development tutorials
The Operating System Resource Center
BrokenThorn Entertainment
Skelix OS Tutorial Content

Learning the linux kernel is another matter, it might be easier to read historic linux kernels for a newbie than the latest one. You might find this interesting

Linux Kernel 0.01 commentary

Hope something in my rambling is of some use to you ūüôā

Djembe

Sunday, February 15th, 2015

I learned about this African musical instrument ( from Mali ) from udemy

 

UC-ZUVFS1G8

 

 

ADHD

Sunday, February 15th, 2015

UC-82LZ4BW8I just completed this course, it was good

GNU plot

Thursday, January 29th, 2015

GNU plot is very helpful for plotting data and quite powerful too. After some searching I found the book GNU plot in action.

I fount this website very useful for surface plots :

http://lowrank.net/gnuplot/plot3d2-e.html

This is another useful reference :

http://www.phyast.pitt.edu/~zov1/gnuplot/html/intro.html

This always helps : http://www.gnuplot.info/.

 

Hint:  I think its a good idea to use awk to combine different columns. etc