Posts Tagged ‘open source’

Make Pomodoro timer open in tray

Wednesday, September 10th, 2014

Cold day outside. Got into kinda hackish mood. Started my laptop and seen that annoying window again. Let me explain. I run a program called Pomodoro timer on Startup. If you don’t know it, behold: Pomodoro Technique. But back to the Pomodoro timer issue. I hate how the “Settings” window is showing up every time I boot. I want it to start in tray. Can I make it start in tray?

Get the code

The sources are free on GitHub. If you have console (e.g. Cygwin) with working subversion so you simply run:

svn checkout svn://svn.code.sf.net/p/pomodorotimer/code/trunk pomodorotimer-code

to checkout the repository into pomodorotimer-code directory. If or you don’t use console you can use TortoiseSVN. Then go to the directory you just created.

You can see some .cs and .csproj files. That just screams C# and some .NET Forms app. Let’s look for the Main method:

grep -iR main *

It’s in Program.cs

Do the job

I just want the program to open in tray every time, that all. I don’t need to see settings window unless I manually open it. In .NET Forms you can hide window (form) by simply calling the form.Hide() method. So in the Program.cs, replace this line:

Application.Run(new SettingsForm());

with this:

SettingsForm form = new SettingsForm();
form.Hide();
Application.Run();

That’s it. Compile:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe Program.csproj

Now you can find your brand new bin/Debug/Program.exe. Simply copy it into Program Files or wherever you keep your Pomodoro program.

Howgh

Open Street Map

Sunday, June 22nd, 2014

I’m kinda proud editor of open street map. My reason is simple. I find a place, say cafeteria, that I really like and want to remember… AND I wan to use Open Street Map as my primary map source. Well the best thing to do is to put all my favourite places with all the details on there right? And so I do. Webpages, openning hours, phones and mail adresses, smoking/nonsmoking… Simply everything.

Here is link with all my changes so far: http://www.openstreetmap.org/user/kub1x/history It’s not much but I’m working on it. I also write each of the organizations to make them aware of the map and show the support. I’ll also leave some notes here as I have to browse the OSM wiki all the bloody time ;)

Notes about editing OSM

Openning hours (key)

opening_hours=Su-Tu 11:00-01:00, We-Th 11:00-03:00, Fr 11:00-06:00, Sa 11:00-07:00

 Facebook site (key)

I disagree with the following syntax as there is already a reasonable sytnax for wikipedia and almost every organization I know have facebook page and facebook does have nice URL system already. Therefor I’ll use contact style AND the same style used for wikipedia as follows. I’ll also probly discuss this in OSM mailing lists.

contact:facebook=http://facebook.com/Nasekavarna
facebook=Nasekavarna

Czech house numbering system

For address Thomayerova 800/5 we add following three tags:

addr:housenumber=800/5
addr:conscriptionnumber=800
addr:streetnumber=5

Hints

  • To start editing: go to http://osm.org > press edit > login/register/watch tutorial > edit the map > save (a.k.a. commit) your changes
  • Use reasonable reasonable comment about your commit (about one sentence long) about what you just did.
    e.x.: “added cafeteria Naše Kavárna in the areal of Thomayerova hospital in Prague
  • Do one thing at a time. e.x. don’t mix road edits with addition of cafeteria. Make it two commits instead. It will keep your work organized ;) for you and for others.

My edits

just some notes