What is Generic Math Support in C# 11? (with simple examples) What is Generic Math support in C# 11, and how do we take advantage of it? Let's dig in and find out! (part 3 of 3)
How do I overload arithmetic, equality, and comparison operators in C#? What's it mean to overload operators in C#? And what's that have to do with Generic Math in C# 11? Let's find out! (part 2 of 3)
What's a static abstract interface method in C#? What are static abstract members (new in C# 11), what can we do with them, and how are they related to Generic Math? (part 1 of 3)
What's the point of points in scrum? Points aren't hours, but they sorta represent hours. Or do they? 🤔 If you're as perplexed as I used to be, here's a few thoughts about points.
TWIL vol.6 (GitHub, 2FA... and lunar standard time?) This week I learned that GitHub wasn't requiring 2FA yet (but will soon), and the moon may need its own timezones (to the dismay of devs everywhere).
TWIL vol.5 (InstallShield is as fun as Crystal; Cloudflare lives at 1.1.1.1) This week I learned more about InstallShield, a Cloudflare service for families, and that email filters can be too aggressive.
TWIL vol.4 (blocklists and APIs, encoding vs encryption, and does AI have an uncanny valley?) This week I learned about malicious site blocklists and some APIs that might be interesting to dig into, read up on encoding vs encryption, and pondered whether AI could dip into the uncanny valley.
TWIL vol.3 (.NET Framework limitations, VS2022 and legacy apps, and the default keyword) New year, new discoveries... WinForms can be upgraded to .NET; default vs null in C#; VS 2022 won't show the Form designer in legacy apps
Why doesn't VS 2022 show my WinForms UI at design time? Someone at work asked about whether we'd be able to use VS 2022 to work on our main WinForms app. It works just fine in VS 2019, so it should work in VS 2022, right? Except it doesn't. What we get is white screens of brokenness whenever we try to open a Form in the designer. But why?
Using Tuples and deconstruction to return multiple values in C# A big challenge with any language is trying to group and organize things sensibly, and returning multiple values is no exception. Let's check out Tuples and deconstruction, and see how they can help us out.
Why do I need to install an extension just to copy/paste? I was creating a document in Office365 the other day - something I've done a hundred times - but when I tried to paste with their custom right-click menu I was greeted with a popup telling me to download a browser addon. Well, that's weird.
TWIL vol.2 (MV3 delayed, HTTP Codes resource, Mars Insight EOL) A few things I learned this week.. Google delayed MV3 again; there's a great diagram showing all the HTTP response codes and when to use them; the Insight rover is now retired, but the data is available online
TWIL vol.1 (.NET 7, abstraction, ChatGPT meet SO) This week... what's new in .NET 7 / C# 11, abstraction is good, and ChatGPT hits StackOverflow.
Turning a BackgroundWorker into a Task with TaskCompletionSource Sometimes the safer way to "update" old code is to leave it be and paint over it with a newer construct. Let's see how to modernize a BackgroundWorker using Tasks and TaskCompletionSource.
My experience migrating to MV3 I migrated my addons to MV3, and learned that version numbers increase, DRY is overrated, and 3 and 15 are probably important but I have no idea why. What I didn't learn is how MV3 made my addon better.
Named arguments in C# - pass what you want and forget the rest Named arguments in C#.. they've been around a long time, but does anyone use them? Let's check out another feature that helps tame wild code.
Local functions in C# (aka nested methods) C# 7 introduced a new tool for the belt - local functions. Let's take a look at what they are, how to use them, and why we might not want to.
Checking for null in C#, using the null-conditional and null-coalescing operators Checking for nulls in C# is tedious, but C# 6 gave us the null-conditional and null-coalescing operators. Let's see how they've improved things.
Using string interpolation to craft readable strings in C# The longer I write software, the more I come to appreciate clear code. String interpolation in C# is just one more way to help us do that.
6 space-related APIs to check out ahead of the Artemis I launch The week of NASA launching Artemis I is a good time to check a few of the many APIs that make tons of raw space data accessible for anyone to use.
Time and mental energy are limited resources - use them wisely Learning, creating, and improving are all constants in software development. There's no reason to ever be bored in this field! But we do need to be careful about what commands our time and energy, because those are limited resources.
Displaying an IIS hosted site in CEFSharp Thanks to CEFSharp, we can finally bring WinForms to the web! That didn't sound right. Okay, let's just look at hosting a site in IIS and showing it.
Enjoying the wins, accepting the losses When our code isn't clicking, negativity can quickly overshadow all the positive. That's when we need to remember our victories!
ESI: Building Apps with Azure DevOps - Manage Dependencies Continuing with Microsoft's ESI lessons, I learned about Azure Artifacts and the benefits of package managers. They're good. Use them. ;)
ESI: Building Apps with Azure DevOps - Running Tests Forging ahead with Microsoft's ESI, this week I learned about automated test runs, code coverage, and all the places DevOps displays test results.
ESI: Building Apps with Azure DevOps - Implement a Workflow Continuing with Microsoft's ESI, I spent some time this week learning about workflows, reusable elements, and protecting and monitoring the code.
Hosting a simple webpage in WinForms with CEFSharp WinForms and the web. Like oil and water, they don't mix well. But with CEFSharp, they mix a LOT better. Let's check it out.
ESI: An Intro to Azure DevOps For the next few weeks, I'd like to write a few blog posts as I go through the Enterprise Skills Initiative, a Microsoft website that seems to consist mostly of courses on learning Azure, with a little bit of GitHub and VSCode thrown in too. I got an email from
What is Manifest V3 and why is Google pestering devs about it? If you've ever dug into the underpinnings of a browser extension, or maybe even created one yourself, you've seen the manifest.json file that acts as a sort of usage guide for an extension. Not the kind of usage guide most people would want to read, but it's vital for
What's taking so long? (a question every dev gets.. and even asks themselves) Ever solved a problem, just to beat yourself up on how long it took? Me too. Maybe we need to spend more time making the invisible.. visible.
Beware the bite of the refactor bug Refactoring code is part of the dev life, and can even help keep the code healthy, but going too far can do more harm than good. Ever after a decade of writing code, I still have to remind myself from time to time!
Mocking MessageBox (or any static class) in WinForms Unit testing a WinForms app is an uphill battle in the best of times, before you add in classes like MessageBox. Let's make the best of it.
Using nameof to avoid magic strings There's a lot of ways to make our code work for us. Let's check out using the nameof operator to avoid magic strings.
Why am I getting a "Please complete the security check" error? I visited a page the other day and saw something odd.. a page that said it was checking my browser. It's unpolished and unfriendly, and my first instinct was to just close the tab and forget it. Then I dropped to the bottom of the page and noticed the link to Cloudflare. Interesting.
Sunk costs, timeboxing, and asking for help One of the biggest struggles I have with programming is knowing when to ask for help. A little struggle is necessary for growth, but when am I just wasting time when I could be learning from others?
A more helpful exception box for WinForms apps If you're in a legacy codebase with a centralized "message box" form, why not add some features that make it work for you? 😏
Every software dev is a contractor Seeing my full-time job as a long-term contract has helped me improve and contribute, without taking things personally or falling into complacency.
How to log errors in WinForms using NLog Logs are a great tool for squashing bugs and tracing errors. Let's see how to add NLog to our project.
How do I move a subdirectory into its own git repository, with history? Need to pull a subdirectory out of repo A and create a new repo B out with it? Including full history and branches? Okay, here's how.
Can I write my own HTML tags? Can you create your own HTML tags? The answer is..... sorta. Yes and no. Not completely, but a little. Typical, I know.
Avoiding tribal knowledge in the programming world When I was less skilled as a developer, it was enough to just stay afloat, learning what I needed for the current day or project. As my skill and confidence grows, I've come to appreciate the extra things in life - like a decent set of docs.
Using MVP to test a WinForms app If you find yourself supporting a WinForms application, you're likely to notice the tests... or lack thereof. Just because we may not have been so focused on automated tests and continuous integration when WinForms was younger, that doesn't mean we can't introduce them now. Better late than never!
Using Async, Await, and Task to keep the WinForms UI responsive For most of my dev career, I've been in C# shops. That doesn't mean every project required C# exclusively, but most of them did. I've also used React, Ruby, C++, Erlang.. whatever's called for. But large company or small, if you're a C# dev, sooner or later you'll likely find
10 great resources for learning more LINQ LINQ is a great addition to any C# dev's toolbelt. Used to query and manipulate data, similar to SQL, it leads to cleaner, more maintainable code.
What is DotNet Try? Do you prefer reading or doing? How about both? DotNet Try pulls in C# code from your project and turns your docs into an interactive experience.
Be ready to explain your code Does the mere thought of explaining your code cause anxiety? Be confident! We should all understand what we're writing and why. It's an opportunity (for everyone) to learn!
Scratch that itch for coding! Learning a little about programming could benefit anyone. If you want a fun intro to coding and logical thinking, check out Scratch!
3 inspiring apps from the DigitalOcean App Platform Hackathon A few of my favorite submissions from DigitalOcean's App Platform hackathon, that hold real promise for bringing people together!
Sonic Pi is music to the ears Some programmers think their code is music to the ears - with Sonic Pi it is! A tool for creating music, it serves as a fun intro to development too.
What is mocking a dependency? When you're writing tests, you generally don't want to write to the database, email customers, and hit third-party API's. That's why we need to know how to mock dependencies!
What's a code review? Does the idea of submitting to a code review make you sweat bullets? Or do you brush it off as a necessary evil? It should be a (hopefully positive) conversation, wherein the team agrees to the code they're all going to have to help maintain, and maybe learns something new too.
The transient nature of code I just deleted my coworkers code. 😱 It was good code that wasn't needed anymore, and he understood why. The nature of coding is that it's a progression, and any individual code is transient by nature. Today's code is subject to tomorrow's refactoring.
Does rethrowing an exception in C# still reset the stack trace? All programming languages have gotchas to trip you up. In C#, one of them is the subtle (but significant) difference between "throw" and "throw ex".
How will I know when I'm a programmer? How do you know when you've finally arrived, and are officially a programmer? Is it a set of skills, a certain amount of time? Can you ever really arrive, when it's a race of one with no finish line?
A 30th anniversary Zelda tribute, in Node.js A few years ago, on the 30th anniversary of the Legend of Zelda, Scott Lininger and Mike Magee open sourced a 3D version of the original LoZ. The site was taken down, but the code's still available to run!
How can I make a word cloud? You've most likely seen word clouds, like in the sidebars of blogs, but let's check out an example of writing our own.
Where should I store application data in Windows? Windows sets certain locations aside for apps, and makes them easily discoverable for devs to use. Let's see how.
What is the Law of Demeter? At work, we're running through The Pragmatic Programmer - the original, not the 2nd edition published last year. If anyone is reading that, I'd love to know if it really updates things for modern programming and whether it seems necessary. The original seems pretty timeless. Yesterday was my turn to
Just a dash o pepper with my repo, thanks I found an unusual account while querying GitHub for users, aaand... having nowhere else to go right now, I decided to investigate it.
13 addons to power up your GitHub game GitHub is an amazing set of tools around Git, but it's lacking in certain areas. Where it fails to impress, browser addons often pick up the slack. Here's 13 addons (plus a few honorable mentions) that will take your GitHub experience to the next level!
How to find the iCal address for a public Google calendar Every Google calendar URL has an iCal file you can use... here's how to find it.
How to make a dark mode with CSS Every time I learn some new piece of CSS I'm amazed at how flexible and powerful it is. Like how easy it is to tailor your site for your visitor's "dark mode" preference!
How to deploy your own RequestBin in under 5 minutes If you need to consume a webhook from another service, or verify the payload being sent from your own REST API endpoint, RequestBin can help. It intercepts and displays the contents of any call made to it. Here's how to deploy your own instance in just a few minutes.
Why are websites requesting access to motion sensors... on my desktop? I was checking the status of a FedEx order when Brave warned me that "this site has been blocked from accessing your motion sensors". I'm struggling to understand why a website would need that access. Do I get a different experience if I drop my device? Tip my monitor over? Spin the mouse around?
3 Ansible playbooks, 2 DO droplets, and a website... in a pear tree 🎄 Running through another of Erika's Ansible posts with example playbooks, creating a few pointless ones of my own, and discovering just how easy it is to deploy a website running on Apache!
Hands-on Ansible, using two DigitalOcean Ubuntu droplets Today I'm wrapping my head around a build tool called Ansible, used for deploying machines in a scriptable, repeatable manner. Follow along as I step through an excellent tutorial from DigitalOcean, applying what I learn to a couple DO Ubuntu VMs... the $5/mo ones - nothing fancy needed!
Replacing Gmail (and its office suite) with Mailbox.org Google provides some amazing tools, but at what cost to privacy? One of the biggest blockers in eliminating them has been finding a reliable and affordable replacement for email (and ideally, calendar, documents, tasks, etc too). Well I may have finally found it, in Mailbox.org.
How do I add seconds, minutes, or hours to a DateTime structure in Erlang? Ruby gives you 12 ways to do anything. Erlang makes it tough to find one. Awhile back, I was trying to add time to an existing DateTime value, but I couldn't find a function (such as in the Calendar module) that allowed me to manipulate a DateTime value directly. Here's how I ended up doing it.
Docker - Peeling back the layers A few weeks ago, I took my first real look at Docker, and learned just enough to write a bad analogy. Now I'm taking a closer look at the anatomy of a docker image, which I've always heard consists of layers, but I've never quite understood what that meant. Time to find out!
Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement This error might look a little cryptic at first glance, but it's fairly descriptive in explaining what's wrong. You're likely to come across this one before your first cup of coffee.
How do I assign C# code to a variable? Did you know most languages have a way to pass around code to other functions, so you can call (invoke) it in other parts of your application? In C#, it's called a delegate.
How can I find the state of NumLock, CapsLock or ScrollLock in WPF? If you're writing a WPF application and need to find the state of the Num Lock, Caps Lock, or Scroll Lock keys, you're in luck - there's a method for that.
What is the opposite method of Any in LINQ? One of the many nice functions in LINQ is a single word that iterates through a collection, returning true if at least one item in the collection matches the condition you specify. But what's the opposite of the Any keyword in LINQ?
Jumpin' on the Docker train (better late than never...) I've had no reason to learn Docker so far, but it's been around for years, I've heard others talk about it, and now I feel like I should already know it. Well, we're using it where I work to varying degrees and I think I may be delving into some of it soon, so...... time to get the basics.
How to enable logging for an AWS Lambda job When you create a new AWS Lambda job, logging is (inexplicably, to my thinking) not configured by default. I'm sure there's reasons for it, but considering this is a service where jobs run headless, it seems pretty important to be able to jump in and quickly see exactly why a job is failing.
What's the GitHub Package Registry? Most of us host something (and some of us everything) on GitHub, especially since they host private repos for free too now. I've been eager to try the GitHub Package Registry since they announced it last May. Well, I just got access to the beta, so let's see what we can do!
What's a package manager? If you've heard the term package manager, especially with GitHub announcing their own, you might be wondering what exactly it is. Well, it's a way to find, reuse, and share code, among other things.
Using the GraphiQL IDE to access a GraphQL API One of the tools bundled with GraphQL is GraphiQL, which lets users query your API in the browser and see results immediately. This is a huge time-saver! Let's take a look at how GitHub uses it for their GraphQL API.
What is GraphQL and how does it differ from REST? As much as we'd like to think there's one "best" way to do things, GraphQL is an alternative for REST, not a replacement. And while there's quite a few differences between them, the major difference is that GraphQL lets you build a query to get exactly (and only) the data you're interested in.
How to generate and verify TOTP 2FA codes (in C#) A few days ago I wrote about how to create a TOTP 2FA code for your app, and I mentioned at the end of it that I'd like to work out an implementation in C#. Here it is... grab the WPF app from GitHub.
How to create a TOTP 2FA code for your app I've been using 2FA on every site that supports it for quite some time, but I've never given much thought to how a 2FA code is created. I enable it, scan the QR code, and print the backup codes. The rest is magic. 🧙♂️ But no more! Today is the day we figure out how to generate a 2FA code...
What is minification vs obfuscation? Mozilla announced they'll no longer accept extensions with obfuscated code. It's good news for users, maybe not so much for developers. Obfuscated code is (intentionally) nearly impossible to understand, and could easily be malicious. Let's unpack and break down a few concepts.
CodeFactor, Uploading Images via REST, and the Ghost Admin API v2.0 I finally wrapped up (for now) a little side project of mine, a C# wrapper around v2.0 of the Ghost RESTful API. I call it GhostSharp, and it's available on GitHub and NuGet. It covers the entire Content API as well as the 4 stable endpoints of the Admin API.
Protecting your GitHub account and keeping your code secure GitHub, GitLab, and Bitbucket just released a joint statement on a widespread ransomware attack that resulted in compromised accounts. That got me thinking, what can a person do to protect his or her code on GitHub? As it turns out, a lot...
How to modify a config file in Erlang I was tasked this week with writing an escript to modify an Erlang config file. All I needed was to read it in, make a couple updates, and write it back out. Should be easy, right? Please make it easy Erlang. No? Of course not... this is Erlang after all.
Running Windows XP in VirtualBox Just got an MSDN account, which always comes with some old treasures (hey, beauty's in the eye of the beholder). Take a trip back with me, to the days of Windows XP, the beginning of the .NET Framework, and even further... ;)
Using an application config file with a .NET Standard app and NUnit 3 Porting .NET Framework code to .NET Standard has been a learning experience, with some challenges too. This time I had a .NET Standard library that expected an application config file, but loading one from an NUnit test suite proved to be more difficult than it sounded at first.
8 Tools Every Developer Should Know and Use You learn a lot doing a decade of anything... techniques, approaches, tools. If someone asked you what the top 10 tools were in your field, what would you tell them? Here's my top 10 list for software development.
How to include a DateTime format as a constant inside string interpolation I was upgrading some code to use string interpolation, a feature introduced in C# 6, when I ran into a small snag with DateTimes and a format string stored as a constant.
5 Practical Examples of C# Attributes (and why you'll want to use them) Ever thought it'd be convenient to attach metadata to your code at design time, then read it at runtime? Attributes let you do just that - to methods, classes, tests, enumerations, and more. Use reflection to read them at runtime and take some action. Here's a few examples for the uninitiated...
How do I open the browser dev console? Most people will never even know their browser hides a great set of tools, mostly used by web developers, but which can be useful for anyone trying to figure out why their browser is misbehaving.
Keep your EUnit teardown logic as simple as possible! I ran into an issue where an EUnit test fixture was failing with an error I hadn't seen before. It seemed to be coming from the meck mocking suite itself, and was reporting that it was 'already_started' and the tests would fail to run... that's a new one. So the obvious question was, WTF@#$ WHY????
I've lost access to my Mozilla Addons account... now what? I recently realized that somehow, in the 6 months since I last logged into my Mozilla developer account, none of my short list of emails would let me back in. Here's how I regained access.
Searching historical newspapers with the Chronicling America API I've got a few old newspapers from the 1930s and 1940s, and find them fascinating. And so I was excited to stumble on the Library of Congress's Chronicling America API, which 'provides access to information about historic newspapers and select digitized newspaper pages'. Let's check it out.
Using the IP Geolocation API to find info about an IP address Last year I caught an article about a simple, free service called ipify that returns your IP address. It became so popular the author soon found himself dealing with billions of requests per month! Here's a look at that API and the IP Geolocation API that it spawned.
Great web comics for devs Need a comic break? Here's some web comics I've stumbled upon over the years - the funny, sarcastic, informative, and just plain weird.
Common Dialyzer Errors and Solutions in Erlang When dealing with a dynamically typed language, any effort to tame the beast can pay off. For Erlang, that means Dialyzer specs. The more specs added, the more helpful the tool becomes - but getting to that point can be painful. Here are some warnings I've seen, what they mean and how I solved them.
5 Markdown Tricks for GitHub Here's a few tricks for rendering markdown in GitHub that most people wouldn't know about. Oh, and they work for new Issues, Pull Requests, and in the Wiki too!
Hosting a GitHub wiki on Ubuntu (and keeping it in sync) I've always been a fan of wikis, but GitHub's is so poorly designed it doesn't get much love. I once wrote about cloning a wiki locally and editing it using Gollum, but now I'm taking a look at hosting it externally on DigitalOcean, using Gollum and keeping it in sync with the repo hosted on GitHub.
Querying Amazon's product details with the Amazon Product Advertising API This API is allows you to query the Amazon catalog, either with keywords or by targeting specific products, and extract details about those products in order to promote (advertise) them. I'm hoping that the question/answer area is one of those details that can be extracted, but we'll see.
A few thoughts on date/time handling in Erlang Handling date and times is a thorn in every experienced developer's side. If you haven't had the pleasure yet, you will. ;) Coming off a week of standardizing some datetimes across an Erlang app, here's a few personal thoughts.
How to select an earlier .NET version on Visual Studio for Mac (tl;dr: you can't) Despite its marketing, Visual Studio for Mac is not the Visual Studio that millions love, ported to the Mac. Something that's absolutely trivial in standard VS, switching between .NET Frameworks, wasted several of my evenings. Maybe it'll help someone else.
How do I convert my code from C# to VB.NET (or from VB.NET to C#)? If you work with the .NET Framework long enough, you may eventually find yourself tasked with converting one language to another, either by request or necessity. But conversion isn't always necessary - it's possible (and easy!) to have one solution with multiple languages.
How to calculate Easter (and other holidays) in Erlang On a whim, I created an Erlang module for calculating various holidays, and things were going well until it came to Easter. Have you ever tried to calculate Easter? It's surprisingly difficult! Here's my solution...
Access yesterday's Internet with the Wayback Machine API The Wayback Machine, a product of the Internet Archive, is an ambitious tool that's been documenting websites for many years. It's useful when a page you need is removed by the original author. Let's take a look at their API and how we might make use of it.
A look at the many ways APIs can authorize access After writing about so many APIs and having to figure out the auth process for each, I wanted to compare and contrast how some of these services approach authentication and authorization, and why they might've decided to do it the way they did.
Writing a random selection algorithm that factors in age (weighted selection) Have you ever had a collection of items and needed to select a random one from the lot? What if you have a class with some property (i.e. 'age' or 'weight') that you want to take into account when doing the random selection? Let's see how we might approach that...
Getting rid of unused function errors when using timers in Erlang Have you ever tried to execute a function at some future time in Erlang? You can, with a timer, but the compiler may complain that the function you're calling via the timer is unused. Why is that and what can you do?
Using AWS Lambda to tweet random blog posts from an RSS feed If you've got a Twitter account, and a blog with a lot of content, sharing your posts can be a nice way to help someone out, and drive a little extra traffic to your site. If your site generates an RSS feed, here's how you can automate the process - for free!
Using AWS Lambda to tweet random posts from a Ghost blog If you've got a Twitter account, and a blog with a lot of content, sharing your posts can be a nice way to help someone out, and drive a little extra traffic to your site. Here's how you can automate the process on your Ghost blog - for free!
My first experience with AWS Lambda I've been wondering if I can tame Twitter a bit by cleaning up my timeline. Using AWS Lambda and the Ephemeral Go package, I think I've found a good start.
Are property accessors possible in Erlang records? I ran into a problem in Erlang yesterday that made me think: Is there anyway to implement a property accessor on a record?
Creating your own secure, personal wiki using DigitalOcean and DokuWiki I've been thinking for awhile now that I wanted to setup a wiki. I wanted something light-weight, with support for uploading images and files. And I wanted to retain control over the data and configuration, as well as encrypt access to it. Here's how to install DokuWiki on Ubuntu with DigitalOcean.
314 (or so) Awesome Raspberry Pi Resources on Pi Day I combed through my bookmarks, scoured links from old posts, and finally just started looking... everywhere. I discovered a lot of new people to follow, new material to read, and new projects to try out. I'll have no shortage of things to do and try out on the Pi now, and neither will you!
Automatically adding links next to all headers on the page (a Chrome extension) Ever needed to link directly to one section of a webpage? You can, as long as there's a header (or another element nearby like a div) with an ID assigned to it. Getting the ID isn't tough, but it's a bit of a pain. It doesn't have to be that hard.
Managing your posts, tags, and users with the Ghost Blog API The Ghost API provides access to your blog's posts, tags, and users. You can get items, as well as create them. Before accessing anything though, you'll need several pieces of data, depending on your blog settings and whether you're trying to get data or create it. Let's see what we can do with it.
Generating random passwords, numbers and GUIDs with the PasswordRandom API The PasswordRandom API provides random values - and not just passwords as the name would seem to suggest. It also generates GUIDs, random numbers, characters, etc.
Creating a Table of Contents for your blog A table of contents is nice to have, and convenient for your visitors, so I wrote a script that should work for any blog (with some minor adjustments). Here it is, along with some specific notes for using it in a Ghost blog.
How many parameters should a function have? Someone gets a request, and finds the function that could complete it - just need to pass one more parameter. This happens a few more times. Eventually you have something no one wants to touch. They just throw more code at it and RUN, hoping to get out before they get too messy. 💩What do you do?
Managing your books and shelves with the Google Books API The Google Books API provides access to Google Books, which lets you search for any book and, at a bare minimium, see meta data about it. Depending on copyright status, you might also be able to see sample pages or read the entire book. You can also buy books.
What is an API wrapper and how do I write one? When you find an API to use in your app, you'll need to access it in a specific language - not always an easy or straightforward task. As long as you're doing all that work, why keep it to yourself? Let's look at creating an API wrapper that you can share with others!
Accessing weather and climate data with the Planet OS API Planet OS seems to have found a great number of services that provide scientific/weather/earth related data, regularly download a small sample set from each, and provide a way to access the data through their own API. Let's see what they've got and what we can do with it!
How to make all images in a Ghost post auto-link to themselves (to view at full resolution) When you insert an image into a post using the Ghost platform, it might be resized (depending on the theme you're using) to a significantly smaller size than its actual dimensions. Viewing the full version means either your visitor has to open the image in a new tab, or you
How can I test what a REST endpoint is posting? UPDATE 2: In February 2019, I got an email about a new public RequestBin site, created by PipeDream. As of Jan 2020 it's still up, so that's good. In general, if the data is remotely sensitive, I'd be wary of sending requests to an endpoint I didn't control - consider
Accessing game data with the Internet Game Database (IGDB) API The Internet Game Database is a community-driven site that collects and shares information about games and game-related data. Let's check out the IGDB API!
Accessing book and author data with the Penguin Random House API Penguin Random House is a book publisher, and their API can be used to get data about books, authors and events. Let's check it out!
Accessing census, demographic, and housing data with the US Census Bureau API The US Census Bureau APIs provide free access to geolocation data, as well as American census data, demographics, housing stats, etc. Let's check them out!
Accessing current and historical weather data with the OpenWeatherMap API OpenWeatherMap provides free access to extensive weather data - current conditions, 5-day forecast, uv index, weather alerts, etc. Let's check out their API!
Discover where the ISS is, where it will be, and who's on it with the ISS Notify API The ISS Notify API (or is it the Open Notify API?) was written by Nathan Bergey for a Science Hack Day competition, then released to the public. You can use it to find the location of the ISS, or to find when it'll pass over a location! Check it out.
Manage boards and cards with the Trello API Trello is a virtual kanban board... or a nice to-do list if you're going solo. I like it, maybe you will too, and their API makes nearly all areas accessible to devs.
Access space-related media with the HubbleSite API The Space Telescope Science Institute works closely with the Hubble telescope and its operation. They've made available, through their HubbleSite API, tons of photos, videos, and other data.
Accessing photos of the Mars Rover, space, landsat images, and more with the NASA API NASA's API makes their data (such as Mars rover photos) available to anyone who wants to consume it. It's an unprecedented wealth of knowledge, so let's dig in!
Access climate data and station info with the NOAA API The NOAA API lets us query weather and climate data from NOAA, an agency that studies and charts conditions in the oceans and atmosphere. Let's check it out!
Accessing directions, coordinates and more with the Google Maps API The Google Maps API is a series of APIs for multiple platforms, each focused on a small set of tasks. At first it all seems a bit overwhelming, but each of them is pretty easy to use. Let's check a few out!
Managing your workspace, channels, and messages with the Slack API Slack is a popular communication and collaboration tool, and their API gives us access to channels, messages, and more. Let's check it out!
Managing files and folders in a Dropbox account using the Dropbox API Dropbox provides file storage that syncs between your devices, and their API gives you access to that. Let's check it out!
Access and manage your buckets and files on Backblaze with the B2 Cloud Storage API The Backblaze B2 Storage API, built on top of Backblaze's cloud storage, lets you access and manage your buckets. Let's check it out!
Access your photos and other data with the Instagram API The Instagram API gets data about media, but also manipulate likes, comments and much more. Let's check it out!
Accessing tweets, friends, lists, and more with the Twitter API The Twitter API lets you access tweets, users who tweet, metadata, manipulate lists, and more. Let's check it out!
5 Ways to Tame the Erlang Beast Becoming an Erlang developer has not always been easy, but over the last couple of years I've learned a few ways to tame the beast. It doesn't need to become any other language, but there's definitely room for improving the developer experience!
An Erlang snippet for easily concatenating binaries and strings There have been a number of times when using Erlang that I've found myself concatenating a list of binaries and strings. I usually resort to manual conversions one way or the other... and I think you'll agree they're both pretty ugly. Here's a short snippet to make it easier!
It's just a tiny refactor. What's the worst that could happen? Ever gone on a refactor binge? Ever had it bite you? Check out these code "fixes" in 5 different languages - can you figure out what each fix breaks?
Making Your First Chrome Extension We all have our favorite web browser with our favorite extensions loaded, but have you ever considered writing your own? In the past few months I've created a couple extensions to suit my own needs. Here's what I've learned!
What is the cloud? For the last couple years, a sad little cloud has been making its way through the Internet, spreading its message of cold hard reality. It mocks those who would say "The Clouuuud" with the same child-like sense of awe and wonder as those little aliens from Toy Story. "The Cloud"
How to build on top of the Casper theme in Ghost This blog runs on the Ghost platform, and I've done a bit of customization to the styling. Nothing major. I was mildly surprised when I ran a ghost update the other day and suddenly my custom themes and scripts were just gone! Luckily I use DigitalOcean (a great provider, if
What is an API? An API is an Application Programming Interface, but what's that really mean? In a more practical sense, it's one programmer hiding the (possibly messy) details of their own code behind a nice veneer, in order to make it easier for another programmer to consume it in their own program.
A few tips for handling and manipulating timezones Some issues transcend programming language, equally tripping up developers across the board... * Regular expressions (try validating an email address... [https://stackoverflow.com/q/201323/301857]) * SQL injection [https://www.owasp.org/index.php/SQL_Injection] (NEVER run a user's input through your database without sanitizing it) * Using floating types for
How can I do unit testing in Visual Studio for Mac? While working a code kata last month, I paired with someone to do it in C#. It was a good opportunity for trying out Visual Studio for Mac. Although I've previously kicked the tires on VS4Mac a bit, one of the things I hadn't tried testing out was, well.. testing. As it turns out, it's pretty easy!
What is TDD (and red-green-refactor)? When you create a program, you should be thinking about how you’ll know it’s right when it’s done. How will you make sure it’s doing what it’s supposed to do, before it goes to production? TDD and red-green-refactoring can help!
5 Quick Hacks for Your Ghost Theme These "hacks" for Ghost add some cool features to any blog, and should be usable with any theme.
Migrating a blog from WordPress to Ghost About a week ago I decided to migrate my blog to the Ghost platform. I'd been thinking about it for awhile - even installed it once or twice to play around with it - but never fully committed. Truth is, I didn't really want to switch. I knew that, however
How to evaluate a string of code in Erlang at runtime Erlang has the ability to read in a string, representing a line of code to execute, at runtime. It can parse it out, evaluate it and return the value. Evaluating Simple Expressions At its most basic, we can just read any expression passed in and execute it. -module(parser). -export(
What is charlieplexing? (a Raspberry Pi demo) On past projects, when I needed multiple LEDs, I just connected each to its own GPIO pin. I knew the current only worked in one direction, but I didn't think to take advantage of that fact. Charlieplexing is a method for arranging multiple LEDs so as to use the minimal number of pins possible.
What is a Git alias? If you're unfamiliar with Git's "alias" feature, it provides a way to create shortcuts for other Git commands, which can save you a lot of time. They’re easy to setup and maintain too. Let's see how.
5 Things You Can Do With a Locally Cloned GitHub Wiki There’s a feature of every GitHub repo that in my experience doesn’t get a ton of love, and that's the wiki. In all fairness, I'm not sure how much love it deserves - it's sorely lacking in features. But did you know it's a separate repo that you can clone and manipulate locally?
How do you compare two objects in C#? (testing for equality) It's common to need to compare two objects for equality, such as when detecting changes before a save operation. What does it mean to define equality in C#? What is given to you out of the box, and what can you define yourself? Let's take a look!
What is Hacktoberfest and How Can You Participate? There are 10 days left in October. 10 days to earn a t-shirt in the third annual Hacktoberfest [https://hacktoberfest.digitalocean.com/], when DigitalOcean and GitHub offer swag to the masses to encourage contributions in open source software. Last year, DigitalOcean said participation jumped [https://www.digitalocean.com/company/blog/
Connecting an Analog Joystick to the Raspberry Pi One of the coolest things about the Raspberry Pi is its GPIO pins. They’re just sitting there, waiting to be connected to all kinds of useful peripherals so your Pi can interact with the world around it. Power an LED to signal the user. Place a button in the
Creating a Flickering Candle Using an RGB LED on the Raspberry Pi After getting PWM (pulse-width modulation) to work with an RGB LED last week, I was trying to think of what else I could do with an LED that demonstrated changes in color as well as intensity. I’m not sure why – maybe it was because we lost power in our
How to Use an RGB multicolor LED with Pulse Width Modulation (PWM) on the Raspberry Pi If you buy a kit with random LEDs, wires, switches, etc, you’re likely to end up with one or two of those funky little LEDs that appears to be white, and has 4 wires instead of 2. I had set mine aside and made a mental note to figure
Creating a "Simon" Game Clone on the Raspberry Pi Have you been around long enough to remember the popular Simon game from the 70s and 80s? There’ve been plenty of remakes over the years, but I had one of the originals when I was younger. It’s a game of patterns that tests your memory. It flashes a
Creating Music with Sonic Pi After seeing Scott Fradkin live-code Sonic Pi for nearly an hour at Stir Trek - not only explaining what it was capable of but showing us too - it inspired me to do a little experimenting of my own once I got back home.
How to Create a Raspberry Pi Virtual Machine (VM) in VirtualBox I was flipping through The MagPi back-issues and came across an article about setting up a virtual Raspberry Pi environment. It got me thinking... I’ve been playing around a lot on the Pi itself, but it’d be nice to experiment with code even when I don’t have access to a physical Pi.
How to Flash an LED on Your Raspberry Pi When You Get New Email What a indicator light when you get new email? Here's how to flash an LED on your Raspberry Pi when someone sends you a message!
Generating Morse Code on the Raspberry Pi Using a Button on a Breadboard I created a morse code generator before based on entering a string at the console. Now I extended it to generate a message with a button click.
Using PullUp and PullDown Resistors on the Raspberry Pi When you start out creating circuits with the Raspberry Pi and its GPIO pins, there's an unexpected but important concept to understand, called "floating". To adjust for it, you need to understand how to use pullup and pulldown resistors.
Building a Morse Code Transmitter on a Raspberry Pi I had made the Raspberry Pi blink an LED a few times, and as thrilling as that had been ;) I wanted to try something different. So I built a morse code transmitter!
How to Access Your Raspbian Desktop on the Raspberry Pi from Another Computer When I want to play around with the Raspberry Pi, I typically end up on the floor in front of the TV, surrounded by cables. Fortunately, in a few relatively easy steps, you can create a setup that allows access to the Raspbian desktop from any machine in your house.
Hello World for the Raspberry Pi (Making an LED Blink) I finally unboxed my Pi a few weeks ago, and since then I’ve been learning some Python, which is the primary language of the Pi. A whole new world opens up when you start experimenting with the GPIO pins, which let you interact with other devices and react to the surrounding environment.
Building a model 4-stroke combustion engine from Smithsonian Last summer, I found this “Smithsonian Motor-Works” set at a garage sale. Once built, it models a 4-stroke internal combustion engine. I’d shelved it for a rainy day and rediscovered it last weekend while cleaning the basement. The girls were out - time for a little father/son bonding!
HacktoberFest, and Making My First OSS Contributions All last month, DigitalOcean carried out an event called HacktoberFest. Developers love them some swag! And we’re pretty much suckers for any kind of prize if it means proudly lording it over our fellow developers for a little while. In hopes of inspiring each other, of course. ;)
Setting up Windows 10 in a Virtual Machine (VMWare Player or Hyper-V Manager) Shortly after Windows 10 was officially released, I took a brief look at setting it up in a virtual machine.
Chrome Extensions: A Peek Under the Hood Any time we install software, we place ourselves at someone else’s mercy. Sure, bugs happen, but we have to be vigilant about what we’re installing on our devices. Are you curious about what exactly is in those Chrome extensions and apps you use? You should be! Here's why...
What is implicit vs explicit conversion? Following an answer I gave on SO, I thought I'd write up a brief explanation of implicit and explicit conversion in C#.
The effect of the Obsolete attribute on a class is ignored when there's an interface involved The effect of the Obsolete attribute on a class is ignored when there's an interface involved. It caught me by surprise, but on second thought makes complete sense!
An extension method for passing a column name to SqlDataReader.GetFieldValue There are two SqlDataReader.GetFieldValue methods - one that accepts an ordinal value and returns a specific type, and one that accepts a column name but returns an object. Let's try to have the best of both worlds, passing in a column name and getting back a specific type.
Passing data between two Forms in WinForms Passing data between two Forms, or any two classes, is a very common issue in C#. If you need to pass data around, there are a few ways to do it. Let's get it to work, and then do it better.
Using a TextBox and CollectionViewSource to Filter a ListView in WPF At one point, I was asked to code a text field to serve as a filter for a ListView that. WPF provides for more flexibility (including grouping and sorting, but I’m only going to cover filtering).
Installing Windows 3.1 in VMware Player While looking for a copy of Windows 98 on MSDN to install some old software (compatibility mode under Windows 7 didn’t work), I came across Windows 3.11. Installing it was a little tricky though...
Installing DOS 6.22 in VMware Player While looking for a copy of Windows 98 on MSDN to install some old software (compatibility mode under Windows 7 didn’t work), I came across Windows 3.11. I just had to try installing it! But first, DOS 6.22...