teleren/devto huggingface dataset:
Js Statement vs Expression
Tags: javascript, programming, webdev, react
Published: 2022-01-22 07:39:30


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

## Expression
**  When we are use any value for using insiade a variable, If else condition, Loop etc. This value initialization  are called expression. Simple Statement justify the expression and do the action after considering the expression. 
```javascript
// Expression
'Zonayed' + ' ' + 'Ahmed';
```
**

## Statement -
** Simple inside javascript when we are using second bracket after closing that we are using semicolone that's whole syntext called statement. In details statement working with expression, consider it and do the action after justify the expression. 
```javascript 
// Statement
for(expressions) {
   //Some Code here
}
```

Remember if we are using arrow function inside a variable that whole things are not Statement that is called expression.
Future Ideas for Telescope
Tags: osd700, opensource, telescope
Published: 2022-01-22 07:32:24

This is the 2nd week since I started to work as a maintainer for [`Telescope`](https://github.com/Seneca-CDOT/telescope), a blog aggregator mainly maintained by Seneca College students and alumni. The purpose of `telescope` is to let students to have experience on working on a real open source project, as well as learning about open source.

Last Thursday we released Telescope 2.5! There were some minor setbacks and issues that we had to resolve, so now we have Telescope 2.5.1, as well!

I have to say that it was an interesting how everybody worked diligently to finish the necessary work for the 2.5 milestone. For this week, I took a more relaxing approach on the project, focusing on some reviews along the way. Most of the coding happened last week, so I had to focus on any help that someone may ask me.

However, I decided to also focus on two areas that some people might not be super interested on when working on a project: dependencies and documentation.

## Documentation

Oh, the dreaded documentation work! If I was listing the areas that people dread the most, documentation writing would probably be in the top.

If I had to be honest, I also do not enjoy writing documentation. It is not because I don't like writing documentation at all, it's because most of the time I need to write the documentation right when I finished writing the code. It is very difficult to write documentation without hiding some important information because you didn't think it was important while writing it.

Writing documentation is not easy, as you don't want to have to edit it all the time. We are already writing code, now we have to write documentation and maintain it on top of that?

However, one thing I enjoy doing is going through old code and understand what it does. There is this weird drive within me that wants to discover what the codebase is doing, and diving into the code after being familiar with the project is more feasible that if I had started when I knew nothing.

It is ambitious, but not impossible! I will require the help of everybody in the project to thoroughly review the documents written, and I help review other people's documentation.

To use testing terms, I hope we will achieve over 50% coverage for documentation on Telescope!

## Dependencies

I mentioned dependencies, but what do I mean?

Well, I would like to help on how to visualize the dependencies of Telescope, so that we can also help our community. Telescope wouldn't exist thanks to the work poured into these projects every day, so to have a healthy open source community, the best one can do is to contribute back!

However, to contribute back, one needs to find that potential work. The first step is to find it! Thus, being able to visualize the dependencies you use and gather more information about them would help by a whole lot!

This sounds promising and also like a lot of fun! I'm excited to work on this, as I feel it would have a big impact in the project.
Mapping in solidity
Tags: solidity, web3, mapping, blockchain
Published: 2022-01-22 07:29:52

---
title: Mapping in solidity
published: true
description: 
tags: solidity, web3, mapping, blockchain
---
Mapping in Solidity acts like a hash table or dictionary in any other language. 
```
mapping(key => value) <access specifier> <name>;
```

 keys are mapped to a value. Data isn't stored in a mapping, only its hash value.

- key: any built-in types like `uint` , `bytes`, `string`  except  for a `mapping`, `a dynamically sized array`, a `contract`, an `enum` and a `struct`.
- value: any type including `mapping`, `struct`, `arrays`

They don't have a length and you can't iterate through the mapping.
e.g.
```sh
// mapping declaration
mapping(uint => string )public people

// update mapping
 people[10] = 'Mark'; // assigns a value
people[12] = 'Andrew';

 // reading  values

people[1] // reads a value

 people[unknown_key]    //will return the default value of the type, i.e '' for string or 0 for unint

```
**Assign an array as a map value**
We can assign an array as a value type to a map and can access them as we would an array like below:
```
contract Mapping {
    
    mapping(address => uint[]) scores;    
    
    function manipulateArrayMap() external {
        scores[msg.sender].push(1);             //assign a value; 
        scores[msg.sender].push(2);             //assign another element
        
        scores[msg.sender][0];                  //access the element in the map array
        
        scores[msg.sender][1] = 5;              //update an element in the map array in index 1
        
        delete scores[msg.sender][0];           //delete the element in the index 0 of the map array
    }
    
}
```
**Assign another map as a map value**
We can also assign another map as a map value and can access them as we would access a map like below:
```
contract Mapping {
    
    mapping(address => uint) balances;
    mapping(address => mapping(address => bool)) approved;
    
    function manipulateMapOfMap(spender) external {
        approved[msg.sender][spender] = true                     //assign a value to the approved map
        approved[msg.sender][spender];                           //get the value of the map
        
        delete approved[msg.sender][spender]                     //delete the reference
    }
    
}
```

**Common Use case**
associate unique Ethereum addresses with associated unique values
Laravel 9: New Designs!
Tags: laravel, laravel9, php, webdev
Published: 2022-01-22 07:28:30

Soon, Laravel 9 wil release and there are some new features that we can use them.

This series is going to be a sequel about Laravel framework version 9 and in each article we will review a new feature!

#### 1. Say hello to new Error Page

![Laravel 9 Error-Screen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mtua827px6hsf3ryoyaf.jpeg)

New Laravel 9 Error Page will provide some new information, functionalities and help we understand code better.
This design will show us routes, stack, context parameters and so much more...

#### 2. Beautiful Route List

![Laravel 9 New Route List](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eciku95elawgc24ycfhp.jpeg)

Maybe, you are agreed with me about we needed a fresh design for showing the list of routes with `php artisan route:list` command and here it is with Laravel 9.

#### 3. Test Coverage through Terminal

![Laravel 9 Test Coverage](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ph07ws80n43na6d3gs4i.jpeg)

[Nuno Madru said:](https://twitter.com/enunomaduro/status/1483502508593065985?cxt=HHwWgsC5gf7qupYpAAAA)

> In Laravel 9, they will be introducing the `artisan test --coverage` option. This option displays the test coverage directly on the terminal.
> This feature comes with an `--min` option, that you may use to indicate the minimum threshold enforcement for test coverage.


Farewell... till next episode!
Component Inheritance in Angular. Object-oriented programming Series (Part 1)
Tags: angular, javascript, beginners, tutorial
Published: 2022-01-22 07:23:24

As you no the four fundamental concepts of Object-oriented programming – Inheritance, Encapsulation, Polymorphism, and Data abstraction.

In this post we would be look at how to perform Inheritance with angular component.

##Step 1

Create a base component which contains any logic  which could  be reusable across other component in your application.



```

import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'es404020-base',
  template: '',
})
export class BaseComponent {
  public submitted: boolean;

  constructor() {
    this.submitted = false;
  }

changeState(){

    this.submitted !=  this.submitted 

}

 

  
}





```

##Step 2

Next is to inherit this base component.To inherit a class we simply extend the component.

```


export class AppComponent extends BaseComponent implements OnInit {

constructor() {
super();

}
}




```

super():be used in expressions to reference base class properties.

That how you can achieve simple Inheritance in angular.Thanks for reading.
Which Are The Key Attributes of Performance Engineering?
Published: 2022-01-22 06:22:40

Performance engineering is dynamic and ends application performance testing by continuously monitoring the software development life cycle. Performance engineering is used to recognize the hidden potential of your software by fixing issues, and it bottlenecks the bugs and errors by providing analytical reports to the developers. It is concerned with performance, as the name suggests. Continuous feedback loops are given by allowing flawless collaboration of system tools, processes and teams of analysts and developers. 

It is used to carry out non-functional requirements of the system. Other alternatives for performance engineering are system engineering and application engineering. Performance engineering is a discipline that applies mathematical, scientific, analytical, and measurement concepts to fulfill a system's non-functional requirements and deliver them to the end-user.

Performance engineering is now a requirement in large corporate offices. It is a separate discipline that runs parallel with system engineering. The chief objective of performance engineering is to increase the business revenues, ensuring the system completes transactions within the given time limit.

The performance engineer helps maintain the reliability of software applications and IT systems by improving the performance of the applications and systems. In addition, a performance engineer helps develop the product better by eliminating and fixing the system issues.

Performance engineering makes software maintenance costs feasible by avoiding unnecessary hardware acquisition costs. The unnecessary system rework and the late software deployment are also eliminated caused by performance issues. Besides this, performance engineering increases server capability and future identity bottlenecks. Performance engineering continuously performs testing and monitoring systems, providing a collaboration of tools, teams and processes through feedback loops. Performance engineering tracks the app once the code is deployed and uses specific application tools to put it into APM.

Business requirements drive performance engineering. Potential Issues in the development cycle of business are solved by performance engineering, right from the designing stage to deployment, thus decreasing the cost of software development. 

Performance engineering has its QA process embedded in every software development life cycle stage. The end-user is highly benefited by using [performance engineering](https://aitglobalindia.com/performance-engineering/) as customer-based applications are produced consistently with high-performance results. 

End -to- End system optimization is delivered through continuous testing and monitoring processes through performance testing. A multifunctional team of project analysts and developers maintain a high-performance level to enhance customer satisfaction. COE (Testing Center of Excellence) provides testing services, and it is the most trusted service. COE suggests different testing methods and supports other business units.
JCenter shutdown impact for android developer
Tags: reactnative, javascript, android, java
Published: 2022-01-22 06:16:01

10 days remained before jcenter() shutdown and this will affect android developer during compiling  and building APK to avoid this you must point your project to other repositories such as mavenCentral().For those who are using react-native,they can upgrade to react-native latest version which use maven central as the repository.
https://blog.gradle.org/jcenter-shutdown
Mounting remote folders over SSH
Tags: ssh, mounting, remote, terminal
Published: 2022-01-22 06:15:34

Challenges:

1. Permanence:
2. Write permission
3. Reconnects 
4. Authentication


Install ssh:
`sudo apt install ssh sshfs`

generate SSH Keys:

`mkdir $HOME/.ssh`
`chmod 0700 $HOME/.ssh`
`cd $HOME/.ssh`


`ssh-keygen -t rsa 4096`

copy the keys to the server
`ssh-copy-id username@remotehost`



##Do not recommend it
#Disable Password Authentication on the:
#`sudo nano /etc/ssh/sshd_config`
#change 
#`PasswordAuthentication no`

`sudo systemctl restart ssh`

##Challenges are how to get around default read_only
#1) The mounted folder can only viewed using `su` and graphically must run graphical su equivalent

`sudo sshfs user@remote:/home/user/ /home/userc/1/2 -o reconnect -o idmap=user -o allow_other -o allow_root`
Git Commands Every Dev MUST know
Tags: git, devops, opensource, programming
Published: 2022-01-22 06:04:57

Hello and Good Morning ☕
I know I had not been writing lately, but now I am back on my writing spree 🎉
Today we are going to see some awesome git commands, that every developer MUST know. Look carefully when I stress on the word MUST. Knowing these commands would definitely make your time easier. 😉
So let's start.
- Initialize local git repository
```git init```

- Add a particular file to a repository
```git add git_commands.md```

- Add all uncommitted files to the repository 
```git add .```

- Set Repository
```git config --global user.name 'mursalfk'
git config --global user.email 'mursalfurqan@gmail.com'```

- Add message to your commit
```git commit -m "You can add a message to your commit like this"```

- See commit history
```git log```

- Add remote Name/URL
```git remote add origin 'https://github.com/mursalfk/mursalfk.git'```

- Push your changes to remote repository
```git push origin master```

- Clone any repository
```git clone 'https://github.com/mursalfk/mursalfk.git'```

- Update the current working directory
```git pull origin master```


> Tired already? Come on... It's not that long 😉
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nm22olicm0zakxf1xoso.png) 


- Check difference in between commits
```git diff HEAD~1 HEAD```

- Download files from any repository
```git fetch origin master```

- Create a new branch
```git branch branchName```

- Create a new branch inside a folder
```git branch branchFolder/branchName```

- Switch to another branch
```git checkout branchName```

- Switch to another branch present in another folder
```git checkout branchFolder/branchName```

- Create and checkout to the new branch at the same time
```git checkout -b branchName```

- Create and checkout to the new branch present in another folder at the same time
```git checkout branchFolder/branchName```

- Merge to a new branch
```git merge master```
Enterprise Software Lifecycle Management
Tags: software, management
Published: 2022-01-22 05:49:26

This computer science course will teach you the models, methods and practices of [software](https://www.mitzon.com/edx/enterprise-software-lifecycle-management/) development to make the process manageable and result in high-quality and efficient software products. This course is an introduction to software lifecycle management using the approved principles and best practices developed by IT leaders and verified by large-scale systems operation.
How Do We Make A SNES Emulator (using python) ?
Tags: help, programming, python
Published: 2022-01-22 05:44:48

everyone has played mario and kirby games since snes and nes were launched right ? maybe some of you haven't but i am not going on those games i am going on the console snes which is now in emulated versions now i have a question how do we make an snes emulator using python ? why not make a small team and build it ? thanks in advance
Self-Taught Developer Journal, Day 45: TOP Building Rock Paper Scissors UI cont.
Tags: webdev, beginners, codenewbie, devjournal
Published: 2022-01-22 05:44:26

Today...

I am still working on the Rock Paper Scissors UI for The Odin Project.

I designed a rough mock up of what I plan to create for the game. 

![Mockup](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y4zmyjzfgv42cxxegrh5.png)

Since we already created the logic for the game in JavaScript, I don't have to worry about the script right now. So I am going to focus on creating the HTML elements first and use CSS to set them in the desired locations. Then I will add the DOM manipulation methods and events in my JavaScript code because I'll have something to select. 

After testing the game, I will go back and add the CSS to style. I am not sure yet on the exact design, but I will decide that after I get the game working on the webpage.

## Resources
[The Odin Project](https://www.theodinproject.com/paths/foundations/courses/foundations/)
[Revisiting Rock Paper Scissors](https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/revisiting-rock-paper-scissors)
First Week of Telescope
Tags: javascript, opensource, webdev
Published: 2022-01-22 05:03:04

This week has been a tough week with the issues I have been trying to solve. This week I was focusing how to start integrating React Native into Telescope through this [discussion](https://github.com/Seneca-CDOT/telescope/discussions/2667). A lot of good things came from the discussion like:

- Keeping a Monorepo.
- Deciding on the Expo CLI.
- An idea on a UI library to start with.

After figuring out how to move forward with the React Native, I wanted to fix an issue for the Release but I never got to make it. I was working on [CSP error in Dashboard with inline (“script-src” #2511)](https://github.com/Seneca-CDOT/telescope/issues/2511). I was able to get [CSP examples](https://content-security-policy.com/examples/allow-inline-script/) from [Amasia](https://github.com/AmasiaNalbandian). After reading through the website I tried the two methods of fixing the issue, hashing the function and putting it in the `script-src` or using nonces on the scripts causing the errors. I took me awhile to hack away with these methods as I thought the material-UI library was causing the scripting error but, I figured out that it was not. After trying to use the debugger to figure out the problem I had to take a break and step away from the computer for a little bit. I am hoping to look back at it with a pair of fresh eyes this week and finally close these issues. After I finish this issue and another issue assigned to me, I want to officially kick off React Native development.
Python #3 : estrutura de dados - tuplas
Tags: python, codenewbie, datascience, beginners
Published: 2022-01-22 04:53:03

_Esse post faz parte dos meus cadernos **pessoais** de estudos. Todas as anotações são baseadas nas aulas da Mentorama - Cientista de Dados do zero e organizadas sob o meu ponto de vista. M2A1A4._


---


### Estrutura de Dados em Python

Definição: Coleções de dados com características específicas

#### Tuplas 
Imutáveis, você só altera a tupla inteira. Vários tipos.


---

#### Criar tuplas 

Para criar tuplas você coloca os elementos entre `()`separados por `,` _na lista a gente colocava com `[]`, lembra?_

`tupla_inteiros = (1,2,3)`

também dá pra criar usando o método `tuple`

`tupla1 = tuple((1,2,"a", True,"a"))`

Nas tuplas também dá pra usar a função `len` para contar os elementos

`print(len(tupla_inteiros))
3`
`print(len(tupla1))
5`

##### Acessar os elementos por indexação, igual nas listas 

`tupla1[2]
'a'`

##### Concatenação de tuplas 

`tupla_inteiros + tupla1
(1, 2, 3, 1, 2, 'a', True, 'a')`

##### Funções básicas das tuplas

`print(max(tupla_inteiros))
print(min(tupla_inteiros))
3
1`

##### A TUPLA É IMUTÁVEL 

Diferente da lista, não conseguimos alterar um elemento da tupla. 

`tupla_inteiros[0]=2
TypeError: 'tuple' object does not support item assignment`

mesmo erro que ele apresentou quando tentei alterar um elemento de uma `string`

Por esse fato, não temos tantas funções de mutação como tínhamos na lista: `insert, append, remove, pop`.
 
Mas temos outros...

##### Contar elementos 

`tupla1.count('a')
2`

##### Buscar elemento por index 
sempre a primeira aparição do elemento

`tupla1.index('a')
2`
Week 2 : A lot of opportunity ahead 
Tags: opensource, javascript, typescript
Published: 2022-01-22 04:46:09

We are heading by the end of week 2 with a lot of opportunity to expanding our lovely [Telescope](https://telescope.cdot.systems/) project

## Things I work on during the week

I have been working on 2 PR during the week [PR-2665](https://github.com/Seneca-CDOT/telescope/pull/2665) where I pick up @yodawgz0 work on idicate the status of the build. My first attempt was to figure it out how the code work after I follow the long conversation between Andrew and @yodacanada on what could have been work on. After I spent time working on refactoring the code we all come to agree that the logic have been implementing in another PR (dev life :)) and we only need to automate loading status using icon from `material-icon` and delete `datetime-calculator.js` since I find no usage for it. For this PR we still need to automate a webhook build from Github which I filed an [issue-2701](https://github.com/Seneca-CDOT/telescope/issues/2701CDOT/telescope/issues/2701), I might  need to investigate more since the build data seem not showing up properly on my end even though I had pinged one of the maintainers to trigger a buid manually but we did not see any information related to the build showing up.

The second [PR](https://github.com/Seneca-CDOT/telescope/pull/2706) which is quite easy where I only need to wrap the embedded Youtube video preview in an `<a>` tag

This week I have to say Gitpod really got me. It is way too convenience to work on it even though I was not master it yet. It automate rebuilding container images for me and get everything set up and ready to go. The only things I would need to figure it out on how I can rebuild all the images. What I did was to turn off the workspace and try to access it again which is not optimize at all.
 
## Moving on to 2.6 release

Yesterday on Slack people was having fun of someone breaking production because of their search PR. 
So that what people think and act which is possitive for the work. People don't just freak out but instead slowly looking for trouble and fix it. Just like what our prof say in the first meeting. He hope all of us get good at getting lost ! 

Coming into the next release I hope to contribute on the beggining of the React Native part of our project. People on the group also show many good idea on how to improve it. I would love to help out and also maybe implement a copy to clipboard button for code area in students blog post ! Looking forward to crash production !