teleren/devto huggingface dataset:
Just getting started...
Tags: flatiron, javascript, beginners, codenewbie
Published: 2021-12-16 14:33:44

i've survived my first 3 days of flatiron school's software engineering live program. the analogy that is commonly used to describe the pace is: "like drinking from a firehose".

AGREED! to further that water analogy, i feel like i'm just treading water as more water is dumped on me. i'm looking forward to swimming!

my mind is honestly spinning a bit from all the new information, and keeping track of all the little built-in javascript syntaxes. 

i really appreciate that javascript, html, ruby, etc. are all referred to as languages. that comparison becomes more and more apt each day.

growth only happens when uncomfortable. there's a LOT of discomfort right now. i have to stay grounded and consistent in things that are in my control and are comfortable, which right now is making sure i wake up early to walk our dog, reece (which is my morning moving meditation in the park, assuming reece isn't in her occasionally frenzied foraging mode), strength training, or yoga. 

i'm feeling grounded by my weekly wednesday workout that is only ground-to-standing exercises, the OG greatest exercise there is: turkish get ups!

well back to the firehose! time to swim like a dolphin.

<img src="https://media0.giphy.com/media/AZcYQr9FMKypW/giphy.gif">
1 line of code: How to convert html special chars
Tags: javascript, webdev, productivity, codequality
Published: 2021-12-16 15:38:47

```javascript
const htmlSpecialChars = str => str.replace(/[&"'<>]/g, (i) => ({ "&": "&amp;", '"': "&quot;", "'": "&#039;", "<": "&lt;", ">": "&gt;" }[i]));
```
---
Returns a new string where all HTML special characters are converted to HTML entities.

---

Certain characters have special significance in HTML, and should be represented by HTML entities if they are to preserve their meanings.
Based on [PHP: htmlspecialchars](https://www.php.net/manual/en/function.htmlspecialchars.php)
 
---

## The repository & npm package

You can find the all the utility functions from this series at [github.com/martinkr/onelinecode](https://github.com/martinkr/onelinecode)
The library is also published to [npm as @onelinecode](https://www.npmjs.com/package/@onelinecode/onelinecode) for your convenience.

The code and the npm package will be updated every time I publish a new article.

---

Follow me on [Twitter: @martinkr](http://twitter.com/_martinkr) and consider to [buy me a coffee](https://www.buymeacoffee.com/martinkr)

Photo by [zoo_monkey](https://unsplash.com/@zoo_monkey) on [Unsplash](https://unsplash.com/s/photos/fuji)

---

[![Subscribe to the weekly modern frontend development newsletter](https://modernfrontend.dev/banner/banner_583-111.png)](https://modernfrontend.dev/)

---
If you're going to use a poor commit message, just git rebase -i instead
Tags: git, beginners, programming, productivity
Published: 2021-12-16 15:32:16

## We've all been there.

Panic commits. You've spent HOURS on a problem only to solve it at the end of your day. The end of your sanity.

You know you want to save your work and commit it, but you've done so much brain-mashing that the eloquent commit message you had hours ago is lost to a sea of fog and quick-hacks.

> it works.

Before you push, let's take a beat here.

Maybe you are trying some things and a rapid commit-cycle is more your style. You are a _git-slinger_. Pew pew pew!

You arrive at the same destination as above.  Before you push, let's take a moment to reflect on your last N commits.

```
git commit rebase -i HEAD~{{number of commits you've done}}
```

[As you know](https://dev.to/sublimegeek/do-your-commits-pass-this-simple-test-4ak2), I'm **vehemently against** rebasing **public** commits, but if it hasn't been pushed yet, the world is your oyster.

So, a `rebase` stacks the group of commits on top of your new "base" point, in which case, it's the commit you chose above.

`HEAD` is the _latest_ commit and the number of commits before that selects the right ancestor.  I know, it's some Marty McFly shit.

An interactive rebase gives you the ability to squash commits into each other (basically summating the changes into a single commit), reorder them, change their commit messages, and many more options.

In short, you can clean up that disaster you committed trying to solve that one thing by that one date.

Let me close by saying this one important thing:

> Be careful.

**Rebasing** rewrites your git history.  You can lose work if you aren't careful.  When in doubt, just squash all of your commits instead of removing or reordering them until you get more comfortable with the operation.

For more about rebasing, check out:
- https://git-scm.com/docs/git-rebase

If you like my git posts, check out https://dev.to/sublimegeek/git-staging-area-explained-like-im-five-1anh
TOR🧅- Stay Anonymous In Internet
Tags: cybersecurity, tor, security, beginners
Published: 2021-12-16 15:30:12


## Why Tor?
Have you ever wondered when you search for some product like let's say a **Mobile Phone** and Facebook, Google And Many others show you the ads relevant to your search? So, it means these big tech giants have an eye on our searches right? So the solution is to use Tor which makes you anonymous on the internet by routing your traffic via multiple servers around the world. So the end website that you visit will not get to know what is your original IP address.

## Small History On Tor
The Tor Project was launched in 2002 and its main technology was developed by the US Navy and was mostly funded by the government.

> "We were increasingly concerned about all these websites - in the 2000/01 dotcom bubble, everyone was offering free services, and by free they meant 'we take all your information and sell it as many times as possible',"
Said the executive director Andrew Lewman to the Guardian in April 2012

## What does Tor Do?
Tor directs your traffic through a free, worldwide volunteer overlay network, consisting of more than six thousand relays, for concealing a user's location and usage from anyone conducting network surveillance or traffic analysis. Using Tor makes it more difficult to trace the Internet activity to the user. Tor's intended use is to protect the personal privacy of its users, as well as their freedom and ability to conduct confidential communication by keeping their Internet activities unmonitored.

## How can Tor Help You?
The Tor project team says that it's users fall into the following categories

![How_Tor_Works_1](https://upload.wikimedia.org/wikipedia/commons/6/67/How_Tor_Works_1.svg)
> Image By Electronic Frontier Foundation, [CC](https://creativecommons.org/licenses/by/3.0) BY 3.0, via Wikimedia Commons

- Normal people who want to keep their internet activities private from websites and advertisers those concerned about cyberspying 

![How_Tor_Works_2](https://upload.wikimedia.org/wikipedia/commons/1/16/How_Tor_Works_2.svg)
> Image By Electronic Frontier Foundation, [CC](https://creativecommons.org/licenses/by/3.0) BY 3.0, via Wikimedia Commons

- For Intermediate users, it could mean running Tor so that your children's location can't be identified when they are online, or could mean a political activist in China, Russia or Syria could protect their identity.

![How_Tor_Works_3](https://upload.wikimedia.org/wikipedia/commons/a/a1/How_Tor_Works_3.svg)
> Image By Electronic Frontier Foundation, [CC](https://creativecommons.org/licenses/by/3.0) BY 3.0, via Wikimedia Commons

## Conclusion
- Is TOR Better Than VPN? In short, Yes because it routes your network traffic through multiple Nodes
- Stay tuned for a post on Tor vs VPN
- Thanks For Reading 🙂

## Video Reference
{% youtube pBYbfHq3iQ0 %}
Day 92/100 Text Readability
Tags: 100daysofcode, programming, design, motivation
Published: 2021-12-16 14:37:50

Improving the readability of an article would make the user's interest to keep reading and encourage to spend longer time to value the contents and establish a sense of empowerment to deliver the emotions and facts about the motivations of creativity.

![banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oqyyzhaka9522prjz2je.png)

## Adjust whitespace within the text:

**Line Spacing**

- Line spacing, also known as Leading, refers to the distance between two lines of text. Adjusting this value has a huge impact on the legibility of your site.

**Tracking**

- Similar to kerning, a way to make your text more readable is to adjust the tracking of the letters. Tracking is the space between the letters and the words. If you have too little tracking, the words will appear cramped, so by increasing tracking slightly, you make your text significantly more legible.

**Kerning**

- Kerning is the space between two letters in the text. You
typically will not need to worry about kerning because a well-designed typeface already has optimal kerning built in. It is most important when you want to adjust the kerning in a title or header to achieve the design you want.

## Code Snippets

```
var num = 99;

while (num >=1) {
// Last iteration. Note occurances of bottle, bottle, bottleS
if (num === 1) {
   console.log(num + " bottle of juice on the wall! "
            + num + " bottle of juice! Take one down, pass it around... " + (num-1) + " bottles of juice on the wall!");
}
// Second-last iteration. Note occurances of bottleS, bottleS, bottle
else if (num === 2){
         console.log(num + " bottles of juice on the wall! "
         + num + " bottles of juice! Take one down, pass it around... " + (num-1) + " bottle of juice on the wall!");
}
// All other iterations. Note occurances of bottleS, bottleS, bottleS
else {
     console.log(num + " bottles of juice on the wall! "
     + num + " bottles of juice! Take one down, pass it around... " + (num-1) + " bottles of juice on the wall!");
}

num = num - 1;
```

## Summary

I didn't realize having this challenge made me spontaneous in making plans. I started to realize that even if I'm submitting short useful blogs, somehow the most important thing is that I'm learning something.

[![resource](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqqygs8z5cal87i6lzc6.png)](https://www.thoughtworks.com/insights/blog/no-estimates-not-only-answer-or-moving-towards-predictability)
GraphQL vs REST: a response time performance comparison
Tags: graphql, nestjs, rest, api
Published: 2021-12-16 14:23:47

After creating a GraphQL API in a NestJS project with TypeORM, I've been trying my hardest to avoid adding REST API endpoints.  Once I started implementing some basic auth via JWT's (w/access tokens & refresh tokens), I wondered why it's not common to use GraphQL mutations for this purpose...

I tried making everything the same, including the length of names for each endpoint/query.  Here are my results:

**Note: all GraphQL requests (queries and mutations) are POST requests.

API | Type | Avg Response Time | Sample Response Times
---|---|---|---
REST | GET | 0.329s | 0.280s, 0.261s, 0.316s, 0.472s, 0.314s
REST | POST | 0.561s | 0.690s, 0.454s, 0.479s, 0.814s, 0.369s
GraphQL | Query | 0.795s | 0.735s, 0.717s, 0.716s, 1.133s, 0.674s
GraphQL | Mutation | 0.711s| 0.713s, 0.753s, 0.684s, 0.703s, 0.700s
recursion in typescript
Tags: javascript, typescript, functional, programming
Published: 2021-12-16 14:10:25

One word, 'trampoline'.

*Sometimes you just come across something brilliant and wonder 
"why did I not think of that?". Such discoveries humble you but also if you are like me, makes you realize you need to think out of the box next time. "Out of the box" here just means think fresh. Because when you are stuck with a problem, the last thing you need to do is trying to solve it the same way again.*

So I am getting deep into functional programming. I am having blast. Been a while since I had so much fun coding. But I had a problem. I cannot do recursive functions. I know how to do them, but typescript complains that the function refers to itself.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ekbeqs17smamxq6wqtlf.png)
So at first I was like ha, must be a limitation of typescript because you can do this in javascript without any problems right? Ah javascript you got my again, with your smooth talking lies.
Nope, I suddenly realized what the word 'stackoverflow' meant. In brief, when you call a function, that function creates a 'stack'. It is memory where the parameters and some other stuff live until the function finishes execution. But when you call the function recursively the stack just blows up after a number of recursions, causing a runtime error.
![screenshot showing the error](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7i08yc6shl7pi8q38phj.png)
 
I tried a few ways to create a workaround, but none worked in a way I wanted or at all.

But recently when I was not even looking for this I came across a technique called 'trampoline'.

Here's the implementation I found: [source](https://blog.logrocket.com/using-trampolines-to-manage-large-recursive-loops-in-javascript-d8c9db095ae3/)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cvfw38zuow2zzx83cj2u.png)
I made some modifications, because why not XD.
![article on trampolines by Benjamin Johnson](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4n2tozt2w5um434bglbd.png)
 
I made the modifications because, (nothing against the source, its a great example to explain the concept)
1. what if the function we are creating returns a function by design? that will break this code.
2. the usage of it "trampoline(someFunction)", implies you can do this with just about any function, but that is not how it works.

So with my modifications this is how a recursive function is defined, (there might be a better way, but its best I could create right now)
 ![screen shot of my implementation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kstcckuzsv2pzwuvb38a.png)

I already have a couple of changes I might want to do to this, but I am so glad that I came across this concept that I just wanted write down my thoughts in the post. Maybe someone else who never knew this found it through me. That would be my pleasure !
Interval Partitioning
Tags: intervalpartitioning, algorithms, greedyalgorithms, algo
Published: 2021-12-16 14:08:47

When data put into a table surpasses all of the existing range partitions. Interval partitioning is an extension of range partitioning that directs the database to automatically build segments of a defined interval. At least one range division must be specified. For Definition and more visit HERE

Example
There are 10 Lectures, each with a fixed start time and end time. Each Lecture needs a lecture Hall. There can be only one lecture in one lecture hall at the same time. You have to find the minimum number of lecture halls needed for scheduling all lectures.

To read more visit : https://hecodesit.com/interval-partitioning/
What is Spring Boot
Tags: java, programming, tutorial, springboot
Published: 2021-12-16 14:00:05

Many tech tutors have in their best explained what Spring Boot is. Having read their articles, I have come up with a clear view of what spring boot is all about. This article will benefit both newbies and intermediate developers who want to venture deep into this beautiful spring module.
Spring Boot is a project built on a spring framework that eliminates the boilerplate configurations required for setting up a Spring application. 
Spring Boot is the combination of Spring Framework and Embedded Servers. 
XML configuration is not required (deployment descriptor). Its ability to use convention over configuration software design patterns decreases the workload on the developer.
Developers can use Spring STS IDE or Spring Initializr to develop Spring Boot Java applications.
Parts of a Grinder
Published: 2021-12-16 13:52:17

[Parts of a Grinder](https://mechanicaljungle.com/parts-and-functions-of-grinding-machine/) are as follows.
- Base.
- Table.
- Segment.
- Grating Wheel.
- Wheel Guard.
- Grating Wheel Head.
- Three Types of Traversing Wheels.
- Coolant Supply Nozzle.

#1. Base-

The base is under most of the grinding machine. It is typically made of solid metal. This guides the remainder of the grinding machine.

#2.Table-

The table is loose at the base. This is the place where the workpiece is set and appropriately positioned for grinding. It can move evenly left and right utilizing a crossing wheel known as a hand navigating wheel.

#3.Column-

It is an upward segment where the grating wheel, wheel head, and wheel watch are put.

#4. Rough Wheel-

It is the primary wheel that turns and eliminates the material from the outer layer of the workpiece and makes it smooth. This wheel is covered with scraped spot and permits the material to be taken out effectively from the outer layer of the workpiece.

#5. Wheel Guard-

It is a front of a grating wheel or grinding wheel which ensures the specialist in a mishap—grinding machine parts and capacities.

#6. Grating Wheel Head-

It is a compartment that is gone up or down utilizing a crossing wheel called an upward feed handwheel. We push this wheel head forward so the grinding wheel contacts the workpiece.

#7. Three Types of Traversing Wheels-

Hand navigating wheel: – This crossings wheel is utilized to move the table, and it is left evenly to oblige the workpiece with the grinding wheel.
Cross-side handwheel: – This navigating wheel is utilized to move the work table in the forward and reverse way to connect between the workpiece and the grinding wheel.
Vertical feed handwheel: – This navigating wheel is utilized to move the wheel head in vertical all over bearing. These three wheels are utilized to change the places of the workpiece and the grinding wheel so these two connect with one another.

#8. Coolant Supply Nozzle-

The coolant supply spout is utilized to embed the spout into the grinding machine, which cools the workspace so that hotness isn't disintegrated into the workpiece and the grating wheel.
A huge update of UniDAC, PgDAC, and dbExpress with PostgreSQL 14 Support
Tags: dbexpress, pgdac, unidac
Published: 2021-12-16 13:05:20

---
title: A huge update of UniDAC, PgDAC, and dbExpress with PostgreSQL 14 Support 
published: true
description: Devart announced new versions of UniDAC, PgDAC, and dbExpress with the support for PostgreSQL 14
tags: dbexpress, pgdac, unidac
//cover_image: https://direct_url_to_image.jpg
---
Devart, a recognized vendor of world-class data connectivity solutions for various data connection technologies and frameworks, presented new releases of the products with  **PostgreSQL 14 support**. Now, the users can download [UniDAC 9.1](https://www.devart.com/unidac/?utm_source=devto&utm_medium=referral&utm_campaign=pr_dac_express_16.12.2021), [PgDAC 7.1](https://www.devart.com/pgdac/?utm_source=devto&utm_medium=referral&utm_campaign=pr_dac_express_16.12.2021) new versions. 

Also, it was released the [dbExpress Driver 5.1 for PostgreSQL](https://www.devart.com/dbx/postgresql/?utm_source=devto&utm_medium=referral&utm_campaign=pr_dac_express_16.12.2021) with the support of OUT parameters in stored procedures and [dbExpress Driver 9.1 for SQL Server](https://www.devart.com/dbx/sqlserver/?utm_source=devto&utm_medium=referral&utm_campaign=pr_dac_express_16.12.2021) with MARS and Snapshot Transactions support.

**The list of improvements includes:**
- UniDAC and PgDAC support the new option - the PoolID connection.
- The WireCompression option for the Connection component is available for the InterBase data provider.
- NexusDB provider has block fetch support and better fetch performance. 
- The FSIZE SQL function and Autoinc data type for Visual FoxPro tables are available in the DBF data provider. 

To learn more about the recent release and download new products, visit: 
https://blog.devart.com/new-versions-of-unidac-pgdac-and-dbexpress-support-postgresql-14.html

**UniDAC** - a universal tool for Delphi developers with access to various databases and clouds for building high-performance applications for desktop and mobile platforms.

**PgDAC** combines components focused on providing direct access to PostgreSQL server when working with Delphi, C++Builder and Lazarus (and Free Pascal) via TCP/IP without involving PostgreSQL Client.

**dbExpress** is a database-independent layer that defines common interface to provide fast access to SQL database servers from Delphi and C++Builder including Community Edition, on Windows and macOS (32-bit and 64-bit) and Linux (64-bit) platforms.

**About Devart** 
 
Devart is one of the leading developers of database tools and administration software, ALM solutions, data providers for various database servers, data integration, and backup solutions. The company also implements Web and Mobile development projects. 
For additional information about Devart, visit https://www.devart.com/.
Attention to Detail
Tags: webdev, productivity, writing
Published: 2021-12-02 02:23:17

It’s been quite an adventure so far at [Perpetual Education](perpetual.education). I appreciate many things about this mentorship and the help Derek is giving us, but for today I’d like to focus on details. That is, the importance of paying close attention to the details in coding and web development. Earlier in my **writing** series, I talked about writing as a way to avoid missing critical details. Think of this as a sort of extension of the prior.

###Avoid Overlooking the Little Things###

Part of the ongoing process at our mentorship is the creation of our portfolio. This could be in the form of a landing page, a multi-link site, etc. It’s up to us to use the tools Derek teaches us and craft something wonderful (and, of course, working together to bring it to life!).

When we’re excited to create a page that showcases what we’re capable of, it’s easy to want to move quickly toward the final product. This is where things can get sloppy if we act with haste rather than *precision*.

When writing your code, take your time and pay attention to the details! You might complete an HTML page only to find that you missed a closing tag somewhere along the way. 

###More Than One Pair of Eyes###

Of course, no one is perfect, so it helps to have someone look over your code even after you’ve examined it thoroughly. That second set of eyes doesn’t have to be human, either; run your code through a validator to see what can be fixed. Got it right the first time around? Great! Even if you didn’t, it’s OK! Let it be a reminder to keep an eye out for the little things on future projects.

Happy coding!

Andrew