суббота, 17 декабря 2011 г.

ASCII Codes for the Greek Alphabet

Α - &# 913; - Greek capital Alpha 
α - &# 945; - Greek lower case alpha 

Β - &# 914; - Greek capital Beta 
β - &# 946; - Greek lower case beta 

Γ - &# 915; - Greek capital Gamma 
γ - &# 947; - Greek lower case gamma 

Δ - &# 916; - Greek capital Delta 
δ - &# 948; - Greek lower case delta 

Ε - &# 917; - Greek capital Epsilon 
ε - &# 949; - Greek lower case epsilon 

Ζ - &# 918; - Greek capital Zeta 
ζ - &# 950; - Greek lower case zeta 

Η - &# 919; - Greek capital Eta 
η - &# 951; - Greek lower case eta 

Θ - &# 920; - Greek capital Theta 
θ - &# 952; - Greek lower case theta 

Ι - &# 921; - Greek capital Iota 
ι - &# 953; - Greek lower case iota 

Κ - &# 922; - Greek capital Kappa 
κ - &# 954; - Greek lower case kappa 

Λ - &# 923; - Greek capital Lamda 
λ - &# 955; - Greek lower case lamda 

Μ - &# 924; - Greek capital Mu 
μ - &# 956; - Greek lower case mu 

Ν - &# 925; - Greek capital Nu 
ν - &# 957; - Greek lower case nu 

Ξ - &# 926; - Greek capital Xi 
ξ - &# 958; - Greek lower case xi 

Ο - &# 927; - Greek capital Omicron 
ο - &# 959; - Greek lower case omicron 

Π - &# 928; - Greek capital Pi 
π - &# 960; - Greek lower case pi 

Ρ - &# 929; - Greek capital Rho 
ρ - &# 961; - Greek lower case rho 

Σ - &# 931; - Greek capital Sigma 
σ - &# 963; - Greek lower case sigma 
ς - &# 962; - Greek lower case final sigma 

Τ - &# 932; - Greek capital Tau 
τ - &# 964; - Greek lower case tau 

Υ - &# 933; - Greek capital Upsilon 
υ - &# 965; - Greek lower case upsilon 

Φ - &# 934; - Greek capital Phi 
φ - &# 966; - Greek lower case phi 

Χ - &# 935; - Greek capital Chi 
χ - &# 967; - Greek lower case chi 

Ψ - &# 936; - Greek capital Psi 
ψ - &# 968; - Greek lower case psi 

Ω - &# 937; - Greek capital Omega 
ω - &# 969; - Greek lower case omega

понедельник, 5 декабря 2011 г.

как жаль, все только начало получаться...

понедельник, 6 июня 2011 г.

BackupYourSystemTAR

tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --exclude=/proc --exclude=/lost+found --exclude=/sys --exclude=/mnt --exclude=/media --exclude=/dev / 
Restore:
tar -xvpzf /home/test/backup.tar.gz -C /
mkdir /proc /lost+found /sys /mnt /media

четверг, 2 июня 2011 г.

OMG, pointer to member

struct foo
{
public:
    int d;
    std::string s;
};

struct comparator;
struct comparator_proxy
{
    comparator const *ptr;
public:
    comparator_proxy(comparator const *ptr) : ptr(ptr) {}
    bool operator()(foo const &a, foo const &b) const;
};

struct comparator
{
    virtual ~comparator() {}
    virtual bool operator()(foo const &, foo const &) const = 0;
    comparator_proxy proxy() const
    {
        return comparator_proxy(this);
    }
};

bool comparator_proxy::operator()(foo const &a, foo const &b) const
{
    return (*ptr)(a, b);
}


template<typename T>
struct member_comparator : comparator
{
    T foo::*data;

    explicit member_comparator(T foo::*data) : data(data) {}
    
    bool operator()(foo const &a, foo const &b) const 
    {
        return a.*data < b.*data;      
    }
};


template<typename T>
std::auto_ptr<comparator> make_member_comparator(T foo::*ptr)
{
    return std::auto_ptr<comparator>(new member_comparator<t>(ptr));
}

struct boo
{
    std::vector<foo> arr;

    void sort_by(int num)
    {
        static std::auto_ptr<comparator> member[] = {
            make_member_comparator(&foo::d),
            make_member_comparator(&foo::s),
        };
        std::sort(arr.begin(), arr.end(), member[num]->proxy());
    }
};
@from

суббота, 1 января 2011 г.

Nice tip

After accidentally rebooting the wrong server a couple times, forgetting what I had ssh’ed to, I decided on a handy fix, this /usr/local/bin/confirm script:
#!/bin/sh
echo "You are about to run the command '$*' on `hostname`." >&2
echo -n "Are you sure this is what you want to do? (Y/N): [N] " >&2
read x || exit
case "$x" in
[Yy]*)  exec "$@" ;;
*)      echo "Command '$*' aborted." >&2  ; exit 1 ;;
esac
Now, on my servers I add these aliases to root’s .bashrc file:
alias halt=’confirm halt’; alias reboot=’confirm reboot’
That’s saved me a few times since then. The .bashrc file also already had the “alias rm=’rm -i’” in there, which at first I hated, but learned to like it after it too saved my skin on more than one occasion.
@via http://www.cyberciti.biz/tips/my-10-unix-command-line-mistakes.html

суббота, 20 ноября 2010 г.

вторник, 2 ноября 2010 г.

Fix log4j.dtd warning in eclipse

The file cannot be validated as the XML definition "/home/drsm/work/workspace/sts2/kgdnp/src/main/java/log4j.dtd (No such file or directory)" that is specified as describing the syntax of the file cannot be located.

you can fix this by manually adding new XML catalog entry to STS. Open the preferences and navigate XML -> XML Catalog and click add to the following entry:

Location: jar:file:/home/drsm/devtools/sts/sts-2.5.0.M3/plugins/org.apache.log4j_1.2.15.v201005080500.jar!/org/apache/log4j/xml/log4j.dtd
(you need to modify this to reflect your installation path)
Key Type: Public ID
Key: -//APACHE//DTD LOG4J 1.2//EN

Now click OK and if everything goes well you see the new entry the User Specified Entries with no red cross indicating an issue.

@from