stubby4j – Java-based HTTP stub server

I released a Java-based HTTP stub server. We are actually using it on our current project. Give it a go, perhaps it can help you too. In brief, why would you use a stub HTTP server?

You want to simulate responses from real server and don’t care (or cannot) to go over the network
You want to verify that your code makes HTTP requests with all the required parameters and/or headers
You want to verify that your code correctly handles HTTP error codes
You want to trigger response from the server based on the request parameters over HTTP or HTTPS
You want support for any of the available HTTP methods
You want to trigger multiple responses based on multiple requests on the same URI
You want to easily configure stub data using configuration file
You want to easily configure stub data at runtime, without restarting the server by making a POST to an exposed endpoint
You want to [...] Continue Reading…

LaTeX – Fonts with Ligatures

Spent some time yesterday playing with LaTeX again, and to be more specific – with fonts in LaTeX. I created a resume template by applying XeLaTeX type setting. The latter allows me easily to load system fonts (both OTF and TTF) in .TEX files.

It is very similiar to CSS – XeLaTeX allows you to load system fonts simply by calling font’s name in your commands. Have a look at the following example: I declared a new command HoeflerFont which uses one of my system fonts by its name: Hoefler Text

\newcommand{\HoeflerFont}[1]{\fontspec[Alternate=1,Ligatures={TeX,Common,NoCommon, Rare}]{Hoefler Text}\selectfont #1}

I used several different fonts for my resume with ligatures enabled. Ligatures are curly little letter tails that make text style look somewhat medieval. From Wikipedia:
In writing and typography, a ligature occurs where two or more graphemes are joined as a single glyph. Ligatures usually replace consecutive characters sharing common components and are part of a more [...] Continue Reading…

Measure amount of WTFs per package or project

I created a library that measures amount of WTFs per package or project. This library is a by-product that derived from what I was doing few days ago:

I was dabbling with Java and decided to take a break. I came across a well know image that depicts code review session behind closed doors. The image called “The only valid measurement of code quality: WTF/minute”. I decided to make an extension to the latter concept.

This library brings you the ability to mark code smells in your source code (Classes, methods, fields etc.) with ‘WTF’ annotation. The WTF annotation accepts an arbitary message, if none provided, the default message ‘Dude.. WTF?!’ is used instead. When source compiles, the compiler generates a warning using the message from the detected annotation(s) and information about annotated element. The following is a sample output from compiling a class containing WTF annotations:
Warning: : In CLASS [wtf.per.project.model.DummyPojoImpl] [...] Continue Reading…

Unfamiliarity Causes Rejection

Recently I listened to a talk given by an ex-ThoughtWorker, Simon Harris. One of the things that Simon talked about was how we, developers (and generally speaking – human beings) sometimes tend to reject what is unfamiliar to us. Within software development context it can be an existing/legacy application or a module that we need to extend, and which is difficult to understand.

Really, how many times we looked at someone else’s work (eg:. a developer that has left the company a long time ago) and thought “Dude, this is so weak … come one”?

Instead of just pointing fingers, maybe we should stop for a moment, try to think and understand, what were the reasons for producing that mediocre piece of code? Look at the current software’s state from a different angle. Sure, sometimes a poorly written software is simply just that – a poorly written software without a particular [...] Continue Reading…

LateX – Transparent Watermark Image

If you want to add a watermark image to your LaTeX document, you can achieve it easily using three packages: graphicx, tikz and eso-pic:

Graphicx package allows to load images into documents. If you want to add transparency to your image, you need also to use tikz package. Tikz is used for producing vector graphics from a geometric/algebraic description, but is also allows to play with opacity levels.

Eso-pic package provides hooks to inserts the images on one or more pages as a background (in other words – a watermark).

\\usepackage{graphicx}
\\usepackage{tikz}
\\usepackage{eso-pic}

\\newcommand\\BackgroundPicA{\\put(270,440){{%
\\begin{tikzpicture}\\node[opacity=0.1]{%
\\includegraphics[scale=0.80]{letter-watermark.jpg}};%
\\end{tikzpicture}%
}}}

\\newcommand\\BackgroundPicB{\\put(-80,-40){{\\reflectbox{%
\\begin{tikzpicture}%
\\node[opacity=0.1]{%
\\includegraphics[scale=0.80]{letter-watermark.jpg}};%
\\end{tikzpicture}%
}}}}

\\makeatletter%
\\AddToShipoutPicture{\\BackgroundPicA}%
\\AddToShipoutPicture{\\BackgroundPicB}%
\\makeatother

\\begin{document}
.
.
\\newpage
.
.
\\end{document}

I have attached a final result as PDF, so you can see the output: PDF with semi-opaqued watermark.

LateX – Style Section Title With a Color Filled Box

I was playing with LaTeX in order to create a resume template for my self. I was looking for a way to style title generated by the \section command. My goal was to generate color filled box with some text inside and some padding.

This is what I have came up with:

\\definecolor{gray}{RGB}{186,186,186}
\\section{\\fcolorbox{black}{gray}{\\color{black}%
{\\parbox{6.5in}{\\vspace{.03in}\\hspace{.03in}\\LaTe X{ is really cool}\\vspace{.03in}}}}}

Which produced the following result:

I Have Joined the ThoughtWorks Camp

I have some good news: I am going to be a ThoughtWorker. After two or three weeks of interviews, I have recently accepted their offer and going to start with the company in August.

I am really looking forward to it, since many bright, passionate and talented people work for ThoughtWorks. The company is known for its cutting-edge technology development and being one of the global leaders in enterprise Agile development services. In other words, I am really happy :)

I will keep writing updates from time to time about my experience at ThoughtWorks. Stay tuned.