Why I enjoy using Emacs

October 3, 2011 1 comment

 

Some people prefer Vim for their text editing, please take a look at my friend, Noel Cower’s blog discussing the merits of Vim.

It would seem like a step backward to some people to work in an environment that offers little visual flash when editing code and files. The very same people often recoil in horror when they are plunged into a command terminal interface and told to configure something without the aid of bright over-glossed million color icons. To other people, the lack of clutter is the very reason for using such tools as Emacs or Vim. When I attended college, I often took notes using the little known Microsoft DOS text editor called “edit”. I found that I could focus on the lecture much better if I simply ran the program in full screen mode. In this way these full screen text editors let a person focus on what matters – the text or code.

These programs DO require something of the user. They must learn and retain command information. Honestly I found it interesting and challenging to learn to use Emacs. Perhaps the most immediate benefit is the speed gained from never having to take your hands off the keyboard to move the mouse. Emacs offers many different ways to move the cursor around your work without ever having to touch a mouse. It also offers ways to select move and modify selected blocks of text. Some implementations do use the mouse.

Speaking of selecting text, perhaps the most useful of all selection tools in Emacs is the ability to copy, move, and paste “rectangles” of text. If you are working with column based data this is an invaluable tool for easy editing. This is a great addition to the table making ability of Emacs. You can copy and paste cells in tables easily. Yes, Emacs also offers ascii art tables which are very handy should you be making plain text tables as one might in some source code commentary. There are many hidden features to be found.

Speaking of hidden features, Emacs offers games, a file utility, compiler support, multiple programming modes, a calculator, a lisp evaluator, and an internet relay chat client. I found the client by mistake actually Emacs: The text editor where a simple typo spawns a whole unknown feature. I now use Emacs both on Windows and Linux to do my IRC chatting. I simply type Alt+x (to get into command line mode) and then enter “erc”. Another great feature of a text based editor is the ability to run across any terminal connection. Emacs adapts itself to the terminal specifications and may offer special features should your terminal support it. I used ssh to run a pure text Emacs secession on my home computer from work. It allowed me to compile some C code for an nCurses tutorial book I was working on.

If you are running a graphical desktop, Emacs will also let you run a special n00b friendly GUI implementation. Most seasoned users will be comfortable enough in the text only mode. Both feature the same editing commands.

Is Emacs right for you? Honestly, I don’t know. It takes time, dedication, and some hefty memorization.
If you enjoy learning to use tools and are strong willed then yes, for sure it is.

Here is a screenshot of Emacs running in Windows. This is the text only version (yes it has more colors if you are editing programs it DOES highlight code quite well!)

Categories: Uncategorized

Oh Unicode how I love and hate you.

June 20, 2011 3 comments

Unicode is a really great thing. It allows for a wide range of special characters and letters in different languages.

The problem is that is is messy to work with while programming especially when you want to create standardized code.
Anyway, I am working on a Linux terminal picture viewer probably because I’m enjoying using the terminal and sometimes need to see a picture file before copying it or moving it.
This presents a problem for text only terminals I need to view the image, especially if it has come from a digital camera with an odd name.

Here is the result of my tinkering you can see a standard ASCII version and a Unicode version using the braille letters as dithering patterns. Currently it is SFML powered C++. The image is the standard test image, “lena”.

So there you have it, a use for a very odd set of Unicode characters, the braille set.

Christmas ball photography hack WORKING!

June 15, 2011 19 comments

A $20 360 degree panorama solution.

Let me first say NO that pink coat is not mine. This was done at my parents’ house.

I’m very very pleased to day that today I was finally able to accomplish my dream of providing a cheap way for the average person to do special 3D 360 degree panorama. I found that if one simply shoots a spherical object from above, they can capture a whole 360 degrees worth of image data. I used this cheap ( and admittedly crappy Christmas tree ball). To do this I disabled the camera’s flash, set a timer for 10 seconds, and moved my tripod so the ball was in full view. I then stepped back and allowed the ball and camera to do their magic. This is the result, look at all that image data tucked away inside there! The FINAL 360 degree product is at the very bottom if you don’t like to read.

A top down shot of a common Christmas ball.

Now I used GIMP to convert the image from a polar map to a normal rectangle. The result will look squished but we’ll fix that.

Be SURE to crop your image first so the sphere is in the center and the image is square not rectangular.

Now we are ready to begin the magic.

Select

Filters -> Distorts -> Polar Coordinates

Uncheck “To Polar” Your image should unfold into a square.

This is the result.

You can see that we are getting there. Now I went to Image -> Scale Image and scailed the width by a factor of 314 % (This is PI times the height!).

I’m not sure that that is the correct width, readers please correct me if my math is incorrect.

Here is the final result, please keep in mind this is a proof of concept. The Christmas ball had many imperfections in the surface. You can probably get amazing results with one of those half dome safety mirrors like retail stores use and a professional camera. I’m just a simple inventor, this is probably a 15 dollar project if you have the camera already. According to one commenter, my final picture might be out of proportion please read the comments.

Please readers, feel free to correct, comment, and improve on my methods.

DIY 3D photography… coming up a bit short.

June 15, 2011 2 comments

 

An ongoing project is currently driving my crazy all because I’m missing one piece to make it work.

The idea is to provide a cheap and acceptable way to do 3D photograph construction and viewing with a single picture.

The idea is as follows:

1. Obtain a large mirror finish ball or hemisphere.

2. Place it on the ground.

3. Take a picture from directly above zooming in to fill the the view of the camera but not cropping the sphere.

4. Crop the image to a square keeping the sphere in the center.

5. Use custom image software that reconstructs the sphere from a polar image to a rectangular one – giving a full 360 degrees of view along the horizon with some acceptable distortion at the top of the image. This will not be as good as the effect constructed from 6 pictures but should give a complete 360 degree panorama from a single shot.

My problem is that I cannot find a cheap solution for a mirrored sphere or hemisphere between 8-18 inches. Currently I’m not working so a 20 dollar or less solution would be best.

Tanks now implemented.

In the spirit of being traditional I have hand coded these tanks into my game point by point.

I’ve eliminated the grid to show them off a bit better. Currently I’m fighting visibility vs detail. The ground grid has a nice effect but around the horizon it really starts to block things in the distance. Anyway here is the tank that has been coded into the game. I have no idea how to do the collisions from scratch so I will probably have to implement a solution like Box2D. I feel pretty bad about not having the math skills to code complex polygon collisions. I really envy people who have had a chance to really understand the complex math. Understanding  breeds more understanding. Often a simply hurdle will prevent us from reaching full potential. If you look at what you have learned as an unfolding tree each unblocked branch leads to further branches and further learning.

Ahem, I’ll now just shut up and show the picture. The first person view from the turret is a bit ugly I admit, but it is technically correct.

Categories: Uncategorized

Candidate for wire frame tank model.

June 6, 2011 1 comment

Here is a sort of concept design for what the tanks in my upcoming game might look like. I’ll probably have to hand code these points.

Categories: Works in Progress

Time to start a new project!

Currently, I am starting work on a game that looks and plays a bit like the Atari classic Battlezone.

It will be monochrome and composed of only wire frame shapes.

I don’t plan on making a port of the game but rather working on creating a unique game that looks as if it was from the same era of design. Being a proud Vectrex owner, I know what true vector lines look like. To create this effect the final product will need to be high enough resolution to blur our the chunky pixel lines then I’ll apply additive blending to complete the feel. Darn shame vector displays fell out of favor. Just a simple first screen of what I DO have for now. Let me also clear something up, yesterday I talked about blurring and such being bad in “retro” games. Vector games should be high resolution and blurry to achieve the effect of not being raster (as vector line display games are NOT).

EARLY shot. Yes I still need enemy tanks and an aiming reticle.

 

 

 

 

 

 

 

 

I’ll keep you posted…

Categories: Works in Progress
Follow

Get every new post delivered to your Inbox.