Archive for the 'REALBasic' Category

03/09 Programming, 빨리빨리, and Translation

Appart from a couple of inaccuracies, this is a good translation of Teach Yourself Programming in Ten Years by Peter Norvig. That a document which starts with the question Why is everyone in such a rush? was translated into Korean – and the link to that translation is at the top of the list… – is definitely amusing, since we know the maladive penchant our [ex-]hosts have for speed over accuracy. If you’re learning Korean, it’s a good sample to work from.

Learn at least a half dozen programming languages. Include one language that supports class abstractions (like Java or C++), one that supports functional abstraction (like Lisp or ML), one that supports syntactic abstraction (like Lisp), one that supports declarative specifications (like Prolog or C++ templates), one that supports coroutines (like Icon or Scheme), and one that supports parallelism (like Sisal).

Hmmph. I guess that list could use some upgrading, since the hype languages of the 21st Century are mostly not in there, and at least one language quoted here [Icon] is not developed any longer – which is a shame, I like Icon… As for Prolog, was it ever alive? ;-)

Python will match a few categories here, my favorite, RB, too, Erlang will cover a lot of ground for you here – not that I am conversant [yet!] in Erlang, but I’m learning! – and while C may come up short, most of these languages were/are written in C. Of course, if you aim to achieve stable and well-performing concurrent programming in C, you’ll end up with Erlang, as they say… :D I don’t think I’ll ever wrap my head around Lisp/Scheme – not that I didn’t try… – and I find Java and C++ repulsive and offending, but it’s probably just a matter of taste and education [or lack thereof…?].

But in the end, be it computer languages or human ones, 10 years is a minimum. Practice makes good, and education alone won’t take you very far [case in point: the profs I had at the Uni. You could tell those who had practiced their language skills and those who had kept their knowledge at the academic level…].

Anyway, this is an attempt at tagging

12/22 Updated curllib4RB

From its home page:

Features:
There are three methods available:

  • getFTP(URL As String, targetFolderItem As FolderItem, isSSL As Integer)
  • putFTP(file2upload As FolderItem, Login As String, Pwd As String, URL As String, isSSL As Integer)
  • curllib.getHTTP(URL As String) As String

isSSL can be set with: curllib.SSL_TRANSFER and curllib.NO_SSL

This little dylib was meant to be used mainly for [S]FTP transfers, but since it’s all there, I added the HTTP[S] get, and could possibly add more. Useful for quick jobbies, I guess…

12/01 curllib For RB

I have posted here a preliminary version of curllib For RB, a dylib + RB Module that makes [S]FTP transfers in RB easy; lemme rephrase that: possible and easy… It is based on libcurl and works well enough. There are some rough edges left, but for a first draft, it is quite good, if I may say so myself… :-)

10/23 fPic news

I have fixed a couple of bugs, and added one interesting feature: fPic.displayImage(). It uses GLUT to open a window and OpenGL to draw the fPic. The code is crude in the sense that it’s mono-image only [create two fPic, display both and watch my code make a pig’s breakfast of your efforts], and doesn’t care much about checking your screen bounds vs the image’s. That’ll come in time. But it’s freaking fast. Like, very. Even on my tired TiBook, the most time-consuming task is creating the window. Copying bits to the buffer is something C code and PowerPC do well and fast.

I am not sure whether a command-line application [the intended target of fPic] is really in need of a GUI solution, even a limited one, but it sure comes in handy for me when checking the execution of new functions in fPic.

08/30 fPic Beta

I have released a beta of fPic – on the RB-NUG and [unofficial] RB/FR lists and on RB Garage. Some feedback already from the French side of the programmosphere – despite the language barrier, as the docs are in English. We’ll see. I am to hand over an article – like three months late – that will tie in nicely, as it is the second part of Pictures and Dynamic Libraries: a poor man’s plugin, which introduces the basics of fPics. The second part will delve deeper in the mechanics of linking C code and RB code in an OOP fashion – hopefully.

From the docs:

fPic is a two-part project aiming at providing a replacement Picture class for command-line applications [which notoriously lack any graphic capabilities]. I say two-part because it is split into a dynamic library [manip.dylib] and an RB class, fPic. The dylib handles the heavy-lifting, while the fPic class provides a [more or less] seamless way for RB programmers to manipulate images in CLI applications. I hope to be able, in the end, to produce a library that will have zero dependencies, or at least zero exotic ones (like things usually installed via Fink), but for the moment, some things are necessary, as doing without them would either cripple fPic, or make it too hard to build from the get-go.

And of course, this is a Mac OS X only library. I am planning to make a Linux version, some day, when the Mac version is stabilized. The Linux version, however, would have fewer functionalities, as I can’t use the Accelerate [FreeRotate, ContrastStretch and Equalize] and CoreGraphics [PDF files] frameworks there.

I have provided a few sample programmes, which show some of the things that can be done:

* fPicTester
fPicTester showcases some of the capabilities of fPic. It requires the images included in the distribution folder. The resulting image, Result,jpg, is opened in Preview.

* jpeger
jpeger is a small utility that takes a file image, a destination folder or filename, and some options, and converts the source image to a JPEG image. On success, if only one page was converted [in the case of PDF files, you may request one or more pages], the converted JPEG is opened in Preview.

* OnDemandPDF
This is a combination of a command-line app and some PHP. Put this folder inside ~/Sites/ so that it is accessible from your localhost [you’ll need Apache and PHP up and running of course]. Put some PDFs inside the docs subfolder, and access it from your favourite browser:

http://localhost/~yourNick/OnDemandPDF/
Click on one of the links, to view a document, and read it “online”.

This is a very early beta version, although I do use it myself in a couple of projects, so far without major problems. There are issues yet to be solved, see the docs included in the distribution, and feedback would be appreciated.

You can get the current beta here