Archive for the ‘en’ Category

La solución para las ingenieras

2 02UTC julio 02UTC 2016

Hay pocas estudiantes de ingeniería. De ingeniería informática en particular.

Es un tema que me interesa desde hace mucho. En un JENUI hubo una ponencia hablando de esto… y la ponente era alemana. Es decir, que no se podía culpar al atrasado país ibérico ni al cerril macho patrio; en la avanzada, europea, moderna y civilizada Alemania las cifras eran iguales, si no peores.

No solo eso; pasa lo mismo en todo el mundo. Hay pocos fenómenos que resulten tan coherentes, repetidos en países distintos, culturas relativamente diferentes, de uno y otro lado del charco. Las feministas dirán inmediatamente que no; que todas las culturas donde hay estudios de ingeniería son un régimen patriarcal, y por tanto no es extraño que ocurra lo mismo en todas ellas. Pero el caso es que en este asunto no he encontrado más que suposiciones e hipótesis. Ni un razonamiento sólido. Cuando alguien llegaba con un estudio que supuestamente arrojaba luz sobre el problema (y algunos recibieron atención de la prensa) yo lo leía y me decepcionaba absolutamente. Bueno, esto daría para un artículo largo. De hecho, con un compañero acabamos escribiéndolo y presentándolo a un congreso.

El caso es que leo un par de artículos en El Mundo. Por supuesto, no se acuerda de las ingenieras en informática; es probable que la autora ni siquiera supiera que la informática es una ingeniería. Pero eso son los prejuicios de ella, no los míos.

Uno es un artículo… de YoDona, y se titula Así son las ingenieras españolas. El artículo menciona las típicas historias sobre malentendidos o casos concretos de machismo, pero por supuesto no arroja ninguna luz sobre por qué las mujeres no se matriculan hoy en día (es más; en el caso de informática la tasa de matriculación no ha ido aumentando, sino disminuyendo).

El otro, y también de YoDona, es aún más… interesante. Se titula ¿Operación biquini? No, operación neurona para las niñas. Si te preguntas a qué viene ese título, no eres el único; y si encuentras la respuesta, no dejes de decírmelo. ¿Neurona para las niñas? ¿Biquini? Alucino.

En este artículo sí se aborda el asunto de las campañas para favorecer la matriculación de mujeres en ingeniería. Y unos presuntos expertos de una empresa llamada Smartick dan unas pautas. Brillantes. Cosas como estas que cito (literalmente):

  • Que en los estudios se demuestre la aplicación práctica para su vida diaria.
  • Que entiendan que ser bueno en matemáticas te abrirá puertas en el futuro.
  • Complementar la enseñanza de las mates con juegos.
  • Enseñar que las ‘mates’ molan a todos porque ayudan a entender mejor el mundo.
  • Sin matemáticas no se tiene capacidad crítica sobre noticias o informaciones.
  • Actitud positiva hacia las matemáticas, que mejora con la tecnología.
  • No hablar mal de las matemáticas, no fomentar patrones de conducta.
  • Buscar la aplicación práctica de los números, por ejemplo, en las recetas de cocina.
  • Motivar a las niñas para que no se priven de oportunidades futuras.
  • Para evitar estereotipos negativos de su capacidad intelectual, como “las niñas son de letras, se les dan mal las matemáticas”.
  • Queremos que haya mujeres en los puestos de dirección y política, para lo que necesitan dominar las matemáticas.
  • Intentar estimular a las niñas a que realicen actividades de construcción, robótica…

Por una parte, cosas como “motivar a las niñas para que no se priven de oportunidades futuras” es tan útil como “motivar a los conductores para que no beban antes de conducir”. Ya, tú. Si hasta ahí llegamos todos. De esos puntos ¿cuántos son medidas concretas que se puedan llevar a cabo?

Por otra parte… desafío al lector a que en cada uno de esos puntos evalúe si tiene algo que ver con las niñas, o los niños con pene no necesitan que se les demuestre la aplicación práctica de las matémáticas, o complementar las mates con juegos, o que no se hable mal de las mates… Vamos, por qué eso va a ayudar a que las niñas se acerquen a la ingeniería. O por qué si se hace no va a conseguir que se acerquen más niñas pero también más niños varones, con lo que el efecto neto será nulo.

Y finalmente… me ha encantado en particular el ejemplo incluido en el punto 8. La aplicación práctica de los números… por ejemplo, en las recetas de cocina. Me pregunto por qué citan ese ejemplo en concreto hablando de niñas. Viva la eliminación de estereotipos.

Lo dicho: si alguna vez lees algo coherente, no obvio o no basado en suposiciones gratuitas, no dejes de decírmelo. Todavía no he encontrado nada.

 

Anuncios

A bass player’s prayer

25 25UTC abril 25UTC 2016

Lord, let my quarter notes be even today.

According to James Chirillo, a good bass player he knew started his day with this prayer.

Using filters with LDAP authentication for Meeting Room Booking System

24 24UTC septiembre 24UTC 2015

Maybe you think you need a system for managing meeting room reservations. If that’s the case, chances are you’ve considered MRBS (Meeting Room Booking System). Probably not a bad idea: it’s free and not difficult to install and run (I’m using MRBS 1.4.11, PHP 5.1.4, MySQL 5.0.22… and off you go). Plus, it’s localized.

In addition, maybe you’ve got an LDAP server and you want that one to manage authentication. That’s not difficult, and the docs explain how to do it.

If you don’t want every LDAP user to be able to create and delete reservations, one of the available mechanisms is to use a filter. There is a configuration variable, $ldap_filter, that allows you to specify the users that the system will find and hence authenticate. The problem is: initially, it will probably not work.

In my case, the LDAP server is Microsoft Active Directory. The user name can be found in a field named sAMAccountName. If you try to do something like this in your config.inc.php file:

$ldap_filter = "(|(sAMAccountName=alloweduser1)(sAMAccountName=alloweduser2))";

it will not authenticate anybody, even if that search filter is perfectly valid.

Well, the trick is: MRBS puts parentheses around your $ldap_filter expression. So you must write your $ldap_filter without them. In the previous example, this will work:

$ldap_filter = "|(sAMAccountName=alloweduser1)(sAMAccountName=alloweduser2)";

Of course, there are lots of reasons an LDAP can fail (usually because you write some incorrect value in the configuration) but, in my case, the reason was this one.

Testing SMTP and IMAP with GreenMail

14 14UTC agosto 14UTC 2015

If you want to write some SMTP, POP3 or IMAP client code, maybe you’ll consider using GreenMail. This is a Java library that implements a mail server, and you can easily use it for testing purposes. You include it in your project, and in your tests, you can just start the server, send fake messages to it, or fetch them. You can connect to it and directly test IMAP, POP3, SMTP and their secure versions.

You can do something like this:

// ALL means you start all the protocols / servers 
// (SMTP, IMAP...) but you can choose only
// some of them.

GreenMail server = new GreenMail(ServerSetup.ALL);
server.start();

/* Do your stuff */

server.stop();

“Your stuff” can be sending mail to your local host, and then checking. You can create a user before sending him an email:

// Creating the user
server.setUser("testuser@localhost.com", 
	"testuser",
	"testpassword");
// Sending him an email
GreenMailUtil.sendTextEmailTest(
	"testuser@localhost.com",
	"sender@localhost.com", 
    	"First message subject",
	"This is the first body");

but if you don’t, a mailbox is automatically created when an email is received. Cool.

There is one annoying problem. In theory, according to documentation, GreenMail listens to port 3025 for SMTP. But when you try the above code, you find that mail sending is not working, and you get a connection refused exception.

Then you add a rule to your firewall to make sure port 3025 is allowed, to no avail.

And finally, in my case, a look at netstat or tcpview or whatever shows that GreenMail SMTP is listening to port 25, just as usual in any other SMTP server, in spite of what the documentation says. GreenMailUtil.sendTextEmailTest(), on the other hand, seems to be trying to connect to 3025, so it doesn’t match.

I’m not sure why this is happening. But my solution was to explicitly create my SMTP server at port 3025. Instead of using the predefined ServerSetup.ALL or other constants, you can be more explicit and create an array of ServerSetup objects, specifying port, address and protocol. So I changed the above code and created my servers like this:

ServerSetup[] ss = {
    	new ServerSetup(
		3025, 
		"127.0.0.1", 
		"smtp"),
    	ServerSetup.IMAP
};

server = new GreenMail(ss);

Notice that the string for the protocol “smtp” MUST be lowercase. In this case I use IMAP as well because I wanted to test IMAP, but it’s up to you which serversetups you include in that list. The IMAP predefined one worked well for me, so I didn’t explicitly create a new object for that one.

I’m not sure whether all of this is in the documentation, which is far from perfect. I had to find it myself just by trying and debugging.

Of course, that “3025” is here to make it clearly visible in the example; in your production code, you should use some constant that you can easily change just in case future versions of GreenMail switch to a different port 🙂 The same considerations apply to other constants in the code, which you should, as usual, subject to your coding expertise. Just in case.

Hitting a URL from Java

11 11UTC agosto 11UTC 2015

The simplest (and quickest) form I’ve found so far to hit a URL from Java code (or, for that matter, to invoke a REST web service, which is more or less the same) is:

	public static String hitUrl(String urlString) throws Exception {
		URL url = new URL(urlString);
		HttpURLConnection conn = (HttpURLConnection) url.openConnection();
		conn.setRequestProperty("Accept", "text/html");

		if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {
			throw new RuntimeException("Failed : HTTP error code : "
					+ conn.getResponseCode());
		}

		BufferedReader br = new BufferedReader(new InputStreamReader(
			(conn.getInputStream())));

		String buff;
		String res = "";
		while ((buff = br.readLine()) != null) {
			res = res + buff + "\r\n";
		}

		conn.disconnect();
		return res;
	}
	

Setting up Selenium

10 10UTC agosto 10UTC 2015

I’ve just started to have a look at Selenium to automatically test web sites from Java code (and hopefully do other things). This is just a note on how to install Selenium in a few words. It’s quite easy once you’ve figured out what is relevant or not.

  • Selenium is a set of Java libraries that allow you to manage a browser from your code. (They rely on an additional native .EXE file as well; more on this later).
  • There are several things: Selenium RC, Selenium WebDriver, Selenium Server. Forget about everything except WebDriver. RC is an older version (Selenium 1.0), and you will use the server only if you do some special things. Initially, you need Selenium WebDriver (which is equivalent to say “Selenium 2.0”) and that’s it.
  • You have to download Selenium itself. It’s a .zip file (some 20 MB) with a lot of .jar files inside. Take those .jar files (all of them; there are two at the root and a bunch of them inside a directory), copy them wherever you like, and add all of them to your project build path in Eclipse (with “Add external .JARs”).
  • There is an additional thing you will need. When you try to use some “browser”, there is an external (plaftorm-native) executable that handles that browser. And you’ll have to download that executable separately, copy it to some directory of yours, and refer to it from your code. This “driver” is sometimes called “server”, because of how Selenium libraries communicate with it, but it has nothing to do with “Selenium server” as mentioned above (an unfortunate and confusing double use of the word “server”).

So, in my case, I had to do something like this:

  1. Download Selenium itself from here: http://docs.seleniumhq.org/download/. In my case, I downloaded the Java version. But you can use other languages.
  2. Unpack, get the .jar and add them to the build path of muy project (add external jars).
  3. Download the Internet Explorer executable (from here: http://selenium-release.storage.googleapis.com/index.html; don’t get confused if they call it “IEDriverServer” when “server” should be reserved for other uses in this context, but this is the file you need). Or maybe the Chrome executable from here: http://chromedriver.storage.googleapis.com/index.html?path=2.16/ Or the Firefox, or whatever; it’s up to you which browser you want to automate.
  4. Put the executable wherever you want. And then add this line to your code:
    System.setProperty(“webdriver.chrome.driver”, “exe/ChromeDriver/chromedriver.exe”);
    or this one:
    System.setProperty(“webdriver.ie.driver”, “myexefolder/IEDriver/IEDriverServer.exe”);
    or whatever, stating the relative or absolute path where your exe file is. This line must be executed before you call the constructor for the driver: WebDriver driver = new InternetExplorerDriver(); or whatever.
  5. [UPDATE] There is a “generic” browser, which comes from the HtmlUnit framework. This is a Java implementation of a non-GUI browser; it works as a browser, and emulates JavaScript as well. If you use this one, you don’t need external executables, since it’s included in the Selenium libraries, and in addition it’s cross-platform. In that case, remember that HtmlUnitDriver has JavaScript disabled by default, and you have to explicitly enable it; have a look at https://code.google.com/p/selenium/wiki/HtmlUnitDriver.

That’s it. From there, you’ll be able to do things like driver.get(someUrl); and so on.

 

Whiplash

19 19UTC febrero 19UTC 2015

I’ve seen quite a few comments about Whiplash. And now I’ll make my own.

First of all, I liked the film. I’ts one of the sparse times I leave the theater mostly satisfied with that I’ve seen. That doesn’t mean the movie is perfect, of course; there are many things I don’t like. But it’s a honest, correct and enjoyable (in a somewhat wicked sense) movie. That’s quite a lot nowadays, and that’s why I understand all the hype.

Many comments describe the film as a masterwork. I don’t think it is, and I’m not delving too much into that. But I’ve seen comments in the opposite sense, and I’m more interested in those. I think most of them are wrong as well.

In this film there are obvious exaggerations. Too much blood, for instance. Too much speed (playing fast is not one of the main concerns of any jazz instrumentalist). Too much teacher abuse (a big band conductor can terrify you without such a direct and explicit pressure). Too much physical endeavour (a drummer in the best school of New York would probably never play with such a physical tension, which is something you should avoid at all cost when playing any instrument). Too long and supposedly spectacular drum solos.

At this point, direct and explicit pressure hasn't even started yet.

At this point, direct and explicit pressure hasn’t even started yet.

Those are artistic licenses. I don’t like them, but they are acceptable for one reason: they don’t significantly alter the plot, the meaning of the film. The story would be esentially the same if those exaggerations were not there. The exaggerations that really upset me are those that a writer uses as an essential resource to solve a situation; he couldn’t do it without the exaggeration, and he’s resorting to an easy solution. If the drummer was playing someting difficult (but not necessarily fast), if he was rehearsing to exhaustion (without any blood or snare punching), if the conductor was not so foul-mouthed and abusive and if the solos were more adjusted and realistic, the film would be essentially the same.

So, yes, there is some “karate kid” and some “rocky” here. The director wanted to create a hero epic or discourse that everybody could recognize, musician or not. I find that unnecesary and hence wrong, but who knows.

A good example of the comments about Whiplash is that by Kid Millions. A drummer himself, he points out how the drummer actors do a lousy job at faking. I’m not a drummer myself, but I’ve seen quite a lot of them playing, I’m specially sensitive to bad playbacks in instrumentalists, and Whiplash is more than correct in that sense (and actually those actors are supposed to be drummers).

Then the author starts complaining about things that don’t make much sense. He tells things like:

But it turns out that Whiplash is not about […] drumming, or music, or friendship, or fathers and sons, or music school or all the cherished sentimental things one needs to give up to become “one of the greats” — it’s about the casual sexism, racism and homophobia that’s our country’s stock-in-trade.

I strongly disagree. Whiplash is exactly that: it’s about drumming, music, friendship, fathers and sons, music schools and leaving everything aside just to become one of the greats. That’s the point: those are exactly the subjects. On the other hand, Whiplash is not a documentary about drum playing, and I think that’s the problem with many viewers. They wanted to see themselves, their ideas, on the screen, and not a story that just incidentally intersects with their lives.

Another example:

So do we get amazing music in this movie? Well, no, not really. The band plays bloodless renditions of the old jazz standard “Caravan” and the odd-meter mainstay “Whiplash,” and then we see Fletcher in a bar later in the film playing in a tepid piano quartet, playing something boring. I would rate the performance two Zs out of three.

Come on, Kid. It’s a school, and maybe the renditions are bloodless but technically accurate (out of pure fear), and maybe that’s exactly how Fletcher band would have sounded. Fletcher plays uninteresting ballads? Maybe that’s exactly what Flecher would play in reality; maybe he’s a frustrated, mediocre player that finds his glory in winning big band contests and terrifying students. What did you want when you sat at the theater? A story or a jazz concert? Yet more:

Is there something about music that feels galvanic and spiritual here? No, no, it’s straight-up academy, boot camp, overcompetitive, testosterone-fueled posturing. There’s nothing to prove to us that music matters to these characters. […] There are no women in the top jazz group. […] But is there anything that shows us that Neyman might be a prodigy, or a kid whose life has been transformed by music? […] Whiplash is about trying to become a musician in such a twisted and perverse way that it constantly undermines itself. […] Music is not about trying to be the greatest musician who ever lived. […] It’s about playing music with people — finding a community and truly connecting with other people.

When Kid Millions points out the flaws he finds in the film… he’s actually describing the film. To all those supposed defects, I answer: “Yes! Yes, of course!” It’s academy, overcompetitive. There are no women. Neyman is definitely not a prodigy. Whiplash is about trying to become a musician for the wrong reason, and actually being “the best” is the goal for these characters, instead of making beauty with sounds or sharing it with fellow musicians. That’s exactly the story. And then, what’s your problem with that? Whiplash is not endorsing a way of life; it’s telling a story.

If you criticize something by pointing out exactly what it is, what the director wanted to express, as if those things were mistakes, the conclusion is clear: you didn’t understand the film. The film is OK, but you went there looking for something different, and you were wrong.

The same applies to other comments I’ve seen. Instead of critizicing the film, they are critizicing the characters or the events, which makes no sense, since people and life are what they are, sometimes good and sometimes bad.

So there are things I don’t like in Whiplash, but I consider many comments completely misguided.

Adam Tod Brown on rhythm sections

13 13UTC noviembre 13UTC 2014

In Cracked.com, columnist Adam Tod Brown was speaking about halves of music duos who deserve your respect. And then… I read this:

the other people are just the rhythm section, which means they only matter if they suck.

Ouch.

Makes you think, doesn’t it?

 

Irlandiña

13 13UTC noviembre 13UTC 2014

O'Grove

Why (jazz) guitar players should take singing lessons

15 15UTC mayo 15UTC 2014
John Pizzarelli

John Pizzarelli

I’ve been taking jazz guitar lessons for about 8 years. More than one year ago, I was wondering whether I should take (jazz) singing lessons. Becoming a singer was not a goal for me (I didn’t even consider it achievable). But I was curious about what vocalists do, and in addition I thought approaching music from that point of view could be enriching. So I finally started.

First of all, I must put some perspective. You’ve probably done all the training and the long hard work it takes to become a true professional musician; if that’s the case, most of this will be nonsense for you. But if you’re like me, you didn’t really do the serious work first; you actually learned music through the guitar. The strings are your friends, but the notes are your enemies; maybe you can’t even tell which note will sound in every fret and string. And I’ve met lots of guys out there that did exactly the same: all the music they know is bound to the guitar, and there are lots of things they can’t separate from the guitar.

And now, if you are a bit like me, I’m going to tell you two things: how you should take singing lessons, and why you should definitely do it.

 

HOW

The first, most important thing, is to find the proper trainer. And there are two things involved: musical tools and strictly vocal tools.

As for the former, studying jazz implies finding a good jazz trainer. Someone that understands the genre, that masters and is able to explain the many skills needed (improvisation, storytelling, pronunciation, acting, modern harmony, rhythm, style…). Studying jazz singing with an operatic teacher is not a good choice, in my opinion (you can learn tons of things anyway, that’s for sure).

As for the latter, the pure vocal technique, let me state a strong opinion of mine. Forget religion. Forget beliefs. Go for a trainer who only accepts scientific evidence and understands everything he’s teaching.

The vocal training world is full of, so to speak, alchemists. There’s a good reason for that. If you take dancing lessons, your teacher will probably refer to your left foot or ask you to raise your elbow. If you take singing lessons… your feet and elbows are, in this case, hidden inside your neck. Teachers are usually reluctant to cut your throat open in front of a mirror just to show you how to reach a high note. And let’s face it: even if they were allowed to use the scalpel, lots of singers (I suspect teachers included) do not have anyway a clue about the real anatomy of singing (science itself is still studying many aspects of it).

To get to control those unknown organs, people resort to metaphors, or to sensations, or just invent things. So the singing world is bloated with contradictory schools of thought, keeping endless discussions about names, about whether something exists or not.

Don’t allow anybody to teach you with metaphors only. They must prove that they know and understand the real stuff. And for me, this means only one thing: your trainer must follow EVTS or some similar method. Something based on biology, physics, with a consistent nomenclature based on sound scientific principles. Singing is just producing sound; the only allowed magic involves emotions. Reject myths. Flee alchemists, embrace chemists.

I was lucky enough to have a local singer which is proficient in both musical and vocal tools for jazz singing as I’ve described above (in addition to being a superb musician whom I admire).

 

WHY

After my singing lessons, I’ve come to the conclusion that the most important reason is this one:

You must get your guitar out of your way for making music.

Guitar is a jealous beast. No matter who you are and how long you practice, I can bet you need to practice more. That’s true, and will always be. But eventually you must realize that guitar is -literally- an instrument for producing music. The music is somewhere else.

George Benson

George Benson

Most guitar players I know are aware that they are barely able to read, or not able at all; that they are not fluent computing intervals, or naming the notes of a particular scale. Many of us never stop playing during a solo. We don’t pay much attention to the story a song tells (not to mention the lyrics). We forget dynamics, we don’t use them (in spite of their being a particularly powerful emotional resource). We choose and play rhythmic and melodic patterns, but they are bound to our fingers. In fact, very often we are not sure how our own patterns sound; we don’t really have the sounds of the notes in our head, in spite of being able to play them. We are producing music that reflect our artistic decisions, but only to a certain degree; a part of it is not stored in our mind, but in our hands and eyes. Even worse: we are not even aware of this… until we try to sing some pattern.

If you keep relying only on the guitar, you’ll be able to improve your playing. But if you’re like me, you’ll probably never find the motivation to really sit down and study intervals until you master them. Or to really use written music as a valuable tool for transmitting, receiving and processing information. But above all: you’ll never realize that, after all, you don’t really know how that chord, or that scale, sounds. You’ll be relying, consciously or not, on your eyes and your hand.

Singing is a revealing experience. You can’t hide behind the guitar, but most importantly, you must make your music with your head. Step aside the guitar several times a week, face the music, try to sing over a dominant chord, and then return to the instrument.

I keep taking guitar lessons, of course. Last week, I worked harder on the vocal lessons, and let guitar a bit aside. The next guitar session, my teacher and I played three tunes I’ve been studying for weeks. I was afraid of the results, having practiced even less than usual. Of course I noticed the lack of practice, but actually my guitar teacher was quite happy with my playing (and believe me, that’s not easy to achieve). Phrasing, rest management, several of these things were better. My singing practice had emerged while playing the guitar. For instance, when you sing you get acquainted with rests… you need them to breathe!

I’m not saying that I’m a proficient improvisor now (nor an excellent singer, by the way). I devote only a handful of hours a week to music, and most days (literally) I don’t event grab the guitar at all. My progress is very, very slow (but constant). So I cannot tell how this will result in the end. But I’m just starting to see the benefits, and I think it’s worth it.

Problem is, you could easily die from a sudden handsomeness overdose.

Problem is, you could easily die from a sudden handsomeness overdose.

In addition to producing notes, singing will make you a better musician in many other aspects that your guitar is making you forget. You’ll start to get interested in lyrics, in storytelling. You’ll face the fact of producing music without hiding your body; you’ll probably improve your stage presence. You’ll probably start expressing some more things with your face, as you think about what you’re telling (never, ever, underestimate the importance of a smile or a way of looking). While singing, you’ll discover that you can whisper, you can shout, the music changes completely around that, and you’ll realize that dynamics are probably the most underrated, forgotten resource of your playing. The list goes on and on, but to summarize: with a guitar, you can play with little intention. When the instrument is your own body, you can’t work around your intention, so you take a more involved, conscious approach to music. And your intention, your conscience, your feelings, is what this business is all about.

There are very many other reasons to take  singing lessons. For instance, I suppose you’ll be much more valuable as a professional if you’re able to sing (in my case, this is just a hobby), you’ll be more versatile and independent (you’ll be able to gig alone, you’ll be able to do backing vocals, you’ll write and play vocal duo arrangements, you’ll use your voice as another instrument, combined with the guitar or not…). Also, you’ll be able to better understand singers (yes, that’s actually possible!) and help them with your comping.

And there’s another important reason: you can enjoy singing itself. It’s very interesting, and after all… let’s admit it, it’s fun!