07 September 2011

The Bank of San Serriffe

Just checking Knuth's page, I've found out that I appeared twice in The Bank of San Serriffe's balance:
German González-Morris    0x$1.20
German Gonzales-Morris    0x$1.20

It is incredible how many times my last name (being one of the most popular worldwide) is misspelled :D

01 September 2011

Eclipse versions bundled in WebLogic Server

This is a summary of embedded Eclipse versions found in WebLogic Server installations:

WebLogic Server Eclipse OEPE
10.3 only WorkShop --
10.3.1 3.4.2 (Ganymede) 11.1.1.1.1
10.3.2 3.5.0 (Galileo) 11.1.1.3.0
10.3.3 3.5.2 11.1.1.5.0
10.3.4 3.6.1 (Helios) 11.1.1.6.1
10.3.5 3.6.2 11.1.1.7.2
10.3.6 3.7.1 (Indigo) 11.1.1.8.0
12.1.1 3.7.1 12.1.1.0.0
12.1.1 March 2012 3.7.2 12.1.1.0.1
12.1.2 4.3.0 (Kepler) 12.1.2.1
12.1.3 4.3.2 12.1.3
latest standalone 4.4.1 (Luna) 12.1.3.3


WebLogic Server installations can be downloaded from: http://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html

Oracle OEPE can be obtained standalone as well, usually there is newer version too: http://www.oracle.com/technetwork/developer-tools/eclipse/downloads/index.html

Updated: 24-December-2014
 

04 July 2011

Awkward Javadoc comments

There are several funny Javadoc/Source code explaining methods, properties and/or examples:

1. Catastrophic :
weblogic.cluster.singleton

public interface ClusterLeaderListener 

void localServerLostClusterLeadership()

This method is called if the local server is already the cluster leader i.e. localServerIsClusterLeader() has already been called and subsequently the server loses the cluster leadership. This can only happen under catastrophic conditions. This condition is fatal. 



2. Draconian :
javax.xml.validation.Validator 

setErrorHandler:

class DraconianErrorHandler implements ErrorHandler {
     public void fatalError( SAXParseException e ) throws SAXException {
         throw e;
     }
     public void error( SAXParseException e ) throws SAXException {
         throw e;
     }
     public void warning( SAXParseException e ) throws SAXException {
         // noop
     }
 }

3. Draconian' :


DRACONIAN_ERROR_HANDLER

public static final org.xml.sax.ErrorHandler DRACONIAN_ERROR_HANDLER

// ErrorHandler that always treat the error as fatal.


http://javasourcecode.org/html/open-source/jdk/jdk-6u23/com/sun/xml/internal/ws/util/xml/XmlUtil.java.html#line.300

update 2019-01
4.  do you want to debug ?

 static char* do_you_want_to_debug(const char* message);

http://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/file/d3cc20285653/src/share/vm/runtime/os.hpp#l502

5. OpenJDK source has too many swear words


-                rpnChange(0, 2 << 7);   // Bitch Bend sensitivity
+                rpnChange(0, 2 << 7);   // Pitch Bend sensitivity
 
 
-     * method is a mess, but it is fast and it works, so don't fuck with it.
+     * method is a mess, but it is fast and it works, so don't change it.
  

https://bugs.openjdk.java.net/browse/JDK-8215217
http://hg.openjdk.java.net/jdk/jdk/rev/2cc1ae79b303





08 May 2011

Project Euler

Hace un tiempo publiqué una lista de sitios de competencias de programación y resolución de problemas matemáticos más cercanos a las matemáticas recreativas.

Dentro de los cuales he participado en menor grado en TopCoder y CodeChef que demuestran un nivel de probemas bastante simpáticos, en donde la mayor atracción es la de problemas de larga duración (ó maratones tac como lo menciona topcoder). El otro tipo de competencias son de corto plazo, muy similar a los concursos que hace ACM o una prueba de universidad.

Uno que no habia considerado es Project Euler que esta más cercano a las matemáticas que la programación. En este sitio hay problemas definidos con una solución esperada, única (y no como test cases que se pueden ejecutar para variables en los ya mencionados otros concursos).

Es bastante bueno la interfaz del sitio para encontrar información e ir viendo los avances que uno logra, por otro lado, los primeros problemas son bastantes fáciles y de un nivel adecuado para cursos introductorios de programación (a pesar que vi algunos grupos de alumnos de algoritmos y estrucutras de datos, espero que ete caso los hayan forzado a solucionar los problemas más avanzados).

Esta hecho de tal manera que la dificultad de los problemas van avanzando y así uno va consiguiendo logros tal como si fuese un alumno de karate :P

Creo que hay que seguir con este proyecto, cual tiene una perspertiva diferente y con pensamiento libre.

Por ahora solo 12 problemas resueltos y contando...
(ícono automático con datos):

05 May 2011

WLS: Listing Users and their Groups in a Security Realm

Many times I've seen the question about a WLST script for listing groups to which an user belongs.
(This works Oracle Weblogic Server - Version: 9.0 to 10.3.4)


Before running the script you need to set up the environment to your local WebLogic Server by invoking DOMAIN_NAME\bin\setDomainEnv.cmd (setDomainEnv.sh on UNIX), where DOMAIN_NAME is the directory in which you located the domain


You need to modify the line 6, where set the address, port, username and password of your WebLogic Server:

connect('weblogic','welcome1','t3://127.0.0.1:7001')

and run it with the following command line:

java weblogic.WLST groups_of_users.py
Listing groups_of_users.py:
from weblogic.management.security.authentication import UserReaderMBean
from weblogic.management.security.authentication import GroupReaderMBean
from weblogic.management.security.authentication import MemberGroupListerMBean

# connect to WLS with username/password = weblogic/welcome1
connect('weblogic','welcome1','t3://127.0.0.1:7001')

realm=cmo.getSecurityConfiguration().getDefaultRealm()
atns = realm.getAuthenticationProviders()

for i in atns:
  if isinstance(i,UserReaderMBean):
    userReader = i
    cursor = i.listUsers("*",0)
    # print '* Users in realm '+realm.getName()+' are: '
    while userReader.haveCurrent(cursor):
      # print userReader.getCurrentName(cursor)
      user = userReader.getCurrentName(cursor)

# init

      print ''

    # listings groups of user
      # print "Listing the groups of a '" + user +"'"
      atnr=cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvider("DefaultAuthenticator")
      # users? = OracleSystemUser, weblogic
      x = atnr.listMemberGroups(user)
      # print x

      # new pointers for better understanding
      groupReader = atnr
      cursor2 = x
      print "* Groups in user '" + user + "' are: "
      while groupReader.haveCurrent(cursor2):
        print groupReader.getCurrentName(cursor2)
        groupReader.advance(cursor2)
      groupReader.close(cursor2)

# end      
      
      userReader.advance(cursor)
    userReader.close(cursor)
  


Then you will get a similar output to:

* Groups in user 'weblogic' are:
Administrators

* Groups in user 'usertest1' are:
AppTesters
Monitors

25 February 2011

El Rey de e (5x5)

Un nuevo cuadrado encontrado, ahora con 95 dígitos:

2,7182818284590452353602874713526624977572470936999595749669676277240766303535547594571382178525

7 2 0 6 2
1 8 5 5 3
3 7 4 0 9
5 2 7 9 3
6 6 5 6 6

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.

Blog Archive

Disclaimer

Qux