teleren/devto huggingface dataset:
How to save the color of my favorite button in Hive db?
Tags: flutter, dart
Published: 2021-12-04 06:02:05

0


I am trying to create a favorite button for my app.Which work is to change and save color, while the user press it.So i decided to use hive db for it.The problem i am facing is, when i tap the button; the color get changed,but when i move to other page or hot start/reload the page,the color changed back to it former self automatically. As i am a beginner i cant understand what value i have to put in the hive db to save the button-color.To indicate the user its being marked as favorite.
           class p1 extends StatefulWidget {
           @override
           _p1State createState() => _p1State();
           }

          class _p1State extends State<p1> {
          bool _isFavorite = true;
          @override
          Widget build(BuildContext context) {
          return MaterialApp(
         home: Scaffold(
         body:Stack(
       children:<Widget>[
       Image(
       image:AssetImage("Image/Chowsun1.jpg"),
     fit:BoxFit.cover,
     width: double.infinity,
     height: double.infinity,
     ),
      Align(alignment: Alignment.center,
          child: Text('   Its you '
              ,style: TextStyle(fontSize: 35.0,
                  color: Colors.white,
                  fontFamily: "Explora",
                  fontWeight: FontWeight.w900 ) )



         ),
         Stack ( children: [Positioned(
           top:90,
           right: 20,
           child:const Text('   1 ',
             style: TextStyle(
                 fontSize: 25.0,
                 color: Colors.white,
                 fontFamily: "Comforter"
               ),
               ),
               )], ),





    Align(
        alignment: Alignment.bottomCenter,
        child: (
            IconButton(
                icon: Icon(
                  Icons.favorite,
                    color:_isFavorite ? Colors.white: Colors.red


                ),
                onPressed: (){
                  setState(() {
                    _isFavorite= !_isFavorite;
                  });

                  Hive.box(FAVORITES_BOX).put(_isFavorite, 
                  !_isFavorite);

                }
            )
        )
    )])

  ),
);
} }
Evernote Anonymous logins
Tags: evernote, security, googleaccount, evernotelogin
Published: 2021-12-04 05:44:04

Very often, I m receiving mail from Evernote like this...

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

When I login to evernote and see in the `devices` section, I am often seeing logins like below from different countries...

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1i5n6uyujax1v6b7h87v.png)
 
My Evernote login is through my google account.. In that case, how is these logins happening from other countries...?

Is my google account compromised or it is some security flaw in evernote app...???

How to identify this..?
Need Help for Best App Develop #Streming
Published: 2021-12-04 05:26:23

[Airy TV](https://airy-tv.com/) is truly a magnificent app because it provides a 100% free streaming service for everyone. Now, you don’t need to even pay for cable subscription if you have this app. Here are its feature.
But of course, these platforms aren’t free! In fact, a lot of people say that they can’t afford to splurge that much just to watch movies and shows. But thanks to Airy TV, you don’t even have to pay ridiculous fees anymore. Now, you can watch any category of shows and movies you want. You can also watch the classic channels, sports, comedy shows and many more! Want to also watch anime? Say no more, this app offers a wide variety of content for every audience there is.
please provide the best tool r cosing for app development.
Why I Use Printf Over Echo
Tags: commandline, scripting, devops
Published: 2021-12-04 04:44:54

---
title: Why I Use Printf Over Echo
published: true
description: 
tags: commandline, scripting, devops
canonical_url: https://www.soohoo.io/blog/echo-vs-printf/
//cover_image: https://direct_url_to_image.jpg
---
_This post [originally appeared on my personal blog](https://www.soohoo.io/blog/echo-vs-printf/)._

While echo is the more widely known command for printing text to standard out, I have found behavior and documentation inconsistencies in its varying implementations[^1].

macOS echo man page:
![macOS echo man page](https://www.soohoo.io/static/ced692b1e0d131c11fe9910513a34ce5/22475/macos_echo_man_page.png)

Ubuntu echo man page:
![ubuntu echo man page](https://www.soohoo.io/static/2cc96f4e95a52788cd4adf6349175680/22475/ubuntu_echo_man_page.png)

In addition, it's default behavior can cause unintended results when combined with character sensitive commands like base64. Here are a few use cases where echo has caused some trouble for me.

1. Base64 encoding credentials to put into secret management (Hashicorp Vault, kubernetes, etc.)
    ```shell
    #!/usr/bin/env bash

    PASSWORD="supersecretpassword"

    # echo output
    echo "${PASSWORD}" | base64
    c3VwZXJzZWNyZXRwYXNzd29yZAo=

    # printf output
    printf "${PASSWORD}" | base64
    c3VwZXJzZWNyZXRwYXNzd29yZA==
    ```
    Echo appends a newline to the end of your output which will be passed in the output piped to the base64 command and also appear in the base64 encoded output.

2. Doing script output
    
    Desired output
    ```shell
    one line
    two line
    three line
    four
    ```

    Script
    ```shell
    #!/usr/bin/env bash

    INPUT="one line\ntwo line\nthree line\nfour"

    # echo output
    echo "${INPUT}"
    one line\ntwo line\nthree line\nfour

    # printf output
    printf "${INPUT}"
    one line
    two line
    three line
    four
    ```

    The desired output can be achieved using `echo` with the `-e` argument, but as shown in the screenshots above, it's not always documented.

[^1]: https://unix.stackexchange.com/a/65819
Labio - Beauty & Balance
Published: 2021-12-04 04:20:46

LABIO - Thương hiệu mỹ phẩm Việt Nam cao cấp được hình thành và phát triển bởi đội ngũ chuyên gia hàng đầu về sức khỏe và mỹ phẩm an toàn.

Thông tin về Labio - Thương hiệu mỹ phẩm Việt Nam cao cấp
Địa chỉ:Tầng 6, tòa nhà Việt Á, số 9 Duy Tân, Dịch Vọng Hậu, Cầu Giấy, Hà Nội
Hotline: 1900 3030
Email: support@labio.vn
Website: [https://www.labio.vn/](https://www.labio.vn/)
Facebook : [https://www.facebook.com/labio.official/](https://www.facebook.com/labio.official/)
Google site:[https://sites.google.com/view/labiovn/](https://sites.google.com/view/labiovn/)
[](https://vi.wikipedia.org/wiki/M%E1%BB%B9_ph%E1%BA%A9m)
[](https://www.google.com/search?q=labio+m%E1%BB%B9+ph%E1%BA%A9m+vi%E1%BB%87t+nam&kgmid=/g/122_gf1z)
Angular 13 Form Validation Tutorial Step by Step
Tags: angular
Published: 2021-12-04 04:06:49

Hi,

Today, i will let you know example of angular 13 reactive forms validation. you can understand a concept of angular 13 forms validation example. if you have question about angular 13 reactive forms example then i will give simple example with solution. you can understand a concept of reactive form validation in angular 13. Here, Creating a basic example of angular 13 form validation example.

Reactive forms provide a model-driven approach to handling form inputs whose values change over the time. In Reactive forms, we need to import "ReactiveFormsModule" from angular forms library. we will use FormControl, FormGroup, FormArray, Validation classes with Reactive forms in angular 13 app.

If you have simple and basic form in your angular 13 application then i will prefer to use Reactive forms in angular. here i write simple example of Reactive forms with validation in angular 13.

You need to follow bellow step to create reactive forms in angular 13.

Article: https://www.itsolutionstuff.com/post/angular-13-reactive-forms-validation-tutorial-exampleexample.html

Thank you
Advent of PBT 2021 - Day 3
Tags: challenge, testing, webdev, javascript
Published: 2021-12-03 08:51:47

---
title: Advent of PBT 2021 - Day 3
published: true
description: Advent of Property Based Testing - Day 3
tags: challenge,testing,webdev,javascript
//cover_image: https://direct_url_to_image.jpg
---

> _Advent of PBT 2021 — Learn how to use property based testing and [fast-check](https://github.com/dubzzz/fast-check) through examples_

Today we will cover an _algorithm_ often taken as an example when we talk about tests. While it is most of the time not really representative for real world examples let's cover it...

Our algorithm today is: **fizzbuzz**.
It comes with the following documentation and prototype:
```ts
/**
 * FizzBuzz
 *
 * @param n - The value to consider
 *
 * @returns Fizz if divisible by 3, Buzz if divisible by 5,
 * the number as a string if none of the conditions apply
 */
declare function fizzbuzz(n: number): string;
```

A more detailed explanation of what you should expect out of it is given by Wikipedia in https://en.wikipedia.org/wiki/Fizz_buzz.

In order to clarify our expectations, we already wrote some examples based tests for it:
```ts
it("should be itself for 1, 32 or 121", () => {
  expect(fizzbuzz(1)).toEqual("1");
  expect(fizzbuzz(32)).toEqual("32");
  expect(fizzbuzz(121)).toEqual("121");
});

it("should be Fizz for 3, 6 or 33", () => {
  expect(fizzbuzz(3)).toEqual("Fizz");
  expect(fizzbuzz(6)).toEqual("Fizz");
  expect(fizzbuzz(33)).toEqual("Fizz");
});

it("should be Buzz for 5, 10 or 50", () => {
  expect(fizzbuzz(5)).toEqual("Buzz");
  expect(fizzbuzz(10)).toEqual("Buzz");
  expect(fizzbuzz(50)).toEqual("Buzz");
});

it("should be Fizz Buzz for 15, 30 or 150", () => {
  expect(fizzbuzz(15)).toEqual("Fizz Buzz");
  expect(fizzbuzz(30)).toEqual("Fizz Buzz");
  expect(fizzbuzz(150)).toEqual("Fizz Buzz");
});
```

How would you cover it with Property Based Tests?

In order to ease your task we provide you with an already setup CodeSandbox, with examples based tests already written and a possible implementation of the algorithm: https://codesandbox.io/s/advent-of-pbt-day-3-vt4j2?file=/src/index.spec.ts&previewwindow=tests

You wanna see the solution? Here is the set of properties I came with to cover today's algorithm: https://dev.to/dubzzz/advent-of-pbt-2021-day-3-solution-366l

---

[Back to "Advent of PBT 2021"](https://dev.to/dubzzz/advent-of-pbt-2021-13ee) to see topics covered during the other days and their solutions.

More about this serie on [@ndubien](https://twitter.com/ndubien) or with the hashtag [#AdventOfPBT](https://twitter.com/search?q=%23AdventOfPBT).
Linux probably isn't for you
Tags: linux, opensource, programming, productivity
Published: 2021-12-04 03:46:21

Look, Linux isn't all *bad*. Linux is way **good** at some sectors but ***not good at a lot sectors***. It's five years since I call myself a Debian user. 
I was perfectly good with Linux as a web developer and automation engineer but got some issues while starting game development. Assets development is a lot hard, especially for 2d games. 

Also, editing videos, and making graphics is a lot hard.

I once installed Linux on two of my friends' computer, they both **complained** to me, *Word Processing software*, *image editing* and gaming is a headache in Linux. We were science students, but both of them complained and forced me to install Windows back.
So, here we can see Linux is not for everyone.

If you are a tech-savvy person who loves to tinker, you'll probably have great fun using it. Also, Linux is considered to be more secure than Windows, and in many ways, it's more customised.

However, if you're the type of user who likes to press the power button and have everything just work smoothly and without hiccups, you should give it a wide berth. If you think Windows occasionally gives you a headache, you haven't seen anything yet.

And, if you think Linux is not a controversial, silent and peaceful piece of Operating system, then Linux is surely not for you. Here is a [controversial (DO NOT CHECK IT, IF YOU'RE A HARDCORE LINUX FANBOY)](https://webmatrices.com/d/325/1), yet good to discuss/post in the forum.

Linux based OS has some bugs, they pop while you're doing something important. You need to find the solution yourself, sometimes you could not be able to use your GUI of the PC, all you have to do is use CLI, only CLI. So, using Linux makes you strong, brave and smart. It gives you more connection with the backend of your OS.


### Why Linux is not for you?
1. Game Development
2. Graphic design, photo editing and tweaks (For fans of Krita and GIMPS is also available in Windows, so why switch?) 
3. Gaming
4. Video Editing
5. Normal web browsing and emailing
6. Word Processing

### Why Linux is for you?
1. Web development
3. Bot development
4. Docker and Kubernetes
5. Machine Learning and MLOps
6. Linux do have good FPS but lacks the actual games to play
7. Normal web browsing and emailing

> Simply, what I am trying to say is: 
Use Linux only for development purposes (except Indie Game Development, because you have to struggle for simple things related to game assets, also most of the games in itch.io are built for windows, let's not talk about VirtualBox because at the end of the day we will be using windows.).
Get Your First Users, but DO NOT make money with it
Tags: webdev, beginners, productivity, career
Published: 2021-12-04 03:17:55

So, you have developed your product/web/app. I dunno what your web app/app or product is, but getting you first users is really very important. And you just have to do everything and anything that comes to mind and whatever you think will work. 

So in our case, we joined various Facebook groups and Linkedin groups and shared about our web app, yes that work but not in a large scale, we got the first 13 users through it. And then we tried another idea, and got our first 673 users.

### Seek for users' hangout station
We knew we should approach users where they're mostly active, where they hangout the most, online or offline. If your users are online that'll be great, they may hangout in any forum, Reddit forums or LinkedIn groups. You must need to seek for the community for your users.

### Approach your users, and DO NOT ...
Well, this is the most hard, yet most significant part of make your first user base. You must keep in mind, while sharing about your app with your upcoming users, do not make is formal or direct.
#### Do not make it like this
> "This app really helps you to learn Japanese, to install it click below"
If you did it like this, I can assure you that your web app or app never gonna be discovered or installed by anyone. 
 
#### Make it something like this
> "Are you  trying to learn Japanese, well using this app help me and my fried to learn it".
Relate with people, make them feel good and motivate them on what they're trying to achieve, and connect your app with it. Human being are more emotional than rational.
OR you can talk with admins in [Webmatrices Forum](https://webmatrices.com/), and know what is the best caption to share while approaching your targeted audience.  

### DO NOT MAKE MONEY
Do not attach any kind of ads or promotional content in your website in the initial phases, until and unless you get 1,000 users NEVER display advertisement in your web app or app. Yes, you can increase your "number of users to start attaching ads in the web/app.", you can make it 2,000 if you want.

### Use analytical tools
Those are fools, who do not use analytical tools and try to market them on the web. I extremely force you to use analytical tools, for web apps you can use Google Analytics, and for Mobile Apps, Google Play Console can fulfill the requirements of an analytics tools.

## Conclusion
Firstly, know where your targeted audience exists or hangout the most, it can be an online community or similar. Let them know about your web app in an emotional informal way. Also, keep track of things, events and clicks of users with the analytical tool you're using in your web/app. And remember NOT to attach ads on them.
Go range loop: Failed to change value of entry
Tags: go, loop, trounbleshooting
Published: 2021-12-04 03:16:43

I found my misunderstanding on [Go](https://go.dev/) the other day.

```go
arr := []int{1, 2, 3}
for _, entry := range arr {
    entry += 1
}
fmt.Printf("%v", arr)
// [1 2 3]
```

The result is not [2 3 4] 😅

This is because each entry which range returns is:

> [a copy of the element at that index](https://tour.golang.org/moretypes/16)

In order to change value of element in array, use basic for loop with index 🙂

```go
arr := []int{1, 2, 3}
for i := 0; i < len(arr); i++ {
    arr[i] += 1
}
fmt.Printf("%v", arr)
// [2 3 4]
```

---

This post is based on my tweets:
{% twitter 1459433013196955650 %}
Contributing to Telescope - Release 0.4
Tags: opensource, typescript
Published: 2021-12-04 03:08:30

While its been a busy week studying for final exams, I was able to work on contributing to Seneca's open-source project, [Telescope](https://github.com/Seneca-CDOT/telescope) for my final project. I chose to fix the issue of the [search page re-rerendering on input](https://github.com/Seneca-CDOT/telescope/issues/2554). This was due the HTML 5 attribute, <code>autoFocus</code> that was removed in a recent commit. 

ESLint recommends against using the attribute for accessibility purposes, however some [sources](https://brucelawson.co.uk/2009/the-accessibility-of-html-5-autofocus/) indicate that it is acceptable, so long as the page is mainly used for searching such as in this case. 

Accessibility is very important for users on the web. I want t o ensure this does not impact screen readers in a negative way. I know fairly well how important they can be for people like myself who are visually impaired. 

Moving forward, I plan to also fix the rendering of the page after text is placed in the input field.  The search page is supposed to search for results after the user inputs text, but does not seem to work unless the search button is clicked. 

Contributing to Telescope has been fun and provides me with more experience for working on larger, more complex projects.  I will continue to contribute more to Telescope in the days ahead!
Planning: How to contribute to an open source project
Tags: opensource, beginners, programming, github
Published: 2021-12-04 02:27:41

For the last assignment(we call Release) of my open source course, I decided to contribute to an open source project which is my college's C language course notes. I had 3 Releases so far, and this 4th Release requires something larger and more impactful than anything I have done previously.
Repository: [IPC144](https://github.com/Seneca-ICTOER/IPC144)

## Why did I choose this project?
I contributed to the project in my last Release, and also I'm familiar with the course notes as well. Moreover, when I worked on my last [issue](https://github.com/Seneca-ICTOER/IPC144/issues/87) and [pull request](https://github.com/Seneca-ICTOER/IPC144/pull/100), I tried to unify the format with other people's PRs, but people modified in different ways, so I felt unsure.

## Issue
The [issue](https://github.com/Seneca-ICTOER/IPC144/issues/64) I will work on is about "Standardize frontmatter across all pages".

## How I will work on it
I have never done standardizing for a project except my own projects, so it's challenging for me, but I will address this issue based on the following points:
- Read and check all pages
- Standardize frontmatter
- Review PRs and request changes based on the standardization
- Run Prettier and unify the format
- Try to find and modify to standardize pages
- Review

## My schedule
I started working on it late, but this Release's due date is next Friday(Dec 10th) so that I only have 7 days. Therefore, my plan is make as much as progress as I can until Monday. I will review my progress and write about it here, and make a PR on Tuesday.
I will try to complete this Release, study, go to work, study... no sleep!:muscle:

(Photo by Jon Tyson on Unsplash)
Terminal game that generates golf drills
Tags: python, beginners, discuss
Published: 2021-12-04 02:25:45

Hi everyone, first time poster here. I am currently working my way through a pro series on Codecademy and just finished up my first "portfolio project." Any critiques (or supportive comments) would be appreciated. Also let me know if I am botching this blog post. Including the code here felt a little weird, but if that is cool to do, let me know.

The program I created generates a golf drill for the user to implement in their own practice. I am a big golfer myself and I thought it would be fun to create something that gives a drill based on what the user wants to work on and how good they are. A little bit of golf knowledge is required to know what is going on. If you understand what a golf handicap is and the basic skill areas of the game, you should be good to go! I included a limited number of drills because I didn't want to go all out on the project, but a couple options gives a good sense of what is going on.

Here is a [link](https://github.com/wmansfieldgolf/Terminal-Game.git) to the code in GitHub and attached is a photo of the program in action.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3jxnrt5lqmnpqnp88ueb.png)
Ben Computer News
Published: 2021-12-04 02:24:59

Công ty cồ phần Ben Computer là công ty tốt nhất chuyên phân phối giải pháp công nghệ trong việc máy vi tính, mobile, máy móc office, trang thiết bị số, máy móc giải trí
. Truy cập trang Ben tin tức công nghệ để theo dõi thêm thông tin.
Địa chỉ Ben Computer Số 7, Ngõ 92 Nguyễn Khánh Toàn, Quan Hoa, Cầu Giấy, Hà Nội
Software Development Company | IT Consulting 
Published: 2021-12-04 02:17:14

Flatworld Edge, a division of Flatworld solutions, is a leading Software Development Company in India and MS certified partner. With over 10+ years of experience, they delivered 600+ projects in 45+ countries. Our solutions include Microsoft Office 365 migration, Cross-Platform app development, BI Solutions, Service Now, Azure Cloud and Services include Mobile app development, Data Science, Infrastructure Management and Testing Services. For more details, Reach out to us on (+1.855.213.8552) [https://www.flatworldedge.com/](https://www.flatworldedge.com/)