teleren/devto huggingface dataset:
Where to Start: Python or JavaScript?
Tags: discuss, beginners, codenewbie
Published: 2023-04-04 07:00:00

Based on popularity and demand in the current job market, two of the top languages to learn first in coding today are:

1. Python because it’s versatile and easy-to-learn, as well as widely used in data science, machine learning, web development, and automation. It has a simple syntax and a large community of developers, so it’s an accessible language for beginners.
2. JavaScript, especially for front-end (and now popular for back-end) web development, is also quite versatile and scalable. It's used to build interactive websites and web applications, and it has a large number of libraries and frameworks available for developers to use.

Both Python and JavaScript are used in a variety of industries, so learning these languages can provide a solid foundation for further exploration in programming and open up a wide range of career opportunities. 

Where do you recommend our CodeNewbies to start? With one of these languages, or perhaps another? Share your experience!
CRM Software Makes Your Life as a Financial Advisor Easier – literally!
Published: 2023-04-04 06:45:47

Introduction:

The financial advisory industry is undergoing a significant transformation with the rise of CRM software. The adoption of CRM software is changing how financial advisors work by helping them manage their client relationships better, streamline workflows, and provide more personalized and efficient services. In this article, we will explore how CRM software is changing the way financial advisors work and the benefits it offers to the industry.
## Better Client Relationship Management:

[CRM software](https://technanosoft.com/services/crm-development) offers a centralized database for storing client information and interactions. Financial advisors can easily track client interactions, manage tasks, and schedule follow-ups to provide more personalized services. With access to client data in one place, advisors can quickly respond to client inquiries, provide timely advice, and offer more tailored solutions.

## Streamlined Workflows:

CRM software helps financial advisors to streamline their workflows by automating time-consuming tasks. Automated workflows help advisors focus on high-value tasks like building client relationships and identifying new business opportunities. It also leads to improved efficiency and productivity.

## More Efficient Sales Processes:

CRM software can help financial advisors to automate their sales processes, from lead generation to closing deals. By automating tasks such as lead nurturing and follow-ups, advisors can focus on high-value activities such as building client relationships and providing tailored solutions.

### Enhanced Compliance and Reporting:

CRM software can help financial advisors comply with industry regulations by providing a centralized repository for storing client information and interactions. With automated reporting features, advisors can easily generate compliance reports, saving time and reducing the risk of errors.

## Improved Client Engagement:

CRM software can help financial advisors to improve client engagement by providing real-time insights into client behavior and preferences. Access to this data allows advisors to tailor their communication and services to meet clients' needs, increasing client satisfaction and loyalty.

**Conclusion:**

CRM software is changing how financial advisors work by providing better client relationship management, streamlined workflows, more efficient sales processes, enhanced compliance and reporting, and improved client engagement. With the rise of CRM software in the financial advisory industry, advisors can provide more personalized and efficient services, leading to increased client satisfaction and business growth.
Methods In Ruby
Published: 2023-04-04 05:59:39


Ruby is a popular object-oriented programming language that is widely used for developing web applications and other software. It is known for its simplicity and ease of use, making it a great choice for beginners and experienced programmers alike. One of the key features of Ruby is the availability of numerous methods that can be used to accomplish various tasks. In this blog post, we will discuss some of the most useful methods in Ruby and how they can be used.

1.each
 The each method is used to iterate over a collection and perform an action on each element. It takes a block of code as an argument and executes that block once for each element in the collection. For example



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

This will output:

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

2. map
The map method is used to transform each element in a collection based on a block of code. It returns a new collection with the transformed elements. For example:

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

This will output:


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

3. select
The select method is used to filter a collection based on a block of code. It returns a new collection containing only the elements that meet the criteria specified in the block. For example:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/769jt75wh1gch1115bme.png)
This will output:


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

4. reduce
The reduce method is used to combine all the elements in a collection into a single value. It takes a block of code as an argument that specifies how to combine the elements. For example:

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

This will output:


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

In this example, the reduce method starts with an accumulator value of 0 and adds each element in the array to the accumulator.

These are just a few of the many methods available in Ruby. By using these methods, you can write concise and expressive code that is easy to read and maintain. As you become more familiar with Ruby, you will discover even more methods that can help you write efficient and effective code.
AllowSetForegroundWindow quirks
Tags: windows, notifications
Published: 2023-04-04 05:58:39

At some point when developing for Windows you may have seen your app try to get focus for itself but end up flashing the taskbar icon instead. As Raymond Chen explains, [you can't steal foreground focus](https://devblogs.microsoft.com/oldnewthing/20090220-00/?p=19083).

I've come across a couple of additional quirks with `AllowSetForegroundInfo`:

## Issues when launched from Windows notifications

I discussed this problem in my post on [Electron notifications](https://dev.to/randomengy/proper-windows-notifications-on-electron-38jo). As I mentioned there, there's a wrinkle for activations from Windows Notifications. When your app is launched from the protocol string in a notification, for some reason calling `AllowSetForegroundWindow` does not work. Chromium [worked around this issue by sending a dummy keypress event](https://bugs.chromium.org/p/chromium/issues/detail?id=837796).

I created [a node package to execute the same workaround](https://www.npmjs.com/package/windows-dummy-keystroke) for Electron, and then also [fixed this in Tauri's deep-link plugin](https://github.com/FabianLars/tauri-plugin-deep-link/pull/27).

Ideally Windows should come up with a fix and make sure that any process launched from a notification can call `AllowSetForegroundInfo` without having to jump through this hoop.

## ASFW_ANY

But there is another oddity I came across. [AllowSetForegroundWindow's documentation](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-allowsetforegroundwindow) claims that you can pass in `ASFW_ANY` and it will allow any process to take foreground focus. When originally trying to implement this workaround, I used this because I wanted to see if it would work at all before switching to the more secure approach of passing in the specific process ID.

But it just did not work at all until I passed in the PID. No shortcuts here. 🫤
Custom validation for nested loop,
Tags: angular, javascript, typescript, html
Published: 2023-04-04 05:58:12

Hello All,

We are facing some issue during apply validation in score parameter.

We want  score should be less than max score in every field but not apply that validation to relevent field.

We are using angular for development.

We are using nested for loop and multiple index for data retrive

Screen shot of error attached below

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/13oezopwqurgq1bnv076.PNG)
Learn Ajax in simple way for Beginners (part - a)
Tags: webdev, beginners, programming, ajax
Published: 2023-04-04 05:51:15

## So Here is our question arise what is ajax and how it is work?

- Ajax stands for _Asynchronous  JavaScript and XML_


- Ajax is used  to exchange  data  with a  web server 
asynchronously._(asynchronously means  it send and receive data in background and do not reload the page every time in doing so)_.


- The reason ajax  is famous, for it only change the parts of the page which we are updating or changing instead of reloading the whole web page.


- Ajax support _non-blocking calls_ means codes can run simultaneously.



When we are  using ajax , JavaScript will make a request to the server and after getting response from server, it will interpret the response and update or  show the result on the user  screen.

ajax asynchronously communicate with server using _XMLHttpRequest_.
example:

```
let ajaxXhr  = new XMLHttpRequest();
```
 here XMLHttpRequest() is object request we have  created and stored  it in variable name ajaxXhr.

**How ajax Works :** 

- When an event(means like a user  click a button, hover a mouse etc.) occurred on a webpage. 

- then this awakes the ajax engine.

- ajax engine send the XMLHttpRequest to the server. 

- then server give the response to the ajax engine in the format of JSON or XML. 

-  after getting the response it will update the webpage(not whole).

easy example of ajax running: 

```
btn.addEventListener("click", ajaxRun);

function ajaxRun(){
let xhr = new XMLHttpRequest();
xhr.open("GET", "file.txt", true);
xhr.send();
}
```
from above example, we add a event listener to button (btn), means when we click btn , it will run ajaxRun function.
in ajaxRun function, it will create a _new XMLHttpRequest()_ object,
and store it in xhr variable.
then we use object method on xhr for further action.

- we use open method in which we have three parameter 
open(method, URL , async) i.e it tells where we are transmitting the data. (talk about detail in next part).

- send method tells us that the request is send.

**Use of Ajax :**

- it is used for creating dynamic Web apps.

- with ajax, we can send and receive data without reloading the webpage.

- It makes our web apps interactive and faster 


`Hope it help... we talk about it more in ajax part-b`
Today’s management and Soviet propaganda
Tags: leadership, management, engineeringmanagemen, webdev
Published: 2023-04-04 05:35:35

Making mistakes is natural on a journey that is new for you. But avoiding a few blunders can be done by learnings from the experienced ones.
To all the engineering managers, here is a great read from Gregor Ojstersek's newsletter Engineering Leadership.

[](https://newsletter.eng-leadership.com/p/letter-to-myself-when-i-first-started#%C2%A7letter-to-myself-when-i-fir[…]tarted-with-engineering-management)Today’s management-speak has a lot in common with 1930s Soviet propaganda—and it’s making people miserable
How to start contributing to open source
Published: 2023-04-04 05:33:48

Steps to follow if u want to start contributing to open source:-
1)Install git into your machine.
2)Try using it and use its commands for cloning projects
3)If u ok with it then use "good first issue" tag for finding basic projects into which u can contribute.
4)If u just want to see the code without cloning it so use "1s" in your http url after word git.
5)When u find its the good project for contribution then make the changes and pull request send krdo.

Thanks
Tauri + SQLite
Tags: tauri, sqlite
Published: 2023-04-04 05:32:27

For years, SQLite has been my go-to solution for storing any kind of structured local data for apps. The ability to update multiple pieces of data in a transaction has been extremely useful.

Naturally, when building my app in Tauri, I wanted to use SQLite from my Rust backend code.

A bit of poking around led to [Rusqlite](https://docs.rs/rusqlite/latest/rusqlite/) for an ergonomic SQLite wrapper.

But there's a couple other questions to answer in order to tie it in with Tauri.

## Where do you store the SQLite file?

Inside `setup()` we can create an app handle and call `app_handle.path_resolver().app_data_dir()`. That's the designated place to store our app data. From there we can initialize our DB file.

## How do we access the `Connection` from a Tauri command?

Tauri has a built-in ability to store app state. We'll set up struct to hold it:

```rust
pub struct AppState {
  pub db: std::sync::Mutex<Option<Connection>>,
}
```

The Mutex protects access to the connection object. The idea is that you get the `Connection`, run a query on it, then release the Mutex.

In `setup()` we can populate this app state with the DB connection.

```rust
let app_state: State<AppState> = handle.state();
*app_state.db.lock().unwrap() = Some(db);
```

We can also add a convenience trait to easily access the `Connection` object without jumping through the `State` fetch and `Mutex` lock.

```rust
pub trait ServiceAccess {
  fn db<F, TResult>(&self, operation: F) -> TResult where F: FnOnce(&Connection) -> TResult;
}

impl ServiceAccess for AppHandle {
  fn db<F, TResult>(&self, operation: F) -> TResult where F: FnOnce(&Connection) -> TResult {
    let app_state: State<AppState> = self.state();
    let db_connection_guard = app_state.db.lock().unwrap();
    let db = db_connection_guard.as_ref().unwrap();
  
    operation(db)
  }
}
```

Inside Tauri commands we can supply a `app_handle: AppHandle` argument, which will be automatically populated by the Tauri framework. From there we can call our `db()` trait method on `app_handle` to do database operations. Anything returned from the closure will be passed through.

```rust
let my_result = app_handle.db(|db: &Connection| {
    /* Do something with the DB connection and return a value */
});
```

I pass the `AppHandle` through to any other modules that need it, so they also have access to the `Connection`. You can also call `app_handle.clone()` in case you run into ownership issues.

## Full example code
https://github.com/RandomEngy/tauri-sqlite
How to use .NET's built-in caching mechanism to improve the performance of your web applications
Tags: dotnet, aspdotnet, webdev, programming
Published: 2023-04-04 05:28:48

Caching is a crucial technique for improving the performance of web applications. By caching frequently accessed data in memory, you can reduce the number of database queries and other expensive operations your application needs to perform, leading to faster response times and better scalability.

In .NET, the caching mechanism is built into the framework, making it easy to implement and customize. Here are some tips for using .NET's caching features to improve your application's performance:

**1.Use the MemoryCache class** :
.NET's built-in caching mechanism is based on the MemoryCache class, which allows you to store data in memory for quick access. To use the MemoryCache class, you can create a new instance of it in your application and use the Add() and Get() methods to add and retrieve data from the cache, respectively.
```
var cache = MemoryCache.Default;
var key = "myCachedData";
var data = cache.Get(key) as List<MyData>;

if (data == null)
{
    // If the data isn't in the cache, query the database and store the results in the cache
    data = db.Query<MyData>("SELECT * FROM MyData").ToList();
    cache.Add(key, data, DateTimeOffset.Now.AddMinutes(10));
}
```
In this example, we're using the MemoryCache class to cache the results of a database query for 10 minutes. If the data is already in the cache, we retrieve it using the Get() method. If not, we query the database and store the results in the cache using the Add() method.

**2.Use caching for expensive operations** :
Caching is most effective when used for expensive operations that are performed frequently. For example, if you have a page that displays a list of products and the list rarely changes, you could cache the product data to improve the page's performance.

**3.Set a reasonable expiration time** :
When you add data to the cache, you can specify an expiration time to ensure that the data is automatically removed from the cache after a certain period. It's important to set a reasonable expiration time based on how frequently the data changes and how important it is to have the most up-to-date information.

**4.Monitor cache performance** :
Like any performance optimization, it's important to monitor the performance of your caching strategy to ensure that it's actually improving your application's performance. You can use tools like PerfView to measure the impact of caching on your application's CPU and memory usage.

Caching is a powerful technique for improving the performance of web applications, and .NET's built-in caching mechanism makes it easy to implement and customize. By using caching for expensive operations and setting reasonable expiration times, you can reduce the load on your database and other resources, leading to faster response times and better scalability.
Infinite Marquee using just HTML and CSS.
Tags: webdev, tutorial, javascript, programming
Published: 2023-04-04 04:59:37

**HTML**

```
<div class="marquee-horizontal2">
    <div class="track-horizontal2">
        <div class="marquee-text">Marquee</div>
        <div class="marquee-text">Marquee</div>
        <div class="marquee-text">Marquee</div>
        <div class="marquee-text">Marquee</div>
        <div class="marquee-text">Marquee</div>
        <div class="marquee-text">Marquee</div>
    </div>
</div>
```

**CSS**

```
.marquee-horizontal2 {
  display: flex;
  overflow: hidden;
  width: 100%;
  white-space: nowrap;
  justify-content: flex-start;
  -webkit-box-align: center;
  align-items: center;
}

.track-horizontal2 {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  animation: marquee-horizontal 20s linear infinite;
}

.marquee-text {
  -webkit-text-size-adjust: 100%;
  -webkit-box-direction: normal;
  white-space: nowrap;
  box-sizing: border-box;
  padding-right: 0.3em;
  padding-left: 0.3em;
  -webkit-box-flex: 0;
  flex: 0 0 auto;
  font-family: 'Helvetica', sans-serif;
  color: #1d4130;
  font-size: 6.25em;
  font-weight: 700;
  text-transform: uppercase;
}

@keyframes marquee-horizontal {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}
```
Stand Out on GitHub: How to Create an Eye-Catching Profile README
Tags: github, githubprofile, githubreadme, career
Published: 2023-04-04 04:34:55

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

Your GitHub profile is your virtual identity in the coding community. But how can you make it stand out? By adding a profile README! In this step-by-step guide, we'll show you how to create an engaging profile README that will showcase your skills, projects, social media and much more to the world.

1. Create a new repository:

- Go to your GitHub profile page
- Click on the "Repositories" tab
- Click the green "New" button
- Name your repository "username" (replace "username" with your actual GitHub username. This is the most important thing)
- Select "Public" and check "Add a README file"
- Choose a license if you want
- Click "Create repository"

![Creating New Repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/52alv3m83amwnafqcika.png)

2. Edit your README file:
- Open your newly created repository
- Click on the README file
- Click on the pencil icon to edit the file
- Add your content using Markdown syntax
- Preview your changes by clicking the "Preview changes" tab
- When you're done, click the "Commit changes" button at the bottom of the page

![Editing Readme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3o5hssekzov33ka9puex.png)

3. Customize your Profile ReadMe
You can generate awesome profile ReadMe from many online tools. Some of them are:

- https://rahuldkjain.github.io/gh-profile-readme-generator/
- https://gprm.itsvg.in/
- https://profilinator.rishav.dev/
- https://profile-readme-generator.com/

Generate the ReadMe file from your selected resource. Copy the code, repeat the step 2 again and commit changes. Congratulations! You have successfully added a profile README to your GitHub profile.
Here is the link to my GitHub profile https://github.com/arham-rumi.
Conditional Statements in JavaScript: Switch
Tags: javascript, tutorial, webdev, programming
Published: 2023-04-04 04:34:02

In JavaScript, the switch statement is another way to achieve the conditional statements instead of if else. While doing multi level condition check this one is really helpful.

## [The Switch Statement](https://www.programdoc.com/javascript/switch)

The `switch` statement evaluates an expression and compares it with a series of cases. If there is a match, the code inside that case is executed. The switch statement is often used as an alternative to the if-else statement when multiple conditions need to be evaluated.

`break` keyword is used in each case to break the switch statement once the case condition is true, if break is not used then it will check other case condition statements. 

`default` keyword is used at the end of switch, this block will be executed if the above case are not true.

_syntax:_

```js
switch (expression) {
  case value1:
    // code to be executed when expression matches value1
    break;
  case value2:
    // code to be executed when expression matches value2
    break;
  default:
    // code to be executed when none of the cases match expression
}
``` 

Here, `expression` is the expression to be evaluated, and `value1`, `value2`, etc., are the cases to compare with the expression. If the expression matches `value1`, the code inside that case will be executed. The `break` keyword is used to exit the switch statement. If none of the cases match the expression, the code inside the `default` case will be executed.

### Example:

```js
let number = 2;

switch (dayOfWeek) {
  case 1:
    console.log("ONE");
    break;
  case 2:
    console.log("TWO");
    break;
  case 3:
    console.log("THREE");
    break;
  case 4:
    console.log("FOUR");
    break;
  case 5:
    console.log("FIVE");
    break;
  default:
    console.log("Invalid Number");
}
``` 

In this example, since `number` is `2`, the message "TWO" will be printed to the console.