{Notes to self, programming, technology, linux, windows, git} U {Papers, reviews, games, coffee, tabletennis, ramblings} = {things worth saving}

Thursday, March 26, 2009

On cubing: Quick notes on Edge Orientation (Incl. advanced setup)

1,3 = (M U M U M) U2 (M' U M' U M') U2

1,2,3,4 = (M'UM'UM'UM'U)(MUMUMUMU)

1,2,3,4, 8, 11 = (lUl'U)(lUl'U)(lUl'U)(lUl'U)(lUl'U)

1,3, 5, 6, 7, 8, 9, 11 = (dDrR)(dDrR)(dDrR)

Depending on the amount of flipped edges, it can pay off to apply an alg that fixes a great amount of edges and then fix the damage caused afterwards. This requires rememorization. Sometimes it can also pay off to create layers with 4 unfixed edges and do the necessary setup moves, if they are easy.

It also helps to look ahead when Using the layout 2,3,4,5,6,9 you could flip all U edges, which would now leave edge 1 unsolved but in return creates an entire F surface that can be fixed. Algorithms suting this scenario are shown below. If the layout of your cube is too far off the setups might become too complex, but the scenarios below are not unlikely.

2,3,4,5,6,9 : (M'UM'UM'UM'U)(MUMUMUMU) x (M'UM'UM'UM'U)(MUMUMUMU) x'

More mirror algs based on the above concept:

1,2,4,7,8,11: (M'UM'UM'UM'U)(MUMUMUMU) x' ( M'UM'UM'UM'U)(MUMUMUMU) x
1,2,3,5,8,12: (M'UM'UM'UM'U)(MUMUMUMU) z ( M'UM'UM'UM'U)(MUMUMUMU) z'
1,2,4,6,7,10: (M'UM'UM'UM'U)(MUMUMUMU) z' ( M'UM'UM'UM'U)(MUMUMUMU) z

Wednesday, March 25, 2009

On security: Authenticity

Problem

Two solutions can be employed in order for users to send requests R to a database for data and receive said data. Users have a private RSA key skA, and also know the public key of the database pkD. But one of these solutions has a security problem. Which?

  • The first solution involves the user encrypting R under D’s public key, appending his signature on the encrypted request (RSA = public key system = digital signature), and then appending his username A.
  • The second solution involves the user appending his signature on the request, encrypting this under D’s public key, and appending his username A.

Solution

First method

Using the first method the signature of the message is not encrypted with D’s public key, only the R. Since a User ID is also added to the message, unencrypted, a user B is able to intercept the message, sign it with his own signature, replace the existing User ID with his own, and send it to D. The database now takes A’s request, looks up B’s public key, encrypts the response and sends it to B instead of A. This was not supposed to happen.

Second method

The second method avoids this by encrypting everything with D’s public key and by doing so we maintain authenticity. We can therefore conclude that the second method is the most secure.

(solution to old assignment from dSik)

On security: One-time pads

Problem

We’re trying to compromise a One-Time Pad by applying facts we have about the original message. Bits 0-20 (LSB first) contain salary information. What we’re trying to do is to get the recipient of the salary an extra mill. A message will be mentioned as m, a key will be mentioned as k and a ciphertext will be mentioned as c.

Solution

What do we know? We know that the salary is encoded in m in bits 0-20, and we know that we get paid less than a million per month. This is enough information to manipulate m encoded with a One-Time pad! In binary 1 million has MSB 1, using our own encoded notation. We know
that the one-time pad uses XOR to generate c using k. Knowing the location of the MSB in the encoded message, and knowing what it should be, to get an extra million (1), we can change the original message to our liking. For example, if the bit corresponding to our salary MSB bit in c is 0, and we know that we do NOT get paid a million or more, then the corresponding bit in m should also be 0, which means the corresponding bit in k is 0 aswell. Now we can change the bit in c to our liking, 1, which adds a million to our salary.

One-time pad security

The only reason we have been able to compromise the One-Time Pad is because we have enough knowledge about m, to make certain changes. If we did not know anything about the original message, c would be total jibberish.

(solution to old assignment from dSik)

On Xfiles: Paper Clip

When Mulder and Scully, in the episode "Paper clip", go to the mining facility in west virginia and find all those medical records in what Mulder refers to as a "mountain vault", Scully makes a comment about the tissue sample boxes from 1955 being "old".

Having been abducted in 1994, her own medical records are on file, but with a newer tissue sample box made of plastic. She refers to the sample as having been taken "recently", judging by the tissue sample box, cementing the fact that it couldn't have been instated very long ago.

Now... When they check Samantha Mulders file, the tissue sample box is also a newer. Mulder was born in 1961, and Samantha was abducted when he was 12, meaning she was abducted in 1973.

18 years passed from 1955 to Samanthas abduction, and 21 years passed from Samanthas abduction to Scullys abduction. Either 21 years prior to her own abduction is "recent", according to Scully, or... they were keeping recent tissue samples of Samantha.

I was sure Fox Mulder would've noticed it this time, but he never does.

On Tabletennis : Review - Nittaku Narucross Ex Hard 2.2mm

In this micro-review, i'll be comparing the Nittaku Narucross Ex Hard 2.2mm to Joola Express Two 2.0mm, as FH rubbers.

Background:

For a while now, i've been playing with Express, on both sides of my blade. I feel that Express 1, on an all wood blade like W-6, serves me best as a BH rubber, and i still feel this way. Blocking and counter-hitting is a breeze, and sharp/flat loops down the BH line have become so much easier.

The Express 2, in the FH, also provided me with incredible stability in terms of blocking and counter-hitting. Express is by far the best rubber i've tried for this, no doubt. Both rubbers are incredible for short-play because of their hardness.

However, when being forced around the court, to the point where you need to stretch yourself to your limits to reach a ball, i was finding it hard to perform FH loops that weren't simply acts of desperation, but would allow me to get back into the point with a decent trajectory and lots of spin. Because of the speed/elasticity/hardness of the express, performing loops from that angle became extremely hard. So i began looking for something else that would allow me to improve that part of my game, well knowing that i'd be sacrificing some consistency in blocking/counter-hitting.

Nittaku Narucross Ex Hard 2.2mm:

I'm usually not a big fan of 2,2mm sponges, but i found this lying around at my local TT-store, and i couldn't stand for it lying there by it's lonesome. (I also got a sheet of Renaros Bright 2.2mm, that i'll be testing at some point).

Initial impressions

Topsheet - excellent quality. The tackiest new-tech rubber i've tried/seen. The nittaku protective sheet almost appeared to be wet, when i applied it to the rubber.

Rolling the ball around on the surface, you can feel the friction. Bouncing the ball, you can feel the crispy innards begging to come into play. Even at 2,2mm, you sense that it's somewhat slower than the Express 2 2mm, but the Express is by nature more explosive. Didn't come as a surprise to me.

Hardness - It feels about the same as the Express 2.

How does it play?

Blocking/counterhitting - The first thing i wanted to do, was to test it against the Express 2, because it's so brilliant at 2mm. The narucross seemed to lack the same crisp and consistent bounce, but it's by no means shabby. It keeps you on your toes because of the 2.2mm sponge combined with the hardness. You need to be a bit more active in your strokes which begs precision in execution. It's still a great blocking/counter-hitting rubber, and i'm definately going to keep it for further testing.

Looping - This is where it gets interesting. Brush looping is easier due to the tackier topsheet and slightly slower speed. Getting some crazy spinny angles on your FH loops is easier aswell, because of the exact same criteria. It seems to prefer a chinese style of looping. I was able to squeezy some power out of my loops that i didn't have the confidence to do with the Express, which isn't as forgiving. Narucross now offers me some increased stability in that department.

When chasing those balls at crazy angles, as i mentioned was one of my goals for this rubber, i was able , in full stretch, to put the ball back on the table with lots of spin and low trajectory, allowing me time to get back into the points. Big thumbs up.

Counter-looping - Excellent. There's alot of control in this rubber away from the table, i feel. Decent speed coupled with great spin and control will have you putting balls on the table for a long time. Counter-looping away from the table is mostly about keeping the ball in play, and the narucross offered some great improvements over the Express Two, i felt. Close to the table, i still feel the Express Two has the edge.

Smashing - As i've said earlier, it's a bit slower than the express, but it still packs quite a punch. I do prefer to twiddle my blade and smash with the more seemingly more powerful Express 1.

Conclusion

This one i'm keeping. On an all wood blade it provides some excellent play in every aspect of the game, while not being overly fast/bouncy. Adjusting to a more chinese style of looping, i felt it provided me with faster loops than ever. On odd angles, it provided me with a weapon to get back into the points. Hardness/speed allows for spinny and short services. I'll have to do some more testing, but right now i have nothing negative to say about it. Since it's made in germany, there may be durability issues but i'll get to that.

It didn't quite stack up to Express 2 in terms of blocking/counter hitting, but what's the difference between brilliant and more brilliant? It's not much.

On tabletennis : Review - Joola Express One

Joola Express One is like a good steak - Seemingly dull on the outside, packed with juice and an explosion of flavor on the inside.

Background

I'd been playing with TBS / Tenergy 05 for a while. Being a semi-EJ, i wasn't satisfied that something could play that good, and that i was to settle down with a blade and a rubber for more than a month. So, i placed an order for some Galaxy blades, in particular, the W-6, in order to explore the lower end of the speed scale of blades with massive amounts of control.

Let me just say that, for me, Tenergy and W-6 do not work together at all. The high throw of the rubber combined with the slow wooden blade was a poor combo for a powerlooper.

It just so happened that Joola Express was being sold at a, what seemed to be universal, discount. ~35% off. No way was i going to pass that up! I picked up a sheet of Joola Express One 2.0, still trying to maintain that control over speed.

Looks can be deceiving

The topsheet is very special. Unlike any other new-gen rubber. It's almost like it's glazed, and even after several practices/games, it's keeping that glaze which most of all reminds you of a metallic sort of varnish you'd expect to see on a car right out of the factory.

It didn't feel tacky at all, but you could almost sense the secrets lurking below the topsheet, in the green-power enabled sponge which is more or less white in color. With it's 47 degrees of hardness, simply bouncing a ball off the rubber gave an amazingly crisp sound on a wooden blade. I got fairly excited at this point. Too bad it was almost midnight and i was unable to go hit a few balls with it. I sensed alot of explosion begging to be let loose.


All aboard the Express train

First hit with the W-6 / Express One. You know that very first hit? You can always sense if something is sh*t, or if something has potential. I immediately got a good vibe from the Express One.

Having tried Tenergy / W-6 for a while, it took a while to get used to the lower throw, but once i did, i started realizing why some of the pro's played the Express One.

Here you have a rubber that's really hard, which is not only fast and spinny, but plays an extremely good short game and to top it off, is an amazing loopers rubber in all aspects. Brush loops are very controlled with low arches, faster controlled loops are the same, and finally, power drives are incredible spinny and fast. I've never had so many "winners" before, not even with the tenergy. The low throw, and topspin sends the ball zooming past your opponent at an incredible speed. It was hard for me to contain my joy at times.

Express vs Tenergy

As i mentioned, the throw is lower than Tenergy. It's faster and probably a bit less spinny. Control is about the same. Both play a brilliant short game. But where the difference is, is in the explosion. In all aspects of play, the Express one seems to be so controllable, with a consistent low throw that will keep your returns in check, not giving away any radicl opening chances.

Express train to victory

The first hit with the Express One that i mentioned earlier, was a christmas tourney at my club. I rode the express train straight to victory after an initial loss in the group-stage where i couldn't quite get used to the throw, and ended up winning the whole thing.

The Express One is an amazingly interesting rubber. I was quite surprised to find that a rubber could play this offensively on an ALL wood blade, but even more surprised to

For all you powerloopers outthere, check this sheet of glory out, you won't regret it.


Secret ingredient - Pure Green Power

I finally got the chance to get a few real practice sessions in with the Joola Express One @ TBS. Let me sum it up for you: This is an absolutely amazing combo. The first thing that struck me, and keeps striking me, is the similarity with a rubber like Joola Mambo Green Power.

Now i know what's lurking beneath the surface... it's the "Green Power", no doubt. The amount of control in the rubber on a carbon blade is astounding, just like what the mambo gives you. But not only do you get that control, you get explosive speed, spin and a low ball trajectory. It was an absolutely devestating combination. Power loops were easily controllable with either alot of power, and/or alot of spin. More focus on spin would actually put the ball close to the net, with great speed, but spinning out over the side of the table at an incredible angle. Absolutely incredible.

Flat hits are possible from anywhere, even from mid/far distance due to the high amount of control. I'm actually having a hard time describing the potential of this rubber - I'm really excited now that i've paired it with my TBS. And while i might sound like a bad ITTF commercial, there simply isn't much else to say, other than : Go try it out. Don't like it? Hey, you'd probably spend that money on beer anyway, and you're an experience wiser. There's a good chance you might end up with a really lethal weapon.

Final conclusions? This rubber is not a one trick pony. My experiments have been limited, but i've tried it at both ends of the speed scale, and it's performed admirably in both cases. Pure Green Power - and it's light. I've found my new best friend.

Goodbye Tenergy05, i hardly knew ye.

Monday, March 16, 2009

On CORBA : ORB Comparison - Orbix vs TAO

Introduction

This post describes installation, configuration guides for the CORBA ORBs IONA ORBIX Java ORB and PrismTech OpenFusion TAO C++ ORB. Test-programs using the client/server paradigm have been implemented for each ORB where a client calls a method on a servant 1000 times. In each case the duration of these calls were timed and the results are concluded upon at the end. Test-implementation of Java IDL as well as MiddCor C# ORB were used for comparison with no guides provided.

ORBIX Java ORB

Features

  • Interoperable CORBA Naming Service and load balancing extensions
  • CORBA 2.6-compliant (w. early support of CORBA 3.0 features)
  • Bidirectional GIOP for server callbacks
  • CORBA Reflection and dynamic type support


Installation and configuration

The installation and configuration procedure for the ORBIX Java Orb includes the following two steps:

  1. Installation of the ORB and services (optional) via the supplied GUI.
  2. Configuration of a domain which includes setting up ports, load balancing etc.
Before you start, you will need to download the ORB itself from IONA (http://www.iona.com) (registration is required), as well as request a license-key, which will be sent by email immediately.

  1. Go to IONA and create an account.
  2. Go to downloads and select ”Standard Orb”.
  3. Accept Terms. In the right column titled ”Obtain License” select ”Get your license”, new window will open, close it after mail has been sent.
  4. Select OS of choice from ”Download kit” column. Save the ORB!
  5. Unzip content to folder of choice.

A short and precise step-by-step installation and configuration guide can be found at IONA (http://www.iona.com/support/docs/orbix/6.3/install guide/index.htm). Installation is completed by following the steps in the sections ”Launching the installer” and ”Installing with the GUI”. Configuration is completed by following the steps in the section ”Configuring your environment”.

Example use

After installing and configuring your environment, the installer will have generated a script that sets up necessary environment variables. This script is located in /IONA/etc/bin and named _env.bat.

If you chose it during the installation, the installer also generated a script in the same directory that allows you to start selected services through a script. ORBIX includes some useful utilities for generating code that, by hand, can be tedious and error-prone. The utility idlgen uses what IONA calls ”genies”, and will from an IDL file, generate client/server skeletons as well as an ant-build file used by IONAs own ant utility : itant.

By running the idlgen command: idlgen java poa genie.tcl -all -jP my_package hello.idl. The -all parameter will ensure that idlgen generates server/client/ant-buildscript. No stubs have been generated for the IDL just yet. This is done by running itant build_all in the base-dir where you ran idlgen. This will call the idl enterpreter and generate stubs and also modify the build-script to include tasks that will start both server and client.

This example use is simplified, and through the idlgen command it is possible to configure the generated code to support certain POA policies, use of naming server, among other things.

Running the test code

  1. Extract the file orbix test.zip somewhere.
  2. In a command prompt, execute the environment script generated by the ORBIX installerfor your domain.
  3. In a command prompt, traverse to the extraction dir and type itant build all. Then type itant runserver.
  4. In a new command prompt, traverse to the extraction dir and type itant runclient.



OpenFusion TAO ORB

Orb installation

Sign up for an account at PrismTech (http://www.prismtech.com) before proceeding. This is necessary in order to download the Orb. When this is done follow these steps in order to install the orb successfully:

  1. Download the OpenFusion TAO orb for the windows XP platform.
  2. Unzip the orb files in a directory of your choice, eg. C:\Orbs\TAO.
  3. In order for the orb to operate correctly three environment variables must be set. First enter the environment variables configuration by right clicking ”My Computer” and selecting properties. Then switch to the ”Advanced” tab and select ”Environment variables”.
  4. Create a new variable called ACE ROOT and set the value to the install dir of the orb, in this case C:\Orbs\TAO
  5. Create another variable called TAO ROOT and set the value to the install dir of the orb, also C:\Orbs\TAO
  6. The last variable is called TAO IDL and this must point to the tao idl.exe file in the bin directory of the orb installation, in this case C:\Orbs\TAO\bin\tao idl.exe
  7. Lastly expand the PATH variable to include the bin and the lib directory of orb installation. The path would then look like this: ;C:\Orbs\TAO\bin;C:\Orbs\TAO\lib
The orbs should now be installed and be ready for use in any VC++ 6.0 solution. Note that the above installation guide assumes the target OS is a Windows OS. If this however is not the case, refer to the accompanying orb documentation.

Issues

It is important to know that this release of the OpenFusion TAO orb only supports Microsoft Visual Studio C++ 6.0. It was not possible to get it working under the newer release Visual Studio 2005. The reason for this is probably that the compilers from these two release are somewhat different. Since the release of Visual Studio 6.0 .Net framework support has been added to the compilers and this might have some effect when linking with the orb libraries. It was also not possible to get a debug version running with the TAO orb, since the release we were able to acquire only contained the release libraries and not the debug libraries.

Running the test code

The supplied test code performs a simple test. It transmits a short string from a client to a server and then back again 1000 times and calculates the amount of time this took. It is primarily to determine if the orb is working and if it is, how fast it is to get some comparison data. The following steps will explain how to perform the test. Beware that the supplied code will only work if compiled with the VC++ 6.0 compiler.

  1. Open the solution file in VC++ 6.0 and compile a release version of the server and the client.
  2. Open a command prompt and navigate to where the server executable is located and type in ”server -o registry.ior”.
  3. Open another command prompt and navigate to where the client executable is located and type in ”client -f registry.ior”.
  4. The test runs and the client prints out how long it took to perform the 1000 calls.
  5. Terminate the server.


Conclusions

The clients send and receive simple and the tests were executed 7 times and a mean value of the resulting execution times was found.

MiddCor : 319.7 ms
ORBIX : 553.8 ms
JAVA IDL : 1583.8 ms
TAO: 348.6ms

In the cases of the Java based ORBs, the first executions of the test resulted in high execution times possibly due to something VM related. In the cases of the C++ and C# based ORBs, execution times were somewhat steady through all executions

Followers