teleren/devto huggingface dataset:
Calling the SP from MSsql issuse
Published: 2023-01-19 16:12:42

I am trying to calling the SP from MSSQL and I am getting an error:

```
exports.ExportPropertyReport = catchAsyncErrors(async(req, res, APN, TimeTrend, MONTH_YEAR, lowrange, highrange) => {
    // const APN = req.body.APN;
    try {
        let pool = await sql.connect(config, { requestTimeout: 30000 })
        //let pool = await sql.connect(config)
        let result = await pool.request()
            .input('APN', sql.Float, APN)
            .input('TimeTrend', sql.NVarChar, TimeTrend)
            .input('MONTH_YEAER', sql.NVarChar, MONTH_YEAR)
            .input('LOWRANGE', sql.VarChar, lowrange)
            .input('HighRange', sql.VarChar, highrange)
            .execute('dbo.Usp_ExportPropertyReport')

        console.log(result.recordset);

        sql.close();

        res.status(200).json({
            success: true,
            message: `ExportPropertyReport called successfully`,
            result
        });

    } catch (err) {
        console.log(err);
        res.status(500).json({
            "error": true,
            "message": "Error executing query"
        });
    }
});
```

error message : 

RequestError: Validation failed for parameter 'APN'. Invalid number. at Request.userCallback (E:\spcall\node_modules\mssql\lib\tedious\request.js:811:19) at Request.callback (E:\spcall\node_modules\tedious\lib\request.js:205:14) at E:\spcall\node_modules\tedious\lib\connection.js:1982:17 at processTicksAndRejections (node:internal/process/task_queues:78:11) { code: 'EPARAM',
Appwrite Announces Pizza and Swag Fund
Published: 2023-01-19 16:11:26

**_Appwrite to support more small events on a global level_**

Small events, such as hackathons and meetups, rely heavily on sponsorships and collaboration of others to run events successfully. Sometimes there are costs associated with the venue and food. Having food and beverages helps bring a lot more attendees to an event since it’s generally hosted during the evening. It’s hard work to stay consistent and host these events.

This brings us to announce the official **Pizza & Swag Sponsorship Fund** by Appwrite. 
We aim to sponsor these small events with food, beverages, and/or swags. It’s a win-win situation on both ends since it helps Appwrite, a free and open-source organization for building backend applications, improve brand awareness through local communities, and helping developer communities grow their events.

**There are 2 sponsorship tiers:**

- Silver: Reimbursement of up to $250 for Pizza and Beverages, and  Appwrite Swag

- Gold: Sponsorship reimbursement of up to $500 USD,  and Appwrite Swag

You can find more information about the sponsorship information on the form.

_Note: Swag process takes at least 4-8 weeks, ensure to apply for the fund at least 3 months before the event._


## HOW TO APPLY?

1. Fill out the form here 👇
{% embed https://7nxwryuitoy.typeform.com/pizza-swag-fund %}
2. If approved, we will contact you with the next steps within 2 weeks of your submission.  If you don’t hear back, then the application defaults to disapprove


_Note: If there is no response within 7 days, consider the application is automatically not accepted, but you are welcome to apply again for a future event._
Another React ReadMoreComponent
Tags: react, tutorial, webdev, programming
Published: 2023-01-19 15:50:09

---
title: Another React ReadMoreComponent
published: true
description: 
tags: react,tutorial,webdev,programming
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-01-19 15:15 +0000
---

Here is another implementation for a ReadMoreComponent for React.

```

const AnotherReadMoreComponent = ({ text, cutOff }) => {
  const [showReadMore, setShowReadMore] = useState(true);
  const [displayMore, setDisplayMore] = useState(true);
  const getText = () => {
    if (text?.length <= cutOff) {
      setDisplayMore(false);
      return text;
    } else {
      return text.slice(0, cutOff);
    }
  };
  useEffect(() => {
    getText();
  }, []);
  return (
    <div>
      <p
        style={{
          textAlign: "justify"
        }}
      >
        {showReadMore ? getText() : text}

        {displayMore && (
          <span
            style={{
              display: "inline",

              cursor: "pointer"
            }}
            onClick={() => {
              setShowReadMore(!showReadMore);
            }}
          >
            {showReadMore ? "...more" : "...less"}
          </span>
        )}
      </p>
    </div>
  );
};

```

In this example, the component accepts two props `text` and `cutOff` which is the full text to be displayed and how much length you want to display. 

When the component is rendered, it will show the short text version of the content with a "read more" text to click on. When the text is clicked, the component's state is updated to show the full text and a "...less" button.

This component also uses a `getText()` method which checks if the `text` length is less than or equal to `cutOff` it displays the whole string without `more or less` options. 

You can use this component in other component by passing the text and cutOff as prop.


```
<AnotherReadMoreComponent

text="Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"

cutOff="100"

/>

  

<AnotherReadMoreComponent

text="Sed ut perspiciatis unde omnis iste natus "

cutOff="10"

/>
```

For Live Demo here is the link : https://codesandbox.io/s/relaxed-babbage-3mwo1y?file=/src/App.js:1024-2080
An Update on NextSketch
Tags: news, community
Published: 2023-01-19 15:45:09

Hello!

This is just a short announcement on what's going to happen to NextSketch (1). With the recent release of NextSketch 2, we were thinking about where to take the original version. In the middle of that, we also came to realize a bug in the original where it would refuse to acknowledge trial/paid licenses for some.

## Why doesn't NextSketch (1) recognize my license?

This bug was something that evaded testing on our machines (due to IDE/OS differences). Anyone who's build paid plugins for IntelliJ knows about LicensingFacade. It's the singleton that your paid plugin can query for license data. Unfortunately, there doesn't seem to be a way to listen for License events on this platform and the system will return a null value (oh boy) if it isn't sure about the license yet, which NextSketch treats as an invalid license.

If you've tried out NextSketch 2, you'll notice that the first time you start the IDE, there's a 6-7 second verification check which we've used to bypass this and ensure the system is initialized before we query it. We're looking into other, more long-term solutions regarding this. 

## What will happen to NextSketch (1)? 

So that brings us to NextSketch 1's place in the NextSketch 2 era. NextSketch (1) will continue to be for purchase and will receive minor updates/fixes (and the licensing fix) but no new features. 

## That's fine I was moving over to 2 anyway...

If you'd like to take advantage of NextSketch 2, please follow up on our [Transition Guide](https://mohammed-baig.gitbook.io/nextsketch-2-docs/transition-guide)

## What's with the leaf logo? 

Finally, we're looking to change the NextSketch 2 logo. Honestly, it was just put together about 3 days before launch, and while we liked the weirdness of the original logo, we feel like we can do a bit better than that. We're still thinking about this though so take it with a grain of salt for now. 

We're sorry for any users who've experienced this issue on their IDE installations. Sadly, this is an issue that varies across IDE/OS combinations. We'll be looking to fix this as soon as possible. 

Thank you!
Understanding Polygon: The L2 Scaling Solution for Ethereum
Tags: blockchain, web3, polygon, ethereum
Published: 2023-01-19 15:45:04

As the popularity of decentralized applications (dApps) on the Ethereum network continues to grow, the need for a high-performance, low-cost infrastructure has become increasingly important. This is where [Polygon](https://polygon.technology/) comes in.

Polygon (formerly known as Matic Network) is an open-source, multichain scaling solution that aims to provide a high-performance and low-cost infrastructure for decentralized applications (dApps) built on the Ethereum network. It is considered a Layer 2 scaling solution, which means that it runs in parallel to the main Ethereum blockchain, allowing for faster and cheaper transactions.

One of the key features of Polygon is its use of a modified version of the Ethereum consensus mechanism called "Proof of Stake" with a variant called ["Plasma" for its side chains.](https://wiki.polygon.technology/docs/home/blockchain-basics/sidechain/) This allows for faster and cheaper transactions, while still maintaining the security of the main Ethereum blockchain.

Another important feature of Polygon is its concept of "[Supernets](https://polygon.technology/supernets)." Supernets are a collection of interconnected Polygon chains that share a common governance model and token economy. Each Supernet is designed to serve a specific use case or community, and they are designed to be interoperable with each other and with Ethereum.

Polygon also provides a suite of other protocols and services, including a decentralized oracle network, a cross-chain communication protocol, and a decentralized governance model. All of these features work together to provide a robust and flexible infrastructure for dApp developers.

In terms of deployment, developers can use Polygon's SDKs to easily deploy and interact with their dApps on Polygon's networks, and in order to use Polygon's infrastructure, developers need to pay in $MATIC, the native token of the network, as a transaction fee.

Overall, Polygon is a highly promising scaling solution for the Ethereum network. Its use of a modified version of the Ethereum consensus mechanism, its concept of Supernets, and its suite of other protocols and services make it a powerful infrastructure for dApp development.

It's worth noting that Polygon also has on its networks a variety of independent projects and protocols that can be used to build decentralized oracle systems, such as Chainlink, API3, others, as well as AMMs, Lending Protocols, and more.
SuiteScript 2.0 - Using Map-Reduce to retrieve large set of records.
Tags: netsuite, suitescript, mapreduce, oracle
Published: 2023-01-19 15:32:41

---
title: SuiteScript 2.0 - Using Map-Reduce to retrieve large set of records.
published: true
description: 
tags: netsuite, suitescript, mapreduce, oracle
cover_image: https://www.worldometers.info/world-map/world-map-pro.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-01-19 15:26 +0000
---

If you've noticed, Netsuite is very controlled in how they allow partners access their data without safeguards.  And trying to collect large sets of data or process them can be tough but with a little bit of ingenuity, you can. 

This script is a Map/Reduce script, which is a type of script that allows you to process large amounts of data in smaller chunks. 

Here is a SuiteScript 2.0 script that retrieves all customer records from NetSuite and logs the internal ID and company name for each record:

```
/**
 * @NApiVersion 2.x
 * @NScriptType MapReduceScript
 */
define(['N/search'], function(search) {
    function getInputData() {
        var customerSearch = search.create({
            type: search.Type.CUSTOMER,
            columns: ['internalid', 'companyname']
        });
        return customerSearch;
    }

    function map(context) {
        var searchResult = JSON.parse(context.value);
        log.debug({
            title: 'Customer Record',
            details: 'Internal ID: ' + searchResult.values['internalid'].value + ', Company Name: ' + searchResult.values['companyname'].value
        });
    }

    return {
        getInputData: getInputData,
        map: map
    };
});
```

The script uses the search module to create a search for customer records and retrieve the internal ID and company name for each record. The map function is then used to iterate through the search results and log the internal ID and company name for each record.

This code snippet can be helpful for retrieving large amount of data and customizing the output in NetSuite.
How to Create a Page in Symfony 6 (Frontend)?
Tags: php, symfony, twig, encore
Published: 2023-01-19 15:31:32

---
title: How to Create a Page in Symfony 6 (Frontend)?
published: true
description: Introduction to Twig template engine and Symfony Webpack Encore
tags: php, symfony, twig, encore
cover_image: https://anastasionico.uk/img/blog/how-to-create-a-page-in-symfony-with-twig-ancore.jpeg
---

When I was a junior developer I came to a realization pretty quickly.

Despite the value coming from tutorials and documentation one of the best ways to learn a new skill is by doing.

Malcolm Gladwell author of Outliers wrote that to become an expert, we need around 10000 hours of practice. 

Practice does not mean watching videos of how to do things.

Practice means practice!

I am currently learning about a PHP framework called Symfony 6.

My practice will be rewriting my website in it.

Today you’ll learn how I am practicing Symfony by creating front-end web pages in Twig.

[Learn Symfony with me](https://anastasionico.uk/blog/how-to-create-a-page-in-symfony-with-twig-ancore)
Blockchain and Beyond: Your Exciting Journey to Becoming a Developer in 2023
Tags: blockchain, solidity, programming, beginners
Published: 2023-01-19 15:30:53

[Blockchain](https://bit.ly/Howtobecomeablockchaindeveloper) is one of the most promising and rapidly growing technologies in today's digital world. With the increase in demand for [blockchain developers](https://bit.ly/Howtobecomeablockchaindeveloper), it's no surprise that many are looking to break into the field. If you're interested in becoming a blockchain developer, this post will provide you with all the resources you need to get started.

First, let's take a look at [the top 7 highest paying blockchain jobs](https://bit.ly/Toppayingblockchainjob) in 2023. As the industry continues to grow, so do the salaries for those working in it. Check out this link to see which positions are currently paying the most:

> Read: [The Top 7 Highest Paying Blockchain Jobs in 2023](https://bit.ly/Toppayingblockchainjob)

Next, you'll want to familiarize yourself with the programming language used to write smart contracts, [Solidity](https://bit.ly/Solidity101-2023). This guide, [Solidity 101](https://bit.ly/Solidity101-2023), will provide you with a comprehensive introduction to programming smart contracts in Solidity:

> Read: [Solidity 101: guide [2023] to programming smart contracts](https://bit.ly/Solidity101-2023)

Finally, for a more in-depth look at [how to become a blockchain developer](https://bit.ly/Howtobecomeablockchaindeveloper), this guide covers everything from understanding the technology to finding job opportunities:

> Read:[From Zero to Blockchain Hero: How to Become a Blockchain Developer](https://bit.ly/Howtobecomeablockchaindeveloper)

By following these resources, you'll be well on your way to a career in blockchain development. Stay up to date with the latest developments in the field and continue to expand your knowledge and skills. The opportunities in blockchain are endless, and the demand for developers is only going to continue to grow in the coming years. So, it's the perfect time to start your journey as a blockchain developer.
How to convert mp4 to mp3 using python
Tags: python, programming, tutorial, productivity
Published: 2023-01-19 15:28:30


In this tutorial, I am going to be showing you how to convert files from mp4 to mp3, using python. In order to do this, we're going to be using the moviePy library, and it's only going to take about three lines of code. Yes! Three lines of code. That's the beauty of python as a lazy programmer😁.

Let's begin.

## Installing moviePy

Firstly, we're going to need the moviePy library on our computer. So run the following command to install it:

```console
> pip install moviepy
```

## Import the necessary modules

```python
from moviepy.editor import *
```

## Load the mp4 file
Using the `VideoFileClip` method, we would load our video into a variable `video`
```python
video = VideoFileClip("example.mp4")
```

where `example.mp4` is the filename and the format of the video you want to convert.

## Extract audio from video
Then, we are going to extract the audio from the video and save it with our desired filename.
```python
video.audio.write_audiofile("example.mp3")
```

where `example.mp3` is the filename and the format of the audio extracted from `example.mp4`.

## Final code

```python
from moviepy.editor import *

# Load the mp4 file
video = VideoFileClip("example.mp4")

# Extract audio from video
video.audio.write_audiofile("example.mp3")
```
So if you've done everything correctly, and run your code, you should see your conversion in progress in your terminal.
Remove Shorts from your YouTube Subscriptions feed with :has()
Tags: css
Published: 2023-01-30 11:01:17

---
title: Remove Shorts from your YouTube Subscriptions feed with :has()
published: true
date: 2023-01-19 15:28:00 UTC
tags: css
canonical_url: https://rachsmith.com/remove-youtube-shorts/
---

I have nothing against short-form video content. TikTok is a lot of fun! YouTube shorts are... not it. I hate having them show up in my subscriptions feed! Today I figured out how to remove them from the feed with one line of CSS.

I wanted to set `display: none` on all items in the feed that had a child element that signified it was Short. Previously I'd have to go to JavaScript to do this sort of thing, but now we have the [:has() selector](https://developer.mozilla.org/en-US/docs/Web/CSS/:has) I can do it with CSS. This means we can use a CSS-injecting extension like [User CSS](https://chrome.google.com/webstore/detail/user-css/okpjlejfhacmgjkmknjhadmkdbcldfcb?hl=en) or [Stylebot](https://chrome.google.com/webstore/detail/stylebot/oiaejidbmkiecgbjeifoejpgmdaleoha?hl=en).

I'm using [Arc](https://arc.net/) as my browser, which has a CSS injection feature built-in via Style Boosts.

Here's the CSS to add to your extension (or Boost if you're using Arc ) to hide all the Shorts:

**Update: [Jon Campbell](https://fosstodon.org/@healsdata/109719116763728009) pointed out the snippet I had here doesn't work on grid view of the subscriptions page, only the list view.** I've updated it so shorts are hidden on both views. To get a snippet that hid the correct things on list view *without* breaking grid view needed a combination of `:not()` and `:has()`. I've definitely learned some things about `:has()` during this process!

```css
/* Grid View */
#items.ytd-grid-renderer>ytd-grid-video-renderer:has(ytd-thumbnail-overlay-time-status-renderer[overlay-style="SHORTS"]) {
  display: none;
}

/* List View */
ytd-item-section-renderer:not(:has(ytd-grid-renderer)):has(ytd-thumbnail-overlay-time-status-renderer[overlay-style="SHORTS"]) {
  display: none; 
} 

```

Hooray for the [patchability of the Web](https://daverupert.com/2022/09/patchability-of-the-open-web/)!
Responsive Landing Page using HTML CSS and JavaScript
Tags: html, css, javascript
Published: 2023-01-19 15:25:26


responsive landing page using html css and javascript

hey guys, hope you all of fine, recently, I've made another video tutorial, inside the video you will learn How to create a landing page with HTML CSS & JS. 

Inside the landing page I've used video background, you will learn how to use video as a background and how to manage the content. It's completely responsive, when you will decrease the browser size, then you will able to menu bar icons.

Once you click on menus bar icons, then you will able to see the menus bar and also you will able to close the menus using close button which appear inside the navbar.

Guys, those features you will learn inside the video. hope this tutorial is helpful and beneficial for you.

{% embed https://www.youtube.com/watch?v=GXfiFOBPxfM %}
#Rust 🦀 – Working with arrays, vectors and println! macro in Debug mode 🐛
Tags: englishpost, arrays, println
Published: 2023-01-24 19:20:10

---
title: #Rust 🦀 – Working with arrays, vectors and println! macro in Debug mode 🐛
published: true
date: 2023-01-19 15:23:32 UTC
tags: EnglishPost,Arrays,EnglishPost,println
canonical_url: 
---

Hi !

It’s time to learn a little about arrays and vectors. And sure, using println! is a great way to check how this elements works. However, there is a little something extra to learn here.

Let me start with a simple scenario. Defining a vector with weekdays, and print the content. Something like this

```

    // Declare array with weekdays
    let days = [
        "Sunday",
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday",
    ];

    // print days 
    println!("{}", days);

```

And this is the output, with a super cool error.

```

error[E0277]: `[&str; 7]` doesn't implement `std::fmt::Display`
  --> src\main.rs:38:20
   |
38 | println!("{}", days);
   | ^^^^ `[&str; 7]` cannot be formatted with the default formatter
   |
   = help: the trait `std::fmt::Display` is not implemented for `[&str; 7]`
   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead

```

In order to work and print an array (or other complex elements) we may want to use the println! macro in Debug Mode ([more information on Debug Mode here](https://doc.rust-lang.org/rust-by-example/hello/print/print_debug.html)). We need to use the “{:?}” marker for debugging purposes.

So, once we give it a try, we have this output.

```

    Finished dev [unoptimized + debuginfo] target(s) in 0.57s
     Running `target\debug\arr01.exe`
["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]

```

And it works ! And hey, we even have a beautified debug option using the “{:#?}” marker. In this scenaro we will have the array printed one line for each array element.

![Ouput of the debug and debug beautifier sample to print weekedays with the output ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
[
    "Sunday",
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday",
    "Saturday",
]](https://brunocapuano.files.wordpress.com/2023/01/image-26.png?w=1024)

The full source code for the previous scenario is available here.

{% gist https://gist.github.com/elbruno/c98976e178bb42759d204a3b3f71061a %}

More in the official [Rust Documentation for Formatted Strings.](https://doc.rust-lang.org/rust-by-example/hello/print.html)

Happy coding!

Greetings

El Bruno

More posts in my blog [ElBruno.com](https://www.elbruno.com).

* * *