teleren/devto huggingface dataset:
What in the CRUD?
Tags: rails, mvc, beginners, database
Published: 2022-03-12 03:18:45

The title is also what I would be swearing under my breath when I couldn’t get a CRUD function to work.

What are CRUD functions? When do we utilize them? How do we make them work? 

In this blog, I go back to the basics and try to answer all these questions about what CRUD is. 

![Oh CRUD!](https://media.giphy.com/media/l3V0mgFspVuDAJK9y/giphy.gif)

###So, what is CRUD?

CRUD stands for: 
- Create
- Read 
- Update
- Delete 

According to [Sumologic](https://www.sumologic.com/glossary/crud/)'s glossary, CRUD refers to an acronym that refers to the four functions mentioned above, that are necessary to implement a persistent storage application. 

Referring to the example in Altvater, A.'s article in [Stackify by Netreo](https://stackify.com/what-are-crud-operations/), **Create** performs the `INSERT` statement to create a new record. While **Read**, `SELECT`s the table's records based on the primary keynoted within the input parameter. **Update** executes an `UPDATE` statement on the table based on the specified primary key for a record within the `WHERE` clause of the statement. **DELETE**, `DELETE`s a specified row in the `WHERE` clause. 

In addition, each letter in CRUD can also be mapped to an HTTP protocol method, where: 
CREATE = POST
READ = GET
UPDATE = PUT 
DELETE = DELETE 

###Why is CRUD important? 

Can you recall any of these functions you used in your projects? Did you need all of them, or just one? What's the significance of each depending on what you want to do in your app? Just in case you need a refresher, here's a quick tutorial by Johnson, J. of BudiBase on "[How to Build a CRUD Application](https://www.youtube.com/watch?v=DsBudu6Kzls)". 

CRUD operations are essential for both developers and end-users as it provides security control, for one. With this in mind, it is more performant versus SQL statements. Unquestionably, it's tried and tested, as it's a recognized pattern and recognizable by most developers. 

###Conclusion 
I hope this was a comprehensive resource to better understand what CRUD is, and you can better implement it in your future projects!  

![Get set, get ready, CODE!](https://media.giphy.com/media/Dk57URqjqjHjNGHeMV/giphy.gif)
Pages are like notebooks
Published: 2022-03-11 23:05:39

# The Idea

I've for a while have been tinkering with what I think JavaScript'ers have been missing - namely a way to make Jupyter-like notebooks!

So I started building. Actually been on this since November 12th - so about a month. Lot's of stuff is going to happen still!

## The past

Back on the 12th of November it couldn't do much, in fact you were only able to build a page using the source code!

This couldn't spark much joy to any people, so that brings us to the present. 

## The present

Now you are able to build pages as your heart desires! still missing some documentation on how to use the page-builder, but it's definitely a step in the right direction!

## The future

No one knows what the future will bring, not even me for this project! What I do know, though, is that there wil have to be some docs upon how to use the scripting of the pages. Hopefully also a more intuitive way to use the page builder and so on.

I'd love to get some way to work on a saved notebook again, as for now it is not possible to get working on an old saved notebook, which is quite a shame! 

# The page itself

The notebooks are easily managed by a notion-esque idea-inspired way to build a page - in this case, a notebook.

You start with mostly nothing, then add along all the fields you'd possibly need for a long coding experiment.

It all starts with a box - a magic box one might say. This box allows you to add any element you'd like.

For now though, there are four elements to choose from:

 * Header - A header element
 * Text - A text-area element
 * Code - The snippets to run and global to run from
 * Comment - A super simple comment - for less text that Text, but not quite a heading

Checkout the [/page](https://hasty.dev/page) to get a taste off all the elements. It'll show off all of the elements!

# The End

Thanks for reading! 

By now you must be super excited to get the pages - notbooks - a try! You without further ado, [hasty.dev/page](https://hasty.dev/page) and a demo is also available on [hasty.dev/page/demo](https://hasty.dev/page/demo) 🥰

Pst. There's also a shortcut to get a compelely clean slate by navigating to [hasty.dev/page/new](https://hasty.dev/page/new) 💡
Should we use CDN to load JavaScript plugins?
Tags: javascript, webdev, beginners, html
Published: 2022-03-12 03:18:43

Yes! It's much faster than getting the files from your server.

To enhance loading speed, I learned that reducing the amount of HTTP requests is preferable. So, I grabbed a number of JavaScript plugins, including Bootstrap and GSAP, and integrated them into a single huge file. However, loading the JavaScript file on a live server took roughly 10 seconds 😥.

I examined the Network tab, and caching does not appear to be working. So I changed my strategy and started using CDN for JavaScript plugins, and the page loaded in only a few seconds.

Although the performance will vary depending on your server's specifications and settings, I advocate using CDN to load JavaScript plugins because they are automatically cached and will not be downloaded again when users reload the same page or visit other pages.
Fun with JavaScript Arrays
Tags: javascript, typescript, webdev
Published: 2022-03-12 02:57:10

I don’t often see other developers on my team exploiting the abilities of Arrays in JavaScript.  Here are some fun tricks I often use.

## Better Conditionals

Its pretty common that I end up needing to write some code to quickly check if some condition is satisfied.


### Using Arrays for better re-use and readability.

Often times I’ll see code to check for some condition written in the style below.
```javascript

// standard way with chained OR
function isSupported(type) {
  return type === ‘heavy’ ||
    type === ‘light’ ||
    type === ‘thick’ ||
    type === ‘rich’;
}

```


```javascript
// this can be reused for other purposes
// also easily editable and understandable
const supportedTypes = [
  ‘heavy’,
  ‘light’,
  ‘thick’,
  ‘rich’
];

// rather than hard coding an if statement 
// or chaining else, we use a list.
function isSupportedType(type) {
  return supportedTypes.includes(type);
} 

```

### Using a list to make sure conditions pass
In the example below we can use JavaScripts reduce function to test some variable.

This example makes sure all conditions pass, but can be easily updated to test for at least one condition passing.


```javascript

// we can define all the criteria we want to pass
// as an array of functions which return true or false 
const conditions = [
  (number) => number > 0,
  (number) => number % 2 === 0
];


function test(num) {
  // use the reduce function to iterate
  // through the conditions we want to test
  return conditions.reduce((pass, conditionFn) =>
    pass && conditionFn(num), true);
}
```

## Rest Parameters
Somewhat related, it’s sometimes nice to create a function that can deal with an arbitrary amount of arguments.

```javascript
// use the rest operator to collect 
// all parameters to an Array
function logItem(…items) {
   items.forEach(item => 
    console.log(item);
}

logItem(1); // like most people expect
logItem(1, 2); // or call with arbitrary num of arguments 

const items = [1, 2, 3];
logItem(…items); // or even use an array with the spread operator

```
Slot Joker Terbaru
Published: 2022-03-12 02:24:10

## Slotvava Situs Slot Joker


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0uyhb3fqtl40jf8rxex5.jpg)
Slotvava adalah [**_situs slot joker_**](https://www.bisamurah.com) terbaru yang menyediakan [**_promo slot joker_**](bisamurah.com) untuk semua new member 100% hanya syarat TO 3x cukup deposit idr.25k maka sobat mendapatkan bonus di depan.

[**_Slotvava_**](https://www.bisamurah.com) slot joker juga memeberikan metode pembayaran dengan via pulsa tanpa ada potongan.

Metode pembayaran

- Bank Bri
- Bank BCA
- Bank BNI
- Bank Mandiri
- Bank Permata
- DANA
- OVO
- Gopay
- Linkaja
- Telkomsel
- XL

Info detail: [Promo Slot Joker](https://www.bisamurah.com)
Artikel: [jokervava](https://www.jokervava.com)
source: [Game Bintang](https://www.gamebintang.com)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7qwcon3xcnnmhw0nwoxw.jpg)
The truth behind online Courses
Tags: course, javascript, webdev, beginners
Published: 2022-03-12 02:15:14

This is not going to be an article , i will just put down some facts in case you are getting it wrong: 

1-First : A documentation is written about something . 

2-Second : Some people read Documentations and Write books . 

3-Some other people read  those books and make the screencasts [ the video Courses ] for you !

Those courses people mostly make their living from courses making , not from real programming.
And there is no such a "Guru" who do all those projects and master all those things , it is a copy/paste mastery .

Unlike Writing books (Which means and leads to some good traits in a person like being precise and patient) recording a device's screen requires NOTHING and anyone who understands nothing can create a Course to be youtube guru ! 

In any course , keep in your mind always the (Context of a Job Or interview ) or simply your goal  . If you learn for example "git" i think you don't need more than some little commands . 

Once you finish a Course in any field (programming or digital marketing or whatever ) try to make something real and you will hit the real world problems , the earlier you do that the earlier you will get rid of online courses addiction .
Tips To be a Better Programmer
Tags: programming, programmer, codin, webdev
Published: 2022-03-12 00:26:31

In my option to be a good programmer you should follow these tips :

1. Check Your Code First Before Looking to Blame Others
2. Continuous Learning
3. Don't Be Afraid to Break Things
4. Take Advantage of Code Analysis Tools
5. Think carefully before you choose your first language
6. If you're a freelancer, learn to say no, even to money
7. Stay in control of the testing process
8. Never ever duplicate code
9. Don't rush the solution out the door
10. Test and test your finished code
11. Code review
12. Write less code
13. Write self-documenting code

You can find more tips and ways to be a good programmer but for me if you follow these ones, I m sure you ll be a great programmer

You won't - you cannot - become a better programmer through sheer force of programming alone. You can only complement and enhance your existing programming skills by branching out. Learn about your users. Learn about the industry. Learn about your business.

The more things you are interested in, the better your work will be.

Can be found on [Techwebies](https://www.techwebies.com/2020/08/31/tips-to-be-a-better-programmer/)
Threat Modelling Simplified
Tags: devops, security
Published: 2022-03-12 00:22:12

<u>Threat Modelling is a structured approach to identify threats and their impact to the systems in terms of business loss.</u>As part of Threat Modelling `System Owners` identify various risks/threats and implement mitigation plans.

In this post we will try to understand Threat Modelling terminologies.
![Threat-Modelling](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/59pszj503iu0y249ki7p.jpg)

**Threat Agents**
These are the individuals or group of users trying to gain access to the system either by stealing identity of the legitimate users or by tricking the system to believe that they are the real users.It can be determined if `Threat Agent` is a small group or an organisation depending on the size of the threat and possible gains of exploitation.Very sensitive part of the systems should not be easily accessible to `anyone` and must have multiple layers of security and user verification mechanisms.

**Trust Zones**
Different parts of system generates or stores different kinds of data with varied levels of sensitivity.For example, data  stored in Database is used by applications and is highly trusted hence usually there is no need for additional validation to be performed at the time of usage.If the Database is compromised then there will be a `Very High Impact` on the application.

**Impact**
It is a quantification of potential loss in terms of reputation, finances and user trust.Determining the impact of  each possible threat will help the system owners to implement appropriate controls.

**Controls**
These are the countermeasures put in place to prevent, detect  or mitigate the threats.

- `Preventive Controls` totally avoids the threat
- `Detective Controls` observes the running system and determine existence of the threat
- `Mitigations` are the measures put in place to drastically reduce the `likelihood` of threat occurrence.

**Likelihood**
Possibility of the threat occurrence depends on how much infrastructure attacker will need to put in place to exploit the system and possible rewards out it.`Threat Intelligence` available from study of similar systems can also help to determine `likelihood` and appropriate `controls`.

**Threat Mapping**
It is a process to map different paths attacker will follow to take advantage of the <u>missing</u> `controls`.`Data Flow Diagrams` is the best way to determine how `bad actors` can move from one component to another and eventually reach to the most sensitive part of the systems where they can cause maximum damage.Understanding of the system from multiple view points (https://en.wikipedia.org/wiki/4%2B1_architectural_view_model) helps in effective `Threat mapping`.

**Asset Identification**
`System Owners` should have real time tracking of the assets.Any unauthorised addition or removal of the asset could be a possible active threat to the system.

These are the <u>basic Threat Modelling terminologies</u> that every _developer_, _architect_ or _system designer_ should understand to build secure systems and effectively apply _Threat Modelling methodologies_.
Day 548 : The Train
Tags: hiphop, code, coding, lifelongdev
Published: 2022-03-12 00:10:12

_liner notes_:
- Professional : Finally got all the hotels booked for my trip in a couple of weeks. Couple of weeks?! Can't believe it's happening. I'm trying to make the most out of the experience and opportunity. Had some issues with the booking site, but maybe a lot of people were trying to use it at once because everything was fine a couple of hours later. I tried to get hotels that were close to stations so I can get off the train and it's a short walk to the hotel. No need for taxis, ride shares or worry about traffic. I was also able to book the conference hotel which isn't too far from the station. I did SOOO MUCH research and reading reviews and plotting locations on the maps. The day flew by!

- Personal : Last night, I got the contest section working to show up on the overlay site. Did some styling and even added some confetti when the winner is announced. Then I went to bed after watching an episode of Atlanta. I got up early in the morning and working on the section in the dashboard that sets the timer that will start the countdown for different modes.

![Looking down from above at a waterfall with curved mountain walls in Kerepakupai Meru, Venezuela with a very green valley.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ry2ab5gu175j3pqav4y7.jpg)

Going to get the countdown timer working on the front end. Do a quick outro screen. I want to get the site at least working so I can do some livestream tests to get a routine going this weekend so I can deploy it and start promoting the trip next week. I think I don't have too much left to do for the radio show tomorrow because I'm ahead on prepping tracks. Going to get working.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube _CLaM6M_Awo %}
How Not To Measure Time in Programming
Tags: node, javascript, monitoring, performance
Published: 2022-03-14 20:12:25

---
title: How Not To Measure Time in Programming
published: true
date: 2022-03-12 00:02:54 UTC
tags: nodejs,javascript,monitoring,performance
canonical_url: https://blog.insiderattack.net/how-not-to-measure-time-in-programming-11089d546180
---

> a.k.a. how the likes of Date.now() will ruin your metrics.

[![](https://cdn-images-1.medium.com/max/2600/1*i2YWFiBfzqKfmo_k3V8RxQ.jpeg)](https://blog.insiderattack.net/how-not-to-measure-time-in-programming-11089d546180?source=rss----57f0c4748c10---4)

If you fly between two airports that are in two different time zones, would you calculate the time it took for you to fly, by checking the difference between the ‘wall clock’ times of either airport?

If your answer is ‘no’, then let me explain why you shouldn’t do the same in your code, using a little but a very interesting experiment.

[Continue reading on Deepal’s Blog »](https://blog.insiderattack.net/how-not-to-measure-time-in-programming-11089d546180?source=rss----57f0c4748c10---4)
Apple Event Recap
Tags: apple, techtalks, ios
Published: 2022-03-12 00:01:31

Hello fellow tech nerds, I know this recap is very late, but for those of you who didn't hear, Apple held their first event of the year on the 8th of March. This event was a hardware focused event and therefore no software was unveiled.

The first announcements of the event were about Apple TV. Apple just showcased their exclusive movies and exclusive streaming of baseball. Then they moved on to their mid-year refresh of the iPhone lineup. They released two new colours for the regular and pro lineup. The iPhone 13 in 'Green' and the iPhone 13 Pro in 'Alpine Green'.
![iPhone 13 in Green](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7sfiebevnq0w0is8940h.jpg)
 


Next Apple announced a refresh to the iPhone SE. Apple entered this budget category a couple years ago, and I think they did a fantastic job with their iPhone SE (2nd Generation). From the chip to the camera. The only problem this iPhone SE had was the battery life. You would be lucky to be getting 4 hours of screentime on that phone. This year Apple included their flagship level chip and made improvements to the battery and build quality. Now the iPhone SE is a full glass phone. On paper, this phone looks like an amazing budget phone that will get many software updates to come. But we will have to wait for the reviews to start rolling out. Note: apple did bump the price up by $29 USD from $399 to $429.
![iPhone SE Lineup](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3d6q53t750iikf9mdc8p.jpg)
 

Now, the next products that Apple unveiled were the real meat of the presentation. They introduced a new chip, M1 Ultra. Essentially this chip is two M1 Maxes fused together using what they called 'Ultra Fusion'. This new chip gives you 20 CPU cores and 64 GPU cores with 128 GB of unified memory. Now this begs the question, what device is going to use this chip? The answer to that is Mac Studio. A new desktop computer for studios and professionals. With the Mac Studio, they also unveiled a Studio Monitor. This studio monitor packs in a 5K Retina display, P3 colour, 12MP Ultra Wide camera, High-fidelity six-speaker system, studio quality mics and an A13 Bionic Chip. With the new addition of this A13 chip, this monitor on paper is more powerful than most phones on the market right now.
![Mac Studio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pt0shzflreeig329h187.jpg)
 

While all this does sound good, Apple is going to charge you from $1599 USD for the Studio display and $1999 USD for the Mac Studio. For all this Mac does pack in, this price seems somewhat okay. Let me know what you think in the comments.

Thanks for reading!
Phase 1 Project
Published: 2022-03-11 23:27:07

Just finished and turned in my first ever app created with HTML, CSS and JaveScript. I decided to make a weather map and boy was it fun, but stressful! My app is very simple and straight-forward; it asks the user/visitor to input any city, then return said city's current temperature and outside look. It also will only return something if a city is entered, anything else is thrown into oblivion. Then underneath the city prompt, you will find a comment section, which is completely optional. If the user would like, they can type long or short comments about the weather or their thoughts. Then, if they decide they no longer like or want the comment they can delete it by simple clicking on unwanted comments. A final feature of my weather app is that every time the page is reloaded the background image is updated. So if you don't like the current picture just reload it as many times until you are satisfied. Just be warned that if you reload the page of your favorite background image, then it will be changed, but not lost. In the end I am relieved to have completed my first ever coding project! It was a blast and cannot wait to do more:)

https://github.com/RainbowLex/phase-1-weather-project
Feel free to check it out!!
gm. first timer.
Tags: beginners, programming, web3, devjournal
Published: 2022-03-11 22:28:07

I never heard of this website before this week. Currently, I am taking a course on Udemy to learn Solidity and to build NFT marketplaces as a start to my portfolio. After just a brief glance and scroll of this site, I quickly realized that being a part of this community and becoming a contributor would help me on my journey to becoming a developer. One of my activities here is to not only be someone who takes information and value but also shares it and provides it to others. 

My name is Manny. I am on my way to becoming a Web3 developer. 

Nice to meet you.