Enable code suggestions for Java in Netbeans 8 on every character entered

In the NetBeans 8 IDE, by default you get automatic code completion suggestions when typing a dot. You can also trigger the completion manually at any time by pressing CTRL + SPACE.

Pressing that key combination all the time can get annoying quickly though. So here is how to get it on every character you enter (or key you press):

First, go to Tools => Options. Then Select Editor in the top bar, and go to the Code Completion tab. You should now see this menu shown below. Make sure to select your language, in my case Java, in the drop down list:

netbeans_code_completion_select_java_here.png

 

Then enable the following two checkboxes named Auto Popup on Typing Any Java Identifier Part and Subword completion:

netbeans_code_completion_activate_both_checkboxes.png

Now you should get auto-completion as visible below:

 

netbeans_code_completion_result.png

That’s it, enjoy!

 

 

Posted in coding, troubleshooting, tools, IT and computers | Tagged , , , , , | Leave a comment

Lettuce tests with Python: make lettuce print to stdout

The lettuce BDD framework swallows the output of your steps if they try to print to stdout, so you will never see the output of the print in a step like this:

 
@step('Cell number (\d+) should (read|contain) "([^"]*)"')
def cell_group1_should_read_or_contain_group2(step, cell_number, read_or_contain, expected_text):
# your test logic here
print "somevar is now=" + some_var
assert_true(step, 15 == some_other_var)

If you need to print the variable during test development, e.g., because it contains the innerHMTL of some complex element, you can force lettuce to print it by abusing an always failing assertion:

@step('Cell number (\d+) should (read|contain) "([^"]*)"')
def cell_group1_should_read_or_contain_group2(step, cell_number, read_or_contain, expected_text):
# your test logic here
assert True == False, "somevar is now=" + some_var
assert_true(step, 15 == some_other_var)

It’s maybe easiest to run lettuce on the command line for this, e.g.,

cd my_app/test/
lettuce features/my_tested_feature_123123.feature

Hope this helps.

Posted in IT and computers, Software Design | Tagged , , | Leave a comment

WordPress mini theme published: customization of twentyseventeen theme for text links in footer menu

I really like the new WordPress default theme called twentyseventeen. I just needed some small customizations for creating professional websites in Germany.

As you may have heard, lots of things are regulated in Germany, and you may want to have named text links for stuff like the imprint and privacy information for a professional website.

My custom child theme twentyseventeen-textfooter allows you to have that instead of the icon links which are usually displayed in the secondary menu (because it is intended as a social media menu).

Here is a preview image (text links in red circle):
preview_twentyseven_child_theme_text_footer_menu.jpg

The changes are trivial, but if you are interested, get the theme at GitHub.

Posted in coding, general, IT and computers, web design | Tagged , , | Leave a comment

Node.js package published

In my new job I am doing front-end coding with React.js, and every Javascript programmer needs to have some package published at npmjs.com I guess. 😉

So here is my first package: js-object-util

It is inspired by the Immutable API but works for plain Javascript objects. You can use it to easily check for and retrieve properties of deeply nested objects. Let’s have a closer look at the usage:

var objectUtil = require('js-object-util');

// some deeply nested example input
const book = {
	publisher: {
		name: "dpunkt",
		address: {
			city: "Heidelberg",
			plz: 69123
		}
	},
	title : "React",
	year: 2015,
	properties: {
		includes_ebook: false,
		whatever: null,
		dunno: undefined
	},
	readers: [
		{
			type: "user",
			name: "Johnny",
			age: 32,
			nickname: null
		},
		{
			type: "user",
			name: "Brad",
			age: 13,
			nickname: "Bratze"
		}
	]
};

// let's go
var keyExists;
keyExists = objectUtil.hasIn(book, ['publisher', 'address', 'city']);	    // true
keyExists = objectUtil.hasIn(book, ['publisher', 'address', 'notthere']);   // false
var value;
value = ObjectUtil.getIn(book, ['year']);		   // 2015
value = objectUtil.getIn(book, ['readers', '1', 'name']);  // Brad
value = objectUtil.getIn(book, ['readers', '1', 'notthere'], 'alternate');  // 'alternate'

This is cool because you don’t have to do these stupid step-wise tests for the existence of certain properties anymore.

I hope you like it. See js-object-util for installation instructions. Unit tests and coverage stats are included, the source code is at github. License is MIT.

Posted in coding, IT and computers, tools | Tagged , , , , | Leave a comment

Fun with processing.js

I started checking out various visualization tools for the web during the last few months. A project which I found very interesting is processing.js. This is a JS port of the processing language, an easy-to-use language to write visualizations or interactive media stuff. It seems it’s mainly used for visual art stuff.

You can see some example processing.js code here:

 

processing_code

 

The page header animation at the processing website inspired me to create a small game, which I called PRace. Here is a screenshot:

prace_web

It’s a 2D side scroller. You are the red guy on the left, and the goal is NOT to crash into the blue guys coming at you from the right — BUT flying close to them gives you points.

The best thing is that you can give the game a try yourself with a modern browser:

http://rcmd.org/projects/prace/

The code can be found at Github: https://github.com/dfsp-spirit/web/tree/master/processingjs/prace

 

Enjoy!

 

Posted in coding, general, IT and computers | Tagged , , , , | 1 Comment

Architecture visualization in the Quake 3 engine

I was recently given a bunch of 2D plans of a large building. They were floor plans for the 5 stories, plotted on paper. I’m pretty good at imagining the 3D object from 2D plans, but in this case, I thought some 3D visualization might be helpful. So for everybody involved in the project, I built the whole thing in the Quake 3 engine on a rainy Sunday afternoon some months ago when I was ill and had nothing better to do.

Here is the front view:

q3_arch_1

Here is the back of the building:

q3_arch_2

And finally, a small section which already has some windows:

 

q3_arch_3

This was a fun project for a day that made some people happy.

Here is a final shot showing the scene in the Quake level editor GtkRadiant:

q3_arch_editor.jpg

 

Posted in general, Level Design | Tagged , , , , | Leave a comment

Talk on Hodgkin lymphoma cell graphs at ISMB 2016

It’s been a while since I went to the Intelligent Systems for Molecular Biology (ISMB) 2016 conference, but I thought I’d still share a few impressions.

IMG_3775.JPG

 

The conference was held at a Disney Resort Hotel near Orlando, FL. Great weather, but not a good place to be as a PhD student who is short on money.

img_3782

I am working on two projects in the fields of digital pathology/imaging and protein topology in my PhD. I submitted a paper we recently published in Bioinformatics to the highlight track and it was accepted, and I was also given a $ 1000 travel grant (thanks to the RNA group at ISCB!). So I went to the conference directly after a returning from a trip to Indonesia.

The conference was well organized and interesting. There were very few contributions from the field of digital pathology, but quite a few interesting talks on structural biology. I especially enjoyed the keynotes by Ruth Nussinov on Ras signaling and by Deborah Marks on Molecular structure and organism fitness from genomic sequences.

img_3789

My highlight talk was at the last day of the conference, but I got some good questions afterwards and also met interesting people at the poster sessions that were held earlier during the conference.

img_3812

If you are interested in the talk, you can find the slides at F1000:

Tim Schäfer, Hendrik Schäfer, Jörg Ackermann, Norbert Dichter, Claudia Döring, Sylvia Hartmann, Martin-Leo Hansmann, and Ina Koch. CD30 cell graphs of Hodgkin lymphoma are not scale-free — an image analysis approach. Highlight talk at Intelligent Systems for Molecular Biology 2016. Orlando, FL, USA

Slide link at F1000: http://www.slideshare.net/TimSchfer4/schaefertp105

This is a highlight talk based on the following publication:

 

Hendrik Schäfer, Tim Schäfer, Jörg Ackermann, Norbert Dichter, Claudia Döring, Sylvia Hartmann, Martin-Leo Hansmann, and Ina Koch. CD30 cell graphs of Hodgkin lymphoma are not scale-free — An image analysis approach. Bioinformatics, 32(1):122–129, 2016. DOI 10.1093/bioinformatics/btv542

Posted in Bioinformatics, general, Science | Tagged , , , , , | Leave a comment