Sunday, December 27, 2015

The Open Song Project - "You Bring Out The Best In Me"

I wrote the song and my brother Tim arranged the music. He always seems to be able create some kind of magic with the piano. He has zest in music whereas I am kind of like a little more into sport. Anyway, this is an open project which means others can try to improve on it. I am not really sure if this song is complete so I guess additional lyrics and music could be added to it.I think my bro has missed out a line near the beginning but for starters, I think it is  good enough for the most part. The lyrics:-

You bring out the best in me
You mean all the world to me
Took my heart and took my soul
It's the greatest love I know
You bring out the best in me

I just want to be with you
Hold my hand and we will see it through
You bring hope in all my ways 
Light in all my days
You bring out the best in me




Update 3-1-2016: The song has been completed and the the project is generally considered closed. It has been been completed by my nephew in law (nephew of Tim's wife) . These things do happen sometimes I guess! We will be sharing songwriting and music credits with him and his band.  His full name is Ae  (Phumthep Pholwat) from Thailand and the band is a college one called the Sarapa Group. 

 We are now looking into the promotional stage of the song.

Tim Chin - "The Christmas Song" Cover

My brother's cover of " The Christmas Song" which I think is pretty good. (considering  that he doesn't have much time to play the piano)

Sunday, December 13, 2015

Python on the go - Application in calculating resistances

Here is a program that calculates resistances in series or  in parallel.


def resistor(l):
    a=raw_input("series or parallel? (s or p)")
    if a== 's':
       sum1 = 0
       for v in l:
                    
           sum1 = sum1 + float(v)
                    
       return sum1

    elif a =='p':
            sum1 = 0
            for v in l:
                    
                    sum1 = sum1 + (1/float(v))
                    
            return 1/sum1


So, how does it work? Firstly, def means that this is a functional program with a list called 'l' so when you run it, you should type 'resistor ([2,3,5])' for example to calculate three resistances of values 2, 3 and 5 ohms.

 In the second line of the program , you will need to  accept variable 'a' as a raw input which may be s or p.  If a='s' to signify that resistances are in series, then the variable suml is first set to 0. In a way  you can think of the variable suml as some kind of container or box where  values (or variables) v can be added to it. Next, there is a  for loop for each variable v  in list 'l' and this for loop will add each variable in 'l' until the end of the list. Once it has reached the end of the list , 'return sum1' displays the value of sum1 and the program exits.

If a=' p',    to signify that resistances are in  parallel, the process is almost the same, only that  the formula for parallel resistances is  different so some changes need to be made near the end.

Monday, December 7, 2015

Adele - "When We Were Young"

I am no Adele fan but I do like this song. I felt 'Hello ' was a little bit hyped up but this song seems to be timeless.

Sunday, December 6, 2015

FutureLearn - Electrify from University of Liverpool

I  have been trying this course out recently. It seems to be the  simplest  one for Electronics so far but it does help me to remember some of the basics of Electronics so   I suppose it is worth checking out. There is no free cert for this but for knowledge sake, the course seems okay. The videos are mostly about 2 minutes long which appears to work quite well for the course.

 For those starting Electronics or who just want a break from those tough edX courses, this could be one of the  better  ones to  take - just don't expect anything too deep from it.

Having said that, the lecturer does make things interesting and fun enough to keep me watching the videos for the last few days so I think that is the main thing that is good about it.

Sunday, November 29, 2015

Armband /Wristband for smartphone for less than RM4 at Tesco Ipoh

This armband is actually very good for light running exercise. When I first bought it, I thought it did not look good as an armband near my shoulders and thought it would be junk but lately I have used it as a wristband and it works great.

I downloaded the Accupedo pedometer app for Android and also a Screen off app but I think the fact that my Winds Mobile smartphone has intelligent awaken also helps.

It was selling at an offer price  for less than RM4 at Tesco on Saturday which I think  is a very low price for it.  Its original price is around RM15.

It seems it can also  be used as an additional support for knee braces so it is very handy.

It can cause issues if you use it for a long time as a wristband so for longer distances it is probably  better to use it as an armband near the shoulders. So far it looks better as a wristband than an armband - I don't know maybe blue just isn't the right colour for an armband.

It appears as an armband, it looks better with sleeveless shirts. It's a strange thing but it seems to be the case.

Sunday, November 22, 2015

Smartphone battery dropped very quickly from around 50% to close to 0%

 My smartphone battery level seems to have dropped very quickly from around 50% to close to 0%  quite a few times so I went back to the sales vendor. He told me to charge the phone for 8 hours. I am not really sure if this applies to Li batteries but I  remembered that for the older handphone batteries, I needed to charge them for 8 hours. Anyway I charged mine for around 5 hours. I also installed Avira antivirus. It detected and removed a malware. After that it seems like the issue has not  occurred - at least not as  dramatically as before.

Tuesday, November 17, 2015

Running Program

I have increased my running program to 30 minutes a  day.  Anlene Gold milk powder  recommends 30 minutes   a day. It seems the American Heart Association also recommends  30 minutes for 5 days a  week.

There appears to be some improvement in stamina for the last few days with this new program but I also read that there are greater benefits for exercising for an hour so I may try that out every now and then.

https://www.washingtonpost.com/news/to-your-health/wp/2015/10/06/new-study-for-optimal-heart-health-americans-should-double-or-even-quadruple-the-amount-of-exercising-theyre-doing/

Update 2/12/2015 - Have been sticking to 30 minutes as one hour seems too much. Furthermore from the article, it appears that 30 minutes of running appears to be the equivalent of one hour of moderate exercise.

Update 21/12/2015  -   Have been doing 5 km runs these days which can be slightly less than 30 minutes but  it seems that there is some benefit in doing shorter sessions with high intensity too, based on the article below

http://www.ctvnews.ca/health/brief-high-intensity-workouts-equal-longer-medium-intensity-training-study-1.2707792

Update 25/3/2016 Have reduced to 2 miles due to the heat wave but I guess that could be the right amount as 5 km can be quite tortuous sometimes.

Update 5/5/2016 Have been doing 5 km the last two days since the heat wave ended. 5 km is healthier I suppose but can be quite tortuous sometimes.

Update 7/5/2016 It seems like I have been affected by the hot weather again so it is back to 2 mile runs I guess.


Tuesday, November 10, 2015

What's Buzzing?

I managed to pass the MIT Circuits and Electronics  Part 1 but it was a tough one. The Berkeley MOOC Electronic Interfaces was  a little more straightforward even though one has to get 100%  in the theoretical part to pass. (I did not bother about the practical part as I had done somethng similar for my degree course).

Am now looking through the  Circuits and Electronics  Part 1 course again  and trying to get a better grade for it. Anyway I am thankful for these courses as I get to learn quite a lot from them.

Tuesday, November 3, 2015

Recovering from Bad Headaches

 Last week I had very bad headache a few times and had to go on a course of 2 tablets of uphamol(or panadol) 3 times a day.   Apparently one should not take more than 8 tablets a day. Also I lessened the amount of  time spent on computers and took more rest. There seems to less headaches  now so I guess I am recovering in this area.


Sunday, October 25, 2015

Wireless Mouse Weibo from Mr DIY, Tesco Ipoh

I bought this about two months ago.   After about a month of usage,  it started to lag. It seems the batteries had run out, so recently I bought some rechargeable ones and now the mouse seems to be working fine. The led light of the mouse goes to a low light, (it does not actually go off as what I had written before) when the mouse stops moving, so it is best to turn off the mouse after use to save power. I am quite impressed by the Weibo products as I bought a keyboard some time back before the wireless mouse. There is not much of a warranty for them - have to return them within 3 days (update: not a week as stated previously- that was for another item) if there are issues but the cost of these products are considered low and most of them seem to work okay so far.



Update: 10-11-2015.  It isn't working as well as before. Could be due to the fact that it was accidentally dropped when my mum was cleaning the room.  I am still using it though but it seems it sometimes has some difficulty in copying and pasting. This kind of issue does happen in some mouses.

Update: 14-11-2015  It appears the rechargeables are okay - it is just that the performance of the mouse sometimes is not always consistent but still usable.

Update:25-11-2015: I haven't recharged it or switched it off  for some time now.  It appears to be working okay although it lags a little every now and then.

 Hmm, looks like I had to recharge today so there may be some advantage in switching it off every now and then.

Update 14/12/2015: Found out that the led of the mouse does not  go off immediately but goes to a low light mode when the mouse stops moving, so it is best to turn off the mouse when not in use to save power.

Update 26/12/2015: It appears it goes to a low light mode then it goes off after a while but I am not too sure about this!

Update 24/8/2017: I had to recharge the 900 mAh  batteries for about 3 hours - then it was able to work longer.  Here is the site to find out how long to recharge the batteries http://convert-to.com/491/recharging-rechargeable-nimh-nicd-batteries.html


Monday, October 19, 2015

ES500 Solar Charger

 As a solar charger, this doesn't quite live up to expectations but there is something about it that I do like -its design.  It looks like one of the best looking powerbanks out there but it's slow to charge under the sun. As a portable powerbank charged up from the wall socket, it seems to work okay, though I haven't tested long enough to see if it outputs the correct capacity.

After a couple of hours of bright sunlight, it was able to charge up my phone about 5%   but I haven't seen it charge more than  a single bar yet. (There are 5 bars, each bar representing 20%  of the total capacity.)  The last few days have been quite hazy so perhaps this has affected the solar charging performance.



I bought this at the basement of Angsana mall in Ipoh but later I found out there were some on sale at Giant in Bercham. The ones there seem to claim to have  much higher capacity ,70000 mAh, a value which seems too good to to be true and there is no ES500 brand name at the back of the item.

Wednesday, October 14, 2015

How long does it take to charge your smartphone?

I recently bought a solar charger (which I will probably write about later). It was taking some time to charge up so this got me interested to find out as to how long does it take to charge things up.

Here's the calculation: -
Batteries are rated with a capacity of mAh which is milliampere hours while the charger may just have an mA rating.
Time taken in hours=mAh rating of your battery/mA rating of your charger

To convert A to mA, multiply the value by 1000.

Friday, October 9, 2015

Google Handwriting Input

After updating the software for my phone, the handwriting was better. So I have been checking out some handwriting applications and I came across this one which seems quite handy. Now I am using it to write this blog entry. I am writing this on my tablet as it seems to be a little easier to do so.
Editing is a little bit difficult with this application but it seems to be able to spot most words quite well. Still I will probably be using this more for the next blog entries. If I do get tired of writing, I will switch back to typing. Typing appears to be faster  so writing is  for the smaller tablets or phones.

Wednesday, September 30, 2015

edX MITx: 6.002.1x Circuits and Electronics 1: Basic Circuit Analysis

edX MITx-6.002x Circuits and Electronics course seems to have gone through a slight revamp and has been divided into three parts.  I presume not much of the content is going to change except probably the course will run at a more relaxed pace. There will be a better chance to earn a cert. I think the original one was a tough course and dividing it into 3 parts may be a good idea.

Sunday, September 20, 2015

What's Buzzing?

The handphone was not very good for writing (Update: I updated my software for it so now it is much better for writing) so I used the tablet that was given to me as a Christmas present last year - but that did not last long either. It automatically powered off at times so I tried to repair it. Unfortunately the front display part broke(it seems like it may have been made of cheaper glass) and I more or less decided to buy a new one. Later, I tried to repair the broken ones and that was when  I learnt something about the tablet - from the internet


"All phones are obviously different, but many use separate elements for the touch-sensing component called the digitiser and the actual LCD/OLED display."


Sunday, September 13, 2015

What's Buzzing?

Very hazy over here. I haven't seen it that bad for some time.

I bought quite a a few things last week -  a handphone, a bracket for it, a remote shutter, a wireless mouse and some kind of workout armband which was a bit of a disappointment.

The handphone is okay. (Update:My otg cable was spoilt so actually the handphone has some otg capability in it.)  I bought it as my  tablet had more or less conked out. There was an area of the screen  which was not functioning.

It cost me about RM250 but that is not too bad considering it has 1GB of RAM. So performance of it is quite smooth. The brand is Winds Mobile which is meant to be from Malaysia but  the seller seems to claim - it is mostly manufactured in China. I heard Winds Mobile was a good brand for a handphone, a couple of years ago so I decided to give it a try. I haven't checked how good is the phone line though as I had been using it more like a mini tablet.



Monday, August 31, 2015

edX - HKUSTx: ELEC1200.1x A System View of Communications: From Signals to Packets (Part 1)

Am in  the second week of the course and has been quite interesting for the most part so far. Usually communication systems courses are tough but this one has been quite comprehensible so far. I am quite impressed by it. There is  Matlab programming which I am not really that fond of as I had only just completed some Python courses but I do realize, it is used quite a lot in  the workplace. The wonderful thing about these courses is that there are sandboxes where you can try out these softwares and take your time to learn them if you want.

However, datelines for this course is quite short as it is not really self paced - if you are not too worried about earning a cert but just want to learn something  then this is fine.

Sunday, August 23, 2015

Python on the go - Revision of Class and Inheritance

Referred from https://en.wikibooks.org/wiki/A_Beginner%27s_Python_Tutorial/Classes


  A class can be defined as a template for creating objects such as functions. For example the program below provides a description of a shape  and what operations you can do with the shape (that is, the functions). The  __init__()  function is always run when the class is called.

class Shape:

    def __init__(self, x, y):
        self.x = x
        self.y = y
        self.description = "This shape has not been described yet"
        self.author = "Nobody has claimed to make this shape yet"
        
        
    def area(self):
        return self.x * self.y

    def perimeter(self):
        return 2 * self.x + 2 * self.y

    def describe(self, text):
        self.description = text

    def authorName(self, text):
        self.author = text

    def scaleSize(self, scale):
        self.x = self.x * scale
        self.y = self.y * scale



rectangle = Shape(100, 45)      #calling the class Shape
print rectangle.area()                # the area of the rectangle:

print rectangle.perimeter()       #the perimeter of it:

rectangle.scaleSize(0.5)         #makes it 50% smaller
print rectangle.area()              #the new area of the rectangle


It is possible to add extra features to a new class by using inheritance. The example below shows how a new class has inherited some of the features of the old one but its  __init__() function has changed.


class Square(Shape):
    def __init__(self,x):
        self.x = x
        self.y = x
        
square1=Square(10)
print square1.area()


Sunday, August 16, 2015

Python on the go - Revision of Files

One of the simplest ways for programs to maintain their data is by reading and writing
text files.

To write a file, you have to open it with mode 'w' as a second parameter:

file = open('out.txt', 'w')
file.write("Hello there.\n")
file.close()


If the file already exists in the same directory as the program, opening it in write mode clears out the old data . If the file doesn’t exist, a new one is created.


To read a file, you have to open it with mode 'r' as a second parameter:

file = open('out.txt', 'r')
print file.read()


file.read() returns a string with all the characters in the file. With print, the output can be seen in the Python shell.

The above two programs can be combined in one program to write and read a file.


file = open('out.txt', 'w')
file.write("Hello there.\n")
file.close()

file = open('out.txt', 'r')
print file.read()

Sunday, August 9, 2015

Python on the go - Revision of Tuples and Dictionaries

Tuples are very similar to lists but they are not modifiable and they are not used as often as lists. The items in a tuple are enclosed by round brackets instead of the  square brackets that are used in lists.

days=("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday",  "Sunday")

Dictionaries have keys and values. Each value in a dictionary can be obtained by using a key. These keys and values are enclosed in curly brackets.

 phonebook={'Jon':456782,  'Peter':2345233,  'Fred':5678123}

Dictionaries can be useful for finding values of certain keys such as the phone  number in the case above. For example, to find the phone number or value of the key 'Jo' , type in the python shell -

phonebook["Jon"]

An additional key and value can be added to the dictionary by typing in the program-

phonebook["Jack"]=546773


Sunday, August 2, 2015

Python on the go - Revision of Lists

Lists are similar to arrays and in Python, it is quite easy to build them. Here is a simple program that adds a list of numbers using the built-in function sum.


mylist = [1,2,3]
print 'sum of the list is',sum(mylist)


Sometimes we may wish to take certain items from a list and use them for a certain purpose, for example  item 1 minus item 3  or adding the first two items of a list .


mylist = [1,2,3]
print 'sum of the list is',sum(mylist)
print

print 'item 1 minus item 3 of the list is ',mylist[0] - mylist[2]
print 'sum of first two items of the list is ' ,sum(mylist[0:2]) 

Sunday, July 19, 2015

Python on the go - Revision of Repetitions

To repeat a certain task a fixed number of times, a for loop is used:-


 for x in range(5): 
    print x


To repeat a task until a certain condition is met, a while loop is used:-

def countdown(n):
    while n > 0:
          print n
          n = n-1
    print 'Blastoff!'


Another way a process can be repeated is recursion  which can be difficult to implement :-

def countdown(n):
    if n <= 0:
       print 'Blastoff!'
    else:
         print n
         countdown(n-1)


A recursion  usually consists of
(1)  a base case (when to stop)
(2) a work towards a base case
(3) a recursive call that calls itself


Updated - 27-7-2015

Saturday, July 11, 2015

Python on the go - Revision of Conditional Execution

There are times in a program when there is a need to execute certain instructions after a certain condition is met  and this process may be carried out by using   "if"  statements as shown:-


num = raw_input('Input a number? ')
num2=float(num)
if num2>0:
   print "The number is positive"
elif num2==0:
     print "The number is zero"
else:
     print "The number is negative"


elif is an abbreviation for  "else if"  and it can be used more than once. else is used for the possible remaining conditions and normally used at the end of the "if" statements.  However, there does not need to be one.


Sunday, July 5, 2015

Python on the go - Revision of Functions

A function is a block of code which performs a computation. They can be reused in a program.
Here are some functions that can be used on lists

https://docs.python.org/2/tutorial/datastructures.html

These are inbuilt functions.  Certain functions like maths functions can be imported into the program by typing

from math import* 

We can also create our own functions. The 'Hello World' program can be written in a function as shown below.

def hello():
      print  "Hello World"

To call and run the function type  hello()  in the python shell

Monday, June 29, 2015

Python on the go - List Comprehensions

Back to what I have been doing. Here is a way of simplifying some of the things that are done with lists

From https://docs.python.org/2/tutorial/datastructures.html


5.1.4. List Comprehensions

List comprehensions provide a concise way to create lists. Common applications are to make new lists where each element is the result of some operations applied to each member of another sequence or iterable, or to create a subsequence of those elements that satisfy a certain condition.
For example, assume we want to create a list of squares, like:
>>>
>>> squares = []
>>> for x in range(10):
...     squares.append(x**2)
...
>>> squares
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
We can obtain the same result with:
squares = [x**2 for x in range(10)]
This is also equivalent to squares = map(lambda x: x**2, range(10)), but it’s more concise and readable.
A list comprehension consists of brackets containing an expression followed by a for clause, then zero or more for or if clauses. The result will be a new list resulting from evaluating the expression in the context of the for and ifclauses which follow it. For example, this listcomp combines the elements of two lists if they are not equal:
>>>
>>> [(x, y) for x in [1,2,3] for y in [3,1,4] if x != y]
[(1, 3), (1, 4), (2, 3), (2, 1), (2, 4), (3, 1), (3, 4)]

Friday, June 26, 2015

Python on the go - Revision of Variables

Variables in Python can be declared on the go. For example if you input your age with raw_input which inputs your age as a string , it can be converted into a number by declaring it as a float. eg float(age)    as shown below

age = raw_input('How old are you? ')
age2=float(age)
print "You are ",age2,"  years old"

Variables  can be  declared as numbers usually in the form  of a float or integer.  For accuracy, numbers are usually declared as floats.

But you don't always have to declare variables in Python . Sometimes Python recognizes it for you automatically. If you type  a variable like temp=31.0 (short form of temperature) ,  Python recognizes it as a float. In otherwords, any variable with  a decimal number assigned to it,  will be recognized as a float in Python. You can check this with the program as shown


temp=31.0

print type(temp)

The program will print the type of variable temp is - which is a float.


updated 12-7-2015


Wednesday, June 24, 2015

Python on the go

Those five points from 'Think Python'  lie the basis of most computer programs. I could not think of simplifying it much more than that.

What has been done so far is to output data  with  print.

There are generally two types of data - words and numbers but in the programming world, words are described by strings or characters while numbers are described by integers, floats etc.  "Hello World!" is a string.

To input a string, use raw_input()

name = raw_input('What is your name?')
print name

The above, stores the input  into a variable called name and then prints the name.

What is stored in a variable,  can be changed in the program.



Tuesday, June 23, 2015

Python on the go

In Python, a simple “Hello, World!” program would look like this

 print 'Hello, World!'


In C, it will look like this














One can see how much simpler it is, to write certain programs in Python. 

What is in most programs are generally the same. They have the following:-


input: Input data from the keyboard, a file, or some other device. (eg. raw_input)
output: Display data on the screen or send data to a file or other device. (eg print)
math: Perform basic mathematical operations like addition and multiplication. (eg  +   -     *      /   and %)
conditional execution: Check for certain conditions and execute the appropriate code. (eg. if, elif, else)
repetition: Perform some action repeatedly. ( eg. for, while and  the process of recursion)





Python on the go

I have been trying out three introductory courses  from Harvey Mudd College, MIT  and University of Michigan. The first two from edX and the last one from Coursera.

The hardest ones  seem to be the ones from edX - Harvey Mudd and MIT - but the content for those courses are very good and those who are up for the challenge, should probably try them out. For those who are starting out programming  and want to learn it in a more relaxed manner,  the one from Coursera - University of Michigan may be the better option. Generally all three so far, appear to be good enough courses to gain some knowledge  in programming. Professor Charles Severance from the Coursera one,  University of Michigan has written a remixed version of the 'Think Python' book.
Professor Zachary Dodds from Harvey Mudd  has  teamed up with others to also write a book about Python while Professor Eric Grimson    from MIT has won awards for his research in computer vision.

Python is made from C so, according to this article, it is good to learn as many languages as possible.

Unlike Python, getting a C compiler can be a headache in itself as there are many out there and some may not run properly . CodeBlocks  is relatively easy to set up and seems to have not much problems in running the programs.
http://www.cprogramming.com/code_blocks/


Sunday, June 21, 2015

Python on the go

I have been trying out some courses on this programming language for the last few weeks and have found it to be an interesting one.

It's less than  20 MB in download size and it is text based but the language itself is quite simple - probably the simplest I have seen so far. I have had to set it as  - use as admin - as it was crashing quite a few times at the beginning.

In Windows, Python is run through Idle. The version that is used in most courses is Python 2.7.  I read that the reason is due to incompatibility of the code of 2.7 in version 3.

https://wiki.python.org/moin/Python2orPython3

 Idle in Windows, is found by clicking  Start , All Programs , look for  the Python 2.7 folder and click on Idle. Programs are usually written in the Idle text editor and saved as .py files before running them.  The .py files can be edited by right clicking on them.(A simple text document (.txt) can also be used by Idle to run the programs.  Idle can save them in the .py files by typing .py at the end of the filename.)

The programs are run by pressing F5. Idle  will usually automatically prompt you to save the file before it runs.

Here are some resources about Python:  (updated 12-7-2015)

Tutorial:-  The Python Tutorial

Books : -
Think Python by Allen B. Downey
 Python for Informatics by Charles Severance - a remixed version of the above book
CS for All by Christine Alvarado (UC San Diego), Zachary Dodds (Harvey Mudd), Geoff Kuenning (Harvey Mudd), Ran Libeskind-Hadas (Harvey Mudd)


Debugging: - Online Python Tutor by Philip Guo

The courses that I have been trying out are also very good. The one from Coursera  goes at a more gentle pace while the other two from edX   seem to have quite a lot of content in them.

Edx -UWashingtonX: ECFS311x Becoming a Resilient Person: The Science of Stress Management and Promoting Wellbeing

The title of the course is a little bit condescending but the course itself is  something to reflect on and to ask ourselves whether certain topics of it, apply to us in our daily lives. So I think the course is worth a look. There are not many stress management courses in edX that deal with what can be a very complex health issue.

I think the second week may have something in it - that we tend to live our lives without  values or long term goals - hence the lack of meaning in our lives. Education is one of the key values mentioned along with relationships, which can be more important than education . Health and  leisure are the other two key  values that are mentioned.

As for the third week, I noticed  that  at times I  actually wasn't thinking about what I was eating! The bottom line about this is to reflect on it and ask ourselves if it applies to us and if it does, implement it and see if it works. The course is not difficult as the questions can be repeated as many times as you want and the assignments are more or less optional, but I sense that the main purpose of  this course  is not to pass exams, but to learn how to cope with  one of the most complex health issues, in this day and age.

It appears that there may not be an honor cert for this course but I guess that is understandable as the questions can be repeated. Anyway I still learnt something from it so it is still quite useful in that manner.  Updated 5-8-2015


 Here is an additional website on stress management that has some similarity to the course
http://www.webmd.com/balance/stress-management/features/10-fixable-stress-related-health-problems?page=2


Thursday, June 11, 2015

Good Running Form

I have been trying to read some articles about this and here are the  links to  them-
http://blog.bsxathletics.com/2013/03/27/recommendations-for-great-running-form/
http://www.goodformrunning.com/.
http://runnersconnect.net/running-training-articles/running-technique/

Seems like to run better, it is best to lean forward slightly. I felt that it was taking some time for me to warm up but with a  slight lean forward I seem to be able to run faster at the beginning. So far, I have only run a mile using this running form as my runs  have been  interrupted by rain the last couple of days.

Update: It appears that it needs to be assessed on an individual basis. So here are some articles that seem to state that it may not be that significant-

http://greatist.com/move/proper-running-form-tips
http://greatist.com/move/proper-running-form-tips
http://www.drpribut.com/sports/running_form.html

Wednesday, June 3, 2015

edX - UTArlingtonX: ENGR1.0x Introduction to Engineering and Engineering Mathematics

So far this is like a general knowledge course on Engineering. It isn't easy, like most edX courses. It has got me a bit more interested in other fields of engineering.

There is some fun at the beginning of the course where I had to be like an  American Idol judge ( well something like that anyway!). However it can be  a tough exercise as it does not turn out to be positive all the time, from what I read in the discussions. Can't really condone it too much but I guess for two homework assignments, or for less marks, it is okay.

Tuesday, May 26, 2015

edX: - HarveyMuddX: CS002x Programming in Scratch

This is a fun course to try out. I have learnt quite a few things from it and though it may seem to be more geared towards children, adults can join in and will probably find Scratch to be a useful program. I think it brings out the child in everyone of us and it is one of the better edX courses.


Monday, May 18, 2015

edX: - HarvardX: CS50x3 Introduction to Computer Science - week 3 Continue

Obama was not totally wrong when it came to answering a Computer Science question.



bubblesort
(n(n-1))/2
big O    - eg  order of n^2   or O(n^2)

O(n) - finding maximum number in a list
O(log n)  -eg  phonebook -approximately decreases  problem in half every step - list has to be sorted 
O(1)  -  constant

lower bound (n) or   Î©(n)  - eg  bubblesort
lower bound (1)  - phonebook
selection sort -    upper bound and lower bound of n^2
insertion sort -  upper bound and lower bound of n^2
merge sort - eg sort left, sort right and merge  O(n log(n))  which is much faster

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

Sunday, May 10, 2015

edX: - HarvardX: CS50x3 Introduction to Computer Science - week 3

Main functions, command line arguments and sorting  are covered . There are some fun examples of sorting here.







main with argv[] - array of strings
2 chunks of memory


./hello-3 Zamyla     with argv[1]
if no name  - null
argv[5000]  - segmentation fault - touched segment of memory we should not have

error checking   - argc==2
any number of arguments beside 2, program will exit

string - array of char
argv-1      This will print each argument, one per line 
argv-2    get the jth char in the string

sorting- bubble sort, selection sort, insertion sort




Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

Sunday, May 3, 2015

edX: - HarvardX: CS50x3 Introduction to Computer Science - week 2 Continue

Strings and arrays are covered. At the end is a humorous clip from the movie " Spaceballs".






string - char
strlen needs string.h library
not enough memory
null if something goes wrong
check for null
ASCII
integer to char
capitalize
ctype library functions - toupper and islower
https://reference.cs50.net/   info for functions in libraries
arrays
strings end with \0

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

Sunday, April 26, 2015

edX: - HarvardX: CS50x3 Introduction to Computer Science - week 2

More about  functions and data types are discussed in the lecture while at the end, is the tragic story about the Patriot missile which was caused by a  floating point arithmetic error. 




Some short notes here on the lecture:-

can omit curly braces when using one line of code
ssl - encrytpion
regulations about cs50
functions
abstraction - encapsulates
int - returns an integer
implementing get positive int for error checking
int n in the proper braces
prototype
scope - local vs global
data types - char,int, etc
char - 1 byte or 8 bits - 256 total values
int - 4 bytes -  4 billion values
float 4 bytes, double 8 bytes, long long  8 bytes
overflow - 0 comes after 255 for 8 bit values
problems related to float

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

Sunday, April 19, 2015

edX: - HarvardX: CS50x3 Introduction to Computer Science - week 1 Continue

Right at the end is the touching story of Saroo Brierly which  is going to be made into a film soon.





Some short notes here on the lecture:-

make - make object code
./hello
printf is in stdio.h
main - default entry point
paranthesis - holds what is used in printf
double quotes - surround phrase
\n- newline
;   -   finishing a statement
make - finding the file and convert to object code
clang - compiler
clang hello.c - ls to list contents of directory - a.out
mv a.out hello  and then -lcs50
in stdio.h   more to printf
escape sequences
%i is a placeholder for integer
types of variables - float, int , char
in cs50 library - string and bool - Getstring etc
condition  - if condition   { do this }
boolean expression   -  if condtion  and/or another condtion is true needs && and ||
switches - like if else but use cases
loops  -  for, do while
variables need to be defined
functions
a program to do addition with  int x=Getint();
condition-0.c  -  if, else  at first but could not detect zero so if , else if and else used

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

Sunday, April 12, 2015

edX: - HarvardX: CS50x3 Introduction to Computer Science - week 1

A  history of Paul Allen and Bill Gates and their path to programming the Altair 8800 is read out by two students.  String variable is introduced in this lecture.







Some short notes here on the lecture:-

source code
compiler
object code  0 and 1

while (true) - can run forever
for loop - iterate from 0 to 10
variable - store something
counter - counts forever
boolean expressions  eg    if x>y
condition - compares

compiler - eg gcc
standard environment linux  - a hypervisor
cs50 appliance - gedit

make - triggers the compiler - saves 0 1and1 in a file called hello
./hello runs 
\n is actually new line
string s   %s
printf is part of stdio.h
cs50.h library has functions
GetString Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

edX: - CornellX: ENGRI1210x The Computing Technology Inside Your Smartphone

This is another digital course I have been trying out. Seems  interesting so far.  Topics are:-



  • Describe how a smartphone processor works
  • Explain computer system design from binary information to programming
  • Design a small working computer
  • Describe common techniques used to make computers fast

Saturday, April 4, 2015

edX: - HarvardX: CS50x3 Introduction to Computer Science - week 0 continued


There is an amusing example of how programs work with peanut butter jelly sandwich in this lecture.



Some short notes here on the lecture:-

variable - container
loop   - for
condition  - if else

scratch program
statement - eg say hello world,  wait for one second, play sound
boolean expression - eg.  >,  true or false, touching mouse pointer
condition block - if else if else
loops - repeat
variable n
mltithreading
multicolored bulb and binary bulbs

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

Saturday, March 28, 2015

edX: - HarvardX: CS50x3 Introduction to Computer Science - week 0



  • Computers only understand zeroes and ones, an alphabet called binary. While humans use decimal, which has 10 digits 0-9, computers only understand binary, which has two digits, 0 and 1.
  • Now we can do more, by using ASCII, a standard that maps numbers to letters. For example, A is mapped to 65B is 66, etc. Though bits can only store numbers, programs can translate those bits to letters for humans to easily read.

Algorithms


  • Algorithms are sets of instructions to solve particular problems, taking inputs and producing outputs that are hopefully correct, but also efficient.
The famous phone book example:
  • We can open to the first page, and look for someone, say, Mike Smith. Then we continue to the second, third, and so on until we find Mike Smith. That algorithm is correct because we will find him eventually, but isn’t very fast.
  • Humans reasonably open to the middle, and since the phone book is alphabetical and the middle is the M section, we can literally tear this problem in half by ripping the phone book in half and keeping only the half that we think Mike Smith is in. 
efficiency

  • The green line will have a logarithmic slope that doesn’t increase in height as much as the other lines. With the phone book, even if the size of the phone book doubled, it would only take one more step to solve the problem.

Pseudocode is describing code for a problem in English:


1pick up phone book 2open to middle of phone book 3look at names 4if "Smith" is among names 5 call Mike 6else if "Smith" is earlier in book 7 open to middle of left half of book 8 go to line 3 9else if "Smith" is later in book 10 open to middle of right half of book 11 go to line 3 12else 13 give up



Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.