Showing posts with label starter. Show all posts
Showing posts with label starter. Show all posts

Thursday, 10 December 2020

Release 0.4.3 - The End of Something Great

 


Hello my wonderful followers!

It is here... It is finally here. The end of this nightmarish semester is finally here.
I have to say the past two weeks have been really tough for me, with all the final assignments/ labs/ projects.... AND exams bearing and breathing down my neck as the due dates approached.

Needless to say, I got through it. Pulled a couple all nighters and multiple 14/16 hour days worth of work. It feels GOOD though. I found this semester to be the hardest/ most amount of work that needed to be done. Yet, I finished and cannot express how many things I have learned over the course of this semester. 
I have to give my koodos to the very knowledgeable and helpful professor HumphD (OSD600 - Open Source professor). Without him, and this course, I would never have entered the world of open source and have my transition into becoming an open source dev/ contributor go so smoothly. 

Anyways, back to the point. For my last PR of this wonderful course, I chose to do yet another issue for the repo of automating whatsapp web platform. This one was tougher than the last or any previous issues I've done for this repo. 

I think my biggest downfall is finding out how to get python and selenium to collaborate with me without an issue.


So. Let's start by explanation of what I had to do.

I had to open whatsapp. Once connection was established through the bot, I had to cycle through all individual chats and open them.
Once opened the chat info drop down had to be clicked and navigation to delete chat (of the opened already chat) was to be made. Once over the delete element (which is found using a CSS Selector), the element had to be clicked. 



Clicking the "outter" delete would trigger another pop-up box/event to be opened. The bot would have to wait for the presence of the element to be available. Navigates to the element using a CSS Selector and clicks the element.


I ran into problems with the above step because the bot would hang even after the element appeared. I contacted my friend Navpreet (maintainer of the repo) and asked him why this was happening. He quickly glanced at my code when we were on discord with him (late at night because he lives in India) and he explained I was not waiting for the element to become available. So as I mentioned above. The bot would have to wait for the presence of said element "delete" and then execute the follow up functions. He told me it was hanging because it was throwing an uncaught exception and did not know what to do after the exception was thrown. Interesting stuff to be honest. I would have to remember that for next time I contribute to his repo, or other projects :D

After adding that little function in. All I had to do was close the chat info with the function "close_info()". I tested it one final time and made my PR.

I noticed a small problem with the bot behaving strangely on other functionalities that were implemented previously.

I noticed that some of them were not working how they should have been and mentioned it to Navpreet. He said he is aware of this issue and it was happening because of whatsapp changed their CSS Selectors. Thus making pretty much all the main functions break since the selectors did not exist anymore. He thanked me for noticing it as well and said he will make an issue about this when he has time, or fix it himself. 


To be honest, I will probably help him over the winter break since we are buddies now.

Well. Now that I am done with OSD and all my exams. Which by the way could not have ended on the most perfect date than the 9th of December... because CYBERPUNK 2077 came out. AND let me tell you guys. WOW. what an amazing game it has been so far. I have only played about an hour because I was dead tired yesterday, but I was at a loss for words. 8 years in the making was well worth the wait.

Anyways, 

I would like to thank professor Humphrey one last time this semester for giving my colleagues and I the tools and knowledge to gain tremendous amounts of experience this semester and work on whatever we wanted and found enjoyable. 

THANK YOU!


For the last time this semester...

Till next time, 
XOXO,
Gossip Plamen

Thursday, 3 December 2020

Release 0.4.2 - Progression Tree

 

Hello fellow programmers/ followers.
I sincerely hope this past week has been treating you great, because I sure have gotten stomped to the ground due to various things in my academic career -cough- Game Dev... #ThanksGeorge
I also got shot down hard by someone in my personal life. But that is too personal for the internet.

So anyyyyways.......

This week is a little bit of a continuation of the plans I made for my open source development ventures last week. A little bit of a recap.. Last week I decided to pick a repo that I have contributed to in the past. Seeing as my schedule is super tight until the end of the semester, I decided to go back a month and revisit the automating whatsapp web platform. I picked two issues because one was easier than the other and I had created something similar.

Ok!

So I saw that most people on the issues that have been assigned have made little or no progress. I asked Navpreet (the owner/maintainer of the repo) if I could take this issue. He gave me the green light. Although, to be honest I already had started working on the issue before he said it is fine (I knew it would be fine). 

I was tasked with creating a function similar to one that already existed. I had to create a function to remove Administrative privileges from a person/people in a whatsapp group.

As I began working I first examined the steps I had to manually take to remove admin privileges in order to replicate them and adding them into the automation bot.
Since the main logic is being done by Selector constants I had to find the selectors that were responsible for removing admin status from a person in a group.


I inspected the element with the chrome dev tools and quickly found exactly what I was looking for (this took me a while in Release 0.2, but I knew what to look for now).


P.S. The steps you take to removing an admin all lead to using the same selector regardless.

Now that I had my selector. It was time to actually put it in the constants .py file that is used for everything.
GROUPS__REMOVE_ADMIN = (By.CSS_SELECTOR, '._1OwwW ._3oTCZ[title="Dismiss as admin"]')

After that was done it was time to start writing the actual code.

The first thing I had to do was to iterate through the groups and find group name with the passed in one. This is being done by querying the selector and looking for it to match with whatever element you are on. Once the group chat was open, the bot needed to open the group chat info and navigate to the participants section. From there it searches for the name(s) passed in to remove admin privileges from, this is done by finding if the admin logo is present on their name. Clicks their name box and selects "Dismiss as admin". 

Everything worked. there was a couple of bugs at first. I was not checking if the user of the group was already an admin or not and the bot started hanging because it was trying to find an element to click on that did not exist yet. Another problem I actually ran into was that I had to tweak the CSS selector a bit because it is the same selector for making an admin and removing an admin. This is why in the above snippet I decided to include the title as well so it does not create an admin by accident.

Now, that I was done with this feature I could hurry back to Navpreet and have him run it on his end. I submitted a PR and since Navpreet and I are somewhat acquainted from my previous contributions, he knows my secret love most hated feeling is towards python and everything python related. So he gave me a little praise to help me with the next big issue I was going to do for him.


Everything is going swell. My PR even got merged. ONTO better things... not really. OSD is probably my most enjoyed course right now. Everything else feels like such a drag and there is sooo much work.

Anyways this is where I end things for my ventures of open source this week. I have actually started working on my other issue for Navpreet but it is proving to be a little more difficult than I expected. 0.4 amiright?!

I am now going to crack open a beer and enjoy the rest of my night, and try not to think about stupid little details.


Till next time,
XOXO,
Gossip Plamen

Saturday, 14 November 2020

Release 0.3.2 - Don't Sit Too Close to the VR TV

 


Do you remember when you were young and your mom yelled at you for sitting too close to the TV?!

Well, I do too. It was annoying to say the least. I can't blame her though it was a bad habit that was part of most of my childhood, especially when playing my PS1 and PS2, the good ol' days. 

So why doesn't she yell at me whenever I use my Oculus Quest VR? It probably has something to do with the fact that I am 25 years old now and it looks sort of silly for a grown man to get yelled at by his mommy... 

Anyways...

So, as mentioned in my last blog Release 0.3 has two parts, or rather 2 PRs to be submitted.
I wrote about how I contributed to Telescope in my last blog. That was fun.

However, I needed a new repository to contribute to this week. Since I am a big VR enthusiast as I have said multiple times in previous blogs. I chose to do something related to VR.

I started searching and came out empty on specific things that I wanted to do. I then realized that one of the most used programs that I personally use almost on a daily basis is the ALVR application.

ALVR:
ALVR is an open source remote VR display for Oculus Quest. With it, you can play SteamVR games in your standalone headset.

I went on the github repo and found an interesting issue that I felt would benefit not only me, but a lot of people.
I found an issue to translate the WHOLE application, since my native tongue is Bulgarian I decided to submit a PR for the Bulgarian language.

Eh, a translation PR who cares, that is easy. 
You would think so but... well it was relatively easy but it was a lot of work, especially since my Bulgarian has been degrading over the past 18 years since I came to Canada.

Anyways,
I began to look through the files on what needed to be translated.
Thankfully for me, the structure of the project was really well organized and finding the language support files was not that hard.

The first thing I did was to copy the "default" English files into a new folder with the language code "bg" to use them as the base for my translation files.
I then linked those files with the default ones to change when the user selects a language from the drop down menu.

All that was left was to translate. OH SO MUCH TRANSLATION!

I literally spent over 7 hours alone just for translation of values and text. It was tedious work but my PR got merged after about a day ,and a review from the maintainer, later. I was excited because I had contributed to something used all around the world.

After my PR got merged I immediately sent the latest version to two of my friends (who are also Bulgarian) for them to test the translation. They commended me on a job well done.

 I showed all my relatives because this is one contribution that I was extremely passionate and proud of.

Here is a meme, just for fun (because I had it laying around and wanted to post it).


Welp, that was all from me for 0.3. whoever has a VR headset go checkout ALVR and star it. It needs more recognition.

Now, I am going to bury my head in Amazon and Canada Computers because I am building myself a brand new PC for gaming... writing code O.o

Till next time, 
XOXO,
Gossip Plamen

Release 0.3.1 - The Seneca Hubble Telescope

 


Hello once again today.

I will just get to the point of this blog.
So Professor Humphrey gave us release 0.3, 2 weeks ago (I think), I've sort of lost track of time. This 0.3 release was to contribute to two more repos.

The first being a contribution to the Telescope repo.
Telescope is an open source web server and client application for aggregating and presenting a timeline of Seneca's open source blogs. Telescope makes it easy to see what's happening with open source at Seneca right now.

So the first thing I had to do was to find a Telescope issue that I can actually do...
My JavaScript really sucks major donkey balls. So I looked and looked through the hundreds of issues (at the time) that had been filed and stopped at the perfect one for a front end bug that had re-occurred due to a commit changing the flow of how posts are being handled.

I got down to business and started hunting down the culprit CSS that was responsible for not making the posts on mobile not extend the whole screen width. In all hind sight I probably spent a lot more time than required for something like this because as mentioned above, my JS is horrible. It also doesn't help that I am not a big fan/ have much interest of web technologies.

Anyways,
The problem that was at hand was that because of commit #1174 and soon after #1217 the content was not being displayed properly as maintainers/ alumni want.
As I said I hunted down the culprit and found that the default CSS style was not being overridden. I simply applied the style so that it will be used and everything worked according to plan.

Although, this was not a huge fix. I learned a lot about collaboration on a big project and the multiple checks that have to be conducted before something is merged and eventually deployed. 

My PR actually fixed two issues at the same time, the second being by accident but that is not important O.o

These were the results of my small bug fix.
                      Before:                                                  After:
                                 

Oh and the search page issue (linked above)


I was pretty happy with the changes and how it turned out.

Well that is everything for now.

Till next time, 
XOXO, 
Gossip Plamen

Formatting and Linting my Life

 


Hello my fellow followers (professor).
I hope you are all doing well, despite Toronto being in the red zone. 

So, this week was an interesting one for my open source ventures. Lab 7 was released and we were tasked with implementing a code formatter and linter for our, you guessed it, link checker.

To be honest, I've grown fond of working on this little program because I enjoy building on top of it. It's awesome, it started as a POS horrid bandaged looking program but has since turned into something gorgeous, something like a rose if you will.

Anyways, I will get right into it because I have to finish 2 more blogs for this week and do my Game Dev lab #ThankGeorge. 

The first task was to choose a code formatter that would format code according to some standards. I chose the google-java-format that professor Humphrey suggested.

So this tool was actually pretty easy to use. I read the manual and just ran the jar file with the options on the CLI and it worked like a charm.

Low key,
I kind of don't like the way it formatted some of the files and in some instances it became even harder to read... Google standards are weird.

I actually took the extra challenge and made a git hook that will do this automatically every time on any file you commit. (I had some help from a couple of google searches on how to set this up properly)

So I made a little script that would download the formatter to a temp directory, if you don't already have it. The rest is self explanatory but I will throw the script anyways.

I actually installed this as a plugin for my IDE because... why not.

So the next thing we were tasked with was to pick a linter for our code that would improve our code and spot bugs automatically, professors lectures were actually really neat on this. I won't get into details though.

Once again, I chose to go with the professor's recommendations and chose the SpotBugs linter for java.
This was a big harder to use as the documentation was not that explanatory. As the standalone version I chose to use the GUI to see how it was. It was pretty cool so I recommend using that. It spot a couple of "bugs" in my code but not that many. I would say the major one it found was in my Load Ignore files, java file.
I was not closing the BufferedReader and it told me that (see below)

This is actually the same linter but the plugin version on my IntelliJ IDE. The fix it suggested was to either close the reader manually or encapsulate it in a try and catch block, like so.

You can read the full documentation on the CONTRIBUTING.md on my repo.

The final step was to squash all of my commits and push it to github.

Alright, that is all from me for this week's lab.

Till next time, 
XOXO, 
Gossip Plamen

Saturday, 31 October 2020

Season 1 - Hacktoberfest Recap

 

WHAT A RUSH!

A race against time and other open source devs to qualify for open issues on repositories you are interested in.

What a great past time activity that is also accredited for school. 

Hacktoberfest! What a great idea. Especially in these interesting and difficult times.

It has finally ended. The busiest month I have ever lived through. It was not that bad to be honest. I have gotten through a lot worse (I think). 

Welp, this blog will serve as a recap to the most interesting event I have participated in, Hacktoberfest. The point of Release 0.2 was to contribute to at least 3 different repos and make 4 different PRs. 

What a great experience to gain knowledge in different projects and languages... UGH Python

Without further adu, Season 1 Recap of my Hacktoberfest journey.

Release 0.2.1 - Entry into Open Source

To get into the swing of Open Source contributions, I wanted to start off with something small. The first repository I chose was of a website that I had used on occasion to keep up with VR news when I first bought my Oculus Quest HMD. Unfortunately, I found a more intriguing website that contained more up-to-date information and game release/news. My first PR was to locate a script that was returning a status code 404. This was not that hard, like at all (thanks chrome dev tools). I made an issue on the repo and created a PR that had simply commented out the script returning a 404, which was doing nothing anyways. I think the maintainer does not check his github often since the issue and PR still remain open, Oh well.

Release 0.2.2 - Entering Another (Virtual) Reality

This was by far the most exciting repo I worked on throughout the whole month. I love virtual reality and I am really glad I got to contribute to this repo because the whole idea behind it is very neat. Oculus Quest is a standalone headset and has no connection to your PC. This owner of the project created a link to your HMD and PC through your LAN so that the Quest can communicate with discord and update your "discord presence", or simply put what game you are playing at the moment. I felt really accomplished with this PR because, I was finally doing something I have a passion for. I made a PR to update his JSON file which contained all sorts of applications and games. I even chatted with "MadMagic" on discord and we are now friends and talk regularly.

Release 0.2.3 - Avoiding Boring People with Chat Automation

My third PR was actually two smaller PRs. Why two? Well, because I didn't think it was enough for the fixes I made on the first one. I found this really neat repository that was basically a chat automation bot for the whatsapp web-based platform. The chatbot did everything you could imagine a chatbot doing. The maintainer was looking for a small refactor on his code by including a different style of CSS selectors from calling his constant selector class file. I replaced the selectors the way he wanted and got acquainted a little more with python, my arch nemesis. For the second PR of my third PR I had to basically copy the basic logic of his whatsapp bot, but make slight modifications so that a facebook session is made (click link above for more details).


Release 0.2.4 - More Pythonic Automation

This was yet another contribution towards automation bots. However this was tailored only to scraping elements from the whatsapp web-based platform. The maintainer (Navpreet) wanted me to write a function to scrape and return a phone number of a specific person that the user has an existing chat with. Really neat and as it turns out not that easy. It was interesting seeing how code varies from machine to machine. A problem I encountered was that the code ran fine on my machine and did the intended task, but once Navpreet ran it on his end it gave him an error (see blog for more details).

That was it for the month. Overall the experience was amazing and I will definately participate in next years Hacktoberfest. I really enjoyed getting involved in various projects and most importantly I made friends and (Hopefully) connections by interacting with the project maintainers. There are a lot of people that are like minded and have the same cores and interests as I do, no matter where in the world they are. a big thank you to my professor for picking something so interesting to get us involved. 

Oh and I made my 4 + 1 Hacktoberfest accepted PRs even though 2 of the PRs I made for Release 0.2 were not in hacktoberfest repos.


Now, all that is left is to wait for the PRs to mature and for me to get a sweet T-shirt. 
That was everything that happened during Season 1, stay tuned for Season 2 of my hacktoberfest journey next year around the same time... obviously for hacktoberfest.

Till next time, 
XOXO, 
Gossip Plamen


Release 0.2.4 - More Pythonic Automation

 


Hello again, my fellow programmers.

The end of the month of October is here and a fourth and final PR has to be made in order to fulfil the requirements of my 0.2 Release.

I will keep this post short and sweet (again)... because it is Halloween and I have candy to eat... erhm give out O.o 

So, this week as I mentioned above I had to complete my final PR for Hacktoberfest. I was stumped on what I actually wanted to do and contribute to as I was also pressed for time due to spending time on my ever growing open world concept level for my Game Dev. course. #ThanksGeorge

I searched and searched for something interesting to do with knowledge I already had. I then remembered that the point of each consecutive contribution was to learn something new. I remembered the Selenium/Python automation bot from my previous PR and saw that there was open issues the owner of the repo wanted help with. I picked one where I needed to scrape a phone number from a specific "open" chatroom in whatsapp web.

I got to work and I completely forgot about asking the maintainer to assign me to this problem, which I think is a big NO NO in Open Source Dev. 

So, I thought that since I used selenium in my 0.1 release to scrape a web page for links using Java, it would be similar. 

I mean it was not that different but the way the maintainer does the scraping is weird and I was not familiar with it. He finds/scrapes data by using the CSS selector class. Which I found to be an interesting approach, it is risky because whatsapp can change the layout and selector class and that can cause everything in the bot to break. But, I am not one to judge.

Nevertheless, I started searching how to scrape exactly what I was looking for:


Now, that I had the exact selector for the specific class I put the parent div selector class into the constant file class that Navpreet (owner of the Repo) had previously made.

In order to scrape the telephone of a specific chatroom with a person I had to:
  1. Use his already made function to Open a chat with a specific person
  2. Open the chat info
  3. Scrape the phone number from the person's info
  4. Close the chat room
  5. Return the scraped phone number
I ended up using a lot of already made functions throughout his code to avoid code duplications where it was unnecessary, and finished with something looking very simple and clean.

I tested and everything ran fine on my computer... KEYWORDS: "My Computer"
I made a PR thinking everything would be fine.

Navpreet reviewed the code and merged it. YAY!

He then messaged me on discord a couple of hours later saying that there was a bug scraping the number. This was happening because the element that contained the phone number was not yet loaded but the bot scraped something that did not "exist" yet... I have no idea what could be causing this since everything ran fine on my end.

Eh, whatever, I hopped on a call and we started debugging and we thought to implement a "wait" functionality for the bot to hang and wait for the element to be available in order to be scraped.

It worked!
Navpreet made a PR addition to my PR and everything was fine and dandy. 

He is actually a really cool dude. He lives in India and his English was perfect! I was surprised. We exchanged a couple of stories and laughs after we finished debugging. Needless to say I made a friend all the way across the world. Awesome feeling when you can connect with someone on a personal and intellectual level.

Anyways I am off to go HaNd OuT candy and watch a bunch of scary movies. 

Till next time, 
XOXO, 
Gossip Plamen

Saturday, 24 October 2020

Release 0.2.3 - Avoiding Boring People with Chat Automation

 


Hello my wonderful followers, aka my professor.

These past two weeks have been a nightmare for me (and many of my colleagues). This is due to the overwhelming amount of work that I have to do in my final year of my Computer Science program. #ThanksGeorge... BTW, George is my game development professor.

Anyways...
I will begin this blog by asking a question. Have you spent too much time on social media? Do you have boring/ignorant people that chat with you on a regular basis but you just have no interest in talking to them at this specific time? Yeah, you know who I am talking about. AND, if you don't know/have, you are one of those people.

So this week I decided to break away from the VR scene and continue my studies on my automation skill set. I found this really cool github with all kinds of automation bots that do various kinds of things. I found the most "popular" repo which was on the whatsapp platform. I saw one issue that still had no assignee so I acted quick. When I say quick I mean I commented asking to take on this issue quicker than my girlfriend changing her mind about where she wants to eat (and that's quick).
I got assigned to it probably within the hour.

Anyways, the issue was not hard at all. It was to replace some code with a modified version of an already made CSS selection "library". It really was not rocket science and any python beginner could do it. Now, re-read what I just said....
YEP, Python. 
But, Why Plamen, I thought you couldn't stand python and that the snek and you despised each other.
Yeah, well... I don't know, I really do not have an explanation to it. Maybe I enjoy being punished, maybe I am a masochist. Who knows.
No, the actual reason was that it was using selenium and I have a little experience with selenium from my 0.1 release. I wanted to see what else selenium can do so I forced myself to slowly start learning python.

Moving on.

I began to do exactly what was asked of me and began making the appropriate changes, as follow:
# from 
MAIN_SEARCH_BAR = '._3FRCZ'
EC.presence_of_element_located((By.CSS_SELECTOR, selector))
relement = element.find_element(By.CSS_SELECTOR, selector)

# to 
MAIN_SEARCH_BAR = (By.CSS_SELECTOR, '._3FRCZ')
EC.presence_of_element_located(selector)
relement = element.find_element(selector[0], selector[1])
 and so on...
I made my PR and it got merged the next day.
I thought this was not enough though so I looked through the person's other repos and saw they had began making a similar automation bot for facebook, a dying social media platform.

This issue was a bit more challenging as I had to make the base file for opening a browser with facebook as opposed to whatsapp and retain similar logic to his whatsapp file waobject.py 
I fiddled my thumbs around for a little bit and began examining how his code exactly worked. I soon realized that he did not want me to make any implementations but simply make the base file to open a session with facebook. Kinda lame but gotta give the people what they want I guess.
I finished my implementation and sent him a quick PR. Honestly, I believe that two small fixes/contributions were enough to call a combined 3rd PR for my 0.2.3 release. 
I just hope my professor sees it like that.
Even if they were not I came out with a lot more knowledge of python and selenium than going in. Quite frankly I enjoyed contributing to this person's repo as automation is becoming a more popular and growing idea of the current times. 

Well that was it for this week my friends. Short and sweet (again...)

Till next time, 
XOXO, 
Gossip Plamen

Friday, 23 October 2020

Lab 5 - Changing the Course of Time

Oh Boy oh Boy!
I am back with another week's worth of (meaningful) knowledge.

This week we were tasked with refactoring our code for our never ending assignment, link checker (DeadLinkage) for those of you who have not been keeping up with the Kardashians blog. 

I had to pick and choose at least 3 things I wanted to refactor about my code... TBH, I wanted to throw the whole thing away and never look at it again. SERIOUSLY! Although it worked flawlessly the whole thing was held together by a piece of reused duct tape that had fallen on the carpet.

Anyways, I started thinking about how to refactor this whole gigantic mess that looked like my current room state, into something that was modular and easier to look at, as well as easier to work with and maintain.

I came up with something similar to the suggestions put out from our professor.

  • I decided to get rid of global variables such as the CLI ANSI colors and store them into a completely separate class.

  • Split the main driver of the program into smaller more maintainable components and naturally moved them to other classes/files.

  • Refactored how the parsing of the arguments was being handled in the main driver program and split into components based on whether the user provides a URL or a local html file.

Now that the "hard" part of the lab was done, it was time to do some git...git...git outta here...

First thing I had to do once my final commit had been made into my refactoring branch was to rebase and squash the previous commits into one final commit.
This was done by: "git rebase master -i" which opened an interactive rebase editor where I was to pick which commit I wanted to squash the others into.

That went pretty smooth. I was expecting some sort of conflict to occur, but no. ðŸ’¯

The next step before I merged into master was to make a meaningful commit message because frankly the rebasing commit message was not doing it for me.
This is achieved by: "git commit --amend"

IT IS TIIIIIIIMMEEEE!

Let's merge to master ~sweating profusely~

uhhhhmmmm... WHAT?!? No merge conflicts second week in a row?
Am I doing this right? I mean I will take it and go on about working on designing my game for yet another time consuming course GAM537. #ThanksGeorge

I will leave you guys with that for this week.
Expect more of my greatness O.o in the upcoming weeks.

Till next time, 
XOXO, 
Gossip Plamen

Saturday, 17 October 2020

Release 0.2.2 - Entering Another (Virtual) Reality

 

Hello my fellow gamers.

Today's blog will be a continuation on the festivities of Hacktoberfest.

As I mentioned on my last hacktoberfest blog, I am a big VR enthusiast. I absolutely love escaping reality and jumping into the virtual world where I can be whoever or... erhm... whatever I want to be without any judgements. 

So as you all know I bought an Oculus Quest roughly a year ago and have been dabbling into VR open source lately. There are a lot of cool apps/games that are made specifically for the Oculus Quest.

Anyways,
for my second PR I wanted to contribute to something I recently found and have been using ever since I found it. The discord rich presence application for the Quest. It is basically an app that runs on your computer and updates your discord status based on the packets sent from the quest to your local network. The Quest sends packets based on event driven tasks, so every time you open an application a packet is sent. The PC application picks it up and updates your discord status to whatever the packet was.

The creator of this application mentioned that he is looking for contributions to their games/apps json list. 
I got into contact with him and chatted for quite a bit. He told me how to properly test the updates and how the application itself works (see above).

My chat with him went something like this.



Extremely cool dude.

Awesome, I got the OK from the owner to go ahead and contribute to his repo.

The first thing I did was open up his json file to find that there were already over 100 games/apps that were being picked up by discord... That did not make my job easier.

I opened up a third party store (SideQuest) tailored for Oculus Quest developers and got to searching for games that were not in his list.

I found content that I can update his json file with and got to work.

I added about 20 games to the list. Might not seem a lot but it definitely is for the amount of time I spent searching.

Everything was working as expected I fed the package name, the state and the description for each app.



I then pushed it to my fork on github and opened an issue on his repo. I made a PR and linked it with the issue.
To my satisfaction he merged my PR. I felt so good about contributing to an actual VR project. It was awesome. 

I will contribute something more in the future to this repo as it is very useful for Quest owners.

Well... that was it from me for this week. Stay tuned for my next contribution in the VR scene.


Till next time, 
XOXO, 
Gossip Plamen

Friday, 16 October 2020

Lab 4 - More Python Nightmares

 


Hello my fellow programmers/coders/readers... ah w.e.

Just an update on my academic career, or mainly my open source endeavors.

Now I know I said this in my past blogs, You've been following right??, but I absolutely hate Python. I don't know what it is the Snek is just not compatible with me.

So WHY for the love of god did you choose to work on Python again, you ask? Well, the answer is quite simple because I am a loser work well with my friend @chris. Mainly because I like his coding style (similar to mine) and his bald head

Anyways, this week in my open source dev class we had to pick someone else's previous 0.1 release and implement a rather easy but tricky feature to their program. We had to implement a feature that reads a text file and scans links to be ignored from a file or URL.

Alright, Cool! I've worked on Chris' code before this should be a light summer breeze. Boy little did I know that Chris wanted me to do a lot more than just implement this feature...

My guy basically wanted me to restructure his whole program to look cleaner.
Yeah... good times. But, w.e. I told him I'd do it and I am a man of my word.
He had this gigantic code block that was an eye sore. 

This was the first thing I did. I made different functions that were called and outsourced a lot of the work for each type of link with a specific status code. In a sense it is not more modular (I should probably make my code as neat as his TBH! But... then again who really cares).

Once that was done, it was time to get back to the issue at hand. My initial step was to add a "-i" argument option for ignoring links from the file specified.
Super easy. I wish Java had something similar of how it handles arguments. I had to write the following to the "-i" argument option: "nargs=2, action='append' " nargs allows me to take in multiple arguments with a single option. Neat! Yet again Python proves to be superior than Java.

*Actual representation of me dying on the inside*
The other option I had to handle was "concatenating" the arguments into a single list/array. This is done by the " action='append' " pretty self explanatory.

The actual file checking of the links was not that hard to implement. A basic try and catch.
  • Try to open file
  • if file opens call regex function to search for links that do not start with a "#"
  • return array if it found any links

I actually contacted Chris and asked him how he would like me to handle the removing the links that were to be ignored. He told me he would like to continue using BeautifulSoup

In all honesty, that actually made my life much easier, as I did not have to use a separate function for checking links. I simply modeled the checker around his old function.
That's it. I didn't really have any issues with the implementation, more the cleanup... (Damn it Chris)

The second part of the lab was to Review and Test the the code via Remote. so I did just that
I reviewed the feature that Chris had worked on for me and I was thoroughly impressed.
lol O.o
I did not have any issues or remarks towards his code. I am actually thinking of refactoring all those nasty if conditions to match his style of logic (as mentioned earlier, "cleaner"). 
For real, Great job as per the ujee.

I merged the code and to my favor there was actually no merge issues. 
Sweet! 
I honestly learned more about Python from this lab than about git. It's a neat feature but I would find it easier to make a pull request via github than on bash/cmd. 

Till next time, 
XOXO,
Gossip Plamen

Release 0.4.3 - The End of Something Great

  Hello my wonderful followers! It is here... It is finally here. The end of this nightmarish semester is finally here. I have to say the pa...