Archive for the ‘Languages’ Category

Rails… Fails… (sticker)

Tuesday, September 23rd, 2008

I had first seen the interesting Rails logo in a talk by Terry Chay, while I was at OSCON, a few months ago.


Jay Pipes

Now, my esteemed colleague Jay Pipes has it on his laptop. It seems they’re making stickers, even.

Otherwise, my next task is to revamp our Ruby content. Currently, it looks a little sad. It has to at least be as good as Using MySQL With Ruby, no?

workbench-5.1.1-alpha on Fedora 9

Sunday, September 21st, 2008

So, you want to compile Workbench for Linux, on Fedora 9. You need to install the following packages:


autoconf automake libtool libzip-devel libxml2-devel libsigc++20-devel libglade2-devel gtkmm24-devel mesa-libGLU-devel mysql-libs mysql mysql-devel uuid-devel lua-devel glitz-devel glitz-glx-devel pixman-devel pcre-devel libgnome-devel gtk+-devel pango-devel cairo

I feel I’m being too liberal with dependencies, but I’m not about to strip it, I just want to get it working first :)

You need to have ctemplate and ctemplate-devel installed from updates-testing-newkey (relevant koji build log).

By default, configure.in in Workbench looks for “google-ctemplate”, as opposed to just “ctemplate” as Fedora calls it. You can fix this (easy), or “cheat” - in /usr/local/include you can do sudo ln -s /usr/include/ctemplate google. Take your pick.

Now for the fun. Fedora includes gcc-4.3. Ubuntu ships gcc-4.2. Let’s just say gcc-4.3 got stricter (its C++ header dependency streamlining related). So strict, they have a useful porting to gcc-4.3 guide. Just FYI, I believe OpenSUSE is also shipping a more modern GCC (I expect the next Ubuntu release in the coming month to do the same).

So, start getting used to doing the following in files that lead the compiler to fail:

  • #include <cstring>
  • #include <algorithm>
  • #include <memory>
  • #include <climits>
  • #include <cstdlib>

This will help get rid of error messages like: error: ‘memset’ was not declared in this scope. This stuff is already fixed in trunk (or the patch is being applied).

You will need to pick up cairo from source. Why? Because –enable-glitz isn’t on by default in the RPM spec file (similar with Ubuntu). The glitz backend is apparently still a release preview and doesn’t fully work yet. (I have spoken to Alfredo, and he says he’s just removed the requirement on glitz in trunk).

Now, once you’ve built cairo with glitz, before running ./autogen.sh, do: export PKGCONFIG_PATH=/usr/local/lib/pkgconfig. Then go ahead and make it.

There are still plenty of warnings that spew by. I have this vague idea that once Workbench for Linux sits on Launchpad, we’ll run a janitorial tree that fixes warnings in the code. A great way to garner community contributions!

Anyway, a lot of this is either fixed or patches will be applied to trunk. I expect a mysql-workbench-5.1.2-alpha out sooner than you think to eclipse 5.1.1-alpha. Again, superb work Alfredo (and MikeZ and the rest of the GUI team).

HOWTO: MySQL Connector/C++ on Mac OS X

Friday, August 8th, 2008

Excited with the release of the MySQL Connector/C++, I thought I’d get it going on Mac OS X.

You’ll first hit the problem that Mac OS X doesn’t come with CMake. So you’ll have to download it from the site - there’s a warning there that the .dmg installer only works for Tiger, but I ran it on Leopard, and its just fine. Don’t forget to allow it to create links in /usr/bin for ease of use.

After that, you will need to install glib. But to get glib going, you need some dependencies:

Installing them is simple: untar (tar -zxvpf package.tar.gz), ./configure, make, then a sudo make install.

Now, the README file or the instructions on the wiki will just work. I have several MySQL installations, so I preferred to specify what cmake found. I did this by:
cmake -D MYSQL_DIR:PATH=/usr/local/mysql/ -D GLIB_DIR:PATH=/usr/local/lib/glib-2.0/ .

Then a simple make, and you can go on and try the examples, in examples/. Try the connect application to make sure things are working. You will probably run into a snag though:


luna:examples ccharles$ ./connect
Connector/C++ connect basic usage example..

ERR: MySQL_DbcException in /Users/ccharles/code/mysql_connector_cpp_1_0_0_preview/examples/connect.cpp((function n/a)) on line 159
ERR: Cannot connect (MySQL error code: 0 )

Take a look at examples/examples.h, and look at the connection properties. It uses the test database, on localhost (127.0.0.1), standard port 3306, user is root, and the default password set there is root too. This may not be the commonest setting, so don’t hesitate to change the password or leave it blank (ala a default install), and rerun make. The sample applications will now work :)

Congratulations to Andrey, Ulf, and the rest of the connectors team in getting this going!

mod_auth_mysql patched to work with phpass

Sunday, June 1st, 2008

Do you use mod_auth_mysql, the Apache module that allows authentication of users to happen through a MySQL database?

If so, the nice folk at Automattic (makers of fine blogging software like Wordpress) have released a patched version that works with phpass.

With this, you can now have single sign on (SSO), with authentication against a WordPress blog (or bbPress forum). Note that WordPress (in 2.5 and later), doesn’t use MD5 hashes to store passwords any longer; instead they are salted and hashed with the phpass library. The Automattic folk use this to provide SSO for Trac and Subversion.

Read Barry’s announcement, and grab the patched mod_auth_mysql.

Interactive Application Development for IPTV

Thursday, May 8th, 2008

Presented by Ronan McBrien and Sourath Roy, both from Sun Microsystems. The highlight of the show for me? Seeing the Sun Media Receiver. Not much information about it, except from the Sun Labs Open Day.

  • Sun Media Receiver (developed at Sun Labs, now maintained by ISV Engineering). Sun make a PVR? Cool.
  • RISC Processor (150-300MHz, predominantly MIPS, some ARM), memory, HDD optional, Ethernet port, USB, IR (remote control), Video output (SD, S-Video, composite, or HD, via HDMI connectors), hardware codecs (MPEG2, MPEG4-2, H.264)
  • Makes use of the Java Media Framework API
  • Can also expose talking to a SIM/smart card through the Java APIs, for security in your IPTV hardware

Uing DTrace with Java Technology Based Applications: Bridging the Observability Gap

Thursday, May 8th, 2008

Presented by Jonathan Haslam, Simon Ritter, Sun Microsystems

In what I thought was completely great showmanship between Jonathan Haslam and Simon ritter, it was simply, pure comedy, having the two of them on stage. No reason to go deeply into notes (as the verbose slides are available), but the actual demonstration, the writing the code on stage, and the dynamics between the two - that made this session pure gold to attend.

You can ask a system to panic with DTrace if you want!

Some terminology:

  • Probe: place of interest in the system where we can make observations
  • Provider: instruments a particular area of a system, and makes probes available. Transfers control into DTrace framework when an enabled probe is hit
  • Aggregation: patterns are more interesting than individual datum, so aggregate data together to look for arrays. Generally an associative array

DTrace has a PID provider, to look at applications based on PID

dvm provider is a java.net project to add DTrace support in. Install a new shared library, and make sure its in the path.

DTrace in JDK6 exists as a hotspot provider. No need to download a shared library. Its also more feature-rich.

Project DAVE (DTrace Advanced Visualisation Environment) was demoed. Also note that there’s chime.

Free and Open Source Software: Use and Production by the Brazilian Government

Thursday, May 8th, 2008

First up, I want to say, I’m truly impressed with Brazil. One day I will visit this amazing place, and spread the good word of open source with projects that are close to my heart: MySQL, OpenOffice.org, Fedora, and in due time, a lot more. This is a live-blog, from a most interesting talk, at JavaOne 2008. As I wrote on Twitter, “Brazil, simply impresses me. Their use of open source in government, makes me think that the rest of the world has a lot to learn from them”.

Free and Open Source Software: Use and Production by the Brazilian Government
Rogerio Santana <rogerio.santanna@planejamento.gov.br> +55 61 313 1400, Logistics and Information Technology Secretariat
Planning, Budget and Management Ministry
Brazilian Government

Households with Internet access: 70% in the US4k household income range. 70% of households have mobile phones (even when total revenue is USD$2k). Middle and upper class are all, generally on the Internet.

In 2007, 98% of Income Tax has been sent by the Internet. By 2009, there’s only going to be use of a Java application for this. About 17.5 million people filed via the Internet. Impressive.

Brazil has 142k public schools - 26k are connected to the Internet now (18%), and 92% are connected at low speed, while 8% have 512kbps connections.

Plan? Free Internet for schools, from 2008-2025. 1mbps for each connection, growth plans in the next 3 years.

There exists Computer Reconditioning Centres (CRCs) for recycling PCs.

www.eping.e.gov.br (e-PING: e-Government Interoperability Standards)
www.governoelectronico.gov.br (e-MAG: e-Government Accessibility Model)

Brazil has been using electronic voting since 1995. 136.8 million people voted in 2006 election. Next version of vote machines will use GNU/Linux!

Open Standards. Interoperability. Free Software. Free License. Community.

e-PING: uses XML, browser compliant, they have metadata standards

Many organisations of the Brazilian Government use Java as a primary development platform. Remember, Java is important because its the first that allowed even Linux users to interact with government applications.

Brazilian Digital Television? Middle-ware responsible for the interactive process of digital TV also developed in Java. (Ginga is the name of the application).

In education? Enrolment is done via the Internet for universities. e-Proinfo is an e-learning project that has already trained 50k students.

Developing clusters and grids, with focus on high availability, load balancing, database replication, distributed mass storage, and virtualization. The government is backing this, since 2006.

Miguel de Icaza from Mono on Moonlight

Sunday, April 13th, 2008

Miguel de Icaza from the Mono project, tells us more about Moonlight, and where the Mono project is headed, at LugRadio Live USA 2008.

- shows us about Silverlight 1.1 (Moonlight is the Mono equivalent)
- works a charm in Firefox, but there’s issues with the implementation in IE (something JavaScript related)
- Demos the chess application
- Microsoft will provide a Media Pack (they will incur the licensing costs for the media codecs) for all Moonlight users on Linux. Microsoft will also provide regression test suites, and complete specifications for implementation. Novell will deliver a 100% compatible Moonlight and will support it on all major Linux distributions (contractually, only the top 3 Linux distributions - no mention of what the top 3 are). This is the Microsoft/Novell agreement, as of last September 2007.
- The codecs come with a restriction - you can’t use it outside Moonlight. Its only for the in-browser experience. If you use Totem, you’ll need to make use of gstreamer, etc…
- The MSPL is better than the X11 license. Miguel would like to change the Mono license to the MSPL, but everyone that hates him now, will hate him more because of the “Microsoft” substring! Why is the MSPL better? It has a patent clause, so that the code you use there, if covered by a patent, you will not be sued, ever. That in a way, is similar to the Apache license.
- Self-contained applications - traditional GNU software is spread out, quite unlike Mac OS X applications where you drag an application into the Applications folder, and everything is contained in one directory. Mono has an application guideline, where everything is also in one directory.
- Like all good demos, something broke. Miguel starts debugging on stage, and fixes the problem, and the demo works!
- “Programmers have no taste for design”
- “I have a roadmap, but I don’t think anyone gives a fuck, so lets just go to questions”
- How long will it take to get mixed-mode assembly working? If you are Chris Toshok, it will take 2 weeks. If you’re not, definitely longer. He spoke to Dan Kegel from the WINE project :) Patches are being accepted… The aim is to allow WINE to run Windows applications on a fully open source stack

Technorati Tags: , , , , , , , , , , ,