teleren/devto huggingface dataset:
How to define basic types in Typescript
Tags: typescript, beginners, programming
Published: 2023-09-12 07:36:59

In TypeScript, you can define basic types using a combination of built-in primitive types and custom types.

Here are some of the essential basic types:

- Number
```ts
let amount: number = 20;
```
- String

```ts
let course: string = 'Typescript';
```
- Boolean

```ts
let isLoading: boolean = true;
```
- Any
```ts
let book;
```
```ts
function render(document: any) {
  console.log(document);
}
```
- Array
```ts
let arrayOfNumber: number[] = [1, 2, 3];
let arrarOfString: string[] = ['apple', 'orange'];
let arrayOfAny = [];
```
- Tupple
```ts
let tupples: [number, string] = [1, 'ayam'];
```
- Enum
```ts
const enum Size {
  Small = 1,
  Medium,
  Large,
}

let mySize: Size = Size.Medium;
console.log(mySize); // 2
```
- Object
```ts
let employee: {
  readonly id: number;
  name: string;
  retire: (date: Date) => void;
} = {
  id: 1,
  name: 'bayu',
  retire: (date: Date) => {
    console.log(date);
  },
};
```
- Function
```ts
// without parameter
function calculateTax(): number {
  return 10;
}

// number parameter
function calculateTax2(income: number): number {
  if (income > 50000) return income * 2;
  return income * 1;
}

// number multiple parameter
function calculateTax3(income: number, taxYear: number): number {
  if (taxYear > 2022) return income * 2;
  return income * 1;
}
calculateTax3(10000, 2021);

// multiple & optional parameter
function calculateTax4(income: number, taxYear?: number): number {
  if ((taxYear || 2022) > 2022) return income * 2;
  return income * 1;
}
calculateTax4(10000);

// multiple, optional & default value parameter
function calculateTax5(income: number, taxYear = 2022): number {
  if (taxYear > 2022) return income * 2;
  return income * 1;
}
calculateTax5(10000);
```

Defining basic types in TypeScript is crucial for writing maintainable and error-free code. By specifying types explicitly, you can catch errors early in the development process and improve code readability. TypeScript provides a range of built-in primitive types, as well as the flexibility to create custom types, enabling you to create structured and organized applications.

Hope this helps!
Oracle Fusion HCM Online Training
Published: 2023-09-12 07:35:48

Trio Tech’s Oracle Fusion HCM Online Training course is designed to give students an overview of the various aspects of human resources management. It also provides an overview of the different Oracle Fusion HCM Online modules. Fusion  HCM course will cover topics such as setting up users and permissions, managing employee data, and running reports. Our training includes real-time projects for better understanding. By the end of the course, students should be able to confidently use the Oracle Fusion HCM system to manage their organization’s human resources.
Oracle Human Capital Management Cloud applications help organizations manage human resource and talent management processes while supporting local process and compliance needs across multiple countries. Accelerate the implementation and adoption of your applications with Oracle Human Capital Management Cloud Training.
Trio Tech Software Trainings offers Oracle Fusion HCM online training on Applications . The Course` Training will cover both technical and functional topics. We deliver Oracle Fusion Online Training and Corporate Training. 


https://triotechsoftwaretrainings.com/oracle-fusion-hcm-online-training/
DevSecOps Consulting Partner You Can Trust
Tags: devsecops, devsecopsconsulting
Published: 2023-09-12 07:31:42

Enhance your security practices with our expert DevSecOps consulting and implementation services. InfraCloud offers unified visibility for SecOps and DevOps teams, automated vulnerability remediation, misconfiguration threat detection, and security across multi-cloud environments.

## Why Choose DevSecOps Consulting?

- Unified Visibility: We provide a unified view for both SecOps and DevOps teams.
- Automated Remediation: Our services automate vulnerability remediation.
- Misconfiguration Threat Detection: We detect and address misconfigurations and threats.
- Multi-cloud Security: We ensure security across multi-cloud environments.

## Your DevSecOps Consulting Partner

Your partner at every step - whether you’re already on your cloud native journey or just starting out.

**DevSecOps Assessment**

Our team of cloud-native security specialists can share DevSecOps best practices and compliance assessments across your cloud infrastructure and processes.

**DevSecOps Consulting & Advisory**

We understand your infrastructure & business goals. Accordingly, we advise you on the design & implementation of a robust cloud native security plan.

**Deploying Security Products**

Our DevSecOps experts can propose the most suitable security technologies, help you deploy and configure them with an actionable plan to address your DevOps goals.

**Be Compliant and Audit Ready**

We assist you with the implementation of DevSecOps & cloud-based security technologies for advanced threat detection, threat intelligence, and vulnerability scanning to be audit-ready.

**DevSecOps Managed Services**

Leverage InfraCloud’s DevSecOps experts for operating, troubleshooting, and optimizing day-to-day elements of cloud native security, in the most effective way.

**Get the team up to speed**

We help you with detailed documentation and build in-house knowledge to monitor system performance and functions for managing the infrastructure like a pro.

## Why Choose InfraCloud as Your DevSecOps Consulting Partner?

- Certified Developers: We have 170 in-house engineers, including 4 CKS, 51 CKA, and 19 Certified Kubernetes Application Developers.
- Domain Expertise: We implement DevSecOps best practices learned from working with 100+ clients.
- First Mover Advantage: Partner with India's first Kubernetes service provider and second in APAC.
- Training: Our training focuses on core concepts with practical experiences.
- CNCF Certified Provider: InfraCloud is a proud CNCF Silver Member and Kubernetes Certified Service Provider (KCSP).
- Scalability: Easily expand your team of engineers with InfraCloud's support.

## Ready to Get Started with DevSecOps?

[Always on your side! Schedule a call with one of our DevSecOps specialists to achieve your DevOps transformation goals.](https://www.infracloud.io/devsecops-consulting-services/)
Greenbox Digital Course in Kirti Nagar.
Tags: digitalmarketing, digitalmarketingcourse, onlinecourse, offlinecourse
Published: 2023-09-12 07:30:08

[Greenbox Digital Course in Kirti Nagar](https://www.greenboxdigitalinstitute.com/). Exploring the World of [Digital Marketing course in delhi](https://www.greenboxdigitalinstitute.com/).

To remain competitive in today's fast-paced digital landscape, a strong understanding of digital marketing is required. With more people turning to the internet to find products and services, a strong online presence is essential. [Greenbox Digital Course in Kirti Nagar](https://www.greenboxdigitalinstitute.com/) offers a comprehensive digital marketing course that stands out for its excellence and practicality in order to give individuals and organizations with the knowledge and skills needed to thrive in the digital age.

Why Should You Work with [Greenbox Digital Courses in Kirti Nagar](https://www.greenboxdigitalinstitute.com/)?

[Greenbox Digital Course](https://www.greenboxdigitalinstitute.com/) has a well-deserved reputation in Kirti Nagar as
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5a4t8m55br4tbqpyyyw.jpg) a leading provider of digital marketing training. Here are some compelling reasons why you should take part in
How to Generates fake data In Python
Tags: python, programming, data, tutorial
Published: 2023-09-12 07:08:36

## Hi 🙂🖐

Welcome in new post, today i will share with you How to Generates fake data In Python and module called Faker 

Faker is a Python package that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker is for you.

Install it from here : `pip install Faker`

**Examples of how to use**

Generate fake names

```python
from faker import Faker

fake = Faker()

print(fake.name())
```

Generate fake address

```python
from faker import Faker

fake = Faker()

print(fake.address())
```

Generate fake ipv4

```python
from faker import Faker
from faker.providers import internet

fake = Faker()
fake.add_provider(internet)

print(fake.ipv4_private())
```

Generate fake emails 

```python
from faker import Faker

fake = Faker()

print(fake.email())
```

**Localization**
[faker.Faker can take a locale as an argument, to return localized data. If no localized provider is found, the factory falls back to the default LCID string for US english, ie: en_US.](https://pypi.org/project/Faker/)

```python
from faker import Faker
fake = Faker('it_IT')
for _ in range(10):
    print(fake.name())
```

## result
```
Marina Cuomo
Ludovica Bocca
Sig.ra Isabella Aporti
Antonietta Zeffirelli-Carnera
Agostino Cortese
Sig.ra Laura Chittolini
Sig. Geronimo Ferragni
Piergiorgio Sorrentino
Mariano Goldstein
Erika Vercelloni
```

For more info : https://pypi.org/project/Faker/

**Now we're done 🤗**

**Don't forget to like and follow 🙂**

**Support me on PayPal 🤗**
https://www.paypal.com/paypalme/amr396
Testing Spring Application (kotlin) with kotest, jacoco and mockk
Published: 2023-09-12 07:07:03

**Install Kotest**
1. In _build.gradle.kts_

Add a task for Test

```
tasks.withType<Test> {
	useJUnitPlatform()
}
```

Under **_test dependencies_** section

> Kotest on the JVM uses the JUnit Platform gradle plugin.
> Kotest offers a Spring extension that allows you to test code that uses the Spring framework for dependency injection.

```
	testImplementation("io.kotest:kotest-runner-junit5-jvm:5.6.2")
	testImplementation("io.kotest.extensions:kotest-extensions-spring:1.1.3")
```

2. Installing the Kotest IntelliJ IDEA Plugin
It makes things convenient when you want to run tests from editor via a click.

On IntelliJ, go to File > Settings... > Plugins. While on the Marketplace tab, search for "kotest," then select the first result and click on Install.

Ref: https://www.waldo.com/blog/kotest-get-started


**Pick Testing Styles**
It seems the creator of kotest tried the best to cater for all sorts of users.
These are just regular classes that extend one of the Kotest spec styles. 

```
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe

class StringCalculatorTest : FunSpec({

    test("empty string results in zero") {
        add("") shouldBe 0
    }
})

fun add(test: String) : Int {
    return 0
}
```

**Test Coverage**
Add `jacoco` in **_plugins_** section in gradle.
Add following tasks and configs

```
/// Test Coverage
jacoco {
	toolVersion = "0.8.8"
	reportsDirectory.set(layout.buildDirectory.dir("jacoco"))
}

tasks.test {
	finalizedBy(tasks.jacocoTestReport, tasks.jacocoTestCoverageVerification)
}

tasks.jacocoTestReport {
	dependsOn(tasks.test)
	classDirectories.setFrom(
		sourceSets.main.get().output.asFileTree.matching {
			exclude("**/somepackage/**")
		}
	)
	reports {
		xml.required.set(true)
		html.required.set(true)
	}
}

tasks.jacocoTestCoverageVerification {
	//TODO update it to 0.9
	val minimumThresholdValue = "0.0".toBigDecimal()

	violationRules {
		classDirectories.setFrom(
			sourceSets.main.get().output.asFileTree.matching {
				exclude("**/somepackage/**")
			}
		)
		rule {
			limit {
				minimum = minimumThresholdValue
			}
		}
	}
}
```

Ref: https://www.baeldung.com/kotlin/kotest
Beyond Work, What Are Your Goals for the Next 5 Years?
Tags: discuss, beginners, codenewbie
Published: 2023-09-12 07:00:00

_Get a glimpse into the daily experiences, work routines, and unique perspectives of tech professionals, both novice and experienced alike, in "A Day in the Life."_

> What's a non-work-related goal you'd like to accomplish in the next five years?


Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more discussions and online camaraderie!

*{% embed* https://dev.to/codenewbieteam *%}*
Rubyist Hangout Thread
Tags: ruby, discuss, watercooler
Published: 2023-09-12 07:00:00

Well, hello! It's time for our weekly Ruby enthusiasts' meetup, where we celebrate Ruby's 28-year legacy and everything community-approved, Ruby or not. Share with us:
🌟 Spotlight a Fellow Member: Highlight a Ruby enthusiast's accomplishments.
📖 Share an Intriguing Read: Recommend compelling tech articles.
🌐 Current Buzz in the Sphere: Keep us informed on Ruby-related news!
Got Coding Superstitions?🤞
Tags: discuss
Published: 2023-09-12 07:00:00

_Welcome to Code Chatter, your go-to series for conversational coding insights. What makes this series of questions different from all the others? Well, truth be told, not much, but they're still thought-provoking and fun. Join us as we explore the coding world, one witty question at a time._

> Share a quirky coding superstition or ritual you have for good luck or productivity.

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}
Harnessing the Power of JavaScript's Map Function for Enhanced Development Introduction
Tags: webdev, javascript, beginners, programming
Published: 2023-09-12 06:55:16

**Introduction**

As developers, we often find ourselves working with arrays in JavaScript, manipulating data, and transforming it in various ways to meet the requirements of our applications. The map function in JavaScript is a powerful tool that can simplify and streamline this process. In this blog post, we'll explore the map function and demonstrate how it can be used to enhance your development workflow.

Understanding the map Function
The map function is a built-in method that JavaScript provides for arrays. It allows you to apply a specified function to each element of an array and create a new array with the results. Here's the basic syntax:



```
const newArray = array.map(callback(element, index, array));

```
array: The original array you want to iterate through.
callback: A function that is called for each element in the array.
element: The current element being processed.
index (optional): The index of the current element being processed.
array (optional): The array that map was called upon.
Mapping to a New Array
One of the most common use cases for the map function is to create a new array by applying a transformation to each element of the original array. Let's look at a simple example:

```
const numbers = [1, 2, 3, 4, 5];
const doubledNumbers = numbers.map((number) => number * 2);

console.log(doubledNumbers); // [2, 4, 6, 8, 10]
```

In this example, we use the map function to double each number in the numbers array, resulting in a new array called doubledNumbers.

Mapping Objects
The map function is not limited to working with simple values like numbers or strings; it can also be used to transform objects. Consider the following example:


```
const users = [
  { id: 1, name: 'Alice' },
  { id: 2, name: 'Bob' },
  { id: 3, name: 'Charlie' },
];

const userNames = users.map((user) => user.name);

console.log(userNames); // ["Alice", "Bob", "Charlie"]

```
In this case, we are mapping an array of user objects to an array of their names.

Filtering with map
The map function can also be used to filter an array while mapping it. By returning undefined for elements you want to exclude, you effectively filter out those elements from the resulting array. Here's an example:


```
const numbers = [1, 2, 3, 4, 5];
const evenNumbers = numbers.map((number) => {
  if (number % 2 === 0) {
    return number;
  }
});

console.log(evenNumbers); // [undefined, 2, undefined, 4, undefined]
```

In this example, we use the map function to filter out odd numbers while mapping the array. You can then use methods like filter or reduce to further process the filtered array if needed.

Conclusion
The map function is a versatile tool that every JavaScript developer should have in their toolkit. It simplifies the process of transforming and manipulating arrays, making your code more concise and readable.
Explain the filter function in Python
Tags: python, programming, tutorial, coding
Published: 2023-09-12 06:33:52

## Hi 🙂🖐

The `filter` function returns an iterator where the items are filtered through a function to test if the item is accepted or not.

`filter` function take 2 parameters ` filter(function, iterable)` 


Imagine that you have a list of prices and you want to get only the prices < 150 and prices > 25.

```python
my_list = [100, 150, 270, 25, 75, 370]
```

Now you need to create a function to filter this prices.

```python
def my_filter_func(num):
    if num < 150 and num > 25:
        return True
```

Now you need to make a loop on all list

```python
best_Prices = []
for num in my_list:
    if my_filter_func(num):
        best_Prices.append(num)

print(best_Prices) # [100, 75]
```

This is how the filter function works. Now that we know how it works, we don't need to write all this code. Just use a filter.

```python
best_Prices = filter(my_filter_func, my_list)
best_Prices = list(best_Prices)

print(best_Prices) ## [100, 75]
```




**Now we're done 🤗**

**Don't forget to like and follow 🙂**

**Support me on PayPal 🤗**
https://www.paypal.com/paypalme/amr396
Async/Await Traps: The importance of await in try/catch blocks
Tags: javascript, webdev
Published: 2023-09-12 06:30:26

Is the following code going to crash your program or will it execute without any issues? Take your time to make a guess.

```js
async function canParkCar(car) {
    if ( !car.allowed ) {
        throw new Error(`${car.owner} is not allowed to park`)
    }
    
    // some async work
    
    return true
}

function parkCar(car) {
    try {
        return canParkCar(car)
    } catch ( error ) {
        console.log(error.message)
        return false
    }
}

const car1Parked = await parkCar({ owner : 'John', allowed : false })
if ( car1Parked ) {
    console.log(`car 1 parked`)
}

const car2Parked = await parkCar({ owner : 'Mark', allowed : true })
if ( car2Parked ) {
    console.log(`car 2 parked`)
}
```

I was confused to see it's actually crashing EVEN if there is a `try/catch` block intended to handle any thrown errors:

```bash
$ node app.js

file: ./app.js:3
        throw new Error(`${car.owner} is not allowed to park`)
              ^
Error: John is not allowed to park
```

My expectation was to see this in the console:

```bash
$ node app.js

John is not allowed to park
car 2 parked
```

---
One thing you need to be careful regarding `try/catch` blocks and promises is to properly use the `await` keyword
depending on where you want to catch the errors.
In the example above, at this line

```ts
return canParkCar(car)
``` 

the `parkCar` function finished its job by just
returning a promise. The promise wasn't resolved, so no error was thrown.

However, when you use `await` on this line

```ts
await parkCar({owner: 'John', allowed: false})
```

you are now waiting for the promise to resolve and implicitly waiting for any thrown errors. And because there is
no `try/catch` block around this `await` statement, the program crashes. The error bubbled up until the "root" of the
program.

The fix? Just await the `canParkCar` call:

```js
async function parkCar(car) {
    try {
        return await canParkCar(car)
    } catch ( error ) {
        console.log(error.message)
        return false
    }
}
```

Now, the line

```ts
return await canParkCar(car)
```

not only returns a promise, but it also waits for the promise to resolve. Any thrown errors will be handled there by
the `try/catch` block.

The program now has the expected output without any crashes:

```bash
$ node app.js

John is not allowed to park
car 2 parked
```

---
The key takeaway? Be careful when you want to return a promise, or you want to actually resolve it depending on
your `try/catch` blocks.

That's it for this quick tip.


My Website: https://ionel-lupu.com/
My Twitter: https://twitter.com/ionelLupu_
A project making suggestion
Tags: webdev, beginners, programming, opensource
Published: 2023-09-12 06:18:21

A Click-Through Page is a type of landing page that aims to guide visitors to click through to another page, often with the goal of providing more information or encouraging a specific action, such as making a purchase. Here's a suggested layout for a Click-Through Page, along with the sections typically added by a web designer:

**1. Header Section:**
   - Logo and branding elements.
   - Clear and concise headline that grabs attention.
   - Navigation menu (if needed, though options may be limited to avoid distraction).

**2. Hero Section:**
   - An engaging image or video relevant to the content.
   - A brief and compelling message that communicates the value or benefit of clicking through.
   - A prominent call-to-action (CTA) button with text like "Learn More," "Get Started," or similar.

**3. Features or Benefits Section:**
   - Highlight key features, benefits, or advantages.
   - Use icons, images, or short descriptions to make content visually appealing.
   
**4. Testimonials or Social Proof Section:**
   - Showcase testimonials from satisfied customers or users.
   - Include ratings, reviews, or quotes to build trust.

**5. Additional Information Section:**
   - Provide more detailed information about the product, service, or content.
   - Use bullet points, images, or infographics for clarity.
   
**6. CTA Section:**
   - Reinforce the call-to-action with another button or a form.
   - Emphasize the benefits of clicking through once more.
   
**7. Footer Section:**
   - Contact information.
   - Links to privacy policy, terms of service, or other relevant pages.
   - Copyright and social media icons.
   
**8. Exit-Intent Popup (Optional):**
   - Consider adding an exit-intent popup that appears when users attempt to leave the page. This can provide one last opportunity to engage them or offer a special discount.

Remember that the primary goal of a Click-Through Page is to persuade visitors to click through to another page. Therefore, the content and design should be focused on convincing them that taking that next step is valuable and relevant to their needs or interests.

A web designer would be responsible for creating a visually appealing and user-friendly layout, optimizing the page for various devices (responsive design), and ensuring that the design elements effectively guide the user's attention towards the main CTA button or link.