Skip to main content

Posts

Showing posts from April, 2013

Thomasbrötchen

Heute Morgen fragte Kerstin mich: ,,Kannst du zur Bäckerei gehen und 10 Franzbrötchen kaufen?'' Ich antwortete: ,,OK. Aber wie heißen die nochmal?'' ,,Franzbrötchen, wie ein Name, Franz.'' ,,OK.'' Ich ging die Straße entlang und ich sagte den Namen immer wieder um ihn nicht zu vergessen. ,,Franzbrötchen, Franz--bröt--chen, eins, zwei, drei. Franzbrötchen, Franz--bröt--chen, eins, zwei, drei...'' Um die Ecke traf ich einen Freund. ,,Hallo Hitoshi. Schöne Ostern.'' ,,Hallo Thomas. Schöne Ostern.'' Ich ging weiter. ,,Thomasbrötchen, Thomas--bröt--chen, eins, zwei, drei. Thomas--brötchen.'' In der Bäckerei sagte ich der Verkäuferin: ,,Hallo, schönen Tag. Ich möchte 10 Thomasbrötchen, bitte.'' ,,Wie bitte?'' ,,Thomasbrötchen, 10 Stück.'' Sie fragte ihren Mann. ,,Franz, was sind Thomasbrötchen?'' ,,Ach ja'', sagte ich, ,,Franzbötchen, 10 Stück, bitte.'' Franzb...

Math objects on programming (2)

Last article, I showed a simple enumeration generator. But I needed one more flexibility. In my job, I use GPU, that is a fast processing unit, but the available memory size is one order of magnitude small compare to a decent workstation. (E.g, GPU's memory size is 2GB to 6GB, a decent workstation can have 24GB to 256GB main memory.) In this pseudo code example, the unit of memory size is GB. 64GB or 512 GB are too much to the current stare of the art GPUs in 2013.  512GB is too much for the best workstation. Therefore, our product uses a cluster, many workstations are cooperates to do a single job. Almost every customer wants to see how our products scales regarding to the number of workstations. Because they have their needs and they want to know how many workstations and how many GPU are needed for their task. Therefore, we need to demonstrate how the performance changes depends on the number of nodes. Here one more parameter, the number of nodes are added as the following. ...

Python PIL experiment (a image comparison tool) continued

PIL and numpy When I ran this program on my data files, I found the processing time is around 6 seconds, the memory consumption size is 230MB on a 1024x1024 size image. When I processed images resolution of 3840x2160, it took 263 seconds and 2.3 GB memory is consumed. The difference of these resolutions makes only eight times different number of pixels. But the processing time is increased more than 40 times. In my program I only use three buffers for processing, my first estimated minimal program sizes are 10MB for 1024x1024 resolution and 72MB for 3840x2160 resolution. However, the `top' reported 30 times more memory size. When I profiled the program, the most of the time is consumed by the tuple construction (RBG value) and abs function. Therefore, I tried to use numpy to vectorize these code. A table below shows the result. My test environment of Intel Core i7-2720 2.20GHz Linux (Kubuntu 12.10, kernel 3.5.0-27), Python 2.7. +-----------+----------------------------------...

Python PIL experiment (a image comparison tool)

Abstract: Writing image comparison tool with Python PIL. Python PIL module Python Imaging Library (PIL) is a useful Python module to process image files. This time I have a situation that I have different image file format files But the contents must be the same. For example, I wrote a image generation tool and I want to test it. I compress the reference images, but my program produces images with non-compressed image file format. I can use convert (ImageMagick) tools, though this time, I just would like to try a new tool. You can find my image comparison tool here.

Math objects on programming (1)

Abstract: Using mathematical objects often makes a program simpler. This time I have such experience and write it down here. Mathematical object and programming In a program test, we often need to generate a combination of input parameter sets. One of the most easy method to generate a combination is using nested loops. In this article, I use pseudo code based on the Python language. I will provide the real implementation of the program in the appendix. For example, we have following two parameter sets:  data_size_list = [ 5, 64, 512, ]  screen_resolution_list = [     '2560x1440', '3840x2160', ]. The following program can generate the combination of them:   for d in data_size_list:     for s in screen_resolution_list:       print_comb(d, s) # output This method is simple and straightforward, however, less flexible in some cases. For example, we don't know which sets are necessary to generate a combination whe...

My solution of Google drive hang up at "One moment please"

Today I installed Google drive to my Windows 7 environment to share files with my Linux machines. After sign in, the application window said "processing," then it hanged up. There was a button "you must enable javascript". I pushed it, then "One moment please..." after 5 minutes, I exited the program tried it again. It seems some security setting causes this problem. My solution: set  https://accounts.google.com  as a trusted site. Procedure: Open the control panel Go to network and control Go to Internet Options Open Security Tab Click Trusted sites Click the "site" button copy & paste  https://accounts.google.com  to "Add this website to the zone" and click Add button Now it worked for me. But if I removed this site, it still works. That puzzled me a bit...