10 January 2014

Regular Expressions Cookbook: Errata

Nuevo errata encontrado, ahora es uno matemático de una fórmula mal escrita... me imagino que el autor sabia que poner, pero se tuvo que traspapelar la fórmula.

http://www.oreilly.com/catalog/errataunconfirmed.csp?isbn=0636920023630

Footnote 2:

If there are n characters between the double quote and the end of the string, the regex engine will try 2 1/n permutations of ‹ (?:[^"\r\n]+|"")* ›

----

it appears: 2^(1/n)
(this trends to 1, when n grows)

however, it must say 2^(n-1)
when n=4 the number of permutations is 8.
(thus, it has an exponential behaviour).

30 December 2013

The method assumeFalse(String, boolean) is undefined for the type Assume

When trying to compile ant project I got the next error message:

The method assumeFalse(String, boolean) is undefined for the type Assume

Well, this is because I was using junit 4.8.2 and that method's signature is available in 4.11
(maybe an earlier version).

Anyway, the good practice is to download the libraries with fetch.xml.

Regular Expressions Cookbook, 2nd Edition by By Jan Goyvaerts, Steven Levithan


Regular Expressions Cookbook, 2nd Edition
Detailed Solutions in Eight Programming Languages
By Jan Goyvaerts, Steven Levithan
http://shop.oreilly.com/product/0636920023630.do
 


It starts with a good analysis of online and offline regexp tools. Most known applications that can be found in the net, but doing a emphasis to his proprietary tool regexbuddy.

As a classical O’reilly cookbook splits knowledge in contextual sections. Question & Answer, without hesitation, several solution sometimes quick and dirty, but afterward a complete background and more elegant explanation of the consequences of using such approach, providing a better (maybe the best) solution.

The focus of this book is to provide several recipes, direct solution and not an introductory lexical compiler learning book. It gives solutions with many constraint for different flavors of regexp engines, such us, .NET, Java, JavaScript, PCRE, Perl, Python, Ruby.

This cookbook provides a basic introductory chapter, then later chapters becomes more explicit for common programmatic expressions (very wide scope), that most coders would need sometime in their projects, for instance, URLs, Comments, Numbers, Dates (arghhh), XML, CSV, among others.

27 December 2013

Knuth Checks Again ?

It seems that Prof. Knuth is sending again reward checks for typo/errors/solutions for his books.

Surprisingly, I have received one on December 2013.
 
* This time was a simple Spanish acute accent



22 November 2013

Pi within Pi

The string 31415926 occurs at position 50,366,472. This string occurs 3 times in the first 200M digits of Pi.
counting from the first digit after the decimal point. The 3. is not counted.

This reports is obtained from http://www.angio.net/pi/ , in interesting page where you can search Strings inside of Pi.

13 November 2013

Java Network Programming by Elliotte Rusty Harold; O'Reilly Media

Java Network Programming, 4th Edition
Developing Networked Applications
By Elliotte Rusty Harold
http://shop.oreilly.com/product/0636920028420.do

Wisely divided in 13 main parts, reviewing transversely all the network API (and more).
Starting from basic network concepts, including information about NIO, Asynchronous Channels, Socket Options (Java 7), until IP Multicasting. Author mentions that Java Network API is stable since version 1.0 and we shouldn't have any issue after Java 8 is released, anyway as we know, always these future assumptions must be taken carefully about any migration.

Being the 4th edition, it is certainly a proved book, with mature information about the network scope.

Very detailed information on its coding examples, regarding the interfaces, constructors, direct/undirected classes, event handlers, exception handling, and their respective methods.
At the end, explain how this complex API can be used in the expected/correct fashion.

Similar to the new (2nd) edition of Java Web Services book, there is an emphasis on the current de-facto REST standard.

Kind of bible, reference and cookbook of network Java, responding all the most common doubts (and some very peculiar).
for the beginner and advanced developer, well redacted.

Although there are a lot of snippet code in the book, the complete examples can be downloaded from author's website.

10 November 2013

Companion to the Papers of Donald Knuth, Errata

I just bought Companion to the Papers of Donald Knuth and it is a nice book, as usual with many information of high quality of Dr Knuth.

This time I have found simple Spanish cute accent typos, I have received another 0x$1.00 and my simple contribution to these fabulous series book.

My current balance is: 0x$3.40
(Plus the checks)

31 October 2013

Knuth Solved Puzzle

A pesar que yo no lo calcule ;P

Knuth habia puesto un puzzle en su segundo libro (mensaje encriptado con esquema RSA) de tal manera que fuese encontrado cuando ya no viviese (por lo caro del calculo), pero fue encontrado con metodos de


Por lo mismo un nuevo mensaje fue hecho:
http://www-cs-faculty.stanford.edu/~knuth/news12.html
Detalles del equipo NFS@Home project y Greg quienes encontraron el mensaje puede ser encontrado en:
http://escatter11.fullerton.edu/nfs/forum_thread.php?id=374
http://escatter11.fullerton.edu/nfs/forum_thread.php?id=373

The composite cofactor of the RSA public key factored into 91-digit and 97-digit prime numbers. With these factors, we are able to decrypt the RSA-encrypted literary quote. What quote did Donald Knuth hide so well?
91-digit prime factor:
4812118250596034474977589134243684231351843343856605196610181688401638676082217744120094291

97-digit prime factor:
1414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641

With these and the previously known 25-digit prime factor, 1144729885849400174143427, we are able to decrypt the RSA-encrypted literary quote. The quote is the following:
His remarks (as reported) were as follows:--

"O Rowty-owty tiddly-owty
Tiddly-owty tiddly-owty
Highty-ighty tiddly-ighty
Tiddly-ighty ow."


--G. K. Chesterton (1905)

This is from The Tremendous Adventures of Major Brown, the first in the collection of short stories The Club of Queer Trades.

Todo un logro !!!!
Felicitaciones al equipo.

25 September 2013

Fibonacci BigInteger

Leyendo los typos del Libro de Java Web Services: Up & Running primera edicion, usa de ejemplo a los números de Fibonacci:
"How many ways can this person traverse, say, a 100 meters? The answer is fib(100): 3,314,859,971." The 100th fibonacci number is 354224848179261915075. The is way over what a JAVA primary int can hold though. BigInteger can be used to calculate this bigger integer however.

Cual es muy usado en la enseñanza de programación de primeros cursos de universidad y también en series aritméticas.

El problema que el autor no calculo el crecimiento explosivo de tal serie y uso Integer de 32bit para el cálculo cometiendo un error en el numero de Fib(100).


16 September 2013

Java Web Services: Up and Running by Scott Berkun; O'Reilly Media


Java Web Services: Up and Running by Scott Berkun; O'Reilly Media
http://shop.oreilly.com/product/0636920029571.do

2nd edition: RESTful context and more:
 
It has been recently released The second edition of Java Web Services: Up & Running, this means full new content (almost a trend in O'reilly Java titles), and not only an update of bugs and reader's comments.

This new edition focuses in the (not new, but fashion) RESTful services. Today, it is clear the current trend is to use less restrictive REST services and lightweight JSON. Keeping most chapters under this context, it get along with examples and info about WADL, Security JSON, etc.

Also, mentions different implementation Jersey, CXF, among others, so it reach a wider crowd for any doubts and details on these implementations. While in the client side has references to JAXB, Amazon, XStream, Axis.

SOAP Handler, using JAX-WS handlers, shows examples in how an incoming/outcoming SOAP message can be handled to implement business logic in the middle of the conversation; very useful for some security constraint inside of a typical workflow.

Last, but not Least, Security, another important tier on WS, it is covered with simple JAAS and SSL (or better said HTTPS), WS-Security.

Interesting is to mention several (perhaps most important) Java Application Servers, because most examples are using Tomcat, however take time and space to describe tips on
Source code, which is available to be downloaded from Git directly.

At the end, similar to the first edition, a not-so deep introduction the current de facto spec for webservices, giving a compass a quick answer about it.

Small and easy to read, not a cookbook, although several examples could be considered recipes.

Blog Archive

Disclaimer

Qux