IoT Projects for Hobbyists and Professionals

IoT Projects
Learn How to Get Started on Your Own IoT Projects Today!

Interested in getting started with your own IoT project at home? Or are you embarking on a new IoT project at work? Either way, we've got some great tutorials on getting started, opinions pieces that examine different platforms you can use, and the benefits IoT devices and tech can bring to your development projects. 

Ready to get started? Then get to reading! 

Two Images and an API: Everything We Need for Recoloring Products

I recently found a solution to dynamically update the color of any product image. So with just one <img> of a product, we can colorize it in different ways to show different color options. We don’t even need any fancy SVG or CSS to get it done!

We’ll be using an image editor (e.g. Photoshop or Sketch) and the image transformation service imgix. (This isn’t a sponsored post and there is no affiliation here — it’s just a technique I want to share.)

See the Pen
Dynamic Car color
by Der Dooley (@ddools)
on CodePen.

I work with a travel software company called CarTrawler on the engineering team, and I recently undertook a project a revamp our car images library that we use to display car rental search results. I wanted to take this opportunity to introduce dynamically colored cars.

We may sometimes load up to 200 different cars at the same time, so speed and performance are key requirements. We also have five different products throughout unique code bases, so avoiding over-engineering is vital to success.

I wanted to be able to dynamically change the color of each of these cars without needing additional front-end changes to the code.

Step 1: The Base Layer

I'm using car photos here, but this technique could be applied to any product. First we need a base layer. This is the default layer we would display without any color and it should look good on its own.

Step 2: The Paint Layer

Next we create a paint layer that is the same dimensions as the base layer, but only contains the areas where the colors should change dynamically.

A light color is key for the paint layer. Using white or a light shade of gray gives us a great advantage because we are ultimately “blending” this image with color. Anything darker or in a different hue would make it hard to mix this base color with other colors.

Step 3: Using the imgix API

This is where things get interesting. I'm going to leverage multiple parameters from the imgix API. Let's apply a black to our paint layer.

(Source URL)

We changed the color by applying a standard black hex value of #000000.

https://ddools.imgix.net/cars/paint.png?w=600&bri=-18&con=26&monochrome=000000

If you noticed the URL of the image above, you might be wondering: What the heck are all those parameters? The imgix API docs have a lot of great information, so no need to go into greater detail here. But I will explain the parameters I used.

  • w. The width I want the image to be
  • bri. Adjusts the brightness level
  • con. Adjusts the amount of contrast
  • monochrome. The dynamic hex color

Because we are going to stack our layers via imgix we will need to encode our paint layer. That means replacing some of the characters in the URL with encoded values — like we’d do if we were using inline SVG as a background image in CSS.

https%3A%2F%2Fddools.imgix.net%2Fcars%2Fpaint.png%3Fw%3D600%26bri%3D-18%26con%3D26%26monochrome%3D000000

Step 4: Stack the Layers

Now we are going to use imgix’s watermark parameter to stack the paint layer on top of our base layer.

https://ddools.imgix.net/cars/base.png?w=600&mark-align=center,middle&mark=[PAINTLAYER]

Let's look at the parameters being used:

  • w. This is the image width and it must be identical for both layers.
  • mark-align. This centers the paint layer on top of the base layer.
  • mark. This is where the encoded paint layer goes.

In the end, you will get a single URL that will look like something like this:

https://ddools.imgix.net/cars/base.png?w=600&mark-align=center,middle&mark=https%3A%2F%2Fddools.imgix.net%2Fcars%2Fpaint.png%3Fw%3D600%26bri%3D-18%26con%3D26%26monochrome%3D000000

That gives the car in black:

(Source URL)

Now that we have one URL, we can basically swap out the black hex value with any other colors we want. Let’s try blue!

(Source URL)

Or green!

(Source URL)

Why not red?

(Source URL)

That's it! There are certainly other ways to accomplish the same thing, but this seems so straightforward that it’s worth sharing. There was no need code a bunch of additional functionality. No complex libraries to manage or wrangle. All we need is a couple of images that an online tool will stack and blend for us. Seems like a pretty reasonable solution!

The post Two Images and an API: Everything We Need for Recoloring Products appeared first on CSS-Tricks.

The Teletype Text Element Lives On… at Least on This Site

It was this: <tt>

I say "was" because it's deprecated. It may still "work" (like everybody's favorite <marquee> in some browsers), but it could stop working anytime, they say. The whole purpose of it was to display text in a monospace font, like the way Teletype machines used to.

Dave used it jokingly the other day.

Which got me thinking how much I used to use that element!

Right here on CSS-Tricks. See, in my early days, I learned about that element and how its job is to set text as monospace. I thought, oh! like code! and then for years that's how I marked up code on this site. I had never heard of the <code> element! When I did, I switched over to that. But I still haven't updated every single article from <tt> to <code>. It lingers in articles like this:

I bring this up just because it's a funny little example of not knowing what you don't know. It's worth having a little sympathy for people early in their journey and just doing things that get the job done because that's all they know. We've all been there... and are always still there to some degree.

The post The Teletype Text Element Lives On… at Least on This Site appeared first on CSS-Tricks.

The Most Important Elements of AIOps

AIOps

With increasing efficiency and sophistication, the IT environment is becoming extremely complex too. The recent shift to microservices and containers has further added to the already large number of components that go into a single application, which means the challenge is equally big when it comes to orchestrating all of them.

The ability of IT Ops teams to handle such complexities is fairly limited and hiring more resources to configure, deploy, and manage them is not very cost-effective.

DevOpsDays Raleigh 2019: Creating Real DevOps Heroes (Workshop)

Here's a presentation from the recent DevOpsDays 2019.

Today was the launch of this new workshop, focused on creating real DevOps heroes by sharing a brand new (for most) tool for their toolboxes at DevOps Days Raleigh.

Whether you're a developer or and operations-minded person, it's always nice to have a powerful selection of tooling to choose from when tackling the various problems in your daily work.

Containers and Configuration: 3 DevOps Tools and Cheatsheets

These DevOps tools make every DevOps implementation easier.

Puppet

Puppet is one of the most widely-used DevOps tools. It makes delivering and releasing technology changes quicker and more frequent with features that support versioning, automated testing, and continuous delivery. It can manage multiple servers and enforce system configuration. Puppet is one of the most popular configuration management tools in the IT world these days for a number of reasons.

You may also enjoy:  5 DevOps Tools You Should Know In 2019 


Cross-Browser Testing: Best Practices and Useful Resources

Wine testing...browser testing...what's the difference?


In the earlier days of web development, executing cross-browser testing used to be very easy. There used to be only a few limited browsers, each browser had limited versions in usage, and most importantly, there were not so many different mobile screen sizes to worry about. But time has turned upside-down, now there are multiple devices to check on, there are many different browsers available on the market that are used by a considerable number of internet goers, and there are thousands of different screen sizes to test on.

Payara Server Is Jakarta EE 8 Compatible!

Payara Server 5.193.1 is now Jakarta EE 8 Full Profile compatible!

We are very happy to report that we've successfully passed all of nearly 50,000 test suites of Jakarta EE 8 TCK, and Payara Server 5.193.1 is Jakarta EE 8 Full Profile compatible!

You may also like: Jakarta EE and Beyond!

The Payara team is extremely proud to be among the first to achieve Jakarta EE 8 Full Platform Compatibility, starting with Payara Platform 5.193.1. This is a significant milestone for Payara, and the team has done a huge amount of work to get this done. I think this is a great adoption story for Jakarta EE, in general, as Payara Server is not a Java EE 8 implementation. Furthermore, this shows that Jakarta EE is an open standard and can bring in new organizations and implementations.

Become a Master of Java Streams — Part 1: Creating Streams

Check out the article below to become a master of Java Streams!

Declarative code (e.g. functional composition with Streams) provides superior code metrics in many cases. Code your way through this hands-on-lab article series and mature into a better Java programmer by becoming a Master of Java Streams.

The whole idea with Streams is to represent a pipeline through which data will flow and the pipeline's functions operate on the data. This way, functional-style operations on Streams of elements can be expressed. This article is the first out of five where you will learn firsthand how to become a Master of Streams. We start with basic stream examples and progress with more complex tasks until you know how to connect standard Java Streams to databases in the Cloud.

The 2019 Java Developer Roadmap

What on the roadmap for Java developers?

One of the requests I received from many of my readers was to create a Java developer roadmap. Since Java is my area of expertise, it wasn't a problem to create a roadmap, but it took slightly longer for me to create one because of my limited free time. Anyway, I am finally ready to share my Java developer roadmap with you all.

This roadmap contains an unobstructed path on how to become a Java expert, answering burning questions like: Which technologies should a Java developer learn? What tools make you a better Java developer? And lastly, which frameworks must a Java developer absolutely learn?