“People who can code in the world of technology companies are a dime a dozen and get no respect. People who can code in biology, medicine, government, sociology, physics, history, and mathematics are respected and can do amazing things to advance those disciplines.”
An excellent Talk by Robert Martin called “What Killed Smalltalk Could Kill Ruby, Too” that shows why test driven development (TDD) as a concept is so important, not only for Ruby projects but for every software project.
Eine der besten und prägnantesten Übersichten für die UML (Unified Modelling Language) habe ich bei Wikipedia gefunden.
Leider wurde es dort nur im PNG bzw. SVG Format veröffentlicht. Daher habe ich es vom Vektorformat direkt nach PDF konvertiert, das sich am besten von allen Formaten ausdrucken läßt.
Den Finder öffnen, Programme in der linken Seitenleiste auswählen
Skype im Finder auswählen, Rechtsklick, Paketinhalt zeigen
Es öffnet sich ein neues Finder Fenster mit mehreren Verzeichnissen
Das Verzeichnis Resources öffnen und nach einem Verzeichnis mit dem Namen de.lproj suchen. Dieses einfach umbennen oder löschen.
Skype starten
Hintergrund: Applikationen speichern meist ihre Anpassungen an andere Sprachen in eigenen Verzeichnissen. Ein Verzeichnis mit dem Namen de.lproj deutet auf eine deutsche Anpassung hin. Wenn die Applikation diese Sprachdateien nicht mehr findet, nimmt sie die Standardsprachversion, hier also Englisch.
You can think of BTrace as a scriptable debugger or logger: you set breakpoints and when your breakpoints are hit some script gets executed:
It is a dynamic tracing tool for Java.
It instruments classes of a running Java program.
BTrace inserts tracing actions into the classes of a running Java program.
This means you can inject tracing into an already running java program. No changes to the source code of your program are needed. No additional jars need to be loaded by your program.
The scripting is done in Java and no compilation step is needed. See the example below.
Let’s assume we want to get a notification every time a thread is started.
Now let’s create the tracing script i.e. java class. Create a java class named BTraceThread.java:
import com.sun.btrace.annotations.*;
import static com.sun.btrace.BTraceUtils.*;
@BTrace
public class BTraceThread {
// @OnMethod annotation tells where to probe.
// In this example, we are interested in entry
// into the Thread.start() method.
@OnMethod(
clazz=“java.lang.Thread”,
method=“start”
)
public static void func() {
// println is defined in BTraceUtils
// you can only call the static methods of BTraceUtils
println(“about to start a thread!”);
}
}
If it ain’t running already, start the program that shall be traced. I’ll use JRubyIRB to start some threads interactively.
We need now the pid of the IRB. Find the already running Java programms with jps -l
Which returned on my machine: 17404 org.jruby.Main
Which means we got 17404 as the pid of our programm.
Now run your btrace script with: btrace 17404 BTraceThread.java
Everything is in place now. Let’s start some threads using JRuby IRB: t = Thread.new do puts "New thread started at #{Time.now}" end
Everytime a new thread starts you should see ‘about to start a thread!’ .
D:\>C:\Programme\Java\btrace\bin\btrace 17404 BTraceThread.java
about to start a thread!
about to start a thread!
about to start a thread!
about to start a thread!
about to start a thread!
about to start a thread!
about to start a thread!
about to start a thread!
Logfiles tend to grow and grow and grow. The other day I had a log file about 1.3 GB large.
The relevant logging was only in one part of the file. Handling such a big file is a nightmare using most editors. I could open it but the editor would crash as soon as I tried to delete some parts of the file.
What I needed was the part of the file which contains the log entries for the load test, i.e. split the file into smaller parts – or – even better, cut the parts off that I would not need for my analysis.
As expected Unix-based operating systems have some built-in tools for this task:
Create a new file named ‘output.log.00’ . It should contain only the part of the file input.log beginning with the line that matches the regular expression ‘^17:15:’ . I.e. give me everything from 17:15 until the end of the file:
csplit -f output.log. input.log '%^17:15:%'
Now create two files out of ‘output.log.00’: One containing everything before 18:00 (6pm) and one for the remaining part. I.e. I want a file named ‘log.17.00’ which contains all log entries from 17:15 until 18:00 .
csplit -f log.17. output.log.00 '/^18:/'
Using Windows? I’d recommend to install cygwin which provides split/csplit and many other useful Unix tools. In my opinion a must-have for every serious software developer working on this platform.