Kristian Kraljić You may compare programming with poetry,
a harmonic script is a piece of creativity which will last forever.
- Kristian Kraljić

InjLog – Another neat Injection Logger for Java 8

by Kristian Kraljic, January 2, 2016

And This Is It my dear visitors! Six days, six posts. This makes a total of four posts in 2015 and already two posts in 2016. Great! I am very happy to have done that, so we have some time to talk about what is going to happen in 2016.

As already said on my post yesterday, I plan on releasing more stuff on this blog. But no false promises, if it is going to take until Christmas again, that’ll be it. But I’ll try my best to release some smaller snippets throughout the year. Other than that, I’m planning on something in the area of home automation, but I’ll get to that as well in one of my future posts. Last but not least, there is still a lot of work to do for my projects at the University of Applied Sciences in Mannheim and at my main workplace. So it’s not going to be boring year at all.

Coming to the last release for this streak of posts. Logging in Java is a neverending story. There are hundrets of logging frameworks out there. Some build in to Java, some smaller or bigger external libraries. What most of them share: one logger is shared for all classes logging data. My requirement was a little different. I had classes wanting to log data, but where and when to log data, should be decided by another class. Therefore I came up with the InjLog Logging Framework for Java. Read the rest of this entry »

» Leave a Comment «

A BetterGlassPane implementation for the JRootPane

by Kristian Kraljic, January 1, 2016

Happy New Year 2016! 2016 is quite a cool year, because it’s 211-25, which is quite neat! One of my New Year’s resolutions for this year is to release more on this blog, so let’s get it going! The marathon continues, but this is the second to last post already.

I’ve implemented a BetterGlassPane to replace the default glass pane of JRootPane objects in Java. In contrast to the default (JPanel) glass pane, this BetterGlassPane handles any mouse events, without interrupting the controls underneath the glass pane (in the content pane of the root pane). Also cursors are handled as if the glass pane was invisible.

Read the rest of this entry »

» Leave a Comment «

Java Characters class

by Kristian Kraljic, December 31, 2015

This is going to be my last post in 2015, as New Year’s Eve quickly approaches. I also have to hurry up a little, as the raclette grill is already heating up. *jummy* ;-)

Time for a little year-end review. This year has again been very successful for me. After finishing my Master’s Degree in Computer Science end of last year, I began working as a research associate at the University of Applied Sciences in Mannheim next to my main job. We made great progress and were able to release the Genetic Code Anylsis Toolkit just recently. Some of the code snippets of the past few days, have been part of the work done for the Genetic Code Analysis Toolkit. Other than that I mainly focussed on my primary workplace, where I was working hard towards a first release of the SAP ONE Support Launchpad. A lot more happened, but as our little marathon soon comes to an end, let’s get to the point of this post.

There are a lot of helper classes in Java. Even in the core libraries you’ll find plenty of them. Classes such as Arrays, or the Collections class dealing with lists, sets and maps. One helper class I was missing out on, is a Characters class!

Read the rest of this entry »

» Leave a Comment «

Generic ArrayComparator for Comparable Java types

by Kristian Kraljic, December 30, 2015

Another day, another post! The marathon continues. After watching “Star Wars: The Force Awakens” yesterday, let’s speak a few words about Open Source. Since I began releasing my projects, most of it has been released on a dedicated website or on this blog. Meanwhile GitHub is the main source for free and open source code, therefore I decided to create an own profile at: https://github.com/kristian (yay! xD)

I think GitHub is a great way to contribute to Open Source and collaborate between individuals. I’m going to release much of my stuff on GitHub, but add a few more words about it here in my blog. Some smaller snippets will stay though, such as one thing, that I was surprised is not part of the Java standard libraries yet: A generic ArrayComparator for Comparable Java types.

Read the rest of this entry »

» 2 Comments «

Simple File Manager Servlet

by Kristian Kraljic, December 29, 2015

The Force Awakens in my blog, … but also in real-life. We are going to watch the new Star Wars movie today, therefore this is going to be quick marathon post today.

Have you ever tried to manage files on a remote server? Kind of tedious, right? Well I’ve written a very small and light-weight Java Servlet handling various common file management tasks, like:

  • Browsing all root partitions
  • Display of files and folders
  • File up- and download (ZIP file support)
  • Recursive file name search
  • Deleting files and setting file flags (+rwx)

Read the rest of this entry »

» 3 Comments «

Java – (Thread Local) Servlet Cookie Filter

by Kristian Kraljic, December 28, 2015

Sadly but true, it seems that I’m keeping my “one post a year”-momentum up… Oh, No… Not Again! I’m going to challenge myself and pull off a little year-end coding marathon! I’m having a lot of helpfull stuff in my quiver. It’s on, I’m going to release *one* post consecutively for the next six days! Including this one, that’ll make four posts in 2015 and already two post in 2016! So… “LET’S DO THIS!”

Let’s start with a thread local servlet cookie filter implementation. Handling user-based cookies on a server-side servlet application really proves difficult in Java. Cookies (at least for all standard protocol handler implementations) are handled by one central CookieHandler object, which can be set and retrieved using the CookieHandler‘s setDefault and getDefault methods. As this cookie handler is used system-wide, each process shares the same cookies for any given URL. For servlets handling cookies, this becomes a problem sooner or later, e.g. if the servlet is dealing with user-specific logins, or similar.

Read the rest of this entry »

» Leave a Comment «

PowerShell and a bridged gap to Java

by Kristian Kraljic, February 3, 2014

Please find me a reason why I have done this? — No, no… I don’t need any excuse, Windows is a great operating system and the PowerShell is an overdue extention to it *cough, cough, the hurts, ahh I’m dying!* — But seriously, due to the system environment at my workplace, I am mainly working with Microsoft Windows and affiliated programs, such as Microsoft Office (Outlook) and Lync. This does not reflect my personal preference, but adaption is key sometimes.

In fact the Windows PowerShell is really not as bad, as the name might suggest it to be (plus, the name is not claimed, yet). The PowerShell is a quite powerfull framework when it comes to task automation and configuration management in an Windows environment. Due to its scripting capabilities and its full access to COM and WMI it is a major leap compared to its "predecessor", the Windows Command Prompt. The concept of cmdlets and especially the object-oriented pipes are a somewhat modern approach of the "old school" executables and text-based pipes. But — and this is a bold-but — is probably a blessing and a curse at once.

Read the rest of this entry »

» 3 Comments «

Cellular Automata Suite / Collection for Java

by Kristian Kraljic, February 17, 2013

Time flies by so quickly and again half a year has passed since my last contribution. I don’t want to search for any explanation right now, but based on Einstein’s laws of special relativity, I just travelled to quickly (a cheer to the warp drive propulsion system)! If you have no clue what I am talking about, I highly recommend watching this great video about Einstein’s Twin Paradoxon. Anyways, quality goes before quantity and therfore I hope you like this post nevertheless.

Read the rest of this entry »

» Leave a Comment «

Game Theory – Minimax / Negamax Algorithm Visualization

by Kristian Kraljic, January 13, 2012

Have you ever tried of solving any two-player game (such as Tic-tac-toe, Chess, Go, etc.), using a computer? I bet you ever wanted to invent the next version of IBMs Deep Blue, the chess computer which was once able to beat one of the greatest chess grandmaster of human history Garry Kasparov!? But as a picture is worth a thousand words (Wikipedia is so great!):

Read the rest of this entry »

» Leave a Comment «