teleren/devto huggingface dataset:
Variables in Java Programming 
Tags: java, programming, tutorial, beginners
Published: 2021-01-28 12:51:27

In this tutorial, we will study what is <a href="https://usemynotes.com/variables-and-constants-in-java/">variables in java</a> and what's are the type of variables in java programming. So let's go into the deep model. 

<h2>What is variable</h2>

A variable is a storage area where we store the data and the information. A variable is a holder that holds the value while the java program is executed. Variable also declare with a data type. When we declare a variable name the first letter of the variable should not be a digit. And the variable name should not be a keyword.

String name;
int number;

Here string is a data type and name is a variable of this data type.
<h2>Types of variable:-</h2>

<h3>Local Variable</h3>

A local variable always declares inside the body of the method and function. A local variable can be a static variable. The local variable should be initialized before accessing them.

Class Test
{
  public void sum()
  {
   int a, b=30, c=20; // declaring local variable a, b, c
   a = b + c;
   System.out.println(“Sum=”+a);
   }
  public static void main(String[] args)
 {
  Test obj= new Test();    // creating object
  Obj.sum();    // calling object
 }
}

<b>Output</b>
Sum = 50
<h3>Instance Variable</h3>
A variable that is declared inside a class but outside the body, method, constructor or block, is called an instance variable. Instance variable need not be initialized before using them as they are automatically initialized to their default values.

class Test
{
  int a, b=20, c=10;
  public void add()
  {
   a = b + c;
   System.out.println(“Sum=” +a );
  }
public void sub()
{
  a= b-c;
  System.out.println(“Sub=”+a);
}
 public static void main(String[] args)
 {
   Test obj= new Test();
    obj.add( );
    obj.sub( );
 }
}

<b>Output</b>

Sum =30
Sum=10
<h3>Static Variable</h3>

A variable that is declared with the static keyword, the Static variable is stored in the static memory. A static variable is regular to every one of the occasions (or objects) of the class since it is a class-level variable. you can say that only a single copy of the static variable is created and shared among all the instances of the class. Memory designation for such factors possibly happens once when the class is loaded in the memory.

<h3>Static variable Syntax</h3>

static keyword followed by data type and variable name

static data_type variable_name;

<h3>Static variable example in Java</h3>

class VariableDemo
{
  static int count=0;
  public void increment()
  {
    count++;
  }
public static void main(String args[])
 {
  VariableDemo obj1=new VariableDemo();
  VariableDemo obj2=new VariableDemo();
  obj1.increment();
  obj2.increment();
  ystem.out.println("Obj1: count is="+obj1.count);
  System.out.println("Obj2: count is="+obj2.count);
 }
}

<b>Output</b>

Obj1: count is=2
Obj2: count is=2
As should be obvious in the above model that both the items are having a similar duplicate of static variable that is the reason, they shown a similar estimation of check.
YouTube Video | React hooks 14 - Creating Custom hooks - 2
Tags: react, javascript, webdev, showdev
Published: 2021-01-28 12:47:04

In this video we will continue to learn to make custom hooks. With custom hooks we can add our own functionalities to hooks.Custom hooks can be used to share logic like HOCs and Render props.

{% youtube -CaZTF_7Uok %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
Best Hacks to Help You Improve Your Website Ranking
Tags: webcrawler, webdev, seo
Published: 2021-01-28 12:28:50

Every website owner desires to have high traffic on the website. Note that majority of people who search for information trust the sites that appear on the first page. If you search for the [website](https://www.forbes.com/sites/theyec/2019/11/01/seven-ways-to-optimize-your-business-website/) and it appears second or on the third page, then there is something you are not doing. What can you do to enable your site to rank high? Below are hacks you can adopt.

##Create Relevant Optimized Content

High quality, relevant content is vital if you want your site to rank on the first page. You should optimize the content by using relevant keywords. Several keywords will maximize the chances of many people coming to your website. Use relevant tools to help you know the right keywords to use.

##Regular Update

You do not expect your page to rank high if you only update once per year. Note that no matter how good the content is, you need to keep auditing the content and updating the blog. The search engine will consider the site relevant, making it rank top.

##Outbound Links

Have you built links on your website? Ascertain that you create links that direct others to your website from other high quality, relevant sites. Also, create links that direct people to other blogs on your website. Keep on checking if there are broken links and links to some relevant sources.

![Website](https://dev-to-uploads.s3.amazonaws.com/i/3shic7cmhp1iqdxgr4qy.jpg)

##Optimize Site for Mobile 

A high population around the world has a mobile phone. Therefore, if you optimize your site for mobile, it means people can use their phone to see your site's content. However, note that you need to ensure that the headline is attention-grabbing. Only then will curiosity drive many people to your site.

It could be you have tried everything to make your site rank top. Unfortunately, there is no traffic, and you are already giving up. Try to [use web crawler tool] (https://sitechecker.pro/website-crawler/) offers out there to help your site rank top. You will get traffic and earn good revenue.

##Encourage Social Media Sharing

Social media is an excellent platform to get traffic. Note that many people have joined social media platforms nowadays. If you were to post revenant content on your posts, then direct them where they can get more of that information, you would enjoy great traffic. Avoid engaging in irrelevant talks since people may never take you seriously.

###Conclusion

Are you wondering why your site is not ranking top? You should check the [quality of your content](https://www.huffpost.com/entry/the-importance-of-having-_2_b_9563304) and the keywords that you have included. If the content is okay, update it regularly. Use outbound links to get referral traffic. Optimize site for mobile to reach many people. Use social media platforms to direct people to your site.
YouTube Video | React hooks 13 - Creating Custom hooks - 1
Tags: react, javascript, youtube, webdev0
Published: 2021-01-28 12:41:40

In this video we will learn to make custom hooks. With custom hooks we can add our own functionalities to hooks.Custom hooks can be used to share logic like HOCs and Render props.

{% youtube 2K_Xjhssqpg %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
I Created A Fully Responsive Portfolio Website using WordPress
Tags: wordpress, webdev, javascript, html
Published: 2021-01-28 12:39:32

I have always wanted to create a portfolio website, to show who I am, my skills, interests and some of the projects I have worked on before to my potential clients. 

I realized that having a portfolio website has many advantages, as it helps you to show your creativity, helps your potential clients to visualize working with you and most importantly, it improves your chances of wining the job.

I therefore decided to create my own portfolio website using WordPress, mostly because WordPress makes it easy to manage my content, offers great responsiveness and helps in Search Engine Optimization. 

I would like to hear what your thoughts are concerning this website, what I should improve on, what I should remove or what amazes you.

Here's a link to my portfolio website--> http://willteksoftwares.co.ke/

Lastly, Kindly help me get to 2k subs on YouTube - https://www.youtube.com/channel/UCynEkLz6K_BJbI41AAcMg-w
Top 10 Reasons why Video games are good for you
Tags: game, news, research
Published: 2021-02-03 18:50:43

---
title: Top 10 Reasons why Video games are good for you
published: true
date: 2021-01-28 12:30:00 UTC
tags: Game,News,Research,game
canonical_url: https://centocode.com/top-10-reasons-why-video-games-are-good-for-you/
---

Research has shown that games are also good for health and both for the brain and the body. Video games are beneficial by the way they engage with different facets of our daily lives.

The post ["Top 10 Reasons why Video games are good for you"](https://centocode.com/top-10-reasons-why-video-games-are-good-for-you/) appeared first on [CentoCode.com](https://centocode.com).
YouTube Video | React hooks 12 - useRef hook
Tags: react, youtube, webdev, showdev
Published: 2021-01-28 12:29:44

In this video we will continue to learn  the useRef hook. The useRef hook makes it possible to access DOM nodes directly within functional components.


{% youtube SIz3xBIgqfM%}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
YouTube Video | React hooks 11 - Performance Optimization using useMemo hook
Tags: react, youtube, webdev, showdev
Published: 2021-01-28 12:19:26

In this video we will continue to learn  the useMemo hook. We will learn to optimize the performance of our React application using useMemo hook

{% youtube hFAgV613oAM %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
Extractive QA with txtai
Tags: ai, llm, rag, vectordatabase
Published: 2021-01-28 12:17:50

[![](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/05_Extractive_QA_with_txtai.ipynb)

In Parts 1 through 4, we gave a general overview of txtai, the backing technology and examples of how to use it for similarity searches. This article builds on that and extends to building extractive question-answering systems.

# Install dependencies

Install `txtai` and all dependencies.

```
pip install txtai
```

# Create an Embeddings and Extractor instances

The Embeddings instance is the main entrypoint for txtai. An Embeddings instance defines the method used to tokenize and convert a segment of text into an embeddings vector.

The Extractor instance is the entrypoint for extractive question-answering.

Both the Embeddings and Extractor instances take a path to a transformer model. Any model on the [Hugging Face model hub](https://huggingface.co/models) can be used in place of the models below.

```python
from txtai.embeddings import Embeddings
from txtai.pipeline import Extractor

# Create embeddings model, backed by sentence-transformers & transformers
embeddings = Embeddings({"path": "sentence-transformers/nli-mpnet-base-v2"})

# Create extractor instance
extractor = Extractor(embeddings, "distilbert-base-cased-distilled-squad")
```

```python
data = ["Giants hit 3 HRs to down Dodgers",
        "Giants 5 Dodgers 4 final",
        "Dodgers drop Game 2 against the Giants, 5-4",
        "Blue Jays beat Red Sox final score 2-1",
        "Red Sox lost to the Blue Jays, 2-1",
        "Blue Jays at Red Sox is over. Score: 2-1",
        "Phillies win over the Braves, 5-0",
        "Phillies 5 Braves 0 final",
        "Final: Braves lose to the Phillies in the series opener, 5-0",
        "Lightning goaltender pulled, lose to Flyers 4-1",
        "Flyers 4 Lightning 1 final",
        "Flyers win 4-1"]

questions = ["What team won the game?", "What was score?"]

execute = lambda query: extractor([(question, query, question, False) for question in questions], data)

for query in ["Red Sox - Blue Jays", "Phillies - Braves", "Dodgers - Giants", "Flyers - Lightning"]:
    print("----", query, "----")
    for answer in execute(query):
        print(answer)
    print()

# Ad-hoc questions
question = "What hockey team won?"

print("----", question, "----")
print(extractor([(question, question, question, False)], data))
```

```
---- Red Sox - Blue Jays ----
('What team won the game?', 'Blue Jays')
('What was score?', '2-1')

---- Phillies - Braves ----
('What team won the game?', 'Phillies')
('What was score?', '5-0')

---- Dodgers - Giants ----
('What team won the game?', 'Giants')
('What was score?', '5-4')

---- Flyers - Lightning ----
('What team won the game?', 'Flyers')
('What was score?', '4-1')

---- What hockey team won? ----
[('What hockey team won?', 'Flyers')]
```
How to take care of your health being a developer....
Published: 2021-01-28 12:17:17

As a software developer being always in front of screens, straining your eyes, sitting in one position managing all the tasks stressing a lot, all these can really impact our health but wait.... we can manage to take care of it simply following some basic things. what are these mantras...here it goes 

1. ### Hydrate enough
 have a bottle filled with water beside you or on your table. Trust me it helps a lot it will act as a cue and you will eventually develope a habit of drinking water regularly or take a break have a sip it won't give you wings but a boost for sure.

2. ### Blue light filters and Computer Glasses.
you can avoid being myopic or having a problem with shortsightedness by using blue light filters on your screens that gives a soothing experience to your eyes. check out blue light filter extensions and use them next time. special computer glasses usually they are called as blue cut glasses one can wear to protect eyes.

3. ### No Screen breaks.
avoid using your phone to get relaxed and shifting from one screen to another straining your eyes harder just for that short dopamine. instead move your body have a short stretching, call your friend, go outside see things that are far from you because your eyes strain a lot when you are seeing object nearby to make them feel good to try these technics you will feel refreshed if you can't go out just stare something which is 10 to 20 fit apart 

4. ### Eye exercises and Eyecare
simply washing your eyes with water frequently can be a saviour wash your eyes and rotate them clockwise anticlockwise, left-right yon the corners, close-open frequently and feel the difference. one can go for eye drops recommended by doctors to avoid dryness.

5. ### Stay Active
take breaks and stretch your body don't just sit idle run, walk, jump. working out at least 3 days a week changes brain functioning, fasten up oxygen circulations you will feel more active and fresh eventually you will get all the benefits. choose one hobby to keep yourself active be it sports, cycling, tracking, running etc.

6. ### Take weekly breaks
in the end, we are all human being and we need a break so don't stress much take a break go somewhere, interact with people have some life spend time with your friends and family and when you come back you feel like working more your efficiency will be higher. Don't get burnt out its a marathon not a one day sprint.
Yarn 💞 GitHub Sponsors
Tags: javascript, npm, node, news
Published: 2021-01-28 12:14:14

The [Yarn organization](https://github.com/yarnpkg) now accepts individual & corporate sponsorships via both [GitHub Sponsors](https://github.com/sponsors/yarnpkg) and [OpenCollective](https://opencollective.com/yarnpkg)! 🌟

Ever since its inception in 2016 the project operated without official structure allowing it to receive donations. While we made it work, developing expert tools like package managers revealed itself an extremely resource-intensive task. While our companies have been understanding, maintaining Yarn isn't part of our official job statements and many hours have to be spent maintaining the project and supporting our users during our spare time.

[As we're working on Yarn 3](https://github.com/yarnpkg/berry), we hope donations will help our core team justify this work while also giving us the resources needed to sometimes delegate parts of the maintenance to professionals (be it for external security reviews, website redesign, documentation proofreading, etc), thus further improving the quality of our production and letting us focus on building the very tool and workflows we all use everyday.

If you're interested to know more, feel free to ping our team on our [Discord server](http://discord.gg/yarnpkg) and we'll be happy to help!
My First React App
Tags: react, javascript, netlify, beginners
Published: 2021-01-28 12:04:00

Hello Everyone, this is my first post in the DEV community. I have recently started learning react for better front-end development. While learning I have created this app as a part of my learning. 

The react based web app is using openweather API.
Please do let me know if there any ways to improve this app.

App link - http://chicku97-your-weather.netlify.app

Regards,
Sankesh
Quick Survey: IT on-call experience in an "Always-On" world
Tags: sre
Published: 2021-01-28 12:02:37

"Thank you for the tremendous support! We received more than anticipated survey responses and we have closed this survey for now. Keep a lookout for our final report on the state of IT on-call in 2021."

If you’ve ever being on-call, we want to hear 📢 from you! We’re conducting a quick `#survey` to understand your `#oncall` experiences/challenges better. It will take about 3 minutes (yes, we timed it!). Receive a $10 Amazon gift voucher 🎁 in return!


`#ITmonitoring` `#oncall`
How do you do user testing?
Tags: testing, usertesting
Published: 2021-01-28 11:55:26

User testing, or ease of use testing, is a key part of structuring, settling, and propelling an incredible automated item. It's tied in with identifying usability issues at any phase of the item improvement cycle with the point of improving the general client experience. This is finished by checking how to delegate clients to cooperate with the item in a reasonable setting. Along these lines, you can see precisely what works and — more importantly — what doesn't. 

The issue numerous creators and item improvement groups have, in any case, is leading client testing that will recognize real item issues and configuration imperfections. This is justifiable. There are a ton of factors that can impact the quality and legitimacy of a convenience test. Things like a financial plan, tight cutoff times, members, deficiencies in staff, ineffectively organized inquiries, muddled models, and diverse testing situations can — and for the most part, do — devalue the conclusive outcomes.

To guarantee you set up a substantial user test you have to comprehend the <a href="https://www.testingxperts.com/blog/user-testing">user testing process</a>. I've written down 6 simple-to-follow ventures for effective user testing. How about we get straight into it.

Stage 1: Define Testing Objectives 

Stage 2: Choose a Testing Method 

Stage 3: Find Representative Users 

Stage 4: Create Task Scenarios 

Stage 5: Replicate the Testing Environment 

Stage 6: Analyze the Findings 

Client Testing: Test, Analyze, Repeat 

Effectively leading user testing doesn't need to be advanced science. It's very simple once you characterize your destinations, pick your testing technique, make your assignment situations, plan your inquiries, and report the outcomes.
Bookmark Launcher (launch your bookmarks from the terminal)
Tags: node, programming, shell, javascript
Published: 2021-01-28 11:54:28

This CLI allows you to open your bookmarks from the terminal. If you would like to, check it out in the Github repository:
-  https://github.com/joao-gouveia/bookmark-launcher

Let me know what you think!
If you would like to contribute or give ideas please reach out!

## Story
When I started using Windows instead of a MacOS to code at my job, I missed a lot of things. One of those was **Alfred**, which I used all the time, specially to quickly open URLs, either saved separately or from my Google bookmarks.

After searching for a Windows alternative to fit my use case I was not satisfied with what I found. Hence, I designed exactly what I was searching for: an App/CLI which parses my bookmarks and enables me to open them quickly from the terminal. Since I always have the terminal open (in MacOs I used iTerm2 with zsh and in Windows I use Cygwin with zsh) it works nicely for me.

I coded this CLI in Node JS and followed a Kanban approach (I even created stories in a board!) to make things more enjoyable since I love Agile.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ppttsuj7z40rxidyvfgj.png)

## Commands
The CLI is very simple to use.

### To read all your bookmarks and process them to a json file:
- `bml run-save`

### To launch a bookmark:
- `bml <bookmark_name>`
Open-sourcing Datanymizer: in-flight template-driven data anonymization
Tags: rust, opensource, programming, database
Published: 2021-01-28 11:25:11

Fakers, anonymizers, and obfuscators — there are various free and open-source data anonymization tools that have been around for a long time and work pretty well, so why did we create a new one? The one that supports globals, uniqueness constraints, inline rules, and other cool features.

We had some particular requirements we wanted our tool to meet. We didn't want the anonymizer to take a "raw" dump and mutate it. Instead, we needed to provide an already anonymized dump, without access to real data. The configuration that determined how the real system data would be anonymized should have been kept separate from that data.

We also wanted a tool that was flexible about how the anonymization itself takes place, ideally allowing the use of templates to populate field contents.

[Read more about the approach Datanymizer takes.](https://evrone.com/datanymizer)
Chrome DevTools: CSS Angle debugging
Tags: devlive, chrome, devtools
Published: 2021-01-28 11:13:54

Chrome added a new cool feature to Dev Tools in version 88.

It's a CSS Angle visualization tool and can be used to debug angles better visually.

Angles can be found in gradients and transforms, for instance.

How it works:

![Chrome DevTools angle visualization](https://cdn.hashnode.com/res/hashnode/image/upload/v1611389045248/6P65afm2Q.gif)

## Using the Chrome DevTools CSS Angle

First, we need to open the Chrome Dev Tools.

> Mac `Cmd` + `Shift` + `C` or Windows: `Ctrl` + `Shift` + `C`.

Now we can go to the `Elements` inspector and click the element we need.

Then in the `Styles` section, you will see these newly added gauges.

![CSS Angle Gauge in Chrome DevTools](https://cdn.hashnode.com/res/hashnode/image/upload/v1611389113241/qZIHYuwxz.png)

As mentioned, it is an angle tool, so it can debug a transform that will look like this:

![Chrome DevTools angle transform](https://cdn.hashnode.com/res/hashnode/image/upload/v1611389520828/x2fWUwHyl.gif)

Or you can use it to rotate a gradient you have on a specific element that looks like this:

![Chrome DevTools gradient angle](https://cdn.hashnode.com/res/hashnode/image/upload/v1611389550837/2Oudl4Kg_.gif)

If you want to have a play around, feel free to use this Codepen.

{% codepen https://codepen.io/rebelchris/pen/RwGmQBQ %}

### 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)