teleren/devto huggingface dataset:
textField and textEditControl ,Get user input on button click - Flutter
Published: 2022-02-22 08:05:33

I am building a chat screen and trying to get messages from textEditController instead of getting them from the message model.


Code below: 

```
 TextEditingController _controller =
  new TextEditingController();

String _text = '';

...


IconButton(
        icon: Icon(Icons.send),
        iconSize: 25.0,
        color: Theme.of(context).primaryColor,
        onPressed: () async {
          DataModel? data = await submitData(_controller);
          _dataModel = data;
          setState(
            () {
              _text = _controller.text.toString();
            },
          );
        },
      ),

....

 child: TextField(
          controller: _controller, 
          textCapitalization: TextCapitalization.sentences,
          onChanged: (value) {},
          decoration: InputDecoration(hintText: 'Send a message...'),
        ),
```
Today's Daily Humor For Devs - Daily Developer Jokes
Tags: jokes, dailydeveloperjokes
Published: 2022-02-22 08:00:23

---
title: "Today's Daily Humor For Devs - Daily Developer Jokes"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258a3e5534.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ Why did the developer ground their kid?

___A:___ They weren't telling the truthy
 -->
Effective Java, apuntes
Tags: java
Published: 2022-03-05 06:58:41

---
title: Effective Java, apuntes
published: true
date: 2022-02-22 07:56:52 UTC
tags: java
canonical_url: https://jorge.aguilera.soy/blog/effective-java/intro.html
---

 ![portada](https://jorge.aguilera.soy/images/effective-java/portada.jpg)

Hace mucho tiempo (demasiado) me leí la primera edición de este libro, imprescindible para todo programador Java y tengo que admitir que cayó en el olvido, pero más por mi culpa que por el libro. Muchos de los consejos que se recogen en él los vas aprendiendo después de enfrentarte a situaciones y no saberlas resolver e ir viendo cómo otros las han resuelto de forma elegante, cuando en realidad podía haberlas aplicado yo mismo si hubiera leido con antención en su momento.

Creo que parte de olvidar muchas de las cosas que leemos (técnicas) es que no las ponemos en práctica inmediatamente, así que esta vez que ha caído la tercera edición en mis manos voy a intentar ir "tomando apuntes" y escribiendo por aquí los resúmenes

Así que este primer post es más un compromiso de subir futuros artículos que uno en sí mismo, lo admito.

A modo de guía, y fusilando por completo el índice del libro, iré desmenuzando:

- crear y destruir objetos, más allá del constructor y del null

- los dichosos equals, hashCode y toString

- Interfaces (aquí hay tela marinera)

- Genéricos

- Enums

- Lambdas y Streams, aquí usaré probablemente otro libraco que viene muy bien explicado

- Excepciones. Nadie sabemos usarlas de verdad

- Concurrencia. Nota mental, desmenuzar GPars

- Serializacion, me da que esto ya casi nadie habla de ello
มาเล่น Tailwind CSS กับ Angular กัน
Tags: javascript, tailwindcss, css, angular
Published: 2022-02-22 07:56:07

**Tailwind CSS** คืออะไรกันนะ Tailwind คือ Utility-First CSS Framework ตัวนึงที่จะช่วยทำให้เรา styling element ได้อย่างรวดเร็วโดยที่เราไม่ต้องไม่ต้องไปเขียนคลาสเอง

##ข้อดี
* เพื่อป้องกัน ชื่อ class ซ้ำกันกับ parent component เป็นสาเหตุที่ทำให้เกิด style collision
* การ Styling ในโปรเจกต์ก็จะไปในทิศทางเดียวกัน
* ขนาดของ Css ที่ compile ออกมามีขนาดที่เล็กมากๆ ( เดี๋ยวจะเขียนบทความเพิ่มเติมเกี่ยวกับการ optimization ของ Tailwind ว่าเล็กตามคำโฆษณาที่เค้าโม้ไว้รึเปล่า 😂)

หลังจากที่เกริ่นมาสักพักเรามาเริ่มติดตั้ง Tailwind ใน Angular กัน

##การติดตั้ง
* ติดตั้ง Angular CLI ด้วย npm หรือ yarn

```
// NPM
npm install -g @angular/cli

// Yarn
yarn add @angular/cli
```
* สร้างโปรเจกต์ Angular
```
ng new angular-tailwind
cd angular-tailwind
```
* ติดตั้ง Tailwind Css ใน project
```
// NPM
npm install -D tailwindcss postcss autoprefixer

// Yarn
yarn add tailwindcss

// สร้างไฟล์ Tailwind config
npx tailwindcss init
```
* ไปตั้งค่าใน tailwind.config.js ( อยู่ระดับเดียวกับ package.json ) เพิ่ม "./src/**/*.{html,ts}", ใน content

```
module.exports = {
  content: [
    "./src/**/*.{html,ts}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}
```
* เพิ่ม Tailwind ไปใน style ของเรา ( ตรงนี้อาจจะแตกต่างกันถ้าหากเลือก style config ตอนสร้างโปรเจ็ค Angular )

1.1 เลือก Style แบบ CSS
```
@tailwind base;
@tailwind components;
@tailwind utilities;
```
1.2 เลือก Style แบบ SCSS หรืออย่างอื่น
```
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
```
* Start build process
```
ng serve
```

ลองเล่น Tailwind CSS กัน ให้ลอง copy code ด้านล่างนี้ไปแปะใน app.html ดูว่าออกมาสวยงามไหมถ้าใช่ ขอแสดงความยินดีด้วย เราได้ติดตั้ง Tailwind CSS เรียบร้อยแล้ว แต่ถ้าไม่ Comment มาได้เลยเดี๋ยวมาดูกันว่าติดตรงไหน

{% embed 
https://gist.github.com/kanomtang/ce2ca0dfb92acc20b241f0022b241b02 file=gistfile1.txt %}

---
แต่เดี๋ยวก่อนนอกจากข้อดีแล้ว ยังก็ยังมีข้อเสียอยู่นะ
##ข้อเสีย
* ถ้าเราทำงานเป็นทีม อาจจะต้องมีการสื่อสารที่ดีว่าจะเปลี่ยนจากการ styling element แบบที่เคยทำมาเป็นการใช้ Tailwind

* ฝั่ง html ลายตามาก เพราะ styling ทุกอย่างเราเอามาใส่ในฝั่ง html ไม่ได้เขียนแยกเป็น style file ( css, scss หรืออื่นๆ )

* อาจจะต้องใช้เวลาเรียนรู้นิดนึงว่า Design system ของ Tailwind นั้นเป็นยังไงเช่น Color, Spacing, Sizing, Typography และอีกมากมาย

##สรุป
**Tailwind CSS** ถือว่าเป็นอีกทางเลือกนึงที่เราจะกำจัดปัญหาเรื่อง Style collision แล้วลดเวลาเรื่อง Design system แถมยังลดเวลาในการ styling element อีกด้วย

---
##แถม
ติดตั้ง Extension เสริมเพื่อให้ใช้ Tailwind ได้ง่ายขึ้น

* InteliJ จริงๆ ฝั่ง Jetbrain support อยู่แล้ว แต่ถ้าอยากอ่านละเอียดไปที่ [ลิ้งค์](https://www.jetbrains.com/help/webstorm/tailwind-css.html) ได้เลย
* VSCode [ตามลิ้งค์นี้ได้เลย](https://tailwindcss.com/docs/editor-setup#intelli-sense-for-vs-code)

ตามไปดู Code  ได้ที่

Repository : [Github](https://github.com/kanomtang/angular-tailwind)
Let's play Tailwind CSS with Angular
Tags: javascript, tailwindcss, css, angular
Published: 2022-02-22 07:46:22

**What is Tailwind CSS** Tailwind **CSS** is a utility-first CSS framework packed with classes for quickly custom user interfaces without creating our classes.


##Pros

* Prevent classes name of parent and child components are duplicate leads to a style collision problem.
* Make styling elements direction in a project the same way.
* Compile size of a CSS file is smaller than traditional styling ( I will write the articles about optimization Tailwind later, I hope files size are smaller following their advertisement 😂).

After talking about Tailwind, Let's start to install Tailwind to our project!.

##Installation

* Install Angular CLI with npm or yarn.

```
// NPM
npm install -g @angular/cli

// Yarn
yarn add @angular/cli
```

* Create Angular project.

```
ng new angular-tailwind
cd angular-tailwind
```

* Add Tailwind CSS into our project.

```
// NPM
npm install -D tailwindcss postcss autoprefixer

// Yarn
yarn add tailwindcss

// Create file Tailwind config
npx tailwindcss init
```
 
* Add some settings in tailwind.config.js ( same level as package.json ) add `"./src/**/*.{html,ts}",` in **content**

```
module.exports = {
  content: [
    "./src/**/*.{html,ts}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}
```

* Add Tailwind in our main style sheet ( It is different when you select style config when creating Angular project ).

1.1 Select Style as CSS

```
@tailwind base;
@tailwind components;
@tailwind utilities;
```

1.2 Select Style as SCSS or else

```
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
```

* Start build process

```
ng serve
```

* Let's try to apply Tailwind to our HTML code. If you can run the code and its beautiful display on the website congratulations!, you are finished adding Tailwind to the project. But f you are stuck adding Tailwind to our project please let me know in the comment.

{% embed 
https://gist.github.com/kanomtang/ce2ca0dfb92acc20b241f0022b241b02 file=gistfile1.txt %}

---

However, Tailwind CSS still has CONS.

##CONS
* We need to have good communication among the team. Because we change the way to style elements.

* The styles are mixed in HTML code makes it hard to understand.

* Take time for learning about utility classes of Tailwind such as Color, Spacing, Sizing, Typography, and so on.



##Conclusion

**Tailwind CSS** is an alternative way to styling elements and helps eliminate the styling collision problems also reduces time to create a design system and styling elements.

---

##Bonus
Install extensions for used Tailwind efficiencies.

* InteliJ The JetBrains already supported Tailwind CSS. If you want to read more, I provided this [link](https://www.jetbrains.com/help/webstorm/tailwind-css.html)
* VSCode [link](https://tailwindcss.com/docs/editor-setup#intelli-sense-for-vs-code)

My code.

Repository : [Github](https://github.com/kanomtang/angular-tailwind)


If something's wrong, incomplete or you want to share the experience. Please let me know in the comment.
Thank you for taking the time to read this😘.
Growing up
Tags: discuss, personal, improvement, growth
Published: 2022-02-22 07:44:12

---
title: Growing up
published: true
description: The greatest day in your life and mine is when we take total responsibility for our attitudes
tags: discuss, personal, improvement, growth
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2gvhjahlf8m9xdgff0bi.jpg
---

_Originally published on [my blog](https://www.nikola-breznjak.com/blog/daily-thoughts/growing-up/)._

> The greatest day in your life and mine is when we take total responsibility for our attitudes. That's the day we truly grow up. ~ John Maxwell
>
> This one really hits home - what 'thing' are you blaming on your circumstances, instead of taking the responsibility?

---

This is [why I write](https://www.nikola-breznjak.com/blog/daily-thoughts/why-do-i-write-these-daily-thoughts-posts/) these 'daily thoughts' posts.
Create and Debug .Net / dotnet Core Console Application
Tags: dotnet, csharp, console, debug
Published: 2022-02-22 07:43:52


Explained how to create .net core application using .net SDK and how to debug it using Visual studio Code.

Install .net SDK and VSCode setup :  https://youtu.be/55qwQhdzkLM

{%youtube PjQOWLOttbA%}
Hi all,
Tags: beginners, programming, html
Published: 2022-02-22 07:41:40

Hi all,
I am Roshan. I am an SEO executive, working for a company called FACTS Computer Software House L.L.C. I am responsible for driving traffic to our company site. I created a WordPress site for the company. I need suggestions for modifications from you guys. This  is [my site](https://www.facts.ae/).
Sensor Tower : How to research keywords for your apps.
Tags: android, beginners, programming, tutorial
Published: 2022-02-22 07:37:20

<iframe width="560" height="315" src="https://www.youtube.com/embed/ACVepGDcvAM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

[Youtube Video](https://youtu.be/ACVepGDcvAM)
Golang automatic code formatting : Code like a Pro
Tags: go, formatting, vscode
Published: 2022-02-22 07:31:02

### Why Format your code?

Everyone loves clean readable and beautifully organized code using tabs/spaces (whatever you like), short lines etc. As a developer, while writing code, you should not spend time counting the tabs/spaces, instead let the tools handle your code formatting for you and that too automatically.

In this short post, we will learn how you can use `golines` to automagically format all your golang code

### Implementing Golines: a Golang formatter

- Installing golines
```
go install github.com/segmentio/golines@latest
```
- Using golines from VSCode
    - Go into the VSCode settings menu, scroll down to the section for the `Run on Save` extension, click the `Edit in settings.json` link
    - Set the `emeraldwalk.runonsave` key as follows
    ```
    "emeraldwalk.runonsave": {
        "commands": [
            {
                "match": "\\.go$",
                "cmd": "golines ${file} -w"
            }
        ]
    }
    ```
    - Save the settings and restart VSCode
- (optional) using golines from CLI
```
golines -w "path to *.go files"
```
### Summary
golines together with vscode helps you autoformatt your code 
#### from 
```
myMap := map[string]string{"first key": "first value", "second key": "second value", "third key": "third value", "fourth key": "fourth value", "fifth key": "fifth value"}
```


#### To


```
myMap := map[string]string{
	"first key": "first value",
	"second key": "second value",
	"third key": "third value",
	"fourth key": "fourth value",
	"fifth key": "fifth value",
}
```

Isn't this beautiful, I know it is ;)


![](https://raw.githubusercontent.com/ksingh7/blogs/main/posts/assets/thats-all-folks.gif)
Day 29/100 Java
Tags: 100daysofcode
Published: 2022-02-22 07:22:58

Roll on section 9.

Day 29/100

**Language:**
JAVA

**Time Period Spent:**
2 hrs

**Course Taken:**
Udemy: Java Programming Masterclass - Tim Buchalka

**Today's Learning:**
- Interfaces
- Research on interfaces.

**Additional Notes:**
The interface must be "implemented" (kinda like inherited) by another class with the implements keyword (instead of extends). The body of the interface method is provided by the "implement" class. Normally we implement interfaces for two reasons, security and to allow multiple inheritance in a class. An interface implements blueprint of a body that another class inherits from basically.
Download Forge Minesters 1.18.1 ➡ 1.12.2 - How To Install Forge in Minecraft
Tags: minecraft, forge
Published: 2022-02-22 07:14:41

## Forge
Forge is an application that supports Forge modding. Forge can be used to create, edit and share Minecraft mods. Forge comes in the form of a launcher with which you can easily install Forge-compatible mods into Minecraft . Forge was created by Lex Manos in 2011 after he failed to convince Mojang employees Jeb and Dinnerbone to add Modding capabilities to the game so he decided to code his own version himself. 

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

## How To Install Forge

- 1. Download Minecraft Forge installer.
- 2. Run installer as Administrator.
- 3. Select Install Client or Install Server if you want to install for your server.
- 4. Hit OK.
- 5. Open Minecraft launcher and select Minecraft Forge in Profile menu
6. Run game and explore your new mod.
My Frist project
Published: 2022-02-22 07:13:47

My Frist project was '**Password Generator**'. 
**What is the use of password generator?**
A password generator is a software tool that creates random or customized passwords for users. It helps users create stronger passwords that provide greater security for a given type of access.. 
So i created this using Python.

Here is the code.

import random
lower = "abcdefghijklmnopqrstuvwxyz"
upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
number = "0123456789"
symbol = "&-_+=#"
all = lower+upper+number+symbol
length = 10
password = "".join(random.sample(all,length))

print(password)
 
Comment your suggestions.
Thank you.
Laravel Modules new docs website
Published: 2022-06-04 20:56:29

---
title: Laravel Modules new docs website
published: true
date: 2022-02-22 06:53:13 UTC
tags: 
canonical_url: https://dcblog.dev/laravel-modules-new-docs-website
---

I've recently started helping Nicolas Widart with his awesome package [Laravel Modules](https://github.com/nWidart/laravel-modules)

I've now released a dedicated documentation website [https://docs.laravelmodules.com](https://docs.laravelmodules.com) and added versions 7, 8 & 9 These new versions include details for advanced usages:

- Artisan Commands
- Facade Methods
- Module Console Commands
- Module Methods
- Module Resources
- Languages
- Tests
- Publishing Modules
- Registering Module Events
- Livewire
- Spatie Laravel Permission
- Custom Module Generator

Also a new Twitter account [@laravel\_modules](https://twitter.com/laravel_modules)

[https://twitter.com/laravel\_modules/status/1494610708515987465](https://twitter.com/laravel_modules/status/1494610708515987465)
Conditional Formatting in React Pivot Table
Tags: react, reactnative, webdev
Published: 2022-02-22 07:10:34

Learn how easily you can format the appearance of Syncfusion [React Pivot Table](https://www.syncfusion.com/react-ui-components/react-pivot-table) cells with user-defined styles based on conditions. Also, learn how to change the background color, font color, font family, and font size based on specific conditions. 

Product Overview: https://www.syncfusion.com/react-ui-components/react-pivot-table

Download an example from GitHub: https://github.com/SyncfusionExamples

Refer to the conditional formatting documentation for the Syncfusion React Pivot Table component: https://ej2.syncfusion.com/react/document

Interact with the conditional formatting demo for the React Pivot Table: https://ej2.syncfusion.com/react/demo

{% youtube sKFvB8lDw2g %}
Complete Flask - Part 1: Basics of Flask
Tags: python, flask, backend, webdev
Published: 2022-02-22 06:29:57

Prerequisites:
- Python
- A text editor of your choice
- Lots of excitement!
 
Ok, you learned Python and want to use your skills to build something. 

One of the main uses of Python is _web development_,
and there are quite a few technologies to do that. 

Some of the most popular ones are:
- **Flask**
- Django
- FastAPI

You are going to learn Flask today, which is a micro-framework and minimalistic. 

To get started open up a terminal and make sure your Python is working by typing: `python`

I am using Python 3.9.0 but you can use any version greater than 3.6 

Install flask by using: `pip install flask`

## Basic Hello World

So now let's get coding by creating a basic Hello World app.

Create an app.py file in the root folder and import the Flask class from flask like this:

```python
from flask import Flask
```
Then create an app instance:

```python
app = Flask(__name__)
```
`__name__` refers to the name of the current module and it is passed as an argument to Flask. 

Now create a route decorator with '/' (single slash means home page):

```python
@app.route('/')
```
Just below the decorator create a home function that returns the text "Hello, World!":

```python
def home():
    return "Hello, World!"
```

The complete code of hello world app:

```python
from flask import Flask

app = Flask(__name__)

@app.route('/')
def home():
    return "Hello, World!"
```

Run the app using `flask run` and if you are getting an error like **could not locate a flask application**, rename the hello world file to app.py as I already mentioned and that should work.

Now go to localhost:5000 and you should see _Hello, World!_

That's it for Part 1, I will be releasing Part 2 soon and there is a lot to cover so stay tuned!
Number of 1 Bits
Tags: dsa, python, beginners
Published: 2022-02-21 05:46:21

##Instructions

##Approach
There are several ways to solve this problem. Let's look at a few.

####Using count()
We convert the decimal number to binary, replace "0b" with no value and count the number of 1's

###Implementation

```python
def hammingWeight(self, n: int) -> int:
        bits =  bin(n).replace("0b", "")
        return bits.count('1')

```
##Using the bit_count() method
The method returns the number of ones in the binary representation of the absolute value of the integer. 

```python
def hammingWeight(self, n: int) -> int:
        return n.bit_count()
```
You can review [this resource](https://docs.python.org/3.10/library/stdtypes.html#int.bit_count) for a better understanding of the method.

###Bit Manipulation
We can loop through the number and count the number of 1's
Using the modulus operator(%) we can get the number of 1's and shift n to the right until all 32bits are zeros.

- 
n%2 will return 0 or 1 so the count only changes when it is a 1.

####Implementation

```python
def hammingWeight(self, n: int) -> int:
        count = 0
        while n:
            count += n%2
            n = n >> 1
        return count
```
This algorithm has a constant time complexity O(1) because we iterate through 32 bits.
The space complexity is O(1) because we do not need extra memory.

I hope you found this helpful. Let me know of other solution approaches.
TypeScript Readonly Utility type
Tags: typescript, javascript, beginners
Published: 2022-02-22 06:03:03

This is the last of the commonly known interface modifying utility types.
Do note there are a few more, but we'll get to those in a later stage as they are a bit more advanced.

I want to go over the `Readonly` utility type in this article.

Using the read-only type, you can transform a type to be read-only, making it impossible to change after the initial assignment.

## Using the Readonly Utility type

Let's retake this user interface.

```js
interface User {
  id?: number;
  firstname: string;
  lastname: string;
  age?: number;
}
```

If we would now assign some information to this object, we could always re-assign it later in our code.

```js
const user: User = {
  firstname: 'Chris',
  lastname: 'Bongers',
};
user.id = 123;
```

We can now modify any of the existing properties to be a new value.

And we don't always want that.

So in order to prevent this from happening you can wrap the type used in a `Readonly` type like so:

```js
const user: Readonly<User> = {
  firstname: 'Chris',
  lastname: 'Bongers',
};
```

Which will give us the following TypeScript error.

![TypeScript readonly type](https://cdn.hashnode.com/res/hashnode/image/upload/v1644730309446/Ep9udmmle.png)

This Readonly type can be super helpful to represent frozen objects.
Or objects that should not mutate on their own.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Shogun Coders Dojo
Tags: programming, blockchain, nft, showdev
Published: 2022-02-22 05:43:18

Last year a buzzword that later turned into an art revolution came into the picture. NFT's or Non Fungible Tokens are now becoming a household name.
So my friend and I decided to launch an NFT project just for programmers. We present to you shogun coders dojo. A collection of 30 unique NFT's which represent a particular language or framework.
You can own one to show off your skills.

{% embed https://twitter.com/CodersDojo/status/1495317530696683520 %}
We also intend to provide custom NFTs on-demand with a nominal fee in the future.

You can buy the collection at [opensea](https://opensea.io/collection/shogun-coders).