Posts

Showing posts from February, 2024

And to the mystery, Of something pulled away from me

Image
And to the mystery, Of something pulled away from me Still quoting from "Rupturing" by Emily Jane White. I'm still learning Django like the absolute BOSS and PRO that I AM. Margaret Elaine Hamilton who wrote the software for the moon landing. render() I am really struggling with this Django method. From the Django tutorial: "The render() function takes the request object as its first argument, a template name as its second argument and a dictionary as its optional third argument. It returns an HttpResponse object of the given template rendered with the given context." (I don't think that this is always the case with render() - I think that there are more optional arguments.  But here and for the purposes of this tutorial I think we just need these three please - thank you). IDs in Django As you can see I am getting pretty desperate at this stage. Nothing makes sense and nothing is working. But I can get there. And I will get there. I will get there. I will

Rupturing

Image
Rupturing Tarot card for the Tower from the Light Seer's Tower. Please see explanation below. Today's song I am playing on repeat is "Rupturing" by Emily Jane White. Haven't read into the lyrics yet properly. A little note on views in Django "Each view is responsible for doing one of two things: return an HttpResponse object containing the content for the request page, or raising an exception such as Http404. The rest is up to you." "Your view can read records from a database, or not. It can use a template system such as Django's - or a third-party Python template system - or not/" Django has a template system. How interesting. I've heard of this before. I assume that it is coming later in the tutorial. What is a template I wonder? "[Your view] can generate a PDF file, output XML, create a ZIP file on the fly, anything you want, using whatever Python libraries you want." "All Django wants is that HttpResponse . Or an exce

The House Set Fire To My Heart

Image
The House Set Fire To My Heart Today's song we're quoting is Bat For Lash's "Good Love". I have seen her live once. I am learning Django and I am learning it fast. Last night my code wouldn't work. I may try again today. A hydroelectric dam - the lac de la lande in the vosges mountains, france. I once stood at the top of that stony hill and felt the most powerful that I have ever felt in my life. path() arguments in Django So Django, which is a Python framework, has a path() function, and it takes four different arguments. From the tutorial, it seems that only 3 of them are relevant - so we will leave path() argument: kwargs (keyword arguments) for now. 3 relevant arguments The three main arguments I want to focus on are route, view and name. route "Route is a string that contains a url pattern. When processing a request, Django starts at the first pattern in urlpatterns and makes its way down the list, comparing the requested URL against each pattern

No More Candle In The Wind

Image
No More Candle In The Wind Quoting my favourite song of all time: Yosemite by Lana del Rey. No more candle in the wind. I am not a baby. I am not helpless or powerless or fragile. I am strong and I am powerful. I am strong and I am powerful. I am strong and I am powerful. I am strong and I am powerful... and I am learning Django. That's right. I finished Codecademy's basic Python course. And now it's time to learn Django. The Lac de La Lande in Vosges Mountains, France. Aged nearly 15 I stood on this bridge and felt the most powerful that I had ever felt in my life. This was the site of a hydroelectric dam so maybe that's probably why. Questions About Django So Far What is a view? What is a URL conf? What does include() do? " Whenever Django encounters  include() , it chops off whatever part of the URL matched up to that point and sends the remaining string to the included URLconf for further processing."  ???! " The idea behind  include()  is to make it

Burning, the roads through my mind are on fire

Image
Burning, the roads through my mind are on fire Marika Hackman's 'before I sleep' is just the best. I wanted to quote it again today. Constructors in Python are so hard I needed a separate blog post for them. Nyx, the Goddess of the Night Constructors in Python I asked Chat GPT to explain things to me but it still didn't really help. I understand NOTHING but here's some code that I wrote: class Circle : pi = 3.14 # Add constructor here: def __init__ ( self , diameter ): print ( "New circle with diameter: {} " .format ( diameter )) teaching_table = Circle ( 36 Like as in absolutely NOTHING. Instance Variables Oh no even more complicated stuff. Oh so help me God please help me. Classes vs. Objects - courtesy of Chat GPT Class A class is like a blueprint or template for creating objects. It defines the structure and behaviour that all instances of the class will have.  This includes methods. And class variables. Object (Instance) An object is a

Classes in Python

Image
Classes in Python When I hear "Words" by Bayonne, I think of the American Hill. The American Hill is my favourite place on earth and it is a hill near my house in Luxembourg. I call it the American Hill because when I am on there, way way way high up, I feel like I am in America. I LOVE that place. I love Luxembourg.  I love the energy infrastrcure. Types Just reviewing the obvious on types. There are different types and different things that you can do with them. The type of data that you are using will affect the methods you can use on it and so on, for examples, strings are not divisible, and you cannot use .get() on an integer. Classes "A "class" is a template for a data type. It describes the kinds of information that class will hold and how a programmer with interact with that data." You define a class by using the word "class" and it is recommended to capitalise them. Instantiation "A class doesn't accomplish anything simply by be

When the full moon turns white that's when I'll come home

Image
When the full moon turns white that's when I'll come home I love "Full Moon" by the Black Ghosts. It plays at the beginning of Twilight. The movie Twilight changed my life. It came out when I was 14. Twilight is all about introspection and looking inside and going on your own inner journey. And believe me when I say, that, as a teenage girl, I needed that. Today I feel like I am going on my own inner journey again and it is so exciting. This looks a bit like a setting from the Twilight movie. Reading CSV files Okay, back into the Python again for today, then! I created a for loop which read through some CSV files and appended them onto a list. I had to use the cool way of accessing specific values in dictionaries by the following syntax: dictionary_name["Key Name"] ). Reading Different Types Of CSV Files "We call all files with a list of different values a CSV file and then use different delimiters (like comma or tab) to indicate where the different val

The Soul That You Bring To The Table

Image
The Soul That You Bring To The Table "Margaret" by Lana del Rey ft. Bleachers is one of the best songs ever. It's such a curveball omg. I like to be a curveball too. I like to bring the unexpected to everything that I do.  For that is just me; I am unexpected. I like to throw curveballs. Nobody ever sees things coming with me. Just some random pylons... Modules I did a lesson on modules. It was great. Nearly all of it rolled over from my background in working as a software engineer. Yes!!! For the first time on this blog I am saying that. Even though it has been my job for a while. I skipped the video on datetimes because I hate videos. They are boring and not accessible to me. I also skipped a tutorial on pipenv which I may have to go back to at some point. pipenv? What is that? Thank you.  Dictionaries I can't say too much about them because I am learning so fast. I have made a LinkedIn post about them anyway. I learned a lot of interesting things about them overall

Maybe Love, Part II

Image
Maybe Love, Part II  This is another post dedicated to Weyes Blood's "Maybe Love". But right now I am actually listening to Lana del Rey's "Jon Batiste Interlude" on repeat. I LOVE this song. I can never get tired of it. And here is a picture of a pylon near my house: String Methods I have just finished my lesson on string methods in Python. I didn't do the off platform project but that doesn't feel like my priority right now. I feel like I just want to move through the course as fast as possible. And just learn the syntax. I can come back to the off-platform project later if I like but this might not be my top priority for right now. What string methods have I learned? Any interesting ones in particular? .split() Splits a string into a series of list items on a list. You can specify what you want to split by in the brackets, if left blank it just splits on spaces. susanna_string = "Susanna likes cuddly soft dragons" susanna_list = susanna_

Dance The Night

Image
Dance The Night I LOVE the song "Dance the Night" by Dua Lipa. I always immediately feel immensely strong and powerful, the moment I start singing it. It's from the Barbie Movie.  I just absolutely love Dua Lipa in general. To me she exudes strength, confidence, self-assurance and power. She's incredible. She is amazing. I love her. She is brilliant. Absolute goddess energy. Strings in Python So today on the train up to London, I have been doing strings in Python. So far so good and so similar to JavaScript; and/or so similar to LISTS in Python, which I have already done. One of my former Senior Engineers has been mentoring me. He has been just absolutely saving my life. He is an expert in Python. We have agreed on what my next plan and course of action and strategy will be.  He really, really helped me to understand slicing in Python - as well as to slowly understand list comprehension. He is so coooool! Thank you. I am so lucky to have a mentor like that while I sea

Her dance filled me with peace

Image
Her dance filled me with peace Today I am still blogging about Python. I feel like watching the hunger games even though I just rewatched it all. Katniss Everdeen inspires me so much. She is so strong and so powerful. Katniss took on the Hunger Games and she took on the Capitol and she led the rebellion. And if she had lost her job then she too would probably be doing exactly what I'm doing now. And I can't say exactly what it is that I'm doing. But I have a plan. Python I learned about keyword arguments and default parameters in python functions. Keyword arguments mean that you can SPECIFY the parameter and its value and therefore put it in any order you want. Default values means that you assign a specific value to each of the functions and then that, if nothing specific gets inputted into the function call, this gets done automatically. Variable Access I am exhausted and I am losing the will. I am learning Python so fast. Am I doing it too fast? Nah.  Should I be moving

You're the best pilot we ever had, part II

Image
You're the best pilot we ever had, part II I am learning Python like there's no tomorrow and hopefully I can soon reveal why. I'm in the office learning it day in day out - that's right I still have access to my office space. Because it was an annexe office we have a contract that still lasts a bit longer. And so I'm learning Python in here. Every day. Like there's no tomorrow. I'm learning Python like there's no tomorrow. I love electricity. The lights don't turn on for me.  I turn on for the lights. Python I've been working on lists and there is a LOT to learn. The one that is messing with my head is l en() . It goes like this: len(mylist) len(someotherlist) Tuples They are like lists but they are immutable. You can't change them. So you could do something like this: susanna = ("Susanna", 29, "Renewable Energy Software Engineer") You can also do some destructuring assignment: name, age, occupation = susanna print(name) #

fire doesn't scare me

Image
fire doesn't scare me I learned something new in Python today. If and when checking for a condition, you need an "and" keyword for example. Let's say I want to check if someone is in their 20's. I need something a little like this: if age >= 20 and age < 30 Which is new to me and different from JavaScript - I think. Or maybe I just forgot. trying to concatenate a string with a float today I learned that Python doesn't allow you to concatenate a string with a float. whoops... sorry instead you can do this: str() this is the string method - that converts any integer or float to a string. And probably other data types too, I guess? Lists Lists are basically like arrays, now - aren't they??! Everything looks just about identical about the syntax so far - PHEWPH! Lists, just like arrays, can contain different data types. .append() So methods in python are similar to JavaScript. They follow the name of the list (which is an array) and they are preceded by

Everything I'm Learning In Python

Image
Everything I'm Learning In Python # is a comment print prints something print() is a function, like in JavaScript You can use double "" or '' single quotes around a string just like in JavaScript. Variables are assigned with an = sign and don't need a let or a const equivalent. I cannot get used to not using let or const !  And it's so weird reassigning variables without let or const too.  Errors Two common errors in Python are NameError and SyntaxError SyntaxError Something wrong with the way your program is written. Punctuation written wrong A command that is not expected A missing parenthesis  NameError A word that it does not recognise Something that looks like a variable but was never defined Concatenation The Python str() method turns a number into a string. Plus Equals This is good coding revision anyway. You can increment values using a += operator. My biggest technical goal going forwards

Our Love Is A Ghost That The Others Can't See

Image
Our Love Is A Ghost That The Others Can't See On Monday this week I got laid off and this week has been hard. Being laid off is a type of trauma. I don't say this lightly, and I also know what I am talking about. Trauma is anything that happens too fast, too suddenly to process. Unwantedly. Of course I loved my job. To know me is to know that I loved my job. I never stopped talking about it. I never used to shut up about it. But I remain positive and confident and hopeful. I hope that I can keep my mission alive - or do something better with it. But I know I want to work with software engineering and renewable energy. That is all that I really want to do. That is who I am. This is me two years ago, in a talk I gave on neurodiversity at work. ✌✌

Daniel

Image
Daniel Daniel by Bat For Lashes came on and I had to write a blog post just to pay tribute to that song. I still want to include a picture of Yosemite though. Yosemite National Park at Twilight. My nice, neat, and organised to-do list, for my blog I just wrote up a huge piece of my research for work. I am still waiting to see whether it will be used or not, but I remain hopeful. It was a huge piece of work. I feel like I need a tiny bit of a break after that. But I cannot just give up on my research.  I cannot just give up on my research. Okay so where is it then Okay. Here. Now. I need to finish watching that video from Friday's blog post on Renewable Energy and AI. I have about 2.5-3 minutes left. I doubt I'll take any more notes. I just want to have finished it off for me. I need to finish writing up my notes from that video. I have them in a little pile inside of a notebook on the desk in my office. It would be another little post and I might revisit some of the points in m

You Know I Left A Part Of Me Back In New York

Image
You Know I Left A Part Of Me Back In New York I love renewable energy and AI so, so much. I can never get enough of it. So while I have stalled on my current article while it all gets a little bit overwhelming, and while I have a lot going on at work, and while I process this article, I wanted to watch a little video, which it might take me more than one day to watch also. I don't know what happened with the font above but hey that's fun. 😼 What the video is saying so far: "Machine learning [can be used] to boost renewable energy generation and reduce the costs of wind farms." I mean this is always always my favourite topic in the world... always. Here are all the great quotes from the video I watched nearly all the video so far. There were some cool quotes towards the end about the grid level but the really cool stuff was in the middle.  I wrote it all down. I should process it better but that might be another post. Here it is for now: "For example in the renew

No Reminders, Part II

Image
No Reminders, Part II Here is the original No Reminders blog post. There is more about the song there. I have a two-part job today Really I think that it would be better for me to move on with the actual testing for Cypress. But I wanted to read through these two docs: Intro to Cypress and End-To-End Testing. And I know that I should probably do this so here I am. Even though coding is probably more important than reading.  Maybe I'll miss something if I don't read it so let me do this please anyway. Let's Start with the "Intro to Cypress" bit first... Who knows how it will go... In Cypress, you can query elements by SELECTOR... cy.get('.my-selector') "Cypress leverages jQuery's powerful selector engine to help make tests familiar and readable for modern web developers." Querying by text content You can use cy.contains  to find an element by its text content. "This is helpful when writing tests from the perspective of a user interacting