29 November 2016

The Scale Cube

Good example of  cube demonstrating the 3 factors necessary for scalability in microservices (it could be projected to different domains as well). Therefore if you scale in any axis will have an impact in another









http://theartofscalability.com/

http://microservices.io/articles/scalecube.html

https://www.benefitfocus.com/blogs/design-engineering/architecture-cubed

http://www.ossmentor.com/2015/01/scaling-microservices.html

https://github.com/arun-gupta/microservices/blob/master/slides/refactor-microservices.pdf

Dietzler’s law

Interesting law from Neal Ford quoting his colleague Terry Dietzler:

Dietzler’s Law for Access
Every Access project will eventually fail because, while 80% of what the user wants is fast and easy to create, and the next 10% is possible with difficulty, ultimately the last 10% is impossible because you can’t get far enough underneath the built-in abstractions, and users always want 100% of what they want.

Source: http://nealford.com/memeagora/2013/01/22/why_everyone_eventually_hates_maven.html

07 November 2016

Maven subprojects

A raw workaround, and work directly on a parent pom.xml into an eclipse workspace:
  • create workspace
  • create parent project
  • copy files/directories, overwriting (subdirectories)
  • import thru "Existing Maven Projects", and select parent project

however, it doesn't work as expected... I think the copy to directories is wrong, and only it should be a reference to origin.

A much better explanation: http://websystique.com/maven/creating-maven-multi-module-project-with-eclipse/


31 October 2016

Bueno Bonito Barato

En Gestión de Proyectos (informaticos en particular), no existe el BBB (Bueno, Bonito, Barato) tal como en la vida real.

Por el dominio formal del tema, no se utiliza tanto estas siglas, pero sin dudas existen y es un tema tratado en este ambito.

Podemos ver en wikipedia (ver referencias originales) que se usan sinónimos, tal como:

Fast, Good, and Cheap,

Y de la misma forma, se solicita tomar solo 2 de ellas (Pick any two), en donde solo 2 de esas características pueden ser elegidas, ya que la tercera no sera cumplida por motivos de las anteriores :O



En fin, la idea es recordar este buen thumb-rule en el dia a dia de un proyecto...


20 October 2016

Swap Two Numbers



public class SwapTwoNumbers {

    public static void main(String[] args) {

        int x = 5, y = 10;

        x = x ^ y ^ (y = x);

        System.out.println("x = " + x);
        System.out.println("y = " + y);

    }

}

18 October 2016

Holgura

Una palabra clave de gestión de proyectos es holgura.

Esta traducción no siempre es fácil de encontrarla, total float o total slack.



16 October 2016

Pleonasmo

Despues de mucho tiempo pude encontrar la palabra que buscaba para la referencia de redundancias utilizadas de forma correcta, tiene valor expresivo y se utiliza como recurso estilístico

Uno de los ejemplos de forma correcta de su uso es el clásico libro de Vicente Perez Rosales: Recuerdos del Pasado.




06 September 2016

Oscon 2016, May Austin TX

This was the schedule for this conference, with the Keynotes I attended:



18.05.2016:

8:45am Wednesday opening welcome Kelsey Hightower (Google), Rachel Roumeliotis (O'Reilly Media), Scott Hanselman (Microsoft)
8:55am Keynote performance by Sammus Enongo Lumumba-Kasongo (Sammus)
9:30am How did I "git" here? A tale of a CS professor Kyla McMullen (University of Florida)
9:45am Huawei’s open source journey Sanqi Li (Huawei)
9:55am The case for a unified and interoperable open cloud ecosystem Sam Ramji (Cloud Foundry Foundation)
10:15am Closing remarks


11:05am Java 9 sneak peek: An embedded tale Matt Schuetze (Azul Systems) 
11:55am Intro to Apache Spark for Java and Scala developers Ted Malaska (Cloudera)  
1:50pm CarbonData : A new Hadoop-native file format for faster data analysis Jihong MA (Huawei) 
2:40pm Open source and microservices: Your badass, next-gen application architecture Ken Owens (Cisco)
4:20pm Microservices war stories Blithe Rocher (Fastly) 
5:10pm Civic data: Using open source data to create socially impactful data-driven products Vida Williams (Axis Partners, Inc) 

19.05.2016:

8:50am Thursday opening welcome Scott Hanselman (Microsoft), Rachel Roumeliotis (O'Reilly Media), Kelsey Hightower (Google)
9:20am Sustainability in open source Danese Cooper (PayPal)
9:45am Crossing the river by feeling the stones Simon Wardley (Leading Edge Forum (CSC))
10:00am O'Reilly Open Source Awards | Room: Ballroom D
10:10am Closing remarks
11:05am Static and dynamic data with Postgres, Kafka, and Bottled Water Chad Bailey (Heroku ) 
11:55am NoSQL's biggest lie: SQL never went away Matthew Revell (Exoscale) 
1:50pm Real-time democratizing of event-driven big data Rachel Reese (Jet.com) 
2:40pm Open source or proprietary: Choose wisely Patrick McFadin (DataStax) 
4:20pm Java 8 puzzlers: The strange, the bizarre, and the wonderful Baruch Sadogursky (JFrog), Vikto
5:10pm A data-streaming architecture with Apache Flink Jamie Grier (data Artisans) 


Open Source Convention - O'Reilly OSCON, May 16 - 19, 2016

http://conferences.oreilly.com/oscon/oscon-tx-2016/public/schedule/grid/public/2016-05-18

http://conferences.oreilly.com/oscon/oscon-tx-2016/public/schedule/grid/public/2016-05-19

09 August 2016

weblogic.security.SecurityInitializationException: Authentication for user weblogic denied

This is a common exception that is under authentication scope.
Googling you can find a lot of information related to boot.properties and ldap directory.

Nevertheless, this time is about the Managed Server cannot communicate with Admin Server, thus it starts in independent mode, but being the very first time it doesn't have users from realms, finally any user cannot authenticate to MS.

Well, solving the name MBP.local (in my case), everything is solved. (etc/hosts :P )



<Aug 8, 2016 9:13:58 AM EDT> <Emergency> <Management> <BEA-141151> <The admin server could not be reached at http://MBP.local:7001.>
<Aug 8, 2016 9:13:58 AM EDT> <Info> <Configuration Management> <BEA-150018> <This server is being started in managed server independence mode in the absence of the admin server.>

....

.....
....

<Aug 8, 2016 9:13:59 AM EDT> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<Aug 8, 2016 9:13:59 AM EDT> <Critical> <Security> <BEA-090403> <Authentication for user weblogic denied>
<Aug 8, 2016 9:13:59 AM EDT> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: weblogic.security.SecurityInitializationException: Authentication for user weblogic denied
weblogic.security.SecurityInitializationException: Authentication for user weblogic denied
  at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doBootAuthorization(CommonSecurityServiceManagerDelegateImpl.java:966)
  at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1054)
  at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:873)
  at weblogic.security.SecurityService.start(SecurityService.java:141)
  at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
  Truncated. see log file for complete stacktrace
Caused By: javax.security.auth.login.FailedLoginException: [Security:090303]Authentication Failed: User weblogic weblogic.security.providers.authentication.LDAPAtnDelegateException: [Security:090295]caught unexpected exception
  at weblogic.security.providers.authentication.LDAPAtnLoginModuleImpl.login(LDAPAtnLoginModuleImpl.java:251)
  at com.bea.common.security.internal.service.LoginModuleWrapper$1.run(LoginModuleWrapper.java:110)
  at java.security.AccessController.doPrivileged(Native Method)
  at com.bea.common.security.internal.service.LoginModuleWrapper.login(LoginModuleWrapper.java:106)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  Truncated. see log file for complete stacktrace
>
<Aug 8, 2016 9:13:59 AM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FAILED>
<Aug 8, 2016 9:13:59 AM EDT> <Error> <WebLogicServer> <BEA-000383> <A critical service failed. The server will shut itself down>




Tabs & Spaces

A concurrent issue in java project with different developers using different IDE's. Now we have three: Eclipse, Netbeans and IntelliJ.

Workaround for Eclipse:
(replace tabs by spaces, not very elegant, but it works)





29 July 2016

Project Euler @Hackerrank

I've been playing around with HackerRank, which has hard problems, contests and tutorials to become a better developer.

One (of many) interesting features is to have ProjectEuler+ open contest, which is the same PE with timeout handicap, thus becoming much harder, seeking for more elegant solutions  :P


25 May 2016

net.sf.ehcache.CacheException

Working on a POC for ehcache Replicated demo:
https://github.com/devwebcl/java-caches-demo

I hit an issue for Tomcat in Mac OS X using ehcache listener for replication:

May 25, 2016 11:07:41 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class de.consol.research.cache.part03.ehcache.ServletContextListener
net.sf.ehcache.CacheException: Can't assign requested address


This is solved by setting Java system property:

-Djava.net.preferIPv4Stack=true




20 May 2016

Knuth's Algorithm Java Impl

I have created a repository for Java implementations of Knuth algorithm found at TAOCP.

https://github.com/devwebcl/Knuth

For now, only algorithms from 7.2.1.2

Also, it has code from Sedgewick.









02 May 2016

WebLogic access log files

Many times in development side, we want to access log files for a remote weblogic.
One easy way (to avoid several constraints) is to have like-a webpage to see these files.

This can be achieved easily with weblogic.xml parameters:

Different WebLogic Server Tools
Bunch of tools to help WLS admin, debugging, etc.
  1. This first version is a war file to access log files from remote client through an HTML file generated by WLS.
  2. the core idea is to show the directories/files of a particular server, this way we can debug easily. 
https://github.com/devwebcl/wls_contraption

The weblogic.xml is:

 <?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.3/weblogic-web-app.xsd">
    <wls:weblogic-version>10.3.6</wls:weblogic-version>
    <wls:context-root>logs_retrieval</wls:context-root>
   
<!--

/u01/domains1036/MYDOMAIN/logs
/u01/domains1036/MYDOMAIN/servers/SERVER1/logs


/ u01/ domains1036/ MYDOMAIN/ apps/ app1-wl/ dist/ app1. ear
/ u01/ domains1036/ MYDOMAIN/ apps/ app2-auth/ dist/ app2. war

error_web.log :
/tmp

----

 index-directory-enabled

The <index-directory-enabled> element controls whether or not to automatically generate an HTML directory listing if no suitable index file is found.
The default value is false (does not generate a directory). Values are true or false.
https://docs.oracle.com/cd/E28280_01/web.1111/e13712/weblogic_xml.htm#WBAPP596

  -->
    <wls:container-descriptor>
        <wls:index-directory-enabled>true</wls:index-directory-enabled>
    </wls:container-descriptor>

    <wls:virtual-directory-mapping>
        <wls:local-path>/u01/domains1036/MYDOMAIN</wls:local-path>
        <wls:url-pattern>/servers/logs/*</wls:url-pattern>
    </wls:virtual-directory-mapping>

    <wls:virtual-directory-mapping>
        <wls:local-path>/u01/domains1036/MYDOMAIN/</wls:local-path>
        <wls:url-pattern>/logs/*</wls:url-pattern>
    </wls:virtual-directory-mapping>

    <!-- depending on OS we must use : "/" or "c:" -->
    <wls:virtual-directory-mapping>
        <!-- wls:local-path>c:/</wls:local-path -->
        <wls:local-path>/</wls:local-path>
        <wls:url-pattern>/tmp/*</wls:url-pattern>
    </wls:virtual-directory-mapping>
   
   
    <wls:jsp-descriptor>
      <wls:page-check-seconds>0</wls:page-check-seconds>
    </wls:jsp-descriptor>
    <wls:container-descriptor>
      <wls:servlet-reload-check-secs>0</wls:servlet-reload-check-secs>
      <wls:resource-reload-check-secs>0</wls:resource-reload-check-secs>
    </wls:container-descriptor>

</wls:weblogic-web-app>


07 April 2016

Fowler's ideas

Interesting posts from Martin Fowler, most are his ideas, however there some that is referring to third idea... as usual, it is referenced correctly in his document:

- CQRS
- Event Sourcing
- Parallel Model
- ReportingDatabase
- BlueGreen Deployment
- Canary Release


...

16 March 2016

Catastrophic Backtracking

RegExp Playground

This repository contains several regexp examples.

Examples

1. Catastrophic Backtracking

This is Java example of backtracking catastrophic shown in Coding Horror post This is a known behavior when using nesting repetition operators, that has been analyzed in stackoverlow, regular expressions dedicated sites.
It can be seen the exponential explosion that take to parse using regexp for a simple pattern:
(x+x+)y+
Details of this issue can be found on the above links.

Execute

mvn clean package
mvn exec:java -Dexec.mainClass="cl.devweb.regexp.exploit.CatastrophicBacktracking"

Rule of Thumb - Solution

The solution is simple. When nesting repetition operators, make absolutely sure that there is only one way to match the same match. If repeating the inner loop 4 times and the outer loop 7 times results in the same overall match as repeating the inner loop 6 times and the outer loop 2 times, you can be sure that the regex engine will try all those combinations.

OUTPUT

 mvn exec:java -Dexec.mainClass="cl.devweb.regexp.exploit.CatastrophicBacktracking"
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building regexp-exploit 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- exec-maven-plugin:1.4.0:java (default-cli) @ regexp-exploit ---
Found value: xxxxxxxxxxxxxy  timer=113.2 μs
Invalid match of 1 chars took 20.97 μs
Invalid match of 2 chars took 14.28 μs
Invalid match of 3 chars took 21.82 μs
Invalid match of 4 chars took 149.2 μs
Invalid match of 5 chars took 26.92 μs
Invalid match of 6 chars took 43.73 μs
Invalid match of 7 chars took 80.80 μs
Invalid match of 8 chars took 135.6 μs
Invalid match of 9 chars took 207.1 μs
Invalid match of 10 chars took 240.6 μs
Invalid match of 11 chars took 442.9 μs
Invalid match of 12 chars took 848.0 μs
Invalid match of 13 chars took 1.623 ms
Invalid match of 14 chars took 2.504 ms
Invalid match of 15 chars took 4.339 ms
Invalid match of 16 chars took 8.163 ms
Invalid match of 17 chars took 16.60 ms
Invalid match of 18 chars took 33.27 ms
Invalid match of 19 chars took 69.98 ms
Invalid match of 20 chars took 138.2 ms
Invalid match of 21 chars took 268.9 ms
Invalid match of 22 chars took 537.9 ms
Invalid match of 23 chars took 977.8 ms
Invalid match of 24 chars took 2.132 s
Invalid match of 25 chars took 4.260 s
Invalid match of 26 chars took 8.433 s
Invalid match of 27 chars took 17.18 s
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.977 s
[INFO] Finished at: 2016-03-16T12:38:59-03:00
[INFO] Final Memory: 9M/245M
[INFO] ------------------------------------------------------------------------
We can see taking a Thread Dump, where is spending (wasting?) most of the time:
"main" #1 prio=5 os_prio=31 tid=0x00007f8f9a006000 nid=0x1303 runnable [0x000000010a718000]
   java.lang.Thread.State: RUNNABLE
    at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
    at java.util.regex.Pattern$Loop.match(Pattern.java:4785)
    at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4272)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4272)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
    at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
    at java.util.regex.Pattern$Loop.match(Pattern.java:4785)
    at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4272)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4272)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
    at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
    at java.util.regex.Pattern$Loop.match(Pattern.java:4785)
    at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4272)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4272)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
    at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
    at java.util.regex.Pattern$Loop.match(Pattern.java:4785)
    at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4272)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4272)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
    at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
    at java.util.regex.Pattern$Loop.match(Pattern.java:4785)
    at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4272)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4272)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
    at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
    at java.util.regex.Pattern$Loop.match(Pattern.java:4785)
    at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4272)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4272)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
    at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
    at java.util.regex.Pattern$Loop.match(Pattern.java:4785)
    at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4272)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4272)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
    at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
    at java.util.regex.Pattern$Loop.matchInit(Pattern.java:4801)
    at java.util.regex.Pattern$Prolog.match(Pattern.java:4741)
    at java.util.regex.Pattern$Start.match(Pattern.java:3461)
    at java.util.regex.Matcher.search(Matcher.java:1248)
    at java.util.regex.Matcher.find(Matcher.java:637)
    at cl.devweb.regexp.exploit.CatastrophicBacktracking.main(CatastrophicBacktracking.java:81)

TODO

  • add more examples :)

License

MIT . .

15 March 2016

Maven Cheat Sheet

Some reminder for Maven:

1. Use a different settings.xml
mvn --settings ~/.m2/YourOwnSettings.xml clean install
or
mvn -s ~/.m2/YourOwnSettings.xml clean install

2. Jboss tasks:
 mvn jboss-as:deploy
 mvn jboss-as:redeploy
 mvn jboss-as:undeploy

3. Eclipse Maven clean:
(retired)
mvn eclipse:eclipse
mvn eclipse:clean
mvn install

4. set java version:
<project>
 [...]
 <build>
 [...]
 <plugins>
 <plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-compiler-plugin</artifactId>
 <version>3.5.1</version>
 <configuration>
 <source>1.4</source>
 <target>1.4</target>
 </configuration>
 </plugin>
 </plugins>
 [...]
 </build>
 [...]
</project>

5. Missing Maven dependencies in Eclipse Project

   workaround to have an eclipse maven project

6. basic maven structure

src/main/java

 - src 
    - main 
          - java 
          - resources 
          - webapp 
     - test 
          - java 
          - resources 
          - target

7. packaging:

<packaging>jar</packaging>

8. executing from maven:

add the following plugin to pom.xml:
<plugin>
 <groupId>org.codehaus.mojo</groupId>
 <artifactId>exec-maven-plugin</artifactId>
 <version>1.2.1</version>
 <configuration>
 <mainClass>com.myorganisationname.common.App</mainClass>
 </configuration>
 </plugin>

and run it with:


mvn exec:java

9. skipping test:


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
      or
 
 mvn install -DskipTests
 

 
10. Multiple Module Projects
<packaging>pom</packaging>


<modules>
<module>guide-ide-eclipse-site</module>
<module>guide-ide-eclipse-core</module>
<module>guide-ide-eclipse-module1</module>
</modules>


Add the parent to the POMs of the new modules:
 <parent>
 <groupId>guide.ide.eclipse</groupId>
 <artifactId>guide-ide-eclipse</artifactId>
 <version>1.0-SNAPSHOT</version>
 </parent>


mvn install
mvn eclipse:eclipse

http://maven.apache.org/plugins/maven-eclipse-plugin/reactor.html


11. web archetype

mvn archetype:generate -DgroupId=cl.devweb -DartifactId=wls_log_retrieval -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

12. copy dependencies:

 mvn dependency:copy-dependencies -DoutputDirectory=OUTPUT_DIR
 
13. tomcat

mvn tomcat7:deploy
mvn tomcat7:undeploy
mvn tomcat7:redeploy

14. verbose class

mvn test -DjvmArgs="-verbose:class"

15. web.xml-less
(servlet 3.0+)

<plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-war-plugin</artifactId>
 <version>2.6</version>
 <configuration>
  <failOnMissingWebXml>false</failOnMissingWebXml>
 </configuration>
</plugin> 
 
 
16. weblogic
 
mvn com.oracle.weblogic:weblogic-maven-plugin:deploy

mvn com.oracle.weblogic:weblogic-maven-plugin:undeploy


            <plugin>
                <groupId>com.oracle.weblogic</groupId>
                <artifactId>weblogic-maven-plugin</artifactId>
                <version>12.1.3-0-0</version>
                <configuration>
                    <adminurl>t3://127.0.0.1:7001</adminurl>
                    <user>weblogic</user>
                    <password>welcome1</password>
                    <upload>true</upload>
                    <action>deploy</action>
                    <remote>true</remote>
                    <verbose>true</verbose>
                    <source>target/${project.artifactId}.${project.packaging}</source>
                    <name>${project.artifactId}</name>
                    <targets>AdminServer</targets>
                </configuration>
            </plugin>
 
17. debug flag

mvn -X
or

mvn -e


18. update (when it does not find jar)

mvn -U package

19. dependencies

mvn dependency:tree
     -Dverbose
 

08 March 2016

Logging of class loading and unloading.

There are several useful system properties for JVM that are not very popular.

One of those is:

-verbose:class

This helps to printout all the jar files that are being used when running classes.

i.e.:
 [Opened /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/rt.jar]
[Loaded java.lang.Object from /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/rt.jar]
[Loaded java.io.Serializable from /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/rt.jar]
[Loaded java.lang.Comparable from /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/rt.jar]
[Loaded java.lang.CharSequence from /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/rt.jar]
[Loaded java.lang.String from /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/rt.jar]
[Loaded java.lang.reflect.AnnotatedElement from /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/rt.jar]
[Loaded java.lang.reflect.GenericDeclaration from /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/rt.jar]
Another approach is to printout in the code itself using ClassLoader (but this is more intrusive).

  ClassLoader cl = ClassLoader.getSystemClassLoader();

  URL[] urls = ((URLClassLoader)cl).getURLs();

  for(URL url: urls){
     System.out.println(url.getFile());
  }
 
 

02 March 2016

Sherlock Holmes Quotes

Interesting quotes from Sherlock Holmes:

From movie Mr. Holmes (2015)

I haven't a clue.
One can't solve everything.

 
From book A Scandal in Bohemia
It is a capital mistake to theorize before one has data

01 March 2016

TeX file to PDF

We have two easy ways to achieve this

1. Go to a longer (but safer) path:

tex --> dvi --> ps --> pdf

By using:

tex example.tex
dvips example.dvi
ps2pdf example.ps

2. or using a straightforward tool:


pdftex example.tex


In both scenarios you'll get a PDF file.

Give it a try with several TeX files at Knuth's

29 February 2016

The Scrum Field Guide

I have won a free book from coderanch. After asking a politic question, I am going to receive it.
Interesting book, and even more interesting was the thread I had with the author (Mitch).

UPDATE1 (30.03.2016) I received the book

http://www.coderanch.com/t/662440/Agile/Scrum-Field-Guide-scope

http://www.coderanch.com/t/662632/Agile/Winners-Scrum-Field-Guide

Image from http://ecx.images-amazon.com

 

27 February 2016

Erase una vez...

Mandarinas y naranjas para las monjas de la granja, pan con queso para el diablo leso, esterines y esterones para los diablos orejones...

25 February 2016

Missing Maven dependencies in Eclipse Project

I have faced a couple of times this issue. There is a workaround that sometimes works, however it is not always true.

modify .classpath xml file, adding the following tag:
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
 <attributes>
 <attribute name="maven.pomderived" value="true"/>
 <attribute name="org.eclipse.jst.component.nondependency" value=""/>
 </attributes>
</classpathentry>

Several tips & tricks appear at: http://stackoverflow.com/questions/4262186/missing-maven-dependencies-in-eclipse-project

UPDATE1: another usual mistake is not to have the maven directory structure:

src/main/java

12 January 2016

JDK8: self-closing element not allowed

JDK8 has issues with HTML tags in javadoc :

<br /> and <p />
[ERROR] Exit code: 1 - /Users/devwebcl/development/workspace-java/ehcache-jcache/ehcache-jcache/src/main/java/org/ehcache/jcache/JCacheCachingProvider.java:39: error: self-closing element not allowed

38:  * A JSR107 adapter for EHCache.
39:  * <br />

More details at:

http://stackoverflow.com/questions/26049329/javadoc-in-jdk-8-invalid-self-closing-element-not-allowed


This workaorund can be applied to Maven as well (pom.xml):

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <configuration>
                <additionalparam>-Xdoclint:none</additionalparam>
              </configuration>
            </plugin>

        </plugins>
           


       


11 January 2016

Biblioteca Knuth





Vol 1,2,3 (boxed) 1997
Vol 2 2nd edition
Vol 4 Combinatorial Algorithms, Part 1, 1st printing, January 2011

TAOCP vol4, generating all tuples and permutations
first printing, February 2005





1993




1996




2010





2011





2011




15th printing. 

+ Números Surreales

1979



05 January 2016

Celebration of Mind: Selected Papers on Fun and Games: Martin Gardner

Don Knuth's Selected Papers on Fun and Games

From 2014 Celebration of Mind:


Video:
http://www.msri.org/general_events/20854

here the video can be downloaded in mp4 format.


1.
Martin Gardner tribute, a very

"that's just a coincidence"



2.
Dr. Matrix Names
Numerology of Dr. Matrix by Martin Gardner,


- first print: 1968
Matrix, Irving J.

- second print
Matrix, Irving Joshua

666 in Name of Dr. Matrix

https://en.wikipedia.org/wiki/Irving_Joshua_Matrix





My Blog List

Blog Archive

There was an error in this gadget

Disclaimer

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