12 November 2019

TAOCP: Volume 4B, Fascicle 5

The Art of Computer Programming, Volume 4B, Fascicle 5: Mathematical Preliminaries Redux; Introduction to Backtracking; Dancing Links

This fascicle covers three separate topics:
  1.  Mathematical Preliminaries. Knuth writes that this portion of fascicle 5 "extends the ‘Mathematical Preliminaries’ of Section 1.2 in Volume 1 to things that I didn't know about in the 1960s. Most of this new material deals with probabilities and expectations of random events; there's also an introduction to the theory of martingales."
  2.  Backtracking: this section is the counterpart to section 7.2.1 which covered the generation of basic combinatorial patterns. This section covers non-basic patterns, ones where the developer needs to make tentative choices and then may need to backtrack when those choices need revision.
  3.  Dancing Links: this section is related to 2 above. It develops an important data structure technique that is suitable for backtrack programming described above.




06 November 2019

Eclipse - spaces instead of tabs

Usually when using a new eclipse version or AnyEdit Tools.

Always I forget to change this and the impact is huge in git.



04 November 2019

BEA-141297

Cuando se baja de forma incorrecta el AdminServer:

<Info> <Management> <BEA-141297> <Could not get the server file lock. Ensure that another server is not running in the same directory. Retrying for another 60 seconds.>

Hay que borrar :

/mdw/domains/base_domain/servers/AdminServer/tmp/AdminServer.lok


08 October 2019

Parsing tools


Many times I've seen the necessity for parser creation. There are many examples where we need a parser for automation of analysis, diagram creation, etc.

Most common libraries for it :

  1. antlr
  2. javaparser
  3. eclipse jdt
  4. custom

Own example: https://github.com/devwebcl/eclipse-cdt-poc


Examples :


  1. Documenting your architecture: Wireshark, PlantUML and a REPL to glue them all
  2. Your Program as a Transpiler
  3. Federico Tomassetti has several DSL examples.



27 September 2019

Deuda Técnica

https://en.wikipedia.org/wiki/Technical_debt
https://www.martinfowler.com/bliki/TechnicalDebt.html
https://martinfowler.com/bliki/TechnicalDebtQuadrant.html
https://sites.google.com/site/unclebobconsultingllc/a-mess-is-not-a-technical-debt

A mess is not a technical debt. A mess is just a mess. Technical debt decisions are made based on real project constraints. They are risky, but they can be beneficial. The decision to make a mess is never rational, is always based on laziness and unprofessionalism, and has no chance of paying of in the future. A mess is always a loss. (Uncle Bob)

contraponen:

https://hackernoon.com/there-are-3-main-types-of-technical-debt-heres-how-to-manage-them-4a3328a4c50c


En los 2 primeros ejemplos de Dag, la deuda tecnica siempre se basa en un diseño profesional y correcto, no la flojera o al no-profesionalismo que Uncle Bob describe.

I agree with Uncle Bob that this is usually a reckless debt, because people underestimate where the DesignPayoffLine is.

https://martinfowler.com/bliki/DesignStaminaHypothesis.html

hay 2 curvas por agregar deuda tecnica y time to market.

al final el buen diseño es para obtener mas rapidez en el desarrollo (y mejor calidad).

JVM CPU

Thread CPU time

A Java virtual machine implementation may support measuring the CPU time for the current thread, for any thread, or for no threads.The isThreadCpuTimeSupported() method can be used to determine if a Java virtual machine supports measuring of the CPU time for any thread. The isCurrentThreadCpuTimeSupported() method can be used to determine if a Java virtual machine supports measuring of the CPU time for the current thread. A Java virtual machine implementation that supports CPU time measurement for any thread will also support that for the current thread.
The CPU time provided by this interface has nanosecond precision but not necessarily nanosecond accuracy.
A Java virtual machine may disable CPU time measurement by default. The isThreadCpuTimeEnabled() and setThreadCpuTimeEnabled(boolean) methods can be used to test if CPU time measurement is enabled and to enable/disable this support respectively. Enabling thread CPU measurement could be expensive in some Java virtual machine implementations.

https://docs.oracle.com/javase/7/docs/api/java/lang/management/ThreadMXBean.html#getThreadCpuTime(long)


ThreadMXBean.getThreadCpuTime()

https://github.com/devwebcl/jdk7u-jdk/blob/master/src/share/classes/java/lang/management/ThreadMXBean.java


https://github.com/devwebcl/jdk7u-jdk/blob/master/src/share/classes/sun/management/ThreadImpl.java


16 September 2019

Memory Leaks: A Primer

from http://www.toptal.com/java/hunting-memory-leaks-in-java

For starters, think of memory leakage as a disease and Java’s OutOfMemoryError (OOM, for brevity) as a symptom. But as with any disease, not all OOMs necessarily imply memory leaks: an OOM can occur due to the generation of a large number of local variables or other such events. On the other hand, not all memory leaks necessarily manifest themselves as OOMs, especially in the case of desktop applications or client applications (which aren’t run for very long without restarts).

Think of memory leakage as a disease and the OutOfMemoryError as a symptom. But not all OutOfMemoryErrors imply memory leaks, and not all memory leaks manifest themselves as OutOfMemoryErrors.


My Blog List

Blog Archive

Disclaimer

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