teleren/devto huggingface dataset:
AWS CDK ARM64 CodeBuild is broken
Tags: cdk, arm6, docker
Published: 2023-04-05 09:36:44

That's so sad that AWS is not doing a good job with undifferentiated heavy lifting.
A lot of noise but the reality as usual shows what is true.

Below is a simple example of CDK Pipelines which should work


```

pipelines.CodePipeline(
    self,
    "pipeline",
    self_mutation_code_build_defaults=pipelines.CodeBuildOptions(
        partial_build_spec=codebuild.BuildSpec.from_object(
            {
                "phases": {
                    "install": {
                        "commands": [
                            "npm cache clean -f",
                            "n 16",
                            "node -v",
                        ]
                    }
                }
            }
        )
    ),
    code_build_defaults=pipelines.CodeBuildOptions(
        role_policy=[
            iam.PolicyStatement(actions=["*"], resources=["*"]),
            iam.PolicyStatement(actions=["sts:AssumeRole"], resources=["*"]),
        ],
        build_environment=codebuild.BuildEnvironment(
            compute_type=codebuild.ComputeType.LARGE,
            build_image=codebuild.LinuxBuildImage.AMAZON_LINUX_2_ARM_2,
        ),
        partial_build_spec=codebuild.BuildSpec.from_object(
            {
                "phases": {
                    "install": {
                        "commands": [
                            "npm cache clean -f",
                            "n 16",
                            "node -v",
                        ]
                    }
                }
            }
        ),
    ),
    synth=pipelines.ShellStep(
        "synth",
        input=pipelines.CodePipelineSource.connection(
            repo_string=pipeline_vars.github_git_repo,
            branch="main",
            connection_arn=pipeline_vars.github_connection_arn,
        ),
        install_commands=[
            "npm cache clean -f",
            "n 16",
            "node -v",
            "pip install -r requirements.txt",
            "npm install -g aws-cdk",
        ],
        commands=[
            "cdk synth",
        ],
    ),
    pipeline_name=pipeline_vars.project,
    self_mutation=True,
)

```

**What we need to remember is that AWS doesn't provide updated build image that contain supported node version, ideally 16 or 18, but they stick with node 12!**

The pipeline above is enforcing node 16 installation for pipeline synth and self-mutation.
function declaration vs function expression
Tags: javascript, beginners, programming, tutorial
Published: 2023-04-05 09:21:27

In JavaScript, there are two common ways to define a function: function declaration and function expression.

A function declaration is a statement that declares a named function with a specified set of parameters. Here's an example:

```
function addNumbers(a, b) {
  return a + b;
}
```
A function expression, on the other hand, is an assignment statement where the function is assigned to a variable or property. Here's an example:

```
const addNumbers = function(a, b) {
  return a + b;
};
```
The main difference between function declaration and function expression is that function declarations are hoisted to the top of their scope, whereas function expressions are not.

This means that you can call a function declared with a function declaration before it is defined in the code, but you cannot do the same with a function expression. For example:

```
console.log(addNumbers(2, 3)); // Output: 5

function addNumbers(a, b) {
  return a + b;
}
```
In this case, the function addNumbers is hoisted to the top of the code, so it can be called before it is defined.

However, if you try to do the same with a function expression, you will get an error:

```
console.log(addNumbers(2, 3)); // Output: Uncaught ReferenceError: addNumbers is not defined

const addNumbers = function(a, b) {
  return a + b;
};
```
In general, it's a good practice to use function declarations for functions that need to be called before they are defined, and function expressions for functions that will be assigned to variables or properties.

→ But function expression can only invoke/run/call "after" the function definition.

→ If we call the function expression before initialization, then this will give an error.

→Function declarations are hoisted but function expressions are not.
Draft: Common Software Engineer Interview Questions
Tags: interview
Published: 2023-04-05 09:17:58

# Background
This post will be my dump of software engineer interview questions. Whenever I found anything interesting, I will put it here, so this is an "always a draft" post.

Also, I will try to answer them.

# Questions

## What happens when you enter a URL into your browser and press enter?

Plenty of little things will happen, like, a key-pressed callback/handler will be called. This handler will get a string value from the text field. The browser will try to parse the value and do something about it.

But I guess that is not the detail level that question meant. Hehe. So I'll continue at a slightly higher level.

After the browser determined that the string is indeed a URL, it will try to chunk the URL into some parts: 
- protocol
- hostname
- path
- query-params

Then the browser needs to resolve the IP address of the hostname by looking into DNS records. It will start at its local DNS cache, and if it cannot find it, it will consecutively find it in the OS cache, router cache, ISP DNS server, and ends at some public DNS server.

Then it will try to establish TCP/IP connection using a handshake with the host, by exchanging synchronize(SYN) & acknowledge(ACK) messages. 

After the connection is established, if needed/able, the browser will try to make a TLS handshake by exchanging messages. 

After the connection is established, the browser then starts to send HTTP requests, with path, headers, and/or body. The host (or by now can be called the server), handles the requests and send back the response.

A response usually got an adequate amount of information for the browser to render something, for example, HTML, JS, or CSS.

Then the browser renders something based on the response, and maybe do another request to the server if required.

References:
- https://medium.com/@kasunpdh/ssl-handshake-explained-4dabb87cdce
- https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/

---

## How do you handle edge cases and errors?

## How do you make sure your code is maintainable?

## What are some signs that a system is architected well?

## Can you tell me about a mistake you made and how you handled it?

## How do you approach designing systems for high availability and relia

## What is CORS
How to Integrate Magento 2 with POS Systems
Tags: magento, magento2, magento2tutoria
Published: 2023-04-05 09:04:56

Hey! Is it valid or not that you are keeping a retail business and looking for methods of streamlining your cycles and update your clients' understanding? Planning Magento 2 with a Brick and mortar store (POS) structure might be the game plan you're looking for.

You could feel compromised by the possibility of consolidating Magento 2 with a POS system, but trust me, it's not exactly so particularly puzzled as it shows up. In this article, we will guide you through the entire cycle one small step at a time, starting with picking the reasonable POS programming, setting up the compromise, and dealing with any issues that could come up on the way.

Close to the completion of this helper, you'll have a sensible perception of **_How to Integrate Magento 2 with POS Systems_** across both your on the web and detached stores. Along these lines, get some coffee, and could we start!

Fore information, please visit this:-**_[https://webguru.dev/how-to-integrate-magento-2-with-pos-systems/](https://webguru.dev/how-to-integrate-magento-2-with-pos-systems/)_**
Effortlessly Deploy 🚀 Next.js Projects with Vercel
Tags: nextjs, javascript, webdev
Published: 2023-04-05 09:02:10

Are you tired of spending hours configuring your web projects for deployment? Look no further than Vercel, the cloud platform for modern frontend teams. With Vercel, you can effortlessly deploy your Next.js projects in just a few steps. Here's how:

## 1. Create a Vercel Account
First, sign up for a Vercel account at vercel.com or login to your existing account using GitHub/GitLab.

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



## 2. Add a New Project
Once you've signed in to your account, go to the Vercel dashboard and click on 'Add New', then select 'Project'. This will prompt you to connect your repository.


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



## 3. Connect Your Repository
Connect your GitHub account and select the Git Repository that you want to import. Once you've connected your repository, Vercel will automatically import your project and start the deployment process.

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



## 4. Configure and Deploy
If you have custom build commands or .env variables that your app uses, you can configure them in the Vercel dashboard before deploying your project. This step is optional, but can be useful for more complex projects.

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



## 5. Your Deployment is Ready
Once your project is deployed, you can visit it from the subdomain that is assigned by Vercel. From here, you can configure additional options like Custom Domains, SSL certificates, and more.

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



That's it! With Vercel, deploying your Next.js projects has never been easier. Say goodbye to complicated deployment processes and hello to effortless deployment with Vercel.
Last contemplations BitAlpha AI
Published: 2023-04-05 08:22:29

How to utilize the BitAlpha AI stage?
Remember that CFD exchanging may involve dangers, and some of them might prompt total loss of your capital on the web. In this manner, you should careful when exchange. When on [BitAlpha AI](https://www.bitalphaaibot.com), you better recollect the accompanying tips:

Don't bother putting resources into bigger aggregates: when you put aside your installment, you better beginning money management with just little piece of it not to lose all your store immediately.
Utilize additional cash as your foundation capital: to begin crypto exchanging, you better have an additional money to try not to gamble with your primary pay.
Screen the robotized cycle: regardless of whether the framework is totally computerized, you better really take a look at the interaction to keep away from specialized issues.
Partake in the demo account choice: this free record is an opportunity to get familiar with the exchanging system and all subtleties connected with crypto area.

https://www.bitalphaaibot.com
https://twitter.com/bitalphaai
https://www.instagram.com/bitalphaai
https://www.pinterest.co.uk/bitalphaai_
https://www.facebook.com/bitalphaai.official
https://www.youtube.com/@bitalphaai
https://sites.google.com/view/bitalphaai/home
https://bitalphaai.blogspot.com/
https://medium.com/@bitalphaai
https://bitalphaai.gumroad.com/
https://www.reddit.com/user/bitalphaai
https://bitalphaai.wordpress.com/
https://www.tumblr.com/blog/bitalphaai
https://techplanet.today/member/bitalphaai
https://bitalphaai.law.blog/
https://bitalphaai.mystrikingly.com/
https://bleup-pfaiows-moily.yolasite.com/
https://bitalphaai.wixsite.com/bitalphaai
https://groups.google.com/g/bitalpha-ai/c/HJA9wo6S74k
google chrome pdf extension
Tags: questions, javascript, webdev
Published: 2023-04-05 08:16:03

Am trying to make a google chrome extension that will handle pdf downloads. I want it to send downloaded pdfs  to server. Please help. This is what I have currently done. My manifest.json
```
{
    "name": "PDF333",
    "version": "1.0.1",
    "description": "PDF auto download",
    "manifest_version": 3,
    "author": "Petach",
    
    "icons": {
        "16":"icons/16.png",
        "32":"icons/32.png",
        "48":"icons/48.png",
        "128":"icons/128.png"
    },
    "permissions": [ "downloads", "activeTab"],
    "background": {
    "service_worker": "background.js"
  }
}
```

And finally background.js as below
```
chrome.downloads.onChanged.addListener(function (downloadDelta) {
   
    if (downloadDelta.state && downloadDelta.state.current === "complete" && downloadDelta.mime === "application/pdf") {
        chrome.downloads.search({ id: downloadDelta.id }, function (downloadItems) {
            var xhr = new XMLHttpRequest();
            xhr.open("POST", "http://localhost:4000");
            xhr.setRequestHeader("Content-Type", "application/pdf");
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        console.log("PDF uploaded successfully!");
                    } else {
                        console.error("Failed to upload PDF.");
                    }
                }
            };
            xhr.send(downloadItems[0].filename);
        });
    }
});
```
How to update data of child table in web form using client script in Frappe Framework
Tags: frappe, erpnext
Published: 2023-04-05 08:00:32

how can I use the same client script which is basically updating the value of rows in the child table from the data coming from an external API and is working for the doctype form to work with the web form client script? the data is coming but the rows are not updating 

The Script:

```
function updateCateringLimits(frm, responseMessage) {
   frappe.call({
      method: 'frappe.wis.doctype.script.get_catering_limits',
      args: {
         buid: frm.doc.buid,
         office_guid: responseMessage[frm.doc.officename]
      },
      callback: function (response) {
         const cateringLimitsObj = response.message;
         const cateringLimits = Object.values(cateringLimitsObj)[0];
         const childTable = frm.doc.catering_limits || [];

         // Clear the child table first
         while (childTable.length) {
            frm.get_field('cateringlimits').grid.remove_row(0);
         }

         // Add the new rows to the child table
         const childTableField = frm.fields_dict['cateringlimits'];
         if (childTableField && childTableField.grid) {
            cateringLimits.forEach(cateringLimit => {
               const newRow = frm.add_child('cateringlimits');
               newRow.minpeople = cateringLimit.minPeople;
               newRow.maxpeople = cateringLimit.maxPeople;
               newRow.cutoff = cateringLimit.cutoffHrs;
            });
         }

         // Refresh the form to show the updated child table
         frm.refresh_field('cateringlimits');
      }
   });
}
```

I am trying to update my doctype script which is updating the rows of child table in doctype form but the script in not working in the web form client script i have tried to make changes and the code is working till wher it is able to fetch the data from the api but the grid is not updating
Python Training In Gurgaon
Tags: pythoncourse, pythontraining
Published: 2023-04-05 07:46:45

Uncodemy provides you the best Python Training in Gurgaon where you can learn many things from 0 level to Advance level,  which will teach you well, that too in a     friendly budget We Focus on Innovative ideas, High-quality Training, Smart Classes, 100% job assistance, and Opening the doors of opportunities. Our Trainees are working across the nation. We at Uncodemy India, the No#1Python Training in Gurgaon with 100% Placement.
CISSP Training
Tags: cissp, security, cybersecurity
Published: 2023-04-05 07:32:07

The Certified Information Systems Security Professional (CISSP) certification is a globally recognized certification in the field of information security. Infosectrain's CISSP® certification training course is suitable for information security professionals. The certification is offered by the International Information Systems Security Certification Consortium, or (ISC)², and is designed to validate an individual's expertise in information security.

[CISSP Training](https://www.infosectrain.com/courses/cissp-certification-training/
)
Uint256 max value
Tags: uint256, solidity
Published: 2023-04-05 07:29:30

The maximum value of uint256 can be obtained with

```
type(uint256).max;

```
Which is equal to 115792089237316195423570985008687907853269984665640564039457584007913129639935 (2²⁵⁶ - 1). But it's cleaner and safer to use type(uint256).max.
The same can be used for signed integer types

```
//57896044618658097711785492504343953926634992332820282019728792003956564819967
type(int256).max;

//-57896044618658097711785492504343953926634992332820282019728792003956564819968
type(int256).min;
```

## Hacky ways to get the uint256 maximum value
You could also specify it with hexadecimal, which would be a little cleaner than using the decimal representation, but still space consuming and error prone.

```
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

```
That's exactly 64 'f's, don't get it wrong! The 64 is derived from 256 bits divided by 8 to get the number of bytes (32), and each maximum byte is represented in hex by 0xff.
Another ugly solution is to underflow the integer

```
function maximum() public pure returns(uint256) {
   unchecked { return uint256(0) - uint256(1); }
}
```
The following code works properly, but it is deceptive and not recommended for use

```
function maxUint() public pure returns (uint256) {
    return 2**256 - 1;
}
```
It returns the correct value, which you can verify with

```
assert(2**256 - 1 == type(uint256).max);
```
If you write 2**256 as a constant in solidity, the code won't compile because the compiler recognized 2**256 is too large to fit in uint256. But if it is immediately followed by a "- 1", then the compiler recognized the result of the arithmetic is valid with the type.
It's better to just avoid all these gymnastics and just do type(uint256).max;

## Learn more
If you are new to Solidity, see our learn [solidity free for beginners course](https://www.rareskills.io/learn-solidity).
For intermediate and advanced developers, please see our [expert solidity bootcamp](https://www.rareskills.io/solidity-bootcamp).
Facts About QuickBooks Company File
Tags: company, file, software, quickbooks
Published: 2023-04-05 07:21:56

A QuickBooks company file is a digital record that contains all financial and accounting data for a business. It is essentially the heart of the QuickBooks software and serves as the central location where all financial transactions and records are stored. The company file contains information such as customer and vendor data, bank and credit card transactions, invoices, payments, and payroll records. [QuickBooks allows to creation of multiple company files](https://www.askforaccounting.com/set-multiple-companies-quickbooks/), which can be customized to suit the needs of different businesses. With QuickBooks company files, businesses can easily manage their finances, track expenses, generate reports, and make informed financial decisions.

**Facts QuickBooks Company File**

- The Company file is the master file in QuickBooks that contains all the information related to your business.
- The Company file stores all your financial data, such as customers, vendors, items, services, accounts, and transactions.
- It is the central repository of all your QuickBooks information.
- All your company data is stored in the Company file.
- You can create multiple Company files in QuickBooks to store different business information.
- You can also copy or move transactions from one Company file to another.
- The Company file is like your business’s ‘vault’; it stores all your important financial information.
- You can easily access the Company file from any computer with QuickBooks installed.
- You can also back up your Company file to ensure that your data is safe.
- QuickBooks also offers a cloud-based version of the Company file, which allows you to access the file from any device with an internet connection.
- Points to Remember Before Updating Your Company File After Upgrading QuickBooks
- Ensure that you have a current backup of your company file.
- Take a look at any add-on tools and apps that you are using and make sure they are compatible with the version of QuickBooks that you are upgrading to.
- Train your staff on the new features of QuickBooks.
- Run a Verify Data utility to check for any data integrity issues.
- Check your reports and make sure they reflect accurate information.
- Make sure that you are using the latest release of QuickBooks.
- Review any custom reports and templates that you have created to ensure they are compatible with the new version.
- Update your financial institution connections.
- Audit your security settings.
- Run
 a [QuickBooks File Docor to fix company file error](https://www.askforaccounting.com/quickbooks-file-doctor/) and issue.
Unlocking Global Markets with Low-Priced Translation API Service and Lightning-Fast Response Time
Tags: translation, api, translate, googletranslate
Published: 2023-04-05 07:16:29

Are you looking to expand your business globally but struggling with language barriers? Look no further than our API services, which offer top-of-the-line translation capabilities at a fraction of the cost of our competitors.


We understand that language barriers can be a major obstacle to business growth. That's why we've developed an API service that provides accurate and reliable translations in multiple languages, making it easier than ever to communicate with customers, partners, and colleagues around the world.

But that's not all - we also pride ourselves on our lightning-fast response time, ensuring that your API requests are processed quickly and efficiently. This means you can spend less time waiting for translations and more time focusing on what really matters - growing your business.

What's more, our API services are incredibly affordable, making them accessible to businesses of all sizes. With our low pricing, you don't have to sacrifice quality for affordability - you can have both.

In conclusion, if you're looking to expand your business globally and overcome language barriers, our API services are the perfect solution. With low pricing, lightning-fast response time, and top-notch translation capabilities, we're confident that our services will help you unlock new opportunities and reach new heights. Contact us today to learn more!

[Translate Plus](https://translateplus.io)
[Translate Plus Documentation](https://docs.translateplus.io)
if else haqida
Published: 2023-04-05 07:10:45

Assalamu aleykum hurmatli dasturchi bugun siz bilan Python dasturlash tilida if else haqida ko'rib chiqamiz

Python dasturlash tilida `if .. else` (shart amall) xaqida gaplashamiz

Python dasturlash tilida matematika mantiqiy amallarni qo'llab quvatlaydi.

```
If
```
 sozi ingliz tilidan "agar" deb tarjima qilinadi va deyarli barcha dasturlash tillarida shartlarni yozish uchun foydaniladi.

```
Else 


```
ingliz tilidan "aks xolda" deb tarjima qilinadi if  qismi bajarilmaganda else qismi ichidagi kod bajariladi

`misol uchun:`

```
Teng:
```
 a===b

```
Teng emas:
```
 a!=b

```
Kamroq
```
: a<b

```
Kichik yoki teng:
```
 a <=b

```
katta:
```
 a > b

```
Katta yoki teng:
```
 a >= b 

`Keling endi misollar koramiz:
`
a = 5
b = 6
if a > b:
  print("A katta b dan")

else:
  print("A kichkina b dan")

`Natija:
`A kichkina b dan chiqadi

`Va keling yana bitta misol koramiz:`

a = 16
a = 16

if a==b & a==b:
  print("A teng b ga ")
else:
  print("A teng emas b ga")

`Natija:
`A teng b ga