Archive for the 'Uncategorized' Category

June 18th 2007

Camouflage

This is a pretty cool application that was released recently: Camouflage. It is for Mac OS X and will hide all of your desktop icons, and with an assignable hotkey, show your desktop icons. This is perfect for people like me who never keep their desktop clean, but like the look of it when it is. Now I can just hide and show my mess! It’s like hiding things underneath your bed again!

It being free is the added bonus.

Comments Off

June 18th 2007

iUseThis

iUseThis is an interesting site. It’s similar to VersionTracker or MacUpdate, but offers a different metric to judge an application on: the number of active users. You begin by saying “I use this” to whatever applications you use regularly, and you can hunt for new applications as they are updated by seeing what other applications are popular. One would say that a measurement of popularity isn’t necessarily of quality, but an odd phenomenon occurs on the Mac: People tend to only use things they enjoy using, or there are no other options.

Comments Off

June 5th 2007

Yay

I emailed Steve Wozniak the same day of listening to the ending of his book iWoz, which I mentioned was a very inspirational in my post Engineering as an Art. I decided to let him know that I enjoyed his book and how inspirational it was to me. After a month of no response, I had basically decided that he probably had at least skimmed it, but being very busy probably didn’t have time to respond.

And this morning I woke up to a short email thanking me for my email. It’s a great feeling to hear back from someone of such high prestige, even if it’s only a few sentences. What a good way to start a day :)

2 Comments »

June 2nd 2007

Some changes around here

So I’ve been wanting to post a lot of things that haven’t been purely REALbasic related, going on various subjects such as politics, math, science, music, life in general, etc, but until now I’ve resisted. But I shall not resist anymore, and some of you may or may not like that :)

I know the benefits for readers when more than one blog is available is that they can pick and choose what to read by simply subscribing to the individual topical blogs. However, as one person who tried to maintain a separate blog for personal uses and REALbasic, it left me feeling discouraged when I updated one but not the other, and it lead to the demise of my personal blog.

After today, jon(athan)johnson.net now just simply redirects here, and while all of the old posts are gone from history, new posts both personal and geeky will begin appearing here.

Hopefully this won’t annoy most of you, and you’ll stick around. But if it does, so long and thanks for all the fish. :)

No Comments yet »

June 21st 2006

Unique but “Similar” Colors

I just needed to generate a variable list of unique colors, but they also need to work together. IE, I don’t want a hot pink and a pastel yellow, because although they would be a drastically different, they would look odd together. Rather than hard-code it, I thought about it a minute and decided to try it this way.

A popular way to represent colors is HSV, which stands for Hue, Saturation, and Value. Hue is the actual color on the spectrum (or loosely put, Rainbow). Saturation is the intensity of that color. Finally, value is the brightness of that color.

Given a color with the same Saturation and Value but differing Hues, the only difference will be the color itself. If the saturation and value are the same, the colors would also “match” visually.

So, here’s the method I wrote:

Function UniqueColor( index As Integer, colorCount As Integer ) As Color
Return HSV( index / colorCount, .4, .6 )
End Function

I can call this function in a loop to generate a list of colors. An example output would be this list of 5 colors:

  • Color 1
  • Color 2
  • Color 3
  • Color 4
  • Color 5

Enjoy!

2 Comments »

January 26th 2006

Ask the Dev Answers

Up front, let me say how fun it was to write answers to these questions last night. I took a little bit of time before lunch to post them, as I got too tired to finish formatting them last night. If you have any more, feel free to ask!

When will iyeyhwuk be fixed? :)

Done. It’s easy to fix things that aren’t bugs in our code :)

What color underwear are you wearing right now?

This is one of those details that is better left to the imagination of my readers.

Who’s your favorite user and why?

Actually, there’s too many to name. There’s so many contributors to the community that are invaluable, and it’s always great to see what everyone comes up with.

How did you end up at REAL Software and in Austin?

I was very persistent. My older brother offered me a chance to live with him for free for the summer between my senior year and my first year at college. Since in small-town Kansas minimum wage jobs pay … minimum wage, and in Austin a job at McDonald’s would net you $8.75 an hour, it was a great opportunity. I honestly was hoping for a job at some place like Starbucks.

However, I was online at what remained of the REALbasic Cafe, and Paul Scandariato (Intelli Innovations, Inc.) suggested that I try to get a job at REAL Software. Since I had been using REALbasic for about 5 years at that time, I thought that would be a cool place to work.

So, I kept emailing Geoff and Dave until they finally invited me in for an interview, and I began interning the next day.

A year later, a full time job opened up. I took it, and have enjoyed it ever since.

What did you study at Kansas State University?

I started out as a double major in Piano Performance and Computer Science. While I loved playing the piano, and I learned a lot in my classes, I didn’t have the dedication to practice several hours each day, so I dropped that major for the second semester. During my second semester, I began realizing that I was paying a lot of money to study something I was already making a living with — I was paying for college by programming, which is what I was getting a degree in.

I wasn’t a role-model student. I skipped all of my computer classes that didn’t have tests that day, waited until a couple hours before the assignment was due before starting the programming assignments, and in general slacked off and still received A’s.

Getting a computer science degree isn’t important to me. I learn faster by studying on my own, and programming on my own. I’m not saying college isn’t worthwhile — on the contrary, it is very helpful to many people.

What’s your dream feature for REALbasic?

ESP module! Err, realistic feature? The problem is, I have too many features I want to see. A few features that come to mind are:

  • Data modelling for designing your data structures visually, and having it automatically generate code for talking to binary files, XML, and databases in a cross-platform manner.
  • Code analysis tools built it, such as profiling, ‘warnings’, and tips. I’m not an advocate for ‘warnings’ showing up every time you build, because you tend to ignore them. However, if you could run an analysis tool that would tell you deprecated functions, where you might have an error with implicit conversions, etc., I think it would be a very valuable tool. Also, class diagrams.
  • More code editing features- I want to be able to annotate my code with links, pictures, movies, sounds. I want comments to automatically wrap. I want parameters of methods to autocomplete. I want to be able to disclose blocks to hide code I don’t care about at the moment.
  • Classes inside of modules, including support for fully-qualified types. This would help encapsulation so that you could have private “support” classes that no one else can see, but that your special package can use. Fully qualified types would allow you to have Module1.FooClass and Module2.FooClass, and nothing would ever get confused.
  • A system like VB’s Delegates, where you can implement events of one class in another class. A common example would be instead of creating a subclass of Timer, you could just implement the action event of your timer instance inside of your other class.
  • A full optimization layer for REALbasic code. Enough said — there’s no reason REALbasic code can’t be as fast (or even faster in some cases) than C/C++ code, and I want to eventually break the speed barrier using plain REALbasic.

I think that’s enough for now :)

What object-oriented features would you like to see added to REALbasic?

Good question. One is mentioned in the above question — a delegate-like system for REALbasic. A few others that come to mind are:

  • Introspection: Useful for something such as a generic serialization framework.
  • Template-style classes: Useful for many things.
  • Weak References: This is one missing link in our reference counted world. While you can work around their non-existence, it would make life much easier when solving circular references if we had weak references.

What annoys you most about REALbasic?

There are three things that I see as slighly annoying:

  • It’s sometimes easier to do something repetitive in TextWrangler with RegEx than it is to do it in the IDE — such as define a lot of really small classes.
  • I want a separate tab for laying out a window and editing the code of a window. I find myself looking for a tab to switch to when I want to see my layout, and I can’t find it.
  • It’s not easy to search the current method — it is easiest done with the mouse once the find dialog pops up. Which leads me to my next point — it shouldn’t be a dialog.

Overall, however, I prefer REALbasic over any other environment, and I much prefer 2006 to 5.5 and prior.

What types of programming projects do you enjoy working on the most?

Recently, I’ve been more interested in compiler features more than anything. While Mars does incredibly awesome work for the time he has, he is only one man and we can only get so many things out of him at one time. He’s tackled the big things, and I’ve pitched in with some small-ish things, such as shared properties and methods, the new for-loop syntax, continue statement, single-line #if statement, insert unnanounced feature that will be revealed at the Cocoa talk at REAL World, and more that I know I’m forgetting.

However, what interests me most are things that are new to me, or different than I usually work on. Working for REAL Software fits me great because not only do I get to work on the things that I love, I get to work on a large variety of things, which keeps me interested in what I’m doing.

How do you seperate computer use for work, and private? Meaning, how do you get your self to even get in front of a computer in your spare time after a grueling day at work? Or do you do something completely different in your spare time, like don’t touch the computer?

Well, for me programming has always been a hobby. Ever since HyperCard was first set in front of me when I was in first grade, I always enjoyed spending time in front of the computer, exploring new territory. The only difference is that now I get paid to program.

There are plenty of times that I get home and don’t touch my computer at all. However, I often have a good 15-20 different projects that I want to work on. Between Thanksgiving and Christmas, my schedule was along the lines of:
7:00- Get up, eat breakfast while reading email
7:15- Begin working on Cocoa
8:15-8:30- Reach a good stopping place, finish getting around, drive to work.
9:15- Work more on Cocoa
6:30-7:00- Get hungry, leave work to head home and eat
7:45- Work more on Cocoa
10:30- Go to sleep

I did that for four weeks straight, and why could I do that? Because I was so excited about it, and was having fun doing the work. Now, if it had been a project that wasn’t that interesting to me, it’d stay at work.

The other obvious motivator for other projects can often be money. I’m currently finishing up a product that I’m going to begin marketing in the next couple months that has a lot of potential. It has me excited not because I necessarily am having the most wonderful time writing the software, but I’m having fun starting a business, fitting all the pieces together, and dreaming of becoming rich ;)

However, even with all the excitement of a project, there are indeed some days that I’m just braindead when I get home, and all I do is watch some TV, play a game or two, and play the piano. Having a hobby such as playing the piano is great. Being able to take a 15 minute break every hour to go and relax away from the computer is a necessity.

What is the work environment like? What’s a typical day at RS like?

It’s very laid back, and perfect for me. The thing I love about REAL Software the most is the people. Even when I was only an intern, it was great to come to work with everyone each day.

My typical day begins at 8:30 when I start my drive into work. I currently live in North Austin, while the office is in South Austin. It generally takes me 25 minutes in the morning for my commute. I do plan on moving much closer in July, when I get married and my lease expires.

I log into my computer when I get to work, plug in my FireWire drive, and read emails from the lists, check the Feedback System for new items assigned to me, and begin working either from that list or the projects I was working on the day before.

A group of us usually go out to lunch together, alternating between favorites and new places every-so-often. Lunch is about an hour long, sometimes longer (for places like Hula Hut), sometimes less (for places like Taco Bell). Continue working after lunch until about 6:00, where I start my drive home.

I have my own office currently, although that isn’t going to stay that way forever. I kick my shoes off in the morning, play some classical music throughout the day, and keep the lights off in my office (the sunlight from the windows is enough light for me to be comfortable).

There are practical jokes played once-in-a-while, and often they are quite elaborate. If you want to hear some good stories, get some good ideas, or share some good ideas, I’ll share them much more easily over a lunch conversation at REAL World than I will on my public blog ;)

All-in-all the work environment is basically exactly what I’ve always hoped for in a job.

Do you think that you can write as good software in real basic as you can do in Cocoa? Then I am talking about like Delicious Library, iPhoto, sandvox and yojimbo (bare bones) ? And if you say yes, then why don’t we see such software written by RB?

Yes. There’s nothing special about those applications you mention. Things will be easier once REALbasic builds Cocoa to utilize some features that they take advantage of, but it’s not impossible to build such programs using REALbasic. Here are a few applications that I think are great examples of what REALbasic can look like on the Mac:

  • REALbasic 2006: Sorry to pimp our own product out, but I think that the new REALbasic feels like a peer on OS X more than any other version of REALbasic.
  • Intelli Innovations products, such as IntelliScanner Media Collector: This product actually came out before Delicious Library, and while it doesn’t have a bookshelf (which can easily be written as a custom canvas), it still looks and feels like a Mac OS X application. All of their products have sensible designs, IMHO.
  • Studiometry: This cross platform application looks great on Mac OS X. Definitely something to check out.
  • ProSelect: This app, while not using a standard UI, is cross-platform and an excellent example of a well designed application.
  • Shared Space: A visual organizer. While not currently being developed, you should download it and check it out. It’s a great program that looks great as well.
  • What’s funny is that the question mentioned Cocoa apps, such as “iPhoto.” iPhoto actually began as a Carbon application (it was available for Mac OS 9). However, they did rewrite it in Cocoa.

    The other interesting part is that the applications you mention have largely custom interfaces. There’s nothing stopping you from writing a custom interface in REALbasic either.

10 Comments »

January 13th 2006

Relative Paths

I needed a function to create a cross-platform relative path, and decided to make it into a module for everyone’s benefit. If you’ve ever wanted to, in addition to storing the SaveInfo, also save relative path information for files, you know it can be a tricky problem. However, this module adds to methods to the FolderItem class to do exactly this.

Module RelativePath
// Constants
Private Const kUpDirPath = ..
Private Const kSameDirPath = .
Private Const kPathSeparator = :

// Methods
Function CreateRelativePath(Extends fromFile As FolderItem, toFile As FolderItem) As String
If Not fromFile.Directory Then
fromFile = fromFile.Parent
End If

// Get a list of path parts by looping until the parent is nil.
Dim tmpf As FolderItem
Dim fromPathParts() As String
Dim toPathParts() As String

tmpf = fromFile
While tmpf <> Nil
fromPathParts.Append tmpf.Name
tmpf = tmpf.Parent
Wend

tmpf = toFile
While tmpf <> Nil
toPathParts.Append tmpf.Name
tmpf = tmpf.Parent
Wend

// If the top-level items don't match, we're on different volumes, and that ain't going to work
If fromPathParts( ubound( fromPathParts ) ) <> toPathParts( ubound( toPathParts ) ) Then
Return ""
End If

// Now, remove each of the common items from the tops of both arrays.
While ubound( fromPathParts ) >= 0 And ubound( toPathParts ) >= 0 _
And fromPathParts( ubound( fromPathParts ) ) = toPathParts( UBound( toPathParts ) )
fromPathParts.Remove( UBound( fromPathParts ) )
toPathParts.Remove( UBound( toPathParts ) )
Wend

// Now, for every "from" path part that's remaining, it's one level we must go up.

Dim relativePathParts() As String

If UBound( fromPathParts ) < 0 Then
// Just operate on the current directory
relativePathParts.Append kSameDirPath
Else
For i As Integer = 0 To UBound( fromPathParts )
relativePathParts.Append kUpDirPath
Next
End If

// Now that we're up to the same parent folder, we need to traverse down into
// each "toPathPart"
While UBound( toPathParts ) >= 0
relativePathParts.Append toPathParts.Pop
Wend

// Finally, return the result
Return join( relativePathParts, kPathSeparator )
End Function
Function ResolveRelativePath(Extends fromFile As FolderItem, path As String) As FolderItem
If Not fromFile.Directory Then fromFile = fromFile.Parent
// Split the path parts and operate on the parts
Dim outf As FolderItem = fromFile
Dim pathParts() As String = Split( path, kPathSeparator )

For i As Integer = 0 To UBound( pathParts )
If outf = Nil Then Exit
If pathParts(i) = kUpDirPath Then
outf = outf.Parent
ElseIf pathParts(i) = kSameDirPath Then
// Nothing, stay the same
Else
outf = outf.Child( pathParts(i) )
End If
Next

Return outf
End Function
End Module


Download this project

Example usage:

Dim f1, f2 As FolderItem
f1 = GetOpenFolderItem( "????" )
f2 = GetOpenFolderItem( "????" )

Dim relativePath As String
relativePath = f1.CreateRelativePath( f2 )
msgBox "RelativePath is " + relativePath

f2 = f1.ResolveRelativePath( relativePath )

msgBox "Resolved file is " + f2.AbsolutePath

3 Comments »

May 14th 2005

I’ll fix it myself

So, I was happily using 2005b8 this morning, constantly running into a bug that I told Mars about a few days ago. It wasn’t too bad — just had to close and reopen the project if I killed the app while the debugger was stopped at a breakpoint or exception. Not a biggie — needs to be fixed, but I could still work.

However, my BSP tree generation code wasn’t working quite right, and so I started debugging it. I clicked on an object, and boom. Ok.. maybe it was a random thing. Again.. boom. Ok.. annoying, let’s try doing it a different way… Boom.

So, I thought — “Not a big deal, I’ll just debug it in 5.5, and tell Mars about it later.” I then realized I’m using a lot of cool language features of 2005 in this project already. Ok. I’ll just fix it by code inspection.

Nope, not a chance. After 20 minutes, I gave up, and started getting frustrated. I thought, “I wish Mars was working right now.” I haven’t had VPN set up on my Mac since I upgraded to Tiger, so I wasn’t going to be able to check in any changes I made at home, so I tried working a bit longer without it.

Finally, my mind was set — I need to fix this bug now, or else I won’t work on the project again. Who cares that I wasn’t familiar with the debugger code, how it worked, or why it was crashing. I *had* to fix it. So, I did. :) Didn’t actually take too long, surprisingly.

So, if you can’t view objects in b8, wait for b9 ;) I’m going to go back to work now… :P

3 Comments »

February 27th 2005

NilObject Plans

Sorry for those on RSS feeds, this is going to be kind of crazy :) I’m going to start importing examples, too. What used to be on realbasic.maccoding.com is now moving directly to this website in a new category “Examples”. I’ve also added a category “Articles” to have all of my full-length articles (only two at the moment, but there are more in works), and also created a section on the side that will always show the latest articles. I plan on having a similar thing for the 5 latest examples, too.

Hmm… I wonder if those on RSS feeds can still hear me ;) If you do, let me know by leaving a comment! Gracias!

No Comments yet »

February 27th 2005

About the move

Well, I love WordPress. Things that weren’t that easy in b2evolution are very easy in WordPress, such as static pages that aren’t really blog entries. So, here I am after my migration. A few things to note, especially those on RSS feeds. I temporarily made a symbolic link from the old location of the RSS feed, but please update your subscription to the new location.

Now, time to try to spam-proof my WordPress installation. That is one thing I didn’t have to worry about with b2evolution as much — I think security through obscurity there. Anyways, the links (As well as some new ones) have been added again, and so has the events section. I also rewrote the About the Author section. Don’t worry, after I finish my REAL World slides for my talk, I’ll try to post a good tip or something :)

2 Comments »

Next »

  • Current Status

    • Life: Jonathan tweeted Another order from @zappos upgraded. All my orders have been upgraded to overnight... lucky, or is this standard? (Updated 13 hours, 50 minutes ago)
  • Pages

  • Meta