Marco Islas Blog http://islascruz.org/html markuz@islascruz.org (Marco Antonio Islas Cruz) 2005-2008, Marco Antonio Islas Cruz Mon, 08 Feb 2010 00:54:27 -0600 JAWS 0.8.9 general <![CDATA[ Playing with Nokia S60. ]]>


Me :-)

Originally uploaded by markuz



I've just started playing with Nokia S60v5. I'm currently using Python to develop some learning stuff. Remember, Symbian is now Open Source, a little bit late, but Open Source at the end.

]]>
http://islascruz.org/html/index.php/blog/show/Playing-with-Nokia-S60..html markuz@islascruz.org (Marco Antonio Islas Cruz) http://islascruz.org/html/index.php/blog/show/Playing-with-Nokia-S60..html Mon, 08 Feb 2010 00:41:25 -0600
general Software_Development stuff personal Python FLOSS Flickr vim <![CDATA[ Right now ]]>


Right now

Originally uploaded by markuz



3:20 in the morning and I'm working, I need to finish a program that I wrote almost a year ago, that was a Demo program and in 4 days (right now just 2) should be production ready!... I'm gonna need a double Monster dosis.

]]>
http://islascruz.org/html/index.php/blog/show/Right-now.html markuz@islascruz.org (Marco Antonio Islas Cruz) http://islascruz.org/html/index.php/blog/show/Right-now.html Sat, 30 Jan 2010 04:29:48 -0600
general personal Python Pictures FLOSS ICTC Flickr <![CDATA[ Monster ]]>


Monster

Originally uploaded by markuz



Working :-)

]]>
http://islascruz.org/html/index.php/blog/show/Monster.html markuz@islascruz.org (Marco Antonio Islas Cruz) http://islascruz.org/html/index.php/blog/show/Monster.html Fri, 29 Jan 2010 13:08:55 -0600
general <![CDATA[ I finally killed Raam ]]>



I finally killed Raam

Originally uploaded by markuz
The past two weeks I have been playing Gears of War on my spare time which is becoming less everyday.
Well, I had never played Gears even when it is a game that has been arround by more or less two years. It's a little addictive game, more when you are in multi-player mode which I enjoyed playing with my brother.
Yesterday I finally beat Raam, the last boss in the game, to me, was very very difficult to beat because I do it in single player mode and the fucking Dom does nothing.
I'm checking for GoW 2 right now :-).

]]>
http://islascruz.org/html/index.php/blog/show/I-finally-killed-Raam.html markuz@islascruz.org (Marco Antonio Islas Cruz) http://islascruz.org/html/index.php/blog/show/I-finally-killed-Raam.html Thu, 28 Jan 2010 11:51:41 -0600
general personal Pictures FLOSS Flickr Sofia Valentina <![CDATA[ Which one?? ]]>


19012010.jpg

Originally uploaded by markuz



Sofia is trying to decide which one is about to be in her mouth. In the right hand a cookie, in the left hand the belt

]]>
http://islascruz.org/html/index.php/blog/show/Which-one%3F%3F.html markuz@islascruz.org (Marco Antonio Islas Cruz) http://islascruz.org/html/index.php/blog/show/Which-one%3F%3F.html Wed, 20 Jan 2010 10:30:41 -0600
general personal Pictures FLOSS Flickr <![CDATA[ Home office.. ]]>


Home office..

Originally uploaded by markuz



This is my new "home office", very similar to the old one I had when I start working for ICT Consulting.
This time the linksys is not here and the mango became a wireless mouse, Cucusa became into Volvagia, I also have a hammer, just in case everything stop working or I get really really pissed.

]]>
http://islascruz.org/html/index.php/blog/show/Home-office...html markuz@islascruz.org (Marco Antonio Islas Cruz) http://islascruz.org/html/index.php/blog/show/Home-office...html Thu, 14 Jan 2010 20:16:18 -0600
general Software_Development personal Python GNU gtk christine FLOSS ubuntu <![CDATA[ Christine 0.6.1 ]]>
  • http://sourceforge.net/projects/christine/files/christine/0.6.1/christine-0.6.1.tar.bz2
  • http://sourceforge.net/projects/christine/files/christine/0.6.1/christine-0.6.1.tar.gz
  • Binary Packages
    • Ubuntu: https://launchpad.net/~markuz/+archive/ppa (if you already set the ppa in your apt sources list then wait for the update soon :-))
    • Windows: http://sourceforge.net/projects/christine/files/christine/0.6.1/Christine-0.6.1.exe ]]> http://islascruz.org/html/index.php/blog/show/Christine-0.6.1.html markuz@islascruz.org (Marco Antonio Islas Cruz) http://islascruz.org/html/index.php/blog/show/Christine-0.6.1.html Wed, 13 Jan 2010 22:01:02 -0600 general Angry Internet personal FLOSS <![CDATA[ They are supposed to be 2Mb ]]>


      They are supposed to be 2Mb

      Originally uploaded by markuz



      I just want to say Fuck you TelMex!!!!

      ]]>
      http://islascruz.org/html/index.php/blog/show/They-are-supposed-to-be-2Mb.html markuz@islascruz.org (Marco Antonio Islas Cruz) http://islascruz.org/html/index.php/blog/show/They-are-supposed-to-be-2Mb.html Tue, 12 Jan 2010 20:24:28 -0600
      general Stupid things stuff personal Pictures FLOSS Flickr <![CDATA[ Fingers ]]>


      Fingers

      Originally uploaded by markuz



      Yeap, my fingers can feel the cold too. The last days have been a very cold days here in my town. The problem is that my fingers get frozen and I then I can't write anything.
      I cut my gloves, only the tip to allow my fingers tip to touch the keyboard.

      ]]>
      http://islascruz.org/html/index.php/blog/show/Fingers.html markuz@islascruz.org (Marco Antonio Islas Cruz) http://islascruz.org/html/index.php/blog/show/Fingers.html Mon, 11 Jan 2010 10:59:00 -0600
      general Software_Development gtk FLOSS tips and tricks <![CDATA[ Drawing with Cairo without flicker ]]> (py)Gtk provides a quick way to get a cairo context using the gtk.DrawingArea widget, this widget let you draw everythin you want into your application using the widget.window drawable area.

      It help you to create custom widgets (you can also use this with buttons or any other widget), the problem with the usage of this context is that everything you ask it to draw it will draw it as soon as it can.

      If you draw several lines or you draw the same thing very often (an animation for example) your draw may flick, making your application looks ugly.

      There is an easy way to avoid this, using a surface to draw and when you are done put your draw into the context using the set_source_surface method.

      In the next example you have a windows, with a custom "progressbar" using gtk.DrawingArea and a slide that is supposed to change the value of the progressbar but I'm so lazy to move a slide that let the computer do the work :-).

      The trick is this part of the code:

              def do_expose(self, widget, event):
                      x,y,w,h = self.allocation
                      surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, w,h)
                      context = cairo.Context(surface)
                      #cleaning
                      rectangle = context.rectangle(x,y,w,h)
                      context.set_source_rgb(1,1,1)
                      context.fill()
                      value = (self.value / 100)*w
                      rectangle = context.rectangle(x,y,value,h)
                      context.set_source_rgb(0.2,0.5,0.8)
                      context.fill()
                      cr = self.window.cairo_create()
                      cr.set_source_surface(surface)
                      cr.paint()
                      return True
       

      We create a surface using cairo.ImageSurface and then create a cairo context from it, draw on that context and at the end use the widget.window.cairo_create to create a context for the drawing_area and use set_source_surface to get all the stuff
      we drew into the DrawingArea context. At the en just paint it.





      #!/usr/bin/env python
      import gtk
      import cairo
      import random
      import gobject
      class progressbar(gtk.DrawingArea):
              def __init__(self):
                      gtk.DrawingArea.__init__(self)
                      self.connect('expose-event', self.do_expose)
                      self.value = 0
                      self.set_property('events', gtk.gdk.EXPOSURE_MASK)
             
              def do_expose(self, widget, event):
                      x,y,w,h = self.allocation
                      surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, w,h)
                      context = cairo.Context(surface)
                      #cleaning
                      rectangle = context.rectangle(x,y,w,h)
                      context.set_source_rgb(1,1,1)
                      context.fill()
                      value = (self.value / 100)*w
                      rectangle = context.rectangle(x,y,value,h)
                      context.set_source_rgb(0.2,0.5,0.8)
                      context.fill()
                      cr = self.window.cairo_create()
                      cr.set_source_surface(surface)
                      cr.paint()
                      return True
             
              def set_value(self, value):
                      self.value = value
                      self.emit('expose-event', gtk.gdk.Event(gtk.gdk.EXPOSE))

      def change_value(scale, progres):
              progress.set_value(scale.get_value())
      def random_change(scale):
              r = random.randint(50,100)
              scale.set_value(r)
              return True
      window = gtk.Window()
      window.set_size_request(640,480)
      window.set_position(gtk.WIN_POS_CENTER)
      window.connect('destroy', gtk.main_quit)
      vbox = gtk.VBox()
      window.add(vbox)
      progress = progressbar()
      progress.set_size_request(100,100)
      vbox.pack_start(progress, False, False, 2)
      adjustment = gtk.Adjustment(value=0, lower=0, upper=100)
      scale = gtk.HScale(adjustment)
      scale.connect('value-changed', change_value, progress)
      vbox.pack_start(scale, False, False, 2)
      gobject.idle_add(random_change, scale)
      window.show_all()
      gtk.main()
       
      ]]>
      http://islascruz.org/html/index.php/blog/show/Drawing-with-Cairo-without-flicker.html markuz@islascruz.org (Marco Antonio Islas Cruz) http://islascruz.org/html/index.php/blog/show/Drawing-with-Cairo-without-flicker.html Wed, 30 Dec 2009 01:56:40 -0600