Marco Islas Blog

stuff

  • Fennec alpha released for Android and Maemo




    Yesterday, the Fennec team release a new alpha of the Fennec Firefox browser for Android and Nokia's Maemo. It has some very interesting stuff, like the sync between desktop and mobile device, addons, save to PDF and some extra.. Lookd promising, but, at least right now, I'm not installing it on my Android. Why??
    1. It is alpha and some stuff doesn't work like it should, just check the video Pinch Zoom is really choppy..
    2. I'm pretty happy with Android's default browser. Opera Mini didn't make me change it as my default browser (Maybe Opera Mobile would do) and an alpha version of Fennec definitively will not replace it.
  • Aug 10

    SLP Bus StationSo.. what about my life this week?. Well, starting with fake bill that we got on the business, I had already posted a video about it. The worse: I have to pay for that :-(.

    Ok, moving on... one of the few things that I gladly remember about Salamanca, at least the first semester that I lived here, where the Grupo Linuxero del Bajio (GLIB) meetings at Maquiavelo's house. I like them because at the end there where just 3 or 4 left (including maquiavelo) and we talked about Linux, technologies and other nerdy stuff. The past week, I did more or less the same thing, but this time in my business place and with mario y Andres.

    As you should know if you are following me on twitter. I had to travel to San Luis Potosi for work, I arrived, worked and leave in the same day, I meant, I leave Poza Rica Thursday at 7 in the night, arrived at 6:30 in the morning, leave san luis at 11 in the night and arrived to poza rica at 10:30... That was tired 23 hours trip with just 16 hours rest.. but at the end everything was ok and finally meet the Supramax Evo 5 gasoline dispenser:


    Supramax Evo 5

    Saturday and Sunday, both where great days with my family, Sofia, Cristina, Mom and Dad where my company. Saturday was meant to rest, on Sunday I wanted to play Kill Zone 2 and I did, but in 10 minutes period every time I tried, it was at the night that I played all I wanted.

    Now, I'm writing this (captain obvious just appeared), waiting for the end of the day and hit the sack, I'm tired because today's morning (Tuesday) I didn't sleep well working trying to reach the proposed deadline and I did :-), but I have to give more of me if I want to finish all my work on time. Fortunately, it seems that Mario and Andres will be here by tomorrow and will repeat the meeting :-).

  • Huapangos


    Huapangos at Huauchinango, Puebla from Marco Antonio on Vimeo.

    Cristina and I went to Huauchinango, Puebla to celebrate our first anniversary, what a surprise that in Huauchinango are celebrating the city 149 anniversary. There is a bunch of people in the midtown park. We where watching some huapango bands performing and many people dancing. The next day, the first "Chiles en nogada" fest took place at midday.

    Huauchinango is one of those small cities where Cristina and I like to live. Maybe in the future.. :-)

    I realize a couple of things... My father's camera took very large videos and You can upload a video which size is more than 1Gb at least using Vimeo desktop uploader.

    One more video: Read More...

  • C'mon, became a fan


    C360_2010-07-26 09-39-49.jpg

    Old (wasted) joke.
    I wonder how many peole died because of that cpu cooler
  • My laptop


    FxCam_1280155292083.jpg

    Reading some posts via Google Reader
  • My new smartphone

    2010-07-15 15.44.17.jpg

     

    Last thursday I received my Google Nexus One smartphone. This is a gift from my lovely wife and daughter because next July 29 is my birthday. I want to say thank you to Sofia and Cristina.

    My first impressions of the phone allow me describe it as: Amazing!. Everything "just Works!" but not only that, it works great!. I love the account sync (Google {calendar, contacts, mail}, twitter and facebook) . Just after it booted and did the startup configuration the upgrade service warn me that froyo was ready to install. 10 minutes later I was using Android OS 2.2.

    The camera is great, how to say no to 5 megapixels?. And the video, it takes high-res video with a pretty descent frame rate, just check the last sofia video.

    Applications starts ultra fast and perform pretty well, if I was a lover of my Nokia 5530 because it performs pretty well (even when the apps may take some seconds to load) this new (smart)phone got me fascinated.

    Lots of my contacts (from google) where synced, then, I just had to write a couple of them again.

    It is finally here!

    Again, thank you Cristina.

  • My Laptop's hard drive failure.

  • Have you ever had that feeling when you're not sure if you're awake or still dreaming?

    All the time...
    It's called #python - it's the only way to fly.
  • Christine 0.7.0 Beta1 released


    Christine running on win32

    Just to let you know that Christine 0.7.0 Beta 1 has been released. This release include several improvements over Christine 0.6.1 and fixes some problems with the win32 build. The full you can read the full changelog Here.

    You can download christine from Here

    Remember, this is a beta, and many bugs are still there, tests and bug reports are very very appreciated

    Update:

    • Win32 binaries are available Here
    • Ubuntu package is almost done, you can use this ppa
  • Compressed XMLRPC on python

    This post is about something I did on ICTC, we are developing some applications that communicate with each others on over the network and we thought on compressed XMLRPC. I have been looking about this on Google, but didn't really found something. So, I try by myself and this is the result.

    First, allow me to explain a bit more about xmlrpc. XMLRPC is nothing more than a remote call using the HTTP protocol the POST method and XML as content, then, the server do its work and return something in the same way. THen the client parses this xml and create the result in a native way. Just like if that method where in your program. This offer a language independece (the server may be written in some language and several clients in many other languages).

    Then, implementing compressed xml should not be that difficult, I mean.. HTTP support the "Accept-Encoding" header and that should do the job. But hey... xmlrpclib does not include gzip support, so, we are going to do it.

    The server part should subclass SimpleXMLRPCServer and in the constructor we are going to create a inner class that will be a request Handler, this handler is based on SimpleXMLRCPRequestHandler and implements the do_POST method, this method is called everytime something is sent to the server (on every call).

    In do_POST method we are responsible for fetching the data, decompress it, parse it, handle the response and then send the reply to the client. This isn't so hard (check the code). The important part here is that we check for the "accept-encoding" header and that the vale of that header (if exists) is "gzip", if this is true then use zlib to decompress the data and when we have the result of the call, compress it using zlib and send it to the client.

    def do_POST(self):
            if self.headers.has_key('accept-encoding') and \
                            self.headers['accept-encoding'] == 'gzip':
                    # check if the path ir right
                    if not self.is_rpc_path_valid():
                            self.report_404()
                            return
                    try: #Try to get the data
                            max_chunk_size = 10*1024*1024
                            size_remaining = int(self.headers["content-length"])
                            L = []
                            while size_remaining>0:
                                    chunk_size = min(size_remaining, max_chunk_size)
                                    L.append(self.rfile.read(chunk_size))
                                    size_remaining -= len(L[-1])
                            data = ''.join(L)
                            data = zlib.decompress(data) #Decompress
                            response = self.server._marshaled_dispatch(
                                            data, getattr(self, '_dispatch', None)
                                            )
                    except:
                            #Should be good to registre the exception somewhere
                            pass
                    else:
                            #We have an answer...
                            #Let's compress it
                            response = zlib.compress(response)
                            self.send_response(200)
                            self.send_header("Content-type", "text/xml")
                            self.send_header("Content-length", str(len(response)))
                            #As the call was compressed, then we compress the
                            #Answer too. Be sure to set the compressed header.
                            self.send_header("Accept-Encoding","gzip")
                            self.end_headers()
                            self.wfile.write(response)
                            #Close the connection
                            self.wfile.flush()
                            self.connection.shutdown(1)
            else:
                    return SimpleXMLRPCRequestHandler.do_POST(self)
     

    This take us the the other part of the call, the client. The client must implement gzip compression too. The client part is a bit simplier, you just have to subclass xmlrpclib's Transport and and in the "request" method compress the request_body before sending it. Obviously you have to append the "accept-encoding" header to the http connection. Once you have the result you have to check for the "accept-encoding" header too, if it is there, decompress using zlib's methods.

    def request(self, host, handler, request_body, verbose=0):
            '''
            Encargado de manejar los request, envia los datos y recibe
            las repuestas, por lo que aqui se hace la compresion de datos
            y posteriormente se envian los datos recibidos a
            la funcion self._parse_response o self._parse_gzipped_response
            de acuerdo al caso.
            Mas informacion:
            http://docs.python.org/library/xmlrpclib.html
            '
    ''
            h = self.make_connection(host)
            if verbose:
                    h.set_debuglevel(1)
            self.send_request(h, handler, request_body)
            self.send_host(h, host)
            self.send_user_agent(h)
            #Compress if GZIP_ENCODED is true
            if GZIP_ENCODED:
                    #Don't forget to set the header!
                    h.putheader('Accept-Encoding','gzip')
                    request_body = zlib.compress(request_body)
            self.send_content(h, request_body)
           
            errcode, errmsg, headers = h.getreply()
            if errcode != 200:
                    raise ProtocolError(
                                    host + handler,
                                    errcode, errmsg,
                                    headers
                                    )
            self.verbose = verbose
            try:
                    sock = h._conn.sock
            except AttributeError:
                    sock = None
            # Revisar si la respuesta incluye los encabezados de
            # compresion y si este es gzip
            if headers.has_key('accept-encoding') and \
                            headers['accept-encoding'] == 'gzip':
                    return self._parse_gzipped_response(h.getfile(), sock)
            return self._parse_response(h.getfile(), sock)
     
    The whole code and a small example is here: ictcxmlrpc.tar.bz2
Previous page 1 2 3 4 ... 25 Next page
247 entries
twitter logo