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

You like cats? You will love Maro(‚ôā) the COSPLAY CAT ūüėļ

I ran into this fun Instagram account about Maro, the cosplay cat!

Check it out here: https://www.instagram.com/rinne172/

You might also like:

6 Takeaways from Apple WWDC 2017

Today was the the WWDC 2017 Apple Event. It was packed with all new interesting features. I am excited about iOS 11 and the upcoming AR and VR stuff.

Another note worthy policy change is that Apple mentioned that it will start allowing in-app purchases. Is that the reason why Amazon Prime agreed to return to their platform?

Continue reading

Using C/C++ TLS callbacks in Visual Studio with your 32 or 64bits programs

In the following article, I share with you how to use TLS callbacks in your C/C++ program compiled with Visual Studio.

Background

TLS (thread local storage) callbacks are a mechanism provided by the Windows loader to give your program a chance to do initialization/deinitialization tasks when the process starts, terminates, a thread is created or terminated.

A TLS callback has the following prototype:

typedef VOID (NTAPI *PIMAGE_TLS_CALLBACK) (
    PVOID DllHandle,
    DWORD Reason,
    PVOID Reserved);

The Reason argument can be any of the following constants:

  • DLL_PROCESS_ATTACH ¬† = 1
  • DLL_PROCESS_DETACH ¬†= 0
  • DLL_THREAD_ATTACH ¬†= 2
  • DLL_THREAD_DETACH ¬†= 3

The TLS callbacks are encoded inside the compiled program’s TLS data directory(IMAGE_DIRECTORY_ENTRY_TLS). Please refer to the PE file structure. Continue reading

The Iceberg Illusion of Success

I found this picture on the internet and I really loved it and as usual, I would like to use it as a launching pad for today’s article.

I still remember my self when I was young, between the ages of 14 to 23, I used to envy people of my age or slightly older who seemed to have achieved the success that I want for myself.

If I saw another guy with a fancy car, I would immediately justify that by telling myself that he must have rich parents.

If I see a smart guy from a good university, I would say to myself that his parents could afford to educate him in such a prestigious university and then I would say to myself: only if I had the means, then I would have been more successful.

If I saw a guy with a hot looking girl, I would say to myself: “He must have money because that’s why the girl is hanging out with him. I don’t have a car or the money to take her out and give her a nice time”.

Back then, I could not afford to buy all the material possessions that I wanted. I remember when my peers used to have a Game Boy or a Sega Mega drive. They used to come to school and play with those game consoles and it made me feel sad and unhappy because I don’t have one myself. Often times, I would think about my parents with a bit of childish resentment. I had the sense of entitlement because I was immature.

Back then, I could not afford to take vacations or travel wherever I wanted. I was living in a continuous state of perceived lack, holding my happiness hostage to external situations. For a big part of my childhood and adulthood, It felt that my self worth really depends on how others perceive me, how much I have, what car I have, what cloth I wear, what kind of a girl friend I had. Continue reading

DC Glass Seattle

I always run into incredible talent at The Pike Market in Seattle, WA.

Today I ran into¬†David Contreras’ handmade glass products.

Make sure you visit his stand in the Pike Market and check out his Instagram page:

You might also like: