Μεταπτυχιακό 2009-2010, Τμήμα Πληροφορικής, ΑΠΘ

Posted by Spyros
on Thursday, May 07

Τα θερμά συγχαρητήρια μου στο τμήμα Πληροφορικής του Αριστοτελείου Πανεπιστημίου Θεσσαλονίκης και τον καθηγητή (και επικεφαλή του τμήματος) κ. Πίττα για την απόφαση απο φέτος (χρονια 2009-2010) το μεταπτυχιακό πρόγραμμα να έχει τις διαλέξεις των μαθημάτων μόνο πρωινές ώρες (9-16:00) και όλες να είναι υποχρεωτικές χωρίς καμία διευκόλυνση για εργαζόμενους.

Ένα ακόμη εύγε που αυτό το μαθαίνει κανείς όταν κάνει την αίτηση (κ πάλι καλα δηλαδη) αφου στην ιστοσελίδα δεν αναφερεται πουθενα.

Είστε ωραίοι παίδες. Αλήθεια ποιοί θέλετε να κάνουν το μεταπτυχιακό σας; Μπαρμεν και σερβιτόροι (με όλο το σεβασμό δηλ); Μήπως θα ήταν ποιό έξυπνο να συνδέσετε επιβραβευτηκά το μεταπτυχιακό με σχετική επαγγελματική δραστηριότητα αντί να την τιμωρείτε?

Καλόν ύπνο.

Mephisto Contact form plugin 0

Posted by Spyros
on Monday, February 23

Being very much into Mephisto lately, I came across James Crisp’s contact form plugin. As my needs are multisite-oriented, I forked and tweaked it as needed. You can find it here

How to fix broken article versions in emk/mephisto edge (post 0.8.1)

Posted by Spyros
on Thursday, February 19

UPDATE March 15, 2009: Good news, Eric Kidd informed me that the patch has been applied to mephisto edge, commit

Currently in mephisto edge, which is maintained and developed by Eric Kidd (aka emk) article versions are broken. More precisely, the bug comes up ONLY when the installation operates in multisite mode (or even more precisely, when there are at least two articles belonging to two different sites).

After reporting the ticket on lighthouse I found out what the bug was. So..

The problem is how acts_as_versioned is being used. An acts_as_versioned record has among others an “id” column (the default id that ActiveRecord requires) and a “version” column.

Currently Mephisto falsely does the following inside \app\controllers\admin\articles_controller.rb on line 38 (edit action)...

@version = params[:version] ? @article.versions.find(params[:version]) : @article or raise(ActiveRecord::RecordNotFound)

the whole problem is the find(params[:version]) . What happens here is, that we lookup an article’s version by searching for its id instead of for its version column (even though we do use the correct :version parameter.)

So this has to change to find_by_version(params[:version]) and thus become..

@version = params[:version] ? @article.versions.find_by_version(params[:version]) : @article or raise(ActiveRecord::RecordNotFound)

Notice though that this doesn’t break in a single-site installation, because in this case id and version bot get the same (concurrent) increment. That is because all articles belong the same one and only Site instance.

‘nough said, voila le patch

Using error codes for ActiveRecord validations

Posted by Spyros
on Tuesday, February 10

While working on the unit tests of Lele I had the situation where I wanted to differentiate among several validation errors a specific field might have.

Since I didn’t want to start comparing error messages contained in model.errors I came up with the following petit hack

For each validation error I cared about detecting (mostly the custom ones) I did the following…

inside say model Private.rb
def validate
  errors.add(:joined, "Run for your life!!!"+ercode(123)) if  grenade.released? 
end

Now what’s ercode(123) ? The argument is arbitrary, ercode is the following method monkey patch of ActiveRecord inside /config/initializer/application.rb

class ActiveRecord::Base
  def ercode(code)

    #turn an integer like '1' into a string like '01'
    str_code = (code <10 ? "0"+ code.to_s : code.to_s)    

    ENV['RAILS_ENV'] == "test" ?  str_code : "" # I only want this when testing
  end
end

Given this, inside private_test.rb I can check whether a particular validation has been triggered by detecting its error code inside the models error strings.

For example…

def test_custom_validations
  ...
  assert_error_code(private, 123)
end

def assert_error_code(model, code)
  assert model.errors.full_messages.join("").include?(code.to_s) # test wether too long left  
end

Mephisto Multisite, Passenger, Apache2

Posted by Spyros
on Thursday, February 05

Here is my vhost file for using a multisite installation (default nowdays with Mephisto 0.8.1) being served by apache 2 and passenger. Don’t forget to a2ensite foo.com your domain, for apache to pick it up.


NameVirtualHost *:80

<VirtualHost *:80>
 ServerName coderado.com 
 ServerAlias www.coderado.com
 RailsEnv production
 DirectorySlash Off

 DocumentRoot /var/apps/m8/public
 ErrorLog /var/apps/m8/log/apache.log
 CustomLog /var/apps/m8/log/access.log combined

 <Directory /var/apps/m8/public>
  Options FollowSymLinks
  AllowOverride None
  Order allow,deny
  Allow from all
 </Directory>

 RailsAllowModRewrite on
 RewriteEngine On
 # Rewrite / to index.html

 RewriteCond %{REQUEST_URI} ^/assets/.*$
 RewriteCond %{DOCUMENT_ROOT}/assets/%{HTTP_HOST}/$1 -f
 RewriteRule ^/assets/(.*)$ /assets/%{HTTP_HOST}/$1 [QSA,L]

 RewriteCond %{REQUEST_URI} ^/$
 RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/index.html -f
 RewriteRule ^/(.*)$ /cache/%{HTTP_HOST}/index.html [QSA,L]

 RewriteCond %{REQUEST_URI} ^/[^.]+$
 RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_FILENAME}.html -f
 RewriteRule ^/(.*)$ /cache/%{HTTP_HOST}%{REQUEST_FILENAME}.html [QSA,L]

 RewriteCond %{REQUEST_URI} ^/.+$
 RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_FILENAME} -f
 RewriteRule ^/(.*)$ /cache/%{HTTP_HOST}%{REQUEST_FILENAME} [QSA,L]

</VirtualHost>

Installing Nokogiri gem on debian 4

Posted by Spyros
on Tuesday, February 03

Mephisto 0.8 requires nokogiri. Apparently a simple gem install nokogiri is not enough.

here’s what is…

  • sudo apt-get install libxml2-dev libxslt1-dev
  • sudo gem install nokogiri

make mephisto search case insensitive

Posted by Spyros
on Sunday, January 25

small hack applies to mephisto 0.8.1.

around line 76 in mephisto_controller.rb the case sensitive code…

conditions     = ['(published_at IS NOT NULL AND published_at <= :now) AND (title LIKE :q OR excerpt LIKE :q OR body LIKE :q)',

has to become…

conditions     = ['(published_at IS NOT NULL AND published_at <= :now) AND (lower(title) LIKE lower(:q) OR lower(excerpt) LIKE lower(:q) OR lower(body) LIKE lower(:q))',

this downcases all strings before comparing.

trouble switching from sqlite to mysql

Posted by Spyros
on Tuesday, October 28

UPDATE 9/3/2009

So you’re happily rake test ing the shit out of your app, and see nothing but dots.. Then cap deploy and you see nothing.. at all!

Why you ask? I’ll tell ya.

Using Rails 2.1.0 on my dev box, I ran sqlite as dev and test db. All was fine and happy.

Then deployed (to mysql) and all hell broke loose. Looks like Mysql doesnt like lines such as

 named_scope :exclude, lambda {|id| { :conditions => ['id <> ?', id] }  } 

Instead, it prefers

named_scope :exclude, lambda {|id| { :conditions => ['`services`.id <> ?', id] }  }

weird huh?

LeLe, private's facebook

Posted by Spyros
on Saturday, October 18

It’s been a month since the launch of LeLe, our social networking app for former privates of the greek army. People haven’t quite embraced it yet but that shouldn’t keep us from evolving it, should it? No Sir!

So in that spirit, as of yesterday we support OpenID on it, cause no one needs another password. Next step is to enhance its TDD with some shoulda magic (check this comparison by josh susser )

cheers

you gotta... shock the monkey!

Posted by Spyros
on Sunday, September 07

Peter Gabriel sang about it… , so I thought I’ll do the coding part ;)

Through coderado, happily presenting monkey chord. In a nutshell: it transposes music chords found inside a webpage.

So grab your guitar mate…

web app implementation footprint

Posted by Spyros
on Wednesday, August 13

I was just browsing Geoffrey Grosenbach’s wonderful nubyonrails and that “Manufactured with” in the left bottom corner got me interested.

It’s nothing new of course for someone to post info regarding implementation aspects such as tools used on a site. But I wonder if there such thing somewhere somehow centralized…? Sounds like a new pet project.

back to live

Posted by Spyros
on Friday, August 08

Yes Sir (sic!) the greek army finally released me into this dirty little country again! One year surely was too much. Next target, self-reformation. And whilst at it, just got into mephisto again.. god i hate liquid (hail haml)!

OpenID is getting better and better

Posted by Spyros
on Friday, August 08

More major sites are already jumping on the openID wagon. Of course one could argue that this was just a matter of time.

In my eyes though the latest n greatest is PhoneFactor and it’s CallVerifID. Single sign on can’t get any better. Can’t wait to see Greece on the list.

Πρακτική, SAP Germany

Posted by Spyros
on Sunday, July 20

Αν και πάει ένας χρόνος και βάλε απο τοτε που έκανα την πρακτική μου, ορίστε μια μικρή ανασκόπηση…

Η πρακτική ήταν εξάμηνη και μέρος του προγράμματος σπουδών μου στο Τμήμα Πληροφορικής στο ΤΕΙ Θεσσαλονίκης. Περισσότερα για τις σπουδές σε άλλο άρθρο.

Εχουμε κ λέμε λοιπόν

Που

Στα κεντρικά της SAP, Walldorf στη Γερμανία

Πότε

Σεπτέμβριος 05 – Φεβρουάριος 06

Τι είναι η SAP

Η τρίτη μεγαλύτερη εταιρία πληροφορικής στον κόσμο, και η μεγαλύτερη στην ευρώπη. Παράγει Business Software (ERP, CRM, SCM), δηλ τα πακέτα λογισμικού που τρέχουν εταιρίες όπως η Porsche, η Intel, η Adidas κτλ.

Τμήμα

Quality Management for CRM. ECommerce and Channel Management Solutions.

Πώς

Μπήκα εδώ βρήκα θέση της αρεσκείας μου, έκανα αίτηση, πέρασα τηλεφωνική συνέντευξη με δύο μανατζερ, πήγα. Η όλη διαδικασία απο την αρχική αίτηση μέχρι την απάντηση ήταν περίπου τρείς (3) μήνες.

Τι δουλειά έκανα εκεί

Χωρίς να μπορώ να μπω σε λεπτομέρειες, ενόσω ήμουν εκεί η ομάδα μας έτρεχε τα τρία τελευταία Service Packs για το CRM 5.0. Τεστάραμε fixes κτλ Αργότερα συμμετείχαμε στις διαδικασίες σχεδίασης και ανάλυσης του CRM5.1 για τις τηλεπικοινωνίες κινητής. Επίσης διοικούσαμε ομάδες testing στην Ινδία.

Εντυπώσεις, Εταιρική κουλτούρα

Στη SAP ενδοεταιρικά απευθύνεσαι σε όλους με το μικρό τους όνομα. Αυτό διότι θέλουν τα κανάλια επικοινωνίας και ανταλλαγής πληροφοριών να έχουν την μικρότερη δυνατή αντίσταση! Πολύ ενδιαφέρουσα εμπειρία. Περαιτέρω, όλος ο τρόπος διοίκησης και λειτουργίας έβαζε τον εργαζόμενο στο επίκεντρο. Ένα απο τα πράγματα που μου έκαναν αίσθηση ήταν το πως εμείς “παίζαμε” με προϊόντα και τεχνολογίες που η αγορά θα τα έβλεπε δυο χρόνια αργότερα. Επίσης άνθρωποι έφευγαν και έρχονταν διαρκώς. Ενδοεταιρικά και απο έξω. Κινητικότητα φοβερη. Ήταν η νοοτροπία τέτοια που όλοι τολμούσαν τις αλλαγές. Ουσιαστικά απο το γραφείο μας (είμασταν τρεις πρακτικάριοι) πέρασαν σε έξι μήνες 10 άτομα που έμειναν απο μια βδομάδα μέχρι 2 μήνες. Ακόμη είδα πως δουλεύει μια κυριολεκτικά παγκοσμιοποιημένη (ίσως όσο καμία άλλή) επιχείρηση. Στην ημερήσια διάταξη ήταν η συνεργασία με ανθρώπους απο το Palo Alto, το Bangalore και όλη την Ευρώπη.

Γλώσσα

Προσωπικά μιλάω Γερμανικά και Αγγλικά, άλλα υπήρχαν συνάδελφοι που μιλούσαν μόνο Αγγλικά. Κυρίως Ινδοί και Αμερικάνοι.
  1. το να μιλήσει κανείς αγγλικά με Ινδό ειναι εμπειρία!
  2. άλλα και οι Γερμανοί δε πανε πίσω (βλ βίντεο)!

Πως πάει κανείς στο εξωτερικό για πρακτική?

  • Βρίσκει τη θέση μόνος του και πηγαίνει κανονικα
  • Μέσω του προγράμματος Leonardo (κάτι σαν Erasmus για πρακτικές) όπου και πάλι αναζητεί τη θέση μόνος του άλλα πληρώνεται απο το πρόγραμμα αντι απο τον εργοδότη.

Εγώ εκάνα το πρώτο καθώς βαριέμαι την γραφειοκρατία που συνεπάγεται το δεύτερο.

Χρήματα

Εκείνο το καιρό η SAP πλήρωνε 800€ συν ενοίκιο έως 300€ (γαμάτο?). Παραπάνω απο αρκετά για να περάσει κανείς καλα στη Heidelberg.

Αστυνομία! Ψήλα τα χέρια!

Posted by Spyros
on Friday, July 04

Θεσσαλονίκη 2 Ιουλίου 2007, Βασιλικό Θέατρο ώρα 22:30 το βράδυ.

Περνάω μπροστα απο την είσοδο του θεάτρου αργα με το ποδήλατο, ενα ζευγαρι στεκεται και βλέπει έναν τύπο να σπαει το λουκέτο ενος ποδηλάτου με έναν κόπτη. Τον ρωτάνε “τι κάνεις εκει? πας να το κλεψεις?” ή κάτι τέτοιο. Ο τύπος με σπαστα ελληνικά λεει πως έχασε τα κλειδια και συνεχίζει αταραχος. Φυσικά δε πειθεται κανεις. Παρόλα αυτα το ζευγαρι την κανει!! Εγω παω πιο περα, τηλεφωνώ στο 100 κ καθώς ο φίλος μας καβαλαει το ποδήλατο κ ξεκιναει τον παιρνω απο πίσω. Λίγο πιο περα (στα γρασίδια πισω απο το άγαλμα του Μεγ Αλεξανδρου) αφήνει κάτω απο ένα δενδρο το ποδήλατο και ο ίδιος πηγαινει πιο περα στα 30 μετρα και καθεται σε κατω απο ενα αλλο δεντρο σε μια παρεα με 5-6 άτομα της “διαλογής” του. Εικοσι με τριαντα κατι, κλεφτρονοκόπανοι. Έχοντας υποψη οτι Ζ-ητάδες (Αμεση Δραση) την στήνουν συνήθως εξω απο το Μακεδονία Παλας κοιτουσα προς τα εκει και πραγματι ερχοντουσαν. Κατευθύνομαι προς αυτούς τους σταματαω κ τους ενημερωνω. Τελικα για να μην τα πολυλογώ ο τύπος συλλήφθηκε και οι Αστυνομία πηρε το ποδήλατο. Εγώ γύρισα στο Βασιλικό και κατω απο το λουκετο (που το κλεφτρόνι είχε το θρασσος να το αφήσει) έγραψα και αφησα ενα χαρτακι ωστε ο ιδιοκτήτης να απευθυνθεί στο 100 για να παρει το ποδήλατο του πίσω.

Εν κατακλείδι: η αστυνομία έδρασε τάχιστα αλλα.. έπρεπε καποιος να την ειδοποιήσει! Δηλαδή έλεος, είδαν οτι ο αλλος εκλεβε και δεν κανανε τίποτα! Αν οχι εσυ και εγω τοτε ποιος?

Αυτα!