Uncategorized – Bar54 http://www.bar54.de Software Engineering, Web Technologies, eCommerce and some more Sat, 04 Jan 2020 19:37:16 +0000 en-US hourly 1 https://wordpress.org/?v=5.9.4 Tools for Hacking your Everyday Digital Life http://www.bar54.de/2016/03/tools-for-hacking-your-everyday-digital-life/ Thu, 31 Mar 2016 16:34:09 +0000 http://www.bar54.de/?p=778 Ok, this collection is definitely tech-biased and when mentioning “digital life” it does not mean reading an ebook but getting in touch with the technology in the background.
Disclaimer: There is no claim for completeness, independent assessment, or anything else. It’s just a collection of tools that I found useful sometime.

smtp4dev

http://smtp4dev.codeplex.com/
https://github.com/rnwood/smtp4dev
A very useful small tool for windows simulating an SMTP server on localhost. If your application sends an email to a localhost hosted port 25 SMTP server, this email is received and can be viewed or saved. The tool runs in the tray and can be opened to see the emails send.

fakeSMTP

http://nilhcem.com/FakeSMTP/index.html
I faced issues on some Windows 10 machines with running .NET Framework 3.5 which is required by smtp4dev. Since then I switched to fakeSMTP as an easy to alternative written in Java.

Fiddler Web Debugger

http://www.telerik.com/fiddler
A very useful tool for sending web requests and debug what’s going on. For example, to test REST APIs as done in this video introducing the Elastic Search REST API: https://www.youtube.com/watch?v=60UsHHsKyN4

WinMerge

You need to merge text files or just compare their content and don’t want to rely on GNU Diff? Go and give it a try: http://winmerge.org/

Notepad++

A very powerful text editor with a plugin system, language support, and column-based editing. Did you use the CrimsonEditor in the past? You will love Notepad++: https://notepad-plus-plus.org/

HeidiSQL

A free and lightweight SQL client supporting many different SQL databases: http://www.heidisql.com/

WinRAR

A recommendation for handling a wide range of archives from tar balls to zips: http://www.winrar.de/

Windows Image Resizer

If you need to resize images, it’s just one right click (and another left one 😉 ) away with this nice little tool: http://www.bricelam.net/ImageResizer/

GoW GNU on Windows

As I am used to live in both worlds (windows and *nix), I like to have handy *nix command line tools on windows as well. While Cygwin etc. comes with a big overhead, this set of precompiled *nix tools for windows is pretty useful and lightweight to install on your windows machine.  https://github.com/bmatzelle/gow

GnuWin32

Gnu tools such as wget or diff for the windows command line. I preffer to use the GoW set, but these tools are a reasonable alternative as well:  http://gnuwin32.sourceforge.net/packages.html

FileZilla

A probably well known open source (S)FTP client: https://filezilla-project.org/

Eclipse Plugins

Eclipse is not the latest (and maybe not hippest ?) platform and development environment, but it is powerful and even Microsoft recognized this and started investing in it.

EasyShell

Simple and straight forward context menu to open files and folders in a shell or system file explorer: https://marketplace.eclipse.org/content/easyshell

Plugin Homepage: https://github.com/anb0s/EasyShell

]]>
JQuery Mobile: Change Color of SVG Icons http://www.bar54.de/2014/02/jquery-mobile-change-color-of-svg-icons/ Sun, 16 Feb 2014 13:11:45 +0000 http://www.bar54.de/?p=653 Since version 1.4, JQuery Mobile provides an SVG-based icon set for high-quality scalable icons.
Out-of-the-box, the icons are provided in two different color schemes: default (white) and alt-icon (black).

To give your user interface an individual style, you might want to change the color to something more specific such as green, black or a specific rgb color.
Using CSS to change the font color of your button or link containing the icon will not work, as the jQuery Mobile svg icons are realized as background images.

The solution to change the icons color, is to modify the svg image realizing the icon itself.
To do so, open jquery mobiles stylesheet (e.g. “jquery.mobile.inline-svg-1.4.1.min.css”) and find the definition of the icon you would like to change (e.g. .ui-icon-delete:after)
The styles are always defined as “.ui-icon-:after”. The icon style definitions contain background images with the SVG images encoded in a data url.

To change the color, you do not need to understand the full encoded svg data url. You just need to know that shapes in an SVG are defined by polygones. In the example below, search for the string “polygon%20fill%3D%22%23FFF”:

.ui-icon-delete:after{
background-image:url("data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2214%2C3%2011%2C0%207%2C4%203%2C0%200%2C3%204%2C7%200%2C11%203%2C14%207%2C10%2011%2C14%2014%2C11%2010%2C7%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E")
}

polygon%20fill%3D%22%23FFF“ stands for a polygon filled with the color white (FFF).

So to define your custom icon with a different color, copy the style definition into your own css stylesheet file and replace “FFF” with your prefered hex color definition.
Note: You should not modify the original jquery mobile file. Otherwise your modifications could be overridden with the next update.

]]>
WordPress Antispam Bee – “Spam Reason: CSS Hack” on all comments http://www.bar54.de/2014/01/wordpress-antispam-bee-spam-reason-css-hack-on-all-comments/ Thu, 16 Jan 2014 08:31:28 +0000 http://www.bar54.de/blog/?p=558 The wordpress Antispam Bee is one of the most popular WordPress plugins to prevent detect and prevent spam postet as blog comments.
One of it’s detection strategies is to embbed a css-based hidden form field. While human users do not see and thus not fill out this field, bots often do. So if Antispam Bee recognizes this field to be submitted with content, the comment is marked as spam.

Unfortunately, many wordpress administrators report that all their comments are marked as spam. All with the spam reason: “Spam Reason: CSS Hack”.
The reason for that is that several plugins and wordpress themes get into conflict with this anti spam techniques. If you do not want or can fix this issue in the code of the extension or theme, the best opportunity is to simply deactivate the extension or switch the theme.

To start digging for the “Spam Reason: CSS Hack” problem’s origin: Start deactivate one extension or theme after the other, send a comment by yourself and check if it was categorized as spam or not.
For me, the plugin “Conditional CAPTCHA for WordPress” was the reason of the problem. Others reported for example the plugin “izioSEO” to conflict with the spam bee.

By the way, you might want to turn off the local spam database check. This might have been messed up if there were a lot of false negative spam detection before.

]]>
Backbone.js Version 1.0.0 to Version 1.1.0 http://www.bar54.de/2013/10/backbone-js-version-1-0-0-to-version-1-1-0/ http://www.bar54.de/2013/10/backbone-js-version-1-0-0-to-version-1-1-0/#respond Sun, 20 Oct 2013 18:58:05 +0000 http://www.bar54.de/blog/?p=505 The Backbone.js project has published a new minor release of its framework.

View Options
A minor change done is the options registration in Views.
In version 1.0.0 one could create a view with some parameters such as the following example:

new MyView({collection: entries,  viewContainer: $('#entries-container'), param1 : param2});

In the view, you could directly access the parameters directly in the render method:

render: function() {
  var container = this.options.viewContainer;
  var param1 = this.options.param1;
}

In version 1.1.0, the options array is no longer registered in the view by default. To still use the render method as it is shown above, you need to register the options array by yourself during initialization:

initialize: function(options) {
  this.options = options;
}

Afterwards, you can use the code of your render method as you have been used to.

]]>
http://www.bar54.de/2013/10/backbone-js-version-1-0-0-to-version-1-1-0/feed/ 0
Logging in Eclipse Plugins with JUnit Support http://www.bar54.de/2012/08/logging-in-eclipse-plugins-with-junit-support/ http://www.bar54.de/2012/08/logging-in-eclipse-plugins-with-junit-support/#respond Fri, 10 Aug 2012 20:08:28 +0000 http://www.bar54.de/blog/?p=260 Logging can be used for a lot of different of use cases, ranging from debug messages during development upto application monitoring in production.

In the past, log4j was set as a de facto standard, slf4j and the java internal java.util.logging have been developed.
So which should one use? It depends…
While java.util.logging is build into the sdk and one can use it without setting up a logging environment, it provides only limitted flexibility compared to log4j and slfj.
There is a good blog post about which logging to be used also providing a small decision tree on page 2 about how to decide between java.util.logging and log4j: http://java.sys-con.com/node/48541. In this article Joe McNamara discusses logging in general.

But what about the development of eclipse plugins? Especially if you have code, which is executed by JUnit tests – not JUnit Plugin tests! – and by running eclipse plugin instances? In this article I describe how to setup your infrastructure to use a flexible log4j and to get logging output also during your junit test runs.

Why to use not only JUnit Plugin tests? It’s a simple matter of development performance. A plugin development test needs to startup an eclipse instance which takes a lot of time and one will tend to run his tests less often because they need to much time. Same applies to your continous integration builds.

First of all, you should install log4j in your eclipse. It is provided encapsulated as a plugin by the eclipse orbit project:
You can just use your Help->Install new software and add the latest orbit update site such as https://www.geneca.com/software-consulting/ in a world where 70% of software projects still fail, who can you trust? As we all know, trust is earned, not given. The best way to earn trust is through a solid track record. However, that doesn’t help you when you are starting out with a new partner.

Afterwards, add a dependency to the org.apache.log4j plugin in your own plugin.xml.

Now you can use log4j loggers in your classes usual:
import org.apache.log4j.Logger;
...
public class MyClass {
private Logger logger = Logger.getLogger(MyClass .class);
...
public void method(){
logger.debug("ping");
}
}

But now, when you run this code within a unit test your woll endup with a message as this one:
log4j:WARN No appenders could be found for logger (org.splevo.diffing.MatchEngineDiffingService).
log4j:WARN Please initialize the log4j system properly.

So how to prevent it?
The simple answer is, you need to initialize a logging environment.
For your production environment, you normally setup a logging environment configured with a properties or xml file, or event configurable during runtime. But you might not want to have such a complexity for simple logging output in your test environment. Remember, your unit tests should run as fast as possible without any big configuration file loading overhead etc.
So what you can do is, to make use of the log4j BasicConfigurator which is able to initialize a default logging environment for your: .
The best way, to do this is within the setup method of your testcase instance. For example using the code below (JUnit 4):

/**
* Prepare the test.
* Initializes a log4j logging environment.
*/
@Before
public void setUp() {
// set up a basic logging configuration for the test environment
BasicConfigurator.resetConfiguration();
BasicConfigurator.configure();
}

Note: You should call resetConfiguration() first. Otherwise a new Appender will be registered for each unit test which is executed and you will end up with all log messages presented multiple times (once per appender/test case startup).

If you want to use a more reduced logging output, you could for example provide a ConsoleAppender with a SimpleLayout to the BasicConfigurator:
/**
* Prepare the test.
* Initializes a log4j logging environment.
*/
@Before
public void setUp() {
// set up a basic logging configuration for the test environment
BasicConfigurator.resetConfiguration();
BasicConfigurator.configure(new ConsoleAppender(new SimpleLayout()));
}

Or if you want to have a really minimal logging output similar as if you would just call System.out.println() in your code, you can use a PatternLayout with a %m%n configuration for just the message and a line break:
/**
* Prepare the test.
* Initializes a log4j logging environment.
*/
@Before
public void setUp() {
// set up a basic logging configuration for the test environment
BasicConfigurator.resetConfiguration();
BasicConfigurator.configure(new ConsoleAppender(new PatternLayout("%m%n")));
}

]]>
http://www.bar54.de/2012/08/logging-in-eclipse-plugins-with-junit-support/feed/ 0
Talks at WCOP 2012 and CompArch 2012 http://www.bar54.de/2012/06/talks-at-wcop-2012-and-comparch-2012/ http://www.bar54.de/2012/06/talks-at-wcop-2012-and-comparch-2012/#respond Tue, 19 Jun 2012 21:33:09 +0000 http://www.bar54.de/blog/?p=246 On monday the 25th, I will give a talk at the 17th international Workshop on Component Oriented Programming (WCOP) in Bertinoro, Italy. The talk is about respecting component architecture in the process of migrating customized product copies into a software product line (SPL). Such a migration process consists of software difference analysis as well as difference refinement analysis which need to consider individual requirements on the resulting SPL. All of these activities can be improved by considering the component architecture of the software.

The paper was assigned with the young investigator award which includes a second, extended presentation at the main CompArch conference on tuesday the 26th. The program of the workshop and the main conference can be found at http://comparch2012.dei.polimi.it/program.php

]]>
http://www.bar54.de/2012/06/talks-at-wcop-2012-and-comparch-2012/feed/ 0
Typo3: Image Magick “There was no result from the ImageMagick operation” http://www.bar54.de/2012/05/typo3-image-magick-there-was-no-result-from-the-imagemagick-operation/ http://www.bar54.de/2012/05/typo3-image-magick-there-was-no-result-from-the-imagemagick-operation/#respond Mon, 28 May 2012 10:04:01 +0000 http://www.bar54.de/blog/?p=239 Since a couple of days I noticed that all Typo3 installations on 1und1 hosting packages did not succeed in processing images.
Checking the image processing in the Typo3 installation tool the tests did not succeed but returning the error message “There was no result from the ImageMagick operation”.

After investigating into the problem it turned out that 1und1 has updated their ImageMagick installation (now it is 6.6.0-4). The new version seems to require more resources which is prohibited by the 1und1 server configuration.

To fix the issue, it is required to limit the resources ImageMagick consumes to process the images.
This can be done by editing your typo3conf/localconf.php
Add the following line at the top of the file (or at least above the line “## INSTALL SCRIPT EDIT POINT TOKEN”)

// setting to enable image magick processing on 1und1 server
putenv('MAGICK_THREAD_LIMIT=1');

Then clean up your configuration cache and your installation should be up and running again.

The following thread led me to the solution:
http://www.typo3.net/forum/beitraege/108097/seite/5/

]]>
http://www.bar54.de/2012/05/typo3-image-magick-there-was-no-result-from-the-imagemagick-operation/feed/ 0
Publication Network Visualisation by Microsoft Academic Research http://www.bar54.de/2011/10/publication-network-visualisation-by-microsoft-academic-research/ http://www.bar54.de/2011/10/publication-network-visualisation-by-microsoft-academic-research/#respond Tue, 25 Oct 2011 13:29:32 +0000 http://www.bar54.de/blog/?p=143 A pretty cool online tool to browse academic publication networks and communities and to see relationships between individual researchers has been provided by Microsoft Academic Resrearch: http://academic.research.microsoft.com/VisualExplorer#3616114

They provide textual search as well as a very advanced visual explorer enabling you to access Co-Author Graphs, Co-Author Paths and Citation Graphs.

Very nice even for just playing around a little bit.

]]>
http://www.bar54.de/2011/10/publication-network-visualisation-by-microsoft-academic-research/feed/ 0
Typo3 Copyright Note with Automatic Year Update http://www.bar54.de/2011/08/typo3-copyright-note-with-automatic-year-update/ http://www.bar54.de/2011/08/typo3-copyright-note-with-automatic-year-update/#respond Sat, 27 Aug 2011 05:45:00 +0000 http://www.bar54.de/blog/?p=100 Most professional websites place a copyright note in the footer of all sites. Placing this in the html is like nothing. Updating this every year often becomes a mess and is forgotton by time or at least is not done when the new year starts.

With Typo3, you can make this dynamic and specify an automatic year printing in your website template. The following typoscript is able to generate a copyright note such as “© Copyright 2011 Bar54” with 2011 dynamically set to the current year.

# Copyright Note
lib.copyright = COA
lib.copyright {
1 = TEXT
1.value = © Copyright 
2 = TEXT
2.data = date:U
2.strftime =%Y
3 = TEXT
3.value =  
4 = TEXT
4.value = Bar54
}

Instead of the hard coded string Bar54 you can also use {$copyrightText} as a place holder which can be filled in the constants of your website as (copryrightText = XYZ).

]]>
http://www.bar54.de/2011/08/typo3-copyright-note-with-automatic-year-update/feed/ 0
IE cut’s off Animated Gifs at the bottom http://www.bar54.de/2011/03/ie-cuts-off-animated-gifs-at-the-bottom/ http://www.bar54.de/2011/03/ie-cuts-off-animated-gifs-at-the-bottom/#respond Fri, 11 Mar 2011 20:34:40 +0000 http://www.bar54.de/blog/?p=53 If the Internet Explorer has to display animated GIFs, it may happen that it cut’s off some pixels from the bottom of the image. To make the confusion even harder, it does not cut off pixels from all animiation frames but only from a some of them.

The same animated GIF might be displayed fine in other browsers such as firefoy, chrome or even opera.

The problem is reasoned by the configuration of handling none active image frames. There is a configuration for each frame of the animated GIF to set, if this should be present in the background or not if it is not active. For example in the animation View of Photoshop, you can choose for each frame seperatly if this frame should be removed or not, or let Photoshop decide this automatically. By default, this is set to not remove inactive frames and Internet Explorer might cut of some pixels from the bottom of the active frame. This leads to some pixels of the inactive frames beeing displayed instead of those of the active frame.

So as a solution, change the setting of all frames, to remove them when they are not active. This will solve your problem very easily.

]]>
http://www.bar54.de/2011/03/ie-cuts-off-animated-gifs-at-the-bottom/feed/ 0