teleren/devto huggingface dataset:
Java Interview - constructor
Tags: java, interview, career, programming
Published: 2022-04-26 21:42:02

Let's talk about the constructors in Java and what can be asked during the Java interview related to constructors?


## What is Constructor in Java?

We use constructors to initialize all variables in the class when an object is created. As and when an object is created it is initialized automatically with the help of constructor in java.

We have two types of constructors:
1) Default Constructor
2 Parameterized Constructor

```java
public className(){}
public className(parameters list){}
```

## How to Call One Constructor From the Other Constructor?

With in the same class if we want to call one constructor from other we use this() method. Based on the number of parameters we pass appropriate this() method is called.

Restrictions for using this method:
1) This must be the first statement in the constructor
2) We cannot use two this() methods in the constructor

## Difference Between This() and Super() in Java?

this() is used to access one constructor from another with in the same class while super() is used to access superclass constructor. Either this() or super() exists it must be the first statement in the constructor.

## Can We Override Constructors in Java?

Only methods can be overridden in java. Constructors can’t be inherited in java. So, there is no point of overriding constructors in java.
Product Photography Sydney PPY LTD
Tags: photographer
Published: 2022-04-26 21:41:33

We are a well established Sydney based [product photography studio](https://www.productphotographysydney.com.au). Formed in 2007 to serve the growing demand for fast and affordable quality product photography. We have worked with numerous household names including David Jones, Sass n Bide, Lululemon, Marco Polo and Ecoya, From Fairfax & Roberts to Diva and Jax Quickfit to name just a few. We ensure their products look the very best they can, that they are powerful and that they command attention in a fierce online sales environment.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/espm9j12u6tsdfmcmb11.jpg)
Our mission is simple – we aim to become an extension of your business through close professional relationships built on good values, trust and a helpful approach to succeed together.
If you’re selling products online and wish to drive sales further then you’ll understand the importance of having your products stand out from the crowd. Over the years we have developed a wealth of knowledge that enables us to understand, adapt, advise and tailor a package that directly meets your individual needs. No matter your requirements, from still product product photography to 360 product shots or video, clothing invisible mannequin style to flat-lay or even on live talent, look-books or creative concepts, you can rest assured that we have it covered.
PhpIDE - File Manager & Code Editor
Tags: php, linux, ubuntu, nginx
Published: 2022-04-26 21:31:29

- [About PhpIDE](https://phpide.io/)
- [Git](https://github.com/erkinkhidirov/PhpIDE)
- [Documentation](https://phpide.io/documentation/)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g1g8bz2tyyuyv5hlbop4.gif)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l0eck25c47kon2fz5mto.gif)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vfylvdg5mr51t5slbt6p.gif)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6jtztli9zn9lm9kchgb.gif)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ceht6mie2cl0cmryef7z.gif)
Day 18: it would take Superman powers
Tags: productivity
Published: 2022-04-26 21:22:24

Hi!
remember the sessions I talked about that I attended yesterday someone mentioned something about that there are things that would take superman abilities to be accomplished and I think that's what I may need to meet my new deadline
I now have to triple the speed that I usually work on because things had gone south and the deadline I expected Late May is just next week and I had mismanaged my time and I'm really behind.
it get worse with the tasks and features that I have to work on this week being complicated themselves (and the pending article too) so today I was working on integrating CRUD operations from the backend with the frontend and I learned a few things about error handling with Axios but it was not that challenging TBH.
Tomorrow will have to be a bus one of course I expect to write many papers hopefully I will wake motivated enough because I hate typing (not coding :) but I guess there is no other choice 
I will have to see how it goes 

signing off...
Build Querystring like a pro
Tags: javascript, node, webdev, programming
Published: 2022-04-26 21:17:17

Often in apps, you will have to interact with the **URL** to implement some functionality like pagination.

The **URL** is a great place to include some of your app status. The advantage is that users can share the **URL** back to it with the filters set.

The tricky part is sometimes how you get and update those **URL** parameters. Honestly, in modern browsers, there's a neat **API** called [**URLSearchParams**](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) ✨ It allows us to elegantly retrieve or update the **URL** parameters.

> **URLSearchParams** is available in node.js and most browsers.

## ❤️ Follow me

- 🐦 https://twitter.com/thebug404
- 🐙 https://github.com/thebug404

## ℹ️ What is a URLSearchParams?

The [**URLSearchParams**](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API allows us to read the querystring from the URL in a very elegant way, and we no longer need to do complex implementations, in the past it was necessary to call external apis or use regular expressions. In this post I will explain some of the functionalities that this API.

## 🚀 Getting started

The first thing we need to do is initialize a class that contains a query string.

```ts
const urlSearchParams = new URLSearchParams(`?username=thebug404&fullname=The+Bug`);
```

Or you can get the values through the browser URL

```ts
const urlSearchParams = new URLSearchParams(window.location.search);
```

We now have an instance of **URLSearchParams** saved in `urlSearchParams` that we can use to read and modify query parameters.

## 📖 Reading parameters

To get a specific parameter you can use the `get()` method

```ts
const userId = urlSearchParams.get("username"); // thebug404
```

## 💾 Adding parameters

The `append()` method is used to add new query parameters to **URL**

```ts
urlSearchParams.append("country", "El Salvador")

console.log(urlSearchParams.toString()); // country=El+Salvador
```

## 🗑️ Deleting parameters

The `delete()` method is used to remove query parameters from a **URL**

```ts
urlSearchParams.delete("fullname");
```

## 🔥 Generating URL

Another useful use case is to generate a URL with URLs and URLSearchParams under the hood.

```ts
const url = new URL("https://domain.com");

url.searchParams.set('username', 'thebug404');

console.log(url.toString()); // https://domain.com/?username=thebug404
```

## 💡 Conclusion

As we have seen, generating URLs, getting, adding and removing URL query parameters is a really easy task with this API. Honestly, I love how easy and intuitive it is to use, and that makes me very happy, and you?

## ❤️ Follow me

- 🐦 https://twitter.com/thebug404
- 🐙 https://github.com/thebug404
First steps with ShellScripting
Tags: programming, linux, computerscience, devjournal
Published: 2022-04-26 21:02:49

As most of you - don't - know, I've been a loyal Linux user for pretty much a year by now and I love it, it helps me stay productive and I've always been an open-source lover.
Also, I have the not-so-healthy habit of formatting my computer almost weekly, with Windows that was a pain, but in Linux I can write a script to do everything I need for me. I do not recommend you to do that to your PC that frequently, but I can't help myself. So, with the goal of saving me some hours every week, I proceeded to write it, in this post I'll explain what I learned in my first week of studying.

PS: I only know JavaScript, and my first experiences with programming were all in JavaScript, so JS will be the referential.

### 1. Spacing and quoting are very important
I was very surprised when I discovered that sometimes spacing in between brackets in conditional statements mattered, and that I had to quote a lot more than expected to make bash read my strings with spaces as one, even though they were declared quoted. Here's an example:
```bash
array=(
  item0
  "item 1"
)

for each in ${array[@]}; do
  echo $each
done
```
Output: 
```bash
item0
item
1
```
But, if we change  `${array[@]}` to `"${array[@]}"`, the output will be:
```bash
item0
item 1
```
As I would have expected because of my JS baggage.

In JavaScript you can pretty much skip a lot of "code formalities" like that, you can skip semi-colons at the end of operations, you can space practically how you want the parentheses of your if statements and more.
The answer to [this](https://unix.stackexchange.com/questions/117438/why-are-bash-tests-so-picky-about-whitespace) question explains it well enough if you want to read it. 
JavaScript's syntax is a lot more flexible than bash's.

### 2. Content disparity
We all know that JavaScript is well-established right now, and that means that there is a lot of content in that language, from tutorials to questions and answers in Stack Overflow. 
That, at first, seems like a great thing, and it almost always is, but it wasn't uncommon for me to waste 15+ minutes to find an answer to a simple question(that is also because of the infinity of ways to do things in JavaScript) and it was very frustrating. 

In contrast, for bash I found a lot less content, but because of the objectivity of the language, I was able to find answers quicker, I recurrently found what I was looking for in the first or second link that I opened. A great example of this is the page that I linked in the first topic, I found it in less than 5 minutes, even though I was not using very specific terms to google it.

### 3. Conclusion

I had a great time learning to write ShellScript and I feel revigorated after writing different code for a while, sometimes a simple change for a week or two can help you a lot!

#### Thank you for reading! 
You can find me on [Twitter](https://twitter.com/arthurnunesc) and on [GitHub](https://github.com/arthurnunesc) (The script I talked about is there).

This post is a repost of an old article of mine written in 2020-08-26.
Kubernetes - Argument error : too long
Tags: kubernetes
Published: 2022-04-26 21:01:33

While deploying pods on a Kubernetes cluster, we can saw some "weird" errors and generally a quick research helps us to understand what's going on.

But not this time.

---

While starting a pod in Kubernetes, we saw the following error

```
standard_init_linux.go:228: exec user process caused: argument list too long
```

It was the first time we saw it. It was weird, we describe the pod, edit the yaml to check all its values... and we saw nothing. 

So at that point we prayed to find something on StackOverFlow to help us, but nothing too. *(This error message appears for several other tool but not Kubernetes at this moment)*

Then we review every secret, configmap ... to find something... And we saw it. In a secret containing a certificate *(which is injected from a secrets management tool in an environment variable)*, the value wasn't correctly setup and had the certificate multiple times in it.

Once corrected, the pod started correctly!

---

So, if you have a similar issue, don't forget to check all your environment variables *(especially all the ones which are injected from a secret or a configmap)*!

---

I hope it will help you! 🍺

Don’t hesitate to give me feedback here, on [twitter](https://twitter.com/glt_mx) or by [LinkedIn](https://www.linkedin.com/in/maxime-guilbert-14b6a5128/), I will be glad to read it. You can use the same links if you want to contact me or want to collaborate with me.

---

<center><h3>You want to support me?</h3></center>
<a href="https://www.buymeacoffee.com/mxguilbert7" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
XRPL fun @ KU (XRPL Campus Ambassador Program)
Tags: xrpl, xrplgrants
Published: 2022-04-26 20:55:18

 Earlier this semester, as an XRPL Campus Ambassador, I've been giving multiple presentations about the XRP ledger and what involves developing around this ledger. Last week, in cooperation with [KU's Blockchain Institute (KUBI)] (https://kublockchain.com/) which was kind enough to invite and share their space with me, KU students from all majors had the opportunity to learn a ton about the XRP ledger and various topics within it. Swag and Jimmy John's sandwiches for everyone was provided!

From learning how to research and develop on this amazing ledger, to discovering opportunities that the ledger provides for developers currently building projects using the ledger, such as the XRPL Grants, and for content-creators that can harness Ripple's amazing Creator Fund opportunities!


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uc5vl9zm7vcwom8pkii4.jpg)


### Developing on the XRP ledger ###
 Students shared their interest regarding blockchain research opportunities and learning how to develop using blockchain technology. However, they mentioned they didn't exactly know how and where to apply these technologies. In a mix of both technical and non-technical examples, I described how the ledger worked and how easy was to build applications off of the ledger. I showcased multiple blockchain research opportunities that students have, and answered all their questions regarding that exactly meant building these applications using the full potential of the XRP ledger.

Click [here](https://xrpl.org/index.html) to read about the XRP ledger.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f2dvdnm30g1w46nwop7l.jpg)


### XRPL Grants & Ripple's Creator Fund ###
 One thing that caught attention was the fact that they could learn how to develop on the ledger and get their projects funded. From creating NFTs collections and smart contracts natively on the ledger to building applications such as electronic payments systems and online gaming exchanges, these are all amazing use-cases that students can develop and apply for funding by the XRPL Foundation.

If you want to learn more about these opportunities, then visit [XRPL Grants](https://xrplgrants.org/) and Ripple's [Creator Fund](https://ripple.com/creatorfund/).



### Kahoot Blockchain Trivia Game ###
 The event was followed up with a Kahoot blockchain trivia game, in which the winner and all participants received prizes such as XRPL swag (t-shirts, stickers, and KUBI swag), it was great to see over 20 people participating in the game, meaning a lot of fun can be had in these events apart from just talking what blockchain really is.

 The creation of a blockchain environment that allows for a collaboration between students is a great way to showcase what these young developers are able to do. These types of speaker events can be an excellent example for students to immerse themselves in the blockchain space while also learning great opportunities that are being offered to and for them.
Diagrams as Code DaC to go along with infrastructure as Code IaC
Tags: beginners, python, aws, devops
Published: 2022-04-26 20:39:43

I have started using Diagrams which lets you easily draw/create cloud architecture using Python code!  

This also allows you to visualize existing system architecture. The major providers are supported including AWS,Azure, and GCP. It also supports on-premise and SaaS applications. 

**Setup**

The install is pretty straight forward, it does require python 3.6 or higher. Diagrams uses Graphviz to render the diagram, so you will need to install it first before you install and use Diagrams. 

macOS users can download the Graphviz via brew install graphviz. Windows users fear not, you are not forgotten, and may use Chocolatey to run choco install graphviz.

```
# using pip (pip3)
$ pip install diagrams

# using pipenv
$ pipenv install diagrams

# using poetry
$ poetry add diagrams

```
**Demo or Quick Start**

```

# demo.py
from diagrams import Diagram
from diagrams.aws.compute import EC2
from diagrams.aws.database import RDS
from diagrams.aws.network import ELB

with Diagram("Web Service", show=False):
    ELB("lb") >> EC2("web") >> EC2("web") >> EC2("web") >>  RDS("userdb")

```

This generates the diagram below, saved as a png file within your working directory.

`$ python3 demo.py`


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

**More Info**

Check out the [Quick start guide](https://diagrams.mingrammer.com/docs/getting-started/installation#quick-start)

Check out the [guides](https://diagrams.mingrammer.com/docs/guides/diagram)

Available [nodes list](https://diagrams.mingrammer.com/docs/guides/node)
CSS Grid notes
Tags: css, flexbox, cssgrid, webdev
Published: 2022-04-26 20:30:49

[Flexbox Notes](https://curious-woolen-937.notion.site/Flexbox-Notes-1835eca6f15a4715be81908cec2c1c1f)
[CSS Grid Notes](https://curious-woolen-937.notion.site/CSS-Grid-Notes-131416dda9524e6ba6b29675f182e089)
Java Interview - static
Tags: java, interview, programming, career
Published: 2022-04-26 20:19:11

Let's talk about the static keyword in Java and what can be asked during the Java interview related to static?


## What are the Static Blocks and Static Initializers?

Static blocks are also called as Static Initialization Blocks, a class can have any number of static blocks and they can appear anywhere inside java class. We declare static blocks when we want to initialize static fields in our class. <u>Static blocks gets executed exactly once when the class is loaded</u>. Static blocks are executed even before the constructors are executed.

```java
public class Solution{  
	public static void main(String[] args){  
		System.out.println("Main Method");  
	}
	static {  
		System.out.println("Static block - 1");  
	}
}  
```

`Static block - 1 
Main Method `


## Can We Synchronize Static Methods in Java? 
Yes ✅ Synchronized methods are used to protect access to resources that are accessed concurrently. When a resource that is being accessed concurrently belongs to each instance of your class, you use a synchronized instance method; when the resource belongs to all instances (i.e. when it is in a static variable) then you use a synchronized static method to access it. 

## Can Static Methods Access Instance Variables in Java?

No ❌ Instance variables can’t be accessed in static methods. When we try to access instance variable in static method we get compilation error. The error is as follows:
`Cannot make a static reference to the non static field name`

## How Do We Access Static Members in Java?

Static variables are owned by class rather than by its individual objects. Referring static variables outside the class is by <u>ClassName.myStaticVariable</u> but inside the class it is similar to other instance variables.

## Can We Override Static Methods in Java?

No ❌ It is because <u>method overriding</u> is based upon <u>dynamic binding</u> at runtime and static methods are bonded using static binding at compile time.

## Can We Define Static Methods Inside Interface?

✅ Since Java8 you can have static methods in an interface (with body). Defining a static method within an interface is identical to defining one in a class. Moreover, a static method can be invoked within other static and default methods.

## Can constructors be static in Java?

In general, a static method means that “The Method belongs to the class and not to any particular object” but a constructor is always invoked with respect to an object, so it makes no sense for a constructor to be static.
CryptoScan: find cryptokeys ans cryptoadresses
Published: 2022-04-26 20:00:53


![Logo of CryotScan](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e9acfhwpmeirw023t64y.png)The [CryptoScan](https://github.com/PetroBulbash/CryptoScan) program is designed to search for cryptocurrency keys and addresses on a PC and removable storage devices. It can be useful for investigators, computer security specialists, individuals who have lost (forgotten) files with data about their crypto wallets.
Grab Your Spot at CodeLand 2022 & View Speakers
Tags: codeland, codeland2022, codenewbie, announcements
Published: 2022-04-26 19:49:49

---
title: Grab Your Spot at CodeLand 2022 & View Speakers
published: true
description: 
tags: codeland, codeland2022, codenewbie, announcements
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ujam6kfvxdg3s8olp9r.png
---

Hey DEV community!

I just wanted to stop by and let you know that registration for CodeLand 2022 is officially open — plus, speakers have been announced 🌈 

# [>> Register For CodeLand](https://ti.to/codenewbie/codeland-2022)

# [>> View Speakers](https://codelandconf.com/#program)

---

If you've attended [CodeLand](https://codelandconf.com) in the past, you'll be familiar with the goal of this annual conference: to encourage and inspire early-career software developers and their champions. You'll also be pleased to know that for the third year in a row, CodeLand tickets are pay-what-you-want (starting at $0) and the event is entirely virtual, meaning you can join the fun from anywhere that you have an internet connection.

If you've never attended our annual conference, we hope you join us on June 16 & 17 on [CodeNewbie Community](https://community.codenewbie.org) for your first CodeLand. It's a truly special event, made by and for software developers just like you. 

[Angie Jones has been announced as a keynote speaker](https://community.codenewbie.org/codenewbie/announcing-codeland-2022s-first-keynote-speaker-angie-jones-1gn8) for CodeLand 2022, but stay tuned in the coming weeks for more exciting keynote announcements as well as info on interactive activities and conference details.
 

**Learn more about the CodeLand 2022 registration opening and speaker announcements [here](https://community.codenewbie.org/codenewbie/you-can-now-register-and-view-the-program-for-codeland-2022-3k8k).**