As I go through some old applications I wrote for various purposes, but never released, I thought I'd share the source code for a Java program that you can use to get the x/y coordinates or the mouse cursor (pointer) and RGB value of the pixel at that location. I've used this application for various reasons, including determining the location of something on screen, determining the width or height between two points, or getting the RGB value of a pixel on screen.
Scala, Java, Unix, MacOS tutorials (page 366)
| A Machine Learning Bestseller | |
|
Introduction to Machine Learning with Python |
Java image FAQ: How do I crop an image in Java?
To crop an image in Java, just use the Java BufferedImage class, specifically the getSubimage method of the BufferedImage class.
Unix/Linux bash shell script FAQ: How do I prompt a user for input from a shell script (Bash shell script), and then read the input the user provides?
Answer: I usually use the shell script "read" function to read input from a shell script. Here are two slightly different versions of the same shell script. This first version prompts the user for input only once, and then dies if the user doesn't give a correst Y/N answer:
AppleScript foreground application FAQ: How can I get the name of the current Mac OS X foreground application in AppleScript?
Mac OS X Folder FAQ: How do I determine the size of a Mac folder?
Answer: I started to write about how you could use the Unix "du" (disk usage) command on a Mac OS X system to determine the Mac folder size, but then I realized there's a little more obvious approach: Use the "info" command when you have a folder selected in the Mac Finder.
Mac folder size
Using your Mac "Desktop" folder as an example, here's how it works:
Mac online backup services FAQ: Can you provide a comparison of Mac OS X online backup services?
As I continue to dig deeper into the topic of Mac OS X online backup services, I thought I'd start putting together a Mac online backup comparison chart. I just went through the websites of all the online backup services vendors to put together the details below.
Mac Dropbox FAQ: What do you know about the dropbox.com online backup service for Mac users?
Mac Time Capsule backup FAQ: Can I use an Apple Time Capsule drive to make Mac backups, and as a Mac network share (drive)?
I now have a small network of Apple/Mac systems here at the devdaily.com world headquarters, and as I'm starting to feel the need for a network, I looked around the office, and lo-and-behold, I found my old Apple Time Capsule. Hmm, I thought, could an Apple Time Capsule work as a Mac network drive?
Wow, in the worst story I've heard about Facebook privacy yet, it turns out that through a glitch in Facebook's programming, they gave personal user information to advertisers (reported first by the Wall Street Journal). As another Cnet article reports:
Dateline May 20, 2010: Cnet and many others are reporting that the Apple "Get a Mac" ads are finished, and Apple is now switching to a "Why You'll Love a Mac" campaign. Indeed, Apple's own "Get a Mac" web page now redirects to the new campaign page. I thought this was a really fun ad campaign, so John Hodgman (PC) and Justin Long (Mac), you will be missed.
Sigh, so many broken links, so little time ... when I switched this website to Drupal, I didn't (couldn't) take the time to move all of my static content in the Drupal CMS, so a lot of great content is just sitting out there in static files. To help fix that problem a little bit, here's a link to a collection of Java test project (example projects) that demonstrate all sorts of cool and fun things with Java, including:
PHP command line args FAQ: How do I read command line arguments in PHP?
Answer: You just need to access the PHP argv array, as shown in this example:
PHP here document FAQ: How do I create a here document in PHP?
If you ever need to use a "here document" in PHP, here's a short example of the PHP here document syntax:
<?php print <<< END Four score and seven years ago our fathers set onto this continent (and so on ...) END; ?>
I believe the closing tag you use ("END" in my case) must begin in the first column. This is typical with here document syntax, but I haven't tested it in PHP.
Drupal Sitemaps FAQ:How do I create an XML sitemap for my Drupal website?
If you have a Drupal website, and want to create an XML Sitemap for Google, Yahoo, Bing, and other search engines, the Drupal XML Sitemap module is the module you need. Here's what I just did to install this Drupal module it on my OneMansAlaska.com website.
Definition of "oxymoron": Facebook privacy.
Until the Facebook people get their act together (or change their leadership), or until another website/service comes along to compete with what Facebook was offering (before all their privacy screwups), I've decided to go back to the old way of communicating with my friends, and I've deactivated my Facebook account.
Quick note: I just released Version 0.3 of my Teleport command. If you haven't heard of it before, the Teleport command is the Linux/Unix cd command, with a memory. Because it has a memory, you can do many cool things, such as "teleport" from one directory to another, list the history of directories you've visited before, jump to directories with partial names, etc. I think it's pretty cool, and I hope you'll check it out. It's free, and released under the GNU GPL.
Mac OS X launchd plist FAQ: Can you share some Mac OS X launchd/launchctl plist file format examples?
I started to write a long tutorial on the Mac OS X launchd plist format, but I think an easier way (for me) is to point you to a couple of references that explain the launchd plist format fairly well.
Mac OS X launchd plist FAQ: Can you share some examples of how to use the Mac OS X launchd plist StartInterval and StartCalendarInterval keys?
Here's a quick look at the Mac OS X launchd StartInterval and StartCalendarInterval keys. These two keys can be used to represent time values in a Mac launchd plist file, and many people have questions about them.
Mac OS X launchd plist StartInterval examples
The general syntax for the Mac OS X launchd plist StartInterval key is shown here:
vi/vim FAQ: I keep getting these vim swap/temporary/backup files in my current directory, the ones with the tilde (~) character at the end of the filename; how do I get these swap/temporary files to go into another directory?
Facebook privacy facts: I was thinking about writing an article on the "facts" behind the new Facebook privacy changes, as many people seem rightfully upset by them, but few seem to know the actual Facebook privacy facts.
Five facts about your Facebook privacy settings
The best, short article I've found that covers some of the "facts" about the Facebook privacy changes is this article on MacWorld.com. It doesn't cover everything, but it does discuss:
| A Machine Learning Bestseller | |
|
Introduction to Machine Learning with Python |