Archive for June, 2015

Python 3 Quick Code: Get a Random Item from a List with an Even Chance of Being Chosen

📅 June 12, 2015
py001In Python 3, suppose we want to get a random item from a list that contains duplicates, but we do not want to favor the duplicates.

For example, if there are 3 duplicate items in a list of 10, then there is a 3x probability of obtaining that particular item compared to a single occurrence of that item in the list.

The idea is that by eliminating the duplicates, all items should have an equal chance of being chosen. Here is one strategy to achieve this using a set.

Read the rest of this entry »

Advertisements

,

Leave a comment

The Silicon Power S60 120G SSD and Linux

📅 June 4, 2015
s60-02Solid state drives (SSDs)! Yes!

They are fantastic devices that yield impressive computing speed boosts concerning hard drive access. I found myself in need of an SSD and decided to try something new: The Silicon Power S60 120G SSD.

Samsung SSD drives are perhaps the best I have ever used, but in the past, I have been happy with the durability and reliability of the Silicon Power A80 external drive. So, when I saw that the company also produced a line of SSD drives, I had to try one. Given the stellar reviews and low cost of this drive, it was a must-have.

The drive the S60 was replacing was an older Samsung 470. Now, there was nothing wrong with the Samsung. Time has proven its quality. In fact, I have used the Samsung 470 extensively for the past several years, and it continues to be reliable and speedy. However, the motherboard supports SATA3 but not the Samsung (it was close to a first generation SSD). So, it was time to upgrade to a SATA3 SSD.

The Samsung 470 was already fast, so how does the S60 compare? In my experience, it depended upon which operating system I used, and once again, Linux delivered superb performance without a hassle.

Read the rest of this entry »

, , ,

Leave a comment

Hide Files with .hidden

📅 June 3, 2015
hide3bDo you have files or directories that you wish to hide but do not want to rename as hidden dot files?

Here is a nifty trick that will hide all specified files and directories without the need to rename them.

All you do is create a hidden file named .hidden (with the dot) in the directory containing the files you wish to hide. When the file manager refreshes, the listed files will no longer appear.

Let’s see the details…

Read the rest of this entry »

, , ,

Leave a comment