Monday 30 November 2020

CS50 Week 4 (30/11/2020)

I decided to skip one week of CS50 since I wanted to focus more on my Research Proposal and "prepare" for the Financial Econometrics test. After two weeks, I'm back. This time, with an introduction to Memory, Pointers, and Files. I remember that this was the thing that I had difficulty understanding, and I still do. 

The part on Memory was quite easy to understand, and I think I have a better understanding of Pointers now, but I'm still not comfortable with Files. While doing the Problem Set 4 Recover, I had to make notes and rewatch some parts of the walkthrough several times, because I wasn't sure how and at which part of the codes to use it.

Well... here it is... my progress.


Halfway or not???

I didn't get full marks for both problems in PS4

Overall, I think Filter was a lot easier than Recover, despite having more to do. But it didn't mean that I got everything correct on the first go. Like, for the Blur subsection of Filter, I made a bug while writing the codes. I didn't realise that my output would produce wrong answers because I was using altered values for Red Green Blue pixels as part of producing a new blurred image when I shouldn't. I thought that I did something wrong for the algebra, but I didn't. It was just a bug that I had to fix by creating a temporary image or a copy of the original image, that I can alter without having problems using the wrong sets of Red Green Blue pixels by using the values of the original picture, and not those of the copy.

My strategy for implementing Blur in Filter

As for Recover, after getting several Segmentation faults and blank images, reading through Stack Exhange and Reddit to find out what's wrong with my codes, I managed to get everything correct eventually, though upon checking my gradebook, I realised that I didn't get full marks for both Filter and Recover due to style.

What Style50 suggests me to do in order to avoid lengthy codes in Filter

After checking my submissions on Style50, I found the reason for the non-full marks. Apparently, for Filter it was because I was writing really long lines of codes, and I could've made it shorter by using the command for "Enter" using '\n' and that wouldn't affect my codes. This is something that I should use in the next problem sets if I need it.

I have no idea why this is suggested because my codes already look like this before Style50 suggested it

But I'm not sure about the style in Recover. Maybe this all happened because I kept copying and pasting stuffs around, so the gaps are all around the place. Although visually, I see gaps, but the computer doesn't, so I guess this was inevitable.

Okay, so that was it for Problem Set 4. I will be back for next week's materials, InShaAllah.


Monday 16 November 2020

CS50 Week 3 (16/11/2020)

The mid-semester break has started. It's a bit earlier than normal. Normally there will be 7 weeks of lectures before we get a mid-semester break, but for this semester, due to the COVID-19 that still has not subsided, and also probably in conjunction with Deepavali, our mid-semester break happens after the first 5 weeks of lectures.

I was busy with my Financial Econometrics assignment 4. It was on Cointegration and Toda-Yamamoto causality test. Choosing the appropriate model was hard for me because I was not sure when a model is considered free from autocorrelation. But since Prof said that marks will be given based on efforts and not on precision, I guess it won't hurt too much if I got the model specification wrong (add extra lags, or in short of a few lags). I think the most important thing is to clearly present that you understand what you run on E-Views and then you can express it well in algebra.

I did my Financial Econometrics assignment until Saturday, so I only began doing CS50 Week 3 on Sunday. I also began doing the problem sets on the same day. For Problem Set 3, it was the most challenging Problem Set so far, mainly because both the questions that I needed to complete and submit were new to me. They were nothing like the ones that I did in 2018. Well... the concepts are the same, but the questions are different :P I guess, since essentially, I'm still learning what I've learned before. If I'm not mistaken too, the next topic will be the most challenging one, on Pointers, I think haha~ maybe yes, maybe not. Whatever it is, I'm gonna prepare both my mind and body to endure the difficulties that are to come next.

Screenshot for Question 1 (Plurality) - the wrong code I've written

For Plurality (and also for Runoff), I didn't use any physical writing on a paper (or a tablet) and I did all by mental calculations and logics. I guess I didn't need it since I can just imagine what happens in the programme in my head. Everytime I wrote down a section of the codes, I go through the codes again, and think deeply about what things I may miss out, or what exactly happens to the arrays of variables that I have. I'd find bugs when I think like this, just like the one found above. If you look at the terminal (on the bottom of the screenshot), I purposely input in a way that everyone (Liyana, Syahirah, Amal and Nabila) would have similar votes, so if the programme codes are correct, everyone's name should be printed out. But only the first and the final person's names are printed, showing that there's something wrong with my codes. So I had to work on the codes again, until I get them right.

Screenshot for Question 2 (Runoff) - the wrong code I've written

For Runoff, I faced sooooo many problems. I think almost all of the sections that I worked on didn't work the first time I computed the codes. They just seemed wrong. But after re-thinking of new algorithms over and over, alhamdulillah, I finally finished this question too, completing my submission for Problem Set 3.

Problem Set 3 Complete!


Okay, I'm gonna take a break from CS50 while I work on my Master's Research Proposal. I've been making slow progress on it. Still haven't finished the Literature Review. May I make substantial progress on my Research Proposal over this mid-semester break! Ameen~

Saturday 7 November 2020

CS50 Week 2 (07/11/2020)

This week hasn't really as I hoped it to be. I've had to go out of the house a lot, to send parcels for courier and also to buy household necessities. These took quite some of the time that I could've used for studying. But the most disappointing thing about this week is how I've been watching YouTube or Facebook videos before I start doing work, and you know how these videos can be addictive. It's one after the other, and then you realise that you've already been too long on social media/internet. 

I had coursework to do, of course, for Financial Econometrics. I did that but I guess it's because I'm not used to reporting time series results, it took me too much time to finish it. I began doing it on Wednesday (the day after lectures) and finished on Friday night. Huh... really took a long time on it.

On Saturday (today), I decided to do CS50 Week 2. I definitely needed the refreshing of my knowledge since I had the wrong idea of what arrays are on C. But nevertheless, things seem to be more clear to me and it does show how "better" I became at writing codes. I was able to write down the codes without having to search for tips on StackExchange or the likes of that. Alhamdulillah.

To my surprise too, I was able to complete a problem that I've never done before, which was "Readability" (I'm sure I didn't do this one during the 2018 session), though not really something I should celebrate since I didn't get full marks for this (I don't know what's wrong with that one particular thing, ugh). But one thing that I'm a bit skeptical about myself is that my level of attention and focus is a lot more intense when doing CS50 compared to when I'm doing my Master's stuff. I guess it's because when I was doing CS50, I have that urge to finish it ASAP so that "I'd have more time for my Master's" added with the fact that I've used up a lot of time just for Financial Econometrics the days beforehand. 

                                        

Notes that I wrote down for "Readability"

Done Problem Set 2, albeit didn't get full marks

Alright, hoping for a better week ahead :)

Sunday 1 November 2020

CS50 Week 1 (01/11/2020)

This weekend, I nearly forgot that I wanted to dedicate my weekends to CS50 if my other (more imperative) assignments are in pretty good shape. To be frank, I think this week has been really unproductive. I had my period and I had a terrible menstrual cramp. I took 6 tablets of Panadol Menstrual overall, though normally I only took 2 or 4 to ease the pain. So, for one of the days, I really did not do much. As for the other days, I did something, but I wasn't pushing myself to do as much work as I should. I took more breaks and these breaks were a bit longer than they should, sometimes extending to more than an hour. I also did more drawing than I should, I guess.

So for next week, I hope I can improve on my time management because ideally, I would like to finish my Master's research proposal ASAP, get feedback ASAP, and begin collecting data ASAP. On the other hand, I feel like I am procrastinating a lot because I "have a lot of free time" since I'm only doing one module this semester and I have the research coming along. That's one of the reasons why I decided to restart doing CS50, to have more intellectually stimulating things to do. But at the same time, doing all of this is not occupying enough of my time (so far since the semester just started anyway), so I have a feeling that I may become better at time management if I work part-time. Ugh~ but I'm not sure whether I should work when my proposal is still blank pages. So I'm kinda procrastinating the work part too!!!

But on Sunday afternoon, I felt like I should work on CS50 Week 1 because I have a feeling that I will neglect CS50 altogether if I skipped doing it this week. Eventually, I did CS50.

Alhamdulillah, I managed to finish all the exercises for Week 1. I think the exercises are similar to those that I've done before (I chose to do the easy ones like before, too, since I'm not confident that I can take on the harder ones). There's a really small change to the exercises, and I think that's it. But funny enough, I still had to do a lot of thinking and try-an-error before I eventually get the codes right. 

Progress so far. Nice to know that we still have the choice to do easier ones or harder ones, depending on our comfortability.

My personal scribbles for one of the problems in Problem Set 1

Alright, now that that's put aside, I can go on to the next week without any regrets. Let's hope for the best! Ganbatte!