Showing posts with label community. Show all posts
Showing posts with label community. Show all posts

Sunday, October 26, 2014

Obviously I still have a lot to learn about the language and it's application, but being exposed to it for the most part of my internship at Symph, I CAN say though that I have a pretty good grasp of the language's basics.

I greatly referred to Learn Python The Hard Way when I first started, as referred by Albert, and it's safe to say that for those interested in learning Python, their modules are the way to go. Not only have I personally experienced the course's effectiveness, but so did many of the professionals that apply the language in real-world projects when they first started out.

PizzaPy is a meetup group that gets together every month for an evening of pizza, beer and Python. Veterans and beginners freely enthuse about the language and often have a main topic to talk about every meetup. Although being aware of their gatherings for a while now, the celebration of their first anniversary was my the first time I actually participated in a PizzaPy meetup.

PizzaPy's First Anniversary celebrated at The TIDE

The whole day workshop was packed with interesting topics for both Python veterans and beginners alike. It began with a Python for Beginners talk, enough to help us survive the day at least, and then was eventually followed by A Sip From The Flask and a Crash Course on SqlAlchemy.

1) Python variables are Nametags

Many programmers visualize variables as containers of values that they want represented.

Python, instead, uses variables as similar to nametags, pointing to the objects or values they want to manipulate. Python creates the value first and then associates the variable to that value. If another variable has that same value, it is again associated to the already made value.

There is no duplication of values in Python

2) Python lists are "arrays on steroids"

As Daryl, PizzaPy organizer and first speaker, colorfully put it. Python's list is equivalent to Java's array, with a little perks. For example:

array = [1, 2, 3, 4]
and printing array[0] will obviously print 1, right? Now try printing array[-1]. Using negative numbers as indices for the array is acceptable in Python. Their output will be the nth element from the last end of the array. In this case, it's 4. Neat, right? A few other tricks:

print array[1:3]
>>> [2, 3]
print array[:2]
>>> [1, 2]
print array[2:]
>>> [4, 3]

3) Four Spaces is Best

It was in this event that I realized that in programming etiquette, when indenting your code, using four spaces is best rather than simply using TAB (which I am guilty of).

Snippet of code from a project in Sublime Text 2

Reason is that every PC has its own set of spaces for TAB, it could be five or six spaces by default. So when you use your TAB, your code may look right in your machine but when another coder views your code, it'll look totally messed up if his TAB is set in a different number of spaces.

Why is this so important in Python? It is because the language does not have any braces({}) to denote blocks. The interpreter greatly relies on the indents to identify each block of code.

4) The Difference between "..." and '...'

Basically nothing, in general. Single-quotes and double-quotes practically work the same way in Python. The difference, I learned was:

print 'someone is "happy"'
>>>
someone is "happy"
print "someone's happy"
>>> someone's happy

Use single-quotes when you want to display strings with double-quotes and use single-quotes when you want to display strings with single-quotes.

5) Flask was fun

Flask is a microframework  for Python based on Wrkzeug, Jinja 2, and good intentions. *

Steve, the second speaker, did a great job with introducing us to Flask. I used Google App Engine for Askbuildshare and I'm still a beginner at it so I'm not quite sure how it compares to Flask but Steve, when asked about Flask's scalability, said that their systems "haven't crashed yet" so I'm assuming Flask is reliable, at least for some apps that aren't heavy-duty.

My first Flask-run app, made with a lot of help

Trying it out and getting it to work was a really fun learning process for me and I'm looking to explore on it more, just to get a better sense of appreciation for the framework (then again, I still have Google App Engine to mess with so this will still be a while). If you want to learn more about Flask and it's applications, check out Steve's A Sip From The Flask. A very fun and cool intro to the framework and definitely work walking through.

So as you can see, I've only skimmed the surface of what I should have learned at the event/workshop and I definitely still am a sprout in the forest. I was quite happy to know, though, that majority of the event's participants were also beginners in Python like myself so I didn't feel too left out (although a lot of them were already masters of other languages in their line of work. meep). The event was smooth and fact-filled and was a day well spent. Hopefully I'll get to attend more PizzaPy meetups in the future and get to relate more with the hardcore programmers in events like these. 

Tuesday, October 15, 2013

I still have tons of pending posts but the word just has to be spread.

Skip to the end for the facts. 

The first 3 paragraphs are just my account of what happened.

As I woke up at 8-something something a.m. this morning, I thought it was a perfectly beautiful day. Drowzily sitting on my bedside with my sister still sleeping soundly behind me, I thought of today's to-do list and the appointments I had to reconfirm. Then the unthinkable happened. It started out as a small tremor that lasted a few milliseconds that quickly escalated to a full on house-shaking experience. I roughly shook my sister and made sure she got to my father by the living room. I live in an old renovated commercial building on its second floor and we could feel everything. The furniture started to shake, the cabinets and its contents fell, windows and glassware broke and parts of the wall beside the staircase started falling apart!

I know we should have stayed inside, according to advisories but we didn't think the house could take any more and might cave in so we ran for it. My father is to my sister and my mother is to me. My father led the way with my sister trailing close behind him. Comically (but not comically at the time), My mother's arms wrapped her harms around me. Mostly my head and, unintentionally, face. She said it was to protect me from falling debris but all it technically did was impair my sight and made it even more difficult for me to walk (with the tremor there and all). So, in fear of tripping or unintentionally hurting her, I dropped down to the ground and did a butt-slide down the stairs. When we got down, I grabbed her and ran for the gate. We all got out safe, same with out other neighbors and the people in our neighborhood but the panic was still there.

I got to talk to our neighbor who saw our wall go down and then the employees of the shop a floor below ours (they said their flat screen TVs on display, among other things, were damaged). It was all quiet for a few minutes until we saw the people from the market and further run the opposite direction. Somebody kept saying: "Ninghunas ang dagat! Naay tsunami!". I have no idea what hunas is in english but they practically meant the people that live by the sea have noticed the shoreline receding and concluded that a tidal wave is coming. Me, internally panicking, automatically believed it and convinced the family to get in the car to go to higher ground. Of course, after a few minutes (and after texting with a more sensible friend), I realized we were an archipelago and Bohol is located smack dab in the middle of it with other islands surrounding it in all sides so a tsunami was highly unlikely. Still, strong aftershocks are being felt until now. God Bless us all.

Magnitude 7.3 felt in Carmen Bohol. The epicenter.

Magnitude 4.3 at Intensity IV felt at Tagbilaran City, Bohol 9:37 a.m. Ocober 15, 2013.

VOLUNTEERS ARE NEEDED!!
Please contact DALAREICH POLOT (09399023462)

The heartbreaking thing is the destruction of our old historical churches. Most likely the parts that got destroyed weren't part of the original structure and were renovated (correct me if I'm wrong). Hopefully the local government will repair them using the original methods and materials so they'll stand longer.

Blog Archive

Popular Posts