teleren/devto huggingface dataset:
Day 9/100
Tags: 100daysofcode
Published: 2022-02-02 07:21:07

Mid Week Madness!

Day 9/100

**Language:**
JAVA

**Time Period Spent:**
2hrs

**Course Taken:**
Udemy: Java Programming Masterclass - Tim Buchalka

**Todays Learning:**
Code Challeneges:
	- Number Palindrome
	- First and Last number
	- Even Digit Sum
	- Share Digit
	- Last Digit Checker
	- Greatest Common Divisor
	- All Factors
	- Perfect Numbers
	- Number To Words

**Additional Notes:**
Some more productive work gotten in today and done some more challenges. This section of the course seems to be focused on code challenges. There are about 15+ alone in this one. I prefer this format, it gets you away from the dreaded tutorial hell.

Spent some time perfecting the code today. Once I found a solution, I cleared up the excess code, just some housekeeping as I would finish the challenge.

On another note, reading the new book I posted a couple days ago (Outliers) and I can safely say for now that it is worth the read!Mid Week Madness!

Day 8/100

**Language:**
JAVA

**Time Period Spent:**
2hrs

**Course Taken:**
Udemy: Java Programming Masterclass - Tim Buchalka

**Todays Learning:**
Code Challeneges:
	- Number Palindrome
	- First and Last number
	- Even Digit Sum
	- Share Digit
	- Last Digit Checker
	- Greatest Common Divisor
	- All Factors
	- Perfect Numbers
	- Number To Words

**Additional Notes:**
Some more productive work gotten in today and done some more challenges. This section of the course seems to be focused on code challenges. There are about 15+ alone in this one. I prefer this format, it gets you away from the dreaded tutorial hell.

Spent some time perfecting the code today. Once I found a solution, I cleared up the excess code, just some housekeeping as I would finish the challenge.

On another note, reading the new book I posted a couple days ago (Outliers) and I can safely say for now that it is worth the read!
how to trace the api used in a web system using a view or controller in laravel
Tags: api, laravel, beginners
Published: 2022-02-02 07:20:56

am trying to find the api used in one system to push data to another system. The api isnt configured in the api.php yet its somewhere in the system's structure.is it possible to trace the api used in a system using the views or the controllers.i understand that after creating data and storing it,then its pushed using an api to another system.i have already configure it on the env file of the target system where data is being pushed.

TSYSTEM=oceania_caspar
MOTHERSHIP_URL=http://ocosystem.my 
ONLY_ONE_HOST=false
LOCAL_IPADDR=oceania

how can i be able to trace the api in the controller or the views.
DNA – Free One Page HTML Template
Tags: css, html, javascript, webdev
Published: 2022-02-02 07:14:51

DNA is a free [One Page HTML Template](https://htmlcssfreebies.com/dna-one-page-html-template/). It is a multi-purpose template with a modern, trendy and, responsive design.

![DNA - Free One Page HTML Template](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c6d6au5yjuaczml2gn12.png)

## Features

* Content Focused
* Cross Browser Compatible
* Google Fonts
* HTML5 and CSS3
* Modern Typography
* No Framework
* SEO Friendly
* Trendy Design
* Well Structured Code
* W3C Valid

## Highlights

* Pricing Layout
* Modern Footer
* Trendy Off-canvas Menu

## Links

* [Live Preview](https://htmlcssfreebies.com/demo/?id=2)
* [Download](https://htmlcssfreebies.com/dna-one-page-html-template/)

Show your adoration by giving credit for the design and sharing it with your friends.

Enjoy :)
JUnit parameterized tests
Tags: tutorial, java, programming, testing
Published: 2022-02-02 07:14:48

![test](https://cdn-images-1.medium.com/max/2000/0*cFCxSe1YVKjn4fa5.jpg)

## Parameterized test?

Since JUnit4 we can now run the parameterized test, but what does that mean? It means that we can run one test multiple times with different values, great isn’t it?

## How to?

Yeah that great, but how can I do that?
That simple :

* Annotate your test class with **@RunWith(Parameterized.class)**

* Create method annotated with **@Parameters** that returns an Iterable of Objects as test data set.

* Create a constructor that takes as a parameter what is equivalent to one row of your dataset. Or create instance variable that will be equivalent as one parameter and annotate them with **@Parameter(X)** where X is the parameter index in a row of the dataset.

* Create a test case that will use your [instance variable](https://javarevisited.blogspot.com/2012/02/difference-between-instance-class-and.html).

Ok, but concretely can I have an example?

## Exemple

### Class to test

Let’s take a simple class, that take a [String literal](https://javarevisited.blogspot.com/2012/12/how-to-escape-text-when-pasting-as-String-Eclipse-tips.html#axzz5QyeMF7nJ) of a calcul as parameter and return the result.
{% gist https://gist.github.com/ErwanLT/fbd9e376006b6a531e7b870478ac9e8a.js %}
### Classique Junit test

In a Classique way I wrote this test class to test each one of my case
{% gist https://gist.github.com/ErwanLT/a1d1deec27875504efc8cd2d3157d3c1.js %}
As you can see, I have one test per test case, here as my class is simple, it doesn’t have that much line, but what if my class was more complexe, it will be a lot more code, redundant isn’t it?

### Parameterized

Here is the same test, but parameterized, you can see all the previous statement established in the How-to section

* The runner

* The dataset

* The parameters

* The test who use it
{% gist https://gist.github.com/ErwanLT/797c5e16b365ebf6c172726618a4cdc8.js %}
So with one test, I have my 5 previous test cases tested.

Thanks for your reading time, the example in this article are in [Junit4](https://medium.com/javarevisited/top-10-courses-to-learn-eclipse-junit-and-mockito-for-java-developers-4de1e8d62b96), if you want an exemple using [Junit5](https://medium.com/javarevisited/5-courses-to-learn-junit-and-mockito-in-2019-best-of-lot-f217d8b93688?source=---------20------------------), I will write another article about it.
Got the definition of insanity by trying to solve an unsolved math problem with c++
Tags: math, cpp, programming
Published: 2022-02-02 07:06:06

Past days ago, I have read about unsolved math problem on [quantamagazine](https://www.quantamagazine.org/why-mathematicians-still-cant-solve-the-collatz-conjecture-20200922/) post. This problem can be easily understood by the mathematicians or not.

Here is the problem :

Choose an integer, if it’s an even number cut it in half. If it’s odd number, multiply the number with three and add 1. Take the calculated number and repeat the process, then you will be stuck in the same loop.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/80r1gvn92e709pn00k9z.PNG)

For the example, I’ll pick 6, it’s even number, definitely.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2r0xt2flwcgysffm2wzm.PNG)


I'm stuck in a 4-2-1 loop. But what about the other numbers? Will I still be stuck with the same number?

I tried to prove it with the program.

```
#include<iostream>

void math_problem(int number){
	int temp=1;
	while(number>0){
		if(number % 2==0){
			number=number/2; 
			std::cout<<number<<std::endl;
		}
		else{
			number=(number*3)+1;
			std::cout<<number<<std::endl;
		}
	}
}

int main(){
	math_problem(29);
	return 0;
}
```

As a result I am still stuck in the same loop.

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


This is like a quote from Albert Einstein, one of the greatest physicists in human history, about the definition of insanity is doing the same thing over and over again, but producing the same result.

Maybe you passed the incorrect grammar or tenses, i'm sorry, i'm bad in english :)
How to center align a table on page and elements inside the table
Tags: css, html, codever, snippe
Published: 2022-02-02 07:05:36

**Project**: `codever` - **File**:  `howto-get-started.component.scss`

Set `margin-left` and `margin-right` to `auto` to align in center of the page/div and `text-align` to align the text and image inside of the table headers and cells:

```html
.extensions-table {
  margin-left: auto;
  margin-right: auto;
  th, td {
    width: 8rem;
    text-align: center;
  }
}
```

The html part

```html
<div class="container">
    <h2>Get started</h2>
    <p class="lead">Codever is a bookmark and code snippets manager created and designed for Developers & Co.
      The following helpers and extensions will assist you along the way:
    <table class="extensions-table">
      <thead>
      <tr>
        <th align="center"><a
          href="https://chrome.google.com/webstore/detail/codever/diofdblfhjbpgackifolmboaiccmebjb"
          rel="nofollow"><img src="./assets/img/bookmark-48.png" alt="Bookmark" ></a>
        </th>
        <th align="center" ><a
          href="https://chrome.google.com/webstore/detail/codever/diofdblfhjbpgackifolmboaiccmebjb"
          rel="nofollow"><img src="./assets/img/chrome-48.png" alt="Chrome logo" ></a>
        </th>
        <th align="center" ><a
          href="https://addons.mozilla.org/addon/codever/"
          rel="nofollow"><img src="./assets/img/firefox-48.png" alt="Firefox logo" ></a>
        </th>
        <th align="center" ><a
          href="https://addons.mozilla.org/addon/codever/"
          rel="nofollow"><img src="./assets/img/intellij-48.png" alt="IntelliJ Logo" ></a>
        </th>
      </tr>
      </thead>
      <tbody>
      <tr>
        <td align="center" ><a
          href="https://chrome.google.com/webstore/detail/codever/diofdblfhjbpgackifolmboaiccmebjb"
          rel="nofollow">Bookmarklet</a></td>
        <td align="center" ><a
          href="https://chrome.google.com/webstore/detail/codever/diofdblfhjbpgackifolmboaiccmebjb"
          rel="nofollow">Chrome</a></td>
        <td align="center" class="ml-2"><a
          href="https://addons.mozilla.org/addon/codever/"
          rel="nofollow">Firefox</a></td>
        <td align="center" class="ml-2"><a
          href="https://plugins.jetbrains.com/plugin/14456-codever-snippets/"
          rel="nofollow">IntelliJ plugin</a></td>
      </tr>
      </tbody>
    </table>
</div>
```

<span style="font-size: 0.9rem">
  <strong>Reference - </strong>
  <a href="https://github.com/codeverland/codever" target="_blank" style="font-weight: lighter">
     https://github.com/codeverland/codever
  </a>
</span>

<hr/>

> Shared with :heart: from [Codever](https://www.codever.dev/snippets/60c0cf0c5eeee76d9163d4eb/details). Use :point_right: [**copy to mine**](https://www.codever.dev/snippets/60c0cf0c5eeee76d9163d4eb/details) functionality to add it to your personal snippets collection.
Weekly web development resources #107
Tags: webdev, weekly
Published: 2022-02-02 07:01:12



______

##[Cool Backgrounds](https://coolbackgrounds.io/)
[![Cool Backgrounds](https://wweb.dev/weekly/content/107/backgrounds.jpg)](https://coolbackgrounds.io/)
A beautifully curated selection of cool, customizable backgrounds.

______

##[Favicon Generator](https://realfavicongenerator.net/)
[![Favicon Generator](https://wweb.dev/weekly/content/107/favicon-generator.jpg)](https://realfavicongenerator.net/)
A generator to make your favicons look great everywhere.

______

##[spark-joy](https://github.com/sw-yx/spark-joy)
[![spark-joy](https://wweb.dev/weekly/content/107/spark-joy.jpg)](https://github.com/sw-yx/spark-joy)
A list of tools to add design flair, user delight, and whimsy to your product. 

______

##[NextUI](https://nextui.org/)
[![NextUI](https://wweb.dev/weekly/content/107/nextui.jpg)](https://nextui.org/)
React UI library to build beautiful, fast and modern designs.

______

##[SVGOMG](https://jakearchibald.github.io/svgomg/)
[![SVGOMG](https://wweb.dev/weekly/content/107/svgomg.jpg)](https://jakearchibald.github.io/svgomg/)
A web GUI for SVGO to edit SVGs online. 

______

##[TypeScript Cheat Sheets](https://www.typescriptlang.org/cheatsheets)
[![TypeScript Cheat Sheets](https://wweb.dev/weekly/content/107/typescript.jpg)](https://www.typescriptlang.org/cheatsheets)
Downloadable syntax reference pages for different parts of everyday TypeScript code.

______

##[There’s No Such Thing as Clean Code](https://www.steveonstuff.com/2022/01/27/no-such-thing-as-clean-code)
[![There’s No Such Thing as Clean Code](https://wweb.dev/weekly/content/107/clean-code.jpg)](https://www.steveonstuff.com/2022/01/27/no-such-thing-as-clean-code)
A nice article that argues that there is no universal "clean" code.

______

##[Poly Pizza](https://poly.pizza/)
[![Poly Pizza](https://wweb.dev/weekly/content/107/polypizza.jpg)](https://poly.pizza/)
A cool website with over 7000 free low poly models.

______

##[Slidev](https://sli.dev/)
[![Slidev](https://wweb.dev/weekly/content/107/slidev.jpg)](https://sli.dev/)
A nice tool to create presentation slides by writing markdown.

______

##[What's New Since CSS3](https://css-tricks.com/whats-new-since-css3/)
[![What's New Since CSS3](https://wweb.dev/weekly/content/107/new-css.jpg)](https://css-tricks.com/whats-new-since-css3/)
A summary of CSS features that have been added since 2015.

______

##[Make Free Stuff](https://mxb.dev/blog/make-free-stuff/)
[![Make Free Stuff](https://wweb.dev/weekly/content/107/free-stuff.jpg)](https://mxb.dev/blog/make-free-stuff/)
An article by Max Böck on creating free stuff instead of trying to monetize everything.

______

##[Hibiki](https://playground.hibikihtml.com/tutorial/?page=t-intro)
[![Hibiki](https://wweb.dev/weekly/content/107/hibiki.jpg)](https://playground.hibikihtml.com/tutorial/?page=t-intro)
A web framework that lets you create modern frontend applications without JavaScript.

______

To see all the weeklies check: [wweb.dev/weekly](https://wweb.dev/weekly)
22 Web Development Trends Every CTO Should Expect in 2022
Tags: webdev, coredna, devops, graphql
Published: 2022-02-02 06:29:13

Technology continues to evolve as humans find new ways to innovate, doing things faster and with more flair than they did before. Not many areas feature as much of this innovation as the area of web development.

Developers are always looking ahead to discover new technologies that can catapult them to a brighter future. For many companies, keeping up with these developments can prove to be a problem. Thankfully, we've outlined some of the key trends which will be relevant in 2022 and beyond.

## Here are the 22 website development trends you need to keep an eye out in 2022:

1. No-code and low-code will drive application development


2. Artificial intelligence and machine learning adoption to accelerate


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

3. Voice search will explode thanks to IoT


4. Progressive web applications (PWAs) will replace native mobile apps


5. Smaller companies will favor SPAs for app development



6. Cybersecurity will grow in importance



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

7. Motion UI design will boost page interactivity


8. Advancements in cloud computing will continue


9. The next step in process customization will begin

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


10. Companies will favor API-first development



Find the other 12 on Core dna's website 


Happy reading!
Hoisting and Temporal Dead Zone
Tags: javascript, webdev, beginners, programming
Published: 2022-02-02 06:27:23

Hoisting is effectively the result of JavaScript Engine's 2 phase Execution of the program(https://dev.to/himanshuc11/working-of-js-engine-258h).

###What is hoisting?
When variables are encountered during the program run, during the first pass they are given space in memory and initialized with undefined

The variables are updated with their actual values only when the thread of execution reaches the line of code, where they are initialized.

So effectively during hoisting we feel as if the variables are "hoisted" to the top, but actually during the first pass, all variables are assigned undefined and stored in memory.

###What is hoisted?
Although all three types of declaration, let, const and var are hoisted, var behaves differently from let and const. var declarations are initialized with undefined, but let and const are not initialized with a default value, instead an exception will be thrown when we try to access let and const before its initialization from the thread of execution inside from the source file.

```
// The first pass occurs and thread of execution starts from here
// Here vx stores undefined
var dev = "dev"    // vx now stores "dev"
```
```
// The first pass is over
// Here the Engine knows about cx and lx, but cannot assign a value to them
const cx = 'dev' // now cx has its value as 'dev'
const lx = 'dev' // now lx has its value as 'dev'
```
###Temporal Dead Zone
When trying to access let and const variables, before its initialization from the source file's thread of execution, will result in a reference error. The variable is in the Temporal Dead Zone from the start of its initialization in the first pass, till the thread of execution assigns some value to it. Here JavaScript knows that a variable exists, but doesn't know what it data/value it holds

```
// Line 1, here Engine knows about x, but not its value, start of temporal dead zone
.
.
.
let x = 'dev'
// After assigning x some value, temporal dead zone is over, as its declaration is complete
```

###Common Confusion
1. undefined refers to something that doesn't exist yet, or doesn't exist anymore
2. null refers to an empty value
3. not defined refers to an exception in which JavaScript Engine doesn't know about the identifier requested
4. reference error refers to an exception in which, let or const is accessed before its declaration is complete


To get a video tutorial on the concept
https://www.youtube.com/watch?v=wtBbanu-kUY

References
https://developer.mozilla.org/en-US/docs/Glossary/Hoisting 
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let
Python #list #tuple #set #dictionary
Tags: python
Published: 2022-02-02 06:11:26

**1. List :**
It is used to store multiple items in single variable.
In list,
-  Items will be in order.
-  We can change items.
-  It allows duplicate of items .

`mylist = ['dog','cat','monkey','cat']
 mylist[0]='cow'
 print(mylist)`
Output:
```
['cow','cat','monkey','cat']
```

**2. Tuple :**
It is used to store multiple items in single variable.
In tuple,
-  Items will be in order.
-  We can not change items.
-  It allows duplicate of items 

`mytuple = ('dog','cat','monkey','cat') 
 mytuple[0]='cow'
 print(mytuple)`

Output:
```
TypeError: 'tuple' object does not support item assignment
```
**3. Set :**
It is used to store multiple items in single variable.
In set,
-  Items will not be in order.
-  We can not change items.
-  It do not allows duplicate of items -(in below example cat will be showed only once when you print myset)-.

`myset = ('dog','cat','monkey','cat') 
 myset[0]='cow'
 print(myset)`

Output:
```
TypeError: 'set' object does not support item assignment
```

**4. Dictionary :**
It is used to store multiple items in single variable.
In dictionary,
-  Items will be in order.
-  We can change items.
-  It do not allows duplicate of items .

`mydictionary = {'dog':'moo','cat':'meow','cat': 'meow''lion':'roar'}
mydictionary['dog']="bark"
print(mydictionary)`

Output:
```
{'dog': 'bark', 'cat': 'meow', 'lion': 'roar', 'cow': 'moo'}
```

-------Thank you-------------
-------have a good day------
Install Ubuntu Alongside Windows in 5 Steps. Here is how.
Tags: ubuntu, tutorial, linux, codenewbie
Published: 2022-02-02 05:49:27

You may be thinking, ' I NEED TO INSTALL UBUNTU ALONGSIDE WINDOWS 'But you want to know how to install. So this is a post to know more about the dual boot.

First, If you are using Windows, Make a partition from your main disk.

Second, Install ISO image of Ubuntu from Ubuntu's Website. Remember, Only install 20.04, not 21.10 because 21.10 is not for long term support and you will not get Live patch ( FOR SECURITY ) Update.

Third, Install Rufus to extract the ISO image. After installing Rufus, Plug in a Pen drive of 8gb minimum space. Then select your Pen Drive and ISO image and press Start. It will take some time. Also it will Format your Pen Drive and put the boot files.

Fourth, After the process finish, Shut down your PC and Switch it on again. But while the computer starts, You want to press `Esc Key` and `F9` for HP PC. If you are using any other PC/Laptop, Check it in Google. I am currently using HP - ALL-IN-ONE PC 22.

Fifth, After getting into Boot Menu, It will ask some queries like - COUNTRY, LANGUAGE, ETC. At a point, It will ask partition. You just want to delete the partition you made in Windows and Select it. That's ALL.. After some Time it will load and you will get your Ubuntu Alongside Windows.


THANK YOU.<u></u>
Accidentally committed to the wrong branch? Here is how to fix it.
Tags: beginners, git, tutorial
Published: 2022-02-02 05:35:04

If you have made a commit to the wrong branch, there is nothing to worry about. You can easily move the commit to the
correct branch. Let me show you how with an example:

Let's say I made a commit to the `main` branch that was meant to be in the `feature_1` branch (commit `55f0c29` shown below).

```
* 55f0c29 (HEAD -> main) Add settings flag for feature_1
* 4015b6f Provide default for product size
* d8dc31c Add db info to settings
```

We want to undo that last commit and keep the changes. To do that, we use the `reset` command with the `--soft` flag. 

```
(main)$ git reset --soft HEAD^ 
```

`HEAD^` means the commit before where `HEAD` is now. In our case `4015b6f`. We use `--soft` so that Git preserves our
changes. If we look at Git status we will see that our change is still there:

```
(main)$ git status
On branch main
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   file.txt
```

Now we can check out the destination branch and make our commit there. In my case `feature_1` branch didn't exist, 
so I am creating it here with the `-b` flag:

```
(main)$ git checkout -b feature_1
Switched to a new branch 'feature_1'

(feature_1)$ git status
On branch feature_1
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   file.txt

(feature_1)$ git commit -m "Add settings flag for feature_1"
[feature_1 ef640e4] Add settings flag for feature_1
 1 file changed, 1 insertion(+) 
```

If I look at my [Git log](https://practicalgit.com/blog/create-a-good-looking-git-commit-tree-in-terminal.html) I see that `HEAD` is pointing to the new commit in the new branch:

```
* ef640e4 (HEAD -> feature_1) Add settings flag for feature_1
* 4015b6f (main) Provide default for product size.
* d8dc31c Add db info to settings.
```

<a href="https://chipper-musician-9131.ck.page/fc2d4720ba">
![signup](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/97ydrey0skt5rq5gbht6.png)</a>
New Years Resolution - Dev Log 14
Tags: computerscience, beginners, webdev, programming
Published: 2022-02-02 05:34:11

I have not posted a dev log in a while, almost a week! That is mainly because I am at the point in the development process where I am out of my comfort zone. I am learning to use both Next and Redis cloud right now. I must say, Redis cloud via Redis OM does not have amazing documentation support. The bright side is that Redis is super fast, plus due to coupon codes, I have a free $400 worth of credits (and could win a free tesla, lol). I have completed the process of switching over my original project to Next, and have been building out the API routes on the backend. I am getting pretty excited, even though my posts and blogs have very little interaction. This may be optimistic, but I think that I can have the MVP launched by the 15th. I will probably miss this goal, but c'est la vie. On top of this, I am planning on making another YouTube video once my MVP is done, which I will have fun with. The first video got like 30 views, maybe I can get 50 on my next one.

If you have not checked out the video discussing the basic UI, please do:

youtube.com/watch?v=jvH9iTYzUbQ