teleren/devto huggingface dataset:
Advanced MX2 UT
Tags: unittest, python, osdc, git
Published: 2023-06-12 10:14:00

Hi there,

After my last assignment, which is to create a CI github workflow, I started to work on my latest assignment. My latest assignment is to add a more complex and advanced UT to the pymx2 repository via this [PR](https://github.com/vpaeder/pymx2/pull/4).

Our last session with Gabor, we learned about PyTest and all of it's functionalities including handling exceptions.

I like python in general since it is very simple to understand and to implement. I have some experience with UT in my current job position, so it was pretty easy and cool :)

I added a UT regarding the MX2 stop bits (that can only be 1 or 2 integers). So I messed it up with some different object types, including None of course. I had a very fun time doing this. To check that the UT are OK I run the command:
`python -m unittest`

Thank you and stay tuned for the next cool assignment!
@szabgab
Utility Type for curried functions in TypeScript
Tags: typescript, tutorial
Published: 2023-06-12 09:58:07

Ever need a Type for a curried style function? Here's how you do it! 

```ts
// Type helper to define curried function
type Func<T extends readonly any[]> = T["length"] extends 0
  ? () => void
  : T["length"] extends 1
  ? () => T[0]
  : (
      x: T[0]
    ) => T extends readonly [infer _, ...infer V]
      ? V["length"] extends 1
        ? V[0]
        : Func<V>
      : never;

// Usage
const func0: Func<[]> = () => undefined;
const func1: Func<[string]> = () => "";
const func2: Func<[string, number]> = (str) => 0;
const func3: Func<[number, boolean, string]> = (num) => (bool) => "";

```
Weekly Roundup 008 (Jun 05): 🔥Hot Topics🔥 in #workplace, #sharepoint, and #powerplatform
Tags: roundup, workplace, sharepoint, powerplatform
Published: 2023-06-12 09:56:01

Hey fellow developers! It's @jaloplo, here to give you the latest scoop on what's been happening in the [#workplace](https://dev.to/t/workplace), [#sharepoint](https://dev.to/t/sharepoint), and [#powerplatform](https://dev.to/t/powerplatform) communities. 😎

## [#workplace](https://dev.to/t/workplace)

- [Toxic Work environment](https://dev.to/kristiyan_velkov/toxic-work-environment-3jc8) by [Kristiyan Velkov](https://dev.to/kristiyan_velkov)

## [#sharepoint](https://dev.to/t/sharepoint)

- [SharePoint or NetSuite? Which consulting service is right for your business?](https://dev.to/tomdyler/sharepoint-or-netsuite-which-consulting-service-is-right-for-your-business-295c) by [Dyler Tom](https://dev.to/tomdyler)

## [#powerplatform ](https://dev.to/t/powerplatform)

- [AI builder in Power Automate](https://dev.to/seenakhan/ai-builder-in-power-automate-5f13) by [Seena Khan](https://dev.to/seenakhan)
- [Power Automate - Switch, Condition and If()](https://dev.to/wyattdave/power-automate-switch-condition-and-if-25) by [david wyatt](https://dev.to/wyattdave)


That's all for this week's roundup! Thanks for tuning in, and remember to keep the discussions lively and informative in our tags. 💬 If you have any suggestions for future topics, feel free to drop them in the comments below. See you next week! 👋
GithubAction -- use a workflow from another workflow
Tags: githubactions, cicd, devops
Published: 2023-06-12 09:44:23

It's called `reusable` workflow.

I have a workflow for test, and I have another workflow for release. Everytime I release a version, I want to have test passed before run release jobs.

What I have to do is to add `workflow_call` on my workflow

```
# ci.yaml
name: ci-build-and-test

on:
  push:
    branches:
      - main
  pull_request:
  workflow_call:

jobs:
  - (steps to checkout, setup dependency and run test)

```

then I can call it manually from another workflow (yaml file) by using `uses` and path to the ci.yaml file.
If you're using the reusable workflow from different repository then you need to add your github organisation and repo name. 

```
# cd.yaml
name: cd-build-and-publish

on:
  release:
    types:
      - released

jobs:
  compliance:
    if: github.event.release.target_commitish == 'main'
    uses: ./.github/workflows/ci.yaml

```

see more at:
https://github.blog/2022-02-10-using-reusable-workflows-github-actions/
How to Create Analog Clock Using HTML CSS and JavaScript
Tags: html, css, javascript, tutorial
Published: 2023-06-12 08:45:40

How to Create Analog Clock Using HTML CSS and JavaScript

in this video we are going to learn How to Create Analog Clock Using HTML CSS and JavaScript. If you are beginners in HTML, CSS and JavaScript, it's perfect project for you.

Inside the project, I've used HTML and CSS to design that, then I've used JavaScript display the dynamic time inside clock.

You will learn everything step by step from scratch, hope you will learn a lot of new things from the video tutorial.

I hope this tutorial is helpful and beneficial for you.

{% embed https://www.youtube.com/watch?v=x39RozWyDSY %}.
Tỷ Lệ Kèo . Tỷ Lệ Ma Cao - Tỷ số & Tỷ lệ 2 in1 | tilemacao
Published: 2023-06-12 08:54:42

Tỷ lệ kèo nhà cái hôm nay cập nhật tỷ lệ cá cược bóng đá mới nhất. Bảng tỷ lệ kèo bóng đá gồm tỷ lệ s2, tỷ lệ 2in1 người chơi có thể xem kèo châu á, kèo châu âu, kèo tài xỉu, kèo bóng đá chính xác nhất từ bảng tỷ lệ kèo nhà cái m88, 188bet, w88
Hastag : #Tỷlệmacao #Tỷlệs2 #Tỷlệcácược #Tỷlệ2in1
Địa chỉ: Hẻm 441 Nguyễn Đình Chiểu, Phường 5, Quận 3, Thành phố Hồ Chí Minh, Việt Nam
Phone : 0984421220
Website : https://tilemacao.net/
https://500px.com/p/tilemacaonet?view=photos
https://www.youtube.com/@tilemacaonet/about
https://www.linkedin.com/in/tilemacaonet/
https://twitter.com/tilemacaonet
https://www.pinterest.com/tilemacaonet/
https://vi.gravatar.com/tilemacaonet
https://www.goodreads.com/user/show/166641885-t-l-k-o
https://scholar.google.com/citations?hl=vi&user=YCcC72AAAAAJ
https://www.skillshare.com/fr/profile/Ty-le-Keo/45180028
https://tilemacaonet.wordpress.com/
https://6485f7f81a3f0.site123.me/
https://vimeo.com/tilemacaonet
https://wellfound.com/u/tilemacaonet
https://flipboard.com/@tilemacaonet
https://www.kickstarter.com/profile/tilemacaonet/about
https://tilemacaonet.blogspot.com/2023/06/ty-le-keo.html
https://www.blogger.com/profile/02419556655211653120
https://dribbble.com/tilemacaonet/about
https://github.com/tilemacaonet
https://www.reddit.com/user/tilemacaonet
https://www.tumblr.com/blog/tilemacaonet
https://www.twitch.tv/tilemacaonet/about
https://www.flickr.com/people/tilemacaonet/
https://sites.google.com/view/tilemacaonet/trang-ch%E1%BB%A7
http://atlas.dustforce.com/user/tilemacaonet
https://leetcode.com/tilemacaonet/
https://www.hebergementweb.org/members/tilemacaonet.490158/
https://www.gta5-mods.com/users/tilemacaonet
https://social.msdn.microsoft.com/Profile/tilemacaonet
https://www.yourquote.in/ty-le-keo-drlxk/quotes
https://worldcosplay.net/member/1183876
https://app.lookbook.nu/tilemacaonet
https://pawoo.net/@tilemacaonet
https://social.microsoft.com/profile/tilemacaonet
https://www.drupalgovcon.org/user/498776
https://wakelet.com/@tilemacaonet
https://coub.com/tilemacaonet
https://artistecard.com/tilemacaonet
https://wakelet.com/wake/Nyh_obRhcZTR6Ik7Q0Vgh
https://miarroba.com/tilemacaonet
https://xtremepape.rs/members/tilemacaonet.391423/#about
https://www.exchangle.com/tilemacaonet
https://www.penname.me/@tilemacaonet
http://tilemacaonet.idea.informer.com/
https://www.hackathon.io/tilemacaonet
https://osf.io/cbz8w/
https://forums.gta5-mods.com/user/tilemacaonet
https://australian-school-holidays.mn.co/members/17070915
Getting Started with the React Dialog Component
Tags: react, webdev, reactnative
Published: 2023-06-12 08:47:28

Learn how to create and configure the Syncfusion React Dialog component in a React application using Visual Studio Code. In this video, you will learn how to add a Dialog component to a React app. You will see how to add a header and footer; how to drag, resize, and animate the dialog; and how to change its position. Using the Dialog component, you can create a dialog box to collect input from users, warn them about errors, or confirm their decisions. 

_Product overview_: https://www.syncfusion.com/react-components/react-modal-dialog

_Tutorial video_: https://www.syncfusion.com/tutorial-videos

_Download example from GitHub_: https://github.com/SyncfusionExamples/getting-started-with-the-react-dialog-component

{% youtube upDeXQMYFoc %}
How to Automatically Fill a Form: Speed up Your Development 💪
Tags: javascript, productivity, tutorial, beginners
Published: 2023-06-12 08:29:00

You're probably tired of wasting time filling out a form every time you make a code change, right?

Let's imagine you have a form that you're currently developing, and every time you refresh the page... you're forced to fill it all over again.

So, I'm going to introduce you to Chrome DevTools snippets (this DevTools is available on almost all browsers except Safari and Firefox). It allows you to fill out a long form with just a few clicks.

![Screenshot of devtool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3hg9irlyvmt3tv9wfyaj.gif)

## Accessing the Snippets:
Access Chrome DevTools (right-click -> inspect or use the shortcut).

Once there, go to the Sources tab. If it's not displayed, click on the arrow that I've circled in red.
![Screenshot of devtool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rc4vp933wc1tvgl1ipj3.png)

Click on the Snippets tab and then "New snippet."
![Screenshot of devtool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rmzznv1ahdhzmcgloyas.png)

This will open a blank JavaScript code page for you.

## Practical Example

Let's consider the following form:

```html
<form>
    <h1>Form :</h1>
    <label for="input-1">Input 1 :</label>
    <input type="text" id="input-1" name="input-1" placeholder="enter value" required>

    <label for="input-2">Input 2 :</label>
    <input type="text" id="input-2" name="input-2" placeholder="enter value" required>
    
    <label for="input-3">Input 3 :</label>
    <input type="text" id="input-3" name="input-3" placeholder="enter value" required>

    <label for="select">Select :</label>
    <select id="select" name="sekect">
      <option value="">Select Choice</option>
      <option value="choice-1">Choice 1</option>
      <option value="choice-2">Choice 2</option>
    </select>

    <button type="submit">Submit</button>
  </form>
```
To fill it out, you simply need to set the input values in JavaScript:

```javascript
document.getElementById('input-1').value = 'Valeur 1';
document.getElementById('input-2').value = 'Valeur 2';
document.getElementById('input-3').value = 'Valeur 3';
document.getElementById('select').value = 'choice-2';
```

That's it! You just need to either press Ctrl+Enter or click the button.

![Screenshot of devtool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f0ummlflyk8wr5fdnwna.png)


![Screenshot of devtool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3hg9irlyvmt3tv9wfyaj.gif)

## Conclusion
Now you know how to quickly fill out a form using the DevTools snippets!
Of course, snippets can be used in much more complex ways. It's up to you to explore and imagine your own uses.

Feel free to comment if you have any questions, follow me, or react to the article with an reaction 😊
📖 Storybook with simple 🍦vanilla webcomponents
Tags: storybook, javascript, webcomponents
Published: 2023-06-12 08:12:54

It took me way too long to figure out how to get simple custom vanilla javascript webcomponents working in storybook. 
The documentation has no examples and I couldn't find much info online, so thought I'd share how to do it in 4 easy steps. (more for me to have a record to remember how to do it)

1 - Install storybook for HTML only. (this info is hidden behind an accordion on the install page)

```bash
npx storybook@latest init --type html 
```

2 - Start storybook up.

```bash
npm run storybook
```

3 - Create your webcomponent file in `./stories/my-component.js`

```bash
// Define your web component
class MyWebComponent extends HTMLElement {
    connectedCallback() {
      this.innerHTML = '<p>This is my web component</p>';
    }
  }
  
  // Register your web component
  customElements.define('my-web-component', MyWebComponent);
```

4 - Create your story file in `./stories/my-component.stories.js`

```bash
import './my-component.js';

export default {
  title: 'Example/My-Component'
};

export const Default = () => {
  return document.createElement('my-web-component');
};
```

That's it. 

Storybook should now render your vanilla webcomponent. Sorry if this is super-basic, but hopefully it'll help others getting started with storybook without any extra frameworks.
We built an affiliate marketing software for Stripe and Paddle users
Published: 2023-06-12 08:02:21

We launched our MVP a few months ago and would love some feedback!
The tech stack is React with Next, Node and Express and Postgress for the database.

We're not happy with our UX, so now we're working on that! Would love some guide on UX tho!

[Affiliate software for Stripe](https://tolt.io/stripe-affiliate-program)
[Affiliate software for Paddle](https://tolt.io/paddle-affiliate-program)
Magic of Facebook Games: Where AI Meets Fun
Tags: machinelearning, gamedev
Published: 2023-06-12 07:53:14

Hey everyone! Today, we're going to chat about something super interesting. Ever wondered what's going on behind the scenes when you're having a blast playing games on Facebook? Well, we're about to unveil that mystery! The secret ingredient that makes these games so much fun? AI, or Artificial Intelligence!

## What's AI All About?
First off, let's chat a bit about what AI is. In simple terms, it's about making computers or machines smart, like us humans. They can learn stuff, make decisions, and even understand and respond to our languages. Sounds pretty cool, right?

## Facebook and AI
Now, you're probably asking, "What's AI got to do with Facebook games?" Good question! When you're playing a game on Facebook, AI is like the wizard behind the curtain, making the magic happen.

AI helps Facebook games become more engaging and exciting. It can adapt the game to match your skill level, so you're always challenged but never too frustrated. And guess what? It can even create new, personalised content just for you, making your gaming experience truly unique.

## AI in Action: Meet Your Virtual Opponent
You know when you're playing a game, and you don't have a friend to play against, so the computer steps in? That's AI in action. AI can control these virtual opponents, and it's smart! It observes your moves, learns from them, and adjusts its strategy to give you a good run for your money.

## What About Game Recommendations?
Ever noticed how Facebook suggests games that are just perfect for you? Yup, you guessed it - that's AI doing its magic again. It understands your gaming preferences based on the games you've played before and recommends new games it thinks you'll enjoy.

## The Future is Now
So, there you have it! Facebook games are not just about mindless fun; there's a whole lot of cutting-edge tech making your gaming experience awesome. And the best part? This is just the beginning. AI is continually evolving, and it's going to make Facebook [Unblocked 77](https://unblockedpremium.com/c/unblocked-games-77) games even more exciting in the future.

So, the next time you're enjoying a game on Facebook, remember, there's a smart AI working hard behind the scenes to make sure you're having the best time! Isn't that amazing?

Stay tuned for more exciting revelations about the world of tech and gaming. Till then, keep gaming and keep having fun!
7 Must-Know UI Designing Principles to Keep Your Customers Engaged
Tags: ui, design, web, ux
Published: 2023-06-12 07:49:19

94% of users abandon websites or apps due to poor design.
UI design captivates and keeps users hooked by shaping digital interfaces.
Want to create captivating user experiences that keep your customers hooked?
Unlock the power of UI design with these 7 essential principles! 🎨✨
1⃣ Streamlined User Flows
2⃣ Consistent Visual Design
3⃣ Clear and intuitive navigation
4⃣ Feedback and User Interaction
5⃣ Responsive and Adaptive Design
6⃣ Effective Use of Calls-to-Action (CTAs)
7⃣ Involve everyone by contemplating Accessibility

## 1) Clear and intuitive navigation
When users land on a website or application, they expect to navigate effortlessly and find what they are looking for without frustration. In fact, studies reveal that 76% of consumers consider ease of navigation as the most important factor when it comes to website usability. A survey conducted by Clutch revealed that 94% of users stated that easy navigation is the most important website feature. Furthermore, 38% of users will stop engaging with a website if they find the layout or content structure unattractive. When users can effortlessly navigate through a website or application, they are more likely to stay longer, explore more content, and ultimately achieve their desired goals.

## 2) Consistent Visual Design
Consistency in visual design elements helps establish a sense of familiarity, professionalism, and trust, leading to improved engagement and user satisfaction. It not only enhances the user experience but also positively impacts brand perception. Moreover, it helps users navigate with ease, reduces cognitive load, and fosters a sense of trust and professionalism. When users encounter a visually consistent interface, they are more likely to stay engaged, explore further, and form a stronger connection with the brand.

## 3) Responsive and Adaptive Design
With the proliferation of devices and screen sizes, it has become essential for websites and applications to seamlessly adapt to different platforms and provide a consistent user experience. Responsive design ensures that the layout and content dynamically adjust based on the device’s screen size, while adaptive design tailors the UI specifically for each device. This is seen in a study by Adobe that revealed 73% of consumers prefer engaging with websites that provide a consistent experience across devices. By providing a consistent user experience across platforms, businesses can reduce bounce rates, increase time spent on the site, and improve conversion rates.

Read full post here: [https://bit.ly/3qDR0Xy](https://bit.ly/3qDR0Xy)
Reinforcement Learning Explained: A Journey into AI
Published: 2023-06-12 07:44:45

Reinforcement Learning, or RL, is a type of Machine Learning that revolves around an agent – this could be a robot, a game character, a piece of software – basically anything that can make decisions, and an environment in which it operates. The agent takes actions, and based on those actions, it either gets a reward or a penalty.

Think of it like training a dog. You give it a treat when it behaves well (that's the reward), and you might ignore it when it misbehaves (that's the penalty). Over time, the dog learns to behave well to get more treats. That's essentially how reinforcement learning works!

Reinforcement Learning has some impressive applications. Google's DeepMind used RL to train an AI named AlphaGo, which went on to defeat the world champion at the game of Go, a feat previously thought to be decades away. RL is also used in self-driving cars, robotic control systems, and even in recommendation systems like YouTube's own algorithm!

Now, let's break down how reinforcement learning works. First, we have the '**state**' of the environment. This is the current situation the agent finds itself in. Next, the agent takes an '**action**'. This changes the state of the environment. Then, based on the new state and the action it took, the agent gets a '**reward**' or a '**penalty**'.

The goal of the agent is to figure out what actions it should take in what states to maximize its rewards over time. This is often a trial and error process, but as the agent interacts with its environment more and more, it slowly starts to improve its behavior."

So, that's reinforcement learning in a nutshell. It's an exciting field with so many potential applications.
Mobile printers
Tags: webdev, printer, news
Published: 2023-06-12 07:35:00

Mobile printers are very common in our daily work, and the most common ones are logistics label printers in the hands of couriers. This type of mobile printers basically realizes network operation through wireless communication technology. As far as the current market is concerned, Bluetooth occupies a pivotal position in the field of short-distance wireless communication. Bluetooth low energy has the advantages of smart connection, peak current/average current and low current consumption in idle mode, and low cost. The current main smartphones are embedded with Bluetooth Low Energy, which is easy to use, widely used, and popular. Therefore, mobile control based on BLE Bluetooth has gradually become popular in the market.

01
Through the Bluetooth connection between the mobile phone and E104-BT5032A, the documents, pictures and other data on the mobile phone can be directly transmitted to the printing device for printing. E104-BT5032A has the feature of continuous transmission, which can ensure the complete transmission of large files and data, so that users no longer need to rely on PC equipment, no longer need complicated copying and connection, and can print at any time with only a mobile phone.

Feature display
Support the maximum airspeed of 2M, fast transmission speed and short waiting time;
Support multi-master and multi-slave, 4 mobile phones can establish connection with the device at the same time;
Support Bluetooth parameter air configuration function, which is convenient for remote configuration of the device.

02
Every day, Yibyte people are committed to more powerfully assisting the development of IoT, intelligence, and automation, improving resource utilization, and more products and more information. Interested partners can log on to our official website [http:// Visit www.ebyte.com](http:// Visit www.ebyte.com) to learn more, and the customer service lady will answer questions online!