Insight VR

NSConf Notes: Mini Sessions

by john on Feb.21, 2010, under Uncategorized

Mark Aufflick: Notifications.

http://mark.aufflick.com/talks/apns

Limited to 256 bytes. Register device with Apple and then pass token back to your server. Then your server can use the token to send a message to Apple which will be passed to the device.

The notification itself is a binary format. 256 byte limit is payload only. Payload is json formatted.

If a user removes the app you get a notification.

There is a Perl library available that sends notifications.

Separate Sandbox(test) and Production connections for push notifications.

http://github.com/aufflick/p5-net-apns-persistent

Justin Williams from Second Gear Software

Sold off his iPhone business and is focusing on Mac products.

Hard to find a marketing niche in the app store.

Had to find a buyer for his app. Complained enough on twitter that someone approached him asking if he was serious and wanted to sell it. Sold it for 2 to 3 years worth of revenue for the app.

Once you agree upon a price you might want to get lawyers involved. Then sign papers, get money.

Transferring ownership of the application is likely impossible. You have to contact World Wide Developer Relations. They email you a list of four questions. Then they don’t respond. After 90 days got unofficial notification that unless you are selling the whole company they won’t do the transfer.

To ease the pain of the transfer the new owner offered the apps for free for a week, hoping that old users would figure it out and update to the new app.

A workaround might be to create an LLC for each app in case you want to sell it. Very annoying. Apple is not talkative on this topic.

Rod Strougo of Prop.gr – Cocos2D

Wraps a bunch of more complicated technologies for making games.

Two physics engines. Box2D is C++. Squirrel is C.

Box2D is tuned for 1 meter objects, so scale your objects to that.

Cocos2d is at http://www.cocos2d-iphone.org which comes with Box2d, but you can get Box2d from Google Code as well.

Looks like a cool set of libs to quickly build 2d games.

Leave a Comment more...

NSConf Notes: Core Data Synchronization

by john on Feb.21, 2010, under Uncategorized

Marcus Zarra

ZSynch – desktop and iPhone data synchronization

CoreData is the best way to persist data on the iPhone.

Bare minimum for using ZSynch is two calls: set up a delegate and request a synch.

Eventually will synch to the cloud. You’ll be able to run your own server or pay for central hosting.

BSD license.

Leave a Comment more...

NSConf Notes: Hard and Fast OpenGL

by john on Feb.21, 2010, under Uncategorized

Jeff LaMarche

http://iphonedevelopment.blogspot.com

A bit of OpenGL history.

OpenGL ES removes parts that were redundant or killed performance. This includes direct mode, which was great for learing the API. Now you have to jump into the deep end.

Static inline functions for small bits of logic that are called frequently.

Avoid allocating memory a lot. Reuse memory between loop runs when possible.

Use the “f” versions of math.h functions so sqrtf() instead of sqrt() which expects and returns doubles.

Make universal apps to enable Thumb for Armv7 and disable it for Armv6.

Default is counter-clockwise winding.

Leave a Comment more...

Pycon Notes: Natural Language Processing

by john on Feb.20, 2010, under PyCon

Nitin Madnani

Python is well suited to NLP due to nicode support, C/C++ extensibility, etc.

NLTK comes with its own corpora, lots of tools, and WordNet integration. Has its own O’Reilly book.

Dumbo is Python bindings for Hadoop Streaming. Hadoop Streaming lets you use any executable or script for mappers and reducers.

Word association example is trivially parallelized using Hadoop on EC2.

Leave a Comment :, , more...

Pycon Notes: Building Open Source Communities in Rio de Janeiro

by john on Feb.20, 2010, under Python

Henrique Bastos – @henriquebastos

Small Acts are only the essential things.

Python 2008 was hosted in Rio. They had 400 people over 3 days. Henrique sent out an email asking for more information. The python population in Brazil is young, majority under 30, tend to be students, use it for web development (mostly Django) and consider Python essential to the work they do.

http://pythoncampus.org/ does tutorials and talks on university campuses in Brazil. Did 4 sessions last year. Will do one a month this year.

Rio Pythonistas run dojos weekly. Team coding in front of an audience with a projector showing their work.

Horaextra (Overtime) is a weekly social hour for technology enthusiasts.

Python enthusiasts attend conferences for other languages to meet other developers and build community.

They gave a Python t-shirt to President Lula, video of this became a hit at conferences and on YouTube.

SmallActsManifesto.org lists the principles used to build the community in Brazil.

2 Comments :, , , more...

Pycon Notes: Composing Python Tools

by john on Feb.20, 2010, under PyCon

Raymond Hettinger

Deque is like a list. Pronounced “deck” and stands for double ended queue. Can append() and pop() at both ends, can be indexed but not efficiently, no insert. Basically efficient on the ends. In collections.deque().


Timsort
uses partially sorted lists to sort in O(n) time.

Random.sample() picks between two algorithms depending on how you are going to use it because 1,000 choose 900 is very different from 1,000,000 choose 10.

OrderedDicts usually have O(n) performance for deletion. By using a doubly linked list to store items in order and a dict for lookup you get O(1) for all operations. New code is in Python 3.

Python has native support for sets of sets. This enables easy translation of English description of problems involving sets to Python code in a few lines. Applicable to translating an NFA to a DFA.

Leave a Comment :, , more...

Pycon Notes: Understanding the GIL

by john on Feb.20, 2010, under Python

David Beazley

http://www.dabeaz.com/

Simple CPU bound processes run more slowly when threaded. 2x slower in example. Threads actually run faster if you disable a processor.

Rationale for the GIL is that it makes the interpreter massively simpler. So rather than parallel computing what you get in a python process is cooperative multi-tasking. So IO bound operations allow other things to do work while they are waiting for data.

Thread running code is pretty simple. The big question is how something so simple has such diabolical behavior in what seem like simple programs.

CPU bound threads might reacquire the GIL immediately after release.

On multi-processor machines the sleeping threads try each 100 ticks to acquire the GIL and often fail. But they do switch context more often than the single processor case. So you get lots of useless attempts to run on one CPU while the other does work, plus lots of thrashing.

Thrashing also occurs on IO bound systems as well.

GIL code hasn’t changed for many years. All available versions of Python have essentially the same code in place for the GIL.

New GIL has been implemented that doesn’t rely on signals. There is a 5ms timeout period. This causes latency to event handling. Also the thread that requested the timeout might not be the one that gets executed.

New GIL also has diabolical behaviors as well. Possible solutions already exist in the area of operating systems. Reward threads that give up the GIL before their timeslice is over with higher priority. Penalize threads that use their entire timeslice with a lower priority.

Leave a Comment :, , , more...

Pycon Notes: Scaling EC2

by john on Feb.19, 2010, under PyCon

Look at the issues encountered deploying Reddit on Amazon’s EC2 cloud.

High load on CPUs will slow down network significantly since all packets hit the virtual CPU. So load can go up exponentially with traffic.

They run 16 python instances on 8-core machines and only submit one job at a time to an instance in order to avoid loading the CPU.

Elastic Block Devices didn’t provide the needed performance. Created virtual RAID drives in order to mitigate the effect of occasional slow drives.

They shard the database. Avoid reading from the master DB so that it can be available for writes. They also use Postgres as a giant key/value store.

Several types of caching using memcache.

Logged out users are second class citizens and they always get cached content. In addition to that Akami is used as a front end to cache for logged out users.

Use queues for all jobs that get fired off. If a machine fails and a job doesn’t finish it is still in the queue and can get done elsewhere. They use RabbitMQ.

After profiling they’ve switch to C based libraries for some items.

They use pylons (yay!) but don’t care for paste even though they still use it. They say they’ve rewritten about half of paste for their own use.

Price of their EC2 services has stayed constant ($18k-$20k/month) even though traffic has doubled over the past nine months. EC2 prices have dropped as fast as Reddit’s traffic has increased.

Leave a Comment :, , , , more...

Pycon Notes: Quantitative Finance

by john on Feb.19, 2010, under Uncategorized

Wes McKinney from AQR

R is a widely used language in statistics and finance. Python programmers can get at the functionality through rpy.

Other tools: numpy, scipy, IPython, matplotlib.

pandas.sourceforge.net is the package he developed to do analysis. Lots of cool matrix manipulations and statistical analysis.

HDF5 and PyTables used as intermediate storage.

Leave a Comment more...

Pycon Notes: Maximize your program’s laziness

by john on Feb.19, 2010, under PyCon

Presenter David Mertz.

Wait to perform calculations or create data structures until you really need them.

Interesting: Haskell allows recursive initialization of sequences without a base case: an infinite list.

Haskell is inherently lazy. Scheme can be made lazy using delay and force commands.

In Python itertools provides lazy versions of map and reduce. Also allows for slicing a generator.

Promise waits to evaluate until it absolutely has to and then caches the result.

Memoize evaluates and gives a result immediately and caches the result for the given inputs.

Big-O notation savings comes from caching or simply never doing the calculations.

Leave a Comment :, , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!