teleren/devto huggingface dataset:
Way To Pinnacle - CA Institute In Laxmi Nagar
Tags: eissmpendriveclasses, eis, sm, caclasses
Published: 2022-11-01 07:17:45

'[Way to Pinnacle](https://www.waytopinnacle.com/)' was founded in 2013 with a vision to provide guidance to CA & CS students and is governed by the mantra "STUDNT FIRST". Since it's inception way to pinnacle has produced numerous all India rank holders, hundreds of exemptions and thousands of passing results.

We strongly emphasizes on three pillars PRACTICE, PATIENCE & PERSISTENCE Which in all together believes in not giving up , effort required to do something and keep doing it till the end ,even if it is hard. 

 

Our vision is to bring best in our students, create world class professionals, and make them capable to contribute to society and to excel in whatever they chose to do. 

 

Lecture we provide to our students

[EIS SM Pendrive classes](https://www.waytopinnacle.com/eis-sm-pen-drive-classes)
[EIS SM google Drive Classes
](https://www.waytopinnacle.com/index.php?route=product/product&product_id=215)
EIS SM & Audit Pendrive classes
CA Inter Audit Pendrive classes
CA Inter Audit Google Drive Classes
Study Materials 

CA Inter EIS SM Book
CA Inter EIS SM MCQ & Chart Book
CA Inter EIS SM, MCQ & Chart Book COMBO
Next.js Web App Template
Tags: nextjs, template, webdev, javascript
Published: 2022-11-01 07:13:25

I've just released a simple Next.js template including authentication, storage, and password reset logic.


[Demo](https://web-app-template-six.vercel.app/) | [GitHub](https://github.com/Vincenius/web-app-template) | [Blog Post](https://wweb.dev/templates/web-app-template/)

---

🔒 Authentication logic using next-auth/react

📈 User creation stored in MongoDB

🎨 A landing page, authentication pages and a logged in view created with MaterialUI

✉️ Reset password logic and email sending with nodemailer

---

As everything at wweb.dev it is under MIT License

Feel free to check it out and send me feedback via comments or the GitHub repository.

Cheers, Vincent
Optimum Sharding strategy in OpenSearch
Tags: opensearch, aws, sharding
Published: 2022-11-01 06:56:27

This article explores a few tips on optimum `sharding` strategy in OpenSearch.

1. Using time-based indices wherever possible. There are a number of advantages of using time-based indices as mentioned in [this](https://dev.to/aws-builders/advantages-of-using-time-based-indices-in-opensearch-2eie) article. 

2. If unsure, begin with `1` shard. With time-based indices, it offers the flexibility of modifying the number of shards anytime. 
E.g. 

```
if the event count per second is 100 and each event is 1KB, then per day
number of events = 100 per sec * 86400 secs in day = 86,40,000
approx size of each event = 1KB
size of all events per day = 1 KB * 86,40,000 = 86,40,000 KB = ~9 GB per day
```

Each shard is good enough to hold around `30-50` GB data. In the above scenario, with a daily dataset size of `9 GB`, a `single shard` should suffice in case of day-wise indices.

3. Consider another scenario - 

```
If the event count per second is 200 and each event is 2KB, then per day
number of events = 200 per sec * 86400 secs in day = 1,72,80,000
approx size of each event = 2KB
size of all events per day = 2 KB * 1,72,80,000 = 3,45,60,000 KB = ~34 GB per day

```
Here also, a single shard might suffice but it would impact indexing making it slower. Opting for 3 primary shards would mean each shard would be ~12 GB. 

4. For scenario discussed in point 3, the shards of size ~12 GB might look too smaller but then past indices being read-only could be [force-merged](https://aws.amazon.com/premiumsupport/knowledge-center/opensearch-deleted-documents/) to 1 segment. Alternatively, the no of shards could be reduced for past indices by re-indexing them, e.g. say reindex day-wise indices to monthly indices and then force-merge them. This could lead to 30 day-wise indices with each index have 1 shard (thereby total 30 shards for 30 indices) become a single monthly index with say 9 or 12 shards depending on the size of shards.

5. The best way is to experiment and find out what works best. Day-wise indices offer scope to experiment as the template could be easily modified to vary the no of shards for newly created indices.

6. Keep shards EVEN-sized even for different types of indices. Eg. say `twitter` index has `5 shards` each of `10 GB`, then design `posts` index such that the shard size for posts index is also approx around `10-15 GB` or `10-20 GB`. The reason being, if `twitter` index shard is `10 GB` and `posts` index shard is say `50 GB`, then it might lead to un-even disk space.

Feel free to add your questions / thoughts in the comments below.
Salesforce Dumps 2021 examination questions preps
Published: 2022-11-01 06:55:00

Salesforce Dumps 2021 such a lot of sources supplied ordinary takes on the actual exam or didn’t prep us in a meaningful manner.  is different because of this. We cut through the fluff and deliver meaningful exam preps, the examination preps we might want to study with if we had been getting certified. Our exam dumps provide real-world questions that simulate the exam room and job web site, supporting you get the center talents and vital capabilities wished for not most effective Salesforce certification but your destiny career. We need you to go into the trying out facility flippantly and organized to bypass the exam on the primary strive. Why is  the leading exam prep useful resource at the net? well first of all, it’s free! As we love to mention, our exams are definitely free. absolutely everyone receives get right of entry to to 50% or greater of our examination preps simply by way of signing up at . this is a generous quantity too as a few examination preps encompass loads of questions and enough content to be fairly a hit on any examination.  
Get 100% Free Demo >>>>> https://dumpsarena.com/salesforce-dumps/crt-251/
Typescript - Basics and use cases
Published: 2022-11-01 06:50:16

## [Typescript](https://www.typescriptlang.org/) as we all know is the what was missing in javascript from ages - A static type checking system since javascript itself is a weakly typed language

With the help of typescript we can give type-safety to our js codebases like react.

So lets get started with the basics of typescript

First of lets cover the types of variables 

A variable in javascript can be of these types 
- string
- number 
- boolean
- undefined *
- null *
- object

> So lets cover them one by one

If a variable is going to be a string we can simple put it inclusively
**item : string**
This means that item is strictly going to be a string only
similarly with the other types e.g
**item : number**. / for number
**item : boolean** / for boolean


now these are the basic types , but for props that can be grouped together how do we create some thing that shows a group of types together 


That is where **type and interface** comes into effect

Both are used to create a group of types that a component is going to get 

e.g

`type inputTypes{
value:string,
placeholder:string,
type:string
}`

Similarly can be done with interface as well but there are some differences 
- object type can be shown in interface but not in type
- interface with same name in the same file gets merged but that is not for types - for them its just an error

now lets talk about creating types for objects and functions 

**Objects**

Objects has two things to be taken care of i.e
Key part and the value part 
so for objects we can set type as like this

`[v:string]:string`

you can use all the basic types as key and value types here 

this means the key is going to be a string and the value is also going to be a string

**Functions**
Now with functions there are also two parts to it i.e
- Parameters that it is going to be getting
- and the return type that the function is going to be returning


So an example is going to be like this 

type functionProps{
name:string,
age:number,
isAboveThirty:boolean}

`function getAgeSection({name,age,isAboveThirty}:functionProps):string{
if(isAboveThirty){
return 'the person is above thirty'
}else{
return 'He is below thirty'
}
}`

what this means is the function is going to accept the types which are functionProps and the return type is going to be a string

If u don't provide a return type it is going to either infer the type from whatever u returned from the function , or if you don't return anything at all it will set it to void

These are just the basic types just to get you started with typescript 

In the next post i will share how to use typescript in a react app with some advanced types like click events ,input events
Flutter for Windows SD Card Read and Screen Mirror
Tags: flutter, windows, fluttewindowsapp, flutterforwindows
Published: 2022-11-01 06:49:44

Hello,

I am trying to do Windows Desktop application on Flutter and I got stuck two places. Appreciate any leads how this can be resolved.

1. I am unable to find a way in flutter out of the box to read files from an SD card connected to PC.

2. I am unable to mirror my flutter app screen to a secondary monitor in windows environment

Thoughts please.

Thank you.
【資料結構與演算法】- Big O Notation
Published: 2022-11-01 06:37:35


## 【資料結構與演算法】- Big O Notation

Big O Notation 是一種工具：假設有個函式 f(n) 當 input 值放大時 n 的上升曲線大小就是由 Big O Notation 評斷。

**考慮最糟糕的情況，當 input size 龐大時複雜度的成長趨勢**

Big O 算法規則：

 1. 常數不重要( Constants doesn’t matter )

 2. 取最大值 ( Small Terms don’t matter )

 3. log底數不重要 ( Logarithm Base doesn’t matter )

常見的 Big O 演算法( 好到差 )：

 1. O(1)

 2. O(logn)

 3. O(n)：最常見的

 4. O(nlogn)：使用 sorting

 5. O(n²)：想辦法變成 3 or 4。

 6. O(n³)：想辦法變成 3 or 4。

最理想的狀態是使用 O(1) 和 O(logn)，O(n) 是比較常見的 case，大多 sorting 演算法 Big O 的值都是 O(nlogn)，如果有 O(n²)、或O(n³)要想辦法變成 O(n) 或 O(nlogn) 。

Q：假設目前有四個 f(n)，這裡可能就會有個疑問是， 1500 也會影響到演算法的速度，為何 f3(n) 的 Big O 值可以直接去掉 1500 呢 ?

 1. f1(n) = 1000 — — — — → O(1)

 2. f2(n) = n — — — — —→ O(n)

 3. f3(n) = n + 1500 — —→ O(n)

 4. f4(n) = n² — — — — — → O(n²)

看下表就可以知道，當在 input 值 = 1 時 f1(n) 和 f3(n) 這兩個演算法花費時間明顯大於其他兩種。不過當 input 值提升到 100 時， f4(n) 花費的時間遠遠大於其他幾種演算法，這也是為什麼要盡量避免使用 f4(n) 這種演算法的理由。最後，當 input 值提升到了100000 時，會發現其實 f2(n) 和 f3(n) 花費的時間的差距是最相近的，而文章開頭有介紹到，**Big O Notation 考慮的是最糟糕的情況( worst case scenario )**，在這個例子中就是 input 值 = 100000，這也是為什麼 Big O Notation 會忽略 1500 的原因。

![圖源：[資料結構與演算法 (JavaScript)](https://www.udemy.com/course/algorithm-data-structure/)](https://cdn-images-1.medium.com/max/2688/1*9hyboaPBi_6f0Sx147t2pQ.png)

了解了 Big O Notation 的定義和概念後，接著就來看看原生的 JavaScript 中Array 和 Objcet 的各種方法分別屬於哪種 Big O Notation 吧 !!

這些方法的功能不外乎就是四種

 1. **新增 Insertion**

 2. **移除 Removal**

 3. **搜尋 Seaching**

 4. **取值 Access**

先來看看 Object 做以上四種動作時個別的 Big O Notation：

 1. Insertion → O(1)：不管 Obj 多大，新增屬性時所耗費的時間都是一樣的

 2. Removal ****→ O(1)：同上，刪除屬性時所耗費的時間一樣

 3. Seaching → O(n)：從第一個屬性開始找，直到找到為止，花費時間與 Obj 大小成正比

 4. Accessing → O(1)：使用 Hash Tables 這種演算法，因此可以達到不管物件大小取值所耗費的時間都相同的效果 。

再來是 Array ：

 1. Insertion

* push → O(1)：直接新增在最後新增值，不會影響到原本陣列 index

* unshift→ O(n)：新增第一個 index 的值，會讓後面的 index 都 +1

2. Removal ****→ O(1)：同上，刪除屬性時所耗費的時間一樣

* pop→ O(1)：直接移除最後的值，不會影響到原本陣列 index

* shift→ O(n)：移除第一個 index 的值，會讓後面的 index 都 -1

3. Seaching→ O(n)：從第一個 index 開始找，直到找到為止，花費時間與 Array 長度成正比

4. Accessing→ O(1)：同樣使用 Hash Tables，同樣直接取值。 EX：arr[9] 、 arr[999] 花費時間相同。

EXAMPLE：
{% gist https://gist.github.com/angushyx/a9a32260c930ff93073a24d74e998e40.js %}
後記：荒廢了大概四個月的部落格，因為確診兵役延期才又有時間來整理筆記，恰好寫面時題時發現事情不太對勁，對於資料結構與演算法還有很多不了解的部分，除了這個主題之外也想要整理一下 typeScrtipt 的筆記，希望自己能夠撐過去!!!
How to Setup an EV Code Signing Certificate Easily?
Tags: howtoguide, codesigning, digitalcertificate, softwaresecurity
Published: 2022-11-01 06:24:38

An Extended Validated(EV) code signing certificate offers the highest level of security and verifies the publisher's identity by removing the unknown publisher warning as well as the notorious SmartScreen filter. Along with an additional layer of security, it includes some additional validation steps that the user must complete in order for the certificate authority (CA) to verify the legitimacy of the certificate requesting organisation in accordance with CA/B Forum guidelines. 

Once the validation process is complete, the certificate authority (CA) will physically send the EV Code Signing certificate and a HSM device containing the private key by courier to the requesting organization's verified address

Hence, it is crystal clear that the collection process of an EV Code Signing certificate differs from that of a standard code signing certificate.  However, purchasing and getting an EV code signing certificate issued  is not suffice to digitally sign your software and applications until you complete the setup process of your EV code signing certificate by installing it on your system.

Let's learn [How to Setup your EV Code Signing Certificate in an easy step-by-step guide.
](https://signmycode.com/blog/guide-to-setup-your-ev-code-signing-certificate)
Help with thesis survey - PHP developers wanted
Tags: php, productivity, maintenance, research
Published: 2022-11-01 06:15:46

 I'm concluding my Master's degree work, and I need PHP Developers to help me with my research.

So, I would appreciate it if you could get some time and participate in a survey, and maybe in an experiment. I say "maybe" because there is a selection criteria, and the survey system will give you the right directions, according to your answers. 

My work is based in Legacy Software Maintenance, and based on this survey and experiment, I am proposing a framework to improve our work maintaining legacy software. For now, it will be focused on PHP, but future works may expand for other programming languages as well. Even for an experienced developer, I believe there are always new things to learn. 

Maybe by participating you may find some solutions for problems that you have in your projects. 

Some important information: 
- The survey and experiment will be open for participation from Nov 1st, 00:00:00 MDT, until Nov 8th, 00:00:00 MDT. 
- All data will be anonymous. 
- The survey should take from 20 to 30 minutes. 
- The experiment should take approximately 120 minutes. 
- If selected, you need to do the survey+experiment at once, so I recommend setting apart a period of 2:30 hours to do it. 

This is the link to participate: https://landing.pyara.org . 

Feel free to contact me if you have any questions or suggestions. 
Thank you,
Code challenge: Make it make sense
Published: 2022-11-01 06:14:26

You're given a string that contains several words, each word interjected with a number. Your task is to write a function that sorts the words based on the numbers that are contained within them. The function should return the sorted words still containing their respective numbers.

Input:

`"doi4ng y3ou 5today h1ow ar2e"`

Output:

`h1ow ar2e y3ou doi4ng 5today`

Solution:

This is one of my favorite problem because you can use an iterating and sorting technique I find very fun. The first step is to convert our string into something we can work with by splitting it into an array.

```
function order(string){
  return wordsObj.split(" ")
}
```

Output: `["doi4ng", "y3ou", "5today", "h1ow", "ar2e"]`

The objective here is fairly simple, we need to sort the numbers from lowest to highest. How can we do that when they are in a string? Regex and iteration.

```
function order(words){
  return wordsObj = words.split(" ").map((element) => ({ num: element.replace(/[^0-9]+/g, ""), word: element}))
}
```

We've mapped through our array and for each word we've created an object with a number and its associated word. Using regex, we can extract the letters from each element, leaving us with just the number. Since we want our final output to contain the number, we'll leave the word alone. This will return: 

```
[
  { num: '2', word: 'is2' },
  { num: '1', word: 'Thi1s' },
  { num: '4', word: 'T4est' },
  { num: '3', word: '3a' }
]
```

Now all that remains is sorting these objects by their number, and then extract out words.

```
function order(words){
  const wordsObj = words.split(" ").map((element, i) => ({ num: element.replace(/[^0-9]+/g, ""), word: element}))
  return wordsObj.sort((a, b) => a.num - b.num)
    .map((object) => object.word)
    .join(" ")
}
```

Output: `"Thi1s is2 3a T4est"`

Clean refactor:

```
function order(words){
  return words.split(" ")
    .map((element, i) => ({ num: element.replace(/[^0-9]+/g, ""), word: element}))
    .sort((a, b) => a.num - b.num)
    .map((object) => object.word)
    .join(" ")
}
```

[Source](https://www.codewars.com/kata/55c45be3b2079eccff00010f/javascript)
Kubernetes 101 - Pods
Tags: kubernetes, beginners
Published: 2022-11-01 06:13:39

I wanted to explore Pods in more detail as they are quite an essential aspect of the Kubernetes ecosystem.

You can take the name Pod as the literal sense of "pod of whales" or "pea pod," meaning it's one single element in a group of elements.

In the technical sense, a pod is a group of containers with shared storage and network resources. The pods' content is always co-located, co-scheduled, and run in a shared context.

So what exactly is this container we can run on it? It comes down to your application container.
For the sake of simplicity, imagine each pod can run a docker container. Depending on your setup, it can run multiple containers inside one architecture.

## What does a pod do?

Pods are cheap systems. Kubernetes can quickly spool them up, destroy them or replace them.
It takes little to no effort to replace pods, meaning they are stateless and pure.

As mentioned, most of the time, it runs one container, but in some cases, it can run a closed system that needs multiple containers. (Imagine app + background worker).

## Why pods over containers?

You might be wondering why don't we deploy the container directly.
Why is the pod layer needed?

The most straightforward answer to this question is that pods can access shared resources on the local network, meaning they can communicate between them. If we again group the containers they run in, they have yet another way of communicating with the outside pods.

Another reason is their health system in place, making them easily detectable on failure, telling the controller to kill it and spool up a new one.

## Replicable

Because of this setup, it also means pods are the replicable elements.
This basically comes down to Kubernetes being able to automatically create replicas of the system running on the pod.

With this system in place, we can scale horizontally when our load gets higher or have 99% uptime due to replicas on different data sets.

Keep in mind this is solely possible due to the single responsibility of one pod. If this were not the case, it would become impossible to scale them across the board.

## Creating pods

I want to note that you'll never have to create pods manually. This is all managed by the controller.

By doing this, Kubernetes can use resources to their fullest by only spooling up the pods we actively need and managing their workload across different nodes.

A side note is that you can manually create them, but unless things go south, I strongly advise against this.

## Conclusion

Pods are the smallest entity in Kubernetes. Your containers are deployed on nodes.

Pods are managed by the controller and are treated as single-task things. Meaning they are cheap, easy, and stateless.
By doing this, Kubernetes can spool them up quickly and destroy them as it sees fit.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Setup Prettier with Vite & VS Code
Tags: vite, vscode, prettier, javascript
Published: 2022-11-01 06:11:30

Lets face it code formatting is real pain, specially when working on shared projects. Fortunately we have got prettier to solve this problem. This is article is a short guide for setting up prettier in Visual Studio Code, But IDE would do.

## What's Prettier?
Prettier is an opinionated code formatter, for many languages,like Javacript, CSS, JSX.. (mostly all client side tools) and also can be extended to other languages with community plugins

## Time to setup

I will scaffold a quick react typescript project using vite.

```sh
npm create vite@latest
```
## Install prettier 

Install prettier as a dev dependency, this helps us to configure prettier on a per page project

```sh
npm install --save-dev --save-exact prettier
```

## Create file name .prettierrc.json
This will act as the configuration file for prettier. It can be configured using json, YAML or javascript I will be using json

```json
{
   
    "tabWidth": 2,
    "semi": true,
    "singleQuote": true,
    "arrowParens": "avoid"
}
```
This would format the code by using a tab space of 2, adding semi colons at the end of all line endings, using single quotes instead of double, and omits parathesis in arrow functions whenever possible

More rules can be found [Rules](https://prettier.io/docs/en/options.html)

now you can run prettier using
```sh
npx prettier --write .
```
Great!, but can still do better, instead of manually running the configuration we can setup our IDE/Text Editor to help us out.

I am giving the guide for VS Code

## Install the prettier extension 
[VS code extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)

## Open Settings
You can quickly configure the settings by using settings.json file

Press **CMD+OPTION+P** or  **CTRL+ALT+P** and type in **open settings json**

```json
{

  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnPaste": true,
  "editor.formatOnSave": true,

}
```
This will use the formatting option as prettier and follow the configuration set in the configuration file created earlier and also apply formatting when you save or paste a code.

Bam !! 

But what if you need to ignore certain files from formatting say the package-lock.json or the dist/build files. That where .prettierignore comes into play

Create a file called .prettierignore. This works similar to .gitignore and you can follow the same setup

Hope you guys loved it. This is the first part of setting up a good DX using Vite and React. eventually reaching https://github.com/sharath-mohan/react-dx-template this template.

If you liked this article, a star on the github repo would be awesome
1706. Leetcode Solution in cpp
Tags: cpp
Published: 2022-11-01 05:53:59

```cpp
class Solution {
 public:
  vector<int> findBall(vector<vector<int>>& grid) {
    const int m = grid.size();
    const int n = grid[0].size();
    // dp[i] := status of i-th column
    // -1 := empty, 0 := b0, 1 := b1, ...
    vector<int> dp(n);
    // ans[i] := i-th ball's final position
    vector<int> ans(n, -1);

    iota(begin(dp), end(dp), 0);

    for (int i = 0; i < m; ++i) {
      vector<int> newDp(n, -1);
      for (int j = 0; j < n; ++j) {
        // out of bound
        if (j + grid[i][j] < 0 || j + grid[i][j] == n)
          continue;
        // stuck
        if (grid[i][j] == 1 && grid[i][j + 1] == -1 ||
            grid[i][j] == -1 && grid[i][j - 1] == 1)
          continue;
        newDp[j + grid[i][j]] = dp[j];
      }
      dp = move(newDp);
    }

    for (int i = 0; i < n; ++i)
      if (dp[i] != -1)
        ans[dp[i]] = i;

    return ans;
  }
};
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/where-will-the-ball-fall/
History of Amazon
Tags: historyofamazon
Published: 2022-11-01 05:42:11

The history of Amazon is incredibly fascinating. One of the largest eCommerce brand of today started out in a single garage.

Amazon has faced tons of challenges in its growth, but it has become a giant in eCommerce, AI, and video/audio streaming.

Read the complete [history of Amazon](https://www.thereviewsnow.com/history-of-amazon-company/).