Making a progress bar in your iPhone UINavigationBar
Here's a little bit of code i've used to get a nice progress bar in a nav bar:
And here's what it looks like:
Here's a little bit of code i've used to get a nice progress bar in a nav bar:
And here's what it looks like:
I'm creating this app as a learning exercise for me, and to 'scratch my own itch' so to speak - to have a nice simple way to read HN from my iphone while pushing my daughter on the swing: Available in the app store
Available in the app store here
I also intended from the start open-sourcing this so that people can have a look and learn with a nontrivial demo app. The more people that know obj-c/UIKit, the merrier! https://github.com/chrishulbert/HackerNewsReader
Attributions:* Icons by app-bits: http://app-bits.com/free-icons.html
* FMDB sqlite wrapper: https://github.com/ccgus/fmdb
* ConciseKit: https://github.com/petejkim/ConciseKit
* ASIHttp: https://github.com/pokeb/asi-http-request
I've been busy testing megacomet on an EC2 micro instance. Keep in mind this testing is pretty crummy, given the instance only has 600M memory and i'm running the fake-client-flooding app on the same box as the server. Anyway, i was able to get up to 50k connections open before things started getting slow. I'm not sure if i hit a configuration limit, or a memory limit, or what. Testing continues...
Anyway, here's the 'top' results, showing that 50k connections roughly means 16M memory usage:
top - 08:52:17 up 58 min, 2 users, load average: 0.13, 0.16, 0.22 Tasks: 68 total, 1 running, 67 sleeping, 0 stopped, 0 zombie Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 611212k total, 581608k used, 29604k free, 3760k buffers Swap: 0k total, 0k used, 0k free, 25356k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 22542 root 20 0 10392 2020 116 S 0.0 0.3 0:01.47 megacomet 22548 root 20 0 10400 2016 116 S 0.0 0.3 0:01.48 megacomet 22544 root 20 0 10452 2004 108 S 0.0 0.3 0:01.49 megacomet 22546 root 20 0 10392 1968 108 S 0.0 0.3 0:01.49 megacomet 22543 root 20 0 10388 1908 60 S 0.0 0.3 0:01.48 megacomet 22549 root 20 0 10396 1860 20 S 0.0 0.3 0:01.47 megacomet 22545 root 20 0 10396 1840 0 S 0.0 0.3 0:01.47 megacomet 22547 root 20 0 10392 1840 0 S 0.0 0.3 0:01.50 megacomet
And here's where i got the kernel tuning tips from:
http://www.metabrew.com/article/a-million-user-comet-application-with-mochiwe...
http://www.cs.wisc.edu/condor/condorg/linux_scalability.html