Why Programmers Should Buy Mechanical Keyboards

Five years ago I bought my first mechanical keyboard. I was using a generic low end Logitech keyboard for a while. One day, one of the feet broke. A couple days later some of the keys stopped working. Given that I type a lot, I also noticed that some keys felt a bit worn or “flat” when pressed as compared to the others. It was time to invest in a good keyboard. I ended up getting a Corsair K90 mechanical keyboard without knowing much about what I was getting into.

Fast forward to the present and I can’t stand typing on normal membrane keyboards. The best way I can describe using a normal keyboard is by imaging yourself running in ankle deep mud. You’re trying to get to somewhere fast, but the ground is just slowing you down. It’s frustrating, kills motivation and makes you wish you were doing something else after a while. 

That also goes for those overpriced Apple keyboards as well – they’re still membrane.

What is a Mechanical Keyboard?

Simply put, a mechanical keyboard uses individual switches for each key rather than a rubber membrane dome layer on top of a circuit board. There are a variety switches available on the market for modern mechanical keyboards, with the most popular produced by Cherry. Different types of switches offer a different tactile feedback for the user. Some switches are linear – which means there is no resistance when the key is pressed. Others offer a tactile bump or click when pressed. This gives the user a form of sensory feedback when he is typing. Types of switches are usually graded by color, with some popular ones being Cherry MX Blues, Reds, and Browns. We will get into the difference between these in a bit.

So why are Mechanical Keyboards a great investment?

Programmers, Software Developers, IT professionals all spend a lot of time behind a computer. The amount of actual typing time may vary by profession, industry and position. Personally, I can estimate anywhere from 2-4 hours of hand-to-keyboard contact per day. This includes everything from coding, writing emails, chatting with my team on Slack, writing documents, and searching the web. On average this is about 60 to 80 hours per month that your hands are pressing buttons.

Taking this into consideration, wouldn’t it be best to ensure comfortable and efficient typing? As a writer would invest in a great pen, or an artist would invest in a good set of oil paints, why not invest in a great keyboard? As far fetched as it may seem, typing on a nice mechanical keyboard can be motivational.

Advantages of a Mechanical Keyboard

It just feels really good to type on

That clicky and satisfyingly tactile feel just cannot be felt on normal membrane keyboards. It makes typing fun and addictive. There’s something oddly fantastic about hitting a key that is purely mechanical and simultaneously hearing and feeling the mechanism working together.

Mechanical keyboards last longer

While there’s a lot more moving components involved, quality mechanical keyboards with great build quality and reputable switches can last a lifetime when properly maintained. Switches made by Cherry are guaranteed to be fine for 50 million keystrokes. There really is no comparison to a thin film of formed rubber over a circuit board. 

Customization!

After getting into mechanical keyboards, I discovered an entire community and market of keycaps. Mechanical keyboards allows replacing the keycap with aftermarket sets. These come in a variety of colors and designs. Keycaps are usually molded in different choice of plastics, each offering a different feel. Additionally, keycaps come in different profile shapes. There are even kits available to build your own mechanical keyboard.

Custom keycaps on my Cooler Master Rapid Fire I

Different Layouts

QWERTY is the most popular layout everyone uses. When Christopher Sholes invented the typewriter in 1868, legend has it that he designed the QWERTY layout to slow down typists. This was to prevent his machine from jamming.

There are other keyboard layouts that are designed for typing and not for the mechanisms of a typewriter. A mechanical keyboard allows you to try different layouts as you can easily swap around the keycaps, or by having blank keycaps. There are a lot of keyboard layouts available with various studies done on the effect they have on typing speed. 

Image Source: Google Images

Interest factor

It’s nice to demonstrate a mechanical keyboard to people and see their reactions. I also like seeing the eye opening look on someone’s face when they type on a mechanical keyboard for the first time.

Disadvantages of a Mechanical Keyboard

As with anything there are certainly some disadvantages. I can think up the following that may stop someone from getting a mechanical keyboard.

Cost

A good mechanical keyboard is a solid investment that may cost a lot more than a regular run of the mill membrane keyboard. While cost is certainly a consideration, durability should be as well. A mechanical keyboard with solid build quality and Cherry MX switches (guaranteed 50 million typing strokes) should outlast a couple low end membrane keyboards. With that in mind, a mechanical keyboard can be considered an investment that pays off. 

Weight

Lets face it. Mechanical keyboards are heavy. Good ones weigh 2 pounds. Most mechanical keyboards contain a metal plate beneath the switches, with a fairly good durable outer casing. In this regard, weight is co-related to durability and may not be such a bad thing. A good hefty mechanical keyboard feels premium to me. 

Noise

This is subjective and can depend on the type of switch on the keyboard. I’m currently using one with Cherry MX Browns at work and no one is complaining. My Cherry MX Blue keyboard, however, is another kettle of fish. Because blues are both tactile and clicky, it will be heard across the room in an office.

Bluetooth

While they exist, Bluetooth enabled mechanical keyboards are rare. Why is this? My reasoning is that mechanical keyboards are already a very niche market. Bluetooth mechanical keyboards will be a niche market within a niche market – something with companies may not care about pursuing.

Wait, which type of switch should I choose?

Cherry MX switches are graded by color. Similarly, other brands of switches such as Gateron and Outemu follow this same color grading scheme.  A clicky tactile Cherry MX Blue for example, is comparable to a Gateron Blue or an Outemu Blue. 

In 2016, Go Mechanical Keyboard conducted a mechanical keyboard survey with roughly 1000 respondents. From this, Cherry MX Blue switches are preferred for typing purposes, while Cherry MX Browns are great for all purpose use. Both Cherry MX Reds and Browns are also the best choice when it comes to gaming. Personally owning three mechanical keyboards with Reds, Blues and Browns, its not hard to see why linear switches are good for gaming. Their smooth, bump-less feel offers the fastest response during intensive gaming. While I tend to make more typos when using Red switches, typing on Blues is quite the treat. 

Interested in buying a new mechanical keyboard? The iKBC CD108 is a cheap solid choice with great build quality and original Cherry MX switches. Go read my review on it here.

 

Let’s take a look at the iKBC CD108 Mechanical Keyboard

When I saw a full sized keyboard that came with Cherry MX switches, and PBT keycaps all for 59.99, I just had to buy it. This is the cheapest keyboard that I can find which includes original Cherry MX switches. The minimalist look coupled with the included keycap options makes this a great choice for someone who just needs to get work done. This is the keyboard you can take to the office without getting strange looks.

Admittedly, I was a bit worried as there are not much reviews on the iKBC CD108. 

After doing some research, the iKBC brand seems to be sub of the Vortex brand and is well regarded in the mechanical keyboards subreddit page. Their Poker and Poker II keyboards are flagship models with mostly positive reviews. General comments regard iKBC as having decent build quality and offering solid products.

Build and Quality

The outer case is made of a matte durable plastic. It is slightly rough to the touch which matches the feel of the PBT keycaps. The flip out feet are very sturdy with ample amounts of rubber. The entire keyboard weighs about 3-4 pounds and cannot be moved around much when resting on a table. Overall, it has a solid and durable feel and should last a long time with good care.

The PBT Keycaps are a night and day difference when compared to the regular stock ABS keycaps on my Cooler Master Rapid Fire and my Corsair K90. It has a subtle textured feel that is simply addictive to type on.

The included coloured special keycaps feels a noticeably smoother than the normal ones. Both are of the same thickness, but it suggests that a different plastic was used for the coloured keycaps. Granted they still feel better on the fingers than the stock ABS in my other keyboards. There are some minor imperfections on keycaps as seen below which won’t cause any functional issues. 

These minor imperfections does not affect usage in any way, and cannot be seen.

When the space bar key was removed, some glue can be seen holding the stabilizers in place. Although this seems due to the lower budget, it feels sturdy enough and should not be an issue.

Features

The keyboard is minimalistic in terms of features. Above the number pad there are designated keys for mute, volume down, volume up, and calculator. LED lights indicate num lock, caps lock and scroll lock.

You can also lock the Windows key using the Function Button + Windows Key.

Pros

  • The price. This is one of the cheapest keyboards on the market with Cherry MX switches.
    Also consider that the cost of a third party PBT keycap set is around $30 to $60. 
  • Solid build quality. You can throw this thing and it would probably be fine.
  • Original Cherry MX switches in a variety of choices (Red, Brown, Blue, Black, Clear). These switches are made in Germany by the Cherry company and are guaranteed for more than 50 million keystrokes per switch.
    You can learn more about Cherry MX Switches here.
  • All keys are PBT keycaps. This makes this a no-brainer deal. 
  • Includes separate keycaps for modifying the aesthetics of the keyboard.
  • Includes a keycap puller.
  • The printed lettering are basic, clean and looks professional. Here, it separates itself from other gamer oriented keyboards with the common futuristic fonts.
  • Simplicity. The keyboard is as basic as you can get, and this does look really good.

The following are some of the cons of this keyboard. Keep in mind that this is a 59.99 keyboard. As a result, I would say that these cons are negligible.

Cons (but not really) 

  • The keyboard is not backlit. This may not be a con, and if it is, iKBC has a backlit version of this keyboard for about $10 more. Personally, I think this version is better as it has a more professional look and feel.
  • The USB cord is not detachable. This is not a major issue as  the cord is long enough for most use cases and is of decent quality.
  • There is some glue around the stabilizer switches which seems to be a bit questionable. Rest assured as I have been whacking at this thing for a while now and have not seen any problems. All keys feel solid and not in any way wobbly.

Cherry MX Blue switch version

Bottom Line

This keyboard is great if you type a lot for work. For the cost of a Corsair keyboard, you can have a clicky Cherry MX Blue version at home, and a more subtle Cherry MX Brown version at the office. It is a solid, no frills mechanical keyboard with the reliability of Cherry switches. With the included keycaps, it looks clean, professional yet stands out from your regular office keyboard.

This keyboard just feels too good to type on. I have retired my Corsair K90 Mechanical Keyboard in preference of the iKBC CD108.

 

SSMS 2017 – How to Use The Hidden Dark Theme

I’ve always loved having dark themes and styling on any code editor or IDE when I’m doing development work. It just makes it so much easier on my eyes for some reason. I feel less tired and can do more work without getting eye aches or headaches. The discussion of Dark Themes vs Light Themes among developers is never ending. There’s always new and interesting arguments for each, such as being able to interpret light text on a dark background as symbols. It is also natural to think that black text on a white screen is easier on the eyes simply because this is what we are used to from physical print material like books and newspapers. The thing is, these materials aren’t lit like the white background on your monitor screen. All this is further impacted by monitor position and the lighting in the room itself.

Every time I need to use SQL Server Management Studio, I always hate the colour scheme and the lack of theme or skin capabilities. I always wished it looked a more like the recent iterations of Visual Studio (2013, 2015, 2017).

Thankfully, a dark theme option is currently under development by Microsoft. While it can be turned on with a simple edit, it should be noted that there could be unexpected behaviour (and even colouring) as its still being developed.

You can download SQL Server Management Studio from here.

After installation, open a file editor as Administrator (Notepad, Notepad++).

Next, open the following file:

C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\ssms.pkgundef

In here, comment off the following line:

// Remove Dark theme
// [$RootKey$\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}]
[$RootKey$\AD7Metrics\PortSupplier\{4103F338-2255-40C0-ACF5-7380E2BEA13D}]
[$RootKey$\External Tools\Error Loo&kup]
[$RootKey$\LightSwitch]
[$RootKey$\Debugger\LaunchHooks110]
[$RootKey$\DiagnosticsHub]
[$RootKey$\FeatureFlags]
[$RootKey$\VB Editor]
[$RootKey$\Languages\CodeExpansions\C/C++]
[$RootKey$\Languages\CodeExpansions\JavaScript]
[$RootKey$\Text Editor\C/C++]
[$RootKey$\Text Editor\CSharp]
[$RootKey$\Text Editor\Disassembly]
[$RootKey$\Text Editor\ENC]
[$RootKey$\Text Editor\JavaScript]
[$RootKey$\Text Editor\Memory]
[$RootKey$\Text Editor\Register]
[$RootKey$\Text Editor\ResJSON]
[$RootKey$\Text Editor\TypeScript]
[$RootKey$\Text Editor\VBScript]

Finally, start SSMS, and go to Tools > Options > Environment > General. The dark theme should be available for selection in the Color theme option.

So much better on the eyes!

How to finish a thesis when you’re strapped for time

TL;DR: Writing a thesis when you don’t really have a lot of time is quite the challenge. With the right strategy it can be a breeze. Simply talk to your supervisor more often, keep a personal log on hand, skim and tabulate sources, and finally, get a few proofreaders. 

Doing a thesis is a daunting task. Especially if you’re working full time and have to deal with commute traffic. It’s the final boss battle in graduating, but it’s packing a punch. You’re getting beat left and right, and can’t seem to get in a hit. It’s reflecting all your moves and you’re low on HP. You’re running out of potions and this is a solo battle. You have no party members to tank this thing and it just won’t die. You’re flipping through your inventory to see if you have any rare item left to use on it – it’s the end of the game anyway, might as well use all your special items. Sad thing is you have none left. You wasted all of that in the last two courses because you decided to skip a few classes. Suddenly, it raises its ugly tangled many headed form and comes at you …

The good thing is it’s not as hard as you think. It’s quite a journey and you get to level up and even see some cool places if you get a paper published. I completed my MSc last year at the University of the West Indies in Computer Science and had quite a blast doing so. I even got to travel to Vienna, Austria to present a paper that I got published. So how can you finish?

 

Talk to your supervisor often

Some of my friends have been doing their thesis and would leave talking to their supervisor until they have completed a significant amount of work. I believe this can cause a person to lose focus in the thesis or sometimes even go off in another direction or area that was not initially part of the plan. When I wrote my thesis, having weekly meetings really helped push me to complete a significant amount of work in the week before our next meeting. Even if I didn’t have much work to talk about during our weekly meetings, we brainstormed, discussed ideas, and even talked about past work.

While this may not work for all cases, I think that having a 20-30 minute meeting every week on average helps in many ways. Setting a dedicated day and time for this also sharpens your focus and sets the goal for the week. The feeling of accomplishing your own weekly quota of work and finally presenting it is great!

 

Keep a personal log

Writing some weekly notes is a great way to tracking your progress. This also helps with the communication between you and your supervisor. Many times, my weekly update emails to my supervisor came directly from these logs. For logging, you can use anything you like. I opted for a Google doc. Here I simply listed the date, as well as anything that I investigated, worked on, or completed. I also pasted any interesting articles or videos, as well as any ideas, that I wanted to come back to later. I also noted any questions that I may have.

Sometimes when you’re stuck writing, reading over your log entries can help with motivation. You get to see how far you came and everything you did.

Each log entry usually was divided into:

  • Updates or work done
  • New ideas
  • Next steps
  • Interesting stuff
  • Questions and issues

Skim academic papers

If you work full time, then you’re usually spending about 8 hours a day at work, with an additional 1-3 hours commute depending on your job. This really eats away from your thesis time. What about if you’re not working, or you took vacation to do the thesis? Well then you’re lucky and should use all the time you have!

Most academic research papers have an average length of 3-6 pages. With limited time, you can’t afford to read an entire paper in detail before realising that you probably won’t mention it in your thesis. When reading, try just skimming the abstract, introduction and conclusion sections of the research paper. After this, you can make a decision about the paper – If it’s relevant, read it further and start making notes (see the tip below). If it has nothing to do with your research, then you can drop it and move on to the rest of the research you have waiting.

I usually did my skim reading during breakfast or lunch and sorted the papers into sections, depending on my research needs. Later, I would come back and expand any notes that I made on each relevant paper. For reading and managing academic research papers, I used Mendeley. This cross platform tool helped keep my research and notes synced across all devices.

 

Tabularize your literature

If you don’t keep organized, your work can become a big ugly tangle of notes, snippets, writings, and data. Eventually you’ll have to sift through all the rubble so that information can be extracted to formalize your thesis. To keep all my research notes and sources organized, I again opted for a simple Google Doc word document. I formatted it to be in landscape mode, with a custom (long) width. I then created a table and entered data on each research paper that I read. Usually, I would have the document open while reading so that I can note stuff on the fly.

The following is an excerpt of the research sources document that I used during writing my thesis.

 

I utilized different colors and formatting so that anything important can stand out at a glance. This helped immensely to keep tracking of everything. Want to know the best part? When you’re ready to write the literature review, all you need is this table!

Everything is neatly laid out for you to compare, and contrast research sources for the literature review as well as the discussion. When writing the literature review, I usually stated facts from the Points of Interests column. I mentioned any open areas or new areas of research as I noted in the What is missing from this paper? What does not make sense? column. Furthermore, I also commented on ways my research / idea was different as noted in the What makes my project different column.

 

Get people to proof read your drafts

Ok so you’re almost finished writing. You’re excited. You can’t wait to have this submitted so you can leave your cave and get back to life. You printed some of your writing to read to yourself. You end up taking some of it to work where you sit with a grin reading it. Suddenly, someone comes by, picks it up, reads it, and asks why you mentioned that word so many times in one paragraph. You blink. How could you miss that? Why would you even use the same word over and over like that! The words all stand out now, staring at you…

Proof readers help a lot. They read and find things that you cannot see. During your thesis writing, you’re working so close with the material that sometimes you just can’t see the big picture. Sometimes things read fantastic, but in reality it may not be quite clear to a typical reader at all. This is where your proof readers come in. Try and get at least 3 proof readers to go over your stuff and leave comments. You can print out excerpts for them to read, or even send them the entire thesis to leave comments for you – just make sure and thank each and every one after! Proof readers really are golden. They help shape your thesis into something phenomenal.

 

 

Game Programming using Python & Pyglet – Part 1

TL;DR: Python is a great programming language that shines in readability and conciseness. It can be interesting to build a video game in Python. This is the first part of a tutorial series in game programming in Python. We will be setting up Python, Pyglet and PyCharm, as well as creating a very simple Pyglet application.  

Python is a great programming language. It’s a fantastic starting point for beginner programmers, as well as a great tool for experienced developers. What initially drew me to Python was its concise readability. The fact that Python penalizes you for not intending your code properly appeases my neat code obsession. After using Python for a while, I wondered why there weren’t much popular game or graphics programming being done in it. Perhaps the most popular graphics and game programming library for Python seems to be the aging PyGame. Next, there’s a library called Kivy which is geared towards UI related development. Finally, I stumbled across a lesser known library called Pyglet. According to forums and postings, Pyglet is “more pythonic” than the old PyGame, but is definitely lacking in exposure.

So why try building a game in Python? After doing some Google Trends searches, it’s clear that Python is overshadowed by other game libraries and frameworks – notably the elephant in the room – Unity.

So why Python and Pyglet? Well this is my blog and I am the overlord. Also I like Python and building a game (a simple 2D shooter perhaps) will be tons of fun and can lead into some further exploration of a decent language. Be warned though: this is my first tutorial series. Things may change, and be updated as I go along, but I will try to continue by posting each part.

Let’s Start

For this tutorial we will be making a simple application that consists of a window with some balls bouncing around. Nothing fancy. If you click on the screen, a ball will be added with a random speed at the location of the mouse.

First of all you would need to have Python installed on your computer. I will be using Python 3. It should not matter if you’re using Python 2 or 3 – there may be some slight syntax changes here and there.

 

Installing Python on Windows

Download and install the latest Python 3 from here:

https://www.python.org/downloads/

I installed Python to C:\Python3 for easy access. Next you will need to add the following paths to your Environment variables.

C:\Python3;C:\Python3\Scripts

Finally, you can test by opening a command prompt window and trying the following:

python –version

The version of Python you installed will be outputted. Also, while we’re at it, we can test pip:

pip –version

What is pip?
Pip is a command tool for installing and managing Python packages. 

Using pip, we can install Pyglet with the following command:

pip install pyglet

 

The IDE I will be using is PyCharm Community edition. This is probably the best thing to write Python code in at the moment. Download PyCharm here:

https://www.jetbrains.com/pycharm/download/

New Project

Start by creating a new project in PyCharm. I called mine PygletGame (this can change to something more exciting sounding when we get some stuff happening in our game). For now, I created the following directories in the project explorer. This can be done by right clicking on the main directory in the explorer panel on the left, and then selecting New  > Directory.

Assets will hold our images and animations, entities will have our game objects, and system will contain any core code. You will notice that in each directory I also created an __init__.py file. These Python files do not contain any code in them for now.

What is __init__.py? 
These files are usually used to mark directories on the disk as Python package directories. It allows for importing Python files and libraries from these directories. 

 

Small Start

So for our first tutorial, we will be doing something really simple. Just a screen with some bouncing balls.

Let’s get lay down some design.

There. We’ll have a base component object. Anything in the game could be a component. Our Ball class inherits Component. We also have a main file that will have a list of Ball objects. For now, don’t think much of the design. Let’s just get something going on the screen. We can revisit the design in later parts. You can create a component.py file in our system directory, a ball.py file in our entities directory, and the main.py file in our root directory. Additionally, create a config.py file in our root directory. This will be used to store any configurations we need like screen width and height.

Following this, I’m just gonna drop the rest of the code and explain each class in detail. Btw, you can view all completed code here:

https://github.com/keshavbahadoor/PygletGame

let’s have a look at our Component class.

In Python, we need to import the abc module so that we can create an abstract class. This allows a class that can be derived from, but cannot be instantiated. This means that in our game we cannot create a Component object. However, we can create a derived component, such as a Ball or a Player.

Our Component class is currently just a holder of variables that describes an object in the game – its x and y position, its width and height, and if the object is active or not. We also have two abstract methods, update_self, and draw_self. Objects in the game will use these for updating logic (position, calculations, etc.) and to render any representational graphics.

What is **kwargs? 
In Python, kwargs is used to allow the passing of any amount of arguments to a function. Think of it as a dictionary structure that you’re adding to via the method or function call. We can then retrieve values from kwargs using their keys or keywords. Hence the name kwargs, or keyword arguments. 

What’s that @ thing?
You may have noticed that these methods contain strange looking ‘@’ symbols on top of them. These are called Python decorators. They allow stuff to dynamically alter the functionality of a function, method or class. In this case, the abc module will dynamically alter the update_self and draw_self methods to be abstract methods.

Pyglet Coordinate System 

In Pyglet, on screen coordinates of the x axis increase going from left to right, while y axis increase going from the bottom to the top. This also applies to any object such as images or sprites in the game. The bottom left of the image will be the zero point.

Moving on, let’s have a look at our Ball class.

As we can see, our Ball class extends our Component class. Our constructor calls super, which is our parent Component class. We then define some other instance variables that our Ball objects will need. Pyglet contains functions and helpers for loading images, as well as creating and using sprite objects.

For this sample, I simply googled a ball image and used a random one that I found. You can get the same one I used from the github repository. Note that the slashes in the path ‘assets\\ball.png’ may change if you’re using Linux. I haven’t tested this on Linux. (If you’re using Linux, please comment and let me know! ).

To create the sprite object, we pass the image object as well as the x and y coordinates of the containing Ball object.

We would like our Ball to move around the screen. It should change direction if it hits any edge of the screen so that it continues to move within our view. To have the ball behave like this, we can update the coordinate position of the sprite instance.

In the code segment above, we simply add the speed value to our Ball x and y position coordinates. Our x_direction and y_direction values should only be a positive or negative 1. For example, changing x_direction from a 1 to -1 results in the speed value being subtracted rather than added, hence changing the direction of the object. Finally, we update our sprite instance using set_position(..).

After this, we can calculate when to change the direction of the ball below.

Generally, these statements say the following.

  • If the ball’s x coordinate is less than 0 (the left edge of the screen), then we invert x_direction.
  • If the rightmost x coordinate of the ball is greater than the width of the screen, then we invert x_direction.
  • If the ball’s y coordinate is less than 0 (the bottom edge of the screen), then we invert y_direction.
  • If the uppermost y coordinate of the ball is greater than the height of the screen, then we invert y_direction.

We need use the ball’s width to check that the right edge of the ball has passed the right screen edge. Similarly, we need to use the ball’s height to check that the top edge of the ball has passed the top screen edge. If we did not do this, our ball will seem to pass out of our screen before changing direction.

One more thing to note is that we import our config file with our window width and height settings. The following is the contents of the config file:

Finally – and we’re nearly there – let’s have a look at our main.py class.

Right. It looks like a lot is happening here. This file basically a script and not a class. Let’s break it down.

Pyglet lets us create a window object. This gives us a handle to our screen where we can draw things to. We pass our predefined window width and height to the constructor of the window object.

In our first app, we would want a few balls moving around the screen. For this, we have a list to hold any instantiated Ball objects.

Each of these ball objects would need to be drawn to the screen, and updated. This is handled in the draw() and update(…) functions. Both functions iterate through the ball_objects list and call the appropriate functions. We use the isinstance(…) function to check if the current object in the list is a subclass of Component.

Pyglet exposes mouse events, such as press, release, drag, etc.  We can use this for letting our application know when and where to create a new Ball object.

The on_mouse_press(…) function utilizes Pyglet window.event decorator to enable this. When the mouse is clicked on screen, we simply append our ball_objects list with a new Ball object. When creating the new Ball object, we specify the x and y coordinates of the mouse click, as well as a random integer for speed. Having each Ball object move at a randomized speed makes our application more interesting.

main.py contains a main() function. This contains an inner function that is decorated with Pyglet’s window.event. The on_draw() function is called each time the window needs to be redrawn. This is where any rendering to the screen should be done in Pyglet. For this, we simply call our draw() function discussed earlier.

Next, we use Pyglet to set a scheduled interval and pass our update() function.  We also define how often we should update. In this case, our update() method will be called every 1/120 seconds.

Finally, the last command runs our Pyglet application.

If you have been following you should have a blank screen. We can add a Ball by clicking anywhere inside the screen. The ball will move and appear to bounce around the window.

We’ll stop here for now. You can try adding a background Component. Let’s say we want a space scene for our balls. In our next tutorial, we will deal with input and movement, and hopefully have something that resembles more of a game. This is my first tutorial, and I have some pretty cool stuff planned ahead. Feel free to leave any comments 😀

Cryorig R1 Ultimate Review

What’s the point of having a decent desktop computer rig without any aesthetic value? Yes, looks are almost as important these days for most enthusiasts. I mean, who doesn’t love sparkly and shiny things? This is half the reason I opted to upgrade my entry level (yet perfectly fine) Cooler Master Hyper 212 Evo CPU Cooler. The other half was because during code compilations, my CPU was spiking around 60-65 degrees celsius in temperature. In comes the Cryorig R1 Ultimate dual tower CPU cooler. And with a name that includes “Ultimate”, you bet your dollar that she’s gonna be mind blowing – both in look and performance!

Disclaimer: This review focuses more on aesthetic value, and less so on performance. While there was a definite drop in degrees when compared to the Cooler Master Hyper 212 Evo, I did not do full scientific measurements and testing. These measured guides can be found on the usual popular benchmark reviews and comparison websites. I’ll link a few at the end of this article.


So just some brief background on my current rig. Being a software developer by day, I only had modest requirements when it came to running video games. This includes a i7 4790K processor, on a Gigabyte Gaming 5 motherboard, with a Gigabyte WindForce GTX 960. For me, a GTX980 was a bit overkill for my heavy coding and YouTubing yet light gaming needs. Bear in mind that this PC build was completed before Nvidia launched their GeForce 10 series, which included the bang for your buck GTX 1070. All of this was beautifully encased by the renowned Phanteks Enthoo Pro full tower case.

While not a bad cooler, the Cooler Master Hyper 212 Evo was the initial choice for me. It performed pretty decently, although I did see some occasional temperature spikes (especially during Android Studio gradle builds). It also looked pretty boring with a lot of empty space around it in the fully windowed side panel of the Enthoo Pro. I would always suggest a Hyper 212 Evo to any person who is looking to cut cost, and would like to upgrade from the stock cooler that comes packaged with your CPU. 

After spending weeks reading reviews, forums and Reddit posts, I decided on two things. One, water cooling wasn’t my cup of tea. Two, I wanted something with great performance as the Noctua NH-D15 that will match the black and white color scheme I was going for. The main problem I had with water cooling is that you had to go way up in price to find something that is dead silent which can out-perform the NH-D15. When I came across the very underrated Cryorig R1 Ultimate, I knew I found exactly what I was looking for.

The Cryorig R1 Ultimate is huge. And it weighs a lot. About 2 pounds to be exact. Here is a picture of it next to a 500ml bottle of water.

 

And here is a picture of me holding it.

 

I was a bit worried about the stress impact of such a heavy CPU cooler on my motherboard. After scouring through articles and forums, it seems that heavy CPU coolers are designed in such a way to support itself without putting much stress on the motherboard. This is due to the well designed backplate that you secure at the back of the motherboard prior installation of the heatsink.

Installation was a breeze. The included instructions was clear and the included screwdriver tool was easy to use. After installing the backplate, heatsink and then clipping the gracefully designed fans into place, it was all set.

Here’s some pictures of the completed look.

It really does fit in well with the color scheme of the other components and the case. The black and grey futuristic industrial look makes the build a pleasure to look at. The size is also more appropriate in proportions for the full tower Enthoo Pro as compared to the smaller Hyper 212 Evo.  

 

Performance

The Cooler Master Hyper 212 EVO had my CPU idling at an average of 34 degrees celsius. After upgrading to the Cryorig R1 Ultimate, the average idle temperature dropped to 29 degrees celsius. I also noticed much less temperature spikes for any CPU heavy tasks. It was also noticeably quieter than the Hyper 212 Evo. Having not done any scientific testing myself, here are some good articles and benchmarks: 

http://www.legitreviews.com/cryorig-r1-ultimate-cpu-cooler-review_176339/5

https://www.techpowerup.com/reviews/CRYORIG/R1_Universal/6.html

https://benchmarkreviews.com/27660/cryorig-r1-ultimate-cpu-cooler-heatsink-review/6/

http://www.tomshardware.com/reviews/cryorig-r1-ultimate-twin-140mm-tower-cpu-cooler,4867-2.html