Friday, May 10, 2013

Physik ab 3 - Optik: wir basteln uns einen "Regenbogen"

Materialien

  • 1 Sektglas ( "Sekttulpe" mit Stiel)
  • weißer Untergrund, z.B. ein Blatt Papier
  • Sonne, nicht zu hoch stehend, aber auch nicht zu niedrig (9 Uhr Sonne)
Erkenntnisgewinn
Wie entsteht ein Regenbogen? Warum gibt es überhaupt einen Regenbogen? Wenn Licht durch Wasser hindurchgeht findet Lichtbrechung statt.
Letzteres erkläre ich aber nicht, da dieser ein 3 jähriges Kind überfordern würde.

Hintergrund

Gestern waren wir mit dem Auto unterwegs. Es war ein wechselhafter Maitag mit Regen und Sonnenschein. Wir waren gerade auf dem Nachhauseweg, es war später Nachmittag, da stand ein sehr schöner Regenbogen am Himmel und war für uns alle im Auto sichtbar. Besonders unsere "Große" (3 1/2 Jahre) war ganz begeistert.
Heute morgen kam ihr der Regenbogen wieder in den Sinn und sie wollte unbedingt wieder einen sehen: "Papa mach mir doch biiiitte einen Regenbogen".

Umsetzung

Da wir in unserer Wohnung keine Möglichkeit haben, mittels Rasensprenger einen Regenschleier oder Ähnliches zu erzeugen, musste ich mir etwas anderes einfallen lassen. Sonne hatten wir schon mal, die schien in unser Küchenfenster hinein.
Mir kam die Idee, dass ein mit Wasser gefülltes Glas doch bestimmt schöne Lichtbrechungen erzeugen sollte. Erste Versuche mit einem Gläschen für Babybrei schlugen fehl. Hauptursache war die unregelmäßige Glasqualität, die zu einer starken Verzerrung der Lichtstrahlen führte.
Nach einigen Versuchen mit verschiedenen Gläsern zeigte sich ein gestieltes Sektglas als das geeignete Objekt zur Erzeugung eines "Regenbogens" (siehe Bild unten). Wichtig zur Erzeugung eines schönen, kontrastreichen Bildes ist dabei, dass das Sonnenlicht nur auf den oberen, mit Wasser gefüllten Teil des Glases fällt und der untere Teil des Glases beschattet wird.
Spielt man ein wenig herum, erhält man auf der Sonnenabgewandten Seite es Glases ein schönes Spektralmuster ("Regenbogen") und auf der sonnenzugewandten Seite einen Fokus, der auch ganz schön aussieht.






Meine Tochter fand unseren selbstgebastelten Regenbogen wunderschön, und der Papa war froh wieder mal als Held dastehen zu können.

Ich hoffe, Euch inspirieren meine Anregungen zu weiteren Regenbogenspielereien. 
Wenn Euch dieser Post gefallen hat, klickt doch einfach mal auf die Werbebanner - tut Euch nicht weh, bringt mir aber ein paar Cent für die Gläser, die unseren Experimenten zum Opfer gefallen sind ;)

Sunday, April 7, 2013

Physik ab 3 - Magnetismus: wir basteln eine Kompass wie Kolumbus

Zusammenfassung

Dieser Blogpost beschreibt, wie man mit Kindern ab ca. 3 Jahre ein kleines Kompass-Experiment basteln kann und ihnen nebenbei noch etwas über Kolumbus erzählt. Das Erklärniveau bleibt dabei immer auf der Ebene des reinen Schauens und Staunens.

Was braucht man?


  • Eine Schüssel voll Wasser
  • eine, besser 2 Stopf- / Sticknadeln oder kleine Nägel
  • Ein Stück Kork / Wachspapier / Schaustoff / etc.
  • Ein handelsüblicher Küchenmaget
  • Eine Karte der Erde, alternativ Google Earth

Einleitung

Einige Fragen an die Kinder:
Egal ob das Lied bekannt ist oder nicht, es ist ein guter Einstieg, es erst einmal zu singen, um die Kinder abzuholen und eine positive Atmosphäre zu schaffen.
Nach dem Lied erkläre ich erst einmal, dass Kolumbus ein Mann war, der vor ganz langer Zeit gelebt hat. Er ist bis heute bekannt, weil der als erster Seefahrer aus Europa bis nach Amerika gesegelt ist. Die Zusammenhänge "Europa", "Amerika", "Spanien", "wo wohne ich" erkläre ich am liebsten mit Google Maps, weil meine Tochter schon lange weiß, dass wir auf einem "grooooßen Ball mit Namen Erde wohnen", und "Wo die Oma" wohnt, wo "ich wohne", "wo ich letztes Jahr in Urlaub war", etc. Außerdem gibt es im Internet noch viele schöne Bildchen von der Santa Maria, da kann man zeigen, wie die Schiffe von Kolumbus aussahen.

Wie orientiert man sich als Seefahrer?

Hier möchte ich eine Art "Problembewusstsein" bei den Kindern erzeugen in Hinblick aus "wie orientiert man sich auf dem Meer?" Ich erkläre das so: Auf dem Meer gibt es keine Straßen und also auch keine Straßenschilder, die einem sagen wohin es geht. Wenn man jetzt auf die Karte / Google Earth schaut, dann muss einer wie Kolumbus ja wissen, ob er auf der Karte / Erde gerade nach "links", "rechts", "oben" und "unten" fährt. Die Namen der Himmelsrichtungen lasse ich hier weg, oder führe sie erst einmal ein.
Also braucht man am besten ein Gerät, mit dem man erkennen kann, wohin man fährt....

Wir basteln und einen Kolumbus-Kompass

Als erstes versuche ich erst einmal zu zeigen, was (nicht) passiert, wenn man eine "normale", nicht-magnetisierte Nadel hat: das kann man schön machen, indem man versucht, eine Nadel mit der anderen mittels Berührung hochzuheben. Das geht natürlich nicht, ohne dass eine der Nageln magnetisiert ist. Ich bastle auch schon mal meinen Kompass: die Nadel wird in einen schwimmfähigen Träger (Kork / Schaumstoff / Wachspapier / wa sonst so zur Hand ist) gesteckt und in die mit Wasser gefüllte Schüssel gelegt. Es zeigt sich, dass man die Nadel beliebig drehen kann, es gibt keine besondere Richtung. 
Als nächstes nehme ich eine Nadel und fahre mit dem Magneten etliche Male immer in der gleichen Richtung über die Nadel, um sie aufzumagnetisieren. Wenn man jetzt die 2. Nadel mit der magentischen Nadel berührt, so kann man diese mit der magnetischen Nadel hochheben ("das ist fast Zauberei...").
Dann wird die Nadel wieder mit dem Schwimmkörper in die Wasserschüssel gesetzt und - oh Wunder - sie zeigt jetzt immer in die gleiche Richtung. Wir haben uns jetzt eine Kompass wie Kolumbus gebastelt.
Wer will, kann hier aufhören mit dem Experiment.

Was bringt uns so ein Kompass?

Wir sehen, dass die Kompassnadel immer in die gleiche Richtung zeigt. Aber was hat man davon? Die Kinder müssen mir glauben, dass die Nadel immer nach "oben" auf der Karte zeigt. Ein alter Seefahrer kann also mit so einem Kompass immer sagen kann, in welche Richtung auf der Karte er gerade segelt.  Hier kann man schön ein bisschen Abenteuer-Atmosphäre in die Erzählung einbauen: Schiffe bei Sturm, Seefahrer, die aufpassen müssen, dass ihr Schüssel-Kompass nicht überschwappt, etc.

Was kann man noch interessantes Zeigen?

  • Interessant ist auch, was passiert, wenn man sich mit dem Küchenmagneten langsam der Kompassnadel nähert
  • Wer will, kann sich noch einen Elektromagneten basteln und dessen Auswirkungen auf den Kompass zeigen
  • Meine Tochter fand es auch spannend, als sie hörte, das Vögel einen solchen Kompass "im Kopf" habe und so immer genau wissen, in welche Richtung sie fliegen
Meine 3-jährige Tochter fand diese Geschichte des Kolumbus und unser "Experiment", das Basteln eines Kompass sehr spannend. Man kann das ganze schön ausschmücken, um eine spannende Atmosphäre zu erzeugen.

Ich hoffe, Sie können meine Notizen verwenden, um Ihren Kindern ebenfalls ein bisschen Naturwissenschaftler-Glanz in die Augen zu zaubern. Viel Spaß!

Friday, February 8, 2013

My Personal Lean Management Scratchpad

Background

As I am interested in Lean production, lean thinking and lean and agile software development and their application I collect links to pages about these topics and which are interesting for me on this page.

Lean in General

Lean Basics

Lean Production

Lean in Building Industry

Lean Product Development


Jeffrey Liker, James M. Morgan: The Toyota Way in Services: The Case of Lean Product Development
; article on lean in product development.

Lean in Business Administration

Illustrating Lean Principles

Just in Time (JIT)

Porsche JIT Game

In Womack & Jones' "Lean Thinking" is a reference to the "Porsche JIT game" aka as "Beer game" which can be used to illustrate how flow, pull and takt work together to minimize waste and the throughput time of a system. An description of this game can be found in the blog-post "The Beer Game as explained in Lean Thinking; How to promote flow"

Overview Pages

A lrage collection of Lean games can be found here.

Continuous Improvement (Kaizen)

General Process Improvement

  • wandelweb.de: a quite comprehensive site about process improvement and A3-Thinking (in German)

A3-Reports and Their Application

 Process Analysis Tools

Relation to other Management Branches


Tuesday, December 18, 2012

Mass Data Processing in SAP ABAP Environment - Update Function Modules

Background

For an SAP ABAP project I am doing currently, I had the challenge to loop through a database table with 50+ million rows, do some processing with each line and after successful processing I wanted to write some data to another table in the database.

Note: throughout this post I use the notation "<some text>"

First Attempt: Standard Approach

My first attempt looked roughly like this:

SELECT * FROM <DB table1 (50+ million)> into <wa1>. 
process data and put processed data into internal table <itab1>. 
ENDSELECT. 
LOOP AT <itab1> INTO <wa2>. 
INSERT INTO <DB table2> FROM <wa2>.
COMMIT WORK. 
ENDLOOP.

Unfortunately, due to the size of the <DB table1> this ran into a timeout error in dialog processing as well as in batch / background processing.

Second Attempt: Write each single line within SELECT ...ENDSELECT

My second attempt looked like this:

SELECT * FROM <DB table1 (50+ million)> into <wa1>. 
process data and put processed data into internal table <wa2>. 
INSERT INTO <DB table2> FROM <wa2>.
COMMIT WORK. 
ENDSELECT.
Unfortunately, the COMMIT WORK within the SELECT ... ENDSELECT causes a shortdump, as the COMMIT WORK closes the database connection which is required for the next SELECT step.

Third Attempt: Using the Update Function Module

After a bit of reading, I thought out that the problems above could be resolved by encapsulating the processing logic above into an update function module and put the COMMIT WORK outside of the SELECT ... ENDSELECT. For the update module I used the option "Start Immediately". PLease note as well that no COMMIT must be called inside the update module.
Additionally, I used the option PACKAGE SIZE n for the SELECT to do packaged (bunched) processing. In pseudocoding this looks like this:
SELECT * FROM <large DB table> INTO TABLE <itab> PACKAGE SIZE <package size>. 
CALL FUNCTION 'Update_Module_With_Processing_Logic' IN UPDATE TASKEXPORTINGitab_in = <itab>. 
ENDSELECT. 
COMMIT WORK.

Unfortunately, this approach ran into issues as well. I created too many update tasks and the update queue crashed before the COMMIT WORK was issued.

Fourth and Final Attempt: Putting it All Together

Finally, after some more reading and a helpful blog I found a working solution. This solution uses

  • Database cursor and FETCH instead of SELECT
  • Packaged processing via PACKAGE SIZE n
  • Decoupling of the DB data fetch from COMMIT by using the option WITH HOLD
  • Decoupling of the work processes via asynchronous RFC calls
  • Queued DB updates via update function module

The corresponding main program logic looks like this:

OPEN CURSOR WITH HOLD <the cursor> FOR SELECT * FROM <large DB table>. 
DO. 
FETCH NEXT CURSOR <the cursor> INTO TABLE <itab> PACKAGE SIZE <package size>. 
IF sy-subrc <> 0.EXIT.ENDIF. 
CALL FUNCTION 'RFC_Module_Calling_Update_Module' STARTING NEW TASK <the task>DESTINATION GROUP DEFAULTEXPORTINGitab_in = <itab>. 
ENDDO. 
CLOSE CURSOR <the cursor>.
The RFC-module logic looks like this:
CALL FUNCTION 'Update_Module_With_Processing_Logic' IN UPDATE TASKEXPORTINGitab_in = <itab>.  

COMMIT WORK AND WAIT.

Furthermore I changed the update module type to "Start Delayed".

By this approach I was able to do the processing of more than 50 million lines. Maybe it is noteworthy that the processing of the update queue took about 1 day (depending on system). The update queue can be monitored with the help of transaction SM13.

I hope you can get something out of this and you enjoyed reading, all the best
Wolfi

Thursday, October 18, 2012

PS3 Repeatedly Cannot Connect to WLAN


Background

I have a PS3 (CHECHL04 80GB model from 2008 or so) which we are using predominantly for watching movies from the Playstation Store. Up to recently the PS3 was connected via cable to an Apple 1 TB Time Capsule which I used as WLAN router. The Time Capsule itself was connected to a cable modem.
Then, once in a sudden the Time Capsule quit its service... I wrote about this earlier.

Current Setup

I replaced the Time Capsule with a combination of an Apple Airport Express and a Synology DS212j NAS, the cable modem remained the same. Unfortunately, the Airport Express only has one LAN cable socket instead of the 4 like the Time Capsule or an Airport Extreme - which I did not buy due to budget reasons. The one cable socket I reserved for the connection of the DS212j, so the PS3 had to connect to the network via WLAN from now on.

Problems, Problems, Problems - WLAN & PS3 sucks

Everything started without problems - I configured the PS3 network settings (more or less everything on auto mode, the wlan password, ...) and it worked without problems. ... once ...
The next time I switched on the PS3 (I wanted to watch a movie together with my wife..) nothing worked - no connection to the network possible.
What followed was a couple of days nightmare of configuring the network settings again and again and trying all kind of permutations of the network parameters over and over. The wlan was always detected, I verified passwords and IP addresses (automatic and manual), tried the same on the Aiport Express side. Nothing worked...

At Long Last - The Helpful Hint

During my configuration exercises I scanned as well a thousand forums and blogs, without finding a helpful answer right away. In the end one discussion was helpful - unfortunately I cannot find it again to link it here.
In this thread, one author said that there is one speciality of apple wlan devices: if they are working in environments with many wlan routers around (what is the case for me), it switches to wlan channel 13 which causes problems for many client devices - and especially the PS3. The author adviced to manually set the wlan channel of the Airport to a channel lower than 12 or 10 (can't really remember).

I followed this advice and it worked like a fly and ever since. I tried a fixed channel 3 and 6 without problems. I set the PS3 network settings to mostly standard and automatic, no special tricks.

I hope this blog helps other frustrated PS3 network configurators ;)

Monday, October 15, 2012

POSTGIS Spacial Database Installation on a Mac OS X Lion System


Background

Presently I am working on a hobby project of mine where I want to develop a web application with Ruby on Rails which shall visualize data on maps. I essence I want to build a GIS application. After reading a couple of sources in the internet, it became obvious that it would be best to have a spacially enabled database - meaning a relational database with an extension so it can process queries for spacially arranged data. An example would be a simple query where you want to know the gas stations in a certain radius around your current location.
The resulting architecture I want to use is the following:

  • The system database I want to use will be PostgreSQL
  • To spacially enable the database, I want to use the PostGIS addon for PostgreSQL
  • To enable the communication between Rails and the PostGIS server, the activerecord-postgis-adapter is required
  • To be able to write "geospacial" ruby code, the GeoRuby gem is required
  • Furthermore, I want to do the map visualization with OpenLayers to be independent of commercial map services. 

Step 1: Installing the PostgreSQL

So far, I used the Postgres.app (download on postgresapp.com) for my development (to be honest, my development is currently at chapter 9 of Michael Hartl's excellent tutorial of a micropost app). But I found out that Postgres.app is insufficient for the installation of the PostGIS enhancement, but a full PostgreSQL installation is required (see README.postgis in the PostGIS distribution files).
The latest PostgreSQL EnterpriseDB installation files for the common operation systems are available at enterprisedb.com.

PostgreSQL Installation Problem

During the installation I experienced a problem which has been seen by other users as well (see for instance this discussion thread): the installation starts without problems, runs all through, but hangs in the end with a message

  • "Loading additional SQL modules"

You can only click on "cancel" (what I did once...) which rolls back the whole installation. The discussion above gave the helpful hint:

  • hard stop the installation via the Activity Monitor
  • stop any processes called "postgres" running in the background
  • restart the installation once again with the same directories

This procedure makes the installation run once again and this time ending without any problems.

Step 2: Installation of PostGIS

I found a good description "installing PostGIS on Mac OS X and Ubuntu" by "juniorz" which I followed. Still, I ran into a couple of issues and obstacles which I will describe here.

First installation step ($ brew install postgis)


Firstly, I encountered the following error:
==> ./configure --prefix=/usr/local/Cellar/proj/4.8.0
==> make install
Error: The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link proj'
The advice to run "brew link proj" actually did not fix the issue, I got another error message:
$ brew link proj
Linking /usr/local/Cellar/proj/4.8.0...
Error: Could not symlink file: /usr/local/Cellar/proj/4.8.0/bin/proj
Target /usr/local/bin/proj already exists. You may need to delete it.
To force the link and delete this file, do:
  brew link -f formula_name
What helped in the end was a forced deletion of proj:
$ brew link -f proj
A second error appeared for the GEOS library:
==> ./configure --prefix=/usr/local/Cellar/geos/3.3.5
==> make install
Error: The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link geos'
Here the situation was a bit more difficult than for "proj". Neither worked "$ brew link geos" nor "$ brew link -f geos" as the system refused to delete it due to missing privileges. As well "sudo brew link -f geos" failed.
What helped here in the end was to use Finder and to manually delete the directories "geos" located in
/usr/local/Cellar/
/usr/local/include/
 Another issue appeared, when the system tried to download the required json library from
http://oss.metaparadigm.com/json-c/json-c-0.9.tar.gz
here the download process repeatedly stopped at a couple of downloaded percent. I was able to fix this by downloading the file json-c-0.9.tar.gz from github and to move it to the Homebrew installation directory
/Library/Caches/Howbrew/
With these little tricks I was able (Hooorray!) to install PostGIS.


Second installation step (initdb /usr/local/var/postgres)


No Issues.


Third installation step (pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start)


When performing the command above, I ran into the following error:
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log startserver startingsh: /usr/local/var/postgres/server.log: No such file or directory
This could be fixed simply by adding the required "postgres" directory to /usr/local/var/ with the help of the Finder.


Fourth installation step (createdb postgis_template)


This installation step needed as well some adjustment. Trying to execute the command as noted by juniorz, I got a password error, because the command was executed for my user who was unavailable in the DB. After a bit of reading I executed the command with the "-U" option, which allows to execute the command with explicitly giving a user name. I used the postgres default user, whic was the only one available in my local tes DB. With the -U option the command looks like this:
createdb -U postgres postgis_template
you will be asked to give the password after hitting enter

... Here I am stuck in the moment...

Monday, October 8, 2012

Google Chrome Crashes with Error "Chrome.exe - Bad Image" due to icudt.dll

Background

I have been using Google Chrome as standard browser on a Windows 7 Enterprise PC with Service Pack 1 ever since. Then, once in a sudden I get an error popup when I want to start Chrome telling me:

<path to user directory>\AppData\Local\Google\Chrome\Application\22.0.1229.79\icudt.dll is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support.
 The search for solutions did not yield an immediate remedy, so I want to collect my experiences in a blog.

1. Attempt: Install Chrome over existing installation

First thing I tried was to simply go to the Chrome website and install it over the existing installation. I did not run the installation in administrator mode. And I did not download the installer explicitly to some directory.
Result: Failed

2. Attempt: Uninstall Chrome completely and Install again

By using the Windows control panel I uninstalled Chrome from my system, went to the Google website and re-installed Chrome again.
Result: This approach worked