Weekly report #1 – Week 52/2014

First weekly report about what I’ve been about code-, design-, server-, geek-wise. Bugfixes, Raspberries, Christmas and stuff

Monday

Monday was one of those days when one wants to do more than they physically and mentally able. Fixing bugs in calculating deadlines, testing if those deadlines work.

Second thing I did were two tasks from r/dailyprogrammer. Acronym expander was pretty simple, only hard thing there was to detect dot after end of the word. Second one was harder. It was about calculating dimensions from volume.

To solve problem with two unknown dimensions was to make one dimension dependable on the other. This was for cone and cylinder, other two were cube and sphere which have only one dimension. So I decided that height equals two times radius. I’m not sure it is an optimal solution, but it is a solution.

Tuesday

Due to unplanned Christmas preparation I did not write much code today. I found an elegant solution for calculating deadlines. It’s to set deadline for a second before midnight rather than for the midnight for two reasons:

  1. Easier calculation of the deadline
    • there’s no need to check if the date is OK. Bad wording, there needs to be only validation that user entered valid date. There doesn’t need to be checking for end of the month and adjusting the date before creating timestamp
  2. Easier displaying of the date on the front end

I have also brought my Raspberry Pi from hibernation because I want to be more serious with my work. There are things I want to do, but with MAMP are harder to do. It’s also good to know how to set up a server and be it’s overlord.

One thing is PHPUnit for unit testing. They are dropping/dropped support for PEAR framework, and offer only phar package. So it’s smarter to get myself a “full-fledged” server. I plan to get in a month or two big Linux box. Probably with Debian, but I’m not sure yet.

Wednesday

Today is a Christmas day and I decided unexpectedly to cook some more which was a surprise. I didn’t have time to code much, but I made Roman numeral conversion code in PHP.

Thursday

Thursday was mostly about preparing my testing environment on Raspberry Pi. At the moment I don’t feel it is necessary to have separate big computer which would act as a server. So I have set up Apache, PHP and MySQL, may be I should have installed MariaDB instead, and FTP.

The reason to set up FTP was to have easy access to the file system. The next in my plans is to write a short script in JavaScript for Node.js to watch files and upload changed one to the RasPi. So far I have written how to identify files in folder and subfolders.

Friday

I encountered very serious problems with WatchWolf project. It’s a problem with the Node.js itself, specifically some functions don’t work on Mac OS X. Function fs.watch() doesn’t support on mac the name of the changed file. So I am going to have to change the language I use for this support project, probably Java.

Saturday

Today was about modification of certain example class which implements watching over folder and all of it’s subfolders. The main modification was about having an ignore list of folders and files. Secondary modifications were about simplification to the point where anything unnecessary was removed.

Sunday

Short day. The only that I did was to create XML handler for config file. The reason I chose XML instead of ordinary plain text or JSON was that XML and Java go together and I wanted something human readable and editable. I know it’s verbose format and may be overkill solution, perhaps, but it’s implemented.


Links: