Idea for a queue-based File Transfer Utility

I got an idea. I could go on about what inspired idea but I think I’ll just bore myself. I’ll just say that it’s out of need, and it’s just sad someone’s not already done it. Here’s the sketch of what’s on my mind:

  • It’s a GUI wrapper over some simple commandline tool (basic DOS commands to start with, might look into Robocopy later).
  • The goal is NOT to achieve a speedy file transfer (like Teracopy for example). The main point is proper queuing support.
  • Design should be simple enough for someone to pick it up and start using it immediately. It’s a file transfer utility, not the dashboard on a space shuttle.
  • I want this to be cross-platform someday (at least Windows and Linux), the GUI will simply make use of commandline tools. I’ll start with Windows and once it meets some basic requirements, if I have time and more importantly if I feel like it, I’ll work on a cross-platform version.
  • Tool of the trade: wxPython.

The features I want to implement first:

  • Cutting/Copying files adds them to a queue (I’m thinking take over Ctrl+X and Ctrl+C). It’ll basically be like “Enqueue in Winamp”.
  • Before pasting the queue, you can view and edit the queue. Then Ctrl+V or paste will move/copy those file in the order of the queue one after another. Note: I need to investigate parallel file transfers, but for starters, I’ll stick to one file at a time, based on my experience that multiple transfers take more time than the individual transfers combined.
  • As soon as a file is copied or cut, the queue window appears in an always-on-top (non-optional) and transparent (optional) window.

I’m not the type to plan everything out in the beginning, I like to get out a prototype and chalk out the plan as I go along, even if it means a lot of rework along the way. It’s just how I’m comfortable doing things. So basically, when I’m in the right mood, I’ll draw some mockups and whatnot and start from there but in the meanwhile, I gotta get comfy with wxPython, at least the basics. More updates as they come, no particular ETA.

Peace.

A Tribute to IrfanView

IrfanView is the best daily-use image viewer, period.

OK, maybe not for everyone. But for a power-user, that statement holds true. It’s the best general-purpose image editor I have ever used since a long time (2004), and it managed to keep that title for all these years in the midst of so many new Windows releases. It supports all the Windows versions from the ancient Windows 9.x to Windows 8. It is extremely snappy and unbelievably lightweight, with an install size of just about 2 MB (12 MB if all plugins are installed).

A Heads up: IrfanView looks old-school. It doesn’t conform too well to the latest GUI eye-candy standards (to keep compatibility with older Windows versions, I guess). The window border inherits the Windows theme, but the toolbar has always been pretty basic, with just bitmap skinning. If you’re just out for an image viewer which can browse through folders and do slideshows, then there are much prettier alternatives. I for one love Picasa’s image viewer.

As a Viewer

IrfanView is a very capable image viewer if you’re looking for a no-nonsense experience. It supports everything you would expect in a good image viewer, like browsing through folders, zooming in and out and viewing slideshows. But in addition to that, it also supports a lot of file formats for viewing and saving. Animated GIFs are supported too, and my most favourite: PSD files! You can’t edit PSD files but you can view them just fine.

Viewing images

As an Editor

Let’s be clear on one thing: IrfanView isn’t Photoshop. It doesn’t do layers or layer effects, it has very limited support for transparency when editing images, it doesn’t have brushes, a Pen tool or a Clone tool. But for everything else, there’s nothing better. You can:

  • Crop and auto-crop images
  • Resize/resample images, set their DPI
  • Do basic drawing (hit F12 and you’ll see)
  • Change the color depth
  • Cut/Copy/Paste rectangular parts of images using the selection tool with pixel-precision
  • Add text and watermarks
  • Create Panorama images (no intelligent stitching though)
  • Capture the screen (full screen/client area, include/exclude mouse cursor, open in editor/save to file, custom hotkey, timed auto-save)
  • Apply effects (Sharpen, Blur, Zoom Blur, Radial Blur, Noise, Pixelize, Explosion, etc.)
  • Do color corrections (RGB, Brightness, Contrast, Gamma, Saturation)
  • Switch RGB channels
  • Save to many output formats and control their settings
  • And God bless Irfan Skiljan, Batch Conversion with a bunch of options! Open-mouthed smile

Built-in effects

And these are just the features that I use and like. It’s also capable of some other crazy stuff like creating standalone slideshows and screensavers of those slideshows with an option of attaching mp3 files, extract icons from EXEs and DLLs, and much more.

It also comes with a Thumbnails application which is used to browse the supported file formats as thumbnails (I never use it though).

The Thumbnails application

 

A few tips

If I’ve managed to convince you to give IrfanView a shot, then I’m sure you’re heading to the website right now Winking smile

IView_GetIrfanView

I suggest that you download the the plugins pack too, especially if you’re a power user. You never know when you might need them. With the plugins installed, the install size is only about 12 MB, so no loss there.

IView_GetPluginsToo

 

After you install it, be sure to go through the settings. You’ll want to tweak some of them to make IView your own. BTW did you know IrfanView was designed also to be used as a very comprehensive command-line tool? I’ll say it again. IrfanView is the best daily-use image viewer out there. Period.

How I recovered from a bad theming attempt

Have you ever heard of UX theme Patcher? It allows you to apply unsigned themes on Windows (basically most of the interesting themes you can find on the internet). deviantART and many other websites have some amazing themes but they can’t be used as they are not signed by Microsoft. Another reason is that some of these themes modify/replace some system files (explorerframe.dll, shell32.dll, explorer.dll) to theme elements like the back/forward buttons in explorer, the start button, etc.

Since these themes provide modified system files, we need to make backups of the originals (note the Windows Service Pack). There are tools to manage themes by changing the system files automatically (Theme Manager is my favourite). I was using it to set some theme, but something must’ve gone wrong. explorer.exe got corrupted somehow and it was not starting on boot. And I had no backup of the original. If Theme Manager made a backup somewhere, I couldn’t find it.

I restarted the PC and hit F8 during boot to bring up the extended boot menu. I thought I’d find “Startup Repair” there, but I was wrong. All I got were a bunch of Safe Modes and a few other options. Luckily, my decision to have an Ubuntu dual boot proved helpful. I booted into Ubuntu and got online for solutions. I kept seeing a command: “sfc /scannow” all over the forums everywhere. What that command does is check the integrity of all the system files (by verifying their checksums, probably) and is if finds any corrupt files, it replaces those with the original file stored in the repository (C:\Windows\winsxs). So I booted back into windows, but there was no explorer again. I didn’t even have my desktop. I logged into my user, hit Ctrl+Alt+Del, and got to task manager. Tried File –> Run –> explorer without luck (obviously, since explorer was corrupt). I started cmd.exe and ran “sfc /scannow” but alas, I had to have admin privileges to run that command! And I couldn’t for the life of me figure out how to start a cmd prompt with admin privileges. All the posts on the internet were describing the GUI way (from the start menu), but I didn’t have a start menu without explorer. Then I somehow found this blog post about a nice utility written in C called elevate. With the help of that, I was able to start an elevated cmd prompt, run the “sfc /scannow” command, and reboot into a working windows session Smile

So the summary:

  • Always make a backup of all the files that you will change when you theme.
  • Theme Manager is a great tool for managing Windows themes.
  • Should something go wrong, run “sfc /scannow” with “elevate.exe

Have fun theming Smile

The Future of this Blog

I haven’t been blogging much lately because, well, I’m pretty lazy. And I haven’t had much free time. More truthfully though, I’ve lost my touch. There were some pretty big life changes, I got a job, for starters. My blogging habits took a pretty hard hit due to that.

Luckily, I’ve spent the last Saturday reformatting and re-installing OSes on two computers. Tiring and even frustrating as it was, it helped me get back in touch with the tech enthusiast in me. So I guess I’ll start blogging again.

All the same, I did some thinking about what this blog is all about, and there is some good/bad news.

Bad news first: This is not a tech blog. It is my tech blog. Meaning, I use this blog to archive my findings, my subjective opinions on all things tech. It is not really a place to find unbiased, objective hardcore tech info and certainly not Tech news, oh no. There are many good blogs out there which already do that and I don’t like doing tech news except for the occasional post where I’m genuinely interested in the information. It is also not a place to expect frequent updates

Good news: This is just a practice blog. Once I refine my writing style and get comfortable with blogging quality content with relative ease, I’ll create a new blog and move the non-personal content over there. That, will be a full-blown tech blog, and this will be my journal.

Now that that’s clear, well, I’m back! Smile

Under-used Keyboard Shortcuts for Text Editing

Most people know about the basic windows shortcuts for Cut, Copy and Paste (right? Smile with tongue out), but there are a few more shortcuts that I consider are invaluable when writing text. And I was surprised that most people don’t really use them. I am talking about the Home and End keys and their respective combinations with Ctrl and/or Shift keys.

  • Home: Takes the cursor to the beginning of the current line.
  • End: Takes the cursor to the end of the current line (after the last character in the line).
  • Ctrl + Home: Takes the cursor to the very beginning of the active text field/document.
  • Ctrl + End: Takes the cursor to the very end of the active text field/document.
  • Shift + Home/End/Right/Left/Up/Down: Selects all the text between the initial cursor position and the final cursor position.
  • Ctrl + A: Selects everything in the active text field.

All coders and pretty much everyone who types a lot of text in your everyday life, for the love of God, drill these shortcuts into your minds! I promise your productivity will increase at least by 30%.  Here are a few examples of usages:

  1. Example 1 (Ctrl + A): Say you want to post a rather long status update in Facebook and twitter. Type out your message, hit Ctrl + A, then Ctrl + C. Then hit the post button in Facebook, go to Twitter, click on the “What’s New” text box, press Ctrl + V and post it.
  2. Example 2 (Shift + Home): Say you’ve written a complex printf() statement in C to display some information and you have to repeat the same output with a few changes about 5 times. Here’s what you do: Type out the first printf() statement. Your cursor will be at the end of the line right. Now press Shift + Home. The cursor will move to the beginning of the line because of the Home key, but it will also select all the text along the way because of the Shift key. Now copy and paste it as many times as you want. You have thus successfully avoided moving your hand to the mouse, moving the cursor and selecting the text by mouse movement. You’ve achieved all that in just 2 keystrokes: Shift + Home, without taking your hand off the keyboard. Note that you can use Shift with the arrow keys to select text letter by letter.

Aside from these shortcuts, I implore you to familiarize yourself with the keyboard shortcuts of the programs you use the most. It will drastically reduce the time needed to perform simple but repetitive actions. Just use Google, because as they say, Google is your friend! And if you don’t listen, then this Smile with tongue out

Ciao!

The odd details of C++

I’m revisiting C++ with the intention of figuring out the details. This post will contain various little things and questions and pretty much anything. I intend this list to be “something that you won’t typically find in most books”, a list of the details of the C++ language. Not to mention, this page will be changing constantly as I add new information or get answers to questions listed.

Legend:

(?) – Still needs confirmation, some info missing.

And the list begins:

  1. Structured vs. Object oriented programming: Structured programming is task-centric where as object oriented programming is object-centric. For example, in structured approach, when a task is to be performed, we first think of subroutines and then the data structures. In OO approach, we first think of the objects needed to perform the task, then we design the details of the objects and their behaviour. C is a structured language, C++ is an object oriented language.
  2. (?) Default values for data types in C++: When variables are declared and not initialized, what are their values? I believe number types will be set to 0, but it might depend on the compiler. For example, C-Free 4 gave garbage values to int, float and char variables. But when run multiple times, the value for int kept changing but the values for float and char remained the same. Confirm.
  3. (?) String Mutability: Need to explore string mutability, even by using pointers. For example, when I have a char pointer, can I still use it when I change the string length?Also need to explore String class capabilities.
  4. Static variables and functions: Figure out 1.Where static variables can be a.declared b.initialized and experiment on their scope.