• Martin Thoma
  • Home
  • Categories
  • Tags
  • Archives
  • Support me

Recent Posts

Languages for Back Ends

Languages for Back Ends

What programming language would I use for the back end of a big, new project in a startup which wants to offer a web service? Sure, on the client side there is pretty much only JavaScript (including variants like CoffeeScript and TypeScript) in combination with HTML and CSS. I've used … Read More »
Java Exceptions

Java Exceptions

This is a quick article I had for quite a while as a draft. It might not be finished or have other problems, but I still want to share it. When to use Errors and Exceptions An Error is a subclass of Throwable that indicates serious problems that a reasonable … Read More »
Part III: Matrix multiplication on multiple cores in Python, Java and C++

Part III: Matrix multiplication on multiple cores in Python, Java and C++

This is Part III of my matrix multiplication series. Part I was about simple matrix multiplication algorithms and Part II was about the Strassen algorithm. Part III is about parallel matrix multiplication. We got some pretty interesting results for matrix multiplication so far. Now, I would like to get to … Read More »
Google Code Jam Templates

Google Code Jam Templates

Here are some templates that are a good start for Google Code Jam. C++ #include #include #include using namespace std; int main(void) { /* number of test cases */ unsigned short int testcases; cin >> t; for(int i=1; i <= t; i++) { //loops for each case for (int … Read More »
What does volatile mean?

What does volatile mean?

You might have read the variable modifier volatile in C, C++ or in Java. But do you know what it means? C Programming Language The C Programming language by Kerninghan and Ritchie (second edition) contains this keyword only 13 times. Here are the most important ones: [...] declaring it volatile announces … Read More »
How to check if two line segments intersect

How to check if two line segments intersect

You have to line segments and you want to know if they intersect. I'll give you an algorithm how to do it. Test cases First of all, we should think about how lines can be arranged: Testcase T1 Testcase T2 Testcase T3 Testcase T4 Testcase T5 Testcase T6 Testcase F1 … Read More »
What can ArrayList / LinkedList do what List can't?

What can ArrayList / LinkedList do what List can't?

I've told my students to write List myList = new ArrayList(); instead of ArrayList myList = new ArrayList(); as this allows them to switch to any Class that implements List without having to change more code. This does always make sense, except if you need methods from ArrayList … Read More »
Basic Multithreading in Java

Basic Multithreading in Java

A lot of computing power is wasted in many programs as most programs use only one core. If your program is computation intensive, you might want to put some extra effort in your program and make use of this wasted computing power. There are two ways to execute your code … Read More »
Part II: The Strassen algorithm in Python, Java and C++

Part II: The Strassen algorithm in Python, Java and C++

This is Part II of my matrix multiplication series. Part I was about simple matrix multiplication algorithms and Part II was about the Strassen algorithm. Part III is about parallel matrix multiplication. The usual matrix multiplication of two $n \times n$ matrices has a time-complexity of $\mathcal{O}(n^3 … Read More »
How to sort with Java

How to sort with Java

Sorting is a very basic task that every programmer should be able to solve. In Python, you have sort and sorted. In C++, you can use operator overloading. I'll now tell you how to do basic sorting with Java. I will not write about natural language sorting or language-aware sorting … Read More »
  • Martin Thoma - A blog about Code, the Web and Cyberculture
  • E-mail subscription
  • RSS-Feed
  • Privacy/Datenschutzerklärung
  • Impressum
  • Powered by Pelican. Theme: Elegant by Talha Mansoor