teleren/devto huggingface dataset:
Day 25/100 Java
Tags: 100daysofcode
Published: 2022-02-18 07:20:13

Morning research done.

Day 25/100

**Language:**
JAVA

**Time Period Spent:**
2 hrs

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

**Todays Learning:**
- Research on Arrays.
- Reaseach on ArrayList.
- Reaseach on Collections.
- Rewatch array recap.
- Rewatch ArrayList.

**Additional Notes:**
This morning was spent being productive, I recapped on functionality on Arrays and ArrayLists. This helped me in the underlaying use-cases of ArrayList and the difference between, Arrays and ArrayLists. There is a subtle difference that Arrays are a predefined length, while ArrayLists are malleable. I also discovered that I can use the collections import to do the reverse and sorting of an ArrayList of me. Not sure about how this affects speed compared to an Array ForLoop reverse, will need to test this. Overall I am satisfied to continue on the course with this understanding.
A Simple RoadMap For A Beginner Web Developer To Become A Hero Web Developer
Published: 2022-02-18 07:11:46

## Hi!! Hope You All Are Well. Welcome to my post.
So Many Beginner Web Developers, I Mean those who are learning to code may stuck in a situation of that what to learn next or what to do next. What's Next ????

If you are in a situation like that its just because you don't know much about web development. Don't worry, I also had to go through that situation. So, here is what I learned about What's Next.

####THE BASICS
First you need to know the concepts before commands. So, I prefer learning C & Java for learning the basic concepts. You don't need to know C & Java in depth, But just the simple concepts. Although if you are not focusing C & Java, it is best to learn the concepts through C & Java. If you want to know why to prefer C & Java to learn Basic coding, I will be answering to that question in a few. So Keep Updated!

####Web Designing
The next step is to learn web designing.
What To learn for web designing :

- HTML

- CSS

- Basic JavaScript

####Web Development
After learning web designing you can move a further by learning back end programming.
What To learn for web Development : There are many languages & Databases to program back end. Choosing which is all up to you.

##Conclusion
I haven't mentioned much because as you learn you will know more and more about more tool, more languages, Version Controller etc.. The things I mentioned is just a guide to start you journey. Hope you all understand and Comment is open for you valuable replies.

Thank You. Have A Nice Day.
How to get mockable current time in java enterprise
Tags: java, datetime, jakartaee, mocking
Published: 2022-02-18 06:30:20

With Java version 8 it's very easy to get the current timestamp with `LocalDateTime.now()`. One problem that might arise is it's not easily **testable/mockable**. Imagine some testing data and conditions depend on the date you set through this call, or you want to do "time travel". The solution is quite simple - **define a service class that produces the current timestamp**, which you can then easily mock, in this case we'll name it `ProductionCalendar`:

```java
@ApplicationScoped
public class ProductionCalendar {
  public LocalDateTime currentTimestamp() {
    return LocalDateTime.now();
  }

  public LocalDate currentDate() {
    return LocalDate.now();
  }

  public String currentTimestamp(Partner partner) {
    return DateTimeFormatter.ofPattern("yyyy-MM-dd-HH.mm.ss.SSSSSS")
        .format(LocalDateTime.now());
  }
}
```

Then when were you need to call `LocalDateTime.now()` inject this service and use its methods instead:


```java
@Stateless
public class PartnerRepository {

  @Inject ProductionCalendar productionCalendar;

  @Inject EntityManager entityManager;

  public void savePartner(String partnerNumber) {
    Partner partner = new Partner();
    partner.setPartnerNumber(partnerNumber);
    partner.setCreatedAt(productionCalendar.currentTimestamp());

    entityManager.persist(partner);
  }

  public List<Partner> getPartnerCreatedAfterDate(LocalDateTime timestamp) {
    String queryJpql = "select p from P p where createdAt > :timestamp order by createdAt desc";
    TypedQuery<Partner> query = entityManager.createQuery(queryJpql, Partner.class);
    query.setParameter("timestamp", timestamp);

    return query.getResultList();
  }
}
```

Then, in the test class you can easily mock `ProductionCalendar` and calls to its methods and set timestamps as we need them:

```java
@ExtendWith(MockitoExtension.class)
@RunWith(JUnitPlatform.class)
public class UserServiceUnitTest {

  @Inject PartnerRepository partnerRepository;

  @Mock ProductionCalendar productionCalendar;

  @Test
  void testGetLatestPartners() {
     when(productionCalendar.currentTimestamp()).thenReturn(LocalDatetime.now().minusDays(1));
     partnerRepository.save("12345");
     var recentPartners = partnerRepository.getPartnerCreatedAfterDate(LocalDatetime.now().minusDays(2));
     assertThat(recentPartners, hasSize(1));
  }

}
```

<hr/>

> Shared with :heart: from [Codever](https://www.codever.dev/snippets/620e5468390f044e75ba6eb5/details). Use :point_right: [**copy to mine**](https://www.codever.dev/snippets/620e5468390f044e75ba6eb5/details) functionality to add it to your personal snippets collection.
Mad Devs Impresses Clients in 2021
Tags: webdev
Published: 2022-02-18 06:19:41

Every good project is like a little grain. And it grows into something that is of great value to both the customer and the company that provides the service. In the case of a client, this is an unconditional growth, for example, in monetary terms or in a reputation context. In the case of the project executors, this is a great opportunity to demonstrate their professional competence and, most importantly, to make a good impression and get positive feedback. Clutch introduced a new year-in-review feature, where we were greeted by a picture with excellent performance.

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

We took the opportunity to study how our post-project efforts. We were met with a lot of good data on how we did in 2021:

![review1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dlfn7kxhvqgs65cxuww5.png)
![review2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6kotidcdh4pghji8qvsf.png)

 But there was one thing that stood out to us the most.
![quote](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ze5si0f643h71an93h5.png)
This is the general quote that the year-in-review feature highlighted for us. It’s short but plainly puts all the things we focus on when we go into a project. Give our clients the sound foundation and tools they need to start from and grow through our technical expertise.

Why it is important for us? Reviews with comments like this allowed us to be featured on a list of **top software development companies in the UK** on [Clutch](https://clutch.co/uk/developers). These reviews are putting us in a great position in the industry because of the positive word of mouth they spread to our potential clients.

However, the last Rubicon has yet to pass. This is only one of the stages on the way of development of our company. In 2022, we intend to provide an even better service. And the collected data in the new year-in-review will help us with this. More to come for you and for us!

Do you want an app that will be downloaded and used by hundreds of people around the world? You need a reliable partner who is guaranteed to make this possible. [Contact our team](https://maddevs.io/contact-us/?utm_source=dzone) today! We'll help you develop the app that best represents your brand and business.

[![CTA](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gewb8fpx4nv3gkblnqqv.png)](https://maddevs.io/services/?utm_source=devto)

_Previously published at [maddevs.io/blog](https://maddevs.io/blog/mad-devs-impresses-clients/?utm_source=devto)._
AMA & Talk: Scaling your Android build with Jetpack & Dagger
Tags: android, ama, programming, jetpack
Published: 2022-02-18 06:19:37


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

Guess who just joined the club. 👋 

100ms is conducting its first 🤖 Android Developer event, and we’re here to talk about all things development, coding, and scaling. 

Join us for an exclusive Talk & AMA session with Rivu Chakraborty,  Aniket Kadam, and Honey Sonwani on 🗓 26th of February! We will be unlocking elements to scale the Android system by deep-diving into **Dagger and Jetpack compose.**

💡 Going live on **26th February at 11:00 am IST**. Don’t miss this!

https://www.100ms.live/events/android-jetpack-dagger


#GDG #askmeanything #Android #jetpackcompose
Working with Csharp WPF
Tags: csharp, wpf, windows, desktop
Published: 2022-02-18 06:03:49

**C# (C-Sharp)** is a programming language developed by Microsoft that runs on the .NET which is used to develop web apps, desktop apps, mobile apps, games and much more. 


**Windows Presentation Foundation (WPF)** is a free framework developed by Microsoft for easy UI development. 

What I have observed is, Csharp(Wpf) have a large community, whenever you get stucked, question and answer is available on Stackoverflow or any other blog post. 

I have recently started working with Csharp and Wpf. 
Here is my Application : https://github.com/New-dev0/Telegraph


Which uses Telegra.ph api made by Telegram Team for Instant previewable blogs.
My Application is at early stage.
You can ⭐ and fork or contribute in its development. 

Thanks :)
MERN Stack
Tags: javascript, react, node, github
Published: 2022-02-18 05:58:06

**Hello** to all my friends. Happy to join this great community. I hope that everyone doing well in their living and making out the most in the world of computer science.

Right now I am on learning **MERN Stack** for my career and especially for my semester course, All I need from you guys are effective **guidelines**, **road path** and some **projects** to work on for it, I will be very thankful for it. Later on, I also have a **group project** for my **semester course**, so any tips for that would be helpful too.

Thank you for your time.
Have fun!
Saving an AngularJS app with Vue
Tags: javascript, vue, angular, webdev
Published: 2022-02-18 05:49:04

yes, there are still applications developed with **AngularJS** even though its LTS version was discontinued at the end of 2021, in fact from the beginning of the year 2022 the independent team in [XLTS.dev](https://angularjs.xlts.dev/) will maintain a fork of the latest version of AngularJS. by default the only way to migrate your web app is using some libraries available by the Angular team, 

### Why Vue?

[Vue](https://vuejs.org/) offer a natural way to migrate your ng components to Vue components because there are some features that will speed up the whole migration process of your app, for example **templating syntax** and **reactive model**.

This allows migration to be less complex for the team and allows them to still focus on new features and migration at the same time.

let me show you a basic example to make this...

### Setting up AngularJS with [Vue](https://vuejs.org/)


![fusion](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/owx1wh6wos0yetyq7xyb.gif)

**Add Vue snippet**

include Vue/Vuex snippet from your favorite CDN

```html
<script url=".../vue.js"></script>
<script url=".../vuex.js"></script>
```

**Creating Vue instance**

we create a Vue instance in main or some view controller!
```javascript
((module) => {
  const vm = this;

  vm.$onInit = () => {
    vm.ngText = 'Hello World!';
    vm.vueInstance();
  }
  vm.vueInstance = () => {
    new Vue({
      el: document.getElementById('vue-app'),
      data:{
        someText: vm.ngText
      }
    });
  };
})(angular.module('app'))
```

**Create a simple Vue component for this example**


 we declare this component in constant in case we need to run unit tests
```javascript
const MyVueComponent = Vue.component('MyVueComponent', {
  computed: {
    text: {
      type: String
    }
  },
  template:`<div>{{ text }}</div>`
});
```

Finally inside HTML template **ng-non-bindable** does the trick, this directive tells AngularJS not to compile or bind the contents of the current DOM element, in our case a Vue instance

```javascript
<main ng-controller="MainCtrl as vm">
  <div id="vue-app" ng-non-bindable>
    <MyVueComponent :text="someText" />
  </div>
</main>
```

![finish fusion](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w9qbr3q82na8yq6h1rm1.gif)

now you can migrate and deliver new features at the same time with Vue.
you can check a full example using Vue and incorporate Vuex.

{% embed https://github.com/rholo/ng-vue-migration %}
5 Steps to Create an Effective Hiring Funnel
Tags: javascript, beginners, html, programming
Published: 2022-02-18 05:20:17

After creating a hiring funnel, you must check the skills of a Solidity Programmer. The skills of a Solidity Engineer differ from that of a web or app developer. Hence, we have created a list of all the skills that an experienced Solidity Engineer consists of.


**JavaScript Competency
**
[JavaScript ](https://www.javascript.com/), being a primary internet language, is supported by most web pages and browsers. Plus, JavaScript is also a client-side scripting language, which means the code is sent to the web browser or client to execute computation. Furthermore, many libraries and frameworks have been developed based on JavaScript to optimize the app development process. Hence, JavaScript is a major skill that every developer including a Solidity Programmer must have a good command over. Hence, before you [hire solidity developers](https://www.cronj.com/solidity-developers) make sure that he/she has a good understanding and experience in handling JavaScript and its principles.


**Command over Blockchain Architecture
**
An experienced Solidity Programmer must know about Blockchain Architecture. Furthermore, he/she must also have a clear understanding of certain terms like Smart Contracts, Ledger in Blockchain, Consensus, and more. Lastly, make sure you hire Solidity Developer who has a command over various types of Blockchain architecture like Public, Private and Consortium architectures.


**Well versed in Web Technologies
**
Solidity Engineers mainly focus on building Smart Contracts. Thereby, they must have a clear knowledge and experience in web technologies and development. A Solidity Engineer who has worked on web development projects earlier can effectively develop web apps by integrating Blockchain. Therefore, you must hire Solidity Developers who have worked on various web development projects and have skills like [HTML](https://en.wikipedia.org/wiki/HTML)/CSS, JavaScript, PHP, UI/UX, and more.


**Proficient with Different Coding Languages
**
Proficiency with different coding languages is the gateway to developing various web applications. Hence, before you hire Solidity Developers make sure that you check for the following coding skills in their resumes - C+, C++, Java/JavaScript, Golang, or Python. These are the basic coding languages that every Solidity Engineer must possess. Plus, you must also keep up with the latest trends to keep yourself updated with trending tech stacks.


**Experienced with Object-Oriented Programming
**
For complex problems and reusable codes, Solidity Engineers must have experience with Object-Oriented Programming (OOP). Hence, you must [solidity developers](https://www.cronj.com/solidity-developers) with command and experience in handling polymorphism and modularity troubleshooting.
Debounce and throttle simplified
Tags: javascript, webdev
Published: 2022-02-18 05:32:16

I was trying to create my own implementation of debounce and throttle. Yes just for fun.
and I came up with very simplified implementation that anyone can follow just by taking a look at the code.

You can play with the [demo here](https://debounce-throttle.surge.sh/)

Hope you like it.

## Throttle
```js
function throttle(fun, timeduration) {
    let shouldCall = true;
    return (...args) => {
        if (shouldCall) {
            shouldCall = false;
            fun(...args);
            setTimeout(() => {
                shouldCall = true;
            }, timeduration)
        }
    }
}
```

## Debounce
```js
function debounce(fun, timeduration) {
    let lastTimeoutId = 0
    return (...args) => {
        if (lastTimeoutId) {
            clearTimeout(lastTimeoutId);
        }
        lastTimeoutId = setTimeout(() => {
            fun(...args);
        }, timeduration)
    }
}
```

## How to use it
```js
function showValue(val) {
    console.log(val)
}

const throttleInput = throttle(showValue, 500);

const debouncedInput = debounce(showValue, 500);
```
Lo-fi for (DEV) life
Tags: devlife, productivity, devjournal, motivation
Published: 2022-02-18 05:21:14

this is not a post of some new plugin or anything like that, it is rather a valuable ally that will allow or rather help you to stay relaxed and focused in those moments of study or work, especially in the case of developers who need to maintain a high level concentration in some cases.

lo-fi as a concept I think many must have already heard about, it has become very popular in these times especially in this pandemic, there are already several channels on Youtube or Spotify designed entirely in this concept, but I do not want to go into too much detail, I want to share some of the playlists that I consider essential and some alternatives that you can discover, and if you have some others are all welcome to share.

## Code Radio

The first one is [Code Radio](https://coderadio.freecodecamp.org/) from FreeCodeCamp which you can listen to 24 hours a day.

## Lofi Girl

secondly I will point out one of the most popular or the most popular on YouTube! [Lofi Girl](https://www.youtube.com/c/LofiGirl) which already has more than 10 million subscribers and you can find it on different platforms. 


The following playlists are more of personal taste which I want to share.

## Lofi Brasil 
[Lofi Brasil](https://open.spotify.com/playlist/7K3scENpOi7ZPZUHfnfic3?si=6a9f8009761243e8) mixes part of the Brazilian culture in this excellent playlist. enjoy it.

## Hola Beats Lofi
Another very interesting playlist is [Hola Beats Lofi](https://open.spotify.com/playlist/5Xkw0sFd5Y89K7kfrusZsf?si=f106c9fdf5704c5a) which besides being copyright free music, it is available on several platforms.

hope you enjoy it and feel free to share your playlist.
example
Tags: example
Published: 2022-02-18 05:14:07

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
People who went from WordPress to HTML/CSS/JS/etc - what's your story?
Published: 2022-02-18 05:05:45

I've been building WordPress sites for around 2 years in my digital marketing agency. It helps because I can get a site up and running quickly and editing is simple. However, I've wanted to expand my web development knowledge and want to slowly move away from pure WordPress sites.

Has anyone here ever done this? Or did you just get better with WordPress? Is it better to join a web development company and grow in there as a junior web developer?
Day 4
Published: 2022-02-18 04:54:25

Well today was a very longgg day, I had:
- 1 long 10 hour shift from 8:00 AM till 6:00 PM
- Right after my shift, I had to rush to my Applied Artificial Intelligence course COMP-6721 which was till 8:15 PM
- And then I had a lab under the same course till 10:20 PM
Damnn...
I am really tired up right now, but equally psyched to share and re-comprehend what I learned today in my lecture and also to share some personal insights ;)

COMP-6721-Applied Artificial Intelligence:
How to password protect a PDF document
Published: 2022-02-18 04:52:53

To password protect a PDF document users should try out this PDF CHamp application. The tool works great and any user can smoothly password protect a PDF document file easily and reliably. There is no kind of obligations that are faced by any user to protect their pdf document. Follow the below process to password protect a PDF document:

1. - Step 1- Firstly, tick on the checkbox as per your choice
2. - Step 2- Enter the password to protect your pdf files
3. - step 3- Now, browse the path to save the secured pdf files
4. - step 4- Finally, hit the "generate pdf" button

Users can also preview and scan their pdf files in order to check the files that are selected are correct.

Refer:[http://www.securepdf.pdfchamp.com/](http://www.securepdf.pdfchamp.com/)
#35 -(Ready for) Prime Time - CodeWars Kata (5 kyu)
Tags: javascript, webdev, tutorial, 100daysofcode
Published: 2022-02-18 04:36:56

##Instructions
We need prime numbers and we need them now!

Write a method that takes a maximum bound and returns all primes up to and including the maximum bound.

**Example**

> 11 => [2, 3, 5, 7, 11]

---

##My solution:

```javascript
function prime(num) {
function isPrime(n) {
  if(n == 2) return true
     for (let i = 2; i < n; i++) {
        if (n % i == 0) return false
    }
  return true
}
  var r = []
  for(let i = 2; i <= num; i++){
    if(isPrime(i)) r.push(i)
  }
  return r
}
```

---

##Explanation
First I did a function that returned if a number is a prime, using a loop that iterates if the number that is being checked can be divided by another number before it, if it can be divided it means that the number isn't prime, so it returns false, but if it can't be divided it returns true.

> function isPrime(n) {
>   if(n == 2) return true
>      for (let i = 2; i < n; i++) {
>         if (n % i == 0) return false
>     }
>   return true
> }

After that I did a variable "r" that contained an empty array and in this array I'll store the last result.
 

> var r = []

Then I used a for loop that iterated all the numbers from 2 to the number that the function passes as a parameter, and in every oneof the iterations I checked if the number being iterated is prime, and if it is prime I just pushed it to the "r" array.

> for(let i = 2; i <= num; i++){
>   if(isPrime(i)) r.push(i)
> }

Then I returned the "r" array
> return r



---

**What do you think about this solution? 👇🤔**

[My Github](https://github.com/Cesardlr)
[My twitter](https://twitter.com/cesar__dlr)
[Solve this Kata](https://www.codewars.com/kata/521ef596c106a935c0000519)
¿Cómo empezar a PROGRAMAR?
Tags: javascript, webdev, spanish, beginners
Published: 2022-02-18 04:32:23

---
title: ¿Cómo empezar a PROGRAMAR?
published: true
description: Aprender a programar puede ser difícil y complicado, por eso te comparto una serie de consejos para que puedas empezar
tags: javascript, webdev, spanish, beginners
canonical_url: https://gndx.dev/blog/como-aprender-a-programar
//cover_image: https://direct_url_to_image.jpg
---

Dar el primer paso puede llegar a ser difícil y complicado, por eso te comparto una serie de consejos para que puedas empezar en el mundo de la programación, Lo primero que debes de tener en cuenta es que la programación es toda una ciencia, una serie de metodologías y entendimientos sobre el mundo de la computación.

Al inicio puede ser abrumador, más porque encontrarás mucha informacion en internet, recursos, libros, cursos, videos, entre mucha otra informacion, pero con objetivos claros, una planeación sencilla donde dedicas tiempo y práctica, lograras entender la programación y lograr tus objetivos ya sea cambiando de carera o iniciando una nueva.

Te dejo mi video donde encontraras toda la informacion que te guiara a lograr tu objetivo, ser un programador o programadora.

{% youtube 1YNaa-ySD-4 %}