Skip to content

Tools of the trade

Technologies of use:

  • iPhone Resources
  • GoogleApps
  • cocos2d An iPhone 2D game engine. Pretty sweet so far.
    Useful resources (pre 0.9): cocos2d home, tutorials: (start/help, rocks), class overview
  • jQuery
  • DTerm This a MacOSX program that opens a terminal command line at the location. It uses cmd-shift-return to open, esc to close. It is great for doing something to a directory such as updating a git, tarring, cp, or even opening a full terminal by pressing cmd-return for a command.
  • GIT A version control system.
  • iSimulate Allows for controlling the simulator with iPhone. Awesome.
  • Chipmunk A 2D physics engine that comes with cocos2d.
  • Blank Templates
Tagged

Web setup

Working on learning iPhone programming (Cocoa), Google App Engine (scalable backend web apps), Python (goes with App and traditional server), html, css, jquery. Mastering all of these technologies should give a full toolkit for developing all of the web apps one needs. Dashcode can also be useful for quick webpage production.

The idea is that most functionality is in the browser, achieving cross platform, computer independent living with a separate, but correlated development for mobile web browsers and iphone apps. This should pretty much be what one needs to reach everyone. While I may develop on MacOS programs for fun, I think there is little profit in desktop publishing.

Learning parsing techniques on all the platforms is probably a must as well as data storage and interface issues.

Cocoa Objects

Objective-C is a fairly straightforward language (main thing is to be aware of memory leaks for inline creation;usage;discard idioms that should be avoided or mitigated with autorelease pools).

But there is a little of learning to do with the built in object types. For example NSArray (and mutable version) has to everything be an object. So one can use NSNumber to store numbers, NSValue for other types, NSNull for nil. Another facet is using NSEnumeration to go over objects or better to use NSFastEnumeration protocol to do a for (Buttons* b in buttons) { or one can do [buttons reverseObjectEnumerator] to traverse backwards.

It is a lot to take in. I guess one should just embrace the documentation, maybe trying to get pattern matching.

Webserver and Mac

Well, I got a fully functional web environment going. I figured out how to get Apache and Python to work with each other on ScarMac. So now, I can develop as if I am on my webserver, but just locally. Then I upload to my website.

One thing is that the python scripts have to be made executable and as far as I can tell, that is command line.

I have also just started looking at Google App Engine, which works with Python. It sounds interesting.

iPhone Dev

Working on getting into iPhone dev. Started it a couple of months ago and got distracted. Now I am back. Working through, chapter by chapter, Dudney and Adamson. I like it so far.

It is a fairly neat development system (I have just been working with text editors up to now, so…) Essentially, you create a project, then define the interface headers, use interface builder to connect up GUI elements to code objects. Then write the code to do some action. It does not take much to get a functional app.

A little bit tricky to get the provisioning profiles and stuff. I had to get a private key from the old system (export from keychain), get the development certificate and install it, then each app, create an app id (or use a * for a suite of apps), then get provisioning profile, then load that, then compile it after telling the project what appid it is to use and provision profile. Then load it on to iPod. Soon I will be uploading an app to the store.

One key thing to be aware of is the memory management. Any item created with alloc or init must be released. There are also autorelease features, retain features…. Mastering this is important since doing it wrong will not be immediately apparent. Memory needs to be consumed because of the leaks before you will find out the problem. And even then, you need to know about it.

There are certificates that need to be installed into keychain along with a the private key. Development is for creating provisional, distribution is for adhoc and app store.

Tagged

E8 theory

Just came across http://arxiv.org/abs/0711.0770 a theory of everything in which all of the stuff is incorporated into a single connection over spacetime.

This looks very appealing to me. I think I will try to understand this in the context of Bohmian mechanics and my own work on differential geometry as part of quantum stuff. The following quote from the paper intrigues me greatly:

The Riemannian geometry of general relativity has been subsumed by principal bundle geometry — a significant mathematical unification. Devotees of geometry should not despair at this development, as principal bundle geometry is even more natural than Riemannian geometry. A principal bundle with connection can be described purely in terms of a mapping between tangent vector fields (diffeomorphisms) on a manifold, without the ab initio introduction of a metric.

I love Riemannian geometry, but…

See also http://deferentialgeometry.org/
http://en.wikipedia.org/wiki/Antony_Garrett_Lisi
http://www.ted.com/talks/view/id/371

Tagged ,

Object.create

In order to create objects nicely in JavaScript, Crockford suggests:

if (typeof Object.create !== ‘function’) {
Object.create = function () { // create a method of the universal object
function F() {} //create an empty function
F.prototype = o; //load the function’s prototype with the old object to inherit from
return new F(); //use that function to create a new object and return it.
};
}

This implements inheritance from an existing object when creating a new object.
Crockford says changing o later will change new object.

I also need to create a little javascript lab, a notebook to record code, and to look back on.

Tagged

Wkipedia

So on Friday 13, 2009, I did a major rewrite of the Bohmian mechanics page on wikipedia. It has been needed for a long time and now it is there. Now others can go in and refine it as the base has been dealt with. It is exciting and something the Bohmian community has wanted for a long time.

I am now thinking about what else it needs for acceptance. The main thing is to say that it applies to all current physics.

To that end, I want to create an article or a page that delves into a full theory based on QFT and relativity. My collaborators have already done the hard work. I just need to put together all of their pieces, and in some of my own flair, and hopefully the result will be the ability to claim that the Bohmian point of view works for the Standard Model. Maybe that will give good support for tackling quantum gravity, once all the cards are laid out on the table. The most difficult problem to tackle is understanding what the physicists have been talking about, as it is so couched in the language of experiments, i.e. measuring operators instead of the evolution of the wavefunction (which is present).

It will be fun.

Tagged

Crockford videos

More Crockford videos. I haven’t laughed that good in a long time.

One bit that was amusing is the following:

return {
ok : false
};

This works well to return an object literal

return
{
ok: false
};
is a total failure. So go with the first form.

Why does it fail? Well, the language inserts semicolons and does not care about useless statements so it sees:
return ; \\returns undefined
{ \\naked block. useless since no scope, but who cares
ok: false \\label in a totally useless fashion. which is fine. It evaluates false even if it is useless
\\ no semi-colon? no problem, we have insertion
}; \\not a statement so no semi-colon needed. But empty statement okay so it evaluates ;
\\and does nothing.

So all in all, this is a classic case of trying to do the right thing screws you.

JavaScript is a language with lots of power, but it requires good discipline.

One key pattern is encapsulation using closures and functions as data. So

var example = (function () {
var constant = [‘stuff’, ‘more’];
var state = 0;

return function (dig) {
state += 1;
if (constant[dig] !== undefined) {
return [constant[dig], state];
};
}) () );

example(0); //returns [‘stuff’, 1]
example(0); //returns [‘stuff’, 2]
example(1); //returns [‘more’, 3]

//end program

So in this one snippet we see how inner functions access outer functions either to save on initialization times (constants of the function) or to maintain state between calls. It can also be used to have generator functions that generate custom functions. Notice the outer parentheses in example–these are not needed by language, but human maintainers enjoy being told that this function is being evaluated, not assigned. It is the inner function (need not be a function) that is getting assigned as that is what is being returned.

Safari Library

I just signed up for the Safar Library online-8500 books plus videos for $40 a month.

I began watching Douglas Crockford’s videos associated with his Good Parts of JavaScript. Fun stuff. I am really looking forward to going through all of his videos.

He said that in 2007 it was the most popular language anywhere. Amazing. It is a great language and a horrible language. But one can use it as a great language.

I am currently exploring the Flot library with jQuery. Awesome stuff.