stubby4j – HTTP stub server written in Java with embedded Jetty is now hosted on Maven Central. Check Maven Central for the latest releases.
Cheers
stubby4j – HTTP stub server written in Java with embedded Jetty is now hosted on Maven Central. Check Maven Central for the latest releases.
Cheers
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?
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 general class of glyphs called “contextual forms”, where the specific shape of a letter depends on context such as surrounding letters or proximity to the end of a line.
In order to enable ligatures, the font needs to support them. In other words, not all fonts have ligatures enabled. The following image is a screenshot of my resume using fonts supporting ligatures.

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] :CLASS level => WTF?! Are you for real?! This naming convention is bad!
Warning: : In CLASS [wtf.per.project.model.DummyPojoImpl] : FIELD ‘SOME_CONSTANT’ => WTF?! What is this non-descriptive name?
Warning: : In CLASS [wtf.per.project.model.DummyPojoImpl] : CONSTRUCTOR ‘DummyPojoImpl(java.lang.String)’ => WTF?! Dude.. WTF?!
The library also provides a custom JUnit test runner class. The runner consumes package name, annotation class and search filter through @Grep annotation (used in conjunction with @RunWith). The runner scans .class files under the given package, its sub-packages and JARs for the given annotation (for example WTF.class) occurrences. If String regex pattern provided in @Grep, classes are filtered out from being scanned based on the filter. The runner uses a test class internally to assert whether the code is still infested with WTFs (or any other annotation class set in @Grep).
The analysis of .class files within given package, its sub-packages and any JAR files found is done using reflection. At first I was using third party library called ‘Reflections’ for this task (which is a very good tool btw!), but I ended up not using it anymore. I did not want to have third party dependencies and implemented my own meta data analysis in order to keep the library size small and lean. In the near future, I will extract the metadata analysis logic into a separate library. It should be quite flexible since there different .class file scanners in place. For example, scanner for constructors only or for method parameters, fields only etc.
So, if runner’s test assertion fails (given annotation like @WTF found present in the code), the test class generates metrics about how many WTFs are there and where. These metrics appended to the assertion failure message. For example, the following is the example of the custom JUnit runner:
@RunWith(WTFsPerProject.class) @Grep(packageName = "wtf.per.project.model", classNameFilter = ".*", annotationClass = WTF.class) public final class WTFsPerProjectRunner { }
I have few POJOs marked with WTF annoation, the following is the produced output after running the above runner:
Another example of the custom JUnit runner:
@RunWith(WTFsPerProject.class)
//Grep only inner classes
@Grep(packageName = "wtf.per.project.model",
classNameFilter = ".*[$].*", annotationClass = WTF.class)
public final class WTFsPerProjectRunner { }
DisclaimerI created this library for fun. Nothing more. If someone actually decides to use it – great.
If you want you can fork it on Github
Please report if you experience any problems
What is the difference between continuous deployment and continuous delivery? Please describe in one-two lines
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 reason. But at other times, perhaps there were unknown variables in the equation that prevented developers produce something of a higher quality: technical limitations? Some internal politics? Tight deadlines? Environment?
Understanding the historical/current state of an application, can only help us to come up with better results in the long run. I really enjoyed Simon‘s talk, he clearly draws from his extensive experience.
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).
[xml]
\\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}
[/xml]
I have attached a final result as PDF, so you can see the output: PDF with semi-opaqued watermark.
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:
[java]
\\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}}}}}
[/java]
Which produced the following result:
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.