Categories
Technology

Testing with Python, Pytest and Vim

  1. TDD with python, pytest and vim Setting up
  2. Getting Started
    1. pip install pytest
    2. pip install pytest-xdist
    3. If you are using Anaconda, pytest should already be installed
  3. Directory/Folder structure Create a tests folder in your project directory Test data for testing dataframes Name corresponding test files with a test_ infront
  4. Using VIM
    1. Open vim <filename> in the root directory
    2. Enter :vsplit <tests/filename> in vim’s console
    3. You will get a split window.
    4. Ctrl-wx to swap columns in the order of preference. I.e. code on left, test on right or vice versa
    5. Ctrl-ww to switch editing columns
  5. Using VIM – vsplit CODE TESTS
  6. Using VIM – vsplit Cursor Here shows where you are editing code testsCtrl-ww
  7. Pytest
    1. Run pytest -f -v in the root of your project directory
    2. Pytest will be watching for any changes in the code or tests.
    3. Once you save either file, it will re- run all tests automatically
Categories
Miniature Painting

M7B Heavy Assault Walker Punisher / Fireball

Custom paint by Kolectiv

Close up of some of the fine details by Kenneth of Kolectiv. “The Black Hearts” are the heavy walker platoon of the Allies in Dust1947. A much feared platoon able to inflict massive amount of damage in a very short time.

Kill count with a dame on a missile. The Black Hearts are primarily anti-tank. They carry the mighty USMC. Light infantry able to take on other infantry

“Born to kill”.

If you watched Full Metal Jacket, you’ll know this. Dual heavy machine guns help to provide limited air cover while the land forces advance.

The dozer blade.

Provides cover and is able to remove small obstacles on the ground. Are you ready for some Dust?

Categories
Miniature Painting

Crazy Jimmy

One of my favourite heroes from the game Dust1947. Crazy Jimmy adds some pretty neat skills into your walker. I usually pair Jimmy with a Fireball.

Ace Pilot: On activation, roll a die. Additional Action is granted on Army or Target symbol.

Crazy Jimmy: Upon a March Move, receives a free Cover Save

Lucky: Once per game, re-roll misses on any Attack.

Categories
Data

Online Retail

It’s something that I never thought I would have gone into, but circumstances seem to have provided the opportunity.

I started took over the X-mini online store in 2009. I’ve seen it grow to a pretty reasonable performance and also learnt a lot along the way.

I share my experiences here with anyone who is interested in starting an Online Store.

Categories
French Horn

The 30min-a-day principle

photo 30 minutes a day is all it takes for a good practice session. I’m a working adult with a job from 9 to 6. I wasn’t sure how I could learn my instrument properly since I was working.

I read a biography of Yoyo Ma. His father insisted that Yoyo’s sister and Yoyo do practice first thing in the morning before breakfast. If I remember correctly, it was 30 minutes of practice. Practice anything. It could be 1 note, or a difficult passage, or trills, scales, whatever… just 30 minutes before breakfast.

I followed this routine, including in some routines my teacher Jamie had taught me.

I started out with the Farkas routine, doing some harmonic series and if I had time to practice some music. Slowly, this routine modified itself to harmonic series with a trill at the end and all major scales possible on the horn.

Next: Practice Routines

Categories
Golf

Crazy Pitching method

This is unconventional. But it was through a few experiments on the range that helped me zero in.

I focussed on using a pitching wedge. Accurate at 100m.

The first thing, I lined up my right foot perpendicular to the target, ball was on the line just next to my right big toe.

Full-swing, finish with a follow-through to target.

It proved itself over and over again.

This changed my strategy from playing to the green, to playing to the 100m line. Once I was there on the 100m line, I would pitch in.

Categories
Technology

My top 10 “It’s a great time to be a Software Developer” list

Accessibility to:

  1. Frameworks ( Django, Flask, Vue.js, React, Angular, MLFlow, WordPress )
  2. Documentation
  3. Community (includes Stackoverflow)
  4. Cloud platforms
  5. Compute Power (local machine)
  6. Python
  7. Docker
  8. Golang
  9. Scikit-learn, scikit-image
  10. Zsh

Categories
French Horn

It’s all in the lips

dennisbrain
Dennis Brain

The key to playing the horn right is all in the lips. Have a proper embouchure is the only thing that you must get right and form properly. It’s defined as “the position and use of the lips, tongue, and teeth in playing a wind instrument” by the Merriam Webster dictionary.

In The Art of French Horn Playing, Philip Farkas mention on mouthpiece placement that the “ideal spot is a very delicate and painstaking job of experimentation for the individual”. Also, the concept of 2/3 Upper Lip and 1/3 lower lip is mentioned.

I’m going to share with you what I have learnt and also discovered myself.

When I was preparing for an exam, I had to play some music where the highest note was a high “G”. (Note that at this point in time, I had been playing the horn steadily for 5 years. Everyday without fail, I would play at least 30mins some etude, piece or routine.) I had difficulty playing it, sustaining it, randomly playing etc… I just could not play high G. What happened?

My embouchure went haywire. I went for 2 master classes – 1 with Kerry Turner and another with Soichiro Ohno. Both told me something was not right with my embouchure because I took too much effort to play a high G. I was ok 6 months ago, but nearing my exam, this happened. Unfortunately, I went through the exam in this state. Fortunately, I passed. It was extremely demoralising and I had wanted to stop playing horn for good.

What I discovered was I had not used the 2/3 Upper and 1/3 Lower principle. I was using a 1/2 Upper and 1/2 Lower combination. This meant that I had less Upper Lip to buzz with. I had to use more effort and strength just to make that little bit of lip buzz. My muscles weren’t strong enough to sustain and hold that position.

Solution:

I had to change. And there’s no overnight cure for wrong embouchure. It was a painful 1 year to make sure I got things right. Through the discussions with my good horn friends, I learnt more about the term “einsetzen” (setting in) and “ansetzen”(setting against). I didn’t bother with ansetzen because I knew I was already in that mode of just placing the mouthpiece against my lips in a 1/2 1/2 Upper Lower position.

I started using einsetzen position. This changed everything. By setting in the mouthpiece into the lower lip, I was mentally setting up for a 2/3 1/3 Upper Lower position!!! Not only that, I anchored the mouthpiece to my lower lip. My teacher had always reinforced to use the lower lip as a support and to keep the chin flat. It finally made sense!!! By using the einsetzen method, I was physically setting up the lips ratio, lower lip support and keeping my chin flat. Playing and buzzing became efficient – i.e. I was using less strength or effort to produce sound!

To drill this new embouchure position in, I threw away all my normal routines and dived straight into doing scales. Everyday without fail I would do all the scales possible on the horn – staccato, slur and tenuto. For Ab, A, Bb and B – I would do 3 octaves (as required by the ABRSM exam), the rest 2 octaves. In particular, I focussed on the breaking point somewhere around middle C, and so I would routine a 1 octave G major scale over that note.

After going through this for 1 year, I can confidently say that the mouthpiece position on my lips does not change at all whatsoever. What changes is the aperture size of the embouchure. I was renewed! Re-vitalized! I could play the horn again and play all octaves with ease and stability.

Recommendations:

1. Using the Einsetzen method of “setting in” the mouthpiece. Do not think of Ansetzen as you traverse up the scale because that will cause you to ‘change’ mouthpiece position. Just remain Einsetzen even in the upper register.

2. Do scales to strengthen your muscles and get familiar with traversing the scales.

Next: The 30min-a-day principle

Categories
Golf

100 Plus

golf ball resting in dewy grass just above green on tropical courseGolf was something my dad started me on really young. 11 or 12 years, went for coaching and all. But I wasn’t really interested then. I enjoyed going to the driving range though. Hitting balls was cathartic. I had a neat swing nurtured from the young days.

Anyway, I only got my handicap at 33. Before that I had serious sprints of Golf Craze (almost twice a week during my 2nd and 3rd year in Uni). I stayed near a public golf course and walked there to play, and then walked back. When I graduated, it came back and took up lessons with a pro and changed some fundamentals in my swing that wasn’t ‘ideal’. I faced several problems, and decided to stop for awhile (a few years).

So the golf craze is back again. I think it’s something to do with playing the Horn or writing code. The satisfaction of getting something right after hours and hours of practice. I have a putting mat at home and I’d ‘zero’ my putter before a game just to be sure I was putting straight. I watch Tiger and Ernie over and over again on how they hit their driver. I keep a notebook on feet position, swing rhythm, ball position, and other mental mantras that I run through my mind when I hit a ball.

I will share what I’ve learnt here. But in summary, the best way to hit a ball is to not do any of what I have done above. Just don’t think about it, enjoy the greenery and the company. That is what makes the game most enjoyable.

Next: Crazy Pitching method

Categories
Technology

NooB

BinaryCode

Computer Science. When I was younger, I only played games. I wasn’t intrigued by the machine itself, but I was pretty absorbed into the story. Some of the prominent games I loved

MAC/PC: Thexder, Digger, Hillsfar, Star Wars: – Dark Forces, Jedi Knight, Battlefront, X-Wing, TIE, X-Wing vs TIE – Mechwarrior, Diablo, WoW, Red Alert, Rainbow Six, Call of Duty, Company of Heros.

Sega: Thunderforce, Sonic The Hedgehog, Bareknuckles, Golden Axe

PS3: Metal Gear Solid, Colin McRae, Tekken 4

I wasn’t the usual inspired-by-game to go into Computer Science. I wanted to go into Chemical Engineering, but I changed my mind because I wanted to do something more ‘practical’. You see, I had decided computers are the way of the future and Skynet (Terminator) could be a reality. Sound shallow? Well, that was kind of the inspiration behind me embarking into the world of Computer Science.

In 1999, I started to learn C. A very very basic course on programming. What they didn’t teach me then was how to do that at home. We used Borland to write and compile our code. in 2001, I started learning more in Uni. We used Linux and learnt how to code in Python. This changed my entire thinking again. I was inspired by how easy it was to write a few lines of code to do some task.

In Uni we learnt and used C, Python, Java, Haskell, IDL and PHP. There was a project in all of these languages, no running away. By the end of the 4 years, I was pretty worn out and convinced programming wasn’t a career for me. Fast forward to 2011, about 6 years later. I needed to use some coding skills to automate a task at work. And from there, the hacking started again and it’s become rather addictive.

Here’s my story. 🙂

Next: It’s a great time to be a Software Developer