Odd Crash of Opera/Firefox 3.0 on Ubuntu 8.10

For a time my Firefox was crashing and I couldn’t find why or pinpoint which pages made it crash since usually once Firefox was reloaded the pages could be opened. I googled for a while and many reports indicated a problem with the flash plugin and offered several workaround: from reinstalling the adobe plugin to block any flash content. Unfortunately, any of those worked. I got even more puzzled when I started using Opera with similar results. I found a bug report saying that deleting the wins option on /etc/nsswitch.conf may help. Now Firefox seems pretty stable. I’ll try to figure out what’s happening here and post any update here.

 

/etc/nsswitch.conf
------------------
#editado por el supuesto bug de firefox https://bugs.launchpad.net/ubuntu/+source/firefox-3.0/+bug/291843
#hosts:          files mdns4_minimal [NOTFOUND=return] wins dns mdns4
hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

R language

I’ve just know R and I’m amazed. Looks great and simple to use in our statistical analysis tasks of the new algorithms we’re working on. I’ve briefly used Octave-Matlab, Python with Numpy and plain Ruby with gnuplot, but R might be what I was looking for.

Installing Monodevelop Beta 2 (1.9.2) from sources in Ubuntu 8.10

Log on my experience installing Monodevelop Beta 2 from sources in Ubuntu 8.10 with Mono 2.2 already installed (the bolded steps are the ones that actually worked).

  • Install gtk-sharp 2.8.5 with
    configure --prefix=/usr

    – FAILED on make from some missing pango, glib depencies 

  • Install mono-addins –prefix=/usr –enable-gui  – OK
  • gtk-sharp 2.8.5 — FAILS just as the previous
  • gnome-sharp-2.20 — Shows some missing gapi-2.0 dependency. Decided try to fix this
  • Install gtk-sharp-2.12.7 (ignoring some missing things) – OK
  • Uninstall monodoc de gdeb – OK (after that I found that was not necessary)
  • Install monodoc 2.0 –prefix=/usr – FAILS to some missing methods. Googling it seems that monodoc in now integrated with mono 2.2 but couldn’t find it. Decided to install monodoc 2.0 from apt-get again
  • Install monodevelop-1.9.2 with ./configure –prefix=`pkg-config –variable=prefix mono` – OK

Accessing a Microsoft SQL Server 2005 Server from Ubuntu 8.10 via ODBC / FreeTDS

Update: Check the encoding conversion note for FreeTDS

Following this post I’m detailing the process I’ve done (took me less than 10 minutes):

Set up variables on ~/.bashrc – no se si quedaron bien, las hice como root

 export ODBCINI=/etc/odbc.ini
 export ODBCSYSINI=/etc
 export FREETDSCONF=/etc/freetds/freetds.conf

All of the following can be installed via apt-get:

install unixodbc
install tdsodbc
install unixodbc-dev
install freetds-dev

configure /etc/freetds/freetds.conf (check the client charset section since FreeTDS uses ISO-8859-1 by default and it’s very likely you want to change it (check here ):

[MY_SERVER_NAME]
    host = 192.168.0.YY
    port = 1433
    tds version = 8.0 #Checar si se usan otras versiones: www.freetds.org
    client charset = UTF-8

install sqsh
test with

sqsh -S DB -U user -P pass

configure /etc/odbc.ini

[MY-SERVER-NAME]
Driver        = FreeTDS
Description     = Conexion a Sql  con FreeTDS / ODBC
Trace         = No
Servername    = MY-SERVER-NAME
Database    = MY-DATABASE-NAME

configurar /etc/odbcinst.ini

[MY-SERVER-NAME]
Driver        = FreeTDS
Description     = Conexion a Sql  con FreeTDS / ODBC
Trace         = No
Servername    = MY-SERVER-NAME
Database    = MY-DATABASE-NAME

test

isql DB SA PASS

Trying Heroku

I’m trying Heroku  with the same app that runs this blog.  And it’s great! In no more that 2 hours I get the app up and running with few workarounds needed.

  • I had some problems with the tar.gz used to import. It might because a) SVN files and dirs, which I latetly removed, or b) the tarball created on Windows. But I swittched to the Git import method on Ubuntu and everything uploaded ok.
  • I had Rails 2.1 freezed on vendor/, which after some googling  I found it has to be deleted, and comment the line that searches for a specific version of rails.
  • I also had to remove the freezed version of Ferret and use the one included in Heroku.
  • The only problem which turned to be impossible to solve was the import process of the data. I used the YAML export as described in the documentation but it failed and sent a message to technical support. My db is MySQL so the problem may be there. Let’s see what the guys at Heroku say.

How ASP.NET fails – Ready to Quit ASP.NET

This post by Stefan Rusek express exactly how I feel about ASP.NET from the UI/Web perspective. (Check also the Hacker News thread on it)

I would add that, over the years, the whole .NET framework has grown to a over-engineered beast. It’s coherent and consistent, but still a beast. So several parts of the framework simply goes too far on the Object Orientation and builds a excess of classes, realtions, patterns and so on, sometimes making very painful the decision on how to correctly implement things. That’s why you feel so liberated when trying some other alternatives like Ruby on Rails (which, I have to say, seems to be growing too much recently).

Using ASP.NET also drives you to blindly use those architectures, patterns and practices, that Microsoft loves, without realizing that usually simpler is better, and without giving a second thought on how and why you are doing what you are doing (LINQ, three tier architecture, and so on). I’ve seen horrible real-world examples of this.

On the other hand, the .NET framework has some very interesting features like being a complete infrastucture, and C# is evolving in very nice ways, like the new dynamic features. Good things can be done with .NET, but you have to question  the “correct ways” as presented by Microsoft.

CSS Palette: Watch the Palette within a CSS

CSS Palette

I’ve written a quick toy to easily watch the colors used on a CSS. You pass the URL of an online CSS and it will parse the colors and build a palette for you. It’s useful if you want to reduce the amount of colors you’re using by spotting the almost duplicates that usually arise when writting code.

Color “sorting”

To display the colors in a nice order I wrote a “compare” color function to use with the sort method of the Array. It uses a basic color quantization by calculating the euclidean distance between the color and a origin at (0,0,0) black. Ruby code:

  #compares colors using the position 
def compare_colors(a,b)
color_position(rgb(b)) <=> color_position(rgb(a))
end

#returns the color "position" relative to (0,0,0) as euclidean distance
def color_position(rgb)
#Ruby 1.8.7 ya tiene reduce
#Math.sqrt(rgb.reduce{|dist,comp| dist+=comp*comp})
dist = 0
rgb.each{|comp| dist+=comp*comp}
Math.sqrt(dist)
end

One-line parse of the colors of the CSS

Once the CSS is downloaded with the standard net/http methods, it takes only one line to parse it and build an array of distinct colors (Ruby functional style is awesome):

   r.body.downcase.scan(/(#[0-9a-f]{3,6};)/mi).flatten.uniq

Generating the palette using DIVs

I wanted to show the colors as a single strip of squares that would resize with the browser window. This was a bit tricky because positioning DIV side by side had to be done by creating nested DIVs: the first one is displayed inline which makes possible to wrap the with the size of the window. The second div is displayed normaly as block and has a fixed size of 100x100px:

    

;background:<%="#{col[0]}"-%>;width:100px;height:100px;float:left"><%="#{col[0]}"-%>


The CSS Palette is permalinked on the rightbar.