teleren/devto huggingface dataset:
How to add items into an Array in C#
Tags: array
Published: 2021-06-04 17:57:38

By the definition, an array is stored at contiguous memory locations in order that initially it size is fixed. Actually array identifier holds only the reference of memory location and access of elements using index is performed by the following mathematical formula:

location of arr[i] = location of arr[0] + i * size of each element.
Consider we've an array of integer(Int32) arr with length of 5, in order that it have contiguous 5 integers valued allocated memory reference. Since every integer needs 4 bytes, so total referenced size of allocation is bounded in 20 bytes. Let first allocated location is 2020441248 and last allocated location is 2020441229. If we used 0 based indexes, then if we attempt to access arr[5] or quite index of 5 the reference failed to access because arr[5] requires next contiguous 4 bytes [2020441228 to 2020441225] from memory allocation but the identifier isn't conscious of these locations. In order that if we try access any index which is bigger than the array length, then it'll throw an IndexOutOfRangeException runtime exception with a default message like this, "index was outside the bounds of the array”.

How to add items into an Array
In C#, It is not possible to change the array size once is created. So that make sure that your it doesn't have possibility of attempt to access any index of outside than bounded length.

using System;
namespace MainConsole
{
    class Program
    {
        static void Main()
        {
           int[] terms = new int[400];
           for (int runs = 0; runs < 400; runs++)
           {
              terms[runs] = value;
           }
        }
        
    }
}
 

Alternatively, you can usese List<T> or any of other revalant data structure from System.Collection.Generic namespace so that we can apply methods and change the length of collection dynamically like push(), pop() or add(), remove() etc.

using System;
namespace MainConsole
{
    class Program
    {
        static void Main()
        {
           List<int> termsList = new List<int>();
           for (int runs = 0; runs < 400; runs++)
           {
              termsList.Add(value);
           }

           // It is possible to convert it back into an array
           int[] terms = termsList.ToArray();
        }
        
    }
}

[Click to see more]( How to add items into an Array in C# - Kodlogs)
Influences and Nature of the Language
Tags: javascript, java, netscape, linux
Published: 2021-06-04 17:52:19

JavaScript’s creator, Brendan Eich, had no choice but to create the language very quickly (or other, worse technologies would have been adopted by Netscape). He borrowed from several programming languages: Java (syntax, primitive values versus objects),
Scheme and AWK (first-class functions), Self (prototypal inheritance), and Perl and Python (strings, arrays, and regular expressions).

JavaScript did not have exception handling until ECMAScript 3, which explains why the language so often automatically converts values and so often fails silently: it initially couldn’t throw exceptions.

On one hand, JavaScript has quirks and is missing quite a bit of functionality (blockscoped variables, modules, support for subclassing, etc.). On the other hand, it has several powerful features that allow you to work around these problems. In other languages, you learn language features. In JavaScript, you often learn patterns instead. Given its influences, it is no surprise that JavaScript enables a programming style that is a mixture of functional programming (higher-order functions; built-in map, reduce, etc.) and object-oriented programming (objects, inheritance).
Run Multi-container apps with Docker  Compose
Tags: docker, devops, linux, tutorial
Published: 2021-06-04 17:52:16

Containerization of apps is a fast-growing practice as many companies are embracing the cloud and DevOps concepts. Docker packages an application, libraries, and its dependencies in a virtual container that can run on any server. Being that most applications do not run on one single component (even dinosaur apps 🦖 have frontend and backend components), we need a way to define and manage multi-container apps.

In this tutorial I will utilize Docker compose to get a blog up and running that consists of a Ghost Blog service and a MYSQL service; both services will use volumes for persistent storage. This tutorial assumes you have working knowledge of Docker and a server with Docker and Docker compose installed.
<figure>
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/orbmv7180cs9plj4tdl5.png" alt="docker compose services"/>
<figcaption>docker compose services</figcaption>
</figure>
## What is Docker Compose?

Compose is a file format for describing distributed Docker apps, and it’s a tool for managing them.

## What is Ghost?

Ghost is a free and open source blogging platform written in Javascript.

## Let’s go! 🐳

### Step 1 — Login to the server and become root

1\. SSH into the server and become root

`ssh <username>@PUBLIC_IP_ADDRESS`

`sudo su -`

Step 2 — Create a Ghost Blog and MySQL service

2\. Create a `docker-compose.yml` file in the root directory

`vi docker-compose.yml`

Add the following contents
```yaml
version: '3'
services:
  ghost:
    image: ghost:1-alpine
    container_name: ghost-blog
    restart: always
    ports:
      - 80:2368
    environment:
      database__client: mysql
      database__connection__host: mysql
      database__connection__user: root
      database__connection__password: P4sSw0rd0!
      database__connection__database: ghost
    volumes:
      - ghost-volume:/var/lib/ghost
    depends_on:
      - mysql

  mysql:
    image: mysql:5.7
    container_name: ghost-db
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: P4sSw0rd0!
    volumes:
      - mysql-volume:/var/lib/mysql

volumes:
  ghost-volume:
  mysql-volume:
```
### Step 3 — Start up the Docker compose service and Bring up the Ghost Blog

3\. `docker-compose up -d`

Congrats your blog is up and running! Validate via the public IP address of your Docker server.
<figure>
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3ip03e4r18fit41jnf6x.png" alt="ghost blog"/>
<figcaption>ghost blog</figcaption>
</figure>
Connect with me on Twitter [@toutfinesse](twitter.com/toutfinesse)
JavaScript with another angle
Published: 2021-05-07 15:04:32

1. Framework or library
First of all, JavaScript is not a Framework it's a library. the library is smaller than a framework. JavaScript Frameworks Example Is Angular, Vue Js. 
2. JSX
JSX is a way to write JavaScript and Html Code at a time, for jSX we can mix javascript and HTML, CSS. without jSX we can't write HTML code in JavaScript and JavaScript code in HTML, It's possible for jSX. 

3. React Data goes Down
Data in react always goes up to down, for example, we can pass data from the parent to child component with props. 

4. How to send data to parent
In react we can pass data from child to parant, but we can't do this with props we can pass function as props and help of the function we can pass data child to parent component.

5. Conditional Rendering
In react we can easy do conditional rendering, for doing this we can declare a state after that we write our code depense on state. if change state value code render different element.

6. Components
Component is very helpful for write clean and readable coding, because of component we can write code in a page and named it after that we can use it again and again. 

7. Hooks
React hooks originally is special function, all hooks start with word "use". hooks can use only in function component, we can't use it in class components.

8. Virtual DOM diffing
when some change is made by user the file is re-filtered and built a new Virtual DOM, now match old and new DOM for find difference. after find difference changes is applied to the actual DOM.

9. State
When a component need data than state is very useful. after fetch data we can store in state and use the data when need it. we can change state data using function.

10. keep the state small
for best coding experience and clean code always keep state small.
Day 102
Tags: 100daysofcode, programming
Published: 2021-06-04 17:33:47

Day 102/200 of #200DaysOfCode #100DaysOfCode

- Solved two problems on Codewars.

1 - Decrypt this school cipher (7 kyu)
2 - Sum of all the multiples of 3 or 5 (7 kyu)
I build this Chrome extension : This enables every webpage on internet to have a Live-Chat feature.
Tags: showdev, javascript, coding, chrome
Published: 2021-06-04 17:17:56

I hope you have watched live streams on YouTube or Twitch and seen a live chat going with it.

Inspired from there I got this idea of building a chrome extension using which every page on internet can get a live chat feature.

### How it works?
Whenever this extension is triggered it checks which website you are on and then connect you with other people on the same website.

And then it works like a simple Live chat.

### But there is a problem !
It will only works when everyone uses it means any other person on internet should also have the extension then only the person can connect with other

### Please use it and share it
Unless everyone uses this extension it will not show up people online, the purpose of building will not be fulfilled to give a live discussion chat.

> *At least have a look to it.*
Link to extension : [Click Here](https://chrome.google.com/webstore/detail/live-chat/jndncpcadllfnlbdlmfdjfachfkjnmki)

_Please Tell me How the extension is and what more can be done to it?_
Shopping Cart
Tags: codepen
Published: 2021-06-04 17:12:14

<p>My entry for the pattern rodeo no. 7. I am fully aware that there is some heavy DOM-traversing and that the overall js construction is poor, but it works for now.
Uses Zepto, Mustache en Justify Grid. Products can be pulled in as JSON, but in this case hardcoded.</p>

{% codepen https://codepen.io/bartveneman/pen/KHxLG %}
💬 Using Telegram for notes, bookmarks, and more
Tags: telegram
Published: 2021-06-04 17:44:17

---
title: 💬 Using Telegram for notes, bookmarks, and more
published: true
date: 2021-06-04 17:10:00 UTC
tags: 
- telegram
canonical_url: https://www.gozgeek.com/posts/2021/using-telegram-for-notes-bookmarks-and-more/
cover_image: https://cdn.collinsoft.com/file/cdn-collinsoft/gozgeek.com/img/2021/iphone-telegram/iphone-telegram-1024x.jpg
---

_Photo by [Adem AY](https://unsplash.com/@ademay?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/telegram?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

It’s no secret that Telegram is my favorite instant messaging platform. The advantages are many, with the biggest being its cross-platformness (it’s a word now, I just used it). I can run Telegram on any of my devices and computers, easily sharing information, pictures, and other multimedia.

Telegram offers unlimited storage, although the individual file size is limited to 2GB. More than enough space for bookmarks, notes, pictures, and videos that I may come across in my internet travels.

## Create some private groups

I have started private groups called **Notes** and **Bookmarks** to save little bits of information that I come across throughout the day. These groups have only one member, me! Telegram by default creates a **Saved Messages** group for you, but I like to break up the information. You could create a private group for each category. Do you like gardening? Create a private group called **Gardening** and save your notes, bookmarks, and other information in it.

These private groups are my “brain dump”, or a GTD inbox. They give me an easy way to save information. By lowering the friction to save, I have a better chance of actually saving the information.

To create a private group, you have to invite at least one other person. I use my wife’s account for this. After the group is created, you can remove the other person so that you are the only member. Now you can save your stuff into your group.

## Saving information

On my iPhone, I use the _Share Sheet_ and save information directly to the group. On the desktop and laptop, I copy the information and paste it into the group. Under Android, I can use the built in share mechanism to send information directly to the group I want.

## Access and searching

Now I can access that information from any of my devices. The built in search of Telegram works well in this regard.
7 Useful Github Repos For Developing Your Frontend Projects Faster ⚡️
Published: 2021-06-04 16:59:13



✨ Instantly fetch Stack Overflow results when an exception is thrown.
{% github shobrook/rebound %}

___

💡 Look up programming languages from your command line.
{% github chubin/cheat.sh %}
___

🔎 Search Stack Overflow from the command line. 
{% github samtay/so %}
___

✅ Check that your project is performant and SEO friendly.
{% github  thedaviddias/Front-End-Checklist %}
___

🧪 Run accessibility tests on your project.
{% github  pa11y/pa11y %}
___

📝 Generate a README for your Github repo.
{% github kefranabg/readme-md-generator %}
___
🔐 Protect your master branch in Git from accidental deletion or rogue code.
{% github  dwyl/protect-master-branch  %}
___
X.509 Certificate Creation Made Easy with CertsGenerator (Open Source)
Tags: python, x509, security, certificates
Published: 2021-06-04 16:40:49

Generating certificates for your company or for development purpose can be challenging and a lot of solutions exist to provide easy setup and management of your certificates.

Eventually you also have [CertsGenerator](https://github.com/t1m0t/certsGenerator) which does it in a very simple but nevertheless efficient manner: just create a json file with the appropriate configuration and let the application generate the certificates for you!

This application uses [pyca](https://cryptography.io/en/latest/) under the hood , which is one of the main library for the Python language that manages x.509 certificates along with the cryptographic materials. As you may know, x.509 uses these materials to work with certificates and [pyca](https://cryptography.io/en/latest/) handles under the hood all you need to safely do the job.

[CertsGenerator](https://github.com/t1m0t/certsGenerator) acts as an interface between [pyca](https://cryptography.io/en/latest/), and the JSON configuration file in order to generate x.509 certificates:

![1 HMhGe7dvmuf9OuSgQHBmTg](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6psksuq1y48jbq0ti0uq.png)
For example you would set the configuration like [this](https://github.com/t1m0t/certsGenerator/blob/main/tests/confs/test2.json). Other examples are in these [testing configuration files](https://github.com/t1m0t/certsGenerator/tree/main/tests/confs) but you can adapt it depending on your needs.

Thank you for reading this article and feel free to contribute to this project.

Cheers
What expert iOS devs expect from WWDC21
Tags: ios, wwdc, apple, iosdevelopment
Published: 2021-06-04 16:39:16

"Dub Dub" is just around the corner, so that means that every iOS developer out there is filled with equal parts excitement about the shiny new things being announced, and dread about the many ways in which those shiny things will break their apps.

Wondering what expert iOS devs wish for, fear, and expect from this year's Apple Developer Conference? We asked:

## WWDC 2021 Wishes, Fears, and Expectations

Vincent Pradeilles, iOS developer and [YouTuber extraordinaire](https://www.youtube.com/c/vincentpradeilles), spent the last couple of weeks talking to some great folks from the iOS community to ask them about their expectations, fears and wishes for this year's WWDC.

In [a series of interviews](https://youtube.com/playlist?list=PLbKJc0NMPDrAFqAhPPUkCRzvBTlraB5p-), he spoke to Kaya Thomas, Donny Wals, Anastasiia Voitova, Antoine van der Lee, Ellen Shapiro, and Carola Nitz to hear their thoughts.

### Vincent Pradeille's perspective
{% youtube GHTcfENP3XM %}

### Kaya Thomas' perspective
{% youtube 1DtE4yn0dbI %}

### Donny Wals' perspective
{% youtube 55zK18V_X1M %}

### Anastasiia Voitova's perspective
{% youtube 8VG_7V3rEHU %}

### Antoine van der Lee's perspective
{% youtube S1jTcXRQeP4 %}

### Ellen Shapiro's perspective
{% youtube CizsMCF7QS0 %}

### Carola Nitz's perspective
{% youtube 6fseH5PR_No %}

### Join the post-WWDC conversation
To see just how wrong/right everyone was, join them in a post-WWDC live discussion hosted by [Bitrise](https://www.bitrise.io):

Date: June 17th, Thursday
Time: 9 AM PDT / 6 PM CEST

Guests: Paul Hudson, Ellen Shapiro, Vincent Pradeilles, Anastasiia Voitova, Donny Wals, **you**

[Reserve your seat here](https://www.bitrise.io/webinar/wwdc2021-recap-panel-discussion) (if you're not able to make it, we'll send you the recording after the stream has ended)
What was your win this week?
Tags: discuss, weeklyretro
Published: 2021-06-04 16:25:39

---
title: What was your win this week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: discuss, weeklyretro
cover_image: https://cl.ly/188e843c2985/download/Image%202019-02-15%20at%202.36.37%20PM.png
---

Hey there!


**Looking back on your week, what was something you're proud of?**

All wins count — big or small 🎉

Examples of 'wins' include:

- Starting a new project
- Fixing a tricky bug
- Catching up with an old friend... or whatever else might spark joy ❤️ 

---

Happy Friday!

![Squidward jumping for joy](https://media.giphy.com/media/3ogwFHc9GXotMKjhlu/giphy.gif)
GitHub Search
Tags: webdev, github, react, firebase
Published: 2021-05-27 15:09:18

**Search GitHub user and show user info with different UI and add or remove user repo to the favorite list using react with firestore and firebase authentication**

### Demo
GitHub: https://github.com/DIp15739/github-search
URL: https://searchgithubuserinfo.netlify.app

<p align="center">
<a href="https://user-images.githubusercontent.com/42184833/119221268-259d4e80-bb0c-11eb-85a9-8670dcd09d8f.png" target="_blank">
<img src="https://user-images.githubusercontent.com/42184833/119221268-259d4e80-bb0c-11eb-85a9-8670dcd09d8f.png" width="90%" /> 
<a/>
</p>

## **Features**  

-   **Authentication**

	1.  Sign up
	2.  Login
	3.  Forgot Password using email  
    
	4.  Logout

-   **user info**

	1.  Search GitHub user using GitHub API
	2.  Show user profile

		- Avatar

		- Name  

		- Username / Github Id  

		- Bio  

		- Blog URL / Website  

		- Location

  
	3. User Repo

		- Total Repo, Gists and Followers Count

		- Name (on click open github repo page)

		- Description  

		- language  

		- Star count  

		- Watch count

		- Heart icon for add to favorite

	4. add or remove repo in favorite

  

## **Technologies**
1.  React 16.13.1
2.  React Dom 16.13.1
3.  React Router Dom 5.2.0
4.  React Toasttify 7.0.4
5.  Axios 0.21.1
6.  React Bootstrap 1.6.0
7.  Bootstrap 4.6.0

## **How to Use**

    git clone https://github.com/DIp15739/github-search.git
    cd github-search
    npm install

 - ### **Firebase**
	 - Create
		 - Create Firebase Project
		 - Start Authentication with Email
		 - Start Cloud Firestore
		 - Copy config from Project settings
	
	- Setup in project
		- Create `.evn.local` file and add all data</br>
***REACT_APP_FIREBASE_API_KEY*** = apiKey value </br>
***REACT_APP_FIREBASE_AUTH_DOMAIN*** = authDomain value </br>
***REACT_APP_FIREBASE_DATABASE_URL*** = databaseURL value</br>
***REACT_APP_FIREBASE_PROJECT_ID*** = projectId value </br>
***REACT_APP_FIREBASE_STORAGE_BUCKET*** = storageBucket value </br>
***REACT_APP_FIREBASE_MESSAGING_SENDER_ID*** = measurementId value </br>
***REACT_APP_FIREBASE_APP_ID*** = appId value </br>
 
 - ### **In the project directory**

	### `npm start`

	Runs the app in the development mode.  
Open  [http://localhost:3000](http://localhost:3000/)  to view it in the browser.

	The page will reload if you make edits.  
You will also see any lint errors in the console.

	### `npm test`

	Launches the test runner in the interactive watch mode.  
See the section about  [running tests](https://facebook.github.io/create-react-app/docs/running-tests)  for more information.

	### `npm run build`

	Builds the app for production to the  `build`  folder.  
It correctly bundles React in production mode and optimizes the build for the best performance.

	The build is minified and the filenames include the hashes.  
Your app is ready to be deployed!

	See the section about  [deployment](https://facebook.github.io/create-react-app/docs/deployment)  for more information.
BUG: multiple message boxes in antd
Tags: antd, react, javascript, webdev
Published: 2021-06-04 16:11:53

We use antd in our react project. We saw for some reason they were showing up multiple times on a single event click. We were able to solve it using a config options for the message function.

```
message.config({maxCount: 1});
```

This is what you will be needing basically.
Asphalt Crack Sealing Repair in lancaster PA
Published: 2021-06-04 15:35:37

Are you searching for [Asphalt Crack Sealing Repair lancaster pa](https://drivewaypavinglancaster.com/asphalt-crack-sealing-repair)?
In choosing the sealer or sealant for our asphalt driveway, we have many factors to consider. You may ask yourself, can I afford this? Is it worth it? There may be a lot of driveway sealing companies in Lancaster, Pennsylvania that recommend you different types of sealant or sealers to use for your asphalt driveway.
Rails System Tests with Headless Chrome on Heroku CI
Tags: rails, heroku, ci
Published: 2021-06-04 15:20:41

Sometimes your Rails apps just need to execute JavaScript in a real browser. But you also want to run tests on CI, which typically doesn't have a UI. So you need to configure Google Chrome to run _headless_, i.e. without popping up a browser window (but still exercising your app as if it were).

Urgh.

Having just worked through this now, here's what worked for us.

## Prerequisites
Install [chromedriver](https://sites.google.com/chromium.org/driver/).

## Configure test environment
In your `app.json`, add the `chromedriver` and `google-chrome` buildpacks, as well as the usual `ruby` one. Our `app.json` ended up looking like this:
 
```
{
  "environments": {
    "test": {
     "buildpacks": [
        { "url": "https://github.com/heroku/heroku-buildpack-ruby" },
        { "url": "https://github.com/heroku/heroku-buildpack-chromedriver" },
        { "url": "https://github.com/heroku/heroku-buildpack-google-chrome" }
      ],
      "addons": [
        "heroku-postgresql"
      ],
      "scripts": {
        "test-setup": "bin/rails assets:precompile",
        "test": "bin/rspec"
      }
    }
  }
}
```

Also, set any environment variables you might need in your test env via the Heroku UI. You can set non-sensitive stuff in app.json if you want, though.

## Configure Capybara with a headless driver

```
# spec/rails_helper.rb

chrome_bin = ENV.fetch('GOOGLE_CHROME_SHIM', nil)

chrome_opts = chrome_bin ? { "chromeOptions" => { "binary" => chrome_bin } } : {}

opts = Selenium::WebDriver::Chrome::Options.new

chrome_args = %w[--headless --no-sandbox --disable-gpu]
chrome_args.each { |arg| opts.add_argument(arg)  }

Capybara.register_driver :headless do |app|
  Capybara::Selenium::Driver.new(
     app,
     browser: :chrome,
     options: opts,
     desired_capabilities: Selenium::WebDriver::Remote::Capabilities.chrome(chrome_opts)
  )
end

Capybara.javascript_driver = :headless
```

...and that's about it.

The bit that we found we had to do that was different from other posts of this nature we found was setting `Selenium::WebDriver::Chrome::Options.new`. Without this, everything we tried to tell Chrome to be headless was ignored.

If you're reading this, I hope it helps!

## References
- [Heroku Buildpack Google Chrome](https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-google-chrome)
- @fdoxyz [Headless Chrome - Dual mode tests for Ruby on Rails](https://dev.to/fdoxyz/headless-chrome-dual-mode-tests-for-ruby-on-rails-4p6g)
- @ideasasylum [Rails Testing with Headless Chrome on Heroku CI](https://jamie.ideasasylum.com/2017/08/19/rails-testing-with-headless-chrome-on-heroku-ci/)