Το τίμημα του Frankenschock… δεν είναι αυτό που νομίζετε

Ακόμα και σε ένα έγκριτο μέσο, όπως η Ναυτεμπορική, βρίσκεται που και που δημοσιογράφος να γράφει για θέμα με το οποίο η σχέση του είναι… πλατωνική:

“Λαμβάνοντας υπ’ όψιν τις οικονομικές και γεωπολιτικές εξελίξεις, και έχοντας επίγνωση των νέων μέτρων νομισματικής στήριξης και του «πακτωλού» ρευστότητας που προετοίμαζε η ΕΚΤ -πρόγραμμα ενός τρισ. ευρώ- η ελβετική κεντρική τράπεζα προτίμησε την τακτική της υποχώρησης στον συναλλαγματικό πόλεμο που είχε ξεσπάσει τότε, αντί την τακτική της άμυνας, γνωρίζοντας πολύ καλά ότι η υπεράσπιση του ανώτατου ορίου με αλλεπάλληλες παρεμβάσεις θα οδηγούσε με μαθηματική ακρίβεια στην «εξαφάνιση» των συναλλαγματικών της διαθεσίμων.”

http://www.naftemporiki.gr/story/1055258/to-timima-tou-frankenschock

(η έμφαση δική μου)

Στην πραγματικότητα, όπως γνωρίζουν οι πάντες, θα συμβεί το ακριβώς αντίθετο ! Το έχουν επισημάνει πολλές φορές, μεταξύ άλλων, οι Financial Times (πχ. “The Swiss hill that may become a mountain“).

Απλή λογική: όταν μια κεντρική τράπεζα θέλεις να στηρίξει (ανεβάσει) την τιμή του νομίσματος, αγοράζει το νόμισμα ξοδεύοντας συνάλλαγμα –συνήθως δολλάρια. Έτσι τα αποθέματα μπορεί να τελειώσουν κάποια στιγμή. Όταν όμως θέλει να ρίξει την τιμή, όπως η ελβετική κεντρική τράπεζα, τότε “τυπώνει” (στην πραγματικότητα πιστώνει ηλεκτρονικά λογαριασμούς τραπέζης) το δικό της νόμισμα. Και αυτό δεν “τελειώνει” ποτέ.

Αυτό δεν σημαίνει ότι η ενέργεια αυτή δεν έχει προβλήματα (όπως εξηγούν οι FT) ή ότι μπορεί να συνεχίζεται επ’ άπειρον. Αλλά οπωσδήποτε δεν θα “εξαφανιστούν τα συναλλαγματικά αποθέματα”, όπως διατείνεται ο συντάκτης της Ναυτεμπορικής.

Advertisements

Serious but hilarious NSA anecdotes

(This one’s for IT guys, perticularly crypto geeks, source is Schneier’s blog)

NSA recently declassified a lectures book from 1973. It contains some real gems, such as these from pages 55/56:

KAG-1/SEC used to be the bible of US cryptographers, was held in every crypto-center and covered everything from message preparation to compromise reporting in considerable detail. While we viewed it as a model of clarity, this perception was not always shared in the real world. A frustrated Navy Chief stormed out of bis crypto-ccntcr on board a carrier at sea, banded KAG-1 to a sailor and jokingly said “Throw this dam’ thing overboard.” He did. Several ships thereafter steamed back and forth for several days, but never found it. Winds, tides, and currents were studied to predict where it might come ashore with results so ambitious as to offer little hope and, in fact, it was never recovered – at least by us.

This incident triggered an R 1 study on what happens to our documents in salt water. A tank was made, and a copy of KAG-1 immersed. It stayed there for a year or so with no sign of deterioration. Agitators were added to stimulate wave action for another few months, with still no appreciable effect. We never did find out how long such a document would last. Subsequent work, however, has shown that good paper is nearly impervious to salt water, apparently indefinitely. A visit to S2’s exhibit of materials recovered from the sea bottom will bear that out. There you can see perfectly legible codes that had been under water since World War II, together with extraordinarily well-preserved items of hardware and magnetic tape that had been on the bottom for many years. These facts add to the previously expressed skepticism about jettison as a way to get rid of our stuff unless at very great depths and in completely secret location. (Shortly after WWII, small Army training crypto-devices called the SIGFOY were disposed of beyond the 100 fathom curve off Norfolk. Some years later, they became prize souvenirs for beach combers as they began washing ashore.)

UNSOLVED PUZZLE – We used to store a lot of cryptomaterial in a warehouse at Ft. Holabird. It was fenced and protected by a 24-hour armed civilian guard. One evening, such a guard saw an individual inside the fence, evidently attempting to penetrate the warehouse. He drew his weapon, cried “Halt!” and led the individual to the guard shack and started to call in for help. About that time, the intruder started running, climbed the fence, and disappeared.

We asked the guard why he didn’t shoot – he said he was afraid he might hurt somebody.

CONFETTI – When we manufacture one-time tape, a by-product of the punching process is millions upon millions of tiny, perfectly circular pieces of paper called “chad” that come out of holes in the tape. This chad was collected in burn bags and disposed of. Someone thought it would make good public relations to give this stuff to high school kids for use as confetti at football games. Inevitably, one of the burn bags was not quite empty when the chad went in. At the bottom, were a couple of TOP SECRET key card book covers and a few assorted keys. They carried the impressive caveats of those days like “CRYPTO – CRYPTO-CLEARANCE REQUIRED” and were, to use a term earlier referred to, “fascinating” to the kids when they discovered them.

One of the girls, whose father happened to be an Army officer, tacked soine of this material on her souvenir board. When Daddy saw it, he spiralled upward. He decided that it must be destroyed immediately; but first made a photograph of it for the record. He tore it up, flushed it away, and reported in. With some difficulty, various cheerleaders and other students who had glommed on to some of this material were tracked down, and persuaded to part with it.

We no lonser issue confetti.

A History of U.S. Communications Security (Volumes I and II);
the David G. Boak Lectures, National Security Agency (NSA), 1973
http://www.governmentattic.org/18docs/Hist_US_COMSEC_Boak_NSA_1973u.pdf

Oh the joy of coding with German Office

So I’m maintaining an Access database, with lots of VBA code, which serves as an internal management tool.

Changing a report should be, and usually is, pretty straight forward. But there I am today, after all changes are done, stuck trying to understand WHY THE FREAKING F*** a format string doesn’t work.

The offender is a text box with a date, and I’m trying to get it to be displayed like Nov-2015. So, according to Microsoft’s documentation, the format string is mmm-yyyy. Needless to say, didn’t work.

After an hour or so of banging my head on the wall, enlightenment comes: Year in German is Jahr !!! So mmm-jjjj, and, pronto, it worked like a charm.

By the way, Microsoft’s german doc is wrong (seems like a copy-paste error): it mentions jj and yyyy, instead of jj and jjjj which work (giving 15 and 2015 respectively).

GRRRRRRRRRRRRRRRRRRR *#@$%

How to overload static methods in C#

Let’s say I have an abstract generic class and a descendant:

public abstract class AuditObject<T> : ActiveRecordBase<T>

(yes I’m using ActiveRecord) and

public class Employee : AuditObject<Employee>

In both of them I define some static Methods, e.g.

public static DataTable GetLookupTable(String where, Int32 topRows)
{
  return doExtremelyCleverStuffToFetchData(where, topRows);
}

(in the Employee class you need public **new** static or else you get a compiler warning)
As the code is, when I call e.g.

DataTable myList = AuditObject<T>.GetLookupTable("inactive = 0", 100);

…and T is Employee, the static method is not “overriden” i.e. the one that is executed is the method in AuditObject, not Employee.

So in AuditObject I modified the static methods (in this example, GetLookupTable) like this :

public static DataTable GetLookupTable(String where, Int32 topRows)
{
  DataTable tbl = null;
  Boolean hasOverride = hasMethodOverride("GetLookupTable");
  if (hasOverride)
  {
    tbl = invokeStaticMethod<T>("GetLookupTable", new Object[2] { where, topRows }) as DataTable;
  }
  else
  {
    tbl = doExtremelyCleverStuffToFetchData(where, topRows);
  }
  return tbl;
}

Here’s how I find out if the static method exists :

private static Boolean hasMethodOverride(String methodName)
{
  var methodQuery =
    from method in typeof(T).GetMethods(
    BindingFlags.Static | BindingFlags.Public | BindingFlags.InvokeMethod)
    where method.Name == methodName
    select method;
  return methodQuery.Count() > 0;
}

And here’s how the “override” method is called :

public static Object invokeStaticMethod<T>(String MethodName, Object[] Args)
{
  return typeof(T).InvokeMember(MethodName,
    BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod,
    null, null, Args);
}

Voila ! When I call DataTable myList = AuditObject<T>.GetLookupTable(“inactive = 0”, 100); and T is Employee, I get results from the static method defined in the Employee class.

Η πολιτική του φθόνου

Αυτό το κείμενο, στη Ναυτεμπορική, “χτύπησε” ευαίσθητη χορδή:

Η διάκριση «εχθρού-φίλου» είναι ωφέλιμη πριν και κατά τη διάρκεια μιας εκλογικής μάχης […]

Οδηγεί, όμως, στην πολιτική και κοινωνική καταστροφή εάν παραμένει και μετά την επίτευξη του πολιτικο-εκλογικού στόχου […]

Ο κοινωνικός φθόνος είναι ο καρκίνος μιας κοινωνίας.

Δεν είναι τίποτα νέο: μπλε και πράσινα καφενεία υπάρχουν σε κάθε χωριό εδώ και δεκαετίες. Αλλά η τρέχουσα κυβέρνηση έχει σπάσει όλα τα ρεκόρ –και ο κατήφορος σταματημό δεν έχει.

http://www.naftemporiki.gr/story/1021578/i-politiki-tou-fthonou

Wise words

My favourite financial blog, Alphaville (link), reiterates some simple and sound financial advice:

“In his 2002 treatise, Dilbert and the Way of the Weasel, [Scott Adams] laid out one of the most sensible and succinct approaches to financial planning:

  • Make a will.
  • Pay off your credit cards.
  • Get term life insurance if you have a family to support.
  • (*)Fund your Pillar 3 account to the maximum
  • Buy a house if you want to live in a house and you can afford it.
  • Put six months’ expenses in a money market fund.
  • Take whatever money is left over and invest 70% in a stock index fund and 30% in a bond fund through any discount broker and never touch it until retirement.”

(*) Note that the original advice here was “Fund your 401(k) to the maximum” and “Fund your IRA to the maximum”, but these are valid for the US; Pillar 3 is, more or less, the Swiss equivalent.

On the road to crisis

Από τους Financial Times, διαβάζω τα παρασκήνια πριν την κρίση (Φεβρουάριος 2010) από τον Geithner, τον υπουργό οικονομικών των ΗΠΑ.

Αυτά που αναφέρει ότι ειπώθηκαν από τους Ευρωπαίους για την Ελλάδα είναι αποτρόπαια. Η πρώτη μου σκέψη μόλις τα διάβασα ήταν “ωραία αλληλεγγύη από τους Ευρωπαίους !!!”.

Όμως η αμέσως επόμενη, η οποία έρχεται αβίαστα, ήταν “πόσο σκ*** τα κάναμε για να έχουν τέτοια μανία ώστε να θέλουν να τιμωρήσουν όλη τη χώρα ;;;”.

Ο κύριος λόγος που ήταν έξαλλοι ήταν η “διόρθωση” του ελλείμματος που έκανε η κυβέρνηση, η οποία τουλάχιστον εν μέρει έγινε για εσωτερικούς πολιτικούς λόγους –βασικά για να δικαιολογήσει ότι δεν μπορούσε να μοιράσει τα λεφτά που είχε υποσχεθεί προεκλογικά. Και μην ξεχνάμε ότι αυτό ήταν η δεύτερη φορά που συνέβαινε, η προηγούμενη κυβέρνηση όταν ανέλαβε είχε κάνει το ίδιο !!!

Μ’ άλλα λόγια, για εσωτερικούς πολιτικούς λόγους κάναμε την εξωτερική μας εικόνα μαντάρα ! Τόσο χάλια ήταν η γνώμη των Ευρωπαίων για μας, που ειπώθηκαν πράγματα όπως αυτά που θυμάται ο Geithner :

“I said at that dinner, that meeting, you know, because the Europeans came into that meeting basically saying: “We’re going to teach the Greeks a lesson. They are really terrible. They lied to us. They suck and they were profligate and took advantage of the whole basic thing and we’re going to crush them,” was their basic attitude, all of them….”

“But the early premonitions of that were in that initial debate. They were lied to by the Greeks. It was embarrassing to them because the Greeks had ended up like borrowing all this money and they were mad and angry and they were like: “Definitely get out the bats.” They just wanted to take a bat to them.”

Πλήρες άρθρο: http://blogs.ft.com/brusselsblog/2014/11/11/draghis-ecb-management-the-leaked-geithner-files/