Search Results: "davidw"

1 October 2023

Paul Wise: FLOSS Activities September 2023

Focus This month I didn't have any particular focus. I just worked on issues in my info bubble.

Changes

Issues

Review
  • Spam: reported 2 Debian bug reports
  • Debian wiki: RecentChanges for the month
  • Debian BTS usertags: changes for the month
  • Debian screenshots:
    • approved fzf lame lsd termshark vifm
    • rejected orthanc (private data), gpr/orthanc (Windows), qrencode (random QR codes), weboob-qt (chess website)

Administration
  • Debian IRC: fix #debian-pkg-security topic/metadata
  • Debian wiki: unblock IP addresses, approve accounts

Communication

Sponsors The SWH work was sponsored. All other work was done on a volunteer basis.

13 April 2011

David Welton: For sale: LangPop.com

I've been running at capacity for a while now, and something went "snap" recently, so I decided to take a few days off to clear my head a bit. One of the things that came to mind is that I have too many 'side project' things. I have had lots of fun (and a few flame wars) over the years with LangPop.com but I decided that it's another thing that should probably go, in order to simplify my life some. It's a fairly popular site amongst programmers, as I think it's the best of the bunch in terms of guaging an admittedly tricky subject like language popularity, but there's lots of room to add to it. I've got various ideas for whoever ends up buying it! About money: it doesn't earn a lot. Programmers, I think, are fairly blind to advertisements. In the right hands I think it could do better, but most likely, it would work best as a bit of branding/advertising for your own business, much as TIOBE's index has spread their name far and wide. For the time being, I'll accept private bids, and depending on how well that does or doesn't go, may consider using something like Flippa.com later. Write me at davidw@dedasys.com if you're interested. I'd be happy to share some numbers and information with you. Perhaps I'll update this posting with them too. What you get: everything! Historicaly data, code, scripts to manage it, the domain. It could use some cleaning up and love, but it does get the job done. Running it just takes a few minutes a month, so I could hold on to it with no trouble, but I've decided that I want one less thing to think about. Update: Some Numbers In the last year, according to Google Analytics, the site had: 174,645 visits. In the last month, it had 17,047 visits. Revenue? Think of it as zero and you won't be too far off. You would have to rework things significantly to make money from ads on it, I think. Hosting costs? Not sure, particularly, it's on my Linode. It utilizes Ruby on Rails, but creates static HTML pages, so it's fairly cheap.

16 February 2011

David Welton: The UnderPerformingStocks.com sale - halfway in

A few weeks ago, I had an "out-there" idea to try creating and selling a site at the same time. So far, it's not exactly raking in a major amount of cash: www.underperformingstocks.com is For Sale on Flippa! At $100 with a couple of bids, it doesn't look like I'll be able to retire on it! That said, I haven't spent a great deal of time on it, and part of the idea of the experiment was to limit the amount of time the 'new idea' would distract me from other things. I did hope to receive a few more "audience requests" in terms of what to build on Flippa.com, though. Hopefully, things will heat up a bit during the final two weeks of the auction, but I don't think "flipping" web sites is really a business I want to be in. It's been fun to see how much you can build with how little, though, what with all the widgets and API's out there these days. Since I'm a coder at heart, I also released some Ruby code that utlizes Google's stock screener API: https://github.com/davidw/google-screener - it's under the Apache license, and is kind of neat to play around with, I think, and is what I use to fetch information for the site.

3 May 2010

David Welton: Mochiweb proto-deb and hacking

I had some time over the weekend to play a bit with Mochiweb. It's a very nice little bit of work, but kind of strange for an open source project. I think both things come from the fact that it was built to do some very specific things in a business, and once those goals were accomplished, that suited the owner just fine. There is no nice/fancy project home page, no links to documentation, and in general, all of the stuff you're supposed to do for a successful open source project. The code, however, is good, fast, and pretty easy to deal with. Anyway, I wanted to use it for a thing or two I'm working on, so I created some .deb packaging for it. It's been ages since I've done that (indeed, I officially retired from Debian), so it's probably missing something, but I thought I'd throw it out there for people to have a look. The git repository is here: http://github.com/davidw/mochiweb - my changes live in the 'deb' branch. The big thing I've tried to do is make it so that if you have several mochiweb projects on the same machine, they'll all be started/stopped by the init scripts, if you so choose. What you do is add a file with the path to the application to the /etc/mochiweb/apps directory, and when you do /etc/init.d/mochiweb start, it will start all of those. At stop time, it will run the stop.sh script, which shuts things down. It runs things as the user that owns the start.sh script, unless it's root, in which case it simply doesn't run. The thing that's missing right now is a way to get the thing to write logs somewhere, and I'm not quite sure how to do that, so here's hoping someone will write in with a suggestion. The .deb file I generated ought to be attached to this post, although there are no guarantees that I'll keep it up to date.

12 January 2010

David Welton: Rough Estimates of the Dollar Cost of Scaling Web Platforms - Part I

I have been pondering the idea behind this article for a while, and finally had a bit of time to implement it. The basic idea is this: certain platforms have higher costs in terms of memory per concurrent connection. Those translate into increased costs in dollar terms.
Nota Bene: Having run LangPop.com for some time, I'm used to people getting hot and bothered about this or that aspect of statistics that are rough in nature, so I'm going to try and address those issues from the start, with more detail below. Methodology All tests were run like so: my new laptop with two cores and four gigs of memory was used as a server, and my older laptop was used to run the ab (Apache Benchmark) program - they're connected via ethernet. I built up to successive levels of concurrency, running first 1 concurrent connection, 2, 10, and so on and so forth. The "server" computer is running Ubuntu 9.10, "karmic". Platforms The platforms I tested: As stated above, it's pretty obvious that using Rails or Django for something so simple is overkill: Better Tests for the Future I would like to run similar tests with a more realistic application, but I simply don't have the time or expertise to sit down and write a blog, say, for all of the above platforms. If I can find a few volunteers, I'd be happy to discuss some rough ideas about what those tests ought to look like. Some ideas: Results With that out of the way, I do think the results are meaningful, and reflect something of what I've seen on various platforms in the real world. First of all, here we look at the total "VSZ" (as ps puts it) or Virtual Size of the process(es) in memory. Much of this might be shared, between libraries, and "copy on write" where applicable. The results are impressive: Rails, followed by Django and PHP eats up a lot of memory for each new concurrent connection. Rails, which I know fairly well, most likely suffers from several problems: 1) it includes a lot of code. That's actually a good thing if you're building a reasonably sized app that makes use of all it has to offer. 2) Its garbage collector doesn't play well with "copy on write". Which is what "Enterprise Ruby" aims to fix. Django and PHP are also fairly large, capable platforms when compared to something small and light like mochiweb. That said, excuses aside, Erlang and Mochiweb are very impressive in how little additional memory they utilize when additional concurrent connections are thrown at them. I was also impressed with Jetty. I don't have a lot of experience with Java on the web (I work more with J2ME for mobile phones), so I expected something a bit more "bloated", which is the reputation Java has. As we'll see below, Jetty does take up a lot of initial memory, but subsequent concurrent connections appear to not take up much. Of course, this is also likely another 'apples and oranges' comparison and it would be good to utilize a complete Java framework, rather than just a tiny web app with one JSP file. So what's this mean in real world terms of dollars and cents? As your Rails application gets more popular, you're going to have to invest relatively more money to make it scale, in terms of memory. For this comparison, I utilized the bytes/dollar that I'm getting for my Linode, which works out to 18,889,040.85 ($79.95 for 1440 MB a month). As we can see, to have a similar amount of concurrent users is essentially free for Mochiweb, whereas with Rails, it has a significant cost. This information is particularly relevant when deciding how to monetize a site: with Erlang and Jetty it would appear that scaling up to lots of users is relatively cheap, so even a small amount of revenue per user per month is going to be a profit, whereas with Rails, scaling up to huge numbers of users is going to be more expensive, so revenue streams such as advertising may not be as viable. It's worth noting that 37 signals, the company that created Rails, is a vocal supporter of charging money for products. There's another interesting statistic that I wanted to include as well. The previous graph shows the average cost per additional concurrent user, but this one shows how much the platform costs (using when there is just one user, so it acts as a sort of baseline: As we can see, Jetty is particularly expensive from this point of view. The default settings (on Ubuntu) seem to indicate that, for instance, the basic $20 a month Linode package would not be sufficient to run Jetty, plus a database, plus other software. I think that the Apache Worker number is off a bit, and may reflect settings made to handle a large number of connections, or perhaps a different MPM would make sense. Source Code / Spreadsheet The spreadsheet I put together is here: http://spreadsheets.google.com/ccc?key=0An76R90VwaRodElEYjVYQXpFRmtreGV3MEtsaWYzbXc&hl=en And the source code (admittedly not terribly well organized) is here: http://github.com/davidw/marginalmemory/

14 December 2009

David Welton: File Selector for Java ME

I recently did some work to make Hecl read files, which also means that it can execute Hecl scripts from the phone's memory. This is especially important for environments like Blackberry, where we will be distributing a signed version of the Hecl application. To create your own Hecl applications, instead of simply replacing the script in the .jar file, you can point to a script on the device's file system. This is also available for normal Java ME phones, but unfortunately, for an open source project, the cost of a code signing certificate are prohibitive (on Blackberry, it's only $20, so I bought one with my own money). In any case, as part of this effort, I developed a very simple 'file browser', which is used in Hecl to select a script to execute. The results are, like all of Hecl, available under an Apache license, which means that you can use it pretty much wherever you want: http://github.com/davidw/hecl/blob/master/files/org/hecl/files/FileFinder.java http://github.com/davidw/hecl/blob/master/files/org/hecl/files/FileFinderCallback.java Of course, if you spot any ways to improve it or fix problems with it, I'd appreciate it if you sent patches back.

8 April 2009

David Welton: New LangPop.com stats, open source bits and pieces

I released some new statistics on LangPop.com. There are some new things:
  • The normalized results are now user configurable - you can put in your own weights for the various data sources (such as Amazon, Craigslist, and so on), and see how the results change.
  • Freshmeat.net fiddled with their web site, and statistics are not going to be available this month. Hopefully they will be able to correct the problem soon.
  • On the other hand, I wrote some code to grab the data from Ohloh, so there's something new to look at while we wait for Freshmeat to come back on line.
So there is a fair amount going on. Hopefully Freshmeat will come back soon, and I can also add a few fixes to the IRC statistics which I've been thinking about. In the process of doing the above, I also managed to do some open source work, albeit of a minor nature:
  • I updated LangPop.com to use the Flotr Javascript chart library instead of Plotr. So I also updated my Ruby code to integrate it. It's a fairly thin layer at this point, but it does what I need. It's available here: http://github.com/davidw/chartr/tree/master
  • I did some hacking on the Simile Timeline code, (used here on LangPop.com), correcting a bug, and also creating a system to install the whole thing with a simple command. Normally, it's kind of difficult to just use the Simile code on your own site, so I created an (admittedly hacky) way of making it easier to install. That code is here: http://github.com/davidw/standalone-timeplot/tree/master
Oh, yeah, and we moved from Innsbruck, Austria back to Padova, Italy!

David Welton: New LangPop.com stats, open source bits and pieces

I released some new statistics on LangPop.com. There are some new things:
  • The normalized results are now user configurable - you can put in your own weights for the various data sources (such as Amazon, Craigslist, and so on), and see how the results change.
  • Freshmeat.net fiddled with their web site, and statistics are not going to be available this month. Hopefully they will be able to correct the problem soon.
  • On the other hand, I wrote some code to grab the data from Ohloh, so there's something new to look at while we wait for Freshmeat to come back on line.
So there is a fair amount going on. Hopefully Freshmeat will come back soon, and I can also add a few fixes to the IRC statistics which I've been thinking about. In the process of doing the above, I also managed to do some open source work, albeit of a minor nature:
  • I updated LangPop.com to use the Flotr Javascript chart library instead of Plotr. So I also updated my Ruby code to integrate it. It's a fairly thin layer at this point, but it does what I need. It's available here: http://github.com/davidw/chartr/tree/master
  • I did some hacking on the Simile Timeline code, (used here on LangPop.com), correcting a bug, and also creating a system to install the whole thing with a simple command. Normally, it's kind of difficult to just use the Simile code on your own site, so I created an (admittedly hacky) way of making it easier to install. That code is here: http://github.com/davidw/standalone-timeplot/tree/master
Oh, yeah, and we moved from Innsbruck, Austria back to Padova, Italy!

21 January 2009

David Welton: More Github

Before I get started, I want to make it quite clear that I have no problems with Github - au contraire, they provide a very nice service. What my speculation centers around is the social dynamics of Github. One of the Github guys writes a nice response to my original post, here: http://ozmm.org/posts/linux_vs_classic_dev_style.html First of all, apologies for the comment bug. In theory, it has been fixed by the Typo guys, I just need to find the time to upgrade. Chris mentions that it's possible to create a "SourceForge style" project on Github. I see that it's possible to add collaborators, so I guess that's what he means. I still find it a bit ugly to have things at .../davidw/... but that's not very important if the URL is at least stable, rather than hopping around to whoever has the latest fork and updates of the code in question. In my other post, I talked about people being less interested in doing what it takes to contribute to existing projects, rather than forking them, unless it's really called for. Here's a concrete example of how things might go wrong. At my current consulting gig, we were looking at utilizing actionwebservice to do some SOAP stuff. That code is not part of Rails anymore, but that's not the problem - surely someone has decided to take up maintenance of the gem, right? Well, yes... but let's look:
root@fortrock:~# gem1.8 search -r actionwebservice
*** REMOTE GEMS ***
actionwebservice (1.2.6)
datanoise-actionwebservice (2.2.2)
dougbarth-actionwebservice (2.1.1)
nmeans-actionwebservice (2.1.1)
So we have the original, clearly out of date, and three others. Yuck... I guess we'll use the 2.2.2 one, but who knows if perhaps the others contain some good stuff too? Let's Google it. http://www.google.com/search?hl=en&q=actionwebservice The first link is to a RubyForge project, which is basically dead. A few links down, there is a link talking about a more recent version, at the Datanoise site. However, it's one of many. Confusing. If you go to the github page for the datanoise version of actionwebservice, the README has this:
The latest Action Web Service version can be downloaded from http://rubyforge.org/projects/actionservice
Hrm. We were just there and that doesn't seem quite right... Sure, it's an easy enough oversight to ignore, but it adds to the confusion. Now, this is not really a serious problem, but do you see how it could get worse over time, as various people fork the code, write blog entries, and so on? It would get harder for someone interested in utilizing the code in question to ascertain which is "the" version. It's not hard to imagine situations where two forks add different bits of useful code. Typically, in situations like this, new users, those who don't know the code at all, are also the people least able to look through all the diffs and changes and log entries and what not in an attempt to merge any changes that might be useful. This leads to a "paradox of choice" type of problem. Another consideration, this one more positive, is that perhaps people are putting code in Github that, in the past, might have simply remained on their own computers, with no effort whatsoever to share it, so in that sense, Github might be doing people a service by at least making the code public. However, even in that case, if the service fills up with code that people have simply "thrown over the wall", rather than creating a genuine open source project, with a community, communication channels, and so on, it could get a reputation for having code that you have to handle with care, as a lot of is just stuff slapped up there without much thought to quality or continuity. Anyway, the Github guys have done a nice job with the service, and I'm sure they'll continue to improve it. Who knows, perhaps they have some good ideas about mitigating some of these potential problems that they'll be rolling out soon.

David Welton: More Github

Before I get started, I want to make it quite clear that I have no problems with Github - au contraire, they provide a very nice service. What my speculation centers around is the social dynamics of Github. One of the Github guys writes a nice response to my original post, here: http://ozmm.org/posts/linux_vs_classic_dev_style.html First of all, apologies for the comment bug. In theory, it has been fixed by the Typo guys, I just need to find the time to upgrade. Chris mentions that it's possible to create a "SourceForge style" project on Github. I see that it's possible to add collaborators, so I guess that's what he means. I still find it a bit ugly to have things at .../davidw/... but that's not very important if the URL is at least stable, rather than hopping around to whoever has the latest fork and updates of the code in question. In my other post, I talked about people being less interested in doing what it takes to contribute to existing projects, rather than forking them, unless it's really called for. Here's a concrete example of how things might go wrong. At my current consulting gig, we were looking at utilizing actionwebservice to do some SOAP stuff. That code is not part of Rails anymore, but that's not the problem - surely someone has decided to take up maintenance of the gem, right? Well, yes... but let's look:
root@fortrock:~# gem1.8 search -r actionwebservice
*** REMOTE GEMS ***
actionwebservice (1.2.6)
datanoise-actionwebservice (2.2.2)
dougbarth-actionwebservice (2.1.1)
nmeans-actionwebservice (2.1.1)
So we have the original, clearly out of date, and three others. Yuck... I guess we'll use the 2.2.2 one, but who knows if perhaps the others contain some good stuff too? Let's Google it. http://www.google.com/search?hl=en&q=actionwebservice The first link is to a RubyForge project, which is basically dead. A few links down, there is a link talking about a more recent version, at the Datanoise site. However, it's one of many. Confusing. If you go to the github page for the datanoise version of actionwebservice, the README has this:
The latest Action Web Service version can be downloaded from http://rubyforge.org/projects/actionservice
Hrm. We were just there and that doesn't seem quite right... Sure, it's an easy enough oversight to ignore, but it adds to the confusion. Now, this is not really a serious problem, but do you see how it could get worse over time, as various people fork the code, write blog entries, and so on? It would get harder for someone interested in utilizing the code in question to ascertain which is "the" version. It's not hard to imagine situations where two forks add different bits of useful code. Typically, in situations like this, new users, those who don't know the code at all, are also the people least able to look through all the diffs and changes and log entries and what not in an attempt to merge any changes that might be useful. This leads to a "paradox of choice" type of problem. Another consideration, this one more positive, is that perhaps people are putting code in Github that, in the past, might have simply remained on their own computers, with no effort whatsoever to share it, so in that sense, Github might be doing people a service by at least making the code public. However, even in that case, if the service fills up with code that people have simply "thrown over the wall", rather than creating a genuine open source project, with a community, communication channels, and so on, it could get a reputation for having code that you have to handle with care, as a lot of is just stuff slapped up there without much thought to quality or continuity. Anyway, the Github guys have done a nice job with the service, and I'm sure they'll continue to improve it. Who knows, perhaps they have some good ideas about mitigating some of these potential problems that they'll be rolling out soon.

9 December 2008

David Welton: Ruby Shootout

Antonio Cangiano has an interesting set of Ruby benchmarks here: http://antoniocangiano.com/2008/12/09/the-great-ruby-shootout-december-2008/ The two results that were interesting to me were that JRuby does so well, and that REE ("Ruby Enterprise Edition") was a significant improvement over "plain old Ruby" too. I knew that the JRuby guys have done a lot of work, and done a nice job with their implementation, but didn't realize just how good it was. REE is a clever idea, but not that much code, and aimed at memory usage, not CPU, so it's interesting to see how much faster it ends up according to these tests. A few things that would be interesting to see:
  • Raw startup time. Yeah, that probably penalizes JRuby, but it is still a scripting language, and using it like one isn't possible if it takes forever to start up. How much slower is it?
  • A more detailed look at REE's times. How is it that it's that much faster because of some memory tweaks?
In any case, it's a nice bit of work by Antonio - grazie! Update - old, slow davidw missed the fact that there was a startup time benchmark included. Oops.

David Welton: Ruby Shootout

Antonio Cangiano has an interesting set of Ruby benchmarks here: http://antoniocangiano.com/2008/12/09/the-great-ruby-shootout-december-2008/ The two results that were interesting to me were that JRuby does so well, and that REE ("Ruby Enterprise Edition") was a significant improvement over "plain old Ruby" too. I knew that the JRuby guys have done a lot of work, and done a nice job with their implementation, but didn't realize just how good it was. REE is a clever idea, but not that much code, and aimed at memory usage, not CPU, so it's interesting to see how much faster it ends up according to these tests. A few things that would be interesting to see: In any case, it's a nice bit of work by Antonio - grazie! Update - old, slow davidw missed the fact that there was a startup time benchmark included. Oops.

30 October 2008

David Welton: Slicehost Migration

Phew... that was a lot of work. I have a bunch of small sites that I migrated to slicehost, and at the same time upgraded to Rails 2.1. Here are my notes:
  • x86_64 sucks up memory in a bad way. On a 32-bit x86 system davidw 20089 0.0 0.1 3320 1428 pts/1 S+ 11:41 0:00 ruby and on x86-64: davidw 24197 0.0 0.1 16756 1968 pts/0 S+ 18:33 0:00 ruby Ouch! That means that you'll need more memory, and thus to spend more money, to run code that might have fit decently in a similar amount of memory on an x86 machine. For instance, my old server had a gig, and was running low on memory, so on slicehost, I set up one 512 meg slice to handle PostgreSQL, and a gig slice to handle Apache and Rails. The database slice is performing ok, but the 'web' one is kind of iffy in terms of memory. Part of the problem here, I will admit, is that Rails is a memory hog, but still, I had hoped to come out ahead by moving from a machine with 1 gig to two machines with 1.5 gigs between them, and instead I'm more or less where I was before.
  • I got caught up in a bit of a mess with Rails and the Ubuntu Intrepid update. I prefer to manage the Ruby stuff with gems, rather than traditional .deb package management, as I've had better luck with that in the past. I do use some of the system packages though, such as libpgsql-ruby1.8. However, the maintainers did something kind of ugly with the package: they swapped out the actual code from one code base to another - "Switched upstream source from ruby-postgres to ruby-pg". Which changes the way you load it, and perhaps a few other things as well. I think I would have been happier seeing the package renamed or something, as all of a sudden, programs stopped working.
  • I really like the ability to resize slices. I started both my slices at the 256 size, and then made them bigger when I was ready to put them into production. The process is not instantaneous, but it's pretty handy if you need more capacity in a hurry. Adding new slices is also fast.
So, all in all, I'm happy with the move, although the memory issue is irritating.

David Welton: Slicehost Migration

Phew... that was a lot of work. I have a bunch of small sites that I migrated to slicehost, and at the same time upgraded to Rails 2.1. Here are my notes: So, all in all, I'm happy with the move, although the memory issue is irritating.

22 April 2008

David Welton: To a good home: Linux Incompatibility List

I originally had the idea for a list to keep track of stuff that doesn't work with Linux something like 12 years ago. I built an initial version, that proved reasonably popular at the time, but then the place it was hosted had some problems, and I was busy with other things. I finally got around to building a new version four or five years ago, and it's been doing ok since then, but with a baby on the way, I've been thinking of things to get rid of, and this is not something I do active work on, so maybe it would be best to find a new home for the site, located at http://www.leenooks.com. Here's the catch: It currently runs on my own server, and uses DedaWiki, an open source, Rails-based Wiki, as well as PostgreSQL. You would have to relocate it to your own server. So, if you're interested, contact me: davidw@dedasys.com. If I don't find the right person, no worries; I'll keep maintaining it for a while yet.

11 March 2008

David Welton: Mass customization of Android applications

As I mentioned in an earlier article, one of the goals for the Android port of Hecl is to make it as easy as it is to create Java ME applications:
  1. Write the script.
  2. Wrap it up and send it to the phone.
No "compiling" (well, none that's obvious or explicitly asked of the user, at least, as we'll see) or fiddling with build files or writing new Java classes or any of that. We're still not there yet 100%, but I did managed to hack together a system that, from an original Hecl.apk, creates a new application that can be installed on the emulator. This is tricky, because Android looks at the uniqueness of the package and class utilized for the application, meaning you can't just rename Hecl.apk to Foo.apk and install it as a separate app. The emulator will overwrite your old copy of Hecl. Here's what we go through to make this work. Be forewarned - big, ugly hacks that are not for the faint of heart follow. The command line isn't exactly beautiful either, but it beats all the individual steps that it replaces, as we'll see.
java -jar /home/davidw/workshop/hecl/jars/AndroidBuilder.jar -android \
    /opt/android-sdk_m5-rc15_linux-x86/ -class Example -label "Hecl Example" \
    -package my.example -permissions ACCESS_LOCATION,ACCESS_GPS
  1. The first thing that needs to be done is to replace the AndroidManifest.xml that is contained within our "template" application, that resides in Hecl.apk, a copy of which is contained within the AndroidBuilder jar file. Since the compiled version of the xml file is a binary format that hasn't been reverse engineered or documented yet, the best way to do this was to simply:
  2. Write out a new AndroidManifest.xml in our temporary work directory that uses our provided package name, label and class.
  3. Using the aapt command in the SDK, create a new, empty apk file, specifying the newly created xml file as the manifest file to use.
  4. Now we can extract the compiled version of the xml file, for later use.
  5. At this point, we extract a version of Hecl.jar contained within AndroidBuilder.jar to the temp directory.
  6. Now we need to generate some Java classes that correspond to the new package and class names that we've passed to AndroidBuilder. Ideally, I would have done this with some tools to write the byte code out directly, since the classes are so simple: all they do is subclass the Hecl and SubHecl classes so that methods fall through to those.
  7. But instead, I just write out the .java code and compile it.
  8. The two new classes get stashed inside the copy of Hecl.jar that we're working with.
  9. We now use the dx command to compile the entire jar into the classes.dex file that Android uses.
  10. Since Hecl.apk is just a zip file, we can replace the AndroidManifest.xml file and classes.dex file with the new files we have created.
  11. At this point, we rename the whole works, and move it out of the temporary working directory to the current directory.
Phew! That's a lot of ugly work. It's obvious that a lot of this should and could be handled in a less "brute force" way, but for now it gets the job done. The only thing left to do is replace the Hecl script, which is very easy:
zip -r Example.apk res/raw/script.hcl
This makes it possible to whip out new Android Hecl scripts without carrying around a lot of project infrastructure - all you really need is AndroidBuilder.jar and your script. Naturally, all of this is very much a work in progress, so it may not work as advertised, and, given the mess that we go through, bugs are likely as well. Do report them if you find any, and have fun! In the future, it will be necessary to make it so that it's possible to add resources to the apk file with zip, and have them be available to Hecl applications, which was actually the focus of the previous article.

27 February 2007

David Welton: php4, php5, objects and cloning

We take a very simple class:
class Foobar  
var $myvar = 1;
function Foobar()  
 
function printit()  
    echo "var is " . $this->myvar . "\n";
 
function incr()  
    $this->myvar += 1;
 
 
$f = new Foobar();
$a = $f;
$b = $f;
$a->printit();
$a->incr();
$b->printit();
And run it with PHP4 and PHP5:
davidw@byron:/tmp$ php4 foobar.php 
var is 1
var is 1
davidw@byron:/tmp$ php5 foobar.php 
var is 1
var is 2
Apparently it's possible to use the clone function to do what we want with PHP5, but... that means we have to track down every single place in the code where there is something like $foo = $bar. And hope that we got them all, because otherwise subtle bad things might happen. The codebase I've inherited isn't great to begin with, and hunting down every object copy is bound to be torture. Ouch. Update It's been pointed out that my description of exactly what's happening internally isn't correct. However, from my point of view, the end result is the same: a massive search and replace operation in order to obtain the "old" behavior by using clone. Most likely, this means that we won't be able to upgrade soon, which means that we won't be able to take advantage of some of the nice new PHP5 features, which will slow down other works in progress. For want of a nail...

19 March 2006

Clint Adams: This report is flawed, but it sure is fun

91D63469DFdnusinow1243
63DEB0EC31eloy
55A965818Fvela1243
4658510B5Amyon2143
399B7C328Dluk31-2
391880283Canibal2134
370FE53DD9opal4213
322B0920C0lool1342
29788A3F4Cjoeyh
270F932C9Cdoko
258768B1D2sjoerd
23F1BCDB73aurel3213-2
19E02FEF11jordens1243
18AB963370schizo1243
186E74A7D1jdassen(Ks)1243
1868FD549Ftbm3142
186783ED5Efpeters1--2
1791B0D3B7edd-213
16E07F1CF9rousseau321-
16248AEB73rene1243
158E635A5Erafl
14C0143D2Dbubulle4123
13D87C6781krooger(P)4213
13A436AD25jfs(P)
133D08B612msp
131E880A84fjp4213
130F7A8D01nobse
12F1968D1Bdecklin1234
12E7075A54mhatta
12D75F8533joss1342
12BF24424Csrivasta1342
12B8C1FA69sto
127F961564kobold
122A30D729pere4213
1216D970C6eric12--
115E0577F2mpitt
11307D56EDnoel3241
112BE16D01moray1342
10BC7D020Aformorer-1--
10A7D91602apollock4213
10A51A4FDDgcs
10917A225Ejordi
104B729625pvaneynd3123
10497A176Dloic
962F1A57Fpa3aba
954FD2A58glandium1342
94A5D72FErafael
913FEFC40fenio-1--
90AFC7476rra1243
890267086duck31-2
886A118E6ch321-
8801EA932joey1243
87F4E0E11waldi-123
8514B3E7Cflorian21--
841954920fs12--
82A385C57mckinstry21-3
825BFB848rleigh1243
7BC70A6FFpape1---
7B70E403Bari1243
78E2D213Ajochen(Ks)
785FEC17Fkilian
784FB46D6lwall1342
7800969EFsmimram-1--
779CC6586haas
75BFA90ECkohda
752B7487Esesse2341
729499F61sho1342
71E161AFBbarbier12--
6FC05DA69wildfire(P)
6EEB6B4C2avdyk-12-
6EDF008C5blade1243
6E25F2102mejo1342
6D1C41882adeodato(Ks)3142
6D0B433DFross12-3
6B0EBC777piman1233
69D309C3Brobert4213
6882A6C4Bkov
66BBA3C84zugschlus4213
65662C734mvo
6554FB4C6petere-1-2
637155778stratus
62D9ACC8Elars1243
62809E61Ajosem
62252FA1Afrank2143
61CF2D62Amicah
610FA4CD1cjwatson2143
5EE6DC66Ajaldhar2143
5EA59038Esgran4123
5E1EE3FB1md4312
5E0B8B2DEjaybonci
5C9A5B54Esesse(Ps,Gs) 2341
5C4CF8EC3twerner
5C2FEE5CDacid213-
5C09FD35Atille
5C03C56DFrfrancoise---1
5B7CDA2DCxam213-
5A20EBC50cavok4214
5808D0FD0don1342
5797EBFABenrico1243
55230514Asjackman
549A5F855otavio-123
53DC29B41pdm
529982E5Avorlon1243
52763483Bmkoch213-
521DB31C5smr2143
51BF8DE0Fstigge312-
512CADFA5csmall3214
50A0AC927lamont
4F2CF01A8bdale
4F095E5E4mnencia
4E9F2C747frankie
4E9ABFCD2devin2143
4E81E55C1dancer2143
4E38E7ACFhmh(Gs)1243
4E298966Djrv(P)
4DF5CE2B4huggie12-3
4DD982A75speedblue
4C671257Ddamog-1-2
4C4A3823Ekmr4213
4C0B10A5Bdexter
4C02440B8js1342
4BE9F70EAtb1342
4B7D2F063varenet-213
4A3F9E30Eschultmc1243
4A3D7B9BClawrencc2143
4A1EE761Cmadcoder21--
49DE1EEB1he3142
49D928C9Bguillem1---
49B726B71racke
490788E11jsogo2143
4864826C3gotom4321
47244970Bkroeckx2143
45B48FFAEmarga2143
454E672DEisaac1243
44B3A135Cerich1243
44597A593agmartin4213
43FCC2A90amaya1243
43F3E6426agx-1-2
43EF23CD6sanvila1342
432C9C8BDwerner(K)
4204DDF1Baquette
400D8CD16tolimar12--
3FEC23FB2bap34-1
3F972BE03tmancill4213
3F801A743nduboc1---
3EBEDB32Bchrsmrtn4123
3EA291785taggart2314
3E4D47EC1tv(P)
3E19F188Etroyh1244
3DF6807BEsrk4213
3D2A913A1psg(P)
3D097A261chrisb
3C6CEA0C9adconrad1243
3C20DF273ondrej
3B5444815ballombe1342
3B1DF9A57cate2143
3AFA44BDDweasel(Ps,Gs) 1342
3AA6541EEbrlink1442
3A824B93Fasac3144
3A71C1E00turbo
3A2D7D292seb128
39ED101BFmbanck3132
3969457F0joostvb2143
389BF7E2Bkobras1--2
386946D69mooch12-3
374886B63nathans
36F222F1Fedelhard
36D67F790foka
360B6B958geiger
3607559E6mako
35C33C1B8dirson
35921B5D8ajmitch
34C1A5BE5sjq
3431B38BApxt312-
33E7B4B73lmamane2143
327572C47ucko1342
320021490schepler1342
31DEB8EAEgoedson
31BF2305Akrala(Gs)3142
319A42D19dannf21-4
3174FEE35wookey3124
3124B26F3mfurr21-3
30A327652tschmidt312-
3090DD8D5ingo3123
30813569Fjeroen1141
30644FAB7bas1332
30123F2F2gareuselesinge1243
300530C24bam1234
2FD6645ABrmurray-1-2
2F95C2F6Dchrism(P)
2F9138496graham(Gs)3142
2F5D65169jblache1332
2F28CD102absurd
2F2597E04samu
2F0B27113patrick
2EFA6B9D5hamish(P)3142
2EE0A35C7risko4213
2E91CD250daigo
2D688E0A7qjb-21-
2D4BE1450prudhomm
2D2A6B810joussen
2CFD42F26dilinger
2CEE44978dburrows1243
2CD4C0D9Dskx4213
2BFB880A3zeevon
2BD8B050Droland3214
2B74952A9alee
2B4D6DE13paul
2B345BDD3neilm1243
2B28C5995bod4213
2B0FA4F49schoepf
2B0DDAF42awoodland
2A8061F32osamu4213
2A21AD4F9tviehmann1342
299E81DA0kaplan
2964199E2fabbe3142
28DBFEC2Fpelle
28B8D7663ametzler1342
28B143975martignlo
288C7C1F793sam2134
283E5110Fovek
2817A996Atfheen
2807CAC25abi4123
2798DD95Cpiefel
278D621B4uwe-1--
26FF0ABF2rcw2143
26E8169D2hertzog3124
26C0084FCchrisvdb
26B79D401filippo-1--
267756F5Dfrn2341
25E2EB5B4nveber123-
25C6153ADbroonie1243
25B713DF0djpig1243
250ECFB98ccontavalli(Gs)
250064181paulvt
24F71955Adajobe21-3
24E2ECA5Ajmm4213
2496A1827srittau
23E8DCCC0maxx1342
23D97C149mstone(P)2143
22DB65596dz321-
229F19BD1meskes
21F41B907marillat1---
21EB2DE66boll
21557BC10kraai1342
2144843F5lolando1243
210656584voc
20D7CA701steinm
205410E97horms
1FC992520tpo-14-
1FB0DFE9Bgildor
1FAEEB4A9neil1342
1F7E8BC63cedric21--
1F2C423BCzack1332
1F0199162kreckel4214
1ECA94FA8ishikawa2143
1EAAC62DFcyb---1
1EA2D2C41malattia-312
1E77AC835bcwhite(P)
1E66C9BB0tach
1E145F334mquinson2143
1E0BA04C1treinen321-
1DFE80FB2tali
1DE054F69azekulic(P)
1DC814B09jfs
1CB467E27kalfa
1C9132DDByoush-21-
1C87FFC2Fstevenk-1--
1C2CE8099knok321-
1BED37FD2henning(Ks)1342
1BA0A7EB5treacy(P)
1B7D86E0Fcmb4213
1B62849B3smarenka2143
1B3C281F4alain2143
1B25A5CF1omote
1ABA0E8B2sasa
1AB474598baruch2143
1AB2A91F5troup1--2
1A827CEDEafayolle(Gs)
1A6C805B9zorglub2134
1A674A359maehara
1A57D8BF7drew2143
1A269D927sharky
1A1696D2Blfousse1232
19BF42B07zinoviev--12
19057B5D3vanicat2143
18E950E00mechanix
18BB527AFgwolf1132
18A1D9A1Fjgoerzen
18807529Bultrotter2134
1872EB4E5rcardenes
185EE3E0Eangdraug12-3
1835EB2FFbossekr
180C83E8Eigloo1243
17B8357E5andreas212-
17B80220Dsjr(Gs)1342
17796A60Bsfllaw1342
175CB1AD2toni1---
1746C51F4klindsay
172D03CB1kmuto4231
171473F66ttroxell13-4
16E76D81Dseanius1243
16C63746Dhector
16C5F196Bmalex4213
16A9F3C38rkrishnan
168021CE4ron---1
166F24521pyro-123
1631B4819anfra
162EEAD8Bfalk1342
161326D40jamessan13-4
1609CD2C0berin--1-
15D8CDA7Bguus1243
15D8C12EArganesan
15D64F870zobel
159EF5DBCbs
157F045DCcamm
1564EE4B6hazelsct
15623FC45moronito4213
1551BE447torsten
154AD21B5warmenhoven
153BBA490sjg
1532005DAseamus
150973B91pjb2143
14F83C751kmccarty12-3
14DB97694khkim
14CD6E3D2wjl4213
14A8854E6weinholt1243
14950EAA6ajkessel
14298C761robertc(Ks)
142955682kamop
13FD29468bengen-213
13FD25C84roktas3142
13B047084madhack
139CCF0C7tagoh3142
139A8CCE2eugen31-2
138015E7Ethb1234
136B861C1bab2143
133FC40A4mennucc13214
12C0FCD1Awdg4312
12B05B73Arjs
1258D8781grisu31-2
1206C5AFDchewie-1-1
1200D1596joy2143
11C74E0B7alfs
119D03486francois4123
118EA3457rvr
1176015EDevo
116BD77C6alfie
112AA1DB8jh
1128287E8daf
109FC015Cgodisch
106468DEBfog--12
105792F34rla-21-
1028AF63Cforcer3142
1004DA6B4bg66
0.zufus-1--
0.zoso-123
0.ykomatsu-123
0.xtifr1243
0.xavier-312
0.wouter2143
0.will-132
0.warp1342
0.voss1342
0.vlm2314
0.vleeuwen4312
0.vince2134
0.ukai4123
0.tytso-12-
0.tjrc14213
0.tats-1-2
0.tao1--2
0.stone2134
0.stevegr1243
0.smig-1-2
0.siggi1-44
0.shaul4213
0.sharpone1243
0.sfrost1342
0.seb-21-
0.salve4213
0.ruoso1243
0.rover--12
0.rmayr-213
0.riku4123
0.rdonald12-3
0.radu-1--
0.pzn112-
0.pronovic1243
0.profeta321-
0.portnoy12-3
0.porridge1342
0.pmhahn4123
0.pmachard1--2
0.pkern3124
0.pik1--2
0.phil4213
0.pfrauenf4213
0.pfaffben2143
0.p21243
0.ossk1243
0.oohara1234
0.ohura-213
0.nwp1342
0.noshiro4312
0.noodles2134
0.nomeata2143
0.noahm3124
0.nils3132
0.nico-213
0.ms3124
0.mpalmer2143
0.moth3241
0.mlang2134
0.mjr1342
0.mjg591342
0.merker2--1
0.mbuck2143
0.mbrubeck1243
0.madduck4123
0.mace-1-2
0.luther1243
0.luigi4213
0.lss-112
0.lightsey1--2
0.ley-1-2
0.ldrolez--1-
0.lange4124
0.kirk1342
0.killer1243
0.kelbert-214
0.juanma2134
0.jtarrio1342
0.jonas4312
0.joerg1342
0.jmintha-21-
0.jimmy1243
0.jerome21--
0.jaqque1342
0.jaq4123
0.jamuraa4123
0.iwj1243
0.ivan2341
0.hsteoh3142
0.hilliard4123
0.helen1243
0.hecker3142
0.hartmans1342
0.guterm312-
0.gniibe4213
0.glaweh4213
0.gemorin4213
0.gaudenz3142
0.fw2134
0.fmw12-3
0.evan1--2
0.ender4213
0.elonen4123
0.eevans13-4
0.ean-1--
0.dwhedon4213
0.duncf2133
0.ds1342
0.dparsons1342
0.dlehn1243
0.dfrey-123
0.deek1--2
0.davidw4132
0.davidc1342
0.dave4113
0.daenzer1243
0.cupis1---
0.cts-213
0.cph4312
0.cmc2143
0.clebars2143
0.chaton-21-
0.cgb-12-
0.calvin-1-2
0.branden1342
0.brad4213
0.bnelson1342
0.blarson1342
0.benj3132
0.bayle-213
0.baran1342
0.az2134
0.awm3124
0.atterer4132
0.andressh1---
0.amu1--2
0.akumria-312
0.ajt1144
0.ajk1342
0.agi2143
0.adric2143
0.adejong1243
0.adamm12--
0.aba1143