Wednesday, November 30, 2005

zERP

Este es el primer proyecto libre con el que colaboraremos con la comunidad. Estamos desarrollando un ERP bajo licencia BSD. Este proyecto se desarrolla utilizando el framework Mono (más en concreto ASP.NET) y contará con las últimas tecnologías webservices, AJAX, ... http://people.hazent.com/~jrp/zERP-NG-current.tar.bz2

Thursday, October 13, 2005

Hispaforge startup delayed a few weeks

We have problems w/ our internet provider, so Hispaforge will not be available on 15th of October. We are working and we are sure we (Hazent Systems) will surprise you with our deploy. Thanks for keeping on.

Sunday, September 11, 2005

hacking the command line

I love the command line shortcuts, and I was looking for information about the 'cd history'. So I found pushd and popd. The pushd builtin adds directories to the directory stack as it changes the current directory, and popd removes directories from that stack changing the current directory to the last directory removed. To see the stack directory just:
$ echo $DIRSTACK 
or
$ dirs
If you are writing code on ~/Projecs/macaco/src and now need to jump momentarily to ~/Projects/Nazca, just 'pushd .' and when you finish your tasks on ~/Projects/Nazca do 'cd ~/Projecs/macaco/src'. Actually, you can store more than one directory at a time, remember, it is a stack (you can also use FIFO instead LIFO using unix pipes)

Tuning you box

Add to /.bashrc the next lines:
#redefine pushd and popd so they don't output the directory stack
# the output is redirected to /dev/null to prevent displaying the 
# dir stack when they are called
pushd()
{
    builtin pushd "$@" > /dev/null
}
popd()
{
    builtin popd "$@" > /dev/null
}

#alias cd so it uses the directory stack
alias pd='pushd'
#aliad pb as a command that goes one directory back in the stack
alias po 'popd'
# 
#To rotate between directories
alias r "pushd +1"
alias rr "cd "$OLDPWD"

Saturday, September 10, 2005

Working with Mono

These days I have been working with mono. I started to integrate MonoUML into MonoDevelop, you can read more about it in http://planet.monouml.org.

Today I patch Glade# Code Generator to generate Nemerle code. It was very easy and the patch was comitted today:

Index: src/Language.cs
===================================================================
--- src/Language.cs (revisión: 7)
+++ src/Language.cs (copia de trabajo)
@@ -4,5 +4,6 @@
{
 CSharp = 0,
 VisualBasic = 1,
- Boo = 2
+ Boo = 2,
+ Nemerle = 3
}
Index: src/GtkGladeCodeGenerator.cs
===================================================================
--- src/GtkGladeCodeGenerator.cs (revisión: 7)
+++ src/GtkGladeCodeGenerator.cs (copia de trabajo)
@@ -304,6 +304,8 @@
    codegen.GenerateCode(Language.VisualBasic, outputDirectoryEntry.Text);
   else if (languageComboBox.Active == 2)
    codegen.GenerateCode(Language.Boo, outputDirectoryEntry.Text);
+   else if (languageComboBox.Active == 3)
+    codegen.GenerateCode(Language.Nemerle, outputDirectoryEntry.Text);
   else
    throw new Exception ("What is " + languageComboBox.Active + "??");
   
Index: src/Generator.cs
===================================================================
--- src/Generator.cs (revisión: 7)
+++ src/Generator.cs (copia de trabajo)
@@ -282,6 +282,9 @@
      Assembly assembly = Assembly.LoadWithPartialName("Boo.Lang.CodeDom");
      provider = (CodeDomProvider)assembly.CreateInstance("Boo.Lang.CodeDom.BooCodeProvider");
  //          provider = new Boo.Lang.CodeDom.BooCodeProvider();
+     } else if (language == Language.Nemerle){
+      Assembly assembly = Assembly.LoadWithPartialName("Nemerle.Compiler");
+      provider = (CodeDomProvider)assembly.CreateInstance("Nemerle.Compiler.NemerleCodeProvider");
     } else {
      throw new Exception ("Unsupported language");
     } 
Index: data/gladecodegenerator.glade
===================================================================
--- data/gladecodegenerator.glade (revisión: 7)
+++ data/gladecodegenerator.glade (copia de trabajo)
@@ -770,7 +770,8 @@
         True
         C#
Visual Basic
-Boo
+Boo
+Nemerle
         False
         True
      
     } 

Monday, August 15, 2005

iFolder & Zync

Hi there, I have just packaged ifolder3, simias and Zync for hoary. Zync is the SimpleServer included with the simias code. The idea is improve this GPL version.


Jaime share with me :).
deb http://people.hazent.com/~jrp/ubuntu hoary hazent

Sunday, August 07, 2005

Ubuntu Hoary Repository

I have just update my repository. You will find monouml from SVN (compiled against ExpertCode from CVS). I sent a patch to Mario Carrión, a MonoUML developer.

Viewing a XMI sample file and the code generator.
Repository:
deb http://people.hazent.com/~jrp/ubuntu hoary hazent
Enjoy it!

Tuesday, June 21, 2005

Extending PHP

Sometimes we need a new funcionality on PHP that we don't have because it is an OS specific call which needs a deep degree of abstraction inherent in the language or due to another reason.

Today we will learn how to develop an extension to send faxes with only a line of code. You need efax installed and configured (just edit /usr/bin/fax).

Add this lines to /etc/printcap file:
 fax:
 :lp=/dev/null:
 :sd=/var/spool/fax:
 :if=/usr/bin/faxlpr:
Now we can write the module:

efax.c

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include "efax.h"

ZEND_FUNCTION(send_fax); 
PHP_MINFO_FUNCTION(efaxmod);

static function_entry efax_functions[] = {
    PHP_FE(send_fax, NULL)
    {NULL, NULL, NULL}
};

zend_module_entry efax_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
    STANDARD_MODULE_HEADER,
#endif
    PHP_EFAX_EXTNAME,
    efax_functions,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
#if ZEND_MODULE_API_NO >= 20010901
    PHP_EFAX_VERSION,
#endif
    STANDARD_MODULE_PROPERTIES
};

#ifdef COMPILE_DL_EFAX
ZEND_GET_MODULE(efax)
#endif


PHP_MINFO_FUNCTION(efaxmod) { 
 php_info_print_table_start(); 
 php_info_print_table_row(2, "Efax Extension", "Hazent Systems"); 
 php_info_print_table_end(); 
}

 
PHP_FUNCTION(send_fax)
{

 char *name, *number;
 //int name_len, number_len;
        int ret;
    
 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &name, &number) == FAILURE)
             return;
    
 
        char *cmd[] = { "lpr", "-Pfax" , "-J", number, name,(char *)0 };
        // FIXME: getenv
        char *env[] = { "HOME=/var/www", "LOGNAME=www-data", (char *)0 };
        ret = execve ("/usr/bin/lpr", cmd, env);
        return ret;

}

efax.h

#ifndef PHP_EFAX_H
#define PHP_EFAX_H 1

#define PHP_EFAX_VERSION "1.0"
#define PHP_EFAX_EXTNAME "eFax"

PHP_FUNCTION(send_fax);

extern zend_module_entry efax_module_entry;
#define phpext_hello_ptr &efax_module_entry

#endif

config.m4

PHP_ARG_ENABLE(efax, whether to enable eFax support,
[ --enable-efax   Enable eFax support])

if test "$PHP_EFAX" = "yes"; then
  AC_DEFINE(HAVE_EFAX, 1, [Whether you have eFax])
  PHP_NEW_EXTENSION(efax, efax.c, $ext_shared)
fi
To compile it type:
bash$ phpice && ./configure && make
If you want to install it type:
bash$ make install
or, just load it from php during the execution:
dl("efax.so");
send_fax("666666666","fichero.txt");
send_fax("667777666","fichero.pdf");
send_fax("688888866","fichero.ps");
...
You can get the source from: http://people.hazent.com/~jrp/soft/php4-efax.tgz

Friday, May 06, 2005

Monouml for Ubuntu Breezy

I have just packaged monouml for ubuntu breezy. MonoUML is a CASE tool based on the mono Framework written in C#. It supports UML 2.0 (for models and diagrams), works with XMI 2.0, 1.2 and 1.0, code generation, reverse engineering (importing from CIL assemblies) and much more.


Sample Class Diagram


Reverse engineering Process of Maverick.net MVC

Saturday, April 30, 2005

Starting with MWF

You will need libgdiplus installled on your system. (if you are running Ubuntu Breezy, you can use my personal ubuntu repository.

You also need Windows.Forms, if you need it just download it from here.

Yoy will need to install it with gacutil:
sudo gacutil -i System.Windows.Forms.dll

Now you can execute WindowsForm Apps ;)

Lets code..
Open monodevelop and create a new empty project. On the *Solution* window -> references -> Add reference and select System.Windows.Forms.



Create a new empty file and rename it to Main.cs and add the next code:
// created on 30/04/2005 at 17:38
using System.Windows.Forms;

class HelloWindowsForms
{

        public static void Main()
        {
                MessageBox.Show ("Hello World!");
        }

}


Well.. after this tipical 'hello world', we will try something more interesting...
// created on 30/04/2005 at 17:38
using System;
using System.Windows.Forms;


class MyForm : System.Windows.Forms.Form
{
 private RadioButton MyRadioButton;
 private System.ComponentModel.Container components = null;

 public MyForm()
 {
  InitializeComponent();
 }

 public static void Main()
 {
  Application.Run(new MyForm());
 }

 private void InitializeComponent()
 {
     this.MyRadioButton = new RadioButton();    
     this.MyRadioButton.Text = "My RadioButton";     
  this.Controls.AddRange(new System.Windows.Forms.Control[]{this.MyRadioButton}); 
 }

}

My personal Ubuntu Breezy repository

Hi childrens, I'm setting up my personal breezy repository where I'm backporting several packages. You will find mono 1.1.6 (with preview 2.0), monodevelop 0.6, planner 0.13, emacs-snapshot with gtk2 support...

For more information check the following url out:
http://people.hazent.com/~jrp/ubuntu/dists/breezy/hazent/binary-i386/Packages.gz

Add this line to your /etc/apt/sources.list:
deb http://people.hazent.com/~jrp/ubuntu breezy hazent

Monday, April 25, 2005

MobileMaps Alpha

Here is the first public Alpha release of MobileMaps. In this release have been working Jaime Cáceres, Alvaro Gámez and me.

Saturday, March 19, 2005

ForeSight Linux

We are mirroring the FSL project [http://www.foresightlinux.org]. This is a new Linux idstribution based on the conary package system. It comes with mono, beagle, f-spot, howl, hal and much more. Now it is in the initial stages of range development.

Our mirror is hosted in TuxSM: http://tuxsm.org/mirror/foresight/

Friday, March 18, 2005

Thursday, March 10, 2005

Hazent in the North of Spain

Jaime and me are working in several projects using open source software in the North of Spain. Yesterday we were in Cantabria, and now we are in Vizcaya. We will back home tomorow.

Aspaldiko

Monday, March 07, 2005

Starting with wsdl in mono

Webservices allows us to call remote methods through HTTP, using XML. A web server will export the methdos usind WSDL, so it will be transparent for us.

A simple example could be the Google API, which can be found at http://api.google.com/GoogleSearch.wsdl

You can use wsdl.exe to generate a proxy code to make use of these methods.

Implementing the API:
wsdl http://api.google.com/GoogleSearch.wsdl

Compiling the API:
mcs GoogleSearchService.cs -r:System.Web.Services -target:library

We can build a simple program using the Google API so:
mcs google.cs -r:GoogleSearchService.dll -r:System.Web.Services

Gnome SpellChecker - Proof of concept

Run monodevelop and open a new solution/project. Copy the GoogleSearchService.dll library into your project directory. Go to Solution->References->Edit references->.Net Assembly and select the GoogleSearchService.dll file.

Create a GUI with Glade with: a Label, an Entry and a Button in such a way that when you click the button, our GetSpellingSuggestion(string s) method be called with the s parameter as the Entry.Text content.

private void GetSpellingSuggestion(string s)
{
   try{
        GoogleSearchService svc=new GoogleSearchService();
        string result=svc.doSpellingSuggestion(this.key,s);
        label1.Text="Usted quiso decir: "+result;
   }catch(Exception ex){
        Console.WriteLine(ex.ToString());
   }
}        
The 'key' variable is a string containing the hascode provided by Google, which allows us to access its API. (More information is available at http://www.google.com/apis/)

Sunday, February 27, 2005

Presentation

I live in Madrid and my favorite operating systems are Linux and OpenBSD. I can write code in C, C#, Java, and some Python. My favourite IDE is Eclipse, however I'm starting with Monodevelop for C#

For programing in C I prefer emacs. I had been working in several telco/manufacture companies (Vodafone, Ericsson,..) with mobile networks. I'm interested in *NIX kernel development, Linux Desktop (Ubuntu, Gnome, Mono ..), networking, phone systems, cryptography ...