28 December 2010

Dijkstra: My small tribute

for over four decades  mailed copies of his consecutively numbered technical notes, trip reports, insightful observations, and pungent commentaries, known collectively as "EWDs" [1]. This is a great project that has been running for years to transcribed by hand all the already scanned EWD.

I have transcribed two of several  EWD documents that remains for that task; more than a contribution to knowledge (by my side), this is a small tribute to this great computer scientist.

If you feel with time to support in the same way (or proofreading as well), please try visiting the Archive website.

[1] http://www.cs.utexas.edu/users/EWD/

16 December 2010

UML: mal entendimiento

He visto bastante en la escena productiva un mal entendimiento de UML, poniendo 2 posturas opuestas extremas, tal como:
  1. Los que creen que es la panacea
  2. Los que la odian 

Los del primer grupo creen que a base de la primera creen que al usar tal herramienta el proyecto va ser exitoso y todo funcionara.

Los del segundo grupo creen que es basura (muchas veces teniendo la misma base erronea del primer grupo, que es supuesta panacea), porque no les genero el esquelo completo de su diseño de patrones/clases

Generalmente ocurre lo que no se entiende no gusta, ha sucedido siempre en la historia de la civilización, pero acá podemos rescatar algunas buenas practicas para poder usar esta nomenclatura en vez de seguir neófito.

Lo que NO es:

  1. No es la panacea
  2. Por lo mismo no te entregara todas las clases (si tienen un buen diseñador/analista con experiencia en programación y patrones de diseño puede entregar algo robusto, pero siempre tendrá algo que falta y esas iteraciones deberán hacerla el programador, obviamente todo esto funciona si los requerimientos iniciales se hicieron bien y no se ha cambiado en el tiempo). 
Lo que Si es:

  1. Estandariza la nomenclatura
  2. Explica de forma simple ciertas especificaciones como con casos de uso y de secuencia para todo usuario y programadores respectivamente. 

por otro lado simple hay alguna manera de poder especificar guarismos, es más, Meyer y otros ya lo han hecho, lo malo de UML que es propietario, pero se alineo con OMG asi que es el mejor/último esfuerzo que se ha hecho de tal manera que la documentación sea estándar al contratar a Jacobson e IBM comprar a Rational.

-- (15/10/08).



Después de haber escrito el pasado texto hace ya 2 años, veo que Fowler tiene un punto de vista bastante parecido donde me llama mucho la atención los siguientes párrafos:
Changing the design doesn't necessarily mean changing the diagrams. It's perfectly reasonable to draw diagrams that help you understand the design and then throw the diagrams away. Drawing them helped, and that is enough to make them worthwhile. They don't have to become permanent artifacts. The best UML diagrams are not artifacts.

A lot of XPers use CRC cards. That's not in conflict with UML. I use a mix of CRC and UML all the time, using whichever technique is most useful for the job at hand.
 Bueno lo escribió el 2004 :-)

-- (15/12/10)

13 December 2010

EJB 3.0 Database Persistence with Oracle Fusion Middleware 11g : Review

This is a good book (→tutorial) for any developer that wants to use EJB 3.0 with the most popular Oracle J2EE technologies.

The book starts with a simple introduction of EJB 3.0 and compares that spec to EJB 2.x, overviews new features such as, annotations, JPA and interceptors.

Then it goes into this topic in depth, always tied-up to JDeveloper; for instance, shows how to convert EJB 2.x to 3.0, it's a very good example if the reader comes from that legacy specification or to see explicitly how much effort we are saving coding and not generating deploy descriptors to obtain the same business/architecture JEE feature.

Continuing the Book's Oracle point of view, look into EclipseLink JPA, JDeveloper (as main IDE) and complete chapter of Eclipse OEPE and their details. Chapters dedicated to integration with ADF & JSF separately, EJB relationships, and finishing with Web Services.

A lot of details, clear explanations, source code, screen-shots of step-by-step instructions to avoid any doubt to the reader to get the best of these specs and tools.

11 December 2010

Lazy initialization

http://en.wikipedia.org/wiki/Lazy_initialization

from GoF:

You can avoid this by being careful to access products solely through accessor operations that create the product on demand. Instead of creating the concrete product in the constructor, the constructor merely initializes it to 0. The accessor returns the product. But first it checks to make sure the product exists, and if it doesn't, the accessor creates it. This technique is sometimes called lazy initialization. The following code shows a typical implementation:

class Creator {
public:
Product* GetProduct();
protected:
virtual Product* CreateProduct();
private:
Product* _product;
};

Product* Creator::GetProduct () {
if (_product == 0) {
_product = CreateProduct();
}
return _product;




--
Atte.

German Gonzalez

06 December 2010

CWEB en Español

Después de varios meses de trabajo, he podido terminar de traducir a Castellano The CWEB System of Structured Documentation de Donald Knuth.

Fue una tarea bastante ardua, más de lo que imagine ya que hay muchas frases técnicas (de tipografía) y sobre todo con mucha información tácita.

Se puede bajar desde el mismo sitio del Prof. Knuth: http://www-cs-faculty.stanford.edu/~knuth/cweb.html

Si alguien tiene comentarios, sugerencias para el documento, por favor diganmelo.

23 November 2010

Liar, Liar: Solved - FaceBook Puzzles

I have solved the first problem of Facebook Engineering Puzzles (Snack difficulty). It took me more time that I've planned, as usual, being a blackbox is harder to reach a solution.

Right now the robot has problems to receive emails from gmail (using the webmail app), therefore the solution is to send the solution through a script that uses SMTP.

This is the email sent by the robot:
Thank you for your submission of a puzzle solution to Facebook! After running your solution to liarliar (received on November 22, 2010, 9:24 am), I have determined it to be correct. Your solution ran for 1400.789 ms on its longest test case. If you have not already, try installing the official Facebook Puzzles application from http://apps.facebook.com/facebookpuzzles/ and publish a story about your solution! To publish, just go to http://apps.facebook.com/facebookpuzzles/mypuzzles.php and click on the publish link.

If you are applying for a position within Facebook, the puzzle difficulty solved will be taken into account with regards to how much time you had available to solve it (remember that Hors D'oeuvres are only tests for your benefit). I have taken the liberty of alerting our recruiting team about your success. Best of luck!

Sincerely,
-The puzzle robot

23 September 2010

Kludge

Después de haber traducido un documento de Knuth, muchas palabras interesantes me llamaron la atención, entre otras fue kludge que significa una solución no inteligente a un problema en ingeniería, en este caso particular de computación.

UPDATE1 (2016.01.25): Que es diferente a la palabra que intenta crear (y popularizar) en honor a Turing:
"Nomenclaturing: Let's Ture to the Max!"
http://www-cs-faculty.stanford.edu/~uno/news12.html


25 August 2010

Falsos Amigos Em Português

Después de estudiar Português por 1 año, pude hacer mi lista de vocabulario y donde me sorprendio varios aspectos de este idioma, entre otros la gran cantidad de amigos falsos que existen entre Castellano y Portugués:

PortuguêsCastellano
acordardespertar
acordedespertar
apagarapagar, borrar
apelidosobrenombre
asaala de avion, pajaro
asasalas
assim queapenas (apenas pueda)
assistever, ir
baterpegar
batirlater
bilhetebillete, boleto, papeleta
biscoitogalleta
bistecbife
boloqueque
bolsacartera
borrachogoma (caucho)
cabocable
cachorroperro
cafe de manhadesayuno
cafe passadocafe de maquina
calçapantalon
carterabilletera (de hombre)
casacochaqueta mujer
cenaescena
costasespalda
criado-mudovelador
dadosdatos
decoraraprender de memoria, memorizar
descargatirar cadena
deslocadadislocada, desplazado
despidadesnuda
dirigirmanejar, conducir
distintadistinguida
encomendarencargar
enganoequivocado
escritoriooficina
feiraferia
feriadía de la semana, descanso
fracadébil
irritadaenojada, molesta
latirladrar
malamaleta
massapasta
mesmorealmente
mesmo queaunque
montemontón
moralmoraleja
ondaola
palavrãogarabato
pastapaté
pasteisempanada fritas
pegartomar
perdurarcolgar
pimentaaji
pincelisopo
presuntojamón
prontolisto, acabar
pulsomuñeca
que logode pronto
romancistanovelista
ruviapelirroja
secasequia, secado
segundosegún, segundo
senhacontraseña
serenasirena
sinocampana
sobre tudocasaca
sobremesapostre
sobrenomeapellido
solosuelo
telapantalla, televisor
termotérmino
tirarquitar, sacar
tomara queojala
tonturamareo
traçoguión
tragatraiga
vasoescusado, macetero
veiavena

06 August 2010

Sun Certified Enterprise Architect (SCEA)

Varias veces me han pregunto he insistido respecto la certificación Sun Certified Enterprise Architect (SCEA). La mayoria cree que se necesitan todos los certificados especificos de J2EE.

Como se ve en la figura (y pueden rectificar en la página), no tiene ningun requisito para poder tomarlo. Claro esta que no se recomienda ya que abarca todos los temas especializados.

Lo que si es diferente es que la forma de desarrollo del examen es diferente, cual consta de 3 partes: Examen, Proyecto, Ensayo. Mas parecido a una memoria de pre-grado.

02 August 2010

Neo-vintage 2: Pagination in Struts... JSTL implementation

Many times I have needed to use an pagination for many data to be shown in my page, however there is no a good Tag implemented for Struts and not as JSF that has components for it..

There is a good encapsulation with the great library DisplayTag, but this one doesn't give too much freedom to create different things, thus this approach is more flexible.

Finally searching for the web I found a simple JSTL pagination, where you can give a collection of data and at level of presentation parse it and embedded with html and javascript we can get the final pagination that we wish.http://web.archive.org/web/20071213001753/http://www.ekcsoft.com/jstl/content/paginate/ (it is no longer alive).

It has a small bug when the collection is empty therefore the totalCount is zero.

It can be put inside Struts without problems, below can see code of it,:
<c:set var="totalCount" scope="session" value="${queryResults.rowCount}"/>
    <c:set var="perPage" scope="session" value="20"/>
    <c:set var="totalPages" scope="session" value="${totalCount/perPage}"/>
    <c:set var="pageIndex" scope="session" value="${param.start/perPage+1}"/>

   <c:if test="${!empty param.start && param.start >(perPage-1) && param.start !=0 }">
          <a href="?start=<c:out value="${param.start - perPage}"/>">Prev </a>
    </c:if>

   <c:forEach
        var="boundaryStart"
        varStatus="status"
        begin="0"
        end="${totalCount - 1}"
        step="${perPage}">
        <c:choose>
            <c:when test="${status.count>0 && status.count != pageIndex}">
                             <a href="?start=<c:out value='${boundaryStart}'/>">
                                <c:out value="${status.count}"/> |
                            </a>
            </c:when>
        <c:otherwise>
                <c:out value="${status.count}"/> |
        </c:otherwise>
        </c:choose>
    </c:forEach>

    <c:if test="${empty param.start || param.start<(totalCount-perPage)}">
          <a href="?start=<c:out value="${param.start + perPage}"/>">Next </a>
    </c:if>

02 July 2010

Oracle JRockit: The Definitive Guide Review

Oracle JRockit: The Definitive Guide
Copyright © 2010 Packt Publishing

Just like the title establish, this is the definitive guide of JRockit, including the last features of version R28.

It starts with the canonical knowledge to work and understand the JVM, showing details from the most basic until the advanced topics. Describing how and why certain features were made, how it was improved and plus several Best Practices lists to take the best of the suite of tools bundle with JRockit.

The book is wisely divided in two parts, the first is about JVM and the second part is regarding to JRockit Mission Control. Which is a powerful set to dissect JRockit Beauvoir to find out memory leaks, performance, bottlenecks, etc.

It gives an extended explanation of the parameters to take better of this tools suite with a low overhead, many of the areas referred can't be found somewhere else in such deeply detail form.

Everything in only one compendium of information done by the same creators of JRockit.

 More information at:

10 June 2010

Oracle JRockit: The Definitive Guide


This new book for JRockit will be release on June. It is written for specialist in the field.
https://www.packtpub.com/oracle-jrockit-the-definitive-guide/book

At first view it shows all the great enhancements has JRockit for tuning, analyzing, trouble-shooting, etc.

24 May 2010

Martin Gardner QEPD

Lamentablemente Martin Gardner ha dejado de vivir, gran difundidor de las matemáticas recreativas.

A pesar de su avanzada edad todos seguiamos su legado que por muchos años nos inspiró en su mundo imaginario.

http://es.wikipedia.org/wiki/Martin_Gardner

20 May 2010

WLS ListenAddress

When the WebLogic Server is set up to listen a specific port then it stops to listen even the loopback address (localhost/127.0.0.1), let's suppose you want to listen each local server where your application has been deployed.

And could appears many Exceptions related to, such as:

Failed to connect to t3://localhost:7003: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused; No available router to destination
java.net.ConnectException: t3://localhost:7003: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused; No available router to destination
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:203)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:153)
at weblogic.jndi.WLInitialContextFactoryDelegate$1.run(WLInitialContextFactoryDelegate.java:344)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:339)
at weblogic.jndi.Environment.getContext(Environment.java:315)
at weblogic.jndi.Environment.getContext(Environment.java:285)
at weblogic.jndi.Environment.createInitialContext(Environment.java:208)
at weblogic.jndi.Environment.getInitialContext(Environment.java:192)
at weblogic.jndi.Environment.getInitialContext(Environment.java:170)
at weblogic.management.commandline.tools.AdminToolHelper.getMBeanHome(AdminToolHelper.java:590)
at weblogic.management.commandline.tools.ServerInfoCommandLineInvoker.doCommandline(ServerInfoCommandLineInvoker.java:924)
at weblogic.management.commandline.tools.ServerInfoCommandLineInvoker.(ServerInfoCommandLineInvoker.java:117)
at weblogic.management.commandline.AdminMain.main(AdminMain.java:132)
at weblogic.Admin.useAdminMain(Admin.java:43)
at weblogic.Admin.main(Admin.java:22)
Caused by: java.rmi.ConnectException: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused; No available router to destination
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:464)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:315)
at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:251)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:194)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:225)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:188)
... 16 more

The solution is to eliminate that configuration:

Through the GUI you can go to DOMAIN_NAME -> Environment -> Servers -> SERVER_NAME There you'll find a ``Listen Address'' input text. Leave it blank so WLS can listen to localhost otherwise only it will listen to the address entered.

In the config.xml you will see:

<server><name>AdminServer</name>
      <listen-port>7003</listen-port>
      <listen-address>www.devweb.cl</listen-address>
</server>


Restart the WLS and try out again, now it should be able to reach to localhost, doing a WLS Ping and deploying your application.
``If a server's listen address is undefined, clients can reach the server through an IP address of the computer that hosts the server, a DNS name that resolves to the host, or the localhost string. The localhost string can be used only for requests from clients that running on the same computer as the server.''


Simple WebLogic Ping

Many times someone wants to see if a WebLogic Server is up and running. This can be checked thru (even it has been deprecated still comes bundled in the last WLS 10.3.x ):

If you wish to use a more modern tool then use WLST, but then you should write more text for the same test.

java weblogic.Admin -url localhost:7001 -username weblogic -password  welcome1 -verbose PING 1 1024


Muchas veces se quiere ver si un WebLogic Server esta arriba y funcionando, esto se puede lograr con (a pesar que ha sido descontinuado aun viene dentro del WLS 10.3.x) :

java weblogic.Admin -url localhost:7001 -username weblogic -password  welcome1 -verbose PING 1 1024


Esta herramienta ya esta deprecada, pero aun sirve y es útil.

Si quieren usar una herramienta actual entonces pueden usar WLST, pero deben poner mas texto para poder hacer la misma prueba.

http://download.oracle.com/docs/cd/E11035_01/wls100/admin_ref/cli.html#wp1196567

16 May 2010

Martin Gardner

After reaching Martin Gardner for a particular riddle, He wrote me telling me that he is not longer doing anything related to the subject and have donated all his library to Stanford University.

He always with a innovated progressive thinking...

J2EE Web Services - Richard Monson-Haefel - Source Code

Many times has been asked for for the source code of the J2EE Web Services - Richard Monson-Haefel.
In Code Ranch forums he has answered that question:
http://www.coderanch.com/t/147976/Web-Services-Certification-SCDJWS/certification/Download-codes-XML-J-EE
``I lost the code for the book ... Always and I mean ALWAYS back up your hard drive! I had kept the book code on my old PC because my copy of XMLSpy only works on PCs (I use a Mac). I'm still trying to recover after a worm or wear-and-tear or something made the PC stop working. It won't even boot now.

I did test the JAXR code a lot. In fact, I ran the code through the ringer twice so I'm not sure why you are having problems. That said, the UBR registries never did behave exactly as expected so maybe there was a change.

Anyway, I haven't had time to rebuild all the code for the book yet. If anyone gets a start on this I'll be happy to open source it.''
 So, if anyone has done something please contact him.

05 March 2010

Selected Papers on Design of Algorithms

``The present volume, the seventh in a series of his collected papers, is devoted to his work on the design of new algorithms. Nearly thirty of Knuth’s classic papers are collected in this book and brought up to date with extensive revisions and notes on subsequent developments. The papers cover numerous discrete problems, such as assorting, searching, data compression, theorem proving, and cryptography, as well as methods for controlling errors in numerical computations.''

http://www-cs-faculty.stanford.edu/~knuth/da.html

http://www.press.uchicago.edu/presssite/metadata.epl?isbn=9781575865836

Due: April 2010

01 February 2010

MikTeX 2.8 updating

Trying to update MikTeX behind a proxy is a little tricky.

First of all you have to know the URL and Port of your proxy, let's say:

proxy: www.proxyfoo.org
port: 80

Thus you have to set up the environment variable http_proxy (there are more possibilities setting http,ftp,proxy variables):

http_proxy=http://www.proxyfoo.org:80

Also if you are having the error "GUI framework cannot be initialized" in some IDE as WinShell, TeXnicCenter, etc. then the solution is:

Start MiKTeX Options and choose either Yes or No (but not "Ask me first") for the option "Install missing packages on-the-fly".

My Blog List

Blog Archive

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.