Sophomore Dev
The Dev You Say

How to Deepfake Grimes’ Voice and Not Get Blocked

May 8th, 2023

Are you tired of singing on your own songs? Do you dream of collaborating with Grimes, but don’t know how to reach out to her? Well, worry not my friend, for Grimes has just released Elf.Tech – an AI voice software that deepfakes her voice for your use!

But before you start making an AI anthem about anything extreme or offensive (and get blocked by the queen herself), let’s take a look at how you can use this new tool wisely and humorously.

First of all, go to Elf.Tech website and download the demo. It comes with a collaboratively remade Richie Hawtin’s Plastikman track “Passage (Out)”. Listen to it and get inspired! Then, access stems to train your own Grimes AI. Play with them until you feel like a musical genius.

Now that you have created something beautiful (or at least decent), it’s time for release. You’re going to split the royalties 50/50 with Grimes herself! So be tasteful in your choice of lyrics and tune. Follow Grimes’ advice and stay away from “Nazi anthems” or “baby murder songs”. Instead, why not make an AI love song about Elon Musk?

Once your song is out there in the world (or at least on SoundCloud), sit back and wait for the royalties to come in. And who knows? Maybe one day you’ll be able to quit your day job and collaborate with Grimes in person.

In conclusion, Elf.Tech is a fun tool for music creators who want to experiment with AI generated vocals. Just remember to play nice and avoid anything too extreme or offensive. After all, nobody wants their dreams crushed by a blocking spree from Grimes herself.

Water, Water Everywhere, But Is There Life? – The Search for Habitable Exoplanets Continues

May 6th, 2023

If you’re like me and are always on the hunt for signs of life in the universe, then the latest discovery by the James Webb Space Telescope (JWST) is sure to get your attention. Scientists have detected water vapor around a distant rocky planet located 26 light-years away. Now before we all start packing our bags for interstellar travel, let’s take a closer look at what this means.

The exoplanet in question is called GJ 486 b and it orbits a red dwarf star in the Virgo constellation. Despite being three times the mass of Earth, it’s less than a third of our planet’s size. This little guy takes less than 1.5 days to orbit its star and is probably tidally locked – meaning it shows the same face to its star perpetually.

Now here’s where things get interesting. Red dwarf stars are the most common type of stars in the cosmos, so statistically speaking, rocky exoplanets are more likely to orbit them. But red dwarfs can be tricky – they emit violent ultraviolet and X-ray radiation when they’re young that could blast away any atmosphere planets too close to them might have.

So, scientists are keen to find out if a rocky planet like GJ 486 b could form an atmosphere and hold onto it long enough for life to take root there. On Earth, this process took about one billion years! Even though GJ 486 b’s parent star is cooler than our sun, water vapor could still concentrate in starspots which would mimic planetary atmospheres.

And here’s another thing – if there is an atmosphere around GJ 486 b, then radiation from its parent star will constantly erode it. That means any atmosphere has to be replenished by steam ejected from volcanic activity within the planet.

This discovery is important because it could lead us to find more habitable exoplanets outside our solar system. It’s also a reminder that the search for life beyond Earth is ongoing and far from over. So, while we may not have found little green men or women just yet, no one can say we’re not trying.

In conclusion, the latest findings by the JWST are exciting and hold promise for future discoveries. We may not have cracked the code on interstellar travel yet, but at least we know where to start looking for potential habitable worlds. And who knows? Maybe one day we’ll get lucky and find a planet with intelligent life – or at least some alien microbes that can do our laundry. A person can dream, right?

My Long Forgotten Site Got 12,434 Comments While I Was Away…All Spam

May 4th, 2023

So, you know how sometimes you forget about things? Like that container of leftovers in the back of your fridge or that sweater you swore was lost forever? Well, apparently the same thing can happen with websites.

I recently logged into my long forgotten site and was shocked to see that it had received a whopping 12,434 comments! I mean, wow! I must have really struck a chord with people. Maybe my writing had gone viral. Maybe I had finally achieved internet fame!

But alas, as I eagerly clicked on the comments section, my dreams were quickly shattered. They were all spam. Every last one of them.

There were comments about Viagra and Cialis (I don’t even know what those are for 😉️), comments about weight loss pills (I prefer pizza), and even some very disturbing comments that I won’t mention here because this is a family-friendly site.

At first, I was upset. How could these dirty rotten spammers do this to me and my derelict website? But then, as I scrolled through the endless pages of spammy comments, I couldn’t help but chuckle at some of them.

One comment simply said “No.” Another said “I like turtles.” And yet another said “The moon landing was faked.” What do any of these have to do with my website? Absolutely nothing.

So, while it may be disappointing to discover that my long lost site didn’t actually achieve internet fame while I was away, at least it provided me with some entertainment thanks to those ridiculous spam comments. And who knows? Maybe someday it will go viral for real (fingers are crossed).

Now I need to purge them from my database … for posterity.

The Top Five

Handling Multiple Requests Concurrently: A Guide to Improving PHP’s Built-in Server Performance

May 3rd, 2023

This is actually the post I originally wanted to make. The reason was simple. I didn’t find a lot of info about the topic, and this is what the official PHP docs have to say:

You can configure the built-in webserver to fork multiple workers in order to test code that requires multiple concurrent requests to the built-in webserver. Set the PHP_CLI_SERVER_WORKERS environment variable to the number of desired workers before starting the server. This is not supported on Windows.

If you have ever used PHP’s built-in server for more than, let’s say testing your site’s code locally you have probably run into concurrency issues. Servers are responsible for handling a vast amount of requests concurrently. In a single-process synchronous mode, requests are dealt with individually and can block the server from executing until they complete. This can lead to delays in processing and reduce overall server performance.

To tackle this issue, PHP 7.4 introduced support for handling multiple requests concurrently. This feature relies on fork() availability and doesn’t work on Windows. The server forks new workers to serve each incoming request in this mode.

Enabling Concurrent Request Handling

You can activate concurrent request handling by setting the PHP_CLI_SERVER_WORKERS environment variable to the number of workers you want:

PHP_CLI_SERVER_WORKERS=8 php -S localhost:8080

Of you can do the same in code. For example using a wrapper script to enabled the number of workers, like so:

putenv("PHP_CLI_SERVER_WORKERS=8");

This command spawns eight concurrent worker processes capable of handling simultaneous requests.

Things to Keep in Mind When Using Multiple Workers

While using multiple workers can significantly improve server performance, there are some things you need to keep in mind when using them:

  1. Memory Usage – Each worker process requires an independent copy of memory, which means that enabling too many workers could lead to high memory usage and slow down your system’s performance.
  2. Database Connection Limitations – If you’re using multiple database connections, make sure that your connection pool supports concurrent access without encountering deadlocks or other synchronization issues.
  3. Shared Resources Management – When working with shared resources such as files or disk space, ensure that multiple workers do not interfere with each other while accessing these resources at the same time.

Concurrent request handling is an excellent way of improving server performance by allowing the server to handle multiple requests simultaneously. However, it’s important to keep some things in mind while using multiple workers, such as memory usage, database connection limitations, and shared resource management.

Handling concurrent requests is still marked as experimental in PHP 8.1; however, it promises better stability and performance enhancements in the future.

Exploring the Benefits of PHP Built-In Web Server

May 2nd, 2023

And Now for a Public Service Announcement

Well, well, well, look who’s back! It’s me, your favorite forgetful former Sophomore Dev Andrew who disappeared off the face of the internet for a couple of years (not really). Remember me? No? Yeah, I don’t blame you. Even I forgot about my blog until recently when I stumbled upon it by accident while trying to find a recipe for vegan lasagna (not really). Oopsie! So here we are, back at it again with the mediocre content and occasional spelling errors. But hey, a lot has changed in the past few years – like seriously, have you seen what’s going on in the world right now? So buckle up and let’s see if I can still string together some coherent sentences and make you laugh (or mostly – cringe) along the way.

Why am I writing about the built-in PHP web server today? Well, because I actually wanted to write about something else entirely, something that could be summed up in two sentences, and that seemed like a bad start to rebooting the site.

PHP is one of the most popular web development languages used in the world today. It provides developers with a robust set of tools to create feature-rich and dynamic web applications. One such tool that PHP offers is its built-in web server – a handy way to test applications and share local files on your network quickly.

We’ll dive deeper into what the PHP built-in web server is, how it works, and why it’s useful for developers.

What is the PHP Built-In Web Server?

The PHP built-in web server is precisely what it sounds like – a lightweight server that comes bundled with PHP installations. It allows developers to serve their web applications locally without requiring external software like Apache or Nginx.

The built-in server supports execution of PHP scripts, catch-all routing, and static files with common MIME types. It provides an integrated solution for testing and development purposes, allowing developers to work efficiently in a familiar environment.

Why Use The Built-In Web Server?

There are several benefits to using the PHP built-in web server:

  1. Simplicity: The built-in web server is easy to set up and requires no additional configuration or installation processes beyond installing PHP itself.
  2. Lightweight: Since it’s designed only for development purposes and not production use, it’s lightweight in nature, making it faster than other servers like Apache or Nginx.
  3. Security: The built-in web server has limited features compared to dedicated servers; this makes it less prone to vulnerabilities and hacking attempts.
  4. Cross-Platform Compatibility: The built-in server runs on all major operating systems; Windows, Mac OS X, Linux/Unix-based systems as well as different versions of PHP (5.x – 8.x).
  5. Integrated Debugging: Developers can take advantage of integrated debugging tools since both the application code and the webserver run on the same machine.

How to Use the PHP Built-In Web Server

Using the built-in web server is straightforward. First, ensure PHP is installed on your computer. Then open a terminal or command prompt and navigate to your project’s root directory. Finally, start the web server with the following command:

php -S localhost:8000

This command will start the built-in webserver at port 8000 of your local machine. Visit http://localhost:8000 in your browser to see your application running.

You can also specify a different port like this:

php -S localhost:8080

The PHP Built-In Web Server is a great tool for developers who want an easy-to-use, lightweight solution for testing and developing their applications locally. It provides all the necessary features required for development purposes without compromising on performance or security. If you’re looking for a convenient way to test your applications without relying on external servers, then give the built-in web server a try today!

Rustic or Hipster Wedding?

August 29th, 2016

How to tell if you have been invited to a hipster wedding is one of those social survival skills that will keep you from looking like an idiot when you show up. This handy info graphic will lead you through the steps to tell if your wedding, or the wedding of a friend is headed to hipsterville. Of course not all rustic weddings are hipster inspired.

hipster wedding infographic

The original infographic is originally from refinery29.com but I couldn’t find the page.

Do You Put the Hip in Ster?

August 28th, 2016

You know you’ve made it mainstream when Wikihow writes about you. But is their diluted tutorial really all it takes to become a Seattle hipster?

Now you can find out exactly what type of Seattle Hipster you are with this handy quiz.

The Lost City of Melbourne

August 28th, 2016

It appears like there is a new lost city. Melbourne.

Though they’re trying to minimise it, the recent relocation of Melbourne Australia to the ocean east of Japan in Microsoft’s flagship mapping application is blamed on someone having flipped a sign in the latitude given for the city’s Wikipedia page.

This statement may or may not be the actual cause of the issue. One thing is certain though, it does produce a question about accuracy on other areas of the map.

As unfortunate as this is it won’t deter me from using the service in the future.

Tiny Fedoras for Hipster Man Buns

August 28th, 2016

Admit it, you thought you had seen everything didn’t you.

The emerging Capitol Hill fashion combo of the man bun hairstyle topped with a micro-fedora successfully unites the best of contemporary styles in hair and hats for young men. This autumn, expect to see the new look showing up in trendier spots all over the Hill.

Maybe my man bun needs some shade?

Pokemon Go! Killer

August 27th, 2016

Alright, you got me. I played Pokemon Go like there was no tomorrow for about a day. I have something like a hundred and twenty pokemon since my last count. But those days are over. I actually broke out the GBA and Saphire just for the prosperity of it.

Now there is a new game on the market, and it comes out of Belgium.

A Belgian primary school headmaster has developed an online game for people to search for books instead of cartoon monsters, attracting tens of thousands of players in weeks. Players post pictures and hints about where they have hidden a book and others go to hunt them down. Once someone has finished reading a book, they “release” it back into the wild.

“While I was arranging my library, I realized I didn’t have enough space for all my books. Having played Pokemon Go with my kids, I had the idea of releasing the books into nature,” Gregoire told Reuters.

Though it was only set up a few weeks ago, more than 40,000 people are already signed up to Gregoire’s Facebook group.

If you need help creating the app you know where to find me.