Save brightness setting on reboot in Debian Squeeze / Wheezy

I recently installed Debian Wheezy (testing version of Debian 6) on my laptop. Most of the things went smoothly except for a few minor quirks. I eventually switched to XFCE desktop because I wasn’t too big a fan of the new Unity Gnome look.

XFCE was great for speed and it got everything I needed done really well. There was, however, one very annoying issue. Everytime I set my laptop brightness it was lost after a reboot. After reading up online and scouring forums, I finally found the location where the brightness setting is saved.

Location

/sys/class/backlight

There were multiple entries under this directory and changing one of them wasn’t enough for my case. Your case maybe different. To try out a setting before making it permanent, try the following command (as root)

echo 5 > /sys/class/backlight/acpi_video0/brightness

If the above command brings a change in your screen brightness, then you are on the right track. To save the brightness across reboots, we make a change to our /etc/rc.local file using the following commands as root –

cd /etc

gedit rc.local

Just above "exit" statement in the file, add the following lines –

echo 950 > /sys/class/backlight/intel_backlight/brightness

echo 5 > /sys/class/backlight/acpi_video0/brightness

echo 5 > /sys/class/backlight/acpi_video1/brightness

I added the above three lines as I had the entries acpi_video0, acpi_video1, and intel_backlight under my /sys/class/backlight folder. If you have different entries, then make appropriate substitutions above.

That’s it! Save the file and reboot. You should now have your brightness to the same level as you had left if before you rebooted.

.

Advertisements

Enabling the status bar / line number indicator for Notepad in Windows

Notepad is one of the most commonly used application in Windows. Recently I was doing some code reviews and since Notepad wasn’t showing me line numbers, I had to load up another bulky editor which was a real pain.

In order to enable line number indication and to enable the status bar in Notepad, we need to do some simple registry editing –

1. Start the registry editor (Start > Run, type regedit.exe and press enter)

2. Goto the HKEY_CURRENT_USER\Software\Microsoft\Notepad section

3. For the “StatusBar” key, change the REG_DWORD value to 1 (Double click, type “1”, Click OK)

Close the registry editor, and your Notepad should now be able to display the status bar along with the line/column count. Pretty cool.

Notepad - Status-bar enabled

If editing the registry seems like a scary proposition to you, click here to download a registry script. Run it by double clicking.

Related articles, courtesy of Zemanta:

Cameras and sensor sizes

I bought a 5D Mark II recently. While I love this camera (not just for its sentimental value), there are times when I wish I had something a little less bulkier to lug around. The image quality of a full frame sensor cannot be beat. I love the bokeh a FF sensor produces because of increased sensor size and shallower depth of field. Its the primary reason why I have such an expensive camera. It’s image quality is second to none. Well, we have medium format cameras but lets keep this discussion to the more “commonly” used formats.

In this article I wanted to talk about sensor sizes available today and how they affect image quality, bokeh etc. In the days of film we had 35mm sensors. Focal length was simple. 50mm meant 50mm (50mm is considered the nearest focal length to normal human vision). Then we went digital and we started having different sensor sizes for different types of cameras. The different categories (based on sensor sizes) are –

  1. Crop Cameras also known as APS-C (Crop factor 1.6x). Canon follows this and Nikon calls it their “DX” range.
  2. Micro 4/3rd format (Crop factor of 2x)
  3. Full frame (No crop factor. Same as 35mm). Nikon calls it their “FX” range
  4. Canon’s 1DX series like the 1DMarkIII (Crop factor 1.3x)
  5. Newer entrants like Nikon V1, J1 etc (Crop factor 2.7x)

So what do all these crop factors and sensor sizes mean? It means that a focal length will give a different field of view for each of these sensor sizes. 50mm on a Full Frame format camera such as the 5D Mark II or the Nikon D700 is roughly equivalent to 35mm on a crop sensor camera such as the Canon 7D or the Nikon D7000. Here is the same example with some calculations to make it easier

 

50mm, the magic focal length (multiply by crop factors)

Full Frame Camera = 50mm (50mm X 1 = 50mm)

Crop (APS-C / DX) = 35mm (35mm X 1.6 = 50mm)

Micro 4/3 = 25mm (25mm X 2 = 50mm)

and so on…

So how does all this numerical funk affect the end user? Should you be worrying about the sensor size? Before answering this, read the following information about the relation between sensor size and image quality –

 

Sensor Size is directly proportional to Image Quality

Although there are other factors involved, to keep things simple lets just go with the above statement. The reason behind this is straight. A larger sensor obviously means more light absorption. This in turn means better resolution and more information capture. If I have a larger bucket it is bound to hold more water. Another factor that inadvertently affects image noise in megapixels (resolution). If two sensors of the same size are rated at different megapixel values, the sensor with more megapixels will generate more noise. Advances in technology such as gapless microlenses defy this rule but it still is largely true. This rule is the reason why you should never opt for a higher resolution if you do not plan on using it.

 

More megapixels do not mean better pictures

Only go for higher megapixels if you want to heavily crop your image or if you want to print poster size prints. I can shoot better pictures with my old 6 megapixel Pentax K110D DSLR than most people with 15 megapixel digicams. 

Here is where the myth of megapixels becomes clear. It is a common notion that the higher the MP value of a camera, the better the “resolution” of the camera. The true resolution or resolving power of a camera is largely dependent not the lens that is used, not on how many pixels are crammed onto the sensor. The MP value of a camera is largely a marketing gimmick and is sadly still prevalent even today.

 

How to decide between Crop / Full Frame etc?

So just how does one decide what type of DSLR / Camera is suited for their need? There are many factors – money, type of photos, effect desired, end usage etc. From a financial point, Full Frame cameras are most expensive (as they are more expensive to manufacture). Full Frame cameras are best suited for portraits and landscape type of photography where depth of field and image quality are the deciding factors. APS-C or crop cameras are more suited for sports, birds etc. because of their 1.6 crop factor. A 250mm lens on a crop body will give an equivalent focal length of 400mm! The larger the focal length, the more expensive it is to manufacture a lens. This crop factor is very handy for sports, wildlife etc.

 

Portability

According to me, portability is one of the factors that influence the type of camera a person uses. What good is a $2000 camera which clicks images of the highest quality if it sits at home collecting dust? I know a lot of people who get onto the DSLR bandwagon as prices have dropped recently but do not end up making much use of their cameras.The number one excuse is that the DSLR is too bulky to carry around. Another excuse is its too complicated. By the time I have my settings ready, I’ve lost the image. Technological advances are begining to solve this problem though and we have the Micro 4/3rd format. The main idea behind the technology was getting the size of the camera down by (i) Getting rid of the mirror assembly (this is why they’re also called mirrorless cameras) and (ii) using a slightly smaller sensor than an APS-C DSLR. While the quality may not be as good as a regular DSLR, it is a whole lot better than most digicams which have tiny sensors.

 

If you’ve read this far, I hope this article gave you an idea about what sensor sizes mean and how they affect the ultimate images. All these technical details mean nothing if you aren’t out there shooting that image!

RLE (Run Length Encoding) to demonstrate basic compression + Implementation in C

File Compress Figure

I’ve been reading about basic compression techniques and RLE (Run Length Encoding) is as simple as it gets. I decided to write a whitepaper on the technique and also implement a working demo in C. Though RLE is not a great way to compress data, its an excellent start for anyone who wants to delve into compression schemes or just wants to understand the theory behind basic compression. If you want to use/modify the source code feel free just keep the original header intact. Click the link below to read the complete paper.

Click here to download the complete whitepaper in PDF format

CopyX v1.0 beta – File / Folder queue utility for Windows

CopyX User Interface

I’ve continued developing in .NET and C# and have developed this small application called CopyX. I tried to make it as simple to use as possible.

When you want to copy multiple files / folders in Windows (even Windows 7!), explorer will open a new copy dialog for each operation. This will eventually slow down the copy process as you run multiple copy / move operations. I wanted some way to queue up files / folders to be copied like adding multiple jobs and processing them like a queue. I searched online and came across TerraCopy but for some reason it wasn’t stable on my system so I decided to write something of my own and release it for free ( as always 🙂 )

CopyX was born! Please use it, abuse it, do what you like with it! It comes with no warranty or support. If you have issues let me know but I’m not sure when I will release an update. Hope it helps someone out there the way it helped me.

Note: You need Microsoft DOT NET Framework 3.5 to run CopyX

Click here to download

Simpo v1.0 beta – The Simple Password Organizer

Simpo User Interface

DOWNLOAD

I’ve been a hardcore C++ buff right from the early days. Recently I decided to take up learning C# and .NET. Boy, was I in for a treat. I was blown away. Don’t get me wrong. C and C++ are still my favorite languages. But the simplicity and speed of C# and .NET reminded me of the Visual Basic days. Heck, they’ve even gone and made Visual Basic Object Oriented (VB.NET)

Anyways, I developed this nifty little application in my spare time (~ 3 days). Hope you guys find it useful. It basically maintains a list of all the sites and passwords that you enter in it so that you can keep track of all your passwords in one place. We all know how frustrating it is especially with multiple accounts and logins and not remembering the passwords at the right time.

The application even encrypts all the usernames/passwords/comments you store so that no one except you can have access to this sensitive information. Just make sure you don’t forget the password. There is no way to recover the master password and you will lose your data if you do. Lastly, this is hobby software and comes with no guarantee. Let me know if you find any bugs or if you can suggest some enhancements. This program needs .NET framework 3.5 installed on your machine.


Google search is now instant search

nav_logo16 Google have just launched Google instant. So what is Google instant?

This morning when I launched Google (who doesn’t?), I noticed that links loaded as I typed my search query. This seemed really cool and just as I was about to say “What the…”, a small banner popped up below that said Google had launched Google instant and that it would be launched in the remaining parts of the world soon ( I am in Japan as of now )

Google say that it is going to revolutionize the way we search for information. I don’t know about revolutionize, but it is nifty as hell.

Google instant is basically predictive search. Google algorithms predict what you are about to type by matching commonly typed keywords and the search links start loading as you type. Not only is this faster and unique, it also gives you a peek into what sort of links are going to be returned by Google when you search for a particular phrase. This means you can avoid making mistakes since you see the links as you type. As I type “Apple iPod”, I see that I get links to generalized iPod articles but if I add “2010” , I immediately start seeing links to the new lineup of Apple’s iPods.

I am not sure right now how much time it will save you, but I can already see myself getting better at typing the right kind of search phrases. How useful this new feature is for the rest of the world, only time will tell.

Here’s a short video on Google instant –

 

Enhanced by Zemanta