Machine Learning in Stanford University
Posted by Alberto - 17/12/09 at 10:12:10 pm
Machine Learning is a branch of Artificial Intelligence, that aims to develop systems with the ability of learning from the experience. Machine learning techniques can be used in different fields. For example, recommendation systems (as Amazon), biology, games…
If you are looking for a introduction to Machine Learning, you must visit the Stanford University Youtube channel. You will find a complete course about this topic, taught by Professor Andrew Ng. This is the info of the course:
This course (CS229) provides a broad introduction to machine learning and statistical pattern recognition. Topics include supervised learning, unsupervised learning, learning theory, reinforcement learning and adaptive control. Recent applications of machine learning, such as to robotic control, data mining, autonomous navigation, bioinformatics, speech recognition, and text and web data processing are also discussed.
JScrollPane, JTable and horizontal scroll
Posted by Alberto - 10/12/09 at 09:12:18 pmI was coding a graphical interface using Java, and what I wanted was to insert a JTable object inside a JScrollPane. The table was bigger than the JScrollPane, but I didnt know why, only the vertical scroll bar was shown. I spent hours reading Swing tutorials, checking my code… everything seemed to be ok, so.. why it wasnt working?
Finally, I found the answer: there is a bug in Java when you are using JScrollPane and JTable. And the solution was to create a new class extending JTable, in order to override JTable.getScrollableTracksViewportWidth() method with this one:
public boolean getScrollableTracksViewportWidth() {
if (autoResizeMode != AUTO_RESIZE_OFF) {
if (getParent() instanceof JViewport) {
return (((JViewport)getParent()).getWidth() > getPreferredSize().width);
}
}
return false;
}
Source: DaniWeb Forum
Fixing Wordpress Error 500
Posted by Alberto - 10/12/09 at 09:12:17 pmAfter this, I’ve learned that its convenient to deactivate all your plugins before updating to the last version of Wordpress. Im not sure when I did the last update, but it seems this blog have been offline since then.
This morning I tried to read an article of the blog, and I got an “Error 500″ message. First of all, I checked that my Wordpress was working, because I could access to my dashboard. Next step: deactivate all the plugins. But it didnt work. So lets take a look into the Apache log. What I found was:
SoftException in Application.cpp:252: File “/home/xxxxx/public_html/blog/index.php” is writeable by group
Thats it: a permissions problem. So I used Cyberduck (but you can use any other FTP application) to fix it. Delete the “write” permissions of Group and Others:

Note: be sure to apply this to all your files and directories. In my case, as you can see in the image, I used the option “Apply changes recursively”. Your FTP application should have the option to do something like this.
Solving problems with Subversion
Posted by Alberto - 07/11/09 at 07:11:24 pmWhile I was updating my local copy of a SVN repository, I got this error:
Can’t copy / move ‘
.svn-base’ to ‘ .tmp’: The system cannot find the file specified.
The problem was that there were two files in the repository whose names differed only in case (e.g., File.txt and file.txt). This is possible in Unix-based systems, but not in Windows. So due to I was using a Windows computer, I couldnt update my local copy. I you have this problem, just delete or rename one of the files in the repository.
Compiling Erlang on Mac
Posted by Alberto - 05/11/09 at 11:11:59 pmFirst of all you need to install XCode, because you will need GCC compiler. These are the steps I followed:
1. Download the latest version of Erlang. In my case, it was R13B02-1, so I got a file named otp_src_R13B02-1.tar.gz
2. After decompressing the file:
$ cd otp_src_R12B-2
$. /configure
$ make
$ sudo make install
These are the standard steps, but I had a problem with the “make” command. I got the following error:
gen/wxe_events.cpp: In function ‘void initEventTable()’:
gen/wxe_events.cpp:277: error: ‘wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN’ was not declared in this scope
gen/wxe_events.cpp:278: error: ‘wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP’ was not declared in this scope
gen/wxe_events.cpp:279: error: ‘wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN’ was not declared in this scope
gen/wxe_events.cpp:280: error: ‘wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP’ was not declared in this scope
gen/wxe_events.cpp:281: error: ‘wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED’ was not declared in this scope
gen/wxe_events.cpp:282: error: ‘wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE’ was not declared in this scope
gen/wxe_events.cpp:283: error: ‘wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK’ was not declared in this scope
make[4]: *** [i386-apple-darwin9.8.0/wxe_events.o] Error 1
make[3]: *** [release] Error 2
make[2]: *** [release] Error 2
make[1]: *** [release] Error 2
make: *** [install.libs] Error 2
The solution was to build Erlang without wxwidget support, so the steps I followed were:
$ cd otp_src_R12B-2
$. /configure
$ touch lib/wx/SKIP
$ make
$ sudo make install
Fix the Home and End keys in OS X
Posted by Alberto - 11/07/09 at 04:07:46 pmThere is one thing I dont like about Mac OS X: the behaviour of the Home, End, PagUp and PagDown keys. I you want the same behaviour than a Windows or Linux computer, open a text editor and write this:
{
“\UF729″ = “moveToBeginningOfLine:”;
“$\UF729″ = “moveToBeginningOfLineAndModifySelection:”;
“\UF72B” = “moveToEndOfLine:”;
“$\UF72B” = “moveToEndOfLineAndModifySelection:”;
“\UF72C” = “pageUp:”;
“\UF72D” = “pageDown:”;
}
Save the file as DefaultKeyBinding.dict into your ~/Library/KeyBindings directory and reboot your Mac.
Showing hidden files in Leopard
Posted by Alberto - 03/07/09 at 01:07:11 amI’ve found a very useful widget. It adds a button to your dashboard to easily show or hide the hidden files in your system. Install it, press “Show”, and you will see your hidden files in Finder.

The Class java.util.Properties
Posted by Alberto - 21/06/09 at 11:06:58 pmI didnt know this class before start using it some months ago. Now I love it because it makes easier the handling of properties in your Java code.
public class Properties extends Hashtable {
protected Properties defaults;
public Properties();
public Properties(Properties defaults);
public String getProperty(String key);
public String setProperty(String key, String defaultValue);
public Enumeration propertyNames();
public void load(InputStream in) throws IOException;
public void save(OutputStream out, String header);
public void list(PrintStream out);}
It extends java.util.HashTable, so this class stores each property as a pair of (key, value). If your application needs some parameters to work, you can include them in a file, and then, use a java.util.Properties object to load them.
Properties props = new Properties();
FileInputStream file = new FileInputStream(”propertiesfile.txt”);
props.load(file)
Using these three lines, you will have a java.util.Properties object filled with the content of “propertiesfile.txt”. But, whats the format of this file? It has to contain a pair per line, and both of them have to be separated by a white space, ‘=” or ‘:’. The following file would be correct:
Property1=Value1
#This is a comment
Property2:Value2
Property3 Value3
After loading this file, how can we access the properties? If we want to use the value of “Property1″:
String value = getProperty(”Property1″);
Or if we want to modify the value of “Property2″:
setProperty(”Property2″,”New value”);
More info: java.util.Properties
How to edit PATH variable on Mac
Posted by Alberto - 23/05/09 at 10:05:19 pmIf you need to change your PATH variables (or another environment variable, as CLASSPATH) on a Mac OS X, you need to edit a file called .profile located in your home directory. Open a terminal window and type:
open -e ~/.profile
In case you dont have a .profile file, you have to create it:
touch ~/.profile
You have to include a line like this:
export PATH=(path-you-want-to-add):$PATH
For example, lets imagine you want to add the file whatever.jar, located in your Documents folder. You would write:
export PATH=~/Documents/whatever.jar:$PATH
Easy, isnt it?
Eyes Like An Angel Smiles Like A Devil
Posted by Alberto - 21/05/09 at 06:05:15 pmIm sure this post is gonna be very useful to a lot of people. Here you have the lyrics of “Simple songs”, from Big Dad Voodoo Daddy. What was the name of the song again?
“Simple Songs” by Big Bad Voodoo Daddy
Simple songs about simple things
Is what makes my baby swing
Shes got eyes like an angel smiles like a devil
Man you know she’s the real thing
so
When my baby’s not around
The whole world hears my poor heart pound
Cause
“Man you know that she’s the one for me”When I see that crazy smile
Makes it all well worth while
Love my baby can’t deny
Couldn’t hide it if I trySo at the end of the day I can clearly say
She’s the only one for me.
No one else Id rather see
Nowhere else I’d rather beThan hangin’ with my baby tight
Morning, afternoon & night
Love that girl I can’t deny
Couldn’t hide it if I try
If you wanna know more, the keyword is “notpron”
Powered by WordPress with GimpStyle Theme design by Horacio Bella.
Entries and comments feeds.
Valid XHTML and CSS.


