03 January 2019

Btrace cheat sheet

Btrace is a not very popular and powerful tool to debug class at runtime.

The plugin must be installed to run it from visualvm:


Second button to execute it:


Copy the script to be executed thru btrace :


See the results:


It can be executed through command line as well:

btrace <pid> <btrace-script>

$ ./btrace -v -p 2020 -d ./dump/ 64834 TracingScript.java 


More info:
  1. https://github.com/btraceio/btrace
  2. https://dzone.com/articles/btrace-hidden-gem-java
  3. https://www.zcfy.cc/original/btrace-wiki-userguide-mdash-project-kenai

24 December 2018

After Now Archeology

Although it has passed 4 years from his original thesis about puzzle game design. Jakko has defended a complete document and began a game.

The blog a thesis can be found at :  http://afternowarcheology.blogspot.fi/

The research refers to several important books/games in the field.

21 December 2018

OpenGrok

Open source project from Oracle.

It retrieves information from different control version source code and is indexed with Apache Lucene, making a fast solution for searching (and keep updating).



https://github.com/oracle/opengrok/wiki/How-to-setup-OpenGrok
http://demo.opengrok.org/
https://github.com/oracle/opengrok


18 December 2018

Most interesting Socket Options

  • TCP_NODELAY
  • SO_SNDBUF
  • SO_RCVBUF
  • Don't forget timeout !

      socket = new Socket(host, port);
      sock.setSoTimeout(5 * 1000); //milliseconds

      socket.setTcpNoDelay(true);
      socket.setSendBufferSize(1000);
      socket.setReceiveBufferSize(1000);


https://eklitzke.org/the-caveats-of-tcp-nodelay
http://normanmaurer.me/presentations/2013-jax-networking-on-jvm/#/41

Don't want to Hassle

    There are a few frameworks to rescue....

12 December 2018

Bfile++

Quick analysis as an alternative and abstract layer for Oracle BFILE.

- http://www.jcraft.com/jsch/
  JSch library
  https://docs.spring.io/spring-integration/reference/html/sftp.html
  Under the covers, the SFTP Session Factory relies on the JSch library to provide the SFTP capabilities.

- https://commons.apache.org/proper/commons-net/
  FTPFile (Apache Commons Net 3.6 API)

- Commons VFS
  https://commons.apache.org/proper/commons-vfs

- Xodus (JetBrains)
  https://github.com/JetBrains/xodus
  It has three types of database: a key-value storage, an entity-store and a database for files and streams.

- Flexible Storage System (FS2)
  https://github.com/robertjchristian/fs2
  (un solo developer :( esta buena la idea )

Servers:
(out of scope)

- http://www.alluxio.org/ (service)
- https://www.syncany.org/ (tool)


More info:

https://docs.oracle.com/cd/B28359_01/java.111/b31224/oralob.htm#i1059941
https://stackoverflow.com/questions/51503297/managing-oracle-bfiles
http://www.orafaq.com/wiki/BFILE
https://docs.oracle.com/cd/B28359_01/java.111/b31224/oralob.htm#i1059941

11 December 2018

Artist Entities for Coding Books

It is not very common to see in programming books writers, musicians, artist as examples in code samples (usually as entities)

Some examples:

- Get Programming with Haskell

 -  Lovecraft

names = [("Ian", "Curtis"), 
         ("Bernard","Sumner"), 
         ("Peter", "Hook"), 
         ("Stephen","Morris")]


- If Hemingway Wrote JavaScript

    - Ernest Hemingway
    - William Shakespeare
    - André Breton
    - Roberto Bolaño
    - Dan Brown

Table of contents:

Fibonacci
1 Ernest Hemingway
2 William Shakespeare
3 André Breton
4 Roberto Bolaño
5 Dan Brown
Factorial
6 Jack Kerouac
7 Jane Austen
8 Samuel Johnson
9 Sir Arthur Conan Doyle
10 James Joyce
Happy Numbers
11 J.D. Salinger
12 Tupac Shakur
13 Virginia Woolf
14 Geoffrey Chaucer
15 Vladimir Nabokov
Prime Numbers
16 Jorge Luis Borges
17 Lewis Carroll
18 Douglas Adams
19 Charles Dickens
20 David Foster Wallace
Say It
21 Sylvia Plath
22 Italo Calvino
23 J.K. Rowling
24 Arundhati Roy
25 Franz Kafka
Poetic Interludes
1 Edgar Allan Poe
2 William Shakespeare
3 Dylan Thomas
4 Walt Whitman

10 December 2018

Look into JMS filestore

For many reasons sometimes is necessary to lookup JMS filestore directly, this can be achieved through:

1.
java weblogic.store.Admin

2.
storeadmin-> openfile -store FileStore-FileStore1 -dir /tmp/filestore-local

3.
storeadmin-> dump -store FileStore-FileStore1 -out /Users/German/tmp/filestore-local-dump.xml -conn -deep
4.
list -dir /tmp/filestore-local

It can be used for compressing the store as well.

more info:
https://docs.oracle.com/middleware/1221/wls/STORE/admin.htm#STORE363

06 December 2018

Ludic HTTP

418 I'm a teapot

The HTTP 418 I'm a teapot client error response code indicates that the server refuses to brew coffee because it is a teapot. This error is a reference of Hyper Text Coffee Pot Control Protocol which was an April Fools' joke in 1998

451 Unavailable For Legal Reasons:

I just discovered that HTTP status code 451 "Unavailable For Legal Reasons" exists. This number, in the 4xx "Client errors" range, is a reference to Ray Bradbury's Fahrenheit 451 in which books are illegal...

04 December 2018

WLS Shortcuts:

Useful WebLogic Server shortcuts of Admin console:


Servers -> YOUR_SERVER -> General -> Tuning -> Advanced -> Self Tuning Thread Maximum Pool Size: 400 (default)
 

Servers -> YOUR_SERVER -> Monitoring -> General : jdk, os, etc.
 

Servers -> YOUR_SERVER -> Protocols -> Channels : t3, t3s, http, https, etc.

03 December 2018

Optimizar o No Optimizar

desde el 2008.... y fines de 2018 se mantiene...

Viendo un post en el blog http://gpicon.blogspot.com/2007/11/optimizando-solucion-problema-de.html mencionan sobre optimizar y ver comentarios tan radicales como "si el problema es ficticio es una tontera optimizar", se ve varios puntos de vistas que podemos ver en la vida real.

1. si el problema no fuese ficticio entonces no trabajemos en él, entonces la mayoria de las matematicas no existirian hasta encontrarle alguna aplicacion entonces las matematicas no serian lo que son si ese fuese el paradigma (por suerte no hay tan cortos de mente en la historia de la civilización humana).

2. como sale en el triángulo de (... ver cuaderno), segun el tiempo que se le invierte podemos optimizar algun algoritmo (tarea, metodo, etc.), segun la dificultad y los tiempos (como tambien mencionan en otro post, que la Gantt siga bajo fechas estimadas),

3. hoy en dia hay varios paradigmas de metodos agiles (cual utilizo cuando desarrollo) que si el algoritmo funciona dentro de tiempos y uso de recursos razonables entonces dejemoslo ahi y vamos por otro requerimiento, despues podemos volver a optimizar y mejorar (siempre se puede), pero tenemos que terminar otras cosas antes (bueno el proyecto en si).

4. Esto me recuerda a la trilogia de articulos clasicos de Knuth (casi imposible mencionarlo), sobre la curva/transaccion de teoria versus practica, donde es dificil definir el limite hasta donde va cual paradigma y donde ambas hacen simbiosis.

Volviendo al blog inicial, creo que esos comentarios de optimizar es malo estan totalmente errados y deberian intentar meditar mejor sus dichos para poder mejorar el area de desarrollo (en todo ambito).

Creo que acá puede ser mal entendido el dicho de Knuth:

"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." (Knuth, Donald. Structured Programming with go to Statements, ACM Journal Computing Surveys, Vol 6, No. 4, Dec. 1974. p.268.).

La optimización debe ser analizada si realmente es necesaria gastar esfuerzo en algo que impacto en el rendimiento de un algoritmo ya que los cambios marginales se pueden dejar ya que sólo aumento el nivel de riesgo que se dañe lo ya logrado.

Blog Archive

Disclaimer

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