teleren/devto huggingface dataset:
xv6 memory system
Tags: xv6, memory
Published: 2023-01-19 05:47:42

each process can occupy the mempages it needs in xv6.
## page management process
kalloc() function apply for a new page
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ezmohxy4flp5kauc0rpp.png)
kalloc consume kmem.freelist and kfree return resource back.
freelist is just a linked list with no other info

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p2r0zc3rtsh5quasko0l.png)
implement of memset in xv6. we only memeset at alloc part which means all the address has been initialized at the start stage in freelist. 

## memory initial part

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

all kmem has been alloced at init stage

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/naj2u9z893b79gbdrwcm.png)
Object Basics We Should Know Before Solving Coding Problems
Tags: javascript, beginners
Published: 2023-01-19 05:47:40

While solving LeetCode questions, I noticed I'd not fully understood Object and Array. So, I learned the fundamentals of Object again, and this blog is more like a study note for myself. But I hope it helps those of you who've got stuck with the same problems.

This article includes:
1. basics
2. for ... in
3. hasOwnProperty()
4. Object.keys(), Object.values(), Object.entries()
5. forEach


**Basics**
_Object is a collection of related data and/or functionality_ (MDN).

_Property_ means `key: value`, where key is a string and also called 'property name.'

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

We can check if a certain key exists in an object.

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

**for ... in**
So, by using `key in object` along with a for loop, we can get all the keys or values of an object.

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

**hasOwnProperty()**
Another way to check the existence of a key in an object is hasOwnProperty().
_property_ means _key_. It returns true or false

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

*It returns true even when the value is 'undefined' or 'null'.

It is useful for "hash table" questions.

**Object.keys()**
_This returns an array of a given object's own enumerable string-keyed property names_ (MDN).

It returns in the key's numeric order (ascending).
The returned keys are strings.

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

**Object.values()**
_This returns an array of a given object's own enumerable string-keyed property values_ (MDN).

It returns an array in the key's numeric order if the keys are numeric.

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

**Object.entries()**
_This returns an array of a given object's own enumerable string-keyed property key-value pairs_ (MDN).

It returns in the key's numeric order (ascending).

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

**forEach**
`array.forEach(callback)`

`forEach()` iterates over the array items, but if we use Object.keys(), Object.values(), or Object.entries, we can still get values because those return an array.

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

There're more Object methods, but the above would make it easier to solve coding problems and work with JSON.
Sitecore Development Services
Tags: sitecore, seo, supportandmaintenance, services
Published: 2023-01-19 05:36:55

Sitecore development services generally include the following:

**1. Customization:** Sitecore's platform is highly customizable, and development teams can use it to build unique websites and digital experiences tailored to the specific needs of a client. This can include creating custom modules and components, integrating with third-party systems, and building custom workflows and business logic.

**2. Integration:** Sitecore can be integrated with a variety of external systems, such as CRM, ERP, and analytics platforms. Development teams can create connectors and integrations to bring data from these systems into Sitecore and display it on the website or application.

**3. [Ongoing Maintenance and Support](https://sourceved.com/sitecore-maintenance-and-support/):** Once a website or application is built, it will require ongoing maintenance and support to ensure it remains up-to-date and secure. Sitecore development partners or in-house development teams can provide ongoing support and maintenance services to keep the website or application running smoothly.

**4. User Experience Design:** Sitecore development services also include UX design, which is the process of designing the overall look and feel of the website or application, as well as its usability and functionality. This can include creating wireframes, mockups, and user flows to guide the development process.

**5. [Sitecore Upgrade](https://sourceved.com/why-upgrade-to-sitecore-10/):** Sitecore regularly releases new versions of the platform and development teams can help to upgrade the website or application to the latest version, ensuring that the client takes advantage of the latest features and security updates.

**6. [SEO Optimization](https://sourceved.com/best-seo-practices-for-sitecore/):** Sitecore development teams can also work on SEO Optimization, which helps websites and applications to rank higher on search engines. This can include optimizing page titles, meta descriptions, and images, as well as creating and optimizing content.

**7. Performance Optimization:** Sitecore development teams can also work on Performance Optimization, which helps websites and applications to load faster and perform better. This can include minifying CSS and JS, using caching, and implementing image optimization techniques.

Sourceved Technologies Pvt Ltd is a leading [**Sitecore Development Company**](https://sourceved.com/sitecore-development/) with extensive experience in CMS-based Solution Development Services. [**Hire Sitecore Developers**](https://sourceved.com/hire-sitecore-developers/) highly skilled and experienced through Sourceved.
How To Get Multiple Checkbox Value In jQuery
Tags: javascript, checkbox, jquery, laravel
Published: 2023-01-19 05:30:00

In this article, we will see how to get multiple checkbox values in jquery. Here, we will learn to get the selected checkbox values using jquery. 

We will use the :checked selector for checkboxes and radio buttons. It can retrieve the selected value of the checkbox.

When clicking on the checkbox we will push the value in the array using the push() function.

So, let's see get selected checkbox values in jquery, multiple checkbox checked values in javascript, and how to get multiple checkbox values in jquery using an array.

Example:

```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>How To Get Multiple Checkbox Value In jQuery</title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
</head>
<body>
    <form>
        <h3>Select languages:</h3>
        <label><input type="checkbox" value="laravel" name="language"> Laravel </label>        
        <label><input type="checkbox" value="php" name="language"> PHP </label>        
        <label><input type="checkbox" value="jquery" name="language"> jQuery </label>
        <label><input type="checkbox" value="javascript" name="language"> JavaScript </label>
        <label><input type="checkbox" value="react" name="language"> React </label>
        <label><input type="checkbox" value="angular" name="language"> Angular </label>
        <label><input type="checkbox" value="python" name="language"> Python </label>
        <br>
        <button type="button">Get Selected Values</button>
    </form>
  <script>
      $(document).ready(function() {
          $("button").click(function(){
              var arr = [];
              $.each($("input[name='language']:checked"), function(){
                  arr.push($(this).val());
              });
              alert("Your selected languages are: " + arr.join(", "));
          });
      });
  </script>
</body>
</html>
```

Output:

![How To Get Multiple Checkbox Value In jQuery](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/huvtea6acp6ndtmmrcg6.png)

---

- **[Read Also: How To Create Image Slider Using jQuery](https://techsolutionstuff.com/post/how-to-create-image-slider-using-jquery)**
- **[Read Also: How To Create Parallax Scrolling Effect Using jQuery](https://techsolutionstuff.com/post/how-to-create-parallax-scrolling-effect-using-jquery)**
Live RTP Pragmatic Play Hari Ini
Published: 2023-01-19 05:29:43

[Rtppragmaticplay](https://rtppragmaticplay.top) Selamat bergabung di situs cek bocoran live rtp pragmatic play hari ini paling gacor. [Slotonlinepragmatic](https://slotonlinepragmaticplay.page) gacor mudah menang OSB369
Security Aspects for cloud adoption
Tags: cloud, security, migration, aws
Published: 2023-01-19 05:19:39

Hello Everyone, I am going to start a new series of blogs where I am going to create awareness about the various security issues/concerns/challenges that are being faced or security is being neglected during the cloud adoption process.
These days inspite of lot of awareness or attacks on various organizations, still sometimes security is being neglected during the process of cloud adoption and this seems to be the biggest mistake that companies do or due to budget constraints they delay these security activities and decrease the priority towards security. But overall this is one of the biggest mistakes that companies do to neglect the security aspects or decrease the security priority during cloud adoption phases.
This is very important that security should be considered before adopting the cloud and also after moving to the cloud to avoid any issues related that can be a roadblock or major risk in cloud adoption.
In major cases security is neglected due to budget issues, but I have seen many cases when they think about including the security at later stage then the expenses grow to large extent due to other issues or concerns. So its recommended the from day one, security should be kept at the same priority as other activities to avoid many issues related to regulations, compliance etc.
In this series, I will present the content what all security aspects should be considered during initial days of cloud adoption, what all should be considered before selecting the cloud service provider, what all things should be kept in mind about your existing security framework and based on all these consideration, creating a list of steps based on which target cloud service provider should be selected.
I will keep these blogs short to keep them interesting.

Thanks for reading the blog, I hope this will help you increasing your knowledge.
59. Spiral Matrix II
Tags: java, algorithms, 100daysofcode, leetcode
Published: 2023-01-19 05:14:04

**Problem Statement:**

Given a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order.

 

**Example 1:**
**Input:** n = 3
**Output:** [[1,2,3],[8,9,4],[7,6,5]]

**Example 2:**
**Input:** n = 1
**Output: **[[1]]
 

**Constraints:**

- 1 <= n <= 20

**Solution:**

**Algorithm:**
1. Create a matrix of size n x n.
2. Initialize left = 0, right = n - 1, top = 0, bottom = n - 1, num = 1
3. Iterate while left <= right and top <= bottom.
    a) Iterate from left to right and fill the top row with num.
    b) Increment top.
    c) Iterate from top to bottom and fill the right column with num.
    d) Decrement right.
    e) Iterate from right to left and fill the bottom row with num.
    f) Decrement bottom.
    g) Iterate from bottom to top and fill the left column with num.
    h) Increment left.
4. Return matrix.

**Code:**
```
public class Solution {
    public int[][] generateMatrix(int n){
        int[][] matrix = new int[n][n];
        int left = 0;
        int right = n - 1;
        int top = 0;
        int bottom = n - 1;
        int num = 1;
        while(left <= right && top <= bottom){
            for(int i = left; i <= right; i++){
                matrix[top][i] = num++;
            }
            top++;
            for(int i = top; i <= bottom; i++){
                matrix[i][right] = num++;
            }
            right--;
            for(int i = right; i >= left; i--){
                matrix[bottom][i] = num++;
            }
            bottom--;
            for(int i = bottom; i >= top; i--){
                matrix[i][left] = num++;
            }
            left++;
        }
    }
}
```

**Time Complexity:**
O(N^2)

**Space Complexity:**
O(N^2)
Getting Started with Javascript
Tags: javascript
Published: 2023-03-03 16:35:00

---
title: Getting Started with Javascript
published: true
date: 2023-01-05 10:00:00 UTC
tags: JavaScript
canonical_url: https://www.90-10.dev/js-getting-started/
---

## JavaScript in HTML

Here are a couple of different way to run JavaScript directly in your browser.

### HTML header

```
<html>
  <head>
    <title>Webpage</title>
    <script type="text/javascript">
      console.log("here");
    </script>
  </head>
  <body></body>
</html>
```

### HTML body

```
<html>
  <head>
    <title>Webpage</title>
  </head>
  <body>
    <script type="text/javascript">
      console.log("here");
    </script>
  </body>
</html>
```

### External File

Given a file named app.js, to include it in an HTML file named index.html:

```
<html>
  <head>
    <title>Webpage</title>
    <script src="app.js"></script>
  </head>
  <body></body>
</html>

```

## ES6 - import & export

In the example below, we'll use 2 JavaScript files:

```
export function House() { 
  this.width = 100;
  this.length = 200;
}
```

_my-script.js_

```
function paint() { 
  ...
}
function clean() { 
  ...
}
export { paint, clean }
```

_second-script.js_

To include them both in an HTML file:

```
<html>
  <head>
    <title>Webpage</title>
    <script type="module">
      import { House } from "./my-script.js";
      import { paint, clean } from "./second-script.js";
      let house = new House();
    </script>
  </head>
  <body></body>
</html>
```

## ES10 - dynamic import with async Early days Google Chrome only

```
export const helloEvent = () => {
  console.log('Hello World');
};
```

_my-script.js_

```
<html>
  <head>
    <title>Webpage</title>
    <script type="text/javascript">
      window.onload = function() {
        document.getElementById('helloButton').addEventListener("click", async() => {
          const module = await import('./myscript.js');
          module.helloEvent();
        });
      }
    </script>
  </head>
  <body></body>
</html>
```

_index.html_
Encrypting files with #Vim
Tags: vim, encryption, howto
Published: 2023-01-19 05:11:33

One of the easiest way to encrypt a file, is to use Vim. Here are two ways on how to set it up, and use it.

- - -

### Setup

First, it could be good to check if your version actually is built with crypt support:

```bash
$ vim --version | grep +crypt
+cryptv            +lispindent        +quickfix          +wildmenu
```
And then you can check if there's a default value set with:

```vim
:set cm?
```

&nbsp;

There are 3 cryptmethods:

- VimCrypt~01: `zip`,
- VimCrypt~02: `blowfish`,
- VimCrypt~03: `blowfish2`.

You should use `blowfish2`, which is the strongest one.

So, to setup Vim for encryption, all you need is to set the `cryptmethod (cm)`. In your `.vimrc`, you add:

```vim
" cryptmethod
set cm=blowfish2
```

To use it… Just pass the `-x` option when creating the file. You'll be asked to enter a password, twice - and then you're in.

```bash
$ vim -x <file>
```

- - -

### Using a separate file

To take it another step, you can use a separate file to work with. In that way you can keep your normal settings in `.vimrc` - which may include all kinds of viminfo, swap files, backups, etc.

That's maybe not what you want when working with encrypted files. So, to keep the tracks down - create a new file: `~/.vim/vimencrypt`, and then add this to the file:
 
 ```vim
"
" ~/.vim/vimencrypt
"
"
" Usage:
"   $ vim -u ~/.vim/vimencrypt -x <file>
"
" Or add an alias:
"   alias vimx='vim -u ~/.vim/vimencrypt -x '
"
"   $ vimx <file>
"

source ~/.vim/vimrc

set cm=blowfish2

set viminfo=
set nobackup
set noswapfile
set nowritebackup
 ```

<small>_You may need to adjust the path to where **your** `.vimrc` file is._</small>

&nbsp;
 
In that way you encrypt your files without using: viminfo, no backup file, no swap, etc. And it sources your standard `.vimrc`, so you will have your normal environment.

- - -
 
### Usage:
 
```bash
$ vim -u ~/.vim/vimencrypt -x <file>
```

&nbsp;

If you don't like the xtra typing… Add an alias:

```bash
alias vimx='vim -u ~/.vim/vimencrypt -x '

# and use it with:
$ vimx <file>

# Example
$ vimx testfile.txt

#  Result
$ cat testfile.txt
VimCrypt~03!���4����k
����u"E>*�1�~vh���ΊIA(7��@Y�Qj�9l��O
```

&nbsp;

To read more about it, use the help:

```vim
:h cm

" or if you want it in a seaparate tab
:tab h cm
```

- - -

_// Happy hacking…_ :+1:

· Eric
HYPERBEAM TOOL
Tags: webdev, javascript, beginners, programming
Published: 2023-01-19 05:08:37


**About Tool:**
Embed Virtual Computers in your web app Open any third-party website or application, synchronize audio and video flawlessly among multiple participants, and add multi-user control with just a few lines of code.
**Source code:**
https://github.com/MafiaOnespot/hyperbeam
**Tool link:**
https://hyperbeam.com/
🌌 Considerations for globalising the web application
Tags: globalisation, web, angular, react
Published: 2023-01-19 05:00:29

---
title: 🌌 Considerations for globalising the web application
published: true
description: 
tags: globalisation, web, angular, react
series: Globalisation
---


- 💫 **Language support**: Make sure your web-app can display content in multiple languages.
- ⏳ **Time zones and date formats**: Ensure that the web-app can handle different time zones and date formats.
- 💲 **Currency**: Make sure your web-app can handle different currencies, and that prices are displayed correctly.
- 🔢 **Localization**: Consider hiring professional translators to translate your content into different languages.
- 🤌 **Cultural differences**: Be aware of cultural differences and try to design your web-app in a way that is sensitive to these differences.
- 🏴󠁳󠁥󠁯󠁿 **SEO**: Optimize your web-app for search engines in different countries and languages.
- 🧪 **Testing**: Test your web-app in different languages and countries to make sure it works correctly.
- ⚖️ **Legal compliance**: Make sure your web-app complies with the laws and regulations of the countries it is being used in.
- ✨ **Analytics**: track the location of your users and their interaction with the web-app to get better understanding and improve user experience.
- 🚀 **Performance**: Ensure that your web-app loads quickly and efficiently for users around the world.





**Note**: Will see the detailed example in the upcoming post
3. Do use screencasts
Tags: itdepartment, screencasting, bugreports, featurerequests
Published: 2023-01-19 04:36:57

When creating a bug report or feature request, using a screencast is a powerful tool that can save time and improve communication.

### Here are a few reasons why you should consider using a screencast when submitting bug reports or feature requests:

- **Speed:** Often, it's much faster to shoot a 2-minute video than to explain what you need in text. This is especially true when dealing with complex issues or user interfaces.

- **Precision:** With a screencast, you can show exactly what you want, highlighting specific elements or actions on the screen. This eliminates any confusion or ambiguity that can arise from written descriptions.
- **Context:** A screencast also allows you to show how you got to the error, providing valuable context for developers trying to reproduce and fix the issue. This can be particularly helpful when dealing with issues that are hard to reproduce.

## Conclusion:
Screencasts can be a valuable tool when reporting bugs or requesting features. They allow you to communicate effectively and efficiently, helping developers understand and address the issue more quickly. If you are unfamiliar with screencasting software, free and paid options such as Quicktime, Snagit, and my favorite, Loom, is available.


> **Part of the series: 52 dos and don’ts on how to get things done by the IT department**

> I've created a list of 52 dos and don’ts that can make your work with IT much more productive and enjoyable!

> These dos and don’ts are not about managing an IT department, but about how you can get things done by the IT department.

> A new dos and don’ts every week in 2023
974. Subarray Sums Divisible by K
Tags: java, algorithms, 100daysofcode, leetcode
Published: 2023-01-19 04:16:40

**Problem Statement:**
Given an integer array nums and an integer k, return the number of non-empty subarrays that have a sum divisible by k.

A subarray is a contiguous part of an array.

**Example 1:**

**Input:** nums = [4,5,0,-2,-3,1], k = 5
**Output:** 7
**Explanation:** There are 7 subarrays with a sum divisible by k = 5:
[4, 5, 0, -2, -3, 1], [5], [5, 0], [5, 0, -2, -3], [0], [0, -2, -3], [-2, -3]

**Example 2:**

**Input:** nums = [5], k = 9
**Output:** 0
 

**Constraints:**

- 1 <= nums.length <= 3 * 104
- -104 <= nums[i] <= 104
- 2 <= k <= 104

**Solution:**

**Algorithm:**
1. Create a count array of size k and initialize all elements as 0.
2. Initialize sum of elements as 0 and count of subarrays as 0.
3. Iterate through the array and for every element arr[i], do following.
    a) Increment sum by arr[i].
    b) If k is non-zero, then update sum as sum = sum % k.
    c) Increment count of current sum.
    d) Add count[sub_sum] to the result.
    e) Increment count[sub_sum] by 1.
4. Return result.

**Code:**
```
public class Solution {
    public int subarrayDivByK(int[] nums, int k){
        int[] count = new int[k];
        count[0] = 1;
        int sum = 0;
        int ans = 0;
        for(int i = 0; i < nums.length; i++){
            sum += nums[i];
            int mod = (sum % k + k) % k;
            ans += count[mod];
            count[mod]++;
        }
        return ans;
    }
    
}
```
**Time Complexity:**
O(N)
**Space Complexity:**
O(K)
12 JS Conferences in 2023
Tags: javascript, conferences, webdev, programming
Published: 2023-01-19 04:14:58


![DeveloperWeek homepage](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/itbfj8p6u7m349v4wsyk.PNG)

This collection of Ten Amazing Conferences for web developers and programmers are from [James Quick's video: 10 AMAZING Conferences for JavaScript Developers in 2023!](https://youtu.be/rk2aD1aF9GM). Do you "want to get better as a JavaScript Developer and professional? Here are 10 conferences that you should consider in 2023."

1. CodeMash - https://dev.events/conferences/code-mash-sandusky-0-2023
2. That Conference - https://that.us/
3. NDC London - https://ndclondon.com/
4. JSWORLD - https://dev.events/conferences/jsworld-conference-amsterdam-1-2023 
5. RenderATL - https://www.renderatl.com/
6. JSNation - https://jsnation.com/
7. React Summit - https://reactsummit.com/
8. KCDC - https://www.kcdc.info/
9. MagnoliaJS - https://www.magnoliajs.com/
10. All Things Open - https://www.allthingsopen.org/
11. Jamstack Conf - https://jamstack.org/conf/

The twelfth is the one that I am currently registered though virtually. It is DeverloperWeek (the cover photo of this post is a screenshot of their homepage) - https://www.developerweek.com/

I am hoping to learn a lot from this conference. 

Enjoy!