Tech with Kevin

Currently with help from FreeFrontend.com

Tech Enthusiast and Problem Solver

Remote vs. Hybrid

Tue Jan 16 2024

Many companies say they are remote when they clearly are not remote companies. Or, even if you require some office staff, maybe to maintain servers or work in a laboratory, you can still have pure remote roles. So I wanted to just clarify what it should mean to be remote, or at least to me.

If the business requires an employee to come to an office location to work, on any sort of recurrent basis, whether it be weekly, monthly, quarterly, etc… that is a hybrid position. A remote position, and therefore a remote company, does not force employees into an office to do work, especially work that can be done from home.

I can draw a comparison between this and dietary preferences. If you are vegan, then you do not consume animal products. If you eat dairy, eggs, meat, or other foods that come from animals, you don’t say, “I’m vegan but I eat cheese.” A word for that already exists, and it is vegetarian. Same goes for hybrid companies that claim to be remote. You cannot correctly say, “This is a remote company, but we mandate employees to come into office once a week.” A word exists for that, and it is hybrid.

New AI Chips

Mon Oct 02 2023

Nvidia has long been the major graphics card manufacturer, with AMD taking a small slice of the pie. And since graphics cards are used to build many AI models, they’ve been partially responsible for driving the AI revolution as well.

Google has their own Tensor Processor Unit chips to power their AI journey, relieving them from Nvidia’s monopolistic grip on the market, but what about OpenAI? It is expected that at Microsoft’s developer conference in November, called Ignite, they may announce their first AI chip. Additionally, OpenAI is considering developing their own AI Chips. This is because Nvidia is sold out until mid 2024, and other chip makers like Graphcore are fighting through challenging times, having to make job cuts to survi… make more money.

Quick September Update

Mon Oct 02 2023

I just wanted to give a quick updated that I changed jobs. I went from the full stack junior software engineer to test engineer I (basically junior level) for Forcepoint, a cyber security company located in Cork, Ireland. It was a difficult decision but having to travel from Cork to Dublin once a week was beginning to ware on me. I won’t get into the politics of it all, I liked the job and the team and will miss them both.

I also mentioned previously that I wanted to build a new langauge as a learning project. I am going down a similar road currently starting my own database. I figured this is actually a great project, especially for a langauge like Rust because it has the potential to touch many different aspects of programming, from dealing with the file system to creating an HTTP server, parallelism / concurrency, compression and encryption, data storage and indexing techniques, etc… really the sky is the limit. Plus, it’ll probably have its own SQL like programming language to query data, so I will also get my own langauge.

I also want to note my feeling about traveling to the office. I’ll probably add it to a blog sometime, but for employees such as myself, who solely sit at a desk and stare at a computer screen, there’s no reason for me to go into an office. Commuting to and from the office adds to the stress of my day. Additionally, it increases the risk of serious injury or even death, getting knocked down by a bus or car also probably driving to an office location for no actual reason. The more people out and on the road, the more dangerous it is for everyone, include people who have to travel because their jobs cannot be performed remotely. Additionally, there’s the cost of emissions on the environment. Even my e-scooter requires unnecessary charge to travel to an unnecessary location to perform the same work I can comfortably do from home. The office environment is also very distracting, people taking calls at their desks in an open-office layout can be heard from every corner of the office. You need a pair of noise cancelling headphones just to work. And contrary to most middle-management arguments, I find communication more difficult as now I have to find a meeting room, unplug my laptop from the monitors, just to have a call unless I want to be inconsiderate and have it at my desk. And all group meetings still have to be over video calls because some team members may be out of the office or even work in a different office location.

Overall, forcing employees into the office seems unintuitive, irresponsible, and counterproductive, and just gives a very controlling energy. If people want to go to the office for a more social workplace, that’s great, and sure they should do that… socialize in person instead of work. However, I firmly believe it should be a choice, not a requirement.

\Box end of rant, thanks.

Terraform and OpenTF

Mon Aug 28 2023

I’m a huge fan of the YouTube channel Fireship, who released an interesting video, “The ruthless forking of Terraform”. Basically, HashiCorp, owners of Terraform and other products, are changing their coding licences for a more profitable vernture. However, there’s a fork of it that is remaining completely opensource called OpenTF. More information is found in the link. We are also encouraged to start their Github repo to give them support. Long live opensource!

Advance Mathematics

Mon Aug 28 2023

Keeping up with programming and learning for the Masters isn’t easy. In fact, it’s quite difficult even doing it part-time. I took the maths exam over the weekend. I studied my tail off, reviewing calculus, integral transformations, convolutions, Fourier series and transform, v\vec{v}ector algebra and calculus, linear and matrix algebra, and some information theory topics such as Shannon and cross entropy.

All of those hours of reviewing note and practice problems… and I think I over studied. I haven’t gotten the grade back yet but I completed the 90 minute long test in just over 30 and spent another 20 minutes reviewing my work. I am prone to small errors, but I think it went pretty well 😎. Now on to learning Data Science!

My Own Language?

Tue Aug 15 2023

Like the description says, I’ve been thinking a bit lately about building my own programming language, not because the world needs another one, but for practice and to better learn the inner workings of programming. My masters program seems more focused on data science and artificial intelligence, which makes sense for being an applied sciences program. However, I do want to also learn the intricacies of computer programming.

I’m not sure where to start, I found a couple of books, one recommended by No Starch Press, and there are online resources such as this blog by Nora Sandler. But I am torn between writing with Rust, which everyone keeps saying is up and coming even though the endless drama you hear about in podcasts, and good old reliable C. I also found information about having to write a virtual machine before writing the compiler to support your language.

I’ll keep posting when I learn more, in between work and studying…

Levels of Programming Languages

Mon Jul 24 2023

I was looking over a book called “The IDA Pro Book” and it mentions a few different levels of languages which I just want to list out.

  • According to this Wikipedia Article, 5th generation programming languages are mostly constraint-based and logic programming langauges. Think of it like having the computer solve problems without a programmer. It was unfortunately a difficult task to create large programs with only constraints around a problem.
  • There were also the 4th generation programming languages that provide an additional layer of abstraction over 3rd gen. programs. And example per Wikipedia is SQL, which I think really sums up the idea. You don’t write programs in SQL, but helpful queries, and all of the logic of diving into a database and extracting information is abstrated away from the user.
  • There are also 3rd generation programming languages, which as Wikipedia puts, are more machine-independent and programmer-friendly languages. However, they are generalized for computing and not highly focused like later generation langauges. This is where I’d tuck most major languages from C to Python, both compiled and interpreted.
  • Before this came the 2nd generation programming languages, which are also the assembly languages. These languages are specific to particular families of processors and environments.
  • And the 1st generation programming languages refers to the bytecode and machine languages. Which this whole thought started from looking into the difference between those two. Bytecode is actually an intermediate step before machine code. And machine code is the final code that the CPU processes.

Upcoming AWS Novice

Wed Jul 19 2023

Today, at work, I successfully deployed an app for monday.com through AWS using the Express.js framework. Of course I had help from a colleague, and some packages, serverless and serverless-http. These packages allow you to deploy an app with Express.js using AWS API Gateway and Lambda function. The benefits of doing it this way is that you only pay for what you use, and the requests made to your app. When launched in a container, the app is always listening meaning it is always running. A lambda function only executes when called, and the API Gateway is what triggers the function.

The downside is learning how to write your code so that it works more like a Lambda function than a REST API.

RESTful vs Web Socket API

Tue Jul 18 2023

There are several types of APIs, and this GeeksForGeeks.org article does a good job at explaining the difference between RESTful APIs and Web Socket APIs.

Representational State Transfer APIs follow the request-response communication model meaning that all communications require all necessary information to complete the request. Besides that overhead, they are easier to design and implement and “stateless”, so requests are independent of each other. They are handy but because they don’t provide real-time communications, they cannot solve every problem.

Web Socket APIs allow for bi-directional, full-duplex communication. Additionally, communications first establish a connection, and then can communicate continuously. This infers a state of being connected. This allows for real-time communication and reduced overhead for messages. On the contrary, they are a bit harder to set up and can be vulnerable to security threats.

Email Like a Boss

Sun Jul 09 2023

Feeling like a genius at the moment as in one afternoon, I signed my website up for the new domain name of sullivansoftware.dev, and also signed up with a new email address with that domain name through Zoho.com. I’m not a DNS records expert, but the Google IT courses I took from Coursera kind of paid off because I was able to easily follow the instructions of creating new DNS records, and understanding what I was doing (for the most part). 😎

CSS Scroll Into View

Sun Jul 02 2023

Getting a component to fade into view via CSS and JavaScript isn’t too complicated once you understand the basics. Here’s a couple of web articles for some help:

Now, in Astro, you need to be mindful of where you place your CSS. If you include it in a component file, Astro automatically treats it as a module, which makes referencing its name practically impossible. I places the CSS in a “./src/styles/global.scss” file.

.fade-in-section {
    opacity: 0;
    position: relative;
    top: 1.25rem;
    transition: top 0.5s ease-in, opacity 0.5s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    top: 0;
}

Now, you can put the class on your components. It might help for a list of components to use the .map() method so Astro will apply them for you with less writing. I places the JavaScript to add the .is-visible class within the Astro component, in a <script> tag.

const elements = document.querySelectorAll('.fade-in-section');

    function fadeInElements() {
        elements.forEach((element) => {
            const rect = element.getBoundingClientRect();
            const isVisible = (rect.top - 15) < window.innerHeight && rect.bottom >= 10;
            if (isVisible) {
                element.classList.add('is-visible');
            } else {
                element.classList.remove('is-visible');
            }
        });
    }

    window.addEventListener('scroll', fadeInElements);
    window.addEventListener('resize', fadeInElements);
    fadeInElements(); // Initial check on page load

This grabs every component with the initial .fade-in-section class and runs the fadeInElements() function when the window is scrolled or resized. Read up the MDN article on getBoundingClientRect(), it’s a handy method. The custom function adds and removes the .is-visible class based on the element’s position on the screen. Personally, I removed the rect.bottom >= 10 because I didn’t want to fade in while scrolling up, but the choice is yours.

Since React uses the virtual DOM, you could probably do something similar using Ref‘s. However, it is a big no-no to alter DOM elements directly in React. Basically, you don’t want to make changes to elements that React isn’t aware of. So, pull the information about the component you need and then make the changes on the component, not the DOM element.

Hope this was helpful, probably will be for future me :)

GPU vs CPU

Wed Jun 28 2023

I accidently clicked on a YouTube video and watched a good chuck of it that tested speeds of CPUs vs. GPUs for certain tasks. That got me a little curious, so I did some digging.

HowStuffWorks.com covers how a screen can have millions of pixels and how a GPU is needed to render complex images. A graphics card typically has a Graphics Processor (GPU) and some Video Memory (VRAM). They perform complex maths and geometry calculations to render graphics. But the information left me wondering about why they perform better with graphics than a CPU.

TechTarget.com has similar information but dives a little into the history before GPUs were all the buzz. They also discuss that GPUs are designed for “data-parallelism”, applying the same instruction to muliple data-itmes. On the other hand, CPUs are designed for task-parallelism, which is like doing different things to different… things. CPUs usually have 4-8 cores, some have 32, and AMD Ryzen Threadripper has 64 cores. A big difference is that some CPUs have multithreading capabilities, typically 2 cores per thread. But a GPU can have 4-10 threads per core. But how many cores does a GPU have?

Right into the belly of the beast, diving into this 2009 Nvidia blog, a GPU can have hundreds of cores that handle thousands of threads simultaneously.

So, they may lack the power to handle large complex tasks, but GPUs make up for it by doing one easier thing very quickly and in parallel thousands of times over. Along with the AI boom, and a quick look on Google, there are other chips like the Neural Processing Unit (NPU), and the Tensor Processing Unit (TPU). According to this bizety.com article, TPUs are more specifically designed for deep learning, whilst NPUs are a generalist for the broader machine learning algorithms. Also, TPUs are made by Google and only avaiable through them via their cloud. NPUs can be developed and used by any company.

Display Maths

Wed Jun 21 2023

Today’s thought is brought to you by phind.com. It’s an AI search engine made for developers. I’m currently going through a maths course for the Master’s degree and trying to write nice notes. But how do you write them in markdown?

I’m hoping this works, but with the \begin{aligned} and \end{aligned} commands, and then the &= with the \\ to create newlines, we get

$$
\begin{aligned}
\int_a^bf(x)dx &=\int_{x_0}^bf(x)dx-\int_{x_0}^{a}f(x)dx\\
&= F(b)-F(a)
\end{aligned}
$$

Which, with any luck looks like this…

abf(x)dx=x0bf(x)dxx0af(x)dx=F(b)F(a)\begin{gather} \int_a^bf(x)dx &=\int_{x_0}^bf(x)dx-\int_{x_0}^{a}f(x)dx\\ &= F(b)-F(a) \end{gather}

Well, it’s not lined up nicely on my website, but lines up nice in the Obsidian markdown editor.

Follow Up on JavaScript Date Format

Tue Jun 20 2023

Without going back and editing the previous thought, there was a small issue. The date format, being US, wasn’t a YYYYMMDD. ISO is a standardized format for expressing dates. Believe it or not, this is a better solution:

let today = (new Date()).toISOString().split('.')[0].replace(/[^\d]/g, '');
console.log(today)

It’ll produce the following. Do note that this is UTC time, part of the standard.

"20230620093429"

Well, it will produce different results based on when you run it 😅.

JavaScript Date Format

Mon Jun 19 2023

I’m currently building the Skills section, using JSON to keep track of all of the skills and making it easy to import the skills into my project. I considered for a second perhaps keeping all of my thoughts in a JSON as well, but before falling asleep last night remembered that sometimes my thoughts have code! I’ll use this thought to demonstrate (hopefully).

An all to common issue with JavaScript is date formatting. JS does not make it as simple as Python. I wanted to create a filename that had the date and time at the end to make unique files. I asked ChatGPT the easiest way to accomplish this, and here’s the response:

let today = new Date();
let year = today.getFullYear().toString();
let month = (today.getMonth() + 1).toString().padStart(2, '0');
let day = today.getDate().toString().padStart(2, '0');
let hours = today.getHours().toString().padStart(2, '0');
let minutes = today.getMinutes().toString().padStart(2, '0');
let seconds = today.getSeconds().toString().padStart(2, '0');

let fileName = `filename${year}${month}${day}${hours}${minutes}${seconds}.csv`;
console.log(fileName);

I then wrote something like “Thanks. Not sure why JavaScript doesn’t have a built-in method for this.” To which ChatGPT replied “The reason there isn’t a built-in function for formatting dates exactly as you described is that date formatting can vary greatly depending on specific requirements and internationalization concerns.” I thought that was really interesting.

Regardless of the reason, ChatGPT also offered me a more concise solution using Regex:

let today = new Date();
let fileName = `filename${today.toLocaleString('en-US', { hour12: false, timeZone: 'UTC' }).replace(/[^\d]/g, '')}.csv`;
console.log(fileName);

I’ll point anyone confused by Regex to W3Schools.com, as they explain that the carrot in the square brackets means to search for things not in the brackets, and replace with an empty string. It’s actually pretty clever.

The Scrum Deviation Presentation

Sat Jun 17 2023

Spent 6 hours working on a Scrum presentation for my Master’s today… still not complete. Nearly there but I only have 15 minutes to give it and let’s just say I have to cut out a lot of work I did earlier to answer all of the questions in time.

Point being, I would have much rather spent 6 hours in my Machine Learning Udemy course.

First Thought

Fri Jun 16 2023

Here’s the first thought for my website. It’s a markdown file. The idea is to quickly create the markdown file if I have a thought and push live, keeping the website (and my GitHub) looking active!

So, you can apparently use Astro collections to do something similar to what these thoughts are, but I don’t think I am going to use that just yet. I’m actually following this YouTube video by Kevin Powell, the “CSS King”, whom also likes Astro.