Saturday, August 6, 2011

More programming

Seeing as I haven't posted here in a while. Here is the latest update on my world of programmen:

C++: was the language required for my previous programming topic. Initial thoughts:
- this is better than Java
- templates are just macros
- STL is pretty neat
-

Java: required language for my current programming topic:
- still as overly verbose
- simple and easy to usehttp://www.blogger.com/img/blank.gif
- The amount of included resources is huge, you'd never get around to learning all of them

Python: just for fun, scripting, and bots:
- Easy to use
- Lots of libraries!
- I wrote a scraper to get the latest weather for my city from bom.gov.au
#!/usr/bin/python
import urllib2
import json

q = json.load(urllib2.urlopen("http://www.bom.gov.au/fwo/IDS60801/IDS60801.94675.json"))
for i in ['City','Temp','Wind','Rain','Humidity','Wind_Dir']:
print '%s' % (i.rjust(9)),
print
for i in ['name','air_temp',"wind_spd_kmh","rain_trace","rel_hum","wind_dir"]:
print "%s" % (str(q['observations']['data'][0][i]).rjust(9)),
print "${hr 1}\n"
p = filter(lambda x: x!="\r\n",urllib2.urlopen("ftp://ftp2.bom.gov.au/anon/gen/fwo/IDS10071.txt").readlines())

for i in p[5:8]:
j = i.split()
print j[0],"$alignr",' '.join(j[1:])[:-1]


PHP: Seeing I have a job or 2 to make some websites I've got the job of doing the backend. Both sites will use CodeIgniter and MySQL. The only difficult thing to design is a competition management system. Codeigniter is quite good and a huge step up from plain PHP. The myriad of included helpers and libraries simplifies a lot of things and the framework uses the MVC pattern which really separates out the presentation from the application.


I also got a github, so you can see the code I open sourced, the only thing I really update is TwatBot (a bot to post things from IRC to twitter).

https://github.com/JonnoFTW

No comments:

Post a Comment