Skip to main content

124 posts tagged with "in-English"

View All Tags

Know where (not) to touch

· 3 min read

Via Kirai I stumbled on the results of this survey that collects information about erogenous zones. Apparently, thousands of men and women were asked to rank different spots in their bodies and the bodies of a partner — in terms of how much they they like to be touched, and how much they desire to touch the other, respectively. The study is interesting, but I found it somewhat annoying that it is difficult to draw what seems to me like an important conclusion: a comparison between where we think that the other likes to be touched and where he or she actually likes to be touched the most. The body maps provided show coloured zones, but it is difficult to compare women's guess to men's desires, for instance, because the variations in hue are quite subtle. Even if the images are displayed side-by-side, bare-eyed it is hard to notice any change at all in most regions of the body. I am always up for a bit of a Gimp-challenge. So I decided to try and edit the original images to obtain a better representation. This is my take on the results of the survey:

The hot colours (no pun intended) dye areas where we are not touched as much as we would like, so to speak. That is yellow, orange, pink, violet and red. In less academic terms, you could read cool colours, i.e. all shades of blue, as “will you put your hand off now”. I find it much easier here to identify those areas at a glance. Now there are some interesting results in here. Boys, did you notice those three orange/red spots in the female body? That's good news or what. Also, it seems that she doesn't like to be touched in her head and face that much, except that apparently you are not kissing her enough. Oh, and for some reason her right arm expects more attention than her left arm (?). About men, feet and knees look a bit frustrated, in contrast with the arms, which are asking for some independence and need more space, you know, to live their lives or whatever. Penises demand more attention (yes, even more). But not the scrotum. The scrotum is fine, thank you. The diagram below summarises the process that I followed using Gimp. The female images are used here, but the same applies to the other case. The single most important step, on the left side of the image, involves inverting the colours of the image that represents where women are touched, and then adding it to the picture that represents where women want to be touched. Effectively, we are substracting one from the other. The branch at the bottom simply emphasizes colours to make them more apparent. The steps on the top-center of the image produce black-on-white edges that are used as a frame so that regions of the body become more recognisable.

Reading and running

· 2 min read

As naïve and twee and theatrical as they may sound, and yet these words by Will Smith really strike a chord on me. I can relate to this exaltation of knowledge and self-discipline; mentally and physically. Lore in its purest form — books. Control through one sport, the sport.

“The keys to life for me are reading and running. The idea that there are millions and billions of people who have lived before us, and they had problems and they solved them and they wrote it in a book somewhere. […] There is no issue we can have that somebody didn’t already write a thousand years ago in a book. […] You know it’s in a book somewhere but you’ve got to find the right one that is going to give you the proper information.” “When you get on the treadmill you deprive yourself of oxygen. What kind of person you are will come out very, very quickly. You’re either the type of person who will say you’re going to run three miles or you stop the treadmill at 2.94 and you hit it and you call 2.94 3 miles, or you get off after a mile, or you’re the type of person that runs hard through the finish line and when you get to 3.0 you realize, ‘God, I could really do 5,’ and you go ahead and do two more. And that little person talks to you and says, 'Man, do you feel our knee? We should stop. I feel we should stop ourselves right now. This is not healthy anymore.’ When you learn to get command over that person on that treadmill, you learn to get command over that person in your life.”

George Carlin

· 3 min read

I must confess that two days ago I had no idea who George Carlin was. I got to know him only yesterday, thanks to one of @ampajaro's tweets announcing his death first thing in the morning. That was followed by a chain of entries coming from a few of the blogs I (helplessly try to) keep up with. I have read such striking superlatives about this comedian that I youtubed him. After watching a few of his routines I now feel that I have to share and honour his talent. So here you have two pieces of different shows by George Carlin. Caution — strong opinions (and language) ahead. The first video is basically about religion being a pile of bullshit (kudos, we need more of that nowadays):

On
religion

The second video is a somewhat furious yet brilliant sermon against those who are against abortion. (I personally don't agree with all of what Carlin says in this video. I am not against abortion. But unlike most of other left-wing people I know, I am not that sure that I am undoubtfully in favour of abortion, either. Also, I don't buy the theory that equates abortion to women's rights, and to “the choice of one woman”. In any case, I'm an atheist and my position has nothing to do with religion, tradition or customs, so I very much support — and enjoy — Carlin's mockery of religion's mean and simplistic approach to abortion):

“Pro life”? Anti
woman!

What I admire the most about George Carlin is the technique — the round, perfectly-delivered script. He can speak for ten minutes without stumbling over a single syllable, without humming or hesitating. Weaving long enumerations of words or examples, putting the stress in the right place and stopping precisely where required. And I love his strong and brave position on issues as sticky as religion, politics, taboos, gender, death, PC language and abortion. Even if at times he looks more like a fanatical preacher than a comedian and some of his arguments seem debatable to me. But hey, conservatism needs to be balanced. Don't miss his “Seven dirty words" routine (“shit, piss, fuck, cunt, cocksucker, motherfucker, tits”), which apparently caused a radio station to be sued and sparkled a major debate about censorship in the American airwaves. Here, the video audio in YouTube.

Left/right hemisphere

· One min read

On Sunday, two videos that struck me recently. One video for the left hemisphere of your brain. Mathematics, Japan and genius. Part of a documentary about the amazing Daniel Tammet.

“Genius fast calculation by
kids”

The second video is aimed at your right hemisphere. So much beauty and so many ways to invoke it. Imogen Heap knows a few of them.

“Imogen Heap - Just For Now (live at Studio 11
103.1FM)”

Very simple Bash script to get source code stats

· 4 min read

The other day I wanted to have an overview of the size of a software project I'm working on. The project is relatively big and involves quite a few languages and technologies spread among different tiers. Because I just joined the team there are tons of lines of code already written that I have not even seen. So I felt the need to have at least a grasp of the size of the codebase for each language and learn how programming languages compare among them within the project. I came up with this very simple Bash script, getSizeStats.sh. It expects one or more directories as parameters. It finds all regular files contained in the trees that hang from those directories. It then adds up LOC for all files, grouping by the extension of the filenames. The script assumes that the arguments are, or might be, local copies of Subversion repos (that's why it excludes .svn directories). While running, the output line shows a counter for the number of files as they are processed. Once finished, a list of LOC for each language (i.e. file extension) sorted by LOC is created in /tmp/getSizeStats.sh.out.

#!/bin/sh

TMP_DIR=/tmp/basename $0 TMP_OUTPUT_FILENAME=/tmp/basename $0.tmp OUTPUT_FILENAME=/tmp/basename $0.out

if [ -d $TMP_DIR ]; then rm $TMP_DIR/* 2> /dev/null else mkdir $TMP_DIR fi

COUNTER=0

find "$@" -name "." | grep -v \.svn | while read j; do

if [ -f "$j" ]; then cat "$j" >> $TMP_DIR/echo $j | rev | cut -s -d "." -f 1 | cut -d "/" -f 1 | rev COUNTER=$((COUNTER + 1)) echo -en "\r$COUNTER files " fi

done

if [ -f $TMP_OUTPUT_FILENAME ]; then rm $TMP_OUTPUT_FILENAME fi

for i in ls $TMP_DIR; do echo -e "wc -l $TMP_DIR/$i | cut -d " " -f 1 $i\twc -l $TMP_DIR/$i | cut -d " " -f 1" >> $TMP_OUTPUT_FILENAME done

sort -nr $TMP_OUTPUT_FILENAME | cut -d " " -f 2- > $OUTPUT_FILENAME rm $TMP_OUTPUT_FILENAME

echo processed -- see $OUTPUT_FILENAME

(I think that for some versions of echo you'll have to remove the option -e or it won't work properly). The only serious problem I found were filenames containing blanks and other characters that usually need to be escaped (bad naming, I know — it wasn't my idea). I played with different types of quoting and tried to find a workaround for that. Real-time help about that from @enlavin and @nauj27 was much appreciated. I tried that find -print0 | xargs -0 … thing but couldn't make it work as I needed. Eventually the while read j; do … approach worked. (I confess that I still get confused easily by the subtle differences between quoting variants and how variables get expanded in each case. I ought to find some time to learn that well, once and for all). Now there are so many things to improve here. First of all, the script does not tell binary files from text files, i.e. you will also get counts of “lines of code” for all binary assets within your project, such as object files and images. It should also discard all text files that are not source code, e.g. a CHANGELOG. It should be robust to case variations, i.e. group .java and .JAVA files together. It should rely on something more sophisticated than filename extensions to tell programming languages, because you probably want to count your .cpp and .c++ files as a whole. I was planning to better it adding those fixes/improvements and others. Then Golan told me of sloccount, a command that does just what I need. But proper. Here you have an example of how getSizeStats.sh works. After re-inventing the wheel, I couldn't but run my own script… against the source code of sloccount itself.

$ svn co https://sloccount.svn.sourceforge.net/svnroot/sloccount sloccount-src > /dev/null $ ./getSizeStats.sh sloccount-src/ 38 files processed -- see /tmp/getSizeStats.sh.out $ cat /tmp/getSizeStats.sh.out c 4493 orig 3899 html 3032 1 235 dat 197 l 171 rb 152 lhs 59 spec 56 h 50 CBL 31 php 27 inc 23 pas 21 hs 19 gz 10 f 10 cs 8 f90 7 cbl 4 tar 1