JMLogo now works, complete with support for creating programs and creating procedures within those programs! I've tested it (successfully) on the Motorola Razr V3 and the Pantech C300.
If you'd like to install JMLogo, open your phone's web browser and go to http://trivergia.com/jml.jad , and install it when prompted. Drop me a line if it works for you.
I know people aren't going to like this, but JMLogo only works on java-enabled phones. Most AT&T phones are java enabled, most Verizon phones aren't.
2009-02-09
2009-02-07
JMLogo released as open-source
I finally got around to releasing JMLogo (a logo interpreter for mobile phones) as open-source. For those out there that are interested in viewing (and editing) JMLogo's source, you can now get it by using subversion to checkout https://jwutils.googlecode.com/svn/trunk/projects/jmlogo/jmlogo and you can view the code online at http://code.google.com/p/jwutils/source/browse/#svn/trunk/projects/mobile/jmlogo/jmlogo .
2009-02-06
JSRSupport
Yet another of my applications for mobile phones is JSRSupport, a really simple application that I just wrote. It's intended for mobile phone developers, and displays which mobile phone related JSRs a phone supports.
You can download JSRSupport by visiting http://trivergia.com/jsrsupport/js.jad in your mobile phone's browser. JSRSupport is about 2KB in size, so keep in mind that you'll probably get charged by your wireless carrier for downloading stuff. Other than that, JSRSupport is free.
You can download JSRSupport by visiting http://trivergia.com/jsrsupport/js.jad in your mobile phone's browser. JSRSupport is about 2KB in size, so keep in mind that you'll probably get charged by your wireless carrier for downloading stuff. Other than that, JSRSupport is free.
2009-02-04
JMLogo - A Logo interpreter for mobile phones
These last few days, I've been working on JMLogo, a Logo interpreter for mobile phones. It's UI is somewhat based around the UI of Microsoft Windows Logo, but there are some changes. Currently, you can't create procedures, and it only has a limited set of built-in commands.
JMLogo is a MIDlet, so it will only work on Java-enabled phones. The Motorola razr v3 and the Pantech C300 both support JMLogo, although there's currently a bug that prevents JMLogo from starting up on the razr. JMLogo will not work on Verizon phones.
To download JMLogo, open your mobile phone's browser and go to http://trivergia.com/jml.jad and install it. If you have Sun's Wireless Toolkit installed, then you can go to that URL in your regular computer's browser, and a mobile phone emulator will open and run JMLogo.
I'm planning on releasing this as open-source, although I don't know when I'll get around to it. If anyone would like the code for the logo command interpreter itself, or for the whole JMLogo MIDlet, contact me, or post a comment, and I'll get around to releasing it as open-source sooner.
If it doesn't work for you, send me a comment. I just started work on this a few days ago (Monday to be precise), so it's bound to be full of bugs.
I'll be adding support for editing and saving programs, and editing and saving procedures within those programs.
JMLogo is a MIDlet, so it will only work on Java-enabled phones. The Motorola razr v3 and the Pantech C300 both support JMLogo, although there's currently a bug that prevents JMLogo from starting up on the razr. JMLogo will not work on Verizon phones.
To download JMLogo, open your mobile phone's browser and go to http://trivergia.com/jml.jad and install it. If you have Sun's Wireless Toolkit installed, then you can go to that URL in your regular computer's browser, and a mobile phone emulator will open and run JMLogo.
I'm planning on releasing this as open-source, although I don't know when I'll get around to it. If anyone would like the code for the logo command interpreter itself, or for the whole JMLogo MIDlet, contact me, or post a comment, and I'll get around to releasing it as open-source sooner.
If it doesn't work for you, send me a comment. I just started work on this a few days ago (Monday to be precise), so it's bound to be full of bugs.
I'll be adding support for editing and saving programs, and editing and saving procedures within those programs.
2009-02-02
Top-down and Bottom-up parsing
The topic of parsing is a rather complex one, so I've decided to post some examples of two parsing strategies: top-down parsing and bottom-up parsing.
Top-down parsing is determining how to interpret a particular piece of data by splitting around nonterminals first and sorting these into a hierarchy that ends with terminals. Bottom-up parsing is determining how to interpret a particular piece of data by resolving sets of terminals into terminals themselves, and braching up until the whole set has been resolved.
Let's take an example that most people are familiar with: mathematical expressions. We'll use this expression:
2 + 3 - 4 * 5 + 6
This is usually interpreted as (2 + 3) - ((4 * 5) + 6). So how would a computer arrive at that conclusion using each of the parsing methods above?
Let's take top-down parsing first. If we're using top-down parsing, then we'd look at the lowest-precedence operator that we have. In this case, it's the minus sign. We'd then split the expression around the minus sign, so we now have a new expression:
(2 + 3) - (4 * 5 + 6)
Now we analyze each of those in the same manner. In this case, 2 + 3 is now a terminal expression, so we can look up what we're supposed to do with the + operator (the answer is that we're supposed to add the number, if you didn't know that already) and do it, replacing the expression with the result. So in this case, we resolve 2 + 3 to 5, for a new expresion that looks like this:
(5) - (4 * 5 + 6)
Now we'll analyze 4 * 5 + 6. + is a lower precedence operator than *, so we'll split around + first. Now we have this expression:
(5) - ((4 * 5) + (6))
6 doesn't need resolving at this point, 4 * 5 is a terminal expression, so we can resolve that to 20. Now we have:
(5) - ((20) + (6))
20 + 6 is now a terminal expression, so we can resolve it to:
(5) - (26)
5 - 26 is also a terminal expression, so we can likewise resolve it to:
-21
which is the answer.
Now let's see how we'd go about resolving the expression using bottom-up parsing. Here's the expression again:
2 + 3 - 4 * 5 + 6
With bottom-up parsing, we find each occurrence of the highest-precedence operator, and resolve it first. In this case, * is the highest precedence operator. We'd split this out, then, into:
4 * 5
And then resolve it to
20
And then insert it back into the expression, for a new expression of
2 + 3 - 20 + 6
The next highest precedence operator is +. We'll work left-to-right, so the first one we're going to resolve is
2 + 3
This resolves to
5
So our expression now looks like
5 - 20 + 6
We'll do the same thing to the other + character, splitting it out to
20 + 6
and resolving it to
26
for a new expression of
5 - 26
The next highest precedence operator (and the only one left) is the - sign. We take the expression
5 - 26
and resolve it to
-21
which is our final answer.
Both top-down parsing and bottom-up parsing work for most applications. It's up to you to decide which one you want to use, although in my opinion bottom-up parsing is a lot simpler. You can just add some sort of while loop that checks to see if there are any operands in an expression, and if so, finds the highest one, then the leftmost one out of the appearances of the highest one, then resolves the members immediately surrounding it. This would be a little expensive, but it's very simple to implement.
Top-down parsing is determining how to interpret a particular piece of data by splitting around nonterminals first and sorting these into a hierarchy that ends with terminals. Bottom-up parsing is determining how to interpret a particular piece of data by resolving sets of terminals into terminals themselves, and braching up until the whole set has been resolved.
Let's take an example that most people are familiar with: mathematical expressions. We'll use this expression:
2 + 3 - 4 * 5 + 6
This is usually interpreted as (2 + 3) - ((4 * 5) + 6). So how would a computer arrive at that conclusion using each of the parsing methods above?
Let's take top-down parsing first. If we're using top-down parsing, then we'd look at the lowest-precedence operator that we have. In this case, it's the minus sign. We'd then split the expression around the minus sign, so we now have a new expression:
(2 + 3) - (4 * 5 + 6)
Now we analyze each of those in the same manner. In this case, 2 + 3 is now a terminal expression, so we can look up what we're supposed to do with the + operator (the answer is that we're supposed to add the number, if you didn't know that already) and do it, replacing the expression with the result. So in this case, we resolve 2 + 3 to 5, for a new expresion that looks like this:
(5) - (4 * 5 + 6)
Now we'll analyze 4 * 5 + 6. + is a lower precedence operator than *, so we'll split around + first. Now we have this expression:
(5) - ((4 * 5) + (6))
6 doesn't need resolving at this point, 4 * 5 is a terminal expression, so we can resolve that to 20. Now we have:
(5) - ((20) + (6))
20 + 6 is now a terminal expression, so we can resolve it to:
(5) - (26)
5 - 26 is also a terminal expression, so we can likewise resolve it to:
-21
which is the answer.
Now let's see how we'd go about resolving the expression using bottom-up parsing. Here's the expression again:
2 + 3 - 4 * 5 + 6
With bottom-up parsing, we find each occurrence of the highest-precedence operator, and resolve it first. In this case, * is the highest precedence operator. We'd split this out, then, into:
4 * 5
And then resolve it to
20
And then insert it back into the expression, for a new expression of
2 + 3 - 20 + 6
The next highest precedence operator is +. We'll work left-to-right, so the first one we're going to resolve is
2 + 3
This resolves to
5
So our expression now looks like
5 - 20 + 6
We'll do the same thing to the other + character, splitting it out to
20 + 6
and resolving it to
26
for a new expression of
5 - 26
The next highest precedence operator (and the only one left) is the - sign. We take the expression
5 - 26
and resolve it to
-21
which is our final answer.
Both top-down parsing and bottom-up parsing work for most applications. It's up to you to decide which one you want to use, although in my opinion bottom-up parsing is a lot simpler. You can just add some sort of while loop that checks to see if there are any operands in an expression, and if so, finds the highest one, then the leftmost one out of the appearances of the highest one, then resolves the members immediately surrounding it. This would be a little expensive, but it's very simple to implement.
2009-01-30
Mozilla Bespin
UPDATE: Mozilla released Bespin today. Their post is at http://labs.mozilla.com/2009/02/introducing-bespin/.
I was at a conference today, and heard about a new software program or something that's coming out: Mozilla Bespin (pronounced like "best pin", but without the "t" at the end of "best"). It's essentially an online IDE, and a dang good one at that. From what was shown at the conference, it has integrated syntax highlighting and formatting.
The editor was shown editing javascript. I don't know how it's syntax highlighting and editing features are supported for other languages.
Bespin has an integrated file explorer, used for exploring files within the project to be edited. It looks similar to Mac OS X's Finder when it's set to show each nested folder in a pane, with deeper levels to the right. (if someone knows mac's name for that type of view, post a comment and let me know.) You can open files and edit them, and then save them.
Bespin also has an integrated command line, which supports a lot of standard commands (such as rm and mkdir).
Bespin either has or will have support for integrating with version control systems. I can't remember if they said that it would integrate with CVS or Subversion, or both, but it was one of those.
Bespin is going to be officially released in a week or two, according to Mozilla, so let's see what happens. Until it officially comes out, take everything that I say here with a grain of salt, since I completely forgot a pen and paper (and my computer), so I couldn't take notes during the presentation.
I was at a conference today, and heard about a new software program or something that's coming out: Mozilla Bespin (pronounced like "best pin", but without the "t" at the end of "best"). It's essentially an online IDE, and a dang good one at that. From what was shown at the conference, it has integrated syntax highlighting and formatting.
The editor was shown editing javascript. I don't know how it's syntax highlighting and editing features are supported for other languages.
Bespin has an integrated file explorer, used for exploring files within the project to be edited. It looks similar to Mac OS X's Finder when it's set to show each nested folder in a pane, with deeper levels to the right. (if someone knows mac's name for that type of view, post a comment and let me know.) You can open files and edit them, and then save them.
Bespin also has an integrated command line, which supports a lot of standard commands (such as rm and mkdir).
Bespin either has or will have support for integrating with version control systems. I can't remember if they said that it would integrate with CVS or Subversion, or both, but it was one of those.
Bespin is going to be officially released in a week or two, according to Mozilla, so let's see what happens. Until it officially comes out, take everything that I say here with a grain of salt, since I completely forgot a pen and paper (and my computer), so I couldn't take notes during the presentation.
2009-01-26
Wood Puzzle
I've been looking for a particular wood puzzle at stores and such for the last few years, and haven't been able to find it, so I finally decided to create a 3D model of it. Has anyone seen a puzzle that looks like this?

Click to see a larger version
The puzzle is roughly the height of an electric outlet, maybe a bit taller.
There's a loop of string with a wood ball on the end (the wood ball on the string is about the same size as the one attached to the end of the dowel in the puzzle), and the string loops around the lower end of the dowel with the ring on it. The objective is to try to remove the loop of string. I'll probably create a 3D model of the string as well, but string is so much harder to create than rigid objects.
By the way, if anyone really cares, the image was modeled in Google SketchUp 7, and rendered in Kerkythea. A Google search should turn up the location to download and install those, if you're interested them. It took me about a half hour to model the puzzle, and it took the computer (no work by me during that time) about 10 minutes to ray-trace the image. If anyone wants the SketchUp source file, I'd be happy to provide it. Post your request as a comment, and I'll upload it.

Click to see a larger version
The puzzle is roughly the height of an electric outlet, maybe a bit taller.
There's a loop of string with a wood ball on the end (the wood ball on the string is about the same size as the one attached to the end of the dowel in the puzzle), and the string loops around the lower end of the dowel with the ring on it. The objective is to try to remove the loop of string. I'll probably create a 3D model of the string as well, but string is so much harder to create than rigid objects.
By the way, if anyone really cares, the image was modeled in Google SketchUp 7, and rendered in Kerkythea. A Google search should turn up the location to download and install those, if you're interested them. It took me about a half hour to model the puzzle, and it took the computer (no work by me during that time) about 10 minutes to ray-trace the image. If anyone wants the SketchUp source file, I'd be happy to provide it. Post your request as a comment, and I'll upload it.
2009-01-21
Cookie Recipe
NOTE: I'm continually improving this recipe, and I'm keeping this post up-to-date with the latest changes. So if it's different than the last time you saw it, that's why. Anyway, on to the original post...
I've frequently taken cookies to places that I'm going, and I've had a ton of people ask me for my recipe. I'm beginning to tire of writing it down over and over again, so I decided that I'd post it.
The recipe takes some of it's ingredients from my Grandma's cookie recipe, but a lot of things are different. For example, hers uses shortening, while this one uses butter, and less butter than the amount of shortening in her recipe.
My recipe uses powered eggs, which I've found turn out a lot better than using regular eggs. At the end of the recipe is a note on how to use real eggs. Be forewarned that I haven't made it with real eggs in over a year, so your results may vary. Also, I mention a specific brand of powdered eggs. You can try using other brands, but I've never used them, so, again, your results may vary.
When I make the recipe, I typically make it in a Bosch mixer, using the hook (if you use the Bosch mixer with beaters, they will snap). You can make it using just a wooden spoon, but you'll probably have to mix some of it together with your hands when it gets too thick to use a wooden spoon with. Don't try making it with electric beaters, as it gets so thick that it will burn them up.
Anyway, here's the recipe.
Group 1:
In a Bosch mixer (see note above for how to mix without one), mix together Group 1 until thoroughly mixed. You'll want to make sure that there aren't any lumps of brown sugar, or they will end up as crispy chunks in the cookies. Once you've mixed this together, mix Group 2 by itself in a cup. Slowly add this to Group 1 while mixing. It's a good idea to get out a rubber spatula and scrape the dough from the middle of the bowl toward the edges as the liquid from Group 2 has a tendency to pool in the middle of the bowl and not get mixed in. After you've done that and mixed a bit more, mix Group 3 by itself in a separate bowl. Make sure that all ingredients are evenly mixed together. Add this to the Group 1 / Group 2 mixture. Add Group 4, then mix slowly. Then add Group 5 and mix again, but not longer than about 30 seconds or the chocolate chips will start to fall apart.
Set your oven to 350 degrees Fahrenheit. Place a piece of Bakery Pan Lining Paper on a cookie tray (you can get some from Orson Gygi in Salt Lake City), or grease with butter. I've always used paper, so your results may vary with butter. Drop onto the cookie sheet in balls of dough about 1 1/2 inch in diameter, or slightly larger if you want. These should be spaced about 3 inches or so apart from each other. If you want square cookies, you can place them closer. Bake for about 8 to 12 minutes. (I bake mine for exactly 7 minutes 35 seconds, but your oven is likely to be different than mine. Try different baking times and see what works best.)
If I've forgotten anything, feel free to leave a comment. I once forgot to mention the temperature to bake them at when I was giving the recipe to something, and I hope I haven't done anything like that here.
I've frequently taken cookies to places that I'm going, and I've had a ton of people ask me for my recipe. I'm beginning to tire of writing it down over and over again, so I decided that I'd post it.
The recipe takes some of it's ingredients from my Grandma's cookie recipe, but a lot of things are different. For example, hers uses shortening, while this one uses butter, and less butter than the amount of shortening in her recipe.
My recipe uses powered eggs, which I've found turn out a lot better than using regular eggs. At the end of the recipe is a note on how to use real eggs. Be forewarned that I haven't made it with real eggs in over a year, so your results may vary. Also, I mention a specific brand of powdered eggs. You can try using other brands, but I've never used them, so, again, your results may vary.
When I make the recipe, I typically make it in a Bosch mixer, using the hook (if you use the Bosch mixer with beaters, they will snap). You can make it using just a wooden spoon, but you'll probably have to mix some of it together with your hands when it gets too thick to use a wooden spoon with. Don't try making it with electric beaters, as it gets so thick that it will burn them up.
Anyway, here's the recipe.
Group 1:
- 2 1/4 cups brown sugar
- 2 1/4 cups white sugar
- 6 cubes (3 cups) butter (works best if softened to the point that a tiny bit of it has melted)
- 3/4 cup hot water
- 1/4 cup vanilla
- 4 1/2 cups flour (white only; whole weat will cause the cookies to fall apart)
- 1 Tablespoon baking soda
- 1 Tablespoon salt
- 1/3 cup Honeyville Powdered Eggs (1/3 cup of the actual powder; do not reconstitute them)
- 6 cups rolled oats
- 4 cups chocolate chips (typically 2 bags)
In a Bosch mixer (see note above for how to mix without one), mix together Group 1 until thoroughly mixed. You'll want to make sure that there aren't any lumps of brown sugar, or they will end up as crispy chunks in the cookies. Once you've mixed this together, mix Group 2 by itself in a cup. Slowly add this to Group 1 while mixing. It's a good idea to get out a rubber spatula and scrape the dough from the middle of the bowl toward the edges as the liquid from Group 2 has a tendency to pool in the middle of the bowl and not get mixed in. After you've done that and mixed a bit more, mix Group 3 by itself in a separate bowl. Make sure that all ingredients are evenly mixed together. Add this to the Group 1 / Group 2 mixture. Add Group 4, then mix slowly. Then add Group 5 and mix again, but not longer than about 30 seconds or the chocolate chips will start to fall apart.
Set your oven to 350 degrees Fahrenheit. Place a piece of Bakery Pan Lining Paper on a cookie tray (you can get some from Orson Gygi in Salt Lake City), or grease with butter. I've always used paper, so your results may vary with butter. Drop onto the cookie sheet in balls of dough about 1 1/2 inch in diameter, or slightly larger if you want. These should be spaced about 3 inches or so apart from each other. If you want square cookies, you can place them closer. Bake for about 8 to 12 minutes. (I bake mine for exactly 7 minutes 35 seconds, but your oven is likely to be different than mine. Try different baking times and see what works best.)
If I've forgotten anything, feel free to leave a comment. I once forgot to mention the temperature to bake them at when I was giving the recipe to something, and I hope I haven't done anything like that here.
Subscribe to:
Posts (Atom)