teleren/devto huggingface dataset:
Java: 4 ways to create a String! 💡
Tags: java, tutorial
Published: 2020-09-01 13:28:01

# The String Datatype:
A string is nothing but a collection of characters. In java, Strings are **immutable**. Immutable simply means unmodifiable or unchangeable. Once a string object is created its data or state can't be changed but a new string object is created.

# You can create a String using 4 ways in Java:
# 1. Using a character array
Character Array is a sequential collection of data type char.
```java
char[] array = {'s','t','r','i','n','g'};
```
# 2. Using String class
The String class represents character strings. All string literals in Java programs, such as "abc", are implemented as instances of this class. Strings are constant; their values cannot be changed after they are created. String buffers support mutable strings. Because String objects are immutable they can be shared.
```java
String str = "string";
```
# 3. Using StringBuffer
A thread-safe, mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method calls.
String buffers are safe for use by multiple threads. The methods are synchronized where necessary so that all the operations on any particular instance behave as if they occur in some serial order that is consistent with the order of the method calls made by each of the individual threads involved.
```java
StringBuffer  str = new StringBuffer("string");
```
# 4. Using StringBuilder
A mutable sequence of characters. This class provides an API compatible with StringBuffer, but with no guarantee of synchronization. This class is designed for use as a drop-in replacement for StringBuffer in places where the string buffer was being used by a single thread (as is generally the case). Where possible, it is recommended that this class be used in preference to StringBuffer as it will be faster under most implementations.
```java
StringBuilder str = new StringBuilder("string");
```
Now you know how to create a String, In the upcoming article I will be covering all the String methods that can be used to format Strings.

... To be continued 🎉
keep learning, keep growing 💖
4+ Best Responsive Eleventy Themes for Blog 2021
Tags: eleventy, 11ty, webdev, staticsites
Published: 2020-09-01 13:13:08

---
title: 4+ Best Responsive Eleventy Themes for Blog 2021
published: true
description: A collection of best Eleventy Themes and Templates perfect your Blog. Fully responsive, mobile-friendly and easy to use.
tags: Eleventy, 11ty, webdev, staticsites
---

Eleventy is a rising generator for JavaScript ecosystem. As a JS devs, you should definitively consider as Jekyll alternative. It perfectly integrates with your favorite package manager NPM and you'll not rely on Rails ecosystem. You really feels at home.

## Why do users choose Eleventy?

Eleventy is not only a Jekyll replacement, it comes up with great new feature as a site generator. It supports multiple template language (.md, .ejs, .pug, etc.), highly flexible and good integration with multiple source of date (API, file).

If you plan to use Eleventy as a static site generator for your next blog. You'll eventually consider to implement from scratch. Or, if you want to save time you should use a pre-made theme. And here, you'll able to find my short list of Eleventy Themes in 2021.

These themes are truly valuable and make it easier for you to build a blog.

## Blue Minimalist Eleventy Theme

![Minimal 11ty theme](https://creativedesignsguru.com/assets/images/themes/minimalist-blue-eleventy-theme-homepage.png)

A responsive and clean theme perfect for your blog or portfolio. A minimal first theme with no frills.

[Minimal Eleventy theme](https://creativedesignsguru.com/blue-minimalist-eleventy-theme/) - More info

## Blue Modern Eleventy Theme

![Modern 11ty theme](https://creativedesignsguru.com/assets/images/themes/modern-blue-eleventy-theme-homepage.png)

A modern and simple theme. On the homepage, a card grid with image and on the post page, a classic two-column.

[Modern Eleventy theme](https://creativedesignsguru.com/blue-modern-eleventy-theme/) - More info

## Blue Eclatant Eleventy Theme

![Portfolio 11ty theme](https://creativedesignsguru.com/assets/images/themes/eclatant-blue-eleventy-theme-homepage.png)

Awesome responsive two-column blog theme with blue as main color.

[Portfolio Eleventy theme](https://creativedesignsguru.com/blue-eclatant-eleventy-theme/) - More info

## Blue Dark Eleventy Theme

![Dark 11ty theme](https://creativedesignsguru.com/assets/images/themes/blue-dark-mode-eleventy-theme-homepage.png)

[Dark Eleventy theme](https://creativedesignsguru.com/blue-dark-eleventy-theme/) - More info

The only dark theme of the list. For all pages, you'll will have one column for the content and another column for the sidebar.

### Disclamer

I'm the author of all 4 themes. It all comes up with Tailwind CSS, lazy loading images (lazysizes), syntax highlighting (prism.js), HTML and CSS compressor (HTMLMinifier and cssnano). I've built these 4+ template with minimal code, SEO-friendly and Production-ready in mind.
react native com google sheets
Tags: reactnative, googlesheets
Published: 2020-09-01 13:02:57

Preciso colocar o retorno em uma variável para exibir outro componente, só estou conseguindo visualizar o retorno no console.log


const GoogleSpreadsheet = require ('google-spreadsheet')
const credentials = require('./src/credentials.json')
const { promisify } = require('util')

const docId = '1RPWKohhPnHwoH78wrU0VtSaW_zj91kW_oKrAdWktLjY'

const accessSheet = async() => {
  const doc = new GoogleSpreadsheet(docId)
  await promisify(doc.useServiceAccountAuth)(credentials)
  const info = await promisify(doc.getInfo)()
  const worksheet = info.worksheets[0]

// select row
  const rows = await promisify(worksheet.getRows)({
    query: 'imei = 121545465456'
  })
rows.forEach(row => {
  console.log(row.status)
})
}
accessSheet()
One Time Event Listeners in JavaScript
Tags: javascript, beginners, 100daysofcode, codenewbie
Published: 2020-09-01 12:40:23

It is very easy to add an event to any object in JavaScript by using `addEventListener()`. We can even add multiple event listeners to a single object that too of the same type. These events will not override each other and will execute properly as expected without affecting each other’s working.

```javascript
// Syntax
element.addEventListener(event, functionName, useCapture);
```
Event listeners are great, `addEventListener()` is used everywhere. But, there is a problem. The listener gets executed every time the event is fired. We may not want this to happen in each and every scenario.

The options parameter is an object that specifies configurations about the event listener. This allows us to configure the event listener with a once option to use it just for a single time. This is a cleaner approach and also we don’t have to keep track of the element or node.

```javascript
const button = documentgetElementById('button');

button.addEventListener(
  "click", () => {
    console.log('I will fire only once')
  },
  { once: true }
);
```
Best beginner electric guitars 2020
Published: 2020-09-01 12:28:49

So you're looking for the first-rate newbie's electric guitar in the global right now? Then which could simplest suggest one aspect: you've got decided to learn how to play guitar, and we could not be extra stoked to welcome you! Learning the guitar is one of the most rewarding things you may ever do, and we ought to recognise, as among absolutely everyone here are Guitar World we've been playing guitar for a completely, very long term. 

That additionally makes us perfectly-positioned that will help you locate the quality beginner electric guitar for you. Our manual is curated by means of professionals who live and breathe guitars, so it will help you quick slender down the high-quality electric powered guitar for how you want to play, and for the sort of song you'll revel in mastering. We've been via our fair percentage of novice's electric guitars over the a long time, so we recognize precisely which of them to expose you so that you don't waste a dime or some time. https://goodscompared.com/best-lightweight-electric-guitars/

If we sound mega excited it is due to the fact proper now there's in order that lots on offer in the manner of top electric guitars for beginners. The satisfactory and range is absolutely outstanding, thanks to how production strategies have progressed significantly to elevate the bar appreciably on great manage within the  access stage guitar marketplace. 

Put genuinely, it’s hard to discover a six-string in our great beginner electric guitars round-up that doesn’t tick all of these packing containers. Let's take a better look now and get you nearer, quicker, to your dream first electric powered guitar. 

    Buying for a child? Check out these high-quality guitars for kids
    Or get stimulated by the nice electric guitars inside the global
    And the excellent acoustic guitars for novices
    Explore the pleasant newbie guitar amps
    Acoustic vs electric guitar: which is quality for beginners?

In our simple, straightforward manual to electric powered guitars for novices, we will come up with a comprehensive evaluate of what you need to be seeking out while searching for your first ever electric guitar. 

From the distinct styles to be had, to the precise features and capabilities that be counted most while you’re first beginning out, our round-up has you fully included.
PerceptionBox.io
Published: 2020-09-01 12:03:11

WE BUILD & SCALE dedicated delivery teams for startups and SMBs

SUPERCHARGE the process of product development by building and scaling your software teams and R&D centers with top remote talent (flexible staffing and full- time staffing)

ELIMINATE HASSLE of searching, interviewing, hiring, and taking care of the administration and payroll of employees

WE OFFER Developers (Fullstack, Frontend, Backend, Mobile, DevOps, Gaming, & more). And any kind of tech talent you will need

Benefits of working with PerceptionBox

→ Fast turnaround, low employee markup, and highly scalable teams

→ You have 100% utilization rate (contractors work under your authority)

→ We recruit contract employees and act as the employer of record

PerceptionBox provides clients with custom full-cycle web and mobile application development services. In simpler words, we help businesses grow in today's world of innovative technologies. Our team consists of senior-level engineers, business analysts and consultants became a powerful asset to 20+ clients over the last two years. With PerceptionBox your business can access a team of 1 to 20 trained and equipped developers in a heartbeat. No need for recruiting or back-office pains. If you work with us, results are all you get.
Daily Developer Jokes - Tuesday, Sep 1, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-09-01 12:00:09

---
title: "Daily Developer Jokes - Tuesday, Sep 1, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Tuesday%2C%20Sep%201%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12594a73e61.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*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 document store go out of business?

___A:___ It had NoSQL.
 -->
100DaysOfCode | Day 27, 28(Flask)
Tags: 100daysofcode, challenge, python, beginners
Published: 2020-09-01 11:59:25

▄█ █▀█ █▀█ █▀▄ ▄▀█ █▄█ █▀ █▀█ █▀▀ █▀▀ █▀█ █▀▄ █▀▀
░█ █▄█ █▄█ █▄▀ █▀█ ░█░ ▄█ █▄█ █▀░ █▄▄ █▄█ █▄▀ ██▄

Hey There, how is it going everybody?
I'm still learninnnnnnnnnnnng!
Learning every-single day and consistency is the Key!
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/fjihv5vsd18vap2aqmsl.jpg)<figcaption>__Consistency is the _Key of success_!__</figcaption>

2 days ago I started to refresh my information about Decorators. 
If you know about web development and especially __Flask__, you have to know that `Decorators` are so important.
That was really a hard concept to come to grips with it.
But I think now I'm more comfortable with Decorators, cause I can read Flask source code for decorators and understand what the hell is going on behind the scene.
I know there's a long way to master most of the topic and through this way I'll forget something that I need to refresh my information about them.
That would be normal for human to forget things!
And as I know keep practising everyday will solve 99 percent of learning problem.
I have a lack of consistency a little bit, so let me know if you have any Idea to be more consistent.
Feel free to leave a comment below and tell me about your opinion.

Keep Moving Forward ツ

Enjoy Your Journey 👊

Code with 💛

🅑🅐🅝🅙🅘
26 Awesome Cheatsheets from Twitter
Tags: webdev, productivity, beginners, twitter
Published: 2020-09-01 11:50:15

---
title: 26 Awesome Cheatsheets from Twitter
published: true
description: 
tags: webdev, productivity, beginner, twitter
canonical_url: https://blog.madza.dev/26-awesome-cheatsheets-from-twitter
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/ycvysiaxorkswtyy20i4.png
---
Here I've compiled an awesome list of useful cheatsheets from Twitter.

Credit: [Pratham Prasoon](https://twitter.com/PrasoonPratham), [Jatin Rao](https://twitter.com/iamjatinrao), [Trilochan Parida](https://twitter.com/TechParida), [Sunil Kumar](https://twitter.com/sunilc_), [Proful Sadangi](https://twitter.com/profulsadangi), [Siddharthkmr1](https://twitter.com/siddharthkmr1).

I would highly recommend following them all, as they produce quality content on a regular basis.

* Windows shortcuts:
{% twitter 1296403837675286528 %}

* Mac shortcuts:
{% twitter 1297122042810994688 %}

* Linux file system:
{% twitter 1300330626197803008 %}

* Chrome shortcuts:
{% twitter 1296298150290845697 %}

* VSCode shortcuts:
{% twitter 1292443459421265922 %}

* Markdown syntax:
{% twitter 1291670055978012674 %}

* Terminal commands:
{% twitter 1295621245627592713 %}

* Git commands:
{% twitter 1299309200674140161 %}

* Bootstrap rules:
{% twitter 1300694110928429056 %}

* CSS Grid rules:
{% twitter 1300694106901897216 %}

* FlexBox rules:
{% twitter 1300694103982657536 %}

* CSS selectors:
{% twitter 1293805234435702784 %}

* JS operators:
{% twitter 1288384011924955136 %}

* JS string methods:
{% twitter 1292480695667843080 %}

* JS array methods:
{% twitter 1288053880010334208 %}

* JS object methods:
{% twitter 1290632843236790273 %}

* JS date formats:
{% twitter 1292357925457948673 %}

* JS DOM:
{% twitter 1294169143218810884 %}

* Code debugging:
{% twitter 1291003806189105152 %}

* Status codes:
{% twitter 1293085314110459905 %}

* NPM commands:
{% twitter 1294220100585709570 %}

* Yarn commands:
{% twitter 1294594964920258561 %}

* Docker commands:
{% twitter 1294961189093388288 %}

* Regular expressions:
{% twitter 1292640482250481665 %}

* Database types:
{% twitter 1295609372236828672 %}

* Heroku commands:
{% twitter 1289255773919272965 %}

<hr>

I hope you enjoyed the read!

Feel free to follow me on [Twitter](https://twitter.com/madzadev), [LinkedIn](https://www.linkedin.com/in/madzadev/), [Hashnode](https://hashnode.com/@madza) and [DEV](https://dev.to/madza) for more!
Incubators and Accelerators for Startups
Tags: incubators, accelerators, startup
Published: 2020-09-01 11:45:13

---
title: Incubators and Accelerators for Startups
published: true
description: 
tags: Incubators, Accelerators, Startups
//cover_image: https://direct_url_to_image.jpg
---
Startup incubators and accelerators make it easier to raise startup funding and launch a better business faster than ever before. While seed funding is always helpful, that’s not all these investor services offer today’s entrepreneurs. Though these venues are not the only ways to generate startup funding - they are the perfect starting point for a few articles that we want to devote to helping your startup or small business reach the next level in its development plans.


Full article - https://perceptionbox.io/business/incubators-and-accelerators-for-startups/
Optional length?.
Tags: javascript
Published: 2020-09-01 11:43:25

Imagine you have an array of news item. And if that array is empty you do not want to render your news list. Of course! 

And maybe. Your api in that case does not give you the "news" key at all. And you have to write code like this:

```javascript
if(!news || news.length === 0) return null;
```

Then I have news for you! 

Use the new [optional chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining) syntax. 

```javascript
if(news?.lenght === 0) return null;
```

So clean! 

And remember how to spell [length](https://dev.to/berra/javascript-arrays-11g1). 

Until next time!
How to prevent VSCode from expanding treeview on Goto definition
Tags: webdev, vscode, node, python
Published: 2020-09-01 11:38:23

You know, that `Ctrl+Click` or `Cmd+Click`.

Especially for larger folders, like `node_modules/` or `.venv/`.

Apparently, while I am trying to find the right question to ask, I can finally google to find an answer...

It's in Feature Request as well.

{% github https://github.com/microsoft/vscode/issues/87956 %}
Modular doesn’t mean interchangeable
Tags: development, programming, codecraft, design
Published: 2020-09-01 11:35:06

---
title: Modular doesn’t mean interchangeable
published: true
date: 2020-09-01 11:12:00 UTC
tags: development,programming,codecraft,design
canonical_url: https://craignicol.wordpress.com/2020/09/01/modular-doesnt-mean-interchangeable/
cover_image: https://craignicol.files.wordpress.com/2020/03/wp-1583529284530.jpg?w=2400
series: your-api-sucks
---

Microservices are great. Containers are great. Packages are great. Objects are great. Functions are great. At each level they encapsulate functionality into re-usable modules. One place to make changes. One place to optimise. One abstraction to help you move to the best layer.

For the sake of argument though, I’m going to focus on microservices, specifically those accessed via an API, as that’s what I know best.

Interfaces and APIs are good for test harnesses, but isolating systems for your own benefit (to make modules open for extension but closed for change) bears no relation to making that module useful to other systems.

Sure, I could rip out the modules that contain business logic, and package it as a framework, but that doesn’t mean it’s useful for anyone else. It could well be [an inner system](https://thedailywtf.com/articles/The_Inner-Platform_Effect). It may still be coupled to domain/architectural knowledge that make it too valuable to swap out. There could be an implicit dependency for just that one version of that one tool.

It is of course possible to make modules re-usable, but they have to be designed that way, whether up front, or evolved. And anything interchangeable has to be tested, in at least 2 conditions, to make sure it’s suitably robust.

Design an interface. Evolve the design. But don’t mistake solving one problem in one place for a general solution. And don’t think that adding an interface is all it takes to turn a local SQLite data store into a cloud file system repository.
Introduction to Machine Learning and Scikit-Learn
Tags: machinelearning, beginners, productivity
Published: 2020-09-01 10:58:09

#**Day 1 of 21 Days of ML with CODE WARRIORS**
## Table Of Contents 
   *      [Machine Learning](#chapter-1)
   *     [Types of Machine Learning](#chapter-2)
   *      [Application of Machine Learning](#chapter-3)
   *      [Scikit-Learn](#chapter-4)

> Focus on being productive instead of busy. - Tim Ferriss

### Machine Learning <a name="chapter-1"></a>
> Field of study that gives computers the ability to learn without being explicitly programmed. - Arthur Samuel

Machine Learning is a type of Artificial Intelligence that allows software applications to learn from the data and become more accurate in predicting outcomes without human intervention.

![No human intervention](https://dev-to-uploads.s3.amazonaws.com/i/4cns9b99zupsrw6wfg24.png)

It is also considered as a subset of Artificial Intelligence. It gives the new capability for computers. 
#### Examples:
* Weather Prediction
* Classification of Mails (spam or not)
* Housing Price Prediction 

### **Process of developing an ML model**

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

### Types of Machine Learning <a name="chapter-2"></a>
####  Supervised Learning 

This is a process of an algorithm, learning from the training dataset. This is task-driven. (Labelled data)
##### Types of Supervised Learning
1. Regression
2. Classification


####  Unsupervised Learning

This is a process where a model is trained using a piece of information that is not labeled. This is data-driven. (Unlabelled data)
##### Types of Unsupervised Learning
1. Clustering

####  Reinforcement Learning

Reinforcement Learning is learning by interacting with space or an environment. (trial n error)

### Application of Machine Learning <a name="chapter-3"></a>

>AI is the new electricity.

-image recognition 
-self-driving cars 
-product recommendation
-stock market prediction
-online fraud detection

### Scikit-Learn <a name="chapter-4"></a>
![Alt text of image](https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Scikit_learn_logo_small.svg/1200px-Scikit_learn_logo_small.svg.png)
Scikit-learn is probably the most useful library for machine learning in Python. The sklearn library contains a lot of efficient tools for machine learning and statistical modeling including classification, regression, clustering, and dimensionality reduction.

#### Components of scikit-learn:
-Supervised learning algorithms
-Cross-validation
-Unsupervised learning algorithms
-Various toy datasets
-Feature extraction
Get Default Branch Name
Tags: actionshackathon
Published: 2020-09-01 10:49:13

[Instructions]: # (To submit to the GitHub Actions x DEV Hackathon, please fill out all sections.)


### Get the default branch or an empty string, if there are no branches in the repository.
You can call the action in your workflow like this:
```
    - name: Get default branch name
      id: defaultBranchName
      uses: MindaugasLaganeckas/get-default-branch@v1
      with:
        token: ${{ secrets.SUPER_SECRET }}
        path: ${{ env.OWNER }}/${{ env.REPO }}
```
You can access the output like this:
```
    - name: Change to master branch if repository is empty
      if: ${{ steps.defaultBranchName.outputs.default-branch == '' }}
```   


### Submission Category: 
Maintainer Must-Haves

### Yaml File or Link to Code
https://github.com/MindaugasLaganeckas/get-default-branch