↓ Skip to main content

2012 ManicTime review

As 2012 ended, I wanted to take a look back at this year and review my computer usage/consumption in order to reduce time wasting activity. That time should be channeled into more meaningful activities like learning a new language, improving my current skills, practicing piano and more.

The following data has been collected from August 11, 2012 to December 31, 2012. There is about 14 days which do not have any data (application was closed).

The data covers my computer usage with over 966.21h of active usage. During the period for which I collected data, the computer was also powered off for 1686.30h and left unused (away) for approximately 58.04h.

If we account 2 months of 31 days + 2 months of 30 days + 20 days (August) - 14 days without data = 128 days of data. This would average to 7.55h/day of active computer usage. The way it is currently “structured” however is that computer usage during the week is about 4-5h/day while on the week-end, it is about 12h/day.

This sounds a bit high, but there’s a reason to this. I’m not ACTIVELY using the computer for all that time. In ManicTime, the computer is considered active if the computer is being used at least once within a 60 minutes time frame. This means I could potentially be using the computer for 1 minute (or less) every hour and it would count as an active usage of 1h. But for the sake of this review, I’ll consider myself as a computer addict (which I am) and will count every minute as an active minute.

The following top 10 items accounts for 876.18h out of the 966.21h of active usage of the computer.

Application Hours
Google Chrome 457.76
Remote Desktop Connection 179.11
League of Legends (TM) Client 72.69
VLC media player 62.9
HexChat 35.81
Free Alarm Clock 15.02
mRemote 14.9
Sublime Text 2 14.56
Windows Explorer 12.13
Torchlight II 11.3

On first sight we can see that I spend a lot of time browsing the web. I do various things on there and since it is the biggest chunk of my time, it is worth looking at what I do exactly on the web. The following table is the top 10 websites I’ve spent time on.

Web activity
#

Website Hours
www.reddit.com 165.53
www.jolteon.net 19.33
www.youtube.com 17.51
docs.google.com 12.79
-confidential- 12.66
www.twitch.tv 9.34
www.google.ca 8.18
en.wikipedia.org 4.92
www.facebook.com 4.81
mail.google.com 4.08

This covers 259.15h out of 457.76h (56.6%) spent in Chrome. This means that I have a long-tail (a list of many different websites which I visit for a brief period) of 198.61h. The major time consumer here is www.reddit.com, which accounts for 36.2% of my time browsing. Even though reddit is a news/media website (useful for staying up to date with world events, not sure I do that…), it also contains a lot of content which I would categorize as time wasters: funny pictures, pictures of cats, videos as well as discussions about topics of interests (computer science, software engineer, robotics, electronics, etc.). I spent about 1.3h/day during the 128 days for which I collected data, which I find to be quite a lot.

As for the other sites, here’s a couple of notes: www.jolteon.net: This is a bug tracker I use to track new features/bugs where I work. It serves as a personal system for me to track these issues. I use it frequently to update task statuses as well as enter anything that I may have forgotten to add during the day. I also like to review it frequently to remind myself of what is left to work on (and let my mind figure that out while I sleep) www.youtube.com: I often get on youtube because of reddit. I enjoy watching documentaries which last from 30-45 minutes on average. docs.google.com: I’ve spent some time writing documents in Google Docs simply because it allowed me to share them with others so they could review my work. -confidential-: This is a website I use to manage “things” for work. I generally go there every day and it takes me from 5-15 minutes on average. www.twitch.tv: Watching streamers of Starcraft 2 and LoL for a while. www.google.ca: Looks like I spend a lot of time searching… en.wikipedia.org: Whenever I don’t know something about a subject of interest, wiki is a good source (generally…) www.facebook.com: Checking that everyone I know is still alive mail.google.com: Because I like spam

Back to the apps
#

If we go back to the applications I use, the next in the list is Remote Desktop Connection. I use Remote Desktop Connection to connect to my PC at work so that I can do some work from home. As you can see, I have spent almost 1.44h/day working remotely. Considering that I am not a “work at home” employee, I find this to be outrageously high. I would like to see this be as close as possible to 0h/day.

Next is League of Legends (TM) Client. I’ve recently been interested in the game and started to play it on a more regular basis. I would like to keep this at around 1h/day or lower.

I’ve used VLC media player to watch series as well as movie on my PC. Series are 20-45 minutes while movies varies from 1h30 to 3h30. I’d say that about 225h/year looks like an acceptable amount of time spent on this.

I’ve stopped using MSN to chat with friends. My main communication channel is now through IRC, for which I use the HexChat client. I want to spend a maximum of 1h/day on communication though.

I’m not too sure why Free Alarm Clock is part of the top 10. I believe this has to do with the note I wrote at the beginning mentioning that ManicTime would consider a program active if there was some movement on the screen in the last 60 minutes. Since Free Alarm Clock was set to show up (and take focus) every hour, it is quite possible that it simply appeared from time to time while I was away and “sucked” the time out of whatever was running in the background.

mRemote is another application I used briefly to do remote desktop. Since it doesn’t support multiple monitor remoting, I’ve stopped using it.

Sublime Text 2 is my text editor of choice. I haven’t spent a lot of time in it since August mainly because I haven’t been doing any coding at all in the past few months.

Windows Explorer Some time spent searching for files on my PC!

I’ve played through the whole campaign of Torchlight II, which was pretty awesome! I’d be really happy to try multiplayer with some willing friends to see what the end content is like (single player end of game content was pretty funny, but playing it alone wasn’t very satisfying for me).

Conclusion
#

The important part of this process, other than reviewing what time was spent on this year, is to decide new objectives going forward. This means deciding what should be cut down, reduced, increased or added. For each application I’ve already determined what was my goal/limits thus I simply need to make sure I follow them. A monthly review should be sufficient.

Recommendations
#

  • Reduce reddit usage below 1h/day
  • Reduce/cut time spend doing remoting for work
  • Redistribute free time on learning activities and skills improvement

Short SSD setup guide

Backup everything. First rename, then remove when you confirmed it worked. Better safe than sorry.


REM Set the new root location
REM Ex. NEW_ROOT=D:
REM     NEW_ROOT=D:\Data
REM     NEW_ROOT=D:\MyStuff\MyComputer
set NEW_ROOT=D:

REM (Make sure that C:\Users doesn't exist anymore)
move C:\Users C:\Users.Backup
mklink /J C:\Users %NEW_ROOT%\Users

REM DO NOT DO THE FOLLOWING
REM (Rename C:\ProgramData before creating the link)
move C:\ProgramData C:\ProgramData.Backup
mklink /J C:\ProgramData %NEW_ROOT%\ProgramData

REM Update the TEMP folder at system level
setx /m TEMP %NEW_ROOT%\Windows\Temp
setx /m TMP %NEW_ROOT%\Windows\Temp

move C:\Windows\Temp C:\Windows\Temp.Backup
mklink /J C:\Windows\Temp %NEW_ROOT%\Windows\Temp
REM END DO NOT DO

PHPUnit - No coverage report

I was trying to get PHPUnit to give me some coverage report for a project I had not worked on for a long time. I had received a github pull request from someone and I wanted to see what the coverage was on the project to see if the submitter had done a good job of covering his code, but I couldn’t get PHPUnit to generate a report that contained any data. All I would get was a couple of empty directory folders pages, which was useless.

I had code coverage work on another project in the same environment I was in, so I was pretty sure that my problem had to do either with how I had setup PHPUnit for that particular project, or that something else was interfering with the report generation.

I tried a couple of things, starting by calling phpunit from the command line using different arguments:


--coverage-html report test\symbol_test.php

Would generate some report with data in it, good!


-c test\phpunit.xml (logging set in phpunit.xml)

Would generate an empty report, not good…


--coverage-html report -c test\phpunit.xml

Would generate an empty report, not good…

So at that point I saw that it was working correctly and that something was definitely wrong with my phpunit.xml configuration file. I went back to the phpunit.de manual, specifically on the configuration page, and tried to figure out my problem.

For code coverage to be included in your report, you have to add a filter, be it a blacklist or a whitelist, but you have to have a filter.

So I quickly added a filter such as


<filter>
	<whitelist>
		<directory>../</directory>
	</whitelist>
</filter>

which would whitelist everything that is in the project (my project root is one level above test). Ran **phpunit ** in the test folder and I finally got a report with data!


PHPUnit - PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Util/Filter.php'

A friend of mine was trying to install PHPUnit on his mac (OS X Lion), but unfortunately, he got stuck during the process.

At some point, he was faced with this error being displayed. We both looked at the problem and first made sure that said file existed. It was the case, weird…

A bit of googling will reveal that this is frequently fixed by appending the path to the pear folder to your php include_path (defined in your php.ini). But in his case, that was already done and it still wasn’t working.

Next up was to check permissions problem. Not having read permissions on the file would of been an easy one to fix, but again, this was not the cause of the problem.

At this point you might be asking yourself, how come the file exists, you have permission to read it, but yet, you can’t…

Well, the actual problem was that his OS was set up such that the maxfiles was set to 256 and PHPUnit had already reached that amount of open files.

To check if you have the same problem, try running phpunit using sudo dtruss -f -t open phpunit (Linux users will want to use strace -e open phpunit). In your output, you should see the files being opened. At some point, you’ll find Err#24, which indicates “To many file descriptors opened”. If you have this problem, then the following should help you fix it.

The solution to this problem is quite easy. What you’ll want to do is increase the maximum number of descriptors that can be used by a process. You can do it temporarily with ulimit -S -n 1024 (to use 1024 instead of 256). Another way is to edit it and keep those settings (until you change them again) is to use launchctl limit maxfiles 1024 unlimited.


PHPUnit not outputting coverage-html

I’ve been using PHPUnit recently to test a Kohana application I’m developing as my last semester project for my bachelor’s degree.

At some point during the development, code coverage generation decided to stop working on my desktop (my remote CI still had no problem).

I started diagnosing the problem, being on Windows, I thought it could be due to the “poor job” I had done on installing php, pear and phpunit. I didn’t want to go through the trouble or reinstalling everything though and just did the minimum: uninstall and reinstall phpunit. No success at that point.

I decided to go back a week or two in my SVN revisions, have it generate code coverage and get to the point were code coverage generation would fail. Took around 2 SVN “update to” to get to that point. After that, I tried updating the tests, but the new tests were using new features. So I updated the code first, then started updating the test files one by one. After a couple of files, I hit an interesting message:

ErrorException [ 1 ]: Allowed memory size of 134217728 bytes exhausted (tried to allocate 543278 bytes) ~ C:\php\pear\Text\Template.php [ 134 ]

I never had that message show up before, which is kind of strange. I would have expected PHP to tell me that same message everytime it tried to generate the documentation but couldn’t…

So, quick fix was for me to edit my php.ini so that the memory_limit = 256M instead of 128M.


Serializing "anything" in C# using extensions

I was recently interested in getting C# objects to serialize into XML so that I could save and load a configuration out of a file. Sadly, C# support for XML and serialization is far from the best stuff I’ve seen in programming. But anyway, here’s what this post is about: using DataContract with a bit of extension magic to get anything to be serializable into XML!

One small problem when you use the Serializable attribute of C# is that you cannot serialize dictionary directly and we all know dictionaries are a VERY useful structure to have serialized. One easy way to have serializable dictionaries is to use the DataContract attribute instead. It implies a bit more code compared to the version where you use the Serializable attribute, but not that much more (mostly the WriteObject and ReadObject lines).

I haven’t coded any of this, so thanks to user Loudenvier from Stackoverflow.com! This solution allows you to turn ANY object into an XML string representation. It also allows you to turn that string back into an object representation. Very useful.


public static class SerializationExtensions
{
    public static string Serialize<T>(this T obj)
    {
        var serializer = new DataContractSerializer(obj.GetType());
        using (var writer = new StringWriter())
        using (var stm = new XmlTextWriter(writer))
        {
            serializer.WriteObject(stm, obj);
            return writer.ToString();
        }
    }
    public static T Deserialize<T>(this string serialized)
    {
        var serializer = new DataContractSerializer(typeof(T));
        using (var reader = new StringReader(serialized))
        using (var stm = new XmlTextReader(reader))
        {
            return (T)serializer.ReadObject(stm);
        }
    }
}

How to use example


// dictionary to serialize to string
Dictionary<string, object> myDict = new Dictionary<string, object>();
// add items to the dictionary...
myDict.Add(...);
// serialization is straight-forward
string serialized = myDict.Serialize();
...
// deserialization is just as simple
Dictionary<string, object> myDictCopy = serialized.Deserialize<Dictionary<string,object>>();

Source: http://www.stackoverflow.com


Enginuity series on GameDev.net

I’ve just stumbled upon a series of articles from Richard Fine that were written in 2003 which describes the basics of a game engine he calls Enginuity. It lays the foundations to basic memory management, logging, kernel and tasks management and much more. An extremely interesting read. Sadly, you can read in the articles that this was projected to be a series of more than 8 articles, but it seems it stopped at the fifth article. If anyone knows where to find the rest (if it exists), I’d be grateful!

On GameDev.net: Part 1 Part 2 Part 3 Part 4 Part 5


Software developer

A man is flying in a hot air balloon and realizes he is lost. He reduces height and spots a man down below. He lowers the balloon further and shouts: “Excuse me, can you tell me where I am?”

The man below says: “Yes you’re in a hot air balloon, hovering 30 feet above this field.”

“You must be a software developer,” says the balloonist.

“I am,” replies the man. “How did you know?”

“Well,” says the balloonist, “everything you have told me is technically correct, but it’s of no use to anyone.”

The man below says, “You must work in business as a manager.” “I do,” replies the balloonist, “but how did you know?”

“Well,” says the man, “you don’t know where you are or where you are going, but you expect me to be able to help. You’re in the same position you were before we met but now it’s my fault.”

Source: Coding Horror


Software developer

A man is flying in a hot air balloon and realizes he is lost. He reduces height and spots a man down below. He lowers the balloon further and shouts: “Excuse me, can you tell me where I am?”

The man below says: “Yes you’re in a hot air balloon, hovering 30 feet above this field.”

“You must be a software developer,” says the balloonist.

“I am,” replies the man. “How did you know?”

“Well,” says the balloonist, “everything you have told me is technically correct, but it’s of no use to anyone.”

The man below says, “You must work in business as a manager.” “I do,” replies the balloonist, “but how did you know?”

“Well,” says the man, “you don’t know where you are or where you are going, but you expect me to be able to help. You’re in the same position you were before we met but now it’s my fault.”

Source: Coding Horror


Shared network computers not showing up in Leopard

Since I’ve upgraded to Leopard, I couldn’t connect to my Windows network anymore. Browsing through various websites looking for answers, I tried pretty much all of them with no success. Not until I found this page. Is explanation is pretty simple and indeed makes my shared network show up once again!

Here’s the explanation and instructions on how to fix it:

You have plenty of suggestions for fixing the Leopard Windows sharing issue, that I see are all a bit hit or miss. I think the reason for this is because a lot of the things people are trying are fixing the real root issue by accident.

The Leopard advanced network settings has a WINS tab, and in this there is a NETBIOS name field. This is auto-generated by Leopard - it looks like it uses the MAC address to generate it. However, if what is put in there is not compliant with the NETBIOS settings of the Windows network you are connected to, then browsing will not work, because the WINS server will not acknowledge the WINS requests coming from Leopard.

The actual NETBIOS name requirements supported vary depending on the flavour of OS running on the WINS servers on the network. I would suspect the best route to success is to use the most basic NETBIOS name requirements, back from the old Windows NT 4.0 days - stick in no more than an 8-character alphanumeric into the NETBIOS field, and all Windows browsing will be restored.

I had two Leopard machines, one which would browse and one which would not. The browsing one had an 8-character WINS setting, and the non- browsing one had a MAC address in the WINS field. Removing the MAC address and putting in a simple word in the WINS field IMMEDIATELY reinstated browsing.