Last year I was working on a project for a history class and I noticed a recurring, common error in these transcribed articles: there would commonly be an extra space in the middle of words, which occurred, in many cases, three or four times per paragraph. Here's an example from the first paragraph of a pretty notable article, the first article in the release of the famous Pentagon Papers titled Vietnam Archive: Pentagon Study Traces 3 Decades of Growing U. S. Involvement: This error appeared over 300 times in just six transcribed articles I selected. Furthermore, the error likely occurs
Let's say you want to swap the values of two integer variables, a, and b. Simply setting a equal to b and then b equal to a does not work, since a and b would just end up both equaling the initial value of b. So, typically, you'd create another variable - let's call it c - and set that variable to the value of a, and then do something like this. This is very simple, but the extra variable is not actually necessary. Note that some programming languages, for example Python, provide the ability to swap two variables in
Rate limiting is the process of preventing repeated requests to a server in effort to remove spam requests. Typically, a limit is set, such as 200 requests to the server per minute, and any IP address that exceeds that limit will be blocked from making requests for a set period of time. Rate slowing down is the process of slowing down server responses to an IP that has been sending too many requests. For example, the slow down limit could be set to 200 requests per minute, and an extra 2.5 seconds more response time could be added for each
Cronjobs are tasks that can be run periodically, such as every five minutes, or every day at midnight, or even every Friday at noon. Cronjobs have a number of different use cases, and are widely used in many notable codebases. Many hosting servers have existing ways to set up cronjobs, but if you don't have that capability, you may want to go for a different solution. I'll explain how you would go about creating cronjobs in Python, in which a Python function, program, or system command can be run periodically, whether that be every day, every few minutes, or even
Today I'm proud to release my online 2048 AI, Jupiter. Jupiter uses a machine learning method called the Monte Carlo Tree Search (MCTS) algorithm. I've released an article detailing the algorithm and implementation used in Jupiter: Using the Monte Carlo Tree Search (MCTS) Algorithm in an AI to Beat 2048 (and other games). Jupiter (formerly known as Jacob) started as a small AI project in January 2018. I got the idea of using Monte Carlo simulations and search trees as a method to play 2048 from this StackOverflow answer.
I recently worked on an open source project called Jupiter, an online AI to beat the popular online game 2048. In writing this AI, I decided to use a machine learning method called the Monte Carlo Tree Search (MCTS) algorithm. Monte Carlo algorithms like the one used in Jupiter have been used in several notable AIs, including DeepMind's AlphaGo, which famously beat the Go world champion in May 2017. In this article, I'll explain: How and why the Monte Carlo method works; When and where Monte Carlo algorithms can be useful; How I used the Monte Carlo method in an
I recently spent a few hours refactoring some of the backend code on this site at xtrp.io. In changing the backend, I wanted to make sure the refactored code worked the same way as my old code. To do this, I wrote a unit test in Python that sent a request to every URL on my site running the old backend code and the corresponding URL with my local server running the new code, to make sure they worked exactly the same. As with many other sites, xtrp.io has a sitemap at xtrp.io/sitemap/ which lists all of the URLs on
Discord bots can be useful in doing a variety of things like playing music in a voice chat, or sending automated announcements when a Youtuber releases a new video. I'm active on several Discord servers myself and have always wanted to build my own Discord bot. After building, deploying, and using my own bot for over a month now, I've written this article as a starting point in building a basic bot and moving from there. We'll be building a bot that does something pretty simple: solves math equations. Users will be able to send a message on any channel
Custom scrollbars on the web can make a site or design stand out. They can help in portraying key design aspects of a site, whether that be a specific color or a particular style. For example, the scrollbar at Outlook.com's web app portrays a very minimalist style. CSS-Tricks' scrollbar shows their signature orange and pink look. In this post, we'll be building a minimalist custom scrollbar, similar to that on the Outlook.com web app.
Due to lockdown and quarantine in numerous countries, this year's AP tests were moved to an online platform created by College Board, the creator of the AP program and other tests such as the SAT. In most online AP tests this year, students were given 1-2 questions on the exam web app, and were given the option to submit either a photo of their work, a supported text file (ex: .txt, .docx), or copy and paste written text.
I Built Coronavirus Live Monitor - stats, news, and WHO press releases on the virus all in one place
Today, I am proud to release my latest web app and project: Coronavirus (COVID-19) Live Monitor, your hub for news and information on the Coronavirus outbreak. The code can be found on the GitHub repo. Go check it out!
Global variables can cause serious problems and bugs in large-scale projects and web apps. IIFE's solve this problem by wrapping code in an immediately invoked function, so that no global variables are created, but the code still runs without having to be directly called. For smaller sites and scripts, I would personally simply recommend actively trying to use IIFE's whenever possible, and limiting global code. I personally do use global variables in some basic sites for brevity, but it's important to have a clear understanding of what your code's global scope looks like and what sorts of unexpected problems could
I just recently added a fun little feature on my website at xtrp.io: a progress bar when reading blog posts. The bar would show how far users have progressed in reading a post, from 0% at the beginning to when a user finishes reading at 100%. This little feature has become particularly popular among other blogs and Wordpress themes in recent years. For example, the popular tech publication TechCrunch uses a circular scroll progress bar, and many other sites have a similar feature. In fact, if you're reading this on xtrp.io (and you're on desktop), then you may be able to see this feature on the top of your screen!
CSS variables have been around for quite some time now, but are nevertheless extremely useful. The value of a variable can be just about anything, from pixel values to colors to linear-gradients. You can use a variable almost anywhere by wrapping it in a var function.
Today I am proud to release my latest project — a website and the first ever DEV bot (as far as I know), called Daily Developer Jokes. The Daily Developer Jokes bot will post programmer humor and jokes every day at 8:00 AM (EST).
LOLCODE is an esoteric programming language, a type of programming language which is defined by the Esolang Wiki as follows: an esoteric programming language is a computer programming language designed to experiment with weird ideas, to be hard to program in, or as a joke, rather than for practical use.
1. Clip Paths: Clip paths allow you to clip elements into a shape, represented in CSS with the polygon, circle, or ellipse functions. Clip paths are written with the clip-path property for clipping element content, or the background-clip property for clipping element backgrounds.
The developer world is changing quickly. New tech is quickly rendering old languages and frameworks useless, and the hype for new stuff such as WebAssembly, AI, and cryptocurrency is growing quickly. More developers are emerging faster than ever, and this decade could mark the end of an era in programming and the start of a new one.
I have used all three operating systems in my lifetime. When I used Windows it felt too bloated and I missed Bash, my Linux experience was really positive but too many apps didn't support the platform, and so I am sticking with MacOS for now. Every developer's needs are different depending on what they are using their machine for. What OS are you using and why?
The flipping card animation can not only provide functionality and ease of use to any webpage, but can also make your site feel more refined, user-friendly, most importantly, modern and trustable. The animation is a perfect example of bringing real-world movement and functions to the web, improving usability through that.
It seems like almost every other click on the internet ends up in an "Error 404: Page Not Found" page. "Whoops, the page you're looking for does not exist," "Sorry, the requested URL was not found on this server," "Oops, something went wrong. Page not found." Every internet user has seen pages like these.
On October 29, 1959, 50 years ago, Charley Kline, a student at UCLA, sent the first ever message over ARPANET, the predecessor of the Internet. Kline sent the first message to Bill Duval of Stanford University and intended to send the message "login". But the system crashed after he typed the letter "o", and thus the first ever message sent over the Internet was, "lo". Humble beginnings, right?
I will start off by saying that I am a self-taught developer. When I started programming, the internet was the primary place I went to learn. Online tools like W3Schools and Stack Overflow were my go-to sites for quick references and syntax for the various languages and frameworks I was using.
At my school (yes, I am a teenager), there's a school library, which I go to often. One particular day I decided to see if they had any books on web design and development. I've been building websites for a while, but, just for fun, I wanted to see what my school's library had to offer.
Deep Thinking is a book written by Garry Kasparov about chess and machine learning. Kasparov, who is a former chess world champion, is famous not only for his achievements in chess, but for being the first world champion to lose to a computer in May 1997.
First, thank you so much for clicking on this post, much appreciated! I've recently made a pretty big update to my personal website, at xtrp.io which is now at version 4.
Imagine you are building a simple search form, where a user types their search into an input box, and then clicks the search button to search. Here's some sample HTML for the search form
I've been building websites for a few years now, and there are some online tools that I come back to time and time again whenever I start a new project, for fonts, colors, free photos, and more. These tools are invaluable to me when designing websites, so I've compiled a list of them below. I hope you find them as useful as I have over the years.
It's been a while since I've last written on this blog, but I'm back. Since I last wrote, quite a lot has happened. And I'm excited to write about it. First and foremost, I'd like admit something. Something that's been on my mind since I started coding, and since I started putting projects up on [my GitHub](https://github.com/xtrp/) almost 2 years ago.