Implemented a ROT13 Encryption Web App

The Source Code for the Python Web App using Templates (jinja2):
[sourcecode language="python"]
import os # operating system fumctions
import re # regular expression module
from string import letters

import webapp2
import jinja2

from google.appengine.ext import db

template_dir = os.path.join(os.path.dirname(__file__), 'templates')
jinja_env = jinja2.Environment(loader = jinja2.FileSystemLoader(template_dir), autoescape = True)

def render_str(template, **params):
t = jinja_env.get_template(template)
return t.render(params)

class MainHandler(webapp2.RequestHandler):
def render(self, template, **kw):
self.response.out.write(render_str(template, **kw))

def write(self, *a, **kw):
self.response.out.write(*a, **kw)

class Rot13(MainHandler):
def get(self):

def post(self):
rot13 = ''
text = self.request.get('text')
if text:
rot13 = text.encode('rot13')

self.render('rot13-form.html', text=rot13)

app = webapp2.WSGIApplication([
('/', Rot13)],
Source code for the Template positioned in a folder 'templates':
[sourcecode language="html"]</pre>
<!DOCTYPE html>

<title>Unit 2 Rot 13</title>

<h2>Enter some text to ROT13:</h2>
<form method="post">
<textarea name="text"
style="height: 100px; width: 400px;">{{text}}</textarea>
<input type="submit">


Should you go for a Ph.D.? Most of us shouldn’t!

Botton line: If you want to go into – Academics or into R&D (e.g. in the Lab of a big company), then go for a Ph.D. otherwise go for the business experience.

And this is why:

The best answer I’ve seen to this question is by Prof. Matthew Might on his blog. Like many great answers, it uses pictures (taken from The illustrated guide to a Ph.D.):

Imagine a circle that contains all of human knowledge:


By the time you finish elementary school, you know a little:

By the time you finish high school, you know a bit more:

With a bachelor’s degree, you gain a specialty:

A master’s degree deepens that specialty:

Reading research papers takes you to the edge of human knowledge:

Once you’re at the boundary, you focus:

You push at the boundary for a few years:

Until one day, the boundary gives way:

And, that dent you’ve made is called a Ph.D.:

Extending this boundary of human knowledge gives you a number of other skills apart from the knowledge gained (as explained in Vijay Chidambaram’s answer to PhD Careers: If a PhD doesn’t go into research or industry in his or her chosen field or specialty, what is he or she actually more qualified than college graduates to do?):

Ability to work independently. The degree is not conferred until the candidate has proved to experts that he or she has produced original work and advanced the state of the field in some way. Though some work may be done in collaboration, the ideas as such must originate with the degree holder. 

Critical thought. Extending the state of the art cannot be done without knowing what is wrong with the current state. A PhD candidate learns to critically examine the thoughts of others and pick out the pros and cons.

Perseverance. Getting the degree is a long and arduous journey that tests the determination of the candidate.

Ability to work with poorly defined goals. One of the bigger hurdles of the PhD is that there is no clear cut goal. You know you have to do original research, but no one can exactly say these are the things you need to do every day to do it. Research as such involves going back and forth, exploring blind alleys and so forth.

Effective communication. The candidate must be able to communicate about his or her research effectively, at least on paper. The better candidates will be able to communicate through oral presentations as well.

Though a Master’s degree equips one with specialized knowledge, most of the above skills are not learnt during a Masters degree. Do note that you don’t need any degree to acquire the above skills on your own.

A masters degree equips you to do high level, complex design and potentially lead software engineering teams.

A PhD degree equips you to do original research and potentially lead R&D teams.

Date Converter: Transform a date into different formats

One very common data transformation is the stadardization of dates. This Date Converter Code can be customized to your need. You can use foreign languages or change the order of day, month and year. Also you could include other standardizations like ’01’ and ‘1’.
[sourcecode language=”python”]# Date Converter
# Write a procedure date_converter which takes two inputs. The first is
# a dictionary and the second a string. The string is a valid date in
# the format month/day/year. The procedure should return
# the date written in the form <day> <name of month> <year>.
# For example , if the
# dictionary is in English,
english = {1:"January", 2:"February", 3:"March", 4:"April", 5:"May",
6:"June", 7:"July", 8:"August", 9:"September",10:"October",
11:"November", 12:"December"}
# then  "5/11/2012" should be converted to "11 May 2012".
# If the dictionary is in Swedish
swedish = {1:"januari", 2:"februari", 3:"mars", 4:"april", 5:"maj",
6:"juni", 7:"juli", 8:"augusti", 9:"september",10:"oktober",
11:"november", 12:"december"}
# then "5/11/2012" should be converted to "11 maj 2012".
# Hint: int(’12’) converts the string ’12’ to the integer 12.
def date_converter(dic, string):
first_split = string.find(‘/’)
month = string[0:first_split]
second_split = string.find(‘/’,first_split+1)
day = string[first_split+1:second_split]
year = string [second_split+1:]

month_name= dic[int(month)]

return day+’ ‘+month_name+’ ‘+year
print date_converter(english, ‘5/11/2012’)
#>>> 11 May 2012
print date_converter(english, ‘5/11/12’)
#>>> 11 May 12
print date_converter(swedish, ‘5/11/2012′)
#>>> 11 maj 2012
print date_converter(swedish, ’12/5/1791’)
#>>> 5 december 1791[/sourcecode]

Reducing text to it’s components

This short phyton programm takes a Webpage as an input and reduces it to it’s components. The components are the words on the webpage. You can use this and customize this to fit your purpose. This code can be applied in web-crawlers, text analytics and other fields. For example if you want do leave out stop words you would define a dictonary of this word and include this with anouther if statement. This could be applied if you want to reduce patent data to it’s components and leave generic terms like ‘a’ ‘this’ ‘innovation’ etc. out. You would do this because words like this have no information value.

[sourcecode language=”python”]

def remove_tags(source):

output = [ ]

atsplit = True

splitlist = [‘ ‘,’>’,'<‘,’n’]

i = 0

while i < len(source):

if source[i] == ‘<‘:

i = source.find(‘>’,i+1)

if source[i] in splitlist:

atsplit = True


if atsplit:


atsplit = False


output[-1] = output[-1] + source[i]

i = i + 1

return output[/sourcecode]


Verwandte Artikel:

Der moderne CEO nutzt ‘Social Media’.

Hier ein Artikel des Fobes Magazin, mit der Kernaussage: Eine IBM Studie zeigt Social Media Experten sind bei den CEOs unterrepräsentiert. Werden aber in den nächsten 5 Jahre um 57 Prozent zunehmen. Hauptgrund, Social Media Technologien ermöglichen agile und anpassbare Beziehungen zu Kunden, Lieferanten und Mitarbeiter. Damit beeinflusst Social Media alle Unternehmensbereiche. Social Media ist in diesem Kontext mehr als Twitter, Facebook und Xing.

Für angehend ‘moderne CEOs’ ist der Social Media Bereich ein Sprungbrett auf den CEO Posten.

“As CEOs ratchet up the level of openness within their organizations, they are developing collaborative environments where employees are
encouraged to speak up, exercise personal initiative, connect with fellow
collaborators, and innovate,” the IBM study concluded.

Simply put, CEOs and their executives set the cultural tone for an organization. Through participation, they implicitly promote the use of social technologies.  That will make their organizations more competitive and better able to adapt to sudden market changes.

Other key findings of the study include:

  • The study reveals that CEOs are changing the nature of work by adding a powerful dose of openness, transparency and employee empowerment to the command-and-control ethos that has characterized the modern corporation for more than a century.
  • Companies that outperform their peers are 30 percent more likely to identify openness – often characterized by a greater use of social media as a key enabler of collaboration and innovation – as a key influence on their organization.
  • While social media is the least utilized of all customer interaction methods today, it stands to become the number two organizational engagement method within the next five years, a close second to face-to-face interactions.
  • More than half of CEOs (53 percent) are planning to use technology to facilitate greater partnering and collaboration with outside organizations, while 52 percent are shifting their attention to promoting great internal collaboration.
  • Championing collaborative innovation is not something CEOs are delegating to their HR leaders. According to the study findings, the business executives are interested in leading by example.
  • CEOs regard interpersonal skills of collaboration (75 percent), communication (67 percent), creativity (61 percent) and flexibility (61 percent) as key drivers of employee success to operate in a more complex, interconnected environment.
  • The trend toward greater collaboration extends beyond the corporation to external partnering relationships. Partnering is now at an all-time high. In 2008, slightly more than half of the CEOs IBM interviewed planned to partner extensively. Now, more than two-thirds intend to do so.
  • CEOs are most focused on gaining insights into their customers. Seventy-three percent of CEOs are making significant investments in their organizations’ ability to draw meaningful customer insights from available data.

I’ve often held IBM as the best example of a Social Business and a company to emulate rather than Apple. I believe this study and the analysis behind it, reinforces that view.

The IBM study shows that CEOs and the companies they manage must constantly evolve to stay competitive. Partners, suppliers, employees and customers want CEOs to communicate with them on a personal level to build trust and to help align them to the organization’s strategy. There is a lot at stake here. And if CEOs continue to hide in their Ivory Towers under the guise of some old command and control mentality, the next chapter in their career might be written somewhere else.

No one wants that.


Source and all Rights: Fobes Magazin

Der ‚moderne CEO‘ kann Programmieren.

Heute verwenden die meisten Bereiche Computer. Ein ‚moderner CEO‘ muss kein Programmier-Greek sein, aber ein Grundwissen in der Programmierung ist vorteilhaft. Weil:

  1. Er somit seine Geeks versteht und realistische Anforderungen und Bewertung der Leistungen stellt.
  2. Er trainiert sein strukturiertes und analytischen Denken.
  3. Er kann viele seiner Aufgaben automatisieren oder sehr viel effizienter lösen (oder seinem Personal Assistent auf diese Möglichkeiten hinweisen).

Ein moderne CEO hat keine Zeit sich wieder in den Hörsaal zu setzen. Er brauch ein flexibles Lernangebot das sich an seinen zeitlichen Limitationen orientiert. Eine sehr gute Möglichkeit sind neue Onlinekurse, die kostenlose, flexibel und von den weltbesten Professoren (Stanford, Harvard, MIT) konzipiert wurden.

Das beste Angebot für den ‚modernen CEO‘ ist Udacity. Dort wird ein einfacher Python-Kurs angeboten. Dieser erklärt die Grundlagen der Programmierung (vergleichbar mit einer Einführungsveranstaltung einer Universität) und führt direkt durch ein eigenen Projekt (ein eigener  Webcrawler). Diese Projekt kann praktisch verwendet werden, und fördert das Verständnis von modernen Technologie (insbesondere Big Data). Alternativ gibt es Coursera, unterstützt durch die Princton Univerity und Stanford University.
In Zukunft werde ich meine Erfahrungen und Lernstrategien für Onlinekurse in diesem Blog teilen. Zur Zeit nehme ich an ‘Intro to Computer Science’ teil, und muss sagen das es eine kompakte und effiziente Version meines sehr ausführlichen Einführungskurs an der LMU München.

Beispiel in meinem Leben in denen mir Programmierung viel Arbeit erspart hat: Invertierung einer Matrix mit mehreren Millionen Einträgen, Berechnung und Kombination neuer Matrizen, Erstellung von standardisierten auf den Kunden personalisierter Pausentationen, Kundenakquise-Mails und der automatischen Identifikation von Kontaktdaten von relevanten Ansprechpartner.