2008-04-17
Screen Capture on a Mac
It took me a while to figure out how to capture the screen to an image file using OS/X. As is usual, the answer is simple once you know it: Capture. Just run Capture using Spotlight (Command-spacebar).
2008-04-14
Google Gadgets
This weekend I researched Google Gadgets, while looking for an alternative web widget framework to the one I used for The Curious Dreamer widget I created. I have been educating myself on these semi-autonomous chunks of code that can be dropped in other sites. I want to be able to offer the creation of such things in my freelance developer business.
I looked at the Microsoft version, but it is, as may be naturally expected, sort of tangled up with Windows and Microsoft development tools. At least the expectation is that you will use a Windows development system and do things the Microsoft way. There is nothing wrong with that, but I'm more comfortable in a Unix style environment, using vi as my editor and a combination of shell scripts and commands with Nautilus. Also, some research revealed that Google Gadgets can be repurposed as Microsoft widgets.
I delved into Google Gadgets with the thought that I would try to get a hello gadget working and start to understand the framework. Fortunately, my experience with Prototype was useful in my understanding of how Javascript is used in Google Gadgets. I started late Sunday morning, and my five o'clock I had a working prototype that duplicates the functionality of The Curious Dreamer web widget.
After I complete my current client project this week, I will flesh out the gadget I've created and test it. Google's framework is a pleasure to use and is really well designed and practical. I'm going to be able to finish this gadget and I'm keeping notes on some others that I think people will find to be useful. I want to be able to approach site owners and offer a service to create such work for others.
2008-03-29
New Version of Inkscape!
After by last post, I checked to see if the new version of Inkscape was released yet.
It has been! Version 0.46 at http://www.inkscape.org/. I installed Ubuntu Gutsy and checked some of my annoyances, which are...gone! It is not perfect, but it is much better. It remembers file paths better and the Fill and Stroke dialog is now docked in the main program window. Everything I've tried has been a little bit better. Nice job Inkscape crew!
New Banner Ad Created with Inkscape
I just finished a new banner ad for my wife's dream interpretation site, MyDreamVisions.com.
I did the ad using Inkspace under Ubuntu. Open source drawing programs have come a long way. The current version of Inkscape works pretty well. With a little thought, I can create just about any image I can imagine (the limiting factor, in my case). The next version is a major upgrade and is adding a whole bunch of new features. I hope they are going to improve the user interface, which is a bit of a hodgepodge. Things pretty much work, but there are odd bugs and inconsistencies throughout.
But, like I said, it works well enough and it is possible to draw what I want to.
Here is the banner ad I made:
I did the ad using Inkspace under Ubuntu. Open source drawing programs have come a long way. The current version of Inkscape works pretty well. With a little thought, I can create just about any image I can imagine (the limiting factor, in my case). The next version is a major upgrade and is adding a whole bunch of new features. I hope they are going to improve the user interface, which is a bit of a hodgepodge. Things pretty much work, but there are odd bugs and inconsistencies throughout.
But, like I said, it works well enough and it is possible to draw what I want to.
Here is the banner ad I made:
2008-03-27
Mac OS/X Bash Shell
Most Mac users do not have an interest in the Unix shell (running in Terminal). The Mac was carefully an exhaustively developed so an Apple user would not require it. The question is, could a more advanced user enjoy using the shell? I think, yes.
Most things are done very efficiently using the Mac's graphical interface. Searching for files, opening them, copying them...all easy and efficient. Spotlight works great. But, what if you want to do something with every file found in a search? That is an example of when good old Unix shell commands or shell scripts (little programs written to run on the Bash shell) are extremely useful.
How to Open Terminal
Terminal is the program that the Unix shell runs in. To open Terminal, use Spotlight. Type command-spacebar (hold down the command key and press the spacebar) and enter "terminal" in Spotlight. Select Terminal from the results list. Note that the command key is the one that says "command" and has a cloverleaf looking icon - it is next to the spacebar.
Or, use Finder and locate Terminal in the directory: /Applications/Utilities/
Groundwork
Current Macs use a version of the Bash shell. This is the most common type of Unix shell. Most of what works generally in common versions of Unix, works on the Mac. So, when you want to use Google to find a command, or how to use a command, adding the word "unix" usually helps. If you are going to use less common parameters, make sure to also check out specific OS/X reference pages, because there are differences from one Unix to another.
Case is important. Filenames, directories...just about everything is case sensitive. Therefore, you could have "photos" and "Photos" in the same directory. "ls" is the list files command. "LS" and "Ls" are not!
Switches: In Unix, switches are demarcated with a hyphen ("-"). In Windows/DOS a slash character is used ("/"). When more than one switch is selected, they can be strung together after the hyphen. For instance, with the "ls" (list files) command, if you wanted to use both the "-a" (all files, including hidden files) and "-l" (long listing format) switches, the command line would be:
ls -alGlobing: Globing is the term for Unix-style "wildcards". These are handled completely differently than they are in Windows/DOS. In Windows, the program being executed is responsible for expanding wildcard characters. In Unix, the shell expands the filename specified. The Unix globing characters are:
? Matches any one character in a filename. * Matches any character or characters in a filename. [ ] Matches a character within the brackets. - A hyphen used within [ ] denotes a range of characters. ~ A tilda at the beginning of a filename expands to be the user's home directory.Note the absence of a "." period character. Unix does not have the equivalent of Windows-style filename extensions. A Starter Set of Commands Here are a few shell commands to start with.
ls List files. This is sort of like DIR in DOS. cd Change directory. mkdir Make directory. rmdir Remove directory. cat Concatenate file(s) to standard output. Can be used to display file contents.Jump in and get your feet wet. Next, I'll revisit this topic and expand on it a bit.
Unix Equivalent of DOS COPY CON
This is an answer to a question I got by e-mail.
"A lot of times I need to create a quick text file, like a script (like I used to create Batch files in DOS/Windows). I used to use COPY CON for this. How can I do this in Unix?"This is just as easy in Unix. Instead of COPY CON filename, use cat >filename. As before enter the text for the file. Then close the file by hitting enter one more time and entering control-D. Remember, if you are creating a shell script, make the file executable with chmod +x filename. Also, to execute the script, remember to include the path to the script, even if you are in the same directory as the script, like this ./scriptname.
Taxpayer Demands Competent Government
It does not seem as though voting for one party or the other affects the basic competency of our government.Is it too much to ask for? No it is not.
It is our duty to the next generation to leave a better world than the one we were born into.I wish that it was not necessary to concern myself with government. I just want to live my life, love my wife, write what I like, play music, write some code and make things. But, my morning paper sickens me with my government meddling endlessly in my life, my rights, my peace of mind and doing things in my name, with my money, that are stupid and counter to American interests.
The science of government it is my duty to study, more than all other sciences; the arts of legislation and administration and negotiation ought to take the place of, indeed exclude, in a manner, all other arts. I must study politics and war, that our sons may have liberty to study mathematics and philosophy. Our sons ought to study mathematics and philosophy, geography, natural history and naval architecture, navigation, commerce and agriculture in order to give their children a right to study painting, poetry, music, architecture, statuary, tapestry and porcelain. - John Adams
The Adams quote I heard while watching the current HBO series. Embedded therein is the distaste for needing to understand and improve government, out of duty to his country and his children. Just a hard working and intelligent man, doing what he can in the face of loss of liberty and freedom.
Subscribe to:
Posts (Atom)