Double pendulum in cocos2d

KidsCase iPhone & iPad development

Hello everyone,

In last month I was working for Intermarum on a iPhone and iPad game called Kids Case . The game is made especially for children aged 2-5 to familiarise them with new technologies. Kids Case is a game which connect fun with learning. The legendary Memory Game or Puzzles can also be found in Kids Case. The entertaining is made up with beautiful graphics, which are to my liking.

So, after a short introduction, let’s talk about technical side of Kids Case. My task was to implement seven different small games which all together makes Kids Case. The path I chose was to first write all classes and keep images and xib files proper for iPod Touch, iPhone 2G-3GS and iPhone 4 which has twice  a resolution then his predecessor. So in this way I get proper scaling for all iPhones and iPod devices. When the app was ready for iPhones, the reasonable time for iPad came. What I wanted was one universal app. So I’ve marked my target and upgraded it for iPad. It have made a small changes in info.plist and a new iPad-ready .xib file of MainWindow where the app begins. And here I decided to make a new group specially for iPad with all classes rewritten. I don’t really know whether it was a right move or not. One thing I know, that it for sure keeps my project well organised.  Perhaps, I will change my mind one day but for now I somehow dislike condition statements all over the code.

This is my first iPhone app I’ve ever made. I’ve enjoyed the developing process. Apple delivered high-quality kit for developers. Documentation is well written and easy to navigate. For beginner iPhone developer as me, I found stackoverflow.com most helpful site on the internet. I highly recommend typing “site:stackoverflow.com” in google while looking for leads. I would like to post some code with gruelling algorithms, but unfortunately  I haven’t written any code to boast. The project was rather easy to implement, I have just dived in iPhone programming. Now when I know the rules, the Cocoa Touch  API, the Interface Builder, all the environment I’m going to made a game for my own. I can’t tell you exactly what it will be about. I will be just successively adding some new algorithms to the blog. Stay tuned, here I come appstore ;)

Python script for sharing Dropbox files on webpages !

Hi there !
I always wanted to have a download list on my wordpress sidebar but I don’t really like box.net. I’m using dropbox on ubuntu and I found it really handy so I wrote a python script which is generating public urls of files which are in my Dropbox/Public/downloads. I find out that I can have a rss widget on sidebar so I decided to use it to show my downloads. I choose www.delicious.com to generate the rss. My script is simply adding a puburl and the filename (from my dropbox directory) to my delicious bookmarks, than wordpress get’s rss on sidebar widget ;)

What you need to use this script:
- Linux with dropbox
- delicious account
- Python (almost on every linux)

Scripts works like this:
Checking if there are any new files in predetermined directory ->; if true: gets filenames and puburls -> send it to delicious.com with “download” tag (to keep bookmarks in harmony:p) -> (here I’m using it by rss but you can do what you want with it:p)

Here is my code, enjoy ( of course you can download it from sidebar – droplist.py )
Please post issues in comments or talk to me on gtalk.

#!/usr/bin/python
# -*- coding: utf-8 -*-
# From author: Stop for a sec on every comment I've posted here, and do what it says  -Tetek
# P.S Add alias to .bashrc to make it faster to run

import urllib2, urllib, commands, dircache, os, struct, time
from stat import *

theurl = "https://api.del.icio.us/v1/posts/add?"
#Enter your username and password ( url is constant for everybody)
username = 'tetek'
password = 'xxx'
try:
	passman = urllib2.HTTPPasswordMgrWithDefaultRealm()
	passman.add_password(None, theurl, username, password)
	authhandler = urllib2.HTTPBasicAuthHandler(passman)
	opener = urllib2.build_opener(authhandler)
	urllib2.install_opener(opener)
	
	
except:
	print "Incorrect username or password (or just connection fucked up)"

home = os.getenv("HOME")
# Please enter path to folder that you want to upload
path = home + '/Dropbox/Public/downloads/'
files = dircache.listdir(path)

#I'm using tag: download, just simply to get stuff in right order
#'replace' is optional..
def Upload_File_List(i):
	out = commands.getoutput('dropbox puburl ' + path + i)
	paired = { "url": out, "description": i, "tags":"download" ,"replace":"no" }
	data = urllib.urlencode(paired)
	full_url = str(theurl + data)
	upload_it = urllib2.urlopen(full_url)
	print " - " + i + " added!"

try:
#datekeeper keeps the date when this script was last runned
	date_keeper = open("datekeeper.txt", "rb")	
	handler = date_keeper.read()
	date_keeper.close()
	last_update = struct.unpack('i', handler)
#It checks if there are some new files to update
	for x in files:
		check_stat = os.stat(path + x) 
		if int(check_stat[ST_ATIME]) >= int(last_update[0]):
			Upload_File_List(x)
		
	print "Synchronised"
except:
		
	for y in files:
		Upload_File_List(y)
	print "Success"
	

	
	
	
try:
#Saves the current time to the datakeeper.txt I used struct lib to keep int binary
	time_saver = open("datekeeper.txt", "wb")
	current = struct.pack('i', time.time())
	time_saver.write(current) 
	time_saver.close()
except:
	print  "Can't save current time do datekeeper.txt"

Follow

Get every new post delivered to your Inbox.