teleren/devto huggingface dataset:
How to expand dynamically angular material panel
Tags: angular, html, codever, snippets
Published: 2022-11-28 14:52:49

Use the `expanded` attribute of the `mat-expansion-panel` element and set it to `true` when the condition is met.
In the following example a filter pipe is used
and [the result is placed in the `filteredBookmarks` variable](https://www.codever.land/snippets/63806e79944cbd1faacdda84/details) which is checked in the condition - `[expanded]="filteredBookmarks.length === 1"` :

```html
<mat-expansion-panel
  *ngFor="let bookmark of bookmarks | bookmarkFilter: filterText as filteredBookmarks; index as i"
  [expanded]="filteredBookmarks.length === 1">
  <mat-expansion-panel-header *ngIf="i<15">
    <div class="p-3">
      <h5 class="card-title">
        <a href="{{bookmark.location}}"
           [innerHTML]="bookmark.name | slice:0:100 | highlightHtml: filterText"
           target="_blank"
           (click)="addToHistoryService.promoteInHistoryIfLoggedIn(true, bookmark)"
           (auxclick)="addToHistoryService.onMiddleClickInDescription(true, $event, bookmark)"
        >
          {{"see innerhtml"}}
        </a>
        <sup class="external-link-hint"><i class="fas fa-external-link-alt"></i></sup>
      </h5>
      <h6 class="card-subtitle mb-2 text-muted url-under-title"
          [innerHTML]="bookmark.location | slice:0:120 | highlightHtml: filterText"
      >
        {{"see innerhtml"}}
      </h6>
    </div>
  </mat-expansion-panel-header>

  <ng-template matExpansionPanelContent>
    <app-bookmark-text [bookmark]="bookmark" [showMoreText]="true"
                       (click)="addToHistoryService.onClickInDescription(true, $event, bookmark)"
                       (auxclick)="addToHistoryService.onMiddleClickInDescription(true, $event, bookmark)">
    </app-bookmark-text>
  </ng-template>
</mat-expansion-panel>
```

> [**Project**: `codever` - **File**:  `hot-keys-dialog.component.html`](https://github.com/codeverland/codever)

See it in action at [www.codever.land](https://www.codever.land):


![Dynamically expand angular material panel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4dxfr8wynky37v4naiyl.gif)

<hr/>

> Shared with :heart: from [Codever](https://www.codever.dev/snippets/63820b10944cbd1faacdea21/details). Use :point_right: [**copy to mine**](https://www.codever.dev/snippets/63820b10944cbd1faacdea21/details) functionality to add it to your personal snippets collection.
Best of Weekly Resources 2019-2022
Tags: weekly, webdev, javascript, beginners
Published: 2022-11-28 14:49:53

Exactly three years ago I published my first weekly newsletter. Since then I've sent out 125 Emails with a total of 1345 resources.

To celebrate I've put together a list of the 110 most clicked links. You can find the full list here:

[https://wweb.dev/resources/best-of-weekly-2022/](https://wweb.dev/resources/best-of-weekly-2022/)

Cheers,
Vincent
Highlights for the Global AI Student Conference
Tags: machinelearning, career, cloud
Published: 2022-11-28 14:44:09

On December 13th the Global AI Student Conference is taking place. This is the 5th edition of conference that highlights student projects and educator discussion. In 12 hours, the conference travelers around the world, centrally hosted from the Global AI Studio in the Netherlands. Day one has over 20 sessions and panels covering the world, from China to Mexico. Day two is all about gaining hands-on knowledge with deep-learning

## My top 3 for Day 1
The first session I’m looking forward to, is from 3 students from China, they are going to share how they used Microsoft Cognitive Services to create their [iShare Donation Platform](https://aiconf.education/sessions/ishare-donation-platform/).
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s82daapjpuozb9p23av5.png)

Second on my list is [Breast Cancer prediction using automated ML](https://aiconf.education/sessions/breast-cancer-prediction-using-automated-ml/) by Hadil Ben Amor. I’m looking forward to seeing how Automated ML can be combined with Power BI to solve a real problem.

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

Finally, I’m always interested in how we can take responsibility when creating AI systems. In the session [Towards Responsible AI](https://aiconf.education/sessions/towards-responsible-ai/), Luis Beltran is going to share some examples and tips to create responsible AI.

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


> You can find all the sessions and create a personal agenda on [https://aiconf.education](https://aiconf.education). 


## Day 2
The second day is workshop day. During the day you can participate in a free full Fundamentals of Deep Learning workshop offered by Nvidia.   In this workshop, you’ll learn how deep learning works through hands-on exercises in computer vision and natural language processing. You’ll train deep learning models from scratch, learning tools and tricks to achieve highly accurate results. You’ll also learn to leverage freely available, state-of-the-art pre-trained models to save time and get your deep learning application up and running quickly.

[Register and more information click here](https://aiconf.education/workshop/)

## What is the Global AI Community?
The Global AI Community empowers developers who are passionate about AI to share knowledge through events and meetups. We host 3 global AI events across 100 locations that span every corner of the globe. We also provide a variety of resources to members of the community, including a free Meetup Pro account for user groups, event-in-a-box content, Azure passes, and support for booking Microsoft venues. We work closely with product teams at Microsoft to share workshop content about the newest AI products.
[https://globalai.community](https://globalai.community)
Go Code Roast #2: readability.js port
Tags: go, codereview
Published: 2022-11-28 14:40:10

In this video, I roast a port of a Mozilla Javascript library, readability.js (https://github.com/mozilla/readability) to Go (https://github.com/cixtor/readability).

A big thanks to cixtor (https://github.com/cixtor) for volunteering his package for this roast.

{% youtube https://youtu.be/3ve3bTfhvw8 %}
Understand the difference between Microservices vs APIs
Tags: webdev, opensource, programming, tutorial
Published: 2022-11-28 14:34:37

Many of them have misconceptions between Microservices and APIs. They are not equivalent and play a completely different roles in web applications. In this article, you will clearly understand the [difference between Microservices and APIs](https://www.anblicks.com/blog/difference-between-microservices-and-apis/).
Don't use res.json() twice in a single POST request...
Tags: javascript, react, webdev, fetchapi
Published: 2022-11-28 14:29:02

Let us understand what does json() method do in JavaScript. We use fetch API for GET, POST, PUT and DELETE requests in JavaScript. json() method is very commonly used when the request is POST. json() method takes JSON as input and parses it to produce a JavaScript object. It doesn't take any parameters and returns a promise that resolves into a JavaScript object. The object can be an array, a string, a number, or an object.

Whenever a client sends an HTTP request to the server using the POST method, the server will respond with one response. The response is commonly referred to as res. Since it is a single response, calling it again in the same request throws TypeError: Failed to execute 'json' on 'Response': body stream already read.

So now, how do we solve this? There exists a clone() method for allowing multiple uses of the body object. Hence we can read a response more than once in sequence. It creates a copy of the current request object.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9wvot6efcztvoils2nkr.PNG)
Get Started with Notion Templates Today! - No Code
Tags: templates, beginners, startup, productivity
Published: 2022-11-28 14:12:46

Notion is an effective all-in-one workspace for productivity where you can create anything you can imagine. But getting started with it can seem intimidating. These templates were carefully created by me to help you quickly achieve the ideal Notion setup. Download the file, duplicate it in your workspace, and then adjust it to your specifications.

It is a curated list of tools and resources to help web developers in learning, create, and increase productivity. 

[No Code Tools and Resources list](https://manojkiean.gumroad.com/l/no-code-tools-free-resources)

Learn more about a vast collection of online tools and resources for web development. These platforms can help startups quickly build and launch everything from websites to workflow automations to apps. Additionally, it includes tweets and threads discussing the subjects covered in the various categories of education, programming, digital marketing, courses, and much more.

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

What’s included?

- 100+ tools & resources
- Downloadable Resources
- Tweets & Threads
- Periodic Updates

Categories 

- Automation Tools
- No Code Tools
- Mobile Apps
- Blogs
- Images & Videos
- Dev Tools
- Design Tools
- Content Writer
- SEO
- Online Courses
- Forms

[Personal Portfolio](https://manojkiean.gumroad.com/l/personal-portfolio/BF2022)

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

A portfolio for designers or product managers that includes featured projects, a about section, and links to social media.

With this professionally designed portfolio template, you can showcase your services. Allow clients to see how you work in order to build trust and showcase your best work. You can easily modify the template to meet your specific business requirements!

[Budget Tracker](https://manojkiean.gumroad.com/l/budget-tracker)

A complete dashboard for managing all of your finances

A handy dashboard for keeping track of all of your income and expenses. It can be challenging to manage your finances, especially if you're working by yourself. We are here for that reason. We created this dashboard to make it easier for you to keep track of all your earnings, spending, and savings so that you can achieve financial freedom. You can change the template to suit your needs because we created it.

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

What's Included ?

- Accounts
- Income
- Expense
- Subscription
- Plans

** We'd love it if you left us a review !!

Conclusion

I'm hoping that this list of free notion templates will benefit in your learning and boost your outcome. Thank you for taking the time to read the blog post.
MongoDB Atlas Hackathon 2022 Reminder ⏰
Tags: atlashackathon22, mongodb, meta
Published: 2022-11-28 14:03:33

---
title: MongoDB Atlas Hackathon 2022 Reminder ⏰
published: true
description: You still have time to participate in the MongoDB Atlas Hackathon 2022 on DEV! 
tags: atlashackathon22, mongodb, meta
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mr7lauay0hehj4weahmd.png
---

### Submissions for the MongoDB Atlas Hackathon 2022 on DEV are due on December 8th at 11:59 PM UTC.

{% embed https://dev.to/devteam/announcing-the-mongodb-atlas-hackathon-2022-on-dev-2107 %}

---

If you've been a member of the DEV community for a while, you've likely encountered articles by the talented team over at [MongoDB](https://dev.to/mongodb). But have you explored [MongoDB Atlas](https://www.mongodb.com/atlas?utm_campaign=dev_hackathon&utm_source=devto&utm_medium=referral)? It’s more than a database, it’s a full developer data platform offering built-in data services for full-text search, analytics, data visualizations, edge-to-cloud sync and more.

The [MongoDB Atlas Hackathon 2022 on DEV](https://dev.to/devteam/announcing-the-mongodb-atlas-hackathon-2022-on-dev-2107) is an opportunity to harness MongoDB Atlas to build a new application, write a post about it on DEV (your "submission"), and share your work with the world! In doing so, you'll earn a limited-edition profile badge and a DEV sticker pack. You'll _also_ be eligible to win up to $1,000 USD in cash, up to $300 USD towards the Forem Shop, and lots more. 🔥 

Full details and rules for participating in the MongoDB Atlas Hackathon 2022 on DEV can be found [here](https://dev.to/devteam/announcing-the-mongodb-atlas-hackathon-2022-on-dev-2107).

### Don't forget to submit your project by December 8th!

---

If you get stuck at any point, please refer to the [help thread](https://dev.to/devteam/help-thread-mongodb-atlas-hackathon-2022-on-dev-b0i) which the DEV and MongoDB teams are monitoring. If you instead just want to connect or swap ideas with other participants, the [community discussion thread](https://dev.to/devteam/community-discussion-thread-mongodb-atlas-hackathon-2022-on-dev-444l) is the spot to do just that!

If you've already published your submission, great job! Our judges look forward to reviewing your project. Thanks for participating. You're also invited to submit multiple times if you wish!


Happy coding!
Deployment made easier
Published: 2022-11-28 14:01:33

# The ubiquity of cloud services has made it more critical than ever that businesses of all sizes take advantage of cloud-based platforms to increase efficiency and gain a competitive edge.

I am pleased to introduce SuperDev Cloud. A new PaaS that allows automatically turns your code into auto-scalable Web Apps Static Sites, Data Bases, Workers, APIs, Containers, and Cron Jobs.

We enable you to leave the hassle of deployment and infrastructure behind to deploy your code in minutes.

We are excited to invite you to the beta of SuperDev Cloud

Kindly register your interest at this link https://www.superdev.cloud
#PowerAutomate – Flow to use Open Trivia Database questions in a Microsoft Teams bot 🤖 4/N
Tags: englishpost, microsoftteams, opentriviadatabase
Published: 2022-11-30 00:24:48

---
title: #PowerAutomate – Flow to use Open Trivia Database questions in a Microsoft Teams bot 🤖 4/N
published: true
date: 2022-11-28 14:00:00 UTC
tags: EnglishPost,EnglishPost,MicrosoftTeams,OpenTriviaDatabase
canonical_url: 
---

#### PowerAutomate – Flow to use Open Trivia Database questions in a Microsoft Teams bot 🤖 Series

- [Intro to Open Trivia Database API](https://dev.to/azure/powerautomate-flow-to-use-open-trivia-database-questions-in-a-microsoft-teams-bot-1n-1h1e)
- [How to process the API Response and send a question to Teams](https://dev.to/azure/powerautomate-flow-to-use-open-trivia-database-questions-in-a-microsoft-teams-bot-2n-3dlm)
- [How to validate the user response in teams with the Trivia Question correct answer](https://elbruno.com/?p=35989)
- [Sort and mix the possible answers to the question](https://elbruno.com/?p=36003)

Hi !

In previous posts we request a Trivia quesion using the Open Trivia Database API, and sent the question as a message using Teams Flow Bot.

## Context

The process of the quesion is fine, however, the way that we process the answers has a flaw. Let’s take a look at steps in the current flow.

- Initialize an array variable [**arrAllAnswers**] with the array of incorrect answers.
- Add the correct answer to the array.

![Initialize an array variable [arrAllAnswers] with the array of incorrect answers.

Add the correct answer to the array.](https://brunocapuano.files.wordpress.com/2022/11/image-15.png?w=629)

## Solution

Once you answer a couple of questions, you may detect that the correct answer is always at the end. It’s time to think for a creative solution.

At the beggining I think in a weird solution: we have several options to work with arrays, so we may create a series of steps to mix the array.

At the end, I choose to use the simple solution: **sort the array**. Yes, we have a sort function, and that will be enough.

![sort the array variable](https://brunocapuano.files.wordpress.com/2022/11/image-16.png?w=1024)

With this approach, we will always have the question possible answers sorted alphabetically.

## Examples

Let’s take a look at a couple of examples

#### A true – false question

![A true - false question](https://brunocapuano.files.wordpress.com/2022/11/image-17.png?w=900)

#### A 4 possible answers question, using countries ! 

![A 4 possible answers question, using countries !](https://brunocapuano.files.wordpress.com/2022/11/image-19.png?w=875)

\We are almost there ! However, we can improve still this flow a lot 😀

And important: Join me in this 2-week FREE program @MSFTReactor  
and we will learn together about Microsoft Power Pages.  
We will also cover fundamentals of Power Pages architecture, components, features, and tooling.

#### [https://aka.ms/DecPowerPagesBootcamp](https://aka.ms/DecPowerPagesBootcamp)

Starting on Dec 05

Happy coding!

Greetings

El Bruno

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

* * *
Nunca foi sorte, sempre foi atitude.
Published: 2022-11-28 13:50:42

Quando eu tinha meus 16 para 17 anos, fiquei desempregado, entre muitas outras desculpas que o mercado prega, naquela época era que o jovem nessa idade poderia ser chamado pelas forças armadas, e se caso ocorresse era como se o empregador tivesse prejuízo.



Então, eu precisei "me virar"  e entre muitas coisas que eu PODERIA fazer naquele momento, e fiz, fui entregar panfletos nas ruas, a primeira possibilidade foi como entregador de panfletos de vendas de planos de saúde.



Logo, eu vi que algumas pessoas com mais idade tinham uma prancheta que eram preenchidas(pesquisa de campo) com telefone e algumas perguntas sobre planos de saúde, enquanto a gente entregava os panfletos num determinado bairro.



Os donos do negócio de posse dessas informações, faziam ligações telefônicas e tentavam convencer as pessoas pela troca de plano e com isso eles embolsavam as 3 primeiras parcelas do plano pago pelo cliente.



Era muito dinheiro aquilo. Um dia na hora do almoço eu peguei uma das pranchetas e me arrisquei ligando para algumas pessoas. Antes eu tinha observado(meu próprio onboarding) o processo e me iterado dos valores e planos que eles mais "empurravam" para as pessoas.   Foi relativamente fácil vender plano(Vendedor Junior), quando os donos chegaram e viram o que eu estava fazendo apenas disseram:



Você leva jeito para a coisa.



Ali eu recebi minha primeira promoção(Mais trabalho, mais dinheiros) na vida, eu já não entregaria panfletos e poderia vender planos(Novos desafios), mas eu não tinha uma habilitação(Reserva de mercado) para vendas de planos, e então eu ficava apenas com uma pequena parcela(Precarização trabalhista).



Logo em seguida eu, sabendo das artimanhas do pessoal de vendas de plano de saúde, com os entregadores de panfletos, usei do mesmo expediente(Eu e meu primeiro MEI), para vender pages e celulares, mas isso é um fato para uma nova postagem.



E quando dizem que foi sorte, eu digo que foi atitude.(Eu coach)



Qual foi sua primeira atitude na sua carreira?



#carreira #vendas #saude
NEW Personal Portfolio Website Using HTML CSS JavaScript
Tags: javascript, tutorial, css, webdev
Published: 2022-11-28 13:31:10

{% youtube wjqiFCTssTI %}

NEW Personal Portfolio Website Using HTML CSS JavaScript

This video will show you how to build a personal portfolio website using html css javascript

[Github Repo](https://github.com/codewithsadee/julia-portfolio)

---

⏱️ Timestamps
-----------------------------
0:00 - Demo
3:41 - File structure
4:39 - Project initial
11:53 - Header
29:20 - Hero section
39:50 - About section
48:27 - Project section
1:00:25 - Contact section
1:06:18 - Footer
1:08:29 - Media queries
1:24:26 - Scroll reveal effect

---

[![Become a patreon](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fnjl14kdm5qf08hu5lop.png)](https://www.patreon.com/bePatron?u=62535867)
Free Fire Season 55 Elite Pass for December: Pre-order rewards and more details leaked
Tags: freefire, freefiremax, ff, ffmax
Published: 2022-11-28 13:25:27

**Free Fire Season 55 Elite Pass for December – Pre-order rewards and more details leaked:** Free Fire is currently hosted as the most loved and played game through the year 2022. This report AHS been attained a few days ago that shows a huge response via the players who love to play the game free fire. Although, many players are not happy with some activities of free fire like high rated diamonds, increase in price for monthly membership and higher spent over new items. [Read More](https://techmodel.in/free-fire-season-55-elite-pass-december-pre-order-rewards-details-leaked/)
Golang sqlx PostgreSQL Get Last Inserted Row ID
Published: 2022-11-28 13:15:04

Sometime after inserting a row, we might need to get the id usually for creating referenced table with foreign key of id. We can try to use `db.NamedExec` or `db.Exec` to do the operation since it will return a `sql.Result` interface which have `LastInsertId()` method inside it. The problem since we are using PostgreSQL with `pgx` driver, this method is not supported as stated in the documentation: **In MySQL, for instance, LastInsertId() will be available on inserts with an auto-increment key, but in PostgreSQL, this information can only be retrieved from a normal row cursor by using the RETURNING clause.**.

The workaround is to take advantage of `RETURNING` clause that returns the updated row and combine it with `db.GetContext` or `db.QueryRowx` to get the query result, I will use `db.GetContext` here.

For example, we have a `productPayload` struct that we are going to insert.

```go
type productPayload struct {
    UID         string                  `db:"uid" json:"uid"`
	Name        string                  `db:"name" json:"name"`
	Slug        string                  `db:"slug" json:"slug"`
	SKU         string                  `db:"sku" json:"sku"`
	Description string                  `db:"description" json:"description"`
	Image       string                  `db:"image" json:"image"`

	CreatedAt time.Time `db:"created_at" json:"created_at"`
	UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
```

And here is the full code:

```go
query, args, err := db.BindNamed(`
	INSERT INTO products (uid, name, slug, sku, description, image, created_at, updated_at)
	VALUES (:uid, :name, :slug, :sku, :description, :image, :created_at, :updated_at)
	RETURNING id;
	`, productPayload)
if err != nil {
	return err
}

var productID int64
err = db.GetContext(ctx, &productID, query, args...)
if err != nil {
	return err
}
```

The usage of `db.BindNamed` is optional, I use it because I want to convert my `productPayload` struct into slice of positioned arguments, so I don't need to manually pass it to the `db.GetContext`.

I hope this article is useful for you, if it is please share it with your friends, thank you so much for reading to the end and see you in the next article!