Official ObjectGraph Blog

Wednesday, July 25, 2007

iPhone Dictionary

Just finished learning about the viewport metatag and implemeted this for dictionary on iPhone. Usage: Just type a few words and click on the reference.

http://www.objectgraph.com/dictionary/iphone.html

Labels:


posted by gavi at 11:34 AM | 2 comments |

Tuesday, July 24, 2007

onkeyup and iPhone

I got my iPhone a while ago and only now started looking at some development. Naturally i am trying to get our AJAX Dictionary to work on iPhone.

But looks like iPhone does not support the onkeyup event in Javascript. Actually it does not support a bunch of keyboard events (there is no real physical keyboard on iphone, so its hard to distinquish keyup, keydown etc), so i am thiking of just putting a button after the text is inputted.

There is an onchange event but it only triggers if you focus outside the textbox. Here is the first version of it.

http://www.objectgraph.com/dictionary/iphone.html

Labels:


posted by gavi at 12:59 PM | 0 comments |

Friday, July 06, 2007

Graphviz

Today I found something cool for drawing graphs. Its called GraphViz, You can download it from

http://www.graphviz.org/

It can output in various formats including SVG, PNG and GIF. But PNG and GIF dont have aliasing enabled, so they are pretty crappy.

For an example, look here. An image generated using PNG output

http://www.linkulu.com/random/?format=png&numnodes=10&size=5,5

Now look @ an another random graph with SVG output

http://www.linkulu.com/random/?format=svg&numnodes=10&size=5,5

Here is the python code to generate the graphs. I used Django ofcourse

def randomGraph(request):
   #Defaults for Generating random graphs
   random.seed()
   numnodes=5
   format="svg"
   size="2,2"
   mime="image/svg+xml"
 
 
   if "format" in request.GET:
       infor=request.GET["format"]
       if(infor=="png"):
           mime="image/png"
           format="png"
         
       elif(infor=="gif"):
           mime="image/gif"
           format="gif"
         
   if "size" in request.GET:
       size=request.GET["size"]
 
 
   if "numnodes" in request.GET:
       numnodes=int(request.GET["numnodes"])
 
 
   dot="""digraph G{
       size ="%s";
       orientation=portrait;
       {{{dot}}}
   }""" % (size)
 
   nodes=[]
   shapes=['ellipse','box','circle','record','triangle','doublecircle']
   styles=['bold','dotted','normal']
   colors=['cadetblue2','dimgray','dodgerblue1','beige','aliceblue','ghostwhite',
                   'greenyellow','hotpink4','lightgoldenrod2']
 
   st=""
   for i in range(numnodes):
       nodes.append("a"+str(i));
 
   for node in nodes:
       s1=random.randint(0,len(shapes)-1)
       c1=random.randint(0,len(colors)-1)
       st=st+" %s [shape=%s fillcolor=%s style=filled];\n" %(node,shapes[s1],colors[c1])
 
   for i in range(numnodes):
       r1=random.randint(0,numnodes-1)
       r2=random.randint(0,numnodes-1)
       s2=random.randint(0,len(styles)-1)
       st=st+nodes[r1]+"->"+nodes[r2]+" [style=%s];\n" %(styles[s2])
 
   dot=dot.replace("{{{dot}}}",st)
 
   tmpout, filename = mkstemp()
 
   pobj=Popen('dot -T%s -o %s' % (format,filename),shell=True,stdin=PIPE,stdout=PIPE)
 
   fin = pobj.stdin
   fout = pobj.stdout
   fin.write(dot)
   fin.flush()
   fin.close()
   pobj.wait()
 
   fout = os.fdopen(tmpout, 'r')
   jpeg = fout.read()
   fout.close()
 
   os.remove(filename)
 
   #jpeg=dot
 
   return HttpResponse(content=jpeg, mimetype='%s' % (mime))

Labels:


posted by gavi at 4:09 PM | 2 comments |

Sunday, July 01, 2007

Looks like iPhone crash reports!

Just connected my iPhone to sync it and charge it (BTW the battery claims are totally false - you get may be 4 hours with wifi), Here is the screen shot.

Here is a file in the details..
Process:         Exited process [24]
Path:            Exited process
Version:         N/A (N/A)
Code Type:       0000000C (Native)
Effective UID:   0
Parent Process:  mach_kernel [Unknown]

Date/Time:       2007-07-01 19:41:17.651 -0400
OS Version:      OS X 1.0 (1A543a)
Report Version:  6

Exception Type:  00000020
Exception Codes: 0x8badf00d
Crashed Thread:  Unknown

Backtrace not available

Unknown thread crashed with unknown flavor: 4, state_count: 1

Binary Images:

Labels:


posted by gavi at 11:11 PM | 0 comments |

iPhone Bug?

Just got hands on my own iPhone after learning they were still available on 5th Avenue Store, I just could not resist it being only 20 blocks away!

First this device rocks. Very easy activation and extremely easy to use.

Every application seems to be stable and working great. But there seems to a problem when multitasking listening to music and browsing the web at the same time. My friend Horinaga found this bug and i was able to reproduce it.

It could be a quick software fix! Anyway i love the iPhone.

Labels:


posted by gavi at 10:21 PM | 0 comments |