Spring MVC 3 + AJAX (getJSON) and solving 406 Not Accepted

April 12, 2012

I wanted to add AJAX to Spring MVC application. So, I did what most us do, go through the documentation or blog of the Spring Source. But, after playing around I didn't get it to work properly so here are some details that might save you some time. After I follow the instructions in AJAX in Spring 3.0 I got some error "406 Not Accepted", so let's explain how to make it work: Server Side First you need to setup the actions/methods that the ajax client will call and provide that data in a request. In the ... Read more

Tags: spring mvc, j2ee, jquery, ajax

Adding Subversion (SVN) Properties to your code

February 11, 2012

When you are coding in a team enviroment it's good to have the subversion properties in your files, that way any other developer can see quickly who made the last changes and when. You can add the following lines at the bottom of your code: //----------------------------------------------------------------------------- //  REVISION HISTORY //  $LastChangedDate: $ //  $Revision: $ //  $LastChangedBy: $ //  $Id: $ //-----------------------------------------------------------... Read more

Tags: svn, subversion, eclipse, svn properties

How do I change the Ruby/Python version Textmate uses?

February 09, 2012

  I'm using textMate to develop ruby code. It's very handy because I can run it just pressing (cmd-R). But by default it's running ruby 1.8.7 and I want 1.9.2 version. This is the steps to change it: Find the right path with ~$  which rvm-auto-ruby /Users/adrian/.rvm/bin/rvm-auto-ruby ~$  which python3.2 /usr/local/bin/python3.2   Then copy it to TextMate preferences in a new variable called "TM_RUBY", and "TM_PYTHON" as shown bellow:

Tags: how-to, ruby, textmate, python

Get Started with the web crawler Apache Nutch 1.x

February 04, 2012

Apache Nutch is an open source scalable Web crawler written in Java and based on Lucene/Solr for the indexing and search part. It has a highly modular architecture, allowing developers to create plug-ins for media-type parsing, data retrieval, querying and clustering. [*] Motivation By using Nutch, we can find web page hyperlinks in an automated manner, reduce lots of maintenance work, for example checking broken links, and create a copy of all the visited pages for searching over. That’s where A... Read more

Tags: how-to, apache, nutch, search engines, web crawlers

Update Drupal sites

November 04, 2011

The better way to learn is by a concrete example. I update a site called "heyshuga" from Drupal 7.8 to 7.9. Here are the steps 1. Download the latest version of drupal $ wget $ tar -zxvf drupal-x.y.tar.gz -or using drush- $ drush dl drupal 2. Copy the new files to the old directory $ cp -R drupal-x.y/* drupal-x.y/.htaccess /path/to/your/installation 3. Run the drupal update

Tags: drupal

SSH login without password

January 19, 2012

If you want to login to a remote server using SSH and don't have to type the password again and again, here is a little trick $ cat ~/.ssh/ | ssh <user>@<server.domain> 'cat >> .ssh/authorized_keys' After you run this and enter your password (for the last time), you can login to your server just typing: $ ssh <user>@<server.domain> You are all set.

Tags: ubuntu, linux, ssh, cli, command line

Concentration problems? Procastination? You're not the only one.

January 04, 2012

  Procastination and concentration problems are big deals from a lot of people, specially for students. There are too many distractions that are more fun than our homework. I read an interesting article about concentration that I'd like to share a summary with my own notes: There is no substitute for paying attention... here are Five tips to improve your attention/concentration/focus/productivity: F = Five More Rule There are two kinds of people -- those who have learned ho... Read more

Tags: concentration, procrastination, attention

Learning Algorithms from Scratch / Algorithms for Dummies

December 22, 2011

When you are programming you face challenges all the way. Getting the problems solved is just the tip of the iceberg, getting it done efficiently is the rest. Why should you care for efficiency? Solutions to the same problem might take years with certain algorithm, and just minutes using efficient algorithms. For instance, if you have applications that are used for thousands of people over internet, every fraction of second counts. Therefore, efficient algorithms is a must. How I do my algorithms more eff... Read more

Tags: algorithms, runtime analysis, analysis of algorithm, for dummies, big-o

Regular Expressions in C# and Java - CSV Example

November 10, 2011

Regular expressions are used to find matches in texts. The following is a real application of Regex in C# and Java.  CSV are files that all the data is separated by a comma. E.g: name,line1,line2,city,zip code,country You cand easily use String.Split() in C# to get all the values. But, there are cases when the data can contain comma. E.g: "Mr. John Doe, Jr.",7926 Glenbrook Dr., 14623 In this case a regular expression (regex) could be use to determine if the comma is inside a quote or... Read more

Tags: c#, csv, regex, java

How to remove programs from the start up in Mac OS X

November 18, 2011

Well... I have done this so many times in Windows (it's just executing "msconfig" you can edit the startup items). Today, I had the need to do the same in the Mac OS X Lion. Here is how to do it System Preferences > Users & Groups Tab "Login Items" You can remove the programs (-) from the list and they won't show up in the next startup.  

Tags: how-to, mac

git+ftp: Publish Git repository over FTP

November 10, 2011

I have been working with websites for a while and also with different web hosts. The default way to upload content is through FTP but it takes a lot of time because upload the entire site each time. Some web hosts  have ssh and git, which is great for deployement because you can keep track of the versions and also upload only the files that changes.   In order to use git for local development and ftp (for hosting that doesn't support git/ssh) there are some options: Read more

Tags: drupal, git, web development, ftp, gitignore

How to setup Drupal WYSIWYG and Images uploading?

November 09, 2011

It have been a pain for me to upload images and deal with tons of WYSIWYG editors... After many trials in this post I recompiled my experiences and the best method that I have found so far. If you have any suggestion I'm willing to hear it, too. 1. Install and enable the following modules: (disable the WYSIWYG module if you have it install it) -or-   - optional - Read more

Tags: drupal, wysiwyg, imce, ckeditor

How to execute SQL statements on MS Access?

November 09, 2011

Sometimes is quicker to use SQL statements than create tables using the MS Access Visual Designer. For instance, if you already have the SQL code from other databases this could be useful. Here are the steps of how to create a new table programmatically in Access (2007): 1. Open/create your database on MS Access 2. Menu: 'Databases Tools' > 'Visual Basic' (this will open the visual basic editor 3. in the Visual Basic Editor, Menu: Run 4. Insert the name of your macro and click 'create' button 5. Insert a code simila... Read more

Tags: how-to, ms access, sql, visual basic, macros

An Approach to Annotation of Learning Texts on Programming within a Web-Based Educational System - Paper Review

October 26, 2011

V. Mihál and M. Bieliková presents “An Approach to Annotation of Learning Texts on Programming within a Web-Based Educational System”. This work leverage the usage of annotation to enhance programming learning experience. Annotations provide to learners supplementary information that they otherwise will have to find by themselves somewhere else. They describe different types of annotation: manual and automatic. For the manual annotations the user the ... Read more

Tags: paper review, e-learning

Integration of Visualization Techniques and Completion Strategy to Improve Learning in Computer Programming

October 26, 2011

The advantages of different presentation media are explored in the work of N. Hashim and S. Salam in “Integration of Visualization Techniques and Completion Strategy to Improve Learning in Computer Programming” [1]. They compare the advantages of Mobile-based training (MBT) over Web-based training (WBT) for learning computer programming. Additionally, they explain some features that aid the learning process, such as visualization techniques and completio... Read more

Tags: paper review, e-learning

OCCS: Enabling the Dynamic Discovery, Harvesting and Delivery of Educational Content from Open Corpus Sources - Paper Review

September 27, 2011

S. Lawless, V. Wade et al. (2008) [1] introduces the Open Corpus Content Service (OCCS), which is a system to discover, harvest, classify and index educational content from the Internet. It aims to provide a dynamic learning object generation based on the background of the learner. The OCCS employs Heritrix (open source, web-scale, archival web crawler) for discovery educational content available in the WWW. Heritrix uses languages guessers ... Read more

Tags: paper review, focused crawling, e-learning, web semantics

eLearning 2.0 and Social, Practice-Oriented Communities to Improve Knowledge in Companies - Paper Review

September 27, 2011

S. R. Kruk et al. (2007) [1] implemented a social bookmarking system called Social Semantic Collaborative Filtering (SSCF). The goal of the SSCF is to enhance individual bookmarks with shared knowledge of the community. It also presents how digital libraries can be combined with social semantic information sources and it exemplifies how these techniques can improve e-Learning. Digital Libraries and other open courses can leverage their potential with the colla... Read more

Tags: paper review, e-learning, web semantics, social bookmarking

Focused Crawling for Automatic Service Discovery, Annotation, and Classification in Industrial Digital Ecosystems - Paper Review

October 04, 2011

H. Dong et al. (2011) [1] introduce an approach to enhance disperse and heterogeneous industrial digital ecosystem for e-Learning. Its target is to discover and classify the industrial information automatically using focused crawlers. The focused crawler perform 5 operations: webpage fetcher (multithreading web crawling given a URL list), policy center (fetching boundaries, max. depth, multithreading priority), webpage pool (store data ... Read more

Tags: paper review, focused crawling, e-learning, web semantics

Dynamic Hypertext Generation for Reusing Open Corpus Content - Paper Review

September 22, 2011

B. Steichen, S. Lawless, V. Wade et al. (2009) [1] proposed an Adaptive Hypermedia (AH) for dynamic hypertext generation of learning content. This system provides personalized learning services, which aims to enrich the learning process and the satisfaction of the learners. In order to accomplish these tasks: the system perform open courses harvesting and identification, generate dynamically hyperlinks based on the learner experience and appropriated learning strategies, and present the ... Read more

Tags: paper review, e-learning, hypertext generation, adaptation, personalisation, open corpus content, metadata generation

On line Course Organization - Paper Review

September 17, 2011

This paper [1] proposed a specialized search engine, called Fusion, which index meta-information about available courses. Google can be used to perform this search, but the result will be too broad. Fusion provides specialized results only. In order to accomplish this task, Fusion used the web crawler Nutch, which is used to extract the content of courses. The crawler does real-time decisions to parse and store only the necessary data instead of the whole content. The extraction of the metadata is done using the followi... Read more

Tags: paper review, focused crawling, metadata extraction, learning object management, ontology, e-learning

Automated Reverse Engineering Java-Swing GUI - Paper Review

September 07, 2011

The extraction of Java-Swing GUI information using AspectJ seems like an way to do Reverse Engineering. The extracted information could be use later to migrate applications Java-Swing applications to the web, enhance program understating, generate UML diagrams and a myriad of other uses. This article will be summary of the paper about this topic [1]. The authors of the paper [1] are using aspect oriented programming (AOP) to intercept the application while is running and extract desired information. Th... Read more

Tags: software engineering, reverse engineering, gui, aspect oriented programming, aspectj, dynamic analysis, paper review

Determining granularity of independent tasks for reengineering a legacy system into an OO system - Paper Review

September 14, 2011

In this work [1] the authors explain the process of reengineering a legacy system in COBOL for object-oriented. Reengineering is a multi-step process to convert sequential and procedural-driven system into object-oriented and event-driven system. The proposed method [1] to accomplish this task is to transform the legacy system source code into an intermediary language: Wide Spectrum Language (WSL). The WSL code is used to apply an algorithm to identify... Read more

Tags: reverse engineering, paper review, wide spectrum language (wsl), unified modelling language (uml), cobol legacy systems, reengineering

E-Learning on the Social Semantic Information Sources - Paper Review

September 21, 2011

The paper [1] is proposing a social bookmarking system called Social Semantic Collaborative Filtering (SSCF). It presents how digital libraries can be combined with social semantic information sources and it exemplifies how these techniques can improve e-Learning. The goal of the SSCF is to enhance individual bookmarks with shared knowledge of the community. The Fig. 1 shows the dificulty (or time-consumptions) of bookmarking all the interested links and then share all of them in a blog for oth... Read more

Tags: paper review, e-learning

C#'s GetManifestResourceStream Gotcha

July 18, 2011

In the .NET framework, the method Assembly -> Get Manifest Resource Stream has a gotcha that could take some time to figure out why is not working as intented. I was working in a piece of code (show below), and the GetManifestResourceStream always returned NULL exception error. Even though the file was there... C# example: public XmlTextReader GetSyntaxModeFile(SyntaxMode syntaxMode) {     Assembly assembly = typeof(SyntaxMode).Assembly;     var stream = assembly.GetManifestResourceStream(... Read more

Tags: tips, how-to, c#, gotchas, .net

How to set up Git / github in windows

July 21, 2011

Installing Git in Windows is not as straight forward as in a *nix machine like Linux and Mac. This guide help you to get started quickly. You will need the following tools: Putty: download latest version here. TortoiseGit: download the latest version here.  (e.g. Tortoisegit- msysgit: As today the latest version (e.g. Git-1.7.6-preview20110708.exe) Setting up Putty Unzip the folder.  Generate the ssh key using the PUTTYGEN.EXE from the putty folder. After genete it, cli... Read more

Tags: how-to, git, github

Git auto-commit with Crontab

August 15, 2011

You might want to commit from a git repository from time to time for several purposes (backup, control version, continuous integration, etc). One way to accomplish that is using the CronTab (Cron is used to run periodic task in Unix-like systems). Here is an example. 1.- Create an script. e.g. with: # MySQL-dump: save a copy of the actual content in the database. (this is for a Drupal site, the backup is done using drupal's drush) php -c ~/www/php.ini ~/drush/drush.php -r /home/adrimej0/www -u 1 sql-dump --result-f... Read more

Tags: drupal, how-to, git, unix, crontab, drush

Faster Windows XP removing Msmpeng.Exe and other programs

July 15, 2011

At work, I use an Windows XP machine and it some times get really slowly. I noticed from the task manager (ctrl+shift+esc) that the process MsMpEng.exe is consuming most of my CPU time! MsMpEng.exe is a process associated to Windows Defender that help you to "protected" the computer, but sometimes it requires too much resources. So, if eating up your available CPU it is better to disable it. Disable MsMpEng.exe: start menu -> run  (windows key + r) write services.msc and enter Stop the follo... Read more

Tags: windows, tips, how-to

PHP DOM: explained and exemplified

August 06, 2011

This is guide to get started with PHP DOM or a quick reminder to those who have a little while since the last time they used it. The extended documentation is in, but it is quite long. Here you might found a quick reference to get started in no time. Purpose of the DOM (Docuement Object Model): It is a convention used to represent and manipulate objects in XML, XHTML and HTML documents. Parsing XML and HTML files is very useful. It allows to manipulate RSS Feeds, interact with APIs and web services through XM... Read more

Tags: php, dom, xml

Ruby on Rails Architectural Design

August 11, 2011

1         Introduction Ruby on Rails (RoR) is open source web framework written in the Ruby programming language, and all the applications in Rails are written in Ruby. Ruby on Rails is focused on productivity and enforces agile web development. Rails framework leverages the features of the Ruby language. Yukishiro Matzumoto designed this language in 1995 influence by Perl, Eiffel, Python, Smalltalk and others. It’s a dynamically typed, fully object-oriented, general-purpose scripting l... Read more

Tags: twitter, ruby on rails, software architecture, web frameworks, web development, agile frameworks

Microsoft Zune Failure Analysis

August 08, 2011

All the Zune 30 froze, precisely at 12:01 A.M. on December 31, 2008. These devices got stuck with an irresponsive Zune logo. This bug that didn’t allow users to use the device was cause by a bug in the internal clock driver that handled improperly the last day of a year leap. The Zune 30 model 2006 was the only one affected by this bug; all the other models keep working ok, such as the Zune: 80 and 120 GB with hard drive, and 4, 8, 16 GB with flash drive, because they did not have the component with the error. At the core of th... Read more

Tags: product lines, bug, testing, microsoft, freescale, zune

How to set up Samba in Ubuntu/Linux, and access it in Mac OS and Windows

July 13, 2011

Samba allows to share files and printers with other computers remotely, regardless their operating system (linux, windows, Mac, ...). This guide show how to intall and configure the Samba service in a Ubuntu machine and access it through windows and mac. Setting up the Samba File Server on Ubuntu/Linux: Open the terminal Install samba with the following command:   sudo apt-get install samba smbfs Configure samba typing: vi /etc/samba/smb.conf Set your workgroup (if necesary)... Read more

Tags: samba, ubuntu, linux

What technologies are using the most influential Internet companies?

July 13, 2011

Google, Facebook, YouTube, Yahoo, Wikipedia, Hotmail (Windows Live), Twitter, LinkedIn,,, eBay, Bing... You may know probably all these companies; we use some on our daily basis. They bring services to around 2 billion people! And influence our lives everyday. The most influential Internet companies are in the search engine and social media category, so I will focus the analysis in these two.     Search Engines Google -> 1,000,000,000 = 1 billion... Read more

Tags: google, twitter, facebook, programming, social media, internet

Drupal Modules for SEO optimation

July 13, 2011

Search Engine Optimizations (SEO) could be quite challenging for beginners. It's overwhelming the amount of information that a webmaster need to understand in order to make his websites visible, in search engines like Google, Bing, Yahoo, ... Moreover most of this information is quite disperse. The idea here is to provided all the needed information in one place. Starting from steps for all websites and then focusing on Drupal SEO modules.   General Steps: Sign upin the webmaster tools for the main search engines: ... Read more

Tags: seo, drupal