teleren/devto huggingface dataset:
PowerChrome - a chromium-base browser for desktop html/javascript application
Tags: javascript, html, desktop, webdev
Published: 2022-12-13 07:11:13

I had longed for a web browser which has DB connectivity and shell accessibility, so that can develop html/JavaScript application like Electron. PowerChrome comes for this purpose.

PowerChrome is a powerful and portable web browser that uses the Chromium engine to enable fast and easy development of desktop applications using HTML and JavaScript. 

PowerChrome provides a natural approach to HTML and JavaScript application development. It allows HTML pages to access the window shell, file system, and database, and provides additional application support through the PowerChrome JavaScript Interface (which runs in **sync mode**).

Examples of the PowerChrome JavaScript Interface include:

* Calling notepad.exe: `pb.run('notepad.exe')`
* Execute a file: `pb.shell('calc.exe')`
* Copy a file: `pb.fileCopy(sourceFile, targetFile)`
* Connect to Oracle database: `pb.dbConnect('O90', dbParm, dbServer, logID, logPass)`
* Run SQL query (in sync mode): `rsStr = pb.dbQuery('select * from tablename')`
* Run a SQL query and convert results to JSON: `rs = JSON.parse(pb.dbQuery(sql))`
* Get HTML source of a page (in sync mode): `rs = pb.httpSource('https://hacker-news.firebaseio.com/v0/item/160705.json')`
* Popup an HTML dialog: `pb.popup('sample-dialog.html', {width: 1024, height: 700})`

#### Features

* Portable - no installation required
* Chromium-based - can use Chrome/Chromium for testing and debugging
* HTML as the application and JavaScript ES6 for programming
* API that runs in sync mode - no callback or promise objects
* Works with Powerbuilder for advanced functionality
* Simple console support
* Cloud-app enabled
* Run on Windows 7/8/10/11

#### Get Started

1. Download [powerchrome-0.60-with-runtime.zip](https://casualwriter.github.io/download/powerchrome-0.60-with-runtime.zip) and unzip the all-in-one package.
2. Run `powerchrome.exe`.
3. `powerchrome.html` will be loaded to demonstrate how PowerChrome works as an HTML desktop application.

![screen cap](https://casualwriter.github.io/powerchrome/powerchrome.jpg)

Please visit github-repo: https://github.com/casualwriter/powerchrome
for more informaiton.

Looking forward to your comments for improvment, 
thanks in advanced,
931. Leetcode Solution in cpp
Published: 2022-12-13 07:08:20

```cpp
class Solution {
 public:
  int minFallingPathSum(vector<vector<int>>& A) {
    const int n = A.size();

    for (int i = 1; i < n; ++i)
      for (int j = 0; j < n; ++j) {
        int mini = INT_MAX;
        for (int k = max(0, j - 1); k < min(n, j + 2); ++k)
          mini = min(mini, A[i - 1][k]);
        A[i][j] += mini;
      }

    return *min_element(begin(A[n - 1]), end(A[n - 1]));
  }
};
```
#leetcode 
#challenge
Here is the link for the problem:
https://leetcode.com/problems/minimum-falling-path-sum/
HackNITR 4.0
Tags: hackathon, community, beginners, codenewbie
Published: 2022-12-13 07:05:35

[REGISTER HERE](https://www.hacknitr.com/)

![HackNITR 4.0](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f3yi12m1axcz62kfxewi.jpeg)

As the legacy continues, we bring our flagship event back. HackNITR 4.0 is a collaboration between DSC NIT Rourkela and OpenCode, is all set to get the ball rolling with a larger definition than the previous editions. With more than **2200 registrations**, **50+ sponsors** and **INR 5,00,000+ worth prizes**, HackNITR 3.0 is in itself a testimony to the grandeur we await this time.
Buckle up! HackNITR 4.0 is going to be a bumpy ride full of perks, goodies, experience and fun.
With the love and feedback that we received from the last edition, here are a few added perks why you should definitely join us in this hacking extravaganza

**About HackNITR 4.0**

HackNITR 4.0 is a hackathon to encourage you to use your imagination and invention to develop cutting-edge technology-based solutions to challenges in the real world. It was put together by a large group of tech enthusiasts from **Google Developer Student Club**(GDSC) NIT Rourkela and **OpenCode**. The main goal is to grow our local community and give hackers an unforgettable experience. The plethora of fun and excitement is waiting for you from 6th Jan 2023.

**HackNITR accomplishments so far!**

HackNITR is glad to announce its 1000+ registration. But this is just the beginning. We provide you with this wonderful opportunity to network with others who share your interests, collaborate with them, and share expertise to quickly create exceptional projects and find answers to urgent real-world problems.


![Testimonials](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2cp7jwiafme1yfjxms17.jpeg)

Register now to experience one of the largest student-run hackathon of India.

**How can I participate?**

As the countdown starts for D-day Our HackNITR team is all set to begin with the registrations. Still here? Head over to the website link given below and register right away for the largest student-run hackathon in East India, HackNITR 4.0 and complete the first step to discovering all that we have in store for you.

PS - There is absolutely **no prerequisite**. If you look forward to your first hackathon or craving an offline tint to your hacking journey, we have it all covered.

[Register now](https://www.hacknitr.com/)


Follow our Social Handles to stay tuned
HackNITR Website: https://www.hacknitr.com/
HackNITR Instagram: https://www.instagram.com/hacknitr/
HackNITR LinkedIn: https://www.linkedin.com/company/hacknitr/
HackNITR Twitter: https://twitter.com/hacknitr

Let's make this event grand and succesfull
Thank you❤️
I'm geting this Error while debugging in console like Uncaught TypeError: Cannot set properties of null (setting 'textContent')
Published: 2022-12-13 07:03:46

```
<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="bomb.css" >
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous" />
    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
  </head>
  <body>
    <script src='bomb.js'></script>
    <div class="timer-container">

      <input type="text" class="user-input" id="defuser" />
      <br />
      <img
        src="https://d1tgh8fmlzexmh.cloudfront.net/ccbp-dynamic-webapps/time-bomb-img.png"
        class="bomb-image"
      />
      <p class="timer-display" id="timer">10</p>
    </div>
  </body>
</html>
```

```
CSS content:

@import url("https://fonts.googleapis.com/css2?family=Bree+Serif&family=Monoton&family=Open+Sans:wght@400;700&family=Playfair+Display+SC:wght@400;700&family=Playfair+Display:wght@400;700&family=Roboto:wght@400;700&family=Source+Sans+Pro:wght@400;700&family=Work+Sans:wght@400;700&display=swap");
 
.timer-container {
  background-color: #00bafc;
  padding: 20px;
  text-align: center;
  height: 100vh;
}
 
.timer-display {
  font-size: 50px;
  color: white;
}
 
.user-input {
  border-width: 0px;
  border-radius: 4px;
  padding: 6px;
  text-align: center;
}
 
.bomb-image {
  margin-top: 40px;
  width: 150px;
}
```

```
JS content:

let timerEle = document.getElementById('timer');
let countdown = 10;
let intervalId = setInterval(function(){
    countdown = countdown - 1;
    timerEle.textContent = countdown;
},1000);

Can someone help me on this.
```
How to Dismiss / hide / mark as seen the notifications on DEV? 🔔
Tags: watercooler, discuss
Published: 2022-12-13 07:00:00

---
title: How to Dismiss / hide / mark as seen the notifications on DEV? 🔔
published: true
description: It is fun to have notification. It might be better to be able to mark them as "seen".
tags: watercooler, discussion
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
published_at: 2022-12-13 07:00 +0000
---

I love to get [Notifications](/notifications) especially when they are about more people liking or bookmarking my post or when more people are following me.

I also like to be notified when people I follow post something new.

However, I would like to be able somehow "mark as seen" ✔️ each notification and thereby hide it.

🤔 Is it possible somehow? Would you like to have this feature?
How do you handle this?
HackNITR 4.0
Tags: hackathon, programming, community, beginners
Published: 2022-12-13 06:59:52

As the legacy continues, we bring our flagship event back. HackNITR 4.0 is a collaboration between DSC NIT Rourkela and OpenCode, is all set to get the ball rolling with a larger definition than the previous editions. With more than **2200 registrations, 50+ sponsors and INR 5,00,000+ worth prizes**, HackNITR 3.0 is in itself a testimony to the grandeur we await this time.
Buckle up! HackNITR 4.0 is going to be a bumpy ride full of perks, goodies, experience and fun. 
With the love and feedback that we received from the last edition, here are a few added perks why you should definitely join us in this hacking extravaganza.

## About HackNITR 4.0

HackNITR 4.0 is a hackathon to encourage you to use your imagination and invention to develop cutting-edge technology-based solutions to challenges in the real world. It was put together by a large group of tech enthusiasts from **Google Developer Student Club (GDSC)** NIT Rourkela and **OpenCode**. The main goal is to grow our local community and give hackers an unforgettable experience. The plethora of fun and excitement is waiting for you from 6th Jan 2023.

## HackNITR accomplishments so far!

HackNITR is glad to announce its 1000+ registration. But this is just the beginning. We provide you with this wonderful opportunity to network with others who share your interests, collaborate with them, and share expertise to quickly create exceptional projects and find answers to urgent real-world problems.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/78jwr1pknpz3ct0pzurh.jpeg)


Register now to experience one of the largest student-run hackathon of India.

## How can I participate?

As the countdown starts for D-day Our HackNITR team is all set to begin with the registrations. Still here? Head over to the website link given below and register right away for the largest student-run hackathon in East India, HackNITR 4.0 and complete the first step to discovering all that we have in store for you.

PS - There is absolutely **no prerequisite**. If you look forward to your first hackathon or craving an offline tint to your hacking journey, we have it all covered.

[**Registration Link**](https://www.hacknitr.com)

**Follow our Social Handles to stay tuned**
HackNITR Website: https://www.hacknitr.com/
HackNITR Instagram: https://www.instagram.com/hacknitr/
HackNITR LinkedIn: https://www.linkedin.com/company/hacknitr/
HackNITR Twitter: https://twitter.com/hacknitr

Let's make this event grand and succesfull
Thank you❤️
Java 8 Tutorials
Tags: java, programming, tutorial, beginners
Published: 2022-12-13 06:57:09

Java 8 Tutorials 
==============
1) Java 8 Lambda Expressions : https://javaconceptoftheday.com/java-8-lambda-expressions/

2) Java 8 Functional Interfaces : https://javaconceptoftheday.com/java-8-functional-interfaces/

3) Java 8 Method References : https://javaconceptoftheday.com/java-8-method-references/

4) Java 8 Interface Changes : https://javaconceptoftheday.com/java-8-interface-changes-default-methods-and-static-methods/

5) Java 8 Streams : https://javaconceptoftheday.com/java-8-streams-beginners-guide/

6) Java 8 Collectors : https://javaconceptoftheday.com/java-8-collectors-tutorial/

7) Java 8 Optional Class : https://javaconceptoftheday.com/java-8-optional-class/

8) Java 8 Spliterator : https://javaconceptoftheday.com/java-8-spliterator/

9) Java 8 StringJoiner, String.join() And Collectors.joining() : https://javaconceptoftheday.com/java-8-stringjoiner-string-join-collectors-joining/

10) Solving Real Time Queries Using Java 8 Features -Employee Management System :   https://javaconceptoftheday.com/solving-real-time-queries-using-java-8-features-employee-management-system/
Options Pattern in Golang
Tags: go, gonuts, github, tutorial
Published: 2022-12-13 06:56:15

**What ..?**

*Option pattern very powerful in terms of modify the behaviour of the function without changing the code.
It is a function programming pattern that is used to provide optional arguments to a function.*

example when user want to pass additional parameter to a function in SDK, then it modifies the behaviour accordingly.

suppose we have struct name called `config`  which contains below configs
  
    type Config struct{
    		url  	string
    		port 	string
    		timeout time.Duration
    	}

and now our factory methods something like this.

    func NewConfig(url string,port string, timout time.Duration) *Config{
		return &Config{
			port:port,
			url:url,
			timeout:timeout,			
		}	    
	}
But i want `port` and `timeout` to be optional parameters. only `url` i want to make it mandatory 

let's define new type called `Option`

    type Option func(*Config)
    
Option is a function that takes `Config` . By using this option will modify the `Config`


    func WithPort(port string) Option{
	    return func(c *Config){
			c.port = port
		}
    }
    
    func WithTimeout(timeout time.Duration) Option{
	    return func(c *Config){
			c.timeout = timeout
		}
    }
	
`Option` is just a function it takes the pointer and return the updated config. now we have set the desired values to our config. Let's update the Factory method

    func NewConfig(url string, opts ...Option) *Config{
	    config := &Config{
			url:url
		}
		for _, opt := range opts{
			opt(config)
		}
		return config
    }

   Client creates basic Config
   
    appConfig := NewConfig("http://api.google.com")
Client creates url with port

    appConfig := NewConfig("http://api.google.com", WithPort("3000"))
    appConfig := NewConfig("http://api.google.com", WithPort("3000"), WithTimeout(30*time.Second))

## Resources:

-   [open-telemetry/opentelemetry-collector: OpenTelemetry Collector (github.com)](https://github.com/open-telemetry/opentelemetry-collector)
-   [Go (Golang) Functional Options Pattern — YouTube](https://www.youtube.com/watch?v=5ZZwmMI897c)
-   [Functional Options in Go: Implementing the Options Pattern in Golang (sohamkamani.com)](https://www.sohamkamani.com/golang/options-pattern/)
What is singleton class in Java and how to implement it?
Tags: java, beginners, programming, tutorial
Published: 2022-12-13 06:52:10

### Introduction
A singleton class in Java is a type of class that can have only one instance at any given time. This is useful in ensuring that only one object of a particular class is ever created and used in an application, avoiding duplication of resources and improving performance.

### How to Implement Singleton Class??

To implement a singleton class in Java, you need to make the class constructor private, so that no other class can create its own instance. You also need to declare a static instance of the class and initialize it in a static block. Finally, you need to create a public static method that returns the singleton instance.

To illustrate this, let's say we want to create a singleton class called Logger that logs messages to the console. 
First, we'll make the class constructor private so that no other class can create its own instance:

```
private Logger() {

}
```

Next, we'll declare a static instance of the class and initialize it in a static block:

```
private static Logger instance = null;

static {
    instance = new Logger();
}
```

Finally, we'll create a public static method that returns the singleton instance:

```
public static Logger getInstance() {
    return instance;
}
```

Now we can use the Logger class to log messages to the console. All other classes will be able to access the same instance of the Logger class, ensuring that no duplicate instances are created.

### Conclusion

By using the singleton pattern, developers can ensure that only one instance of a particular class is ever created and used in an application, avoiding duplication of resources and improving performance.
Generate SSH key
Published: 2022-12-13 06:50:43

To add an SSH key to your **GitLab** account, you will need to follow these steps:

1. Generate an SSH key on your computer. This can be done by running the following command in a terminal window:

```
ssh-keygen -t rsa -b 4096 -C "<your email address>"
```

Replace <your email address> with the email address associated with your GitLab account. This will generate a public and private SSH key on your computer.

2. Copy the contents of the public SSH key. This can be done by running the following command in a terminal window:

```
cat ~/.ssh/id_rsa.pub
```
This will display the contents of the public SSH key on your screen. Copy the entire key, including the ssh-rsa prefix and the <your email address> suffix.

3. Go to your GitLab profile settings and click on the "SSH Keys" tab.

4. Click on the "Add SSH Key" button.

5. Paste the contents of the public SSH key into the "Key" field.

6. Give the SSH key a title in the "Title" field. This can be anything that helps you identify the key, such as the name of the computer it was generated on.

7. Click on the "Add Key" button.

8. After adding the SSH key to your GitLab account, you can use it to authenticate yourself when pushing and pulling changes from GitLab repositories. This will allow you to use the ssh protocol instead of the https protocol, which can be faster and more secure.



To add an SSH key to your **GitHub** account, you will need to follow these steps:

1. Generate an SSH key on your computer. This can be done by running the following command in a terminal window:

```
ssh-keygen -t rsa -b 4096 -C "<your email address>"
```
Replace <your email address> with the email address associated with your GitHub account. This will generate a public and private SSH key on your computer.

2. Copy the contents of the public SSH key. This can be done by running the following command in a terminal window:

```
cat ~/.ssh/id_rsa.pub
```
This will display the contents of the public SSH key on your screen. Copy the entire key, including the ssh-rsa prefix and the <your email address> suffix.

3. Go to your GitHub profile settings and click on the "SSH and GPG keys" tab.

4. Click on the "New SSH Key" button.

5. Paste the contents of the public SSH key into the "Key" field.

6. Give the SSH key a title in the "Title" field. This can be anything that helps you identify the key, such as the name of the computer it was generated on.

7. Click on the "Add SSH Key" button.

After adding the SSH key to
Container With Most Water
Tags: javascript, leetcode
Published: 2022-12-13 06:44:13

[Container With Most Water](https://leetcode.com/problems/container-with-most-water/description/)

```js
/**
 * @param {number[]} height
 * @return {number}
 */
var maxArea = function (height) {
  let capacity = -Infinity;

  let start = 0;
  let end = height.length - 1;

  while (start <= end) {
    let W = end - start;
    let H = Math.min(height[start], height[end]);
    capacity = Math.max(capacity, W * H);

    if (height[start] > height[end]) {
      end--;
    } else {
      start++;
    }
  }

  return capacity;
};

console.log(maxArea([1, 8, 6, 2, 5, 4, 8, 3, 7]));

```
Top Education NGOs in Noida
Tags: ngos, ngosinnoida, topngos, educationngos
Published: 2022-12-13 06:43:16

Chuck Grassley once said, "What makes a child gifted and talented may not always be good grades in school, but a different way of looking at the world and learning". And providing access to quality education is one of the best thighs you can do to help unprivileged children in Noida. 

On account of this, I consulted Helplocal to share a list of NGOs that are providing education to the unprivileged in Noida. Below is the list of education NGOs in Noida.

Bhavishya Noida 

This is a Noida-based nonprofit organization that was registered in 2016. It aims to deliver education to the unprivileged communities of India by getting their admission into government as well as private schools. It also provides tuition classes to schools and college dropouts so that students can complete their education and can have a bright future. Support Bhavishya by donating money or volunteering with them!

Challengers Group Trust

This is a nonprofit organization providing free education, food, and plantation for the last 7 years to the unprivileged section. This Noida-based non-profit organization has been teaching orphanage kids, slum dwellers, and ragpickers by visiting different areas. The main motive of this organization is to provide free education.

Noida LokManch

Founded in 1997, Noida Lok Manch is a registered charitable NGO society working in the Noida region. The main of this organization is to help victims of natural disasters and provide access to quality education to underprivileged communities across India. 


Above mentioned are the top NGOs that are helping unprivileged children by providing access to quality education. Got any queries to ask? Send them to hello@helplocal.in and get a reply from experts. Also, visit [Helplocal](https://www.helplocal.in/) to discover NGOs active near your place.
NextSketch 2: Save/Load your Sketches!
Tags: news, programming, showdev, tooling
Published: 2022-12-13 06:12:51

Happy December!

We've been working on being able to save and load your sketches inside the editor for the last 2 weeks! Getting it all to work took weeks of figuring out and wrestling with Serialization libraries but, after long last, we're finally here now!

For NextSketch 2, we decided to create a custom, human-readable format to describe the content of our Sketches. Say hello to our own mini-language...Horizon!

Horizon is a plain-text, extremely simple language for defining Sketches, and while we won't go too deep into how it works, if enough people are interested, we'll document it in the NextSketch 2 docs!

For example, a simple Node connected to a sub-diagram (we call them _Containers_), like this produces the following Horizon code:


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

In Horizon, this would be:

```
Canvas (0) {
    Node (2) [pos="865:413",color="30:30:30",text="I'm a Node!",shape="Rectangle",]
    Container (1) [pos="1255:412",color="0:89:255",text="And I'm a Container!",shape="Rectangle",canvas="1",]
    Link (0) [plug="2",socket="1",]
}
Canvas (1) {
    NodeRef (3) [pos="160:217",color="30:30:30",text="I'm a Node! <External>",shape="Rectangle",original="2",]
}


```

Right now, our hand-rolled interpreter is a complete mess and needs cleanup (and error handling!) before we can declare it to be complete.

It's been a rough few weeks for us but we're glad we pulled through and got Horizon to work, ensuring that your diagrams stay usable outside of NextSketch!

Keep Building!