The Ten Paramis

I learned about the paramis when I partook my first Vipassana meditation retreat. A parami is a good mental quality that one must practice and perfect in order to attain liberation.

The 10 paramis are as follows:

  1. Generosity, giving (dana): giving for the sake of giving.
  2. Morality (sila): lead a moral life and follow the 5 precepts
  3. Renunciation (nekkhamma): drop attachment to your personal belongs and lead a generous life. Give and volunteer whenever you can.
  4. Wisdom (panna): participate in wholesome learning. The ultimate knowledge and wisdom comes from within. Hence, practicing the insight meditation helps achieving true wisdom.
  5. Energy/Effort (viriya): conserve your energy and do wholesome activities. Work hard and earn your livelihood. Help others.
  6. Patience/Tolerance (khanti): replace anger and frustration with patience, forgiveness and compassion.
  7. Truthfulness (sacca): every action should come from a place of truthfulness. Prejudice blinds you from the truth.
  8. Determination (adhitthana): success does not come easily. Stay determined and remember that success begets success.
  9. Loving-kindness (metta): or self-less love. Practice loving without expecting anything in return.
  10. Equanimity (upekkha): nothing in life is permanent. Learn to recognize the impermanence and stay equanimous

May all beings be happy!

You might also like:

The Maori Wisdom – Youth Talks – Age Teaches

Little dogs make most noise.
No one needs help to get into trouble.
The God of evil and the God of fear are good friends.
An idle young man – an unhappy old man.
Never be late to a battle to win it.
A piegon won’t fly into a wide open mouth.
Wishing never filled a game bag.
An obedient wife commands her warrior.
Beauty won’t fill te puku (stomach).
Today’s meal is better than tomorrow’s feast.
The brighther the clearing the darker the shadows.
Chase two Moas – catch none.
Time to dream when you are dead.
The widest mouth has the widest grave.
One rotten fish, one fresh fish – two rotten fish.
A warrior without courage has a blunt taiaha (spear).
Great griefs are silent.
A fine food house doesn’t fill itself.
No twigs on the fire – no flame.
A bad thing usually costs a lot.
A wise man knows both pain and joy.
The little wedge reduces the mighty Kauri.


You might also like:

7 Rules of Life

  1. Make peace with your past so it does not disturb your future.
  2. What others think of you is none of your business.
  3. The only person in charge of your happiness is you.
  4. Don’t compare your life to others, comparison is the thief of joy.
  5. Time heals almost everything. Give it time.
  6. Stop thinking too much: it is okay not to know all the answers.
  7. Smile. You don’t own all the problems in the world.

You might also like:

Story: Do you have an email account?

Once upon a time, a man was looking for a job. He reads about an office boy position in Microsoft Corporation. He applies and soon enough he lands an interview.
The interviewer starts asking the man some questions and then notices that the man forgot to fill in his email address.

  • The interviewer: “Oh, it seems you forgot to type in your email address”
  • The man: “No I did not forget. Actually, I don’t have an email account”
  • The interviewer: “You don’t have an email? Well sorry, you cannot work for Microsoft in that case”

Continue reading “Story: Do you have an email account?”

Strange posters on the street – revcom.us

I was walking back home one night and I noticed a torn down poster about capitalism, the corrupt leaders and what not.

This one talks about Gaza:

This one talks about what employees of the system do:

This one talks about capitalism:

So as it turned out, and after research, that these posters originated from the revcom.us website:

Interested? Not interested? Check for yourself.

You might also like:

7 dangers to human virtue – Gandhi

The 7 dangers to human virtue are:

  1. Wealth without work
  2. Pleasure with conscience
  3. Knowledge without character
  4. Business without ethics
  5. Science without humanity
  6. Religion without sacrifice
  7. Politics without Principle

You might also like:

One theory about why numbers are written the way they are

Many years ago, I was reading in Thiaoouba Prophecy book by Michael Desmarquet. A very nice book.

Anyway, in that book, there was a mention about numbers and why they are written the way they are. The alien in the book explains that the numbers are written like this because of the number of angles each number have:

You might also like:

strtok() C++ wrapper

In this article, I share with you a simple C++ class that wraps the string tokenization function strtok(). The QuickTokenizer class makes it easy to tokenize and enumerate the tokens in a thread-safe manner.

The class code

//////////////////////////////////////////////////////////////////////////
class QuickTokenizer
{
private:
  char *buf;
  char *token;
  char *ctx;

  void FreeBuffers()
  {
    if (this->token != NULL)
    {
      free(this->token);
      this->token = NULL;
    }
    if (this->buf != NULL)
    {
      free(this->buf);
      this->buf = NULL;
    }
  }

public:
  QuickTokenizer() : buf(NULL), token(NULL)
  {

  }

  const char *Tokenize(
    const char *str,
    const char *tok)
  {

    this->buf = _strdup(str);
    this->token = _strdup(tok);

    return strtok_s(buf, token, &ctx);
  }

  const char *NextToken()
  {
    return strtok_s(NULL, token, &ctx);
  }

  ~QuickTokenizer()
  {
    FreeBuffers();
  }
};

Continue reading “strtok() C++ wrapper”

Detect executable format using Python

In this article, I am sharing with you a small Python script that lets you detect if a file is an executable file and what platform the executable is targeting.

The following formats for 32 bits and 64bits processors are supported:

  • Mach-O files: both regular and universal formats
  • Windows PE files
  • Linux ELF files

The script

#---------------------------------------------------------------------
EXEFLAG_NONE        = 0x0000
EXEFLAG_LINUX       = 0x0001
EXEFLAG_WINDOWS     = 0x0002
EXEFLAG_MACOS       = 0x0004
EXEFLAG_MACOS_FAT   = 0x0008
EXEFLAG_32BITS      = 0x0010
EXEFLAG_64BITS      = 0x0020

# Keep signatures sorted by size
_EXE_SIGNATURES = (
    ("\x4D\x5A", EXEFLAG_WINDOWS),
    ("\xCE\xFA\xED\xFE", EXEFLAG_MACOS | EXEFLAG_32BITS),
    ("\xCF\xFA\xED\xFE", EXEFLAG_MACOS | EXEFLAG_64BITS),
    ("\xBE\xBA\xFE\xCA", EXEFLAG_MACOS | EXEFLAG_32BITS | EXEFLAG_MACOS_FAT),
    ("\xBF\xBA\xFE\xCA", EXEFLAG_MACOS | EXEFLAG_64BITS | EXEFLAG_MACOS_FAT),
    ("\x7F\x45\x4C\x46\x01", EXEFLAG_LINUX | EXEFLAG_32BITS),
    ("\x7F\x45\x4C\x46\x02", EXEFLAG_LINUX | EXEFLAG_64BITS)
)

def get_exeflags(filepath):
    try:
        with open(filepath, "rb") as f:
            buf = ""
            buf_len = 0
            for sig, flags in _EXE_SIGNATURES:
                sig_len = len(sig)
                if buf_len < sig_len:
                    buf += f.read(sig_len - buf_len)
                    buf_len = sig_len

                if buf == sig:
                    return flags
    except:
        pass

    return EXEFLAG_NONE

Continue reading “Detect executable format using Python”

Takeaways from the “California Driver Handbook 2017”

In this article, I share with you my notes from the “California Driver Handbook 2017“. Perhaps it will come in handy when you are preparing for the driving test in California:

Notes:

  • Speed limit
    • The maximum speed limit on most California highways is 65 mph. You may drive 70 mph where posted. Unless otherwise posted, the maximum speed limit is 55 mph on a two-lane undivided highway and for vehicles towing trailers.
    • California has a “Basic Speed Law.” This law means that you may never drive faster than is safe for current conditions. For example, if you are driving 45 mph in a 55 mph speed zone during a dense fog, you may be cited for driving “too fast for conditions.”
    • The speed limit in any alley is 15 mph.
    • Business or Residential Districts: The speed limit is 25 mph, unless otherwise posted.
  • Stopping and safe distance
    • At 55mph, it takes about 400 feet to react and bring the vehicle to a complete stop, and at 35mph, it takes about 210 feet.
  • Pedestrians, bicyclists
    • Pedestrians, bicyclists, or other vehicles alongside you may experience sudden strong winds when passing or being passed. Slow down and pass safely, and pass only at a safe distance (typically 3 feet or more for bicyclists).
  • Blind Intersections
      The speed limit for a blind intersection is 15 mph. An intersection is considered “blind” if there are no stop signs at any corner and you cannot see for 100 feet in either direction during the last 100 feet before crossing.
  • Near animals
    • If you see a stray animal in your path, slow down or stop if it’s safe. Do not swerve as you may lose control of your vehicle and cause an accident.

Continue reading “Takeaways from the “California Driver Handbook 2017””

Batchography: Embedding Python scripts in your Batch file script

I keep writing about Batch programming, so it is obvious by now that Batch files programming has become one of my favorite activities. Every time I have to write a quick script to automate a task, I go first for the Batch files programming language. If that does not do the job, I use the Python programming language and if that fails, I go for C/C++ before deciding to writing using the assembly language.

Now, what about combining the two languages to achieve what you want?

That’s today’s topic. It is an excerpt from Chapter 4 in the Batchography book. Continue reading “Batchography: Embedding Python scripts in your Batch file script”

Quotes for the last Sunday of April 2017

  • The generous is courageous from the heart and the stingy is courageous by the looks
  • He who did not make personal efforts to learn on his young age will not make efforts to learn at his older age
  • He who defies his parents will get the same treatment from his own children
  • The fool stands upfront in the line so people can see him and the wise stands behind the crowd so he can see the people
  • Don’t flatter the day before it sets and don’t flatter the woman before she dies
  • Only in the hard times that true friends are known
  • Nice words open doors of steel
  • God only thanks those who thank the common people
  • You can fool all the people some of the times, or you can fool some people all the time, but you cannot fool all the people all the time
  • Never trust a friend without experiencing his true friendship and never underestimate an enemy until you test his/her strength

You might also like:

The most important organ – an anecdote

I read this nice anecdote while waiting at my friend’s business the other day:

One day, the body got together and decided to have a board meeting.

Here’’s what went on behind closed doors.

There was intense discussion to determine who was the most important part of the body.

The BRAIN was the first to speak: without me, nothing would be accomplished.”

Then, the HEART spoke up: without me pumping blood to your brain, you could not function.”

The ARMS laughed. “You’’re both wrong: without me to put food in the mouth, nothing would work.”

The STOMACH said: “without me, your food would not digest.”

The LUNGS bellowed back: without me, you could’nt breathe.”

The EYES blinked: “without me, you could not see.”

The KIDNEYS snorted: without me, you could not detoxify and eliminate.”

Then, the COLON meekly spoke up: I am important. You need me to eliminate all of the garbage from your systems.”

Everyone laughed and made fun of him. “How can you be as important as we are? You’’re just a smelly old sewer.”

The poor colon, —his feelings were hurt! He turned away and thought: I’ll show them. He then shut down.

Then, he sat back and watched what would happen:

  • The BRAIN was stupefied.
  • The HEART’s beat was weak and irregular.
  • The ARMS were weak and couldn’t move.
  • The LUNGS— their breathing was shallow.
  • The EYES became clouded.
  • The KIDNEYS quit.

Then, the COLON looked around and decided it was time to call another meeting. It wasn’’t too lively this time, but everyone was in total agreement.

THE COLON WAS THE MOST IMPORTANT ORGAN.

You might also like: