Got an answer on my Python Minidom question

Lately I am have been into python development and the interaction from Python and XML. Python has some modules to interact with modules such as SAX, MiniDom, and other packages for the XML. The email was shoot on the PyXML-SIG list which is a mailing list devoted to give support to python and xml users.The first reaction was the lxml or ElementTree proposal which seems appealing but is yet another XML manipulation framework. However since I want to learn one framework and then move on to the next. Also since I want to do a OpenOffice.org manipulation with the python in the OOo installation. I want to make sure that this code can be run for most people.So finally after some emails I got a real reply to my question about using minidom to change the attribute of some of the nodes. The first step was calling on the namespace and the next will be to use the getElementsByTagNameNS(). This function already have the node name and the attributes as methods like:OONS= ‘http://openoffice.org/2001/toolbar’doc= minidom.parse(PATH)item= doc.getElementsByTagNameNS(OONS, ‘toolbaritem’)[0]item.setAttributeNS(OONS, ‘toolbar:visible’, ‘true’)fp= open(PATH, ‘wb’)doc.writexml(fp)fp.close()The next function is setAttributeNS to have the writexml() to overwrite the changes. The only issues I am having is figuring out the 0 option from the getElementByTagNameNS(). I can’t really figure out if this is a count within the node or within the tree. I’ll be testing this snippet and come up with a script to modify the XML to simplify the toolbars.

Advertisement

Bridging Linux and Windows

Having a Linux desktop on a Windows company carry many hassles, standardization on proprietary — Microsoft software will affect you in ways you can’t possibly imagine. The whole M$ crap was too much to work around through web interfaces so I have eventually to go to virtualization. The virtualization should have take care of everything, if you can’t run a crappy OS like windows at least use it like an app through emulation right? Well not so yet.So we had this thing called Microsoft Communicator, which is like a offspring of MSN Live Messenger. The MSC is utter crap, basically it’s annoying and on top of that is very picky on the communications bits. The interconnectivity with the servers is very weak and dumb and it requires a real IP so the exchange can go back and forth.Having this combined with the pressure from management I decided to take drastic steps and nuke the hard drive. Before nuking it I did a backup which wasn’t very attended since the backup was done to a Fat32 drive which tops at 4GB. This made my backup useless in the end.In the end after a bunch of data lost and stuff I got to get MSC going on a native windows install. I also found out that the server had my wrong email ID which made my torture last even longer. After a week and half of failures and a nuke hard drive, communicator worked. However the challenge was to get back to linux and that’s where the process started.After having a virtual OS set up with outlook, BMC, and Secure client working perfectly, I have to come to the conclusion that all these applications are smart enough to survive NAT networking however MSC will require some credential exchange which lead me to believe that having a real IP would be the best choice to. However on the VirtualBox page there was little documentation on bridging. There was the user manual but even that document wasn’t very thorough and sequential.Reading on the VirtualBox forum I found a VirtualBox guide for Ubuntu which help me out to have the connectivity setup and in the end MSC got connected.The process was not hard but it was long, first problem that I had in the past was finding the right package for the right tools. The tutorial talk about a brctl and tunctl, however these were on two different packages: bridge-tools and tunctl.The other problem that I have was handling all the instructions in the correct fashion. First I have something like scattered commands between one and the other. The next thing is the code for:brctl addbr br0ifconfig eth0 0.0.0.0 promiscbrctl addif br0 eth0dhclient br0tunctl -t tap1 -u my_userbrctl addif br0 tap1ifconfig tap1 up

on my way back

So right now I am just making the final arrangements to go back to Guadalajara, and get to go to work tomorrow. I am carrying my nokia800 so I have a good flight, I hope everything turns out nice. I hope to check back later tonight with maybe a meaningful post or two about my overall trip home.I was feeling a bit bad yesterday but today I am much well. Hope everything turns out to be ok.

Mr Fantastic runs Linux

So I was watching some clips from the fantastic 4 part 2 when I saw Mr Fantastic playing with what it seem like a controller. This device looked real familiar and indeed it was. He was holding a Nokia 770 which is an internet tablet PC that runs the maemo Linux OS.Interesting clip, here is a screenshot:

Media_httpfilesmyoper_tqkib

OOo 3.0 it’s comming

A snippet from GULLFOSS take us to through the roadmap expected for OpenOffice.org 3.0 which is coming faster than many expected.

Media_httpdevelopment_aaxcv

This are great news and at the same time it spurs some debate on what should OOo become. Since the launch of MSO 2007 and the big transformation it had on the UI, we have to wonder if OOo will follow suite. If there will finally be an email client with it and if we are going to see either an explosion of complexity on the source code or a true lean mean Office machine.

Best gift for my Bday

hey!happy birthday!i’m having a really short break now, and i really did a big sacrifice to be able to catch some weird bus to get to the freaking library which is so far. and it’s so hot, so i can get to the internet cuz it’s ur birthday……..just wish u a happy birthday, i send u muchos bessos. mi monito fheo.take care of u pls.i luv u a lot. i really need u so much sometimes….luvkiss

This was by far the best gift I received today, totally unexpected. I was so happy when that email came and a bit frustrated because I didn’t catch it right away. But never the less I can tell you that this girl is still mine. It’s been almost 2 months since I last heard of her, and having her sent me that email clear a bunch of my pain that I was getting from thinking that I was loosing her. Yet she got me a big surprise when I got her email.totally awesome… I am the happiest guy!

Happy Bday to me

So today is my bday, again the mixed feelings of hapiness and realization that I am an old man. I am about to hit 30, (just turn 29) and well I still live with my parents…. haha actually I dont. Yet right now I came back home to visit my sister graduation and found out that my bday hit that same week so I stayed a bit longer.Then again I am almost 30, I don’t have really any thoughts, is just another year, I am getting older, I have felt stuff that makes me think that I older yet I still want to go and play basketball like I was still in high school, no difference.I been doing some swimming while I am here and at least in the water I am still the same. I also feel like I was 21 or somethig, nothing really changed.Is a weird feeling, on the flip side I guess I achieved a lot this year, I stayed the whole year in mexico but at least I wasn’t alone. My girlfriend came here to visit me, we had a great time traveling, I got a good job and my adventure in guadalajara and I got to travel to the US once again.I also gave many talks around the country and well I guess I have had fun which is the most important thing.

Manipulating videos from the commandline

Media_httpfilesmyoper_emqmk

TLLTS and other podcast comment on some of the software that has stalled in development on the Linux desktop. One of this is the video editing software. Today I started manipulating the videos I picked up yesterday. What happened was that I got a DVD full of different segments from my family home videos. These videos include:

  • My sister trip to Vancouver, Canada
  • My Girlfriend visit to Mexico
  • And finally, my sister high school graduation

The transfer to DVD inspired me because I know this videos will go rotten since this videos are becoming more obsolete on the formats like Betamax and 8mm tapes. When you transfer to digital now, you can get this data a new life, accessible from everywhere, from the cellphone, to the PDA and to every digital medium. However digital video is very flexible, the flexibility that software allow us to do is incredible and Linux has many tools arguably speaking of course. I manage to have in a few hours all the videos I needed on the format I wanted and the quality that I really have to get. First thing I did was having some of the steps:

  • Rip the DVD so I can have into Digital
  • Divide the video into more digestible bits
  • Have this clip on a smaller footprint taking care of the quality
  • Be able to play it on my PDA

So my first step was to use a GUI application, the first one that I tried was AcidRip which is a free software front end to mencoder and be able to set a bunch of configuration options that otherwise you will have no idea how to do it. The ripping part was a bit confusing because it has a progress bar that might not work because the numbers were all on 0, and the bar never really took off. However having he DVD spinning told me that there was something going on. I drop to the command line and I saw my output file appear and start to grow on size so that assured me that the ripping was going on. This gave me size of 670MB, for about 1:40 hrs of content. But now I have 3 different videos from what I mentioned before; I was interested on the video from my gf because I was eager to show it to her since she asked for it at one point and it would have been a nice surprise to send it to her. But this clip was in the middle of the whole video squences and now I needed to copy just the segment I need. My first option was to use Avidemux and do the croping. The progress was simple, go to the minute to start the selection, then go to the end of the selection and then just save it by going File > Save > Save Video. I did have a couple of difficulties triying to get to the exact minute to start and end the selection. I wanted to edit the time box but unfortunately I couldn’t get it, or have a Go to.. option. But my second grief was that the simple copy actually did some breaking that after minute 4.23, I lost the sound. Also I experience some de-syncing of the audio with the video. I start looking for alternative tools, probably more simple and I come to ffmpeg. I found a great ffmpeg tutorial to get the specifics on how to do my cropping with hopefully improved results. This tutorial hit on the head about what I needed to crop it. First I learned how to set the starting point to record, which was the option -t, then later was the more challenging which was how to set an end point. As opposed to set an end point you have to say for how long will the recording be happening. So instead having start at minute x and stop at point y, you have to say more like, start at minute x and record for y. Also other options like the tag for the incoming file and the output file. $ ffmpeg -i master_video.avi -ss 00:52:21.0 -t 00:03:25.21 master_clip.avi Here we got to tell the file take this file, go to minute 52.21 and record for 3.25 minute into the file master_clip.avi. This gave me a great video in the sense it was just at the exact point I want to start and stop recording. The problem was the quality was automatically set to crappy quality. So an option I found reading the man pages of ffmpeg was the flag -sameq which stand for same quality. Now that gave me a great video quality, superb I will say. However the file was almost 50mb for 3 minutes of video. Here is where I used my 770-encode script; but since I just learn my little lesson in quality I went on and also activate the quality to best. $ 770-encode -p=best master_clip.avi clip770.avi.

Sister graduation and data preservation

This Saturday my sister graduate from high school, thanks to this it allow me to come home and be back with my family since I went back from the US back in December. Now I will be one week around and be able to work from home.The graduation ceremony was interesting, I got to meet back with some friends and also catch on on what ever happened withmy high school friends too. Amazingly a lot of them are living in the city. I was my family official photographer having to shoot lots of pictures during that night, and have a good time with my family, I even dance some salsa with my mom — I don’t like salsa.However as I was taking pictures to my sister I came to one realization, I start thinking of my won graduation pictures. I had my pictures taken almost 10 years ago and I see them now and they look exactly like my sister picture. What do I mean by that, that when I took my pictures I instantly digitize them and now I can see them the same way they were many years ago.

Media_httpfilesmyoper_xsyfj

And now my sister one….

Media_httpfilesmyoper_hgcfd

Given that the quality of my sister picture is better. It was shot with a more recent camera and it was also shoot natively digital, while the other ones were scanned. However is interesting that the quality once digitized the quality has not change at all. The interesting here is the way this data will preserve for many years to come. Now we are looking to a huge level of image technology because we are using open standards like PNG, while most of the native format is JPEG, it is open enough to be displayed all over and exchange format seamlessly. However the print pictures from my family books have degraded to such a point that is not possible get back or even think on preserving this instance without a major effort.While I was taking the pictures, my dad was taking us a video, the video was NOT a digital video and it was done on a Hi8 cassette. This format is not open, and is not digital, this means that some of the videos shot by this camera can’t be moved around. They can’t be tranfered to other mediums like a computer, cellphone, pda and most important is a dying technology. This means that most of this memories will not be preserved and some of my childhood parties and videos will be gone forever.Interesting topic and even if there is nothing new, is interesting how people are simply not conscious enough to think about this. I hope on the long run we can move forward to digitize all our life medium. Have you digitize all your family legacy yet?

TLLTS with your host…. me :)

So today I was the host of The Linux Link Tech Show, one of the premier Linux podcasts and the longest one running on the web. The show was hosted by Tsuroerusu and me. I was able to give a talk about OpenOffice.org and the integration with Aqua on OSX. The improvements done on the charting modules and the soon to be released 2.2.1 version with some improvements. I was also able to talk on other different topics like the future of the toolkits specially Qt4, KDE, Qt and Linux on cellphones.

There was a big debate on GPLv3 and Free software vs. Open source people and why some people (linc) hate freedom. Finally we start talking on different topics regarding whats hot out right now, a big of rant on Apple, OSX, free software and education and the mainstream of developers versus the open source developers. I got a big rant on free software on education and even reference the big Mexican failure such as Enciclomedia and the OLPC. I couldn’t mention anything on the Classmate PC and also the surge of $100 dls mini PC and the future for ourself now that we manage home networks as opposed to just 1 desktop.I reference to a lot of links from LinuxDevices.com and the cool stuff that has been coming from the CELF, the Consortium for embedded Linux. There are a lot of talks and presentations there, it was pretty bad that I couldn’t get the actual audio talk so people can listen to the future of Linux on cellphones.