Tuesday, April 29, 2014

Postgres on Windows...

Yeah, why did I do this to myself? Well, I'm usually on a Mac, but Apple is dumb in that it doesn't support JEE6, which is what I used to write the sign-out app.

So, I needed to get the database onto the Windows machine where I wrote the sign-out app in JEE6.
So, I downloaded Postgres in a one-click exe file. Then it took me forever how to inflate a database from a pg_dump.

Well, after about 30 minutes of tinkering, here's how

how to run it from command line:

"\Program Files\PostgreSQL\9.3\bin\psql.exe" -U postgres ...



http://www.postgresql.org/docs/8.1/static/backup.html#BACKUP-DUMP-RESTORE

23.1.1. Restoring the dump

The text files created by pg_dump are intended to be read in by the psql program. The general command form to restore a dump is
psql dbname < infile
where infile is what you used as outfile for the pg_dump command. The database dbname will not be created by this command, you must create it yourself from template0 before executing psql (e.g., with createdb -T template0 dbname). psql supports options similar to pg_dump for controlling the database server location and the user name. See psql's reference page for more information.

Thursday, April 10, 2014

Using Sencha CMD 4.0.2 Architecture for ST2

So you have a ST2 project that's all big and uncompiled, and you want to minify it with CMD and even port it to XCode.

Here's how.

You should already have an MVC architecture, with models, views, and controllers separated into separate folders.

Get Sencha CMD4 and perform
sencha -sdk /path/to/sdk generate app AppName /app/folder/

If everything's working, cmd should create an app under /app/folder with a ton of goodies in it.
Check out it's folder structure and stuff. To change themes, access the hidden .sencha folder.

Just for satisfaction, run
sencha app build

There should now be a build folder in your project directory. Go look inside and find the minified code. Hooray!
Now, simply migrate your MVC code into the /app folder generated by cmd.
Run the app build command again. Given your code is structured correctly, and you have made all the proper changes to the app.js file, everything should work.

You now have a minified js and css file! Awesome!

For the phonegap component: check out this website http://www.sencha.com/blog/getting-started-with-sencha-touch-2-build-a-weather-utility-app-part-3
For the tl;dr version, do
sencha app build production 
sencha phonegap init <APP-ID> <APP-NAME>

Now, you should have a phonegap folder, and config.xml file. Check out the config.xml and read it, and make all the obvious changes that you need to make.

Finally, run a
sencha app build native

You should find the /phonegap/platforms/ios folder, inside of which will be an xcode project.

Please comment if you have questions!

Wednesday, April 2, 2014

Mavericks update woes continue.

Now, in Python, the up arrow key give me the previous command in the interactive session.

This is crap.

Here is a link to the solution. You need to recompile Python...
http://stackoverflow.com/questions/893053/python-shell-arrow-keys-do-not-work-on-remote-machine

Updating to OSX mavericks...

Mavericks is pretty horrible... meh.

For one, everything is now slower. Just to get XCode5 dev tools and multiple tabs in the finder, this is not really worth it.

On another note, I continually got this error in Python.

>>> import networkx as nx
>>> nx.Graph()

Segmentation fault: 11

This is ridiculous. Why would they break python?

I found the fix. 


Pretty much, do this stuff. Who knows what it does? It works.

cd /Library/Frameworks/Python.framework/Versions/3.3
cd ./lib/python3.3/lib-dynload 
sudo mv readline.so readline.so.disabled