Saturday, April 15, 2017

Filippos article compression method Fz

Target: to better compress articles
Method: using Zipf law
Name: Fz ( my proposal is the file extension to be fzt )
Description: In an article, the 128 most common words represents about the half of the article.
If we represent these words and their trailing space, with a number 0-127 in ascii text or 0-32767 in utf8 and a marker then we will save a lot of space for other compression methods.
Header: In the header we should refer the text language.
Alice was published in 1865, three years after Charles Lutwidge Dodgson and the Reverend Robinson Duckworth rowed a boat up the Isis on 4 July 1862[3] (this popular date of the "golden afternoon"[4] might be a confusion or even another Alice-tale, for that particular day was cool, cloudy, and rainy[5]) with the three young daughters of Henry Liddell (the Vice-Chancellor of Oxford University and Dean of Christ Church): Lorina Charlotte Liddell (aged 13, born 1849, "Prima" in the book's prefatory verse); Alice Pleasance Liddell (aged 10, born 1852, "Secunda" in the prefatory verse); Edith Mary Liddell (aged 8, born 1853, "Tertia" in the prefatory verse).[6]

The journey began at Folly Bridge in Oxford and ended 3 miles (5 km) north-west in the village of Godstow. During the trip, Dodgson told the girls a story that featured a bored little girl named Alice who goes looking for an adventure. The girls loved it, and Alice Liddell asked Dodgson to write it down for her. He began writing the manuscript of the story the next day, although that earliest version no longer exists. The girls and Dodgson took another boat trip a month later when he elaborated the plot to the story of Alice, and in November he began working on the manuscript in earnest.[7]

To add the finishing touches, he researched natural history for the animals presented in the book, and then had the book examined by other children—particularly the children of George MacDonald. He added his own illustrations but approached John Tenniel to illustrate the book for publication, telling him that the story had been well liked by children.[7]

On 26 November 1864, he gave Alice the handwritten manuscript of Alice's Adventures Under Ground, with illustrations by Dodgson himself, dedicating it as "A Christmas Gift to a Dear Child in Memory of a Summer's Day".[8] Some, including Martin Gardner, speculate that there was an earlier version that was destroyed later by Dodgson when he wrote a more elaborate copy by hand.[9]

But before Alice received her copy, Dodgson was already preparing it for publication and expanding the 15,500-word original to 27,500 words,[10] most notably adding the episodes about the Cheshire Cat and the Mad Tea-Party.

The text above, extracted from Wikipedia article, in ascii was 2230 characters long and after 7z LZMA compression 1327 chars.
After Fz, the text is now 2106 characters long and after 7z LZMA compression is 1288 chars.
So, Fz compression is about 5.56% more efficient when comes to text and 2.94% better when used in 7z LZMA.

Program in PHP: (matrix.csv constructed using the table in using only 128 words in an array)
$csv= file_get_contents($file);
$array0 = array_map("str_getcsv", explode("\n", $csv));
$article= file_get_contents($file);
foreach (explode("\n", $article) as $keya => $vala ) {
  foreach ( $array as $key => $val ) {
    foreach ( $array0 as $key0 => $val0 ) {
        $nv=preg_replace($repl, $key0, $val );
        if($nv != $pval) {
            $outp.= "#".chr($nv);
    if(!$found) $outp.= $val;
    $outp.=" ";
file_put_contents($outfile, $outp);

License GNU/GPL3 :

Copyright (C) 2017  Filippos Filippides

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see \\.
UPDATE: The project is on github @filipposfilippides/fz  

Sunday, May 11, 2014

a new company tax computation

Nowadays we can keep record of nearly everything.

Of course we can keep record of shareholders and tax them, instead to tax the companies with a flat rate.

Then the profits would be taxed according total income of the individuals and paid by the companies proportionally.

Wouldn't this be a fair company tax?

we have 2 companies A & B with 2 shareholders x & y
x has 50% of company A and y has the other 50%
but x has 100% of company B

Nowadays we tax A & B with the same rate of say 30% but with the new computation this varies according total income of x & y, so x will pay more than y.

Sunday, March 31, 2013

$ vs € #2

Let's ask ourselves:
Why did the crisis start?
Why continues?
Why they dissolve the Eurozone?
Whyat any cost?
Why $ vs €?
Why Europe?
Why not save health systems, education etc to save the banks?
What there is a difference between other businesses and the banks?
Why banks own other businesses?

Who wins from all this?
Who gains from the crisis?
Who loses from this?
Who loses from the crisis?

Why this crisis, now?

The answers are simple. The crisis benefits the strong, alone. They are behind this crisis.

Last question:
How do we escape from this crisis?
You answer this.

Θα πρέπει να αναρωτηθούμε:
Γιατί έγινε η κρίση;
Γιατί συνεχίζεται;
Γιατί διαλύουν την ευρωζώνη;
Γιατί πάση θυσία €;
Γιατί υπάρχει αντιπαλότητα μεταξύ $ και €;
Γιατί Ευρώπη;

Γιατί να μην σωθούν τα συστήματα υγείας, παιδείας κλπ και να σωθούν οι τράπεζες;
Ποια είναι η διαφορά των άλλων επιχειρήσεων με τις τράπεζες;
Γιατί οι τράπεζες έχουν και άλλες επιχειρήσεις;

Ποιος κερδίζει από όλα αυτά;
Ποιος κερδίζει από την κρίση;
Ποιος χάνει από όλα αυτά;
Ποιος χάνει από την κρίση;

Γιατί τώρα, κρίση;

Η απαντήσεις είναι απλές. Η κρίση ωφελεί τους ισχυρούς και μόνο. Πίσω από την κρίση βρίσκονται αυτοί.

Τελευταία ερώτηση:
Πώς φεύγουμε από την κρίση;

Ο καθένας ας δώσει την απάντηση που νομίζει.

Friday, March 29, 2013

Thucydides - Θουκυδίδης

"Justice will not come to Athens until those who are not injured are as indignant as those who are injured."

"The secret to happiness is freedom. And the secret to freedom is courage."


«H Δικαιοσύνη δεν θα έρθει στην Αθήνα μέχρι αυτοί που δεν έχουν πληγεί, να αγανακτήσουν όσο οι πληγέντες.»

«Το μυστικό στην ευδαιμονία είναι η ελευθερία. Και το μυστικό προς την ελευθερία είναι το θάρρος.»


Saturday, March 2, 2013

Consumerism - Καταναλωτισμός

Consumer society is self destructive because it puts cheap personal satisfaction over the collective wellbeing of the community and when the capitalist crisis comes, everyone goes to shrinks, because the lack of consumerism brings depression.

Your friends become the objects that you buy and when you do, they come close to you, so they are not your friends any more.

This society is a society of fear, a society of individuals that are working together under a boss, but not communicating with each other. We fear the real contact with others, because they told us so.

So, we become slaves. Slaves of the things that they forced us to think as personal satisfaction. Slaves of our personal "needs" that they implant us.

We do not have real friends, but other individuals who's their only purpose is to gain from us. We fear of them, because we are like them, greedy.
If we have no friends we try to interchange them with objects.
The objects don't argue, the objects don't let us down.
Consumerism becomes our friends who endorse us.
Consumerism becomes our friends who love us.

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

Οι φίλοι σας γίνονται τα αντικείμενα που αγοράζετε και όταν το κάνετε, έρχονται κοντά σας, γι 'αυτό δεν είναι οι φίλοι σας πια.

Αυτή η κοινωνία είναι μια κοινωνία του φόβου, η κοινωνία των ατόμων που εργάζονται μαζί κάτω από ένα αφεντικό, αλλά δεν επικοινωνούν μεταξύ τους. Φοβόμαστε την πραγματική επαφή με τους άλλους, γιατί έτσι μας είπαν.

Έτσι, γινόμαστε σκλάβοι. Σκλάβοι από τα πράγματα που μας ανάγκασε να σκεφτούμε ως προσωπική ικανοποίηση. Σκλάβοι των προσωπικών "αναγκών" μας, αυτών που μας εμφυτεύουν.

Δεν έχουμε πραγματικούς φίλους, αλλά μόνο άλλα άτομα που έχουν μοναδικό σκοπό να κερδίσουν από εμάς. Φοβόμαστε, επειδή είμαστε σαν κι αυτούς, άπληστοι.
Αν δεν έχουμε φίλους προσπαθούμε να τους ανταλλάξουμε με αντικείμενα.
Τα αντικείμενα που δεν αντιδρούν, τα αντικείμενα δεν μας απογοητεύουν.
Ο καταναλωτισμός γίνεται οι φίλοι μας που μας υποστηρίζουν.
Ο καταναλωτισμός γίνεται οι φίλοι μας που μας αγαπούν.

Thursday, January 17, 2013


As long as you getting older you foretell the future. This is called experience.
But you never become so good until you are dead.

Sunday, June 3, 2012

$ vs €

Is the crisis a fight $ vs €?
In the last century the world trade with three coins. Dollar, Pound, and Ruble. The Pound after the second world war, lost its value and after the fall of the USSR the dollar was the sole and undisputed winner. 
U.S. had in their hands a currency that said that is stable, but FED might cut as many coins needed. 
U.S. dominance was monetary sovereignty. 

Until Euro came.
 Euro as currency had an advantage against the dollar. There couldn't be multiplied. The wealth of the Euro area countries was became Euro. 
This advantage was so important that many countries replaced the Dollar with the Euro for their transactions. The stability of a currency is very important and promise not to print Euro was decisive, faith is based on the belief of keeping promises.

In recent years the U.S. has issued a $ 1 trillion, and promised that they would withdraw once the crisis ends. 
The Eurozone didn't did the same, so crisis knocked its door.Eurozone faces a daily dilemma: 
Issue new Euro and break promise or fulfillment of promise and poverty. 
If you want the currency to remain global Eurozone must keep its promise and meet its people. Otherwise the experiment a stable global currency that will supplant the dollar will end ingloriously. 
The end of the universality of the Euro does not mean the end of the world or the Eurozone, but neither will signal the end of poverty for citizens of the Eurozone. 
Of course, the Euro Dollar exchange rate will change for the benefit of the dollar. 
This is of the knowledge of the markets anticipate dropping the price of Euro continuously.

Η κρίση είναι ένας πόλεμος $ με €;
Τον τελευταίο αιώνα τα παγκόσμια νομίσματα ήταν τρία. Δολάριο, Ρούβλι και Λίρα. Η Λίρα μετά τον 2ο παγκόσμιο πόλεμο, έχασε την αξία της και μετά την πτώση της ΕΣΣΔ το Δολάριο ήταν ο μόνος και αδιαμφισβήτητος νικητής.
Οι ΗΠΑ είχαν στα χέρια τους ένα νόμισμα που έλεγαν πως μένει σταθερό, αλλά από την άλλη η FED μπορούσε να κόψει όσα νομίσματα ήθελε.
Η κυριαρχία των ΗΠΑ ήταν και νομισματική κυριαρχία.

Μέχρι που ήρθε το Ευρώ.
Το Ευρώ σαν νόμισμα είχε ένα πλεονέκτημα έναντι του Δολαρίου. Δεν μπορούσε να πολλαπλασιαστεί. Ο πλούτος των χωρών της Ευρωζώνης έγινε Ευρώ.
Το πλεονέκτημα αυτό ήταν τόσο σημαντικό που πολλές χώρες αντικατέστησαν το Δολάριο με το Ευρώ για τις συναλλαγές τους. Η σταθερότητα σε ένα νόμισμα είναι πολύ σημαντική και η υπόσχεση ότι δεν θα τυπωθεί Ευρώ ήταν καθοριστική, εξάλλου η πίστη στηρίζεται σε υποσχέσεις που κρατάμε.

Τα τελευταία χρόνια οι ΗΠΑ εξέδωσαν 1 τρις Δολάρια και υποσχέθηκαν πως θα τα αποσύρουν μόλις τελειώσει η κρίση.
Η Ευρωζώνη δεν έκανε όμως το ίδιο και έτσι η κρίση μετακινήθηκε σε αυτή.
Η Ευρωζώνη καθημερινά έρχεται αντιμέτωπη με το δίλημμα : έκδοση Ευρώ και αθέτηση της υπόσχεσης ή τήρηση της υπόσχεσης και ανέχεια.
Αν θέλει το νόμισμά της να παραμείνει παγκόσμιο πρέπει να κρατήσει την υπόσχεση που έδωσε και να αντιμετωπίσει τους πολίτες της. Αλλιώς το πείραμα ενός σταθερού νομίσματος που θα υποκαταστήσει το Δολάριο θα τελειώσει άδοξα.
Το τέλος της παγκοσμιότητας του Ευρώ δεν σημαίνει και το τέλος του κόσμου ή της Ευρωζώνης, αλλά ούτε θα σημάνει και το τέλος της ανέχειας για τους πολίτες της Ευρωζώνης.
Βέβαια, η ισοτιμία Ευρώ και Δολαρίου θα αλλάξει υπέρ του Δολαρίου.
Αυτό το γνωρίζουν οι αγορές που την προεξοφλούν ρίχνοντας την τιμή του Ευρώ συνεχώς.

Wednesday, April 11, 2012

The Knowledge

We humans are social animals who need the approval of all others in order to live in peace. If we become unsocial then we probably go to prison and loose our freedom, or loose the piece that community offers.
It's in our DNA to follow whoever other people follow, because this is the safest, the easiest, the quickest and the economical way to live.
So, we have the tenancy to follow everybody famous. Everybody who has power, or everybody who seams he has power.
Sheep, dogs are social animals too.

When we stand before a problem, we seek for a solution given by someone else. It's the best way to solve a problem.
But, if the problem is new, we stack. At first, we search for an answer to The Knowledge ( our grand father, our dad, our gurus, our customs, our books and nowadays The Internet ), then, we search for an answer to friends and family, at last, we try to think and solve by our own the problem.
So, we use our mind to solve only new or personal problems, that we do not want anyone else to know about.This is the best way to use our mind less, so use less energy.
If the problem overcomes us we stack and wait to see if in the future somebody answers it.
It's very tricky way, but we live without use our mind at all. We do not answer to major problems but we, simply, follow The Knowledge.

On early communities whoever was famous or had muscles, tries to benefit from The Knowledge by making rules, which in time became, the customs, in communities. (The Knowledge = The Customs)
Then they wrote down some of the customs that benefit the leaders and this called law. (The Knowledge = The Law + The Customs).

So, whoever could use The Knowledge became famous, also he could use it for his own benefit.
The Law became the mind or what they want people to obey and The Customs became the DNA. They also broke the authorities apart. Government & Church.

Nowadays, the power came to other forms of communities: The Companies. Small groups of people try to use The Knowledge for their own by forcing rules that became customs to communities.

But, if The Knowledge is against us?


Sunday, April 8, 2012

the solution to the crisis problem

4 hours work ( full salary )
2 hours community work or participation
2 hours cultural activities
8 hours fun
8 hours sleep

Λύση στο πρόβλημα της κρίσης:
4 ώρες εργασία με πλήρη μισθό
2 ώρες κοινωνική εργασία / συμμετοχή σε κοινά
2 ώρες πολιτιστικές δραστηριότητες
8 ώρες διασκέδαση
8 ώρες ύπνο

Thursday, April 5, 2012

Για τον Χριστούλα.

Ο Δημήτρης Χριστούλας δεν πέθανε επειδή δεν μπορούσε να τα βγάλει πέρα.
Ήταν μια πράξη επιθετική προς την κυβέρνηση, το πολιτικό σύστημα.
Ήταν αγανακτισμένος με την κατάσταση και έβλεπε πως κανείς δεν προχωράει μπροστά.
Έβλεπε πως η τελευταία του κίνηση θα μπορούσε να γίνει έναυσμα για αγώνες.
Ζητά από τους νεότερούς του να κινηθούν. 

Να ξυπνήσουν και να ζητήσουν το μέλλον τους πίσω.
Απομένει να ακολουθήσουμε την προτροπή του αυτή.

Open source = Open Mind

My best of Open source: Linux, Firefox, MySQL, Apache, Asterisk, SOX, KDE, Konqueror, WikiMedia, Joomla,

Life equation by Albert Einstein:
Albert_Einstein(MyLife) {
 If(MyLife==Success in life)
  return (A(Work,Play,keep your mouth shut));
  return (B(Work,Play,keep your mouth shut));
A(x,y,z) {
B(x,y,z) {