teleren/devto huggingface dataset:
Rant: UUIDs and primary keys
Tags: database, uuid, rant
Published: 2021-12-13 22:54:04

**Disclaimer:**_This post is about my experience regarding using UUIDs as primary keys. If you defer from my opinion and you have "real world experience" on this matter, then please correct me, politely._

In this episode of rants with Ali, we will touch a subject about, why I don't use UUIDs as primary keys anymore.

After having built a fairly complex application with UUIDs as sole primary keys and later switching them back for `int`s, but still keeping UUIDs for public..that was painful..

You see, UUIDs work fairly fine if you are just going to call db for fairly simple things, i.e. fetch me this by id. However, this whole thing starts to fall apart, when you have complex joins or a lot of inserts/updates, due to nature of UUIDs.

Now, among many things, the indexing cannot be ordered and so that is going to affect inserts and update. Besides, it is going to take a lot more resources, because UUIDs are bulky and your joins will suffer a lot!

In most applications, you wouldn't really mind having slow updates or inserts but sacrificing on joins..they are quite important, specially if you want to keep your application fast without too many roundtrips and in memory calculations where db is almost always going to win. And having a crippling system defeats any "elegant" solution that anyone can muster!

Now one could argue that they will go with NoSQL where everything is "repeated". Sure. You can. But you will still need aggregations at some point (Not talking about DDD aggregations) and that will still be slower anyways due the database being inherently slower at such tasks.

So, what I instead do now is keep `int` as primary key (in relational database at least) while adding UUID for public facing entities. This gives me best of both worlds.

I am not going to provide exact "numbers" since you can find it all over the internet.

And finally, please don't base your decisions off of 10 minutes of "googling" around..
Day 496 : Miles
Tags: hiphop, code, coding, lifelongdev
Published: 2021-12-13 22:35:46

_liner notes_:
- Saturday : There was no basketball game so we actual got to go on air! As usual, had a really good time. After doing some post radio show work, I worked on my current side project. I'm at the point of converting the Vanilla JavaScript demo to Svelte so I could use it in an Astro project. Made some progress, then went to sleep. The recording of this week's show is at https://kNOwBETTERHIPHOP.com

![Radio show episode image of a person holding the oil sludge that Chevron left in Ecuador with the words Dec 11th 2021 Team](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m1gd77bd1b36yq52jzhn.jpg)

- Sunday : Guess I had a really good night sleep because I woke up later than I intended, haha. Got back to the house in time to start my Sunday https://untilit.works show. Got pretty lucky because there are some miles between where I was and the house. Had the cyphers, even had a new person join, worked on my side project and did some other chores. It was a pretty productive day. Afterwards, worked on my side project some more and went to bed.

- Professional : Got up pretty early so that I could finish up a blog post for work. Got it completed and then submitted it for review. Then I went back to bed. haha. Got up around the normal time, had a meeting with my manager, worked with the person that reviewed my blog to get it ready to be published, and had a couple of other meetings. Not a bad way to start the week.

- Personal : As far as my side project, I didn't get it to a point to release it today, but I'm making some progress. There's like 2 main parts left and I got a good amount of one part done and the second part could be made up of the first if I code it right. That's what I'll be working on. If I can get it working, that will save a bunch of time. Did some research in the Svelte docs and I think I can make it happen.


![A misty green field with some trees and mountains in the distance at sunrise in Maple Ridge, BC, Canada ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gt5ggc05o34xt2cjtfjx.png)

Over the weekend, I did some research on items I'm thinking about purchasing for some projects I want to launch in the new year. I actually made a trip to Best Buy before the radio show to actually get a hands on with a device. I like it and think it will suit my needs. Going to do some more coding on my side project. I want to see if I can abstract a part so I can reuse it elsewhere. We'll see.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube GJ8SVownxBA %}
Solving day 13 of Advent of Code 2021 in JavaScript
Tags: challenge, adventofcode, javascript, video
Published: 2021-12-13 22:30:21

---
title: Solving day 13 of Advent of Code 2021 in JavaScript
published: true
description: JavaScript walkthrough of Advent of Code 2021 (day 13)
tags: challenge, AdventOfCode, javascript, video
series: Advent of Code 2021 in Javascript
---

{% youtube aG2W8HZkJ04 %}
Security Releases – Horizon 29.0.3, Meridians 2021.1.8, 2020.1.16, 2019.1.27
Tags: news, cve, horizon, log4j
Published: 2022-01-04 20:59:03

---
title: Security Releases – Horizon 29.0.3, Meridians 2021.1.8, 2020.1.16, 2019.1.27
published: true
date: 2021-12-13 22:22:41 UTC
tags: News,CVE,Horizon,log4j
canonical_url: https://www.opennms.com/en/blog/2021-12-13-security-releases-horizon-29-0-3-meridians-2021-1-8-2020-1-16-2019-1-27/?utm_source=rss&utm_medium=rss&utm_campaign=security-releases-horizon-29-0-3-meridians-2021-1-8-2020-1-16-2019-1-27
---

Today we released off-cycle updates to all OpenNMS Meridian versions under active support, as well as Horizon 29, to address the Log4j2 "Log4Shell" vulnerability.

It is strongly recommended that you upgrade to the latest releases immediately.

- Horizon 29.0.3 (codename [_Penguin_](https://wikipedia.org/wiki/Penguin))
- Meridian 2021.1.8 (codename [_Cassini_](https://wikipedia.org/wiki/Cassini%E2%80%93Huygens))
- Meridian 2020.1.16 (codename [_Stack_](https://wikipedia.org/wiki/Stack_(geology)))
- Meridian 2019.1.27 (codename [_Ixbalanqué_](https://wikipedia.org/wiki/HD_98219_b))
Web Component Considerations
Published: 2021-12-13 21:44:31

**Building our Card**
For our second project, we are tasked with creating a card. In this card, we are using multiple web elements. To separate our elements in order to give them the attention they need, we broke them into different files. For example, our files in our `src` folder include `CardBody.js`,`CardHeader.js`,and `CardIcon.js`. This makes it easy to go in and style each element without getting "lost in the sauce".

**What's Difficult**
We were having difficulty with getting each separate element to show into one cohesive card, but we did figure that out over time with more messing around. It is definitely more manageable after having practiced and developed our button in a previous project.
The Concept of Fonts
Published: 2021-12-13 21:36:07

A concept from this week that is near and dear to my heart is fonts. I love design and fonts just put the perfect touch onto a project. This concept is something I was having trouble with in my first project, as our button was Halloween themed and I couldn't get my creepy font to work. I wish I had this blog post then.

**How to Implement Fonts in Lit**
You can implement fonts in LitElement by importing a font like Google font. This would be done in the HTML portion of your code and would look like this:

```
<link href="https://fonts.googleapis.com/css?family=Kaushan+Script&display=swap" rel="stylesheet">
```
Source: https://stackoverflow.com/questions/57489637/how-to-load-google-font-in-litelement

**How to Implement Fonts in a General Setting**
In a general setting, I would implement a font by using a font-family in CSS while styling. For example, if I wanted to use a cursive font, I would use this font-family:

```
.cursive {
  font-family: cursive;
}
```
Source: https://developer.mozilla.org/en-US/docs/Web/CSS/font-family

**Why the Difference?**
The main difference to me with using an imported font vs. a css font-family is that you can get a lot better fonts when they are imported. For example, with my Halloween button project, I imported a font so that it was extra spooky.
It's Not Goodbye...It's See You Later 
Published: 2021-12-13 21:18:45

**SYL**
As I finish my last few days in my web developments course I must say: it's not goodbye, it's see you later. I will definitely be using some of the concepts I learned in this class for my future career. My biggest takeaway from this class is how to work with git commands. They seem easy, but they can be really hard if you are just getting started with them. (like I was!)

**Update on Group J's Trading Card**
After a lot of thinking, we decided to do a holiday trading card. It seemed like the festive thing to do. In our tradingCard.js file, we implemented the cards using an array. Each card employs a picture of the character, their stats (Age, Height, Holiday Cheer(these are real stats from google which is amazing considering they are not real)), and icons next to each stat. Surrounding the card is a very festive red and green border. Here are some pictures!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9w3u9ds4ipiatvpwhz4y.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7uuz5cyg7tgrh6tghruz.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z43o7wbg3d894fowlmeh.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m1wjkp3rx68g7igls277.png)

**HAX**
Although we have not implemented our HAX element, we are most likely going to give our trading cards the ability to be translated into another language. I think this is a great implementation for a better UX if English is not someone's preferred language.

**Links to NPM & GitHub Repo**
[https://github.com/ist402groupj/project-3]
[https://www.npmjs.com/org/ist402group19j]
Learn Python Using SoloLearn
Tags: beginners, python, programming, turry
Published: 2021-12-13 21:04:27

## What is sololearn?
Sololearn has one of the world's largest community of people learning how to code. With over 25 programming courses, choose from thousands of topics to learn how to code. These programming languages include: Python, Java, Kotlin, Javascript, C#, C++, C, Go, Swift, SQL, R, React, HTML, CSS, PHP and more yet to come.

### Sololearn Python Courses
In sololearn, there are a number of courses to choose from such as finance and data analysis. For today, we will focus on the general courses namely:

1. - Python for beginners
2. - Intermediate python
3. - Python Core

## How to effectively learn python:

---

### 1. Python for beginners 
Start with python beginners especially if you are new. If you fail to understand a specific topic then search on stack overflow or w3school. Even if you’ve already learnt some aspects of python I’d still recommend because some lessons may be essential when completing intermediate python. During this course interchanging between w3schools and Sololearn would be really helpful since one website teaches something the other doesn’t and vice versa. 

### 2. Intermediate Python
Okay so if you have an overall foundation of Python for beginners you might think you are really ready for intermediate, you even got your first certificate from Sololearn which is totally acceptable by other organisations :) hopefully…


Well here’s the thing, it gets harder. The beginning of intermediate will test your understanding of python from what you learnt in Python. I’d recommend you really understand what you’ve learnt and try answering without using answer sheets or else you’ll have 0 knowledge at this point. I hope you haven’t used leaks in the first course as well or you are done for.


Ok now you’ve probably gone through so much distress and pain and suffering from this course but as you progress you’ll slowly grasp the knowledge of python and probably open up your mind to more possibilities, this is great! When you reach the functional programming module of the course, I’d recommend you go through python core at a slow but timely pace while completing your intermediate course. This is because you may or may not have forgotten some aspects of python for beginners but it’s good to recall and remember what you have learnt.


 If you do not have premium you must have noticed those “purple blocks” to pay for exercises for free, you earn them by completing lessons and completing the major code problems at the end of each module. Use them even in python for beginners but be responsible and use wisely, some exercises wouldn’t be necessary especially the ones in python core.

Cya on the next article!
Command aliases for Ruby debug
Tags: ruby, rails, debug
Published: 2021-12-13 21:01:03

After years with [Pry](http://pry.github.io), there's a new old kid on the block now: [debug.rb](https://github.com/ruby/debug) >=1.0.0 – all new, shiny and ready for Ruby 3.

One thing I miss though is the ability to create command aliases. 

To quickly get out of the debugger, typing «exit-program» involves too many hands for my taste, I prefer something quick like «eee» instead. Pry lets you create such command aliases in `~/.pryrc`:

```ruby
Pry.config.commands.alias_command "eee", "exit-program"
Pry.config.commands.alias_command "ee", "exit"
```

Typing «kill!» or its shorter twin «k!» with debug.rb is no fun either. Here's a quick and dirty monkey patch to do a similar trick in `~/.rdbgrc.rb`:

```ruby
module DEBUGGER__
  class Session
    COMMAND_ALIASES = {
      'ee' => 'quit!',
      'eee' => 'kill!'
    }.freeze

    alias_method :original_process_command, :process_command
    def process_command line
      original_process_command COMMAND_ALIASES.fetch(line, line)
    end
  end
end
```

Happy hammering your "e" key!

---

Photo by <a href="https://unsplash.com/@jhaland?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Jørgen Håland</a> on <a href="https://unsplash.com/s/photos/twins?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
CAMS
Published: 2021-12-13 20:59:37

The company I work for, [TerminusDB](https://terminusdb.com), recently started work on a Critical Asset Management System for the Caribbean Island of Dominica. 

It's a really great project, and one that I'm proud to be part of. Working for free, TerminusDB and a team of skilled volunteers, is assisting ARISE-US (the advisory panel to the United Nations Office for Disaster Risk Reduction) to build a system that will highlight all of Dominica's critical assets and the failure chains associated to them in the face of extreme weather events.

Following the devastating impact of Hurricane Maria in 2017, Dominica decided to build back stronger. Their goal is to become the first climate-resilient nation in the world.

You can read more about the project here.

[Dominica Critical Asset Management System](https://terminusdb.com/blog/critical-asset-management-system/)
My list of useful git commands
Tags: git, softwaredevelopment, softwareengineering, programming
Published: 2021-12-13 20:47:27

As all those of us involved in the field of Computer Science know or should know, Git is by far the most widely used modern version control system in the world today. We utilized it in our everyday routine to keep track of our code changes and helps us to work with other developers simultaneously and independently. <br/>
Although modern IDE and various tools provided by GitHub, Atlassian and other provide us an easy to use way to perform many git commands nothing compares to the power a terminal provides. Bellow you can find a list of my top git commands.

#### Rename latest's commit message
```git
# This will pop up an editor window allowing us to pass the new commit message
git commit -amend 

# This will not pop up the editor
git commit -amend -m "Your new commit message"
```

#### Add file(s) into the latest commit. This requires that last change is not yet pushed into remote
```git
# Add the file
git add the_file_you_want_to_add
# Amend without changing commit message
git commit --amend --no-edit
```

#### Reset to specific commit hash and discard any changes since that hash
```git
git reset --hard <commit-hash>
```

#### Apply a commit from one branch to another
```git
git cherry-pick <commit-hash>
```

#### Show commit logs and limit the output
```git
git log -n <number>
# example git log -n 3
# or
git log -<number>
# example git log -3
```

If you are aware of any useful / useful git command and want to share it please do not hesitate to leave a comment!
What are SOLID principles?
Tags: design, solid, designpatterns, java
Published: 2021-12-13 20:46:47

SOLID is an acronym of below five object-oriented design principles.

- S – Single Responsibility
- O – Open Closed
- L – Liskov Substitution
- I – Interface Segregation
- D – Dependency Inversion

## Single Responsibility Principle
Every entity (class, method, or module) should have a single responsibility. In other words, every entity must have a single reason to change.

## Open Closed Principle
Every class should be Open for extension and Closed for modification.

For example, if there is a method to read a file and the filename is hardcoded in the function, we need to change the method whenever the file name changes. Instead of hardcoding the filename, we can pass it via a parameter in the method.

However, there is an exception to fixing bugs in the code.

## Liskov Substitution
In simple words, it is to replace the supertype object with the subtype object and the behavior is not undesirable then this test has been passed.

If S is a subclass of T, then the object of T can be replaced with the object of S without getting any undesirable behaviour.

For example, if we create a class Rectangle with properties width and height then we create its subclass Square which sets the width and height the same whenever we update any of them. When we added the constraint in the square, it leads to undesirable behaviour when we substitute the square object for the rectangle object. In this example, it did not pass.

```java
class Rectangle {
	Integer width;
	Integer height;
}

class Square extends Rectangle {
	public void setWidth(Integer width){
		this.width = width;
		this.height = width;
	}
	public void setHeight(Integer height){
		this.width = height;
		this.height = height;
	}
}


/** 
Let's create a Rectangle object (supertype)
Rectangle r = new Rectangle();
Now checking Liskov Substitution by replacing Rectangle object with the Square object.
The square objects ensures the constraint that width and height must be same. 
However the reference type is rectangle. Hence, the liskov substitution test has not passed.
**/

Rectangle r = new Square();
r.setWidth(5);

```

## Interface Segregation
An interface should only have those methods which can be implemented by any client. In other words, no client should be forced to implement methods that it does not use. If that’s the case, we should divide the interface into two or more interfaces so that every client implements only those methods that it’s using.

## Dependency Inversion
Whenever we have a dependency on objects, they should be passed via the constructor. We should not create the objects and make the class tightly coupled with the objects. High-level modules should not depend on the low-level modules, instead, they should rely on abstractions.

It also helps in unit testing. We can mock the dependencies by providing their mocks.
Send an SMS with Guile and Twilio API
Published: 2021-12-13 20:36:29

These last days, I tried to send an SMS with a Guile script.
TL;DR: I succeeded!

Since the code is just a simple HTTP POST request, the longest part should have been the creation of the Twilio account (with a Regulatory Bundle and a phone number).

But in the end, it took me about one evening[1] to set up a development environment with the right dependencies, and then two more evenings to figure out which HTTP headers were needed.

Anyway, here is the script:

```scheme
;; send-happiness.scm

(use-modules (web client)
             (web http)
             (ice-9 receive)
             (ice-9 iconv)
             (gcrypt base64))

(define TWILIO_ACCOUNT_SID "your-account-sid")
(define TWILIO_ACCOUNT_TOKEN "your-account-token")
(define TWILIO_PHONE_NUMBER "your-twilio-phone-number")

(define TWILIO_CREDENTIALS
  (base64-encode
   (string->bytevector
    (simple-format #f "~A:~A" TWILIO_ACCOUNT_SID TWILIO_ACCOUNT_TOKEN) "utf-8"))

(define RECIPIENT_PHONE_NUMBER "a-phone-number")
(define TEXT_MESSAGE "Wish you so much happyness !")

(http-post
 (simple-format
  #f 
  "https://api.twilio.com/2010-04-01/Accounts/~A/Messages"
  TWILIO_ACCOUNT_SID)
 #:headers `((content-type . (application/x-www-form-urlencoded (charset . "utf-8"))
             (authorization . (basic . ,TWILIO_CREDENTIALS)))
 #:body (simple-format #f "Body=~A&To=~A&From=~A"
                       TEXT_MESSAGE
                       RECIPIENT_PHONE_NUMBER
                       TWILIO_PHONE_NUMBER))
```


And how to execute it :

`$ guix shell guile gnutls guile-gcrypt -- guile send-happiness.scm`



All phone numbers must start with the country indicator. For example +33 for a French number.

[1] the time unit of my Guile tinkering

_Thank you very much for reading this article!_

_Don't hesitate to give me your opinion, suggest an idea for improvement, or ask a question! To do so : contact me._

_Don't miss out on the next ones..._

- _articles via Mastodon @jeko@write.as and RSS_
- _screencasts via Peertube jeko@video.tedomum.net and RSS_

_And more importantly, share this blog and tell your friends it's the best blog in the history of Free Software! No kidding!_
Dont carry it over to next year!
Tags: programming, productivity, discuss, motivation
Published: 2021-12-13 20:31:26


![Don't carry it over to next year](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4b74niqlb90n69n419mu.jpg)


This is the last month of the year, **Do not wait** for the new year to start writing down resolutions. If you have noticed where you are lagging or where you had missed it; start making amends.


_**That bad habit you planned to change from next year; start working on it this month**_
<dl>
<br/>
<h3>Programmers -</h3>
<dd>That folder worth 800GB of incomplete projects that you are planning to re-visit next year, <b>start it this month.</dd>
<br>
<h3>Entrepreneurs -</h3>
<dd>Those new markets you want to venture into and those deals you want to strike, start making the movements this month.</dd>
</dl>


#####Research has proven most resolutions we make for the next year are usually short lived. Start this month.
Apama Advent Calendar - 13 Dec 2021 - Apama in containers
Tags: apama, iot, cumulocity, streaminganalytics
Published: 2021-12-16 14:17:06

---
title: Apama Advent Calendar - 13 Dec 2021 - Apama in containers
published: true
date: 2021-12-13 20:11:05 UTC
tags: apama, iot, cumulocity, streaminganalytics
canonical_url: https://tech.forums.softwareag.com/t/apama-advent-calendar-13-dec-2021-apama-in-containers/253888
---

_This is Day #13_ _of a short series of brief tips, tricks, hints, and reminders of information relating to the Apama Streaming Analytics platform, both from Software AG as well as from the community._  

Check out the original article in the [Software AG Tech Community](https://tech.forums.softwareag.com/t/apama-advent-calendar-13-dec-2021-apama-in-containers/253888) which covers pre-made Apama base-images in DockerHub. The article contains links leading to other blog articles dealing with instructions available for how to build your own image from an on-prem installation. 

_Note that some posts may be published a day or two early or late (e.g. Mon-Fri) so you may find you have bonus days with more than one post!_