Starting Work on Git-the-Branch

The Itch Aiming to write a tool using this which will show all the git branches in the current directory and the last commit date on those branches (and only the local branches :)) What I did today I had to carry my phone in to the service centre, so I did not quite have as much focussed time as yesterday, with all the coordinating and carrying, but I learned a few new things ...

November 12, 2020 · Mario Jason Braganza

A Good First Day

Was a really good day to ease back into Python today. I got my VS Code up and running. I got a personal [Gitea instance][crjw] up, to host my code, from where I will syndicate it to Github and Gitlab. And finally I got a projects page up, to slowly fill up with projects. I also managed to improve an old program I wrote for myself, but I’ll write about that in the next post. All in all, a day well spent. A journey well begun. ...

November 11, 2020 · Mario Jason Braganza

Getting Back on the Horse

Ok, one more time. I know there have been lots of one more times before, but I am going to keep at this until I get proficient enough at this to land a job :) And while I may not be brainy enough, the one thing I can do is be persistent enough to show up. This time, I will focus on building tiny projects. I realise my life is too chaotic for #100DaysofCode. But I can do this, one tiny thing at a time. ...

November 11, 2020 · Mario Jason Braganza

A Hundred Days of Code, Day 026 - Refactoring

Worked only an hour today. Trying to change the little lookup program, I made the other day, into something a little better. Not quite a good day. Calling it quits early.

August 3, 2020 · Mario Jason Braganza

A Hundred Days of Code, Day 025 - Comprehension Exercises

Working on Comprehension exercises today. Reflections and Experience I really need feedback, when it comes to programming. I cannot face a blank page. I always seem to start with printing something out to screen and then my brain kind of kicks into gear. Everything after that is just type, print, is this what I expected, if not then fix, type, print … Exercise 3.1 and I think, I am finally getting good handle on comprehensions. from something that would take me at least 10 lines of code to just expressing it concisely in 1! I can read Python messages and take a gander at what I need to do next. I see a '_io.TextIOWrapper' object and know I can iterate over it. I see AttributeError: '_io.TextIOWrapper' object has no attribute 'strip' and realise that it cannot be stripped into parts. I need another way to skin that cat. And then I took it too far (just like this sentence), and nested a comprehension in another one, in where, I had to learn how to put in a conditional in the form of a ternary operator, in Exercise 3.2 (the commented for loop is much simpler!), but that was very good practice. Really stretched me! I caught myself getting distracted a lot. I needed to set a 30 min timer and I spent about 15, looking for where the timer app in my Mint Desktop was, instead of just setting the darned timer on the phone. Took an hour to figure out the comprehension for 3.2 and about 20 minutes to do it for Exercise 3.3. Practice helps! Watching the solutions, and I realise, I got them right in principle, but that I need to be more aware of what happens to an object in memory, so that I can simplify code. I was able to remove one level of comprehension, which I used just to get the end of a string.

August 3, 2020 · Mario Jason Braganza

A Hundred Days of Code, Day 023, Day 24 - Tiny Utility to do comparative DNS Lookups

Problem - Compare domain lookups, against DoH Servers Take a list of domains (one per line) from a text file as input, find the IP address for the domain using the standard system level DNS, and then check against DoH answers from both cloudflare and google. and say if all answers match properly or not. Notes What do I need to do? (checklist) Get a list of popular websites, (probably Alexa) figure out a way to read them in loop through each line, and look up its ip with the local dns (use the sockets module) with Google’s DoH json endpoint (use the requests module) with Cloudflare’s DoH json endpoint (ditto like Google) Compare all the values. Print if they match or not. Experience I should commit my work often. This took me two days, because I lost all of yesterday’s progress in a computer hiccough. The program runs well. It intentionally limits itself to only the first result in the Google and Cloudflare lookups. I should learn to focus more on what is at hand and not overthink the program. I should be learning to build primitive little, handy dandy tools, not giant cathedrals. I spent two hours fiddling with a way to create another program that would process files for me. (and abandoned it) I need to read the documentation across sites very carefully. They are written with experienced programmers in mind, and not beginners like me. For e.g. When I was trying to look up domain names with Cloudflare, I blindly copied the example and then wondered why it was not giving me the appropriate replies. I then realised I was missing a seperate parameter, &ct=application/dns-json which was quite clearly listed above, but not in the example below. (which in truth was listed, but as part of the command at the command line and I, like a dumbass, just copied the requisite code to adapt to my Python program. Lesson: Cargo cult with extreme caution) Which leads back to the fact, that I should stick to what is assigned, because just doing that much at this stage is taking me a long time. Improvements and features can wait until I am much more fluent. I realise I am trusting autocomplete too much, and I should at least look at what I am completing. I spent 40 minutes, wondering why my comparisons were not working, when in fact, I was using the wrong variables. Lost loads of time with typos. Be more intentional. More slow. Code. Put your sitenames into a file called dumpsites.txt Run check-ip.py ...

August 1, 2020 · Mario Jason Braganza