Notes to self when using genRSS.py
genRSS is a Python 2 app.
Make sure you switch your environment.
python genrss.py --help
will give you everything else you need.
genRSS is a Python 2 app.
Make sure you switch your environment.
python genrss.py --help
will give you everything else you need.
Back at it after a short personal break. Lots of stuff to catch up on!
i can go back and forth, between lists and strings, converting one to the other and vice versa
i can sort and reverse sort the items in them.
i can nest lists. have lists of lists!
you’ll get confused and make mistakes. it’s ok.
do i still remember functions?
this inceptive programming, using function as arguments to others and combining them with other elements like lists (or inside lists to do shady shit on other lists)? it’s fancily called higher order programming.
and all this stuff generalised and abstracted are called higher order procedures
python provides something like this, called map
very simply put, map
len
for example or abs
) iterable
(think of it as the elements of the list, coming out one by one, but you get your grubby paws on them, before they go into some defined data structure like a list.) if i assume seq
is any of these data structures, i can,
seq[i]
- get the ith element in that list or string or range or tuple len(seq)
- get its length seq1 + seq2
- concatenate two of them (not range) n*seq
- repeat them (not range) seq[start:end]
- slice and dice them e in seq
- will return true if e
exists in the sequence e not in seq
- will return true if it’s not for e in seq
- will iterate over each element in that sequence Why? They save me time!
Instead of indexing on numbers, like I do with the 1st element or the 0th element of a list, i can just index on things, I define myself
In python you create dictionaries using braces. and store data using key value pairs. here’s a few
dictionary_of_names = {}
creates an empty dictionary. dictionary_of_ages = {'Jason':40, 'Tess':48; 'Leo':76}
creates a dictionary of names (keys) with their related ages (values) and now I can just ask for Tess’s age with a dictionary_of_ages['Tess']
without having to lookup where and at what location Tess is in the dictionary
dictionaries are mutable
dictionary_of_ages['Puppy'] = 4
will add the age of my stray doggo to the dictionary) 'Leo' in dictionary_of_ages
) del
dictionary_of_ages.keys()
) and similarly I can get at the values with a dictionary_name.values()
So because of their flexibility on what they can store and index on, dictionaries are much more capable than other data types
It’s like soup!
You’re making soup and there are bugs falling in, from the ceiling.
So how do you get good soup?
You could,
Defensive programming is,
Testing code, basically boils down to checking inputs and outputs.
Debugging
Yikes! I have a bug!
How do I kill it? What do I want to do to fix this?
Set yourself up, for easy testing and debugging
When you test you can,
Testing Approaches
Bugs
Covert
Be Patient. this will take time to get good at
print
statements liberally Work with small things.
Work in increments.
Test and debug it.
Use backups.
Have versions.
Test and compare across versions.
Feel free to work up and down the version tree
Professor Grimson is awesome, and teaches me the way, I imagined some one teaching me CS basics. So many aha moments!
Lets see what this day holds :)
Nope. cannot focus.
Annnnnd now there is no power.
This day is done!
Will just sit at the window and enjoy the rain :)
Hopefully tomorrow is a better day.
Just did the MIT course all day today, because my next problem set is due tonight and I did not want to fall behind again.
Got distracted a bit, but a lot less than yesterday with the way Nikola renders headers, and youtube videos of sausage making :P
Now that I am going through the class, I realise programming is not what I imagined.
It is at once, much simpler and a bit more complex than I thought it to be.
More than that, I realise I can do this. :)
The day isn’t over yet. Will attempt to solve the problem set at night.
a*b
when b
is 1
is just a
. a
to itself while decrementing b
until b
reaches one and et voilà, that value of a
is my answerb
is 1
. so i just keep adding a
to a function that just asks if the value of b
is 1
. if not just add a
to that same function where the else states that I reduce b
by 1
. when b
is 1
, i just return a
which will be the first of the added a
s and the function then begins looping outwards and backwards adding a
. I realise I have horribly explained it, but it’s somehow more intuitive and more elegant to my mind and fun to watch, so I’ll let Professor Grimson do it much better than I can
P.S. A note to student planet readers, if you miss some posts in that feed, check the site to see if I wrote anything (or manually subscribe to the main feed.) I might be uncomfortable pushing certain language or frustrations of mine to other learners at large.
Day 1 is an disaster of fantastical proportions.
I did lots of stuff.
But I got nothing of consequence done.
Save one big thing.
I managed to buckle down and study for six hours.
That counts as a win, a big one in my book.
Will hopefully get more done tomorrow.
If you are following this blog, the days might soon seem out of sync.
That’s because I’ve decided that Wednesday, Thursday and Friday are my days of study. Monday & Tuesday are for work, while Satuday and Sunday are for home and family.
I need to practice what I preach and have margins and boundaries in my life.
I learnt
abs(x-y)
instead of x==y
Ok. Time to be a bit honest.
As you folks know, I have been trying to learn programming using Python since June 2017, when I joined the 10th cohort of DGPLUG’s Summer Training.
And time and again, I have failed.
Not just with programming, but with most other projects I tried to do.
At the end of my rope, I decided to just quit everything and considered (very seriously) a return to my old stressful career, thinking maybe that is all there is for me.
Two people saved me.
The first one was Kushal Das.
The man was absolutely bull headed about me being in the right place and that if anybody could do this, it was me.
The other was my better half.
Everyday I count my blessings and am thankful that I that she chose to share her life with mine.
She patiently listens to my frustrated rants and then tells me to just dust myself up and do it again.
That failure is not the end of the world.
And then she told me to do my physio.
And that I really could do this.
Just because you failed doesn’t mean you can’t succeed.
We all fail. Mentally resilient people realize that its not failure that defines your identity but how you respond.
So towards the end of last year I decided to focus only on one or two things at once.
And at that time it meant my 12th exams.
I studied really hard for three months.
And I did not finish studying.
And I am pretty sure I am going to bomb my exam results.
Then why do I sound so chirpy?
Because I realised Kushal and Abby were right.
That I can in fact learn.
The past four months have been an exercise in frustration.
But I learnt something new everyday.
I could test myself on what I learnt and realise that I did in fact know stuff.
Which led me to my lightbulb moment.
That I cannot do all my learning like those montages they show in movies.
All my learning came from stretching just a tiny bit, every day.
I learnt the basics of Accounts, and lots of Maths.
The difficulty of a task is irrelevant, if it’s vital to your success.
— Ed Latimore
And now that exams are done, I decided to turn my attention back to programming.
And so I made a big ask of Kushal.1
I decided to go to Pune, and try to pick up the basics of programming in Python all over again.
And he graciously volunteered to mentor me for a week.
And here I am a week later, writing all sorts of tiny little programs that do whimsical things and bringing me joy.
I obviously have miles to go before I can even grasp at fluency.
But this time, I am filled with hope and a good measure of confidence.
It’s been a little nerve wracking and there’s been tonnes of head scratching and back stretching.
Kushal has been extremely patient with me, guiding me these past few days, making sure I stretch just the right amount.
And for that I owe him a mountain of gratitude.
Thank you so much Kushal! I hope to pay it forward someday!
I go back home now, and I’ll keep up the momentum with small incremental, regular periods of work.
I will log progress on the dtw blog where I can rant and rave to my hearts content.
My main focus will not be on results though.
Just to stretch myself everyday.
Improve myself just that little bit every day.
And then look back one day and be amazed at how far I’ve travelled.
The way you train reflects the way you fight.
People say I’m not going to train too hard, I’m going to do this in training, but when it’s time to fight I’m going to step up.There is no step up. You’re just going to do what you did every day.”
— Georges St. Pierre
Will Vincent, author of Django for Beginners and Rest APIs with Django has his list of book recommendations for the year.
Read the latest posts on his website to get at them.
If you are a learner like me and wanted a professionally filtered list, (as in too lazy to go hunt them down), this is a godsend.
He covers books on Django, React, Flask, & JavaScript and tutorials for Python, Django & React.
Also check out his year in review.
Thank you muchly, Will.
Testing … just testing
I started out with a very vague idea, of learning programming last year.
I went to Pycon India, fell in love with the community, decided to learn software, and came home all charged up. (Btw, I was so intimidated, I did not speak to a single soul.)
The plan was to sort personal issues, tackle a couple of major work projects so that I could then focus on learning, clear the decks and go full steam ahead come April.
While I made headway, I was also missing the hum and bustle of Pycon that had so charged me, but I did remember one session I attended, that had left me smiling was a sponsored talk of all things, by a certain Mr. Das. Off the cuff, naturally, warmly delivered.
So as I was looking for … someone to talk to, somewhere to belong, who comes along but Santa Das.
While that trip didn't quite happen due to personal reasons, we still kept in touch. (Why he would do that with a newbie-know-nothing like me, I don’t know. The man has a large heart.)
And when the new session of #dgplug was announced, I jumped at the chance!
To those not part of the dgplug summer training, read all about it here. The brave1 souls at the Linux Users’ Group of Durgapur take in a bunch of kids (and adults) who want to learn all about the magical world of software programming and give them tools with which they can paint on that vast canvas.
Our goal is to bring in more upstream contributors to various FOSS projects.
Through this training we show the path of becoming an upstream contributor.— from the DGPLUG summer training page
Communication skills, free software projects, documentation, system administration, source code management, time management, conference proposals and obviously basic programming – the whole gamut is covered here.
So while any odd duck can learn on their own, the DGPLUG summer sessions will help you become a well rounded individual who can code and contribute to the world. A software finishing school, if you will :)
Kushal and the training and it’s successes have been featured in opensource.com time and time again.
A look at the guest speakers (including the all father of Python and the cream of the Indian Developer community) should be enough to convince you to come join.
It’s only been a week, and I’ve been having a ball! We covered communication skills, touch typing and the vi editor this week! If you hurry, you can catch up and work with us.
And for my new #dgplug family, here’s a little something, something2 about me to close this post with …
I look to learn so much from you and know so much more of you over the coming months. I wish you all make good art!
Anwesha Das, over at Law Explained India, was one of the speakers at PyCon India 2016.
(Update: Anwesha rocked Pycon 2017 in Portland. The awesome folks there, seem to have put up the talks in near real time! Anwesha’s talk is here. Check out the rest, here. End update)
And she to me, is a shining beacon of hope, when it comes to actually making it as programmer in this community. All she does, and the way the community responds is heartwarming
A lawyer by trade and a nerd at heart, she along with her team of bravehearts rocked PyLadies at Pycon India. From what (admittedly little) I’ve seen, this fearless group seems to be the only active PyLadies group in the country.
More power to them! And I really, really pray, may their tribe grow! India could do with lots more women, who in my opinion are better at programming than us lads. (And were in fact the first members and drivers of the profession)
.
Her talk involved around generating awareness about the various software licenses in existence and their application to out software projects.
Being well aware of the ignorance, apathy and/or the strong dislike programmers have towards anything that is not coding, she walked through the various licenses that we could use, illustrating each one with examples.
Notable, was the amount of work she put into a project, where she grabbed and sorted the various licenses for the top few thousand packages on PyPI and used that map to make her points regarding licensing. You can go have a look-see here. Not just that, she’s been filing bugs to push developers to adopt a license, in case they did not have one :)
The last third of the talk, (in fact, the meat and potatoes) was on Best Practices for Developers when it came to choosing licenses for the project.
You can actually go read all about it here
Her point, in summary, (besides the how to) was to be intentional about what license you’d choose, to be aware of it’s ramifications, not just on you, but on the users as well.
I hope, PyCon India puts her video (and also the others) online soon.
Thank you, Anwesha. You were awesome!