teleren/devto huggingface dataset:
Ideas for Next Iteration
Tags: java, aws, docker, fullstack
Published: 2021-03-06 01:27:17

Coffee, cake, music, and a tech magazine.

Last October 2020, I wrote down these ideas after reading a special edition magazine called 'Frontend Spezial' of the series 'Der Softwerker', by the company codecentric AG.

These improvement ideas are related to the projects assigned to me at my work.

In the 4 sticky notes as seen in the picture above:

## Frontend:
1. Display a progress bar.
2. Do analysis: measure the time elapsed between each request and response.
3. Test using different mobile devices: cellphones and tablets.
4. Use a common design instead of dependending on a common module.
5. Cypress: a JavaScript End-to-End testing framework.

## Backend:
1. Separate the component into two new components: one to handle the work loads from the inside of the organization, and another for the outside.
2. Containerization: either on-premises or on the cloud. To read about the pros & cons:
 * [On-Premises Containers vs. Public Cloud Container Services](https://containerjournal.com/features/premise-containers-vs-public-cloud-container-services/)
 * [To Use Physical Or To Use Virtual: That is the container deployment question](https://www.docker.com/blog/physical-virtual-container-deployment/)
Cómo se debe trabajar con campos de fecha y hora en varias zonas horarias?
Tags: tip, desarrollo
Published: 2021-03-06 00:56:07

---
title: 'Cómo se debe trabajar con campos de fecha y hora en varias zonas horarias?'
published: true
tags: ['tip', 'desarrollo']
---

Cuando trabajamos en un proyecto geográficamente local, es posible que no nos hayamos topado con este
inconveniente todavía, se maneja una sola zona horaria, el servidor está configurado
en sincronía con la hora local, todos los datos se guardan con hora local, no hay ningún
problema. Pero qué pasa cuando nuestro producto comienza a hacer usado por personas
alrededor del mundo? Su hora local ya no es la misma que la hora en el servidor.

Si tenemos campos como fecha_creacion o fecha_actualizacion generalmente son del tipo
DATETIME, y son auto-actualizados, cuando insertas un nuevo registro se creará
con CURRENT_TIME() y cuando se actualiza podemos poner la fecha desde la aplicación o un trigger.

Si tenemos esta configuración, si un registro se creó a las 8 am hora local,
la fecha_creacion que ve el usuario A en zona horaria local es 8am pero la fecha_creacion
que ve el usuario B en una zona horaria de menos 2 horas de diferencia debería ser 6am, pero es
8am también. No estamos considerando en que zona horaria se encuentra el usuario B.

Ahora bien, podemos comenzar a capturar la zona horaria en las preferencias del usuario B,
o reconocer en dónde se encuentra ubicado usando geoip. Y comenzar a realizar operaciones
de transformación de fecha/hora entre zonas horarias, pero esto rapidamente se vuelve
inmanejable. Las operaciones de cambio de zona horaria siempre son complicadas.

La mejor alternativa para solucionar este inconveniente es usar siempre una hora estandarizada
[**UTC**](https://es.wikipedia.org/wiki/Tiempo_universal_coordinado). Todas los campos fecha y hora deben estar guardados en UTC, la configuración de hora
en los servidores de aplicación debe ser UTC, la configuración de la hora en el servidor
de base de datos también debe ser UTC.

Esto permite que el despliegue de una fecha y hora a un usuario específico se convierta en un asunto
pertinente solo a la interfaz de usuario, solo al mostrar información al usuario se cambia de UTC a
la zona horaria escogida por el usuario.
Day 33: Stooge Sort
Tags: 100daysofcode, javascript
Published: 2021-03-06 00:49:45

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/udlzzbx07lc30ew6hk4c.gif)

```javascript
function day33 (array, i, j) {
    if (j === undefined) {
        j = array.length - 1;
    }
 
    if (i === undefined) {
        i = 0;
    }
 
    if (array[j] < array[i]) {
        var aux = array[i];
        array[i] = array[j];
        array[j] = aux;
    }
 
    if (j - i > 1) {
        var t = Math.floor((j - i + 1) / 3);
        day33(array, i, j-t);
        day33(array, i+t, j);
        day33(array, i, j-t);
    }
};
```
Console:
```javascript
arr = [13,9,60,43,2,39,54,87];
day33(arr);
console.log(arr);
```
Few habits every developer should follow.
Tags: computerscience, beginners
Published: 2021-03-06 00:48:48

##* You should code every day.

  1. You should code every day for at least 30 minutes every day can increase your coding skills.

  2. Follow this, You can learn how to write code.


##* Solve one or two problems every day.

  1. You can solve one or two problems every day.

  2. Starting you can solve the easy problem in few days. then solve the medium problem.

  3. You can use the online website for coding practice for example **[Leetcode](https://leetcode.com/)**,   **[Hackerrank](https://www.hackerrank.com/)**,   **[Codechef](https://www.codechef.com/)**,  **[coderbyte](https://www.coderbyte.com/)**.

##* Never Stop Learning.

   1. Never Give Up.

   1. This field evolves so fast and you need to keep up with it.

   2. Being a developer is a lifelong learning journey.

   3. The worst thing you can do as a developer is to stop learning new technologies.


##* Understanding of new logic of problems.

 1. When you solve the problem then before finding the logic then solve the problem.

 2. Find many logical solutions to a problem. it will improve your coding and logic skills.


##* Think before you write the code.

  1. Don't just write code without having a solution in mind.
 
  2. First, find the solution then code it.

  3. This will save you a lot of time.
Fetch data from protected server content via Chrome Dev tools
Tags: beginners, tutorial
Published: 2021-03-06 00:42:01

Someone recently showed me a protected server that can be accessed using ngrok.com. [Ngrok](https://ngrok.com/) allows you to serve online a server running on your machine. It's pretty cool: you need to install ngrok in your machine and then, running a script like `./ngrok http {{whatever the port}}` (i.e. ./ngrok http 5000) in your terminal (you need to be in the folder where the executable ngrok downloaded file has been unzipped to), generates a random url that can be used to access your server. Once you turn the server off in your machine, the URL stops working as there is nothing in the localhost port any longer. Please note that `./ngrok` I think it is because I am on a Windows machine.

You can protect it by running the script `./ngrok http --auth=username:password {{whatever the port your localhost server is running in}}`. If you head to the provided url, you will get:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9zm8qr74nsw5tkruvcom.png)

Once you enter the determined username and password, you will access the content.

Now, how to access the content using the fetch API and Chrome Dev Tools:

1. Head to the console tab
2. Write:

```
const res = await fetch('{{ngrok URL}}', {headers: {'Authorization': `Basic ${btoa("username:password")}`}})

console.log(await res.json())
```

3. The username and password have to be base64 encoded, and `btoa()` is [the method to do so](https://developer.mozilla.org/en-US/docs/Glossary/Base64). Remember it needs to be a string, so write "username:password".

4. The [Basic Authorization](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) is what is needed when the endpoint is HTTP protected. To pass on the credentials, the `'Authorization'` header (the quotes are needed) value should be a string too: `Basic ${btoa("username:password")}`.

5. Do it from a tab in your browser where you have opened the ngrok url, otherwise you will bump into the same site policy, which prevents serving content if request does not come from the same domain. 

I hope it was useful.
Elm Cheat Sheet
Tags: elm, webdev
Published: 2021-03-06 00:03:47

For a training session at work, I created a [Cheat Sheet for the Elm language](https://twitter.com/luca_mug/status/1366200906606252037). I think is a valuable reference for people that are learning Elm.

Most things are there, both basics and advanced. It also contains full code examples to see the structure of a simple application implemented using The Elm Architecture.

It is interesting to see how much Elm you can fit on a single page!

[![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mp9jbafj42fdb071zawz.png)](https://twitter.com/luca_mug/status/1366200906606252037)

These are other valuable resources to learn Elm:

* [The official Elm guide](https://guide.elm-lang.org/) 
* [Basic examples](https://elm-lang.org/examples)
* Online sandboxes: [elm-lang.org/try](https://elm-lang.org/try) and [ellie-app.com](https://ellie-app.com/)
* [Overview of the Elm syntax](https://elm-lang.org/docs/syntax) 
* [Similarities between Elm and JavaScript](https://elm-lang.org/docs/from-javascript)
* [FAQ](https://faq.elm-community.org/) 
* [A gentle introduction to Elm](https://elmprogramming.com/)
Fetch Shared Data in Next.js With Single Request
Tags: nextjs, javascript, node
Published: 2021-03-06 00:03:05

**Take a look at caching strategies with NodeJS layer in front of Next.js**

While reviewing my current project’s build process, I noticed that generating pages with getStaticProps yields many requests to one endpoint. It’s not a big problem in my case since our backend is quite fast but googling this issue showed that some people are struggling with it. For example, the issue might be serious in case of a slow database or when the backend can’t cope with 100 requests per second. So I decided to try solving this problem and improving the build time of my project.

[Read more](https://itnext.io/fetch-shared-data-in-next-js-with-single-request-833433fa8ed1)
Can we build our SQL queries?
Tags: sql, database, orm
Published: 2021-03-11 07:08:52

---
title: Can we build our SQL queries?
published: true
date: 2021-03-06 00:00:00 UTC
tags: sql, database, orm
canonical_url: https://jhall.io/archive/2021/03/06/can-we-build-our-sql-queries/
---

Whenever I talk to someone about giving up their beloved ORM, one objection inevitably comes up:

> I need my ORM to generate SQL for me.

If I dig deeper, I usually get one of these underlying reasons:

- The desire for SQL-agnosticism. That is, the same code could work with MySQL, PostgreSQL, SQLite, or any other SQL flavor.
- They’re not familiar with all the nuances of SQL queries, joins, etc.

There are both arguably valid concerns.

However, neither of these has _anything_ to do with object-relational mapping, which is what ORMs are for (reminder: ORM stands for **O** bject- **R** elational **M** apping).

If the reason you’re using an ORM is to generate SQL for you, then you don’t need an ORM. You need a SQL query builder! Naturally, most (all?) ORMs are bundled with a query builder, but that doesn’t mean you need all the extra features (bloat?) of an ORM.

Next time you’re facing one of these problems, consider whether you can get by with _just_ a query builder.
Trash your unused node_modules folders and regain hard drive space
Tags: node
Published: 2021-03-05 23:15:41

If you are like me and have a lot of legacy projects on your computer you should consider deleting your node modules folder.  A few minutes and a terminal command gave me back several GB of hard drive space! 

before:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g1w0qdwqyie0g1ahitjx.png)

after:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vyxdwm9ka5bf3a99y4b1.png)

I also ran this in another folder and saved 700mb


- Before getting started make sure your projects backed up to Github or some-place safe.

```shell
cd directory-where-your-projects-live

find . -name "node_modules" -type d -prune -exec trash -rf '{}' +
```

You can `npm install` dependencies to add them back to any projects where you need them.

- If you don't have [trash](https://github.com/ali-rantakari/trash installed) installed (and you probably should) use `rm` instead like this:

`find . -name "node_modules" -type d -prune -exec rm -rf '{}' +`

sources:
https://rtmccormick.com/2018/01/10/clear-node-modules-folders-recursively-mac-linux/
New Intro and What's Here for REXML::Element
Tags: ruby, xml, documentation
Published: 2021-03-05 23:01:05

---
title: New Intro and What's Here for REXML::Element
published: true
description: 
tags: ruby, xml, documentation
---
The introductory Rdoc for class REXML::Element currently is this:

> Represents a tagged XML element.  Elements are characterized by having children, attributes, and names, and can themselves be children. 

I've added an intro that's, shall we say, somewhat more robust?

It includes a What's Here section.
This is merged but not yet released, but may be viewed at
-  https://ruby.github.io/rexml/REXML/Element.html
Day 323 : Wild
Tags: hiphop, code, coding, lifelongdev
Published: 2021-03-05 22:50:45

_liner notes_:
- Professional : Pretty chill day. Didn't do any actual coding. Had a couple of meetings. Helped out with a question from the community and then took some training. Not a bad way to end the week.

- Personal : Last night, I worked on the radio show for this week. The week before, I got a lot of tracks prepared for the show so this week, I didn't have to do too much. I just needed to look up the twitter handles for the artists. It took awhile because I would go down all these different rabbit holes while searching on Twitter. haha That's why I try to stay off Twitter unless I need to be on there. haha. So yeah, that's pretty much all I did. haha.

![Waves crashing on the grassy shore of Jacksonville, Fl, USA](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9aqgehoyw6n2beotv7xj.jpg)

So this Friday turned out to be a pretty eventful day. "Coming 2 America" was released (The first movie was released 33 years ago!). Looking forward to checking it out. The finale of "WandaVision" also came out today! I know that's going to be wild! Then in addition to all that, it's Bandcamp Friday! So I probably spent way too much money buying music. haha It supports indie artists, so that's always a good cause. Pretty much spent the day download the shows and tracks so I don't have to use my hotspot later. My plan is to go through a few more tracks for the radio show and then watch the shows tonight. Maybe I'll do some coding if it's not too late.

Have a great night and weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube lpiYRIcjAxQ %}
Nevertheless, Melanie Coded :)
Tags: wecoded
Published: 2021-03-05 22:46:02


Hi! I'm Melanie, I currently work as a business/technical analyst at [Neudesic](https://www.neudesic.com/) and wanted to share my story about how I joined the STEM world:)

### Majoring in computer science 
In my sophomore year I went from undecided to a computer science & informatics double major at UAlbany. I struggled for a bit and really had to apply myself as I entered the foundational computer science classes. The one foundational computer science class I had to take twice was my favorite one, CS300, taught by Judy O'Rourke. We never actually programmed though, on tests we had to write down our code based off prompts. It was one of the hardest classes I had to take but I enjoyed it because Judy is such a great teacher. We had to learn how to format decimal numbers into binary format (IEEE 754), studied pointers and memory addresses, as well as early programming languages. Learning about the history of computers and how they programmed in the early days was a great experience, nonetheless from Judy; because she would always emphasize how women were leaders in computing, even when women only made up of a small percentage of the class. Not only was Judy a great teacher, she's an awesome role model for women who want to do computer science; she inspired me to keep my computer science major and prove that women can excel in STEM as well!
Crazy Mountain Brewery
Tags: iot, brewery, raspberrypi, diy
Published: 2021-03-05 22:34:48

Coloradans love beer. We hand out beers at the end of races instead of water. After a long day of biking or skiing we drink beer. Beer is a part of the live music scene, sporting events, festivals, and other social gatherings. With that many beer lovers, it makes sense that Colorado has the fourth most breweries per capita in the U.S. and that Colorado is home to more than 400 established breweries.

One of the breweries in our back yard is Crazy Mountain Brewery. They started operations in the Vail Valley with a taproom in Edwards, CO and later opened another location in Denver, which became their production headquarters. Through a mutual contact we learned that the Director of Operations at Crazy Mountain was looking for off-site methods to monitor some of their brewing equipment.

Crazy Mountain knows that complete temperature control is essential during the brewing process. They wanted to be notified via text when the boiler temp dropped below 150 degrees or when the glycol temp was greater than 41.

![Crazy Mountain Brewery](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vdznf7gb2rogcegu8887.jpg)

For this project, Crazy Mountain used a Raspberry Pi connected to a Temperature Sensor to monitor the brewery's boiler tank and a Waterproof Temperature Probe to monitor the glycol tank. The Raspberry Pi was connected to [IoT Ensemble](https://www.iot-ensemble.com) and the data was streamed to a dashboard where the alerts were setup. The alerts had the potential to make a real difference. Within a couple of weeks all of the hard work paid off when the brewery lost power.

> "You saved us a whole day of brewing! If we didn’t have the alert and we didn’t come in to check Sunday or Monday, we would have walked in to cold water today. And it takes so long to heat up that we wouldn’t have been able to brew at all today, which messes up the whole week!"
> Director of Operations at Crazy Mountain Brewery, Denver, Colorado

The mission was a success. You can do the same for your brewery. [This blog](https://www.iot-ensemble.com/blog/raspberry-pi-dht11-node-red-iot-ensemble-power-bi) takes you step by step through configuring a Raspberry Pi/Temperature sensor from scratch, connecting it to IoT Ensemble, and then streaming the data to a dashboard. If you have any questions along the way, drop us a line at support@fathym.com and we'll be happy to help.

[Sign up](https://www.iot-ensemble.com/dashboard) for IoT Ensemble and save your brewery thousands of dollars in time and lost product. Enroll your first device for free. No credit card required.

![Fathym and CMB](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ik7o0cfiudwied4dg0x.jpg)
To <div> or not to <div>? That is the question...
Tags: html, beginners, blog
Published: 2021-03-05 22:06:06

I am starting to appreciate the fact that I came late to the coding game, and one of the things that I am appreciative for are HTML semantics; and how HTML5 brought a plethora of tags that have both vastly reduced the use of the <div> and greatly improved the understanding of the HTML markup.
One of the interesting things that I like about HTML is that it is simple, it’s as simple as coding comes,in the simplest of terms, HTML is saying ‘put this, there’ and CSS is saying ‘and do it this way’. Both HTML and CSS are complimentary partners, one is plain and simple, matter of fact and the other enjoys a little flair, and to coin a phrase, style.
Think of HTML as Lego, colourless lego to be precise. You fit the pieces together and eventually you get something, but CSS comes along and paints each brick a different colour and before you know it; you’ve got yourself something… anyway, I’m getting away from my original point. 
Semantics.
HTML5 has been described by many as “forgiving” and from what I’ve been learning, yes it is forgiving in it’s nature. I will continue to wrap my src and href in “…” but the truth of HTML5 is that you don’t actually have to. The browser will understand what you’re going for and will sort it out. Think of it as a Teams call where a colleague is cutting out, but you still understand the point he’s making. It’s not clean, it’s not the best, but you get it.
HTML likes to keep things simple and for HTML to be both clean and efficient, it also needs to be kept organised, and this why why I am so happy that we are able to structure a page, without relying on the <div>, now don’t get me wrong, I think the <div> is a great tag, it breaks things up, it gives the markup structure, but what it does not give me markup is context.
So whereas we would <div> this and <div> that - now, you can structure your mark up, as an author would structure a story, by giving it a beginning middle and end. We’re taking <header> for you main titles <main>, <section>, <nav>, <article>, and there is a TON more! it’s an actual candy store of tags. What this enables you to do is actually think about your page as a piece of organised content, – sidebar, navigation, heading, subheading, article, footer. 
When I am designing a page, or preparing the structure - before I even place a finger on the keyboard, (and I’m not going to pretend I’m not new to this), I sketch the page in simple blocks and what happens is that I see a structure that these HTML5 tags help to define – and in reverse, I find that I read a piece of code and I can visualise that structure – I don’t even have try because it’s right there – header, main, article, footer.
So to the almighty <div>, thank you for everything, but like all things, we must evolve. So don't be afraid to explore the semantics in HTML5. Honestly, they make understanding the markup much easier.
Actually that was quite cheesy, but you get my point.
Keep safe.
What are Microservices? Microservice Architectures vs Monolithic Architectures
Tags: microservices, beginners, containers
Published: 2021-03-05 21:46:52

Ever wondered what Microservices are and how they compare to more traditional architectures? 

Check out this short video excerpt (~3 mins) from a past webinar where I breakdown the difference between "Monolithic Architectures" and "Microservice Architectures". 

{% youtube GoHRrZ9_98w %}

Check out the full webinar replay of the "Red Hat OpenShift World Tour - Introduction to Containers with Node.js and Kubernetes on Red Hat OpenShift 4.x" on [IBM Developer's Crowdcast page](https://www.crowdcast.io/e/red-hat-openshift-world-2 ).


==== FOLLOW ME ON SOCIAL MEDIA ====
Twitter: [Bradston Dev](https://twitter.com/BradstonDev)
Dev.to: @BradstonDev 
Youtube: [Bradston YT](https://www.youtube.com/channel/UC6Ky8s71RP65akLb_XV1_OA)