Psuedo Code; Excercise 1.

I have enrolled in the Viking Code School and I am currently doing the prep work.

Our first assignment is to use PsuedoCode; simple language used to describe a process or solution in code.  The first assignment is to describe the process of making a grilled cheese sandwich.

I found this assignment interesting if not slightly daunting. I realized I had a fatal flaw inside my PsuedoCode when I was 3/4 finished but I decided to leave it in as a teaching point.  By running programs like GroceryShopping and WASHDISHES multiple times throughout the code I left myself room for serious error.

It is not efficient to search for items seperately at every step of the recipe.

What would be more efficient is to do what Jonathan Popenuck did in his solution.

By searching for all the items needed for the sandwich at the beginning and perhaps seperating them by items that would be under the control of GroceryShopping and items that would be WashDishes you could execute those codes once and save yourself from say, washing the spatula while the sandwich burns on the stove. Or from going to the grocery store 4 seperate times.

What I found most interesting about this assignment was how it forced me to take a seemingly basic task, find all of the essential elements to that task, and try to execute it. I have zero coding experience and no engineering background so this was a fun icebreaker to the theory behind coding.

I found myself thinking of efficent ways to create and link the programs, and even trying to create parent and child code with parameters like INSPECT.

I then began to think of ways to make the program GroceryShopping more streamlined.

I believe however that is our next assignment so I will leave you with this;

Alex´s Grilled Cheese Sandwich- PsuedoCode

    1. PROGRAM GrilledCheeseSandwich

    Search; Bread.

    If FOUND then proceed.

    If NOT FOUND then RUNPROGRAM; GroceryShopping

    Proceed;

    INSPECT; Bread. If Bread is; Moldy and or Hard. RUNPROGRAM; GroceryShopping

    If Bread is Ok, Proceed.

    Search; Cheese.

    INSPECT; (Same parameters as Bread)

    If Cheese is OK-Proceed;

    Take (2) pieces of Bread and place beside eachother.

    Search; Butter

    If FOUND then proceed.

    If NOT FOUND then RUNPROGRAM; GroceryShopping

    Inspect

    If Ok -Proceed

    Search; Knife.

    If Dirty THEN run program WASHDISHES

    If Clean Then Proceed.

    Take Knife and CUT-SmallPiece of Butter.

    Spread Butter on Bread 1.

    Spread Butter on Bread 2

    Turn over Bread 1.

    Place Cheese on Bread 1.

    Pick Up Bread 2

    Place Bread 2 on TOP of Cheese and Bread 1

    Bread 2-Butter UP.

    Search; FryingPan.

    If Dirty THEN run program WASHDISHES

    If Clean Then Proceed.

    Turn ON Burner1 to 75%.

    Place FryingPan on Burner1.

    Wait 5 Minutes for Preheat.

    Add Bread to Frying Pan.

    Wait 2 Minutes.

    Search; Spatula.

    If Dirty THEN run program WASHDISHES

    If Clean Then Proceed.

Flip Grilled Cheese with Spatula- Bread1 is now TOP.

Lower Temperature on Burner1 to 50%

Wait 5 Minutes.

Check if Bread is Brown.

If Bread is NOT Brown Wait (1) Minutes.

Repeat as necessary.

If Bread is OK

Remove GrilledCheese from FryingPan with Spatula.

Place on Plate.

Turn OFF Burner1

Place FryingPan in SINK.

Enjoy.

End.

 

 

 

Advertisements

Know and Defend Your Labour Rights

I lived and worked for a number of years in Asia and specifically in China. While there I experienced first hand the awful state of labour rights and human rights.

I worked at an English training school. My Chinese colleagues were paid a pittance, 1500-2000RMB per month. Around 150-200USD during that time. They would work 12 hour shifts, 6 days a week. Sometimes they were forced to go in on their only day off for training or team building exercises.

They sat in small hot office, cubicles no larger than half a metre wide. They would be forced to change diapers of the boss´s baby, and some of the younger students as well. The teachers were from different provinces in China and they were promised living accommodations in addition to their salaries. Living accommodations amounted to 6 teachers sharing a small apartment, two per bed.

And this was a job to be sought! Migrant labourers in China are often robbed by greedy construction bosses and left in distant provinces with no working rights, no money and no options.

All of this shocked and disgusted me and I left China.

I would like to note at this time I love and admire many Chinese people. I love their delicious food, I pondered their philosophies and meditated in their temples. This article is not meant as an attack on China or Chinese people. My issue is with Labour Rights internationally.

Which is why I was surprised when I returned to live in Hamilton Ontario, and find that many people were forgetting Canadian labour law.

I returned to Hamilton in 2015 and began working for an international school.

During that time I saw both management and Human Resources attempt to bend the law and lean on employees to wave their legal rights.

Human Resources no longer (if they ever did) works for the employee. They are instead a buffer to allow managers and owners to behave however they want.

The college was a 24 hour operation, and myself and an older gentleman had Monday-Tuesday as our weekend. However with many holidays falling on the Monday, we rarely received a three day weekend.We were compensated instead and paid holiday pay. But my colleague, being a man of leisure, reckoned that he was being cheated out of holiday days. He approached HR about Replacement Holidays and he was rejected. He decided to then research the ESA website and found that yes, legally he was entitled to his choice of either a replacement holiday, or holiday pay.

He forward this information to HR, highlighting specifically:

                  “A substitute holiday is another working day off work that is designated to replace a public holiday. Employees are entitled to be paid public holiday pay for a substitute holiday. A substitute holiday must be scheduled for a day that is no later than three months after the public holiday for which it was earned, or, if the employee has agreed in writing, the substitute day off can be scheduled up to 12 months after the public holiday.”  https://www.labour.gov.on.ca/english/es/pubs/guide/publicholidays.php

After not hearing anything for two weeks, his replacement holiday request was quietly accepted.

Now my colleague was a veteran of the Canadian labour force. Serving in the steel industry for three decades. He had battled in union negotiations and seen the labour industry fight for years to obtain these rights. He knew there was blood lost to obtain these rights and he felt it his duty to both use his rights, and educate others on their rights.

So here are several common ways employers attempt to bypass Labour Law.

Minimum Shift/ 3 hour rule. 

Employers, especially in retail and hospitality, will often overstaff in expectation of a busy period. Usually if employers see that they are overstaffed they will send people home. Your employer must pay you a minimum of three hours for any shift you turn up to, regardless of if you worked three hours.

“When an employee who regularly works more than three hours a day is required to                 report to work but works less than three hours, he or she must be paid whichever                   of the following amounts is the highest:                                                                                                   three hours at the minimum wage,
               or the employee’s regular wage for the time worked.”

https://www.labour.gov.on.ca/english/es/pubs/guide/minwage.php

Unpaid Training:

Unpaid training is illegal. Pure and simple. The best way to fight unpaid training is to refuse it. I understand “times are hard” and “a job is a job” but allowing employers to use unpaid training, and willfully allowing employers to use you for free labour is detrimental to labour law.  If everyone refuses to participate in unpaid training then it will become an outdated barbaric idea.

Understaffing:

In certain industries understaffing can be illegal. In healthcare, education and security there are minimum staff requirements that must be met. In many industries, employers will understaff and stress their remaining staff to overexert themselves trying to compensate for  the missing people. By refusing to become stressed, or to work harder than you can (especially for that 11.25$) you can force employers to either have an inefficient organization or to properly fund their staff. By allowing them to force you to do two jobs you are not proving to them you are a capable employee. You are proving that they can abuse workers rights, and create a job atmosphere that everyone is replaceable.

There are many more examples I could name and I encourage you to educate yourself, or reach out to myself or anyone else involved in labour law.

By allowing employers to work you like a dog you add to the current job culture that accepts low wages, low security, and little respect. We all fight for the scraps- these entry level jobs. However were you to fully exert your rights as an employee, and not be over worked or bullied into submission. Your employer would be forced to hire, train and treat other employees how you demand to be treated.

We need each other now.

 

Know & Defend your Tenancy Rights

I recently had a less than pleasant email exchange with my landlord over new lease agreements and a pet in the building. I would like to share my tale as well as offer advice and support to anyone who may not understand their legal rights as a tenant in Ontario.

Recently this year Canada took in 25,000 Syrian refugees.

986 Syrian people were welcomed to Hamilton, Ontario. But not all of them received a warm reception. Several families struggled to find landlords willing to rent to them. Others were subject to rent hikes and illegal requests for deposits. These Syrian arrivals also fell victim to gentrification which has been plaguing the residents of many areas in Hamilton. Low income housing has been steadily demolished to make way for large condominiums to be sold to the Torontonians who are also being priced out of their homes in Toronto.

Before I let this spiral into a rant about greed and inflation and begin fear mongering let me reign in this article. You as a tenant have many rights over your landlord.

Firstly: Your landlord needs to give you at least 24hour notice before entering the premises. This can be done via email, texting or in person. Violation of this agreement means that the tenant can file a T2 with the Landlord Tenancy Board or LTB.

This is a link to that form:

http://www.sjto.gov.on.ca/documents/ltb/Tenant%20Applications%20&%20Instructions/T2.pdf

Notice as well this form can be used should you feel your landlord:

“entered your rental unit illegally, • changed the locks to your rental unit or building without giving you replacement keys, • substantially interfered with your reasonable enjoyment of the rental unit or complex or with the reasonable enjoyment of a member of your household, • harassed, coerced, obstructed, threatened or interfered with you, • withheld or interfered with vital services, care services or meals”

Filing a T2 could result in your landlord repaying you the years rent, as well as the court and filing fees. In my case when I mentioned to my Landlord that I had legal reason to file both a T2 for illegal entrance, and a T6 for his refusal to clean and maintain the property he immediately backed down.

Breaking a Lease:

Many landlords will try and intimidate students and foreigners to be afraid to ever break a lease. The law in Ontario states you may give your landlord two months notice should you wish to break a lease.  I had an experience during my university days in Ottawa.

Four of us were renting a house together but had all began to hate each other. We decided to go our separate ways and we gave the landlord three months notice and the promise to find people to sublet or take over the house for the duration of the lease.  The landlord flipped and began making threats of litigation should we even consider to break the lease. I did some research and discovered that should your landlord refuse to offer and adequate reason for you to assign your lease to another party then you may file a Tenant’s Notice to Terminate the Tenancy (Form N9)no late than 30 days after your original request.

http://www.sjto.gov.on.ca/documents/ltb/Brochures/How%20a%20Tenant%20Can%20End%20Their%20Tenancy%20(EN).pdf

After confronting the landlord with this bit of knowledge they also backed down. People often attempt to bully or ignore the law with those they assume to be ignorant of it. It is systemic since it is one of the ways many police officers act, but again I will not stray with this article.

In the current email exchange I had with my current landlord He hinted at attempting to raise my rent from 400$-450$.

Now the max in Ontario for a rent increase is 2%. And a rent increase can only be done once every 12 months. Since my rent is 400$ it would be an 8$ increase max legally allowed in Ontario. I could wave that law though if I were to believe that my landlord would do renovations which would raise the value of the property. However after living here 8 months I doubt he will suddenly turn my humble abode into a castle.

This is the LTB’s rent increase guide for 2016:

http://www.sjto.gov.on.ca/documents/ltb/Brochures/2016%20Rent%20Increase%20Guideline%20(EN).html

Also for my Landlord to legally raise my rent he would need to give me 90 days written notice of his intention.

My biggest stress however was not the rent increase, but that my landlord seemed to take insult with my beautiful new rescue cat; Sushi. I had consulted my lease before adopting her, and there was nothing mentioned about animals. However my landlord seemed adamant that she needed to be out for September 1st, whether or not I chose to extend my lease. In doing some more research on the LTB I found that even if your lease specifies no animals, your landlord must prove that the animal is damaging property, or making life uncomfortable for the other tenants. Since my cat is well trained and never leaves my floor, he would be hard pressed to get me evicted over my cat.

During the whole situation I knew I was in the legal right, but I was still stressed. Your home is your castle and when people make threats on the safety or security of it, even the toughest souls worry. I can imagine being a refugee fleeing a war torn country to then deal with the bullying and greed of some slum lord in Hamilton.Thankfully I know and am willing to fight for my rights, but many people have been bullied and cheated out of their own homes. Please share this and educate yourself on all of your rights to security, safety and your property. If you continue to wave or ignore your rights, there will be no point in having them.