teleren/devto huggingface dataset:
Do you know JavaScript?
Tags: webdev, javascript, beginners
Published: 2023-03-14 12:45:42

Do you know Javascript? The language we all love has some weird and sometimes unexpected behaviours.

It is a good idea to know them, mostly to avoid unexpected bugs and unpleasant surprises.

Do you want an example?

```js
const a = 0.1;
const b = 0.2;
const c = 0.3;

console.log(a + b === c); // false
```

The output here is `false`. The sum `0.1 + 0.2` is not equal to `0.3`.

Why does this happen? It's because of how floating point numbers are represented in JavaScript.

One more cool example:

```js
"2" + "3" === "23"; // true
```

This was expected, right? We're concatenating two strings. But what if we replace `+` with `*`?

```js
"2" * "3" === 6; // true
```

In this case, the `*` operator tried to convert the two strings in numbers, that's why we got `6`.

## The minigames

I've collected 12 situations like these and I will walk you through them in this video. I will also use the node REPL to further expand on some of them when the output is particularly weird.

{% youtube 8gGuu9c9miY %}

---

This video format is something I've had in mind for a while and I wanted to give it a try. To be honest I'm not too satisfied with the outcome, but I wanted to share it anyway to collect feedback and make even better versions in the future. I'd like to go with multiline code snippets and decide if keep the explanation or make it faster and more entertaining by skipping them. What do you think?

With that said, I hope you enjoyed it and learned something new! Please let me know if you have suggestions on how to improve the video, or if you have any other feedback in general.

---

Thanks for reading this article, I hope you found it interesting!

I recently launched my Discord server to talk about Open Source and Web Development, feel free to join: https://discord.gg/bqwyEa6We6

Do you like my content? You might consider subscribing to my YouTube channel! It means a lot to me ❤️
You can find it here:
[![YouTube](https://img.shields.io/badge/YouTube:%20Dev%20Leonardo-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/channel/UC-KqnO3ez7vF-kyIQ_22rdA?sub_confirmation=1)

Feel free to follow me to get notified when new articles are out ;)
{% embed https://dev.to/balastrong %}
What is github gist?
Published: 2023-03-14 12:34:28


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dm5dgc10p08d1m31daj7.png)
gist.github.com

GitHub Gist is a web-based service provided by GitHub that allows users to share and collaborate on code snippets, text, and other small files. Gists are similar to repositories in that they are hosted on GitHub and have version control features, but they are typically used for sharing and collaborating on small pieces of code or text.

Gists can be created either anonymously or with a GitHub account, and can be either public or private. Gists can also be embedded in web pages and shared via social media, email, or other means.

One of the most useful features of Gist is the ability to fork and clone Gists, just like repositories, making it easy to collaborate on code snippets with other developers. Gists also support syntax highlighting for many programming languages, making it easy to share code that is easy to read and understand.

example gist: https://gist.github.com/Sarvesh-Kesharwani/543234f952326efe286abd2e6fa134a6

Overall, GitHub Gist is a useful tool for developers who need to quickly share code snippets or collaborate on small pieces of code or text with others.
Tips and tricks for debugging and troubleshooting Angular applications
Tags: angular, webdev, api, app
Published: 2023-03-14 11:52:25

Debugging and troubleshooting are integral to the software development process, and Angular applications are no exception. Here are some tips and tricks for debugging and troubleshooting Angular applications:

**Use browser developer tools:** One of the most powerful tools for debugging Angular applications is the browser developer tool. You can use it to inspect the DOM elements, examine network traffic, and debug JavaScript code.

**Utilize the Angular CLI:** The Angular CLI provides a set of powerful debugging tools, including the ability to generate source maps, run the application in a development environment, and view debugging messages in the console.

**Check for console errors:** If your application is not working as expected, check the console for any error messages. Often, these error messages can provide valuable insights into what went wrong.

**Use the debugger:** A debugger is a powerful tool for stepping through your code and identifying where the problem lies. You can set breakpoints, examine variables, and trace the flow of your application.

**Use logging:** Adding logging statements to your code can help you identify where the problem lies. You can use the console.log() function or a more powerful logging library like Log4j.

**Use the ng serve --prod command:** Running your application in production mode can help you identify issues that may not be apparent in development mode.

**Use third-party debugging tools:** Several third-party tools can help you debug and troubleshoot your Angular application. These tools include Augury, Debug Angular, and ng-inspector.

**Review your code:** If all else fails, review your code line by line to identify where the problem lies. Often, a fresh pair of eyes can identify previously overlooked issues.

Debugging and troubleshooting Angular applications can be challenging, but by following these tips and tricks, you can identify and resolve issues quickly and efficiently.

Look no further if you're looking for a trusted partner to help you build your next Angular application. [Contact us today](www.aspiresoftserv.com) to schedule a consultation and learn more about how our Angular development services can help your business succeed.
How to Prepare for AWS EMP Tool (End-of-Support Migration Program)
Published: 2023-03-14 11:41:28


## How to Prepare for AWS EMP Tool (End-of-Support Migration Program)

The AWS End-of-Support Migration Program (EMP) for Windows Server provides the ability to capture and package a legacy application running on Windows 2003, 2008 and 2008 R2 and move to newer version of Windows running in AWS.

## Planning and Preparation:

· On source hardware Identify legacy application to be migrated.

· Document data files locations and folders

· Document IIS website to be migrated

· Created workflow and application use cases to be run while during capture package.

· On Target hardware ensure that correct Windows features and roles are installed.

· Create EMP role and assign to target EC2 instance

## Technical Considerations:

· IIS websites and applications must be running .Net 4.0 to be migrated

· Existing install for packaging and migration

· Reinstall application on legacy OS to package fresh

· Will require access to AWS ARN
oles during the deployment

· Windows services will need to be offline during packaging process

· EMP IIS Export Tool to export the current IIS configuration and websites.

· Database sizes will impact the packaging process

· Migrated Windows services will not exist with same names/directories as legacy system
Display (and edit!) signature from method screen
Tags: sap, abap, s4hana
Published: 2023-03-14 11:41:00

Hi there! 
How many of you have been writting some code in a method and suddenly realice you need to update the method’s signature?

Well, here you have a very useful way to update the parameters view from the methods view. 

Click F6 on your keyboard when you’re in the method’s et voilà! A fresh pop up will open with the info.
## How to Install AWS EMP Tool (End-of-Support Migration Program)
Published: 2023-03-14 11:40:44



How to install EMP tool on legacy Windows 2008 R2 VMware Instance

Download the EMP Tool MSI from AWS and execute.

![](https://cdn-images-1.medium.com/max/2000/1*ruPa8F7M7gtcrQNLcK6V9g.png)

Read, accept, and continue

![](https://cdn-images-1.medium.com/max/2000/1*dHsrvFpqGXkXnX5CvokrcA.png)

Choose installation directory

![](https://cdn-images-1.medium.com/max/2000/1*FHRWpIWbbC18QBnpDO20Zg.png)

Finish and open the installation directory

![](https://cdn-images-1.medium.com/max/2000/1*hDZn1OObpzMyaogDHbAGcw.png)

Install Applications will be available in Start Menu

![](https://cdn-images-1.medium.com/max/2000/1*24la49ezMBeSLc6NkXTQvw.png)

**EMP Guided Reverse Packaging (GRP) **is used to package an application when it’s installation media is not available. This involves packaging the application when the application was previously installed and running.

![](https://cdn-images-1.medium.com/max/2000/1*xPPI1TgWpJaYvOEXon_diQ.png)

**EMP Compatibility Package Builder **s used to package an application when it’s installation media is available. This involves packaging the application during the installation process on the legacy Windows Machine.

![](https://cdn-images-1.medium.com/max/2000/1*VsYL5X8kKQ3kSCKFlfZuvg.png)

Export-IISWebSiteWithDependentFeatures is used to gather all of the IIS configuration, application pools and data for websites located on the source machines. Located in “C:\Program Files (x86)\AWS\EMP\Tools\IISTools”\Export-IISWebSiteWithDependentFeatures.ps1

![](https://cdn-images-1.medium.com/max/2024/1*YERdGo7EbGFqwbThIUNiLA.png)
Python Programming Bootcamp #16 - Solutions for Queue, Stack, MasterMind
Tags: python, tutorial, beginners
Published: 2023-03-14 11:21:55

---
title: Python Programming Bootcamp #16 - Solutions for Queue, Stack, MasterMind
published: true
description: Solutions for exercises in the Python lists chapter
tags: python, tutorial, beginners
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-03-14 11:20 +0000
canonical_url: https://code-maven.com/programming-bootcamp-for-scientists-16
series: bootcamp
---

{% youtube 50BhcXHibCg %}

* 00:00 Nóra solving the exercises in the middle of the Lists chapter
* 01:00 Solution: Queue
* 07:10 Solution: Stack (Reverse Polish Calculator)
* 16:35 Solution: MasterMind
Making explicit what is Production ready and what is not
Tags: featureflag, css, frontend, dx
Published: 2023-03-14 11:21:25

Feature Flags let you control dynamically what code and behavior you show or hide per user, tenant or environment.

At Woovi we have a special Feature Flag name for features that are not ready for production, we called it `TEMP`.

## Making explicit what is Production ready and what is not

![Feature Flag](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i0bl1x83lxza6tncyhg8.png)

We decided to use a border `1px dashed red` around elements that are not Production ready

Here is the React code for this

```jsx
const FeatureTemp = ({ children, ...props }) => {
  const user = useFragment<FeatureTemp_user$key>(
    graphql`
      fragment FeatureTemp_user on User {
        roles
      }
    `,
    props.user,
  );

  const hasTemp = hasRoleTemp(user);

  if (!hasTemp) {
   return null;
  }

  return (
     <div style={{ border: '1px dashed red' }}
       {children}
     </div>
   )
};
```

Usage
```jsx
<FeatureTemp user={me}>
   <Button>Not in Production</Button>
</FeatureTemp>
```

The code above consumes the `roles` of a given user from our GraphQL server using Relay. We verify if the user has the role TEMP, if not we don't render the component, otherwise we render the component wrapped in a div with a border 1px dashed red.

## In Summary
This helped our Customer Success, Sales, Product managers teams to identify what is ready or not for production. We also uncover some code that were ready for production but were still behind a feature flag.

Feature flag is how we can have small pull requests, iterate faster without breaking things. It also enables us to test in production. We also use a BETA feature for customers that want to test new features before unroll to the whole customer base.


---
Woovi
[Woovi](https://www.woovi.com) is a Startup that enables shoppers to pay as they like. To make this possible, Woovi provides instant payment solutions for merchants to accept orders.

If you want to work with us, we are [hiring](https://woovi.com/jobs/)!

---
Photo by <a href="https://unsplash.com/es/@amayli?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Amélie Mourichon</a> on <a href="https://unsplash.com/s/photos/design-system?orientation=landscape&utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Share your work in progress in real time from VS Code or JetBrains
Tags: vscode, git, tutorial, productivity
Published: 2023-03-14 11:20:28

Need to ask a teammate for some help with your code, but don’t want to push broken changes to GitHub? GitLive has a solution 💡

**TLDR;**
{% embed https://www.youtube.com/shorts/d0etYtL81DY %}

*** 

1️⃣ Install the extension for [VS Code](https://marketplace.visualstudio.com/items?itemName=TeamHub.teamhub) or a [JetBrains IDE](https://plugins.jetbrains.com/plugin/11955-gitlive).


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h14xpt70gphhwea2iccg.png)

2️⃣ Then click on the sharing button and the _Live_ icon will appear next to your name.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vqmaae7wby3n3hm5edfr.png)


3️⃣ Now your local changes will be visible for your teammates.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dt5n7p0gu6el14cs3u81.png)

4️⃣ And they can click on the files to see the changes. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/07p91wyz3vdbbozergq4.png)

***

That's it for now, thanks for reading and let us know what you think in the comments!
Understanding HQL from Zero to Hero!
Published: 2023-03-14 11:03:46

### To Create data:

```java
String hql = "INSERT INTO Question(title, topic_id, answer) VALUES(:title, :topic_id, :answer)";
Query query = session.createQuery(hql);
query.setParameter("title", "What is life and universe?");
query.setParameter("topic_id", 42);
query.setParameter("answer", "Discovery");
int result = query.executeUpdate();
```

### To Read data:

1. To List data - as in multiple rows.

```java
String hql = "FROM Question WHERE topic_id > :topic_id";
Query query = session.createQuery(hql);
query.setParameter("topic_id", 42);
List<Question> questions = query.list();

```

Notice: `.list()`

Question object assumes the table is called questions.

2. To List data - as in a single row.

```java
String hql = "FROM Question WHERE topic_id > :topic_id";
Query query = session.createQuery(hql);
query.setParameter("topic_id", 42);
List<Question> singleQuestion = query.uniqueResult();
```

However, **IF** it is not `unique` as in key unique, which would be the case in list of `Topics`.

Use the `list()` but also use `setMaxResult()`. Example:

```java
String hql = "FROM Question WHERE topic_id > :topic_id";
Query query = session.createQuery(hql);
query.setParameter("topic_id", 42);
query.setMaxResult(1);
List<Question> singleQuestion = query.uniqueResult();
```

Incase you are fetching data in a paginated fashion, example page 2 will show results from 20 to 30
then use the above in combination with `setFirstResult(20)` with `setMaxResult(10)`. Take it that setMaxResult is `LIMIT` in SQL and setFirstResult is `OFFSET`.


### To Update:

```java
String hql = "UPDATE Question SET topic_id = :topic_id WHERE id = :id";
Query query = session.createQuery(hql);
query.setParameter("id", 1);
query.setParameter("topic_id", 42);
int result = query.executeUpdate();
```

### To Delete:

```java
String hql = "DELETE FROM Question WHERE id = :id";
Query query = session.createQuery(hql);
query.setParameter("id", 1);
int result = query.executeUpdate();
```

Hope it helps.!
Lab assessment is desperately needed
Tags: freebsd, help, devops, beginners
Published: 2023-03-14 10:37:45

good morning,


Could you please have a look at the following lab contents and share your opinion on the selection of the parts: [https://docs.google.com/spreadsheets/d/1atn3r16nBq7T-PyATb3xeYlofCnbN8q8T65QCwt1b5c/edit?usp=sharing](https://docs.google.com/spreadsheets/d/1atn3r16nBq7T-PyATb3xeYlofCnbN8q8T65QCwt1b5c/edit?usp=sharing).



Please have a look at the **Lab_1GbE** tab.



I have a tiny EUR 10K budget to build a Lab. Please share your comments/arguments/curses :)



The Lab's goals:

- no clowd
- CI/CD pipelines ( runners )
- containerization ( freeBSD jails )
- virtualization ( nanos unikernels )
- microservices
- database cluster ( Redis )
- reactive and event-driven stream processing ( Redis streams; zmq )
- used hardware only
- learn how things do actually function ( switching, routing, VNETs, eBPF, security, etc )
- etc



If the lab proves successful, later Infiniband ( also for stream processing and fluid dynamics calculations ) will be added.



best regards,

Dmitry
Expandable Yajra DataTable Laravel
Tags: laravel, datatabl, yajra
Published: 2023-03-14 10:52:07


```
var table = $('#users-table').DataTable({
        processing: true,
        serverSide: true,
        ajax: '{{ url("users-data") }}',
        columns: [
            {
                "className":      'details-control',
                "orderable":      false,
                "data":           null,
                "defaultContent": ''
            },
            {data: 'id', name: 'id'},
            {data: 'name', name: 'name'},
            {data: 'email', name: 'email'},
            {data: 'created_at', name: 'created_at'},
            {data: 'updated_at', name: 'updated_at'}
        ],
        order: [[1, 'asc']]
    });

    // Add event listener for opening and closing details
    $('#users-table tbody').on('click', 'td.details-control', function () {
        var tr = $(this).closest('tr');
        var row = table.row( tr );

        if ( row.child.isShown() ) {
            // This row is already open - close it
            row.child.hide();
            tr.removeClass('shown');
        }
        else {
            // Open this row
            row.child( format(row.data()) ).show();
            tr.addClass('shown');
        }
    });

    /* Formatting function for row details - modify as you need */
    function format ( d ) {
        // `d` is the original data object for the row
        return '<table class="table">'+
            '<tr>'+
                '<td>Full name:</td>'+
                '<td>'+d.name+'</td>'+
                '</tr>'+
            '<tr>'+
                '<td>Email:</td>'+
                '<td>'+d.email+'</td>'+
                '</tr>'+
            '<tr>'+
                '<td>Extra info:</td>'+
                '<td>And any further details here (images etc)...</td>'+
                '</tr>'+
            '</table>';
    }
On your controller

public function getUsersData()
{
        $users = User::select(['id', 'name', 'email', 'created_at', 'updated_at']);

        return Datatables::of($users)->make(true);
}```
Sum ActiveStorage::Blob byte_size
Tags: rails, mssql, sql
Published: 2023-03-14 10:46:39

You may think to sum up the size all ActiveStorage files, you could simply execute the following query:

```rb
ActiveStorage::Blob.sum(:byte_size)
```

But this may produce numbers too large for the resulting column type:

```
ActiveRecord::RangeError (TinyTds::Error: Arithmetic overflow error converting expression to data type int.)
```

The solution is to cast:

```rb
ActiveStorage::Blob.connection.exec_query(
  'SELECT SUM(CAST(byte_size AS BIGINT)) from active_storage_blobs'
).first
```
Eagle Eye - Grow your DevTool by engaging with content
Published: 2023-03-14 10:30:50


90% of developers visit online communities to get help when they are stuck (Stack Overflow, 2020). It’s safe to say that communities are the lifeline of the developer world. It’s where developers explore new products, ask questions to peers, and make buying decisions.

However, starting and growing developer communities around your DevTool is hard work. Developers don't respond well to traditional marketing. They don't like to be sold to, are active on specific social platforms, and trust their peers more than anything else. Therefore, ads, whitepapers, or cold emails have notoriously low conversion rates. 

What does work well is building relationships with developers based on common interests. One of the most effective ways to do this is to spot content related to your DevTool and insert yourself in the conversation.

That’s why we built Eagle Eye (live on Product Hunt today!). 


![Eagle Eye screen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/elv1sp2nkadvpa0pascw.png)

Eagle Eye lets you discover and engage with the most relevant content in your developer niche. It continuously monitors 10+ developer-focused platforms and generates a personalized feed for you to jump into discussions and add value. If you demonstrate expertise, developers will get curious and check out your profile, learning more about your DevTool. 

‍Eagle Eye will help you never miss a discussion in your developer niche or even about your product. It’s an organic and systematic way to grow your DevTool and will bring you a long way in developer adoption if used consistently. 

If you would like to support us 👉 [Product Hunt Launch 🚀](https://www.producthunt.com/posts/eagle-eye-2)
Simplest CLI pomodoro
Tags: productivity
Published: 2023-03-14 10:25:15

Most pomodoro UI apps these days try to do too much. I am only interested in working for 25 minutes and resting for 5 minutes. And I don't want the interface to stay in the way.

I found [Simple CLI Pomodoro timer for macOS | Patrick Loeber](https://patloeber.com/pomodoro-app-cli-macos/) and I am capturing the installation and usage here for posterity.

## Install

```bash
brew install caarlos0/tap/timer
brew install terminal-notifier
```

Then in your `.zshrc` add:

```bash
work() {
  # usage: work 10m, work 60s etc. Default is 25m
  timer "${1:-25m}" && terminal-notifier -message 'Pomodoro'\
        -title 'Work Timer is up! Take a Break 😊'\
        -sound Crystal
}

rest() {
  # usage: rest 10m, rest 60s etc. Default is 5m
  timer "${1:-5m}" && terminal-notifier -message 'Pomodoro'\
        -title 'Break is over! Get back to work 😬'\
        -sound Crystal
}
```
Build Portfolio Theme in Tailwind CSS & Next.js
Tags: tailwindcss, portfolio, nextjs, framermotion
Published: 2023-03-14 10:23:55

Are you a developer looking for the perfect portfolio theme to showcase your skills and expertise? Look no further than our latest offering - a beautiful and modern portfolio theme designed with developers in mind! 

Portfolio : [https://tf-portfolio-eta.vercel.app/](https://tf-portfolio-eta.vercel.app/)

Buy Now: [https://uat.lemonsqueezy.com/checkout?cart=e8ef4828-dc98-430e-a5e1-b4404d8cc5ed](https://uat.lemonsqueezy.com/checkout?cart=e8ef4828-dc98-430e-a5e1-b4404d8cc5ed)