Tuesday, December 22, 2009

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.

Monday, December 7, 2009

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.

Friday, November 20, 2009

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.

Sunday, November 15, 2009

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

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.

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.

Thursday, November 12, 2009

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.

Wednesday, November 11, 2009

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.

Saturday, November 7, 2009

TextMate, flot

I have begun to learn TextMate. It is awesome. It allows the quick typing and expansion of snippets as well as more powerful command features. It has code folding and column editing. And a cool method for editing multiple lines from the end.

I am also getting into jQuery, its UI library, and flot--a graphical plotting program. My first task is designing a quick statistics lab. So far it is working very well. My first tests run not only on Firefox but IE as well without any tinkering! It works on Safari and even the iTouch seems to have some success (the UI isn't quite right, but that's a design issue).

Haven't done any videos yet except the one test. Maybe next week. Also I have begun working on the wiki page for Bohmian mechanics on Wikipedia. It is exciting and again TextMate is helping me out there too.

Thursday, October 29, 2009

Installed iWork, moved my main work folder, trying to figure out how to call up a finder window with a single keystroke!, registered mythiclogos.com, installing GeoGebra.

Working hard to keep everything clean on my desktop.

Resynching iPod touch.

Started Apache web server. This was dead simple--just go to system prefs and turn on web sharing. The folder is Sites in the Home folder. Later I will need to experiment with running scripts and so forth if I want a fully functional site on my computer, but at least I can do client modeling.

Downloaded jQuery and jQuery UI. Will need to download my usual plugins (Taconite, form, livequery....) For UI, chose Cupertino theme. Saw an online conference on jQuery. I think I might attend.

Used Screenflow to make a demo video of its capabilities. Not too bad. Uploaded it to YouTube and done. Pretty sweet. Idea is to make videos of educational interest, building the logos, with references to the materials at Mythic Logos.

Finally got TextMate bundle loading working. Installed git. Then you can install a bundle by
cd ~/Library/Application Support/TextMate/Bundles
git clone git://gitorious.org/git-tmbundle/mainline.git Git.tmbundle
osascript -e 'tell app "TextMate" to reload bundles'

Workflows

So today I will attempt to setup/experiment with workflows. In particular, I want to start coding up the design patterns for web pages using jQuery (need to start my webserver on this machine and get going). I also intend to learn TextMate to see if it meets my needs for typing scripts. I also want to learn how to use Screenflow and ensure that that works out well. Once I have all these skills in place, I should be good to go to start making videos and projects.

Wednesday, October 28, 2009

scarMac

I received my new iMac yesterday right before I had to leave to teach a class. It is an impressive sight. I am now setting it up. The long running task I have is getting iTunes setup from my old library. I am copying the old iTunes onto my machine then I will combine it with another iTunes library. I hope that I will be able to retain all my old playlists and get the new songs. Then I will work on cleaning it up.

I have already installed Firefox. Next I want to install MacTex, Python, Sage, and the video capturing software which I think is Screenflow.

  • MacTex 2.3 GB, package install
  • Python, Going with default Python install. May upgrade later.
  • Sage, unpack, drag Sage folder wherever (applications), and click on sage. Use notebook() and localhost:8000 to
  • Xcode, from MacOSX DVD and install Xcode mpkg
  • QT Installed
    • QT SDK, 1.46GB, installation problem?
    • The QT libraries worked so installed that. A new version should handle 10.6
    • Installing new version. 64-bit! 4.6 working well so far
  • Python bindings
    • SIP (python configure.py; make; make install (sudo))
    • PyQT (same)
  • QTScintilla, Eric IDE
    • Download QScintilla and install with qmake stuff from instruction (
      qmake -spec -macx-g++ qscintilla.pro
    • Eric IDE
    • Later will look into extra modules on the Eric IDE system
    • Failure: mportError: dlopen(/Library/Python/2.6/site-packages/PyQt4/QtCore.so, 2): Symbol not found: _sipQtConnect
      Referenced from: /Library/Python/2.6/site-packages/PyQt4/QtCore.so
      Expected in: flat namespace
      in /Library/Python/2.6/site-packages/PyQt4/QtCore.so
      An error in SIP
  • Screenflow: video capture with direct publish to YouTube. Download package, install. Try it, pay for it.
  • TuneUp (tuneupmedia) and Dupin (dougscripts) to first get song info then get rid of all duplicates. Doug's scripts also has some other cool scripts for iTunes. The whole process loading my library involved transferring from an old computer and then importing a whole library from another. Done.
Note: scarMac is so named as it came with a little crack/scratch in the lower left corner. It does not seem to be interfering with function, just form. Hence scar. Perfect for a Speakeasy computer.

Monday, October 26, 2009

iMac delayed!

FedEx failed to deliver. They said they tried, but I think they went to the wrong place since I was home, had pre-signed for it, and there was no door delivery tag. So I hope tomorrow I will get it.

In the meantime, I was working with TexWorks on my PC and had to do epstopdf. This requires shell-escape for the TeX version I have (2007). To enable it, I went to Edit->preferences->Typesetting->Edit PdfLatex and in arguments, placed --shell-escape

Security risk, I suppose. But it works.

Also, had fun estimating (26 nCr 3 )/(100 nCr 3) used 25^3/100^3 which is 1/4^3 which is 1/64. So that is between 1/50 =.02 and 1/100 = .01 It is closer to the 2 so I went with .016. That happens to be very close to what the combinatorial ratio is while 1/64 is more like .015625.

New iMac Pre-arrival

Today I should be getting my new iMac. It is very exciting.

I will install gnuplot, python, matplotlib, mactex, geogebra, R, Sage.

I also need to import iTunes and clean it up. I intend to explore Mail, iCal, and the rest and really utilize all that comes with it. I am reading Mac OS X Snow Leopard by Pogue and it is amazing what one can do. Mastering efficient use of the computer is a must.

Then I will turn my attention to screen recording software.

And I want to master Apple Script. That seems a great way to do minor tweaks to the work flow.

I also need to install the development tools.

I intend to explore the iMac as a server as well so I can develop on the Mac and then upload the stuff to the live site. I can browse and explore from my home network. For a pre-release setting, I should be able to open the network up so others can explore it.

For the server, I will install jQuery with UI and other plugins, MongoDB, SQLite, Python, PHP, jsMath

Friday, October 23, 2009

A New Day

Today I take my first steps into blogging. The goal is to record the mythic journey of creation of a logos masterpiece.

My hope is to create a series of materials and methods that will lead to free minds. This will be the story of assembling the materials and how-to's so that myself and others may learn as well.

Taming the art of the web and publishing is a daunting task. The main tools all exist: jQuery, Flot TeX, Python, GeoGebra, Gnuplot, and all the normal web technologies. Putting all of this together in an easy to use form is quite challenging.

The vision I have is to set up a system with a variety of uses: students for which everything is produced and easy to use; most teachers for which default materials or simple changes are sufficient and done simply; more advanced needs for which some programming parts are exposed; and ultimate developer education for complete freedom to develop.

My plan is to setup a basic system over the next few weeks with a few sample topics. Once I have a decent system in place, my hope is to spend four hours a day, doing one full topic. In this way, I could have a decent start by 1/10.

I will be making video tutorials, notes (basic/advanced), calculator tips, computer exploration directions from simple CAS to programming, guidelines to producing problems of this type, questions/tests, unlimited problem trials via web.

At the end, I will use all of this material to produce a book in addition to the website housing all of this material.

I have in mind a variety of other projects and I may write about those ideas and experiences as well. In particular, I want to explore the mythos/logos notion, applying it to ontological quantum theories to put a little magic back into the world of science.