teleren/devto huggingface dataset:
Contribute to OpenSource in this Hacktoberfest 2022
Tags: hacktoberfest, datascience, analytics, opensource
Published: 2022-10-07 05:21:58

Finally, Hacktoberfest 2022 has here, and this year I have enrolled myself as a contributor and a maintainer. To all aspiring data scientists and analysts who are just getting started: Your best opportunity to support the open source movement is right now.

**I have built a repository that compiles various datasets from domains and fields from numerous websites. I also included a recommendation analysis question, so you can choose that one if you're a novice and unsure of what kind of analysis I can perform.**

To demonstrate your abilities, you can utilize any analysis tool (such as Jupyter Notebook, PowerBi, Excel, etc.). Don't forget to submit a pull request and to address the issues as well.

I've mentioned the repository links for Hacktoberfest in the end. Please text me if you have any questions about the suggestion for analysis or Hacktoberfest.

[Repository Link](https://github.com/Nitin-Diwakar/Data-Science-Data-Analystics-Contribution---Hacktoberfest-2022.git).
My second First App
Tags: rust, python
Published: 2022-10-07 04:56:59

10 month ago I wrote my first app in Rust – [Tannenbaum](https://github.com/antonovmike/tannenbaum_rust). I decided to make something by myself just for practice. Now I am learning Python and first app I made is [Tannenbaum](https://github.com/antonovmike/tannenbaum_python) themselves. If you ask me what is easier Rust or Python, I wont answer. Because Rust is my first language with zero IT background. Everything was extremely difficult (today it’s just difficult). 10 month later this kind of code doesn’t look tough, I made it in a few minutes. Other issues I have to solve today: web frameworks, docker, PostgreSQL, Rust async runtime. Well… Let’s rock! Make code, not war!

```Rust
use std::thread;
use std::time::Duration;

fn main() { tannenbaum(7); }

fn tannenbaum(x: i32) {
	let mut top = 0;
	let mut i = 1;

	while top < x/2 {
		for _empty_space in 0..2     { print!(" "); }
		top += 1
	}
	if x%2 == 1 {print!(" ")}
	println!("A");

	while i <= x {
		for _empty_space in 0..(x-i) { print!(" ");	}
		for _left_side   in 0..i     { print!("L"); }
		for _middle      in i..i+1   { print!("M"); }
		for _right_side  in 0..i     { print!("R"); }
		println!();
		thread::sleep(Duration::from_millis(120));
		i += 1
	}
	
	for _stem in 0..(x-1) { print!(" "); }
	println!("ШШШ");
}
```

```Python
x = 8
y = 0
top = 0
i = 1
print(" " * x, end = ""), print("A")
while y < x:
    if x%2 == 1:
        print("|")
        print("A")
        print()

    while i <= x:
        for empty_space in range(x-i):
            print(" ", end = "")
        for left_side in range(i):
            print("L", end = "")
        for middle in range(i, i+1):
            print("M", end = "")
        for right_side in range(i):
            print("R", end = "")
        print()
        i= i + 1

    y = y + 1
print(" " * (x-1), end = ""), print("ШШШ")
```
732. Leetcode Solution in Python3
Tags: python
Published: 2022-10-07 04:03:01

```python3
from sortedcontainers import SortedDict


class MyCalendarThree:
  def __init__(self):
    self.timeline = SortedDict()

  def book(self, start: int, end: int) -> int:
    self.timeline[start] = self.timeline.get(start, 0) + 1
    self.timeline[end] = self.timeline.get(end, 0) - 1

    ans = 0
    activeEvents = 0

    for count in self.timeline.values():
      activeEvents += count
      ans = max(ans, activeEvents)

    return ans


# Your MyCalendarThree object will be instantiated and called as such:
# obj = MyCalendarThree()
# param_1 = obj.book(start,end)
```


#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/my-calendar-iii/
2000s flashback: a web API service...
Tags: 2000s, web, api, service
Published: 2022-10-07 03:43:48

*The years were 2001-2002 and we were returning HTTP requests' data using “our own text format” 😂 😂*

Going through my old files, I happened to find this diagram on a larger project which I was employed as a developer back in late 2001 early 2002:

![040-diagram.jpg](https://behainguyen.files.wordpress.com/2022/10/040-diagram.jpg)

The diagram was by my project manager. Other team members and I were assigned to the <span style="color:blue;">blue box</span>: 

<ul>
<li style="margin-top:5px;"> For web clients, we returned complete HTML pages. </li>
<li style="margin-top:10px;"> For Windows executable clients, we returned only data. So the web server application was also kind of providing <em>Web API service</em>. </li>
</ul>

Back then, *XML* was only a few years old... The project manager decided not to use it: too heavy with all the tags, bandwidth and speed were factors in this decision. *JSON* has just come out, and we were not yet aware of it... I don't recall it was ever mentioned in any of the project meetings.

The project manager decided to go with “our own text format”: we packaged data up on the server-side using this format, returned it via *HTTPS*, and at the client-side, the data was parsed into the *Borland VCL client dataset* ready for further manipulation.

It was fun, but time-consuming, column values boundaries did pose some difficulties especially with blob values. 2022 -- we just use *JSON* 😝

I have forgotten about this project... finding this diagram brings back some memories, I felt the urge to write this post.

Back then, online gaming was still a new industry, there were new legislations just put in place, we were not required to go through any security check, but we were issued with a <em>special employee licence</em>, there were certain gambling activities that we were not allowed to participate while working in the industry:

![040-employee-card.jpg](https://behainguyen.files.wordpress.com/2022/10/040-employee-card.jpg)

Over the years... my hair decided to go... Painful, but what can I do 😾. Thank you for reading. And stay safe.
Python generated jokes 😂🤣
Tags: python, packages, jokes
Published: 2022-10-07 03:39:21

The Alexa APIs for Python consists of python classes that represent the request and response JSON of Alexa services.

The ASK Software Development Kits (SDKs) include development tools and libraries that give you access to Alexa features. These SDKs are available in Node. js, Java, and Python. Alternatively, you can develop your skill in any language and accept requests from and send responses to the Alexa service.

**Pyjokes Library**

Pyjokes is a python library for one line jokes for programmers (jokes as a service). You can get funny one-liner, mostly related to programming.

Install and Importing Library

_#install on command line _


```
pip install pyjokes
```

#import in python idle/editor 
import pyjokes


1) 

```
get_joke()
```

It only returns one joke at a time. It is generated randomly.
Parameters - It has two parameters language and category.
Return Type - It returns string type (str).

```
joke1 = pyjokes.get_joke (language='en', category= 'all') print (joke1)
#output: any random joke
```

2) 

```
get_jokes()
```

It returns a list of jokes.
Parameter- The parameters are the same as above- language and category.
Return type- *It returns a list.

```
jokes= pyjokes.get_jokes (language='en', category=
'neutral')
for i in range(5):
print (i+1, ".", jokes[i])
#output: list of jokes
```

**Parameter: Category**

‌For geeky jokes -'neutral' (It is chosen by default)
• For Chris Norris Jokes - 'chuck'.
• If you want all type of jokes - 'all'
String Compression
Tags: javascript, leetcode
Published: 2022-10-07 03:06:21


Given an array of characters chars, compress it using the following algorithm:

Begin with an empty string s. For each group of consecutive repeating characters in chars:

1) If the group's length is 1, append the character to s.
2) Otherwise, append the character followed by the group's length.

The compressed string s should not be returned separately, but instead, be stored in the input character array chars. Note that group lengths that are 10 or longer will be split into multiple characters in chars.

After you are done modifying the input array, return the new length of the array. [means you have to modify the same array]

You must write an algorithm that uses only constant extra space.


Example 1:

Input: chars = ["a","a","b","b","c","c","c"]
Output: Return 6, and the first 6 characters of the input array should be: ["a","2","b","2","c","3"]
Explanation: The groups are "aa", "bb", and "ccc". This compresses to "a2b2c3".

```js

var compress = function (char) {
  let index = 0;
  let start = 0;
  let end = 0;
  let count = 0;

  while (char.length > end) {
    while (char[start] === char[end]) {
      count++;
      end++;
    }
    char[index] = char[start];
    index++;
    if (count > 1) {
      let toStr = count?.toString();
      for (let i = 0; i < toStr?.length; i++) {
        char[index] = toStr[i];
        index++;
      }
    }
    count = 0;
    start = end;
  }
  return index;
};
console.log(compress(["a", "a", "b", "b", "c", "c", "c"]));
console.log(compress(["a"]));
console.log(
  compress(["a", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b"])
);


```
Adding config parsing to a ssg
Published: 2022-10-07 03:04:52

This week, I was tasked with adding config file parsing to another student's ssg. I chose to add this feature to [Oscar's](https://github.com/LostButton) [my-button-ssg](https://github.com/LostButton/my-button-ssg). The config file would contain the available options for the ssg in JSON format. I created an [issue](https://github.com/LostButton/my-button-ssg/issues/11) and began implementing the new feature.

Since the project was written in JavaScript, I found it quite easy to add config parsing to it. I read the contents of the config file and parsed them into a JSON object. After this, it was pretty simple to read the provided options from the JSON object, perform some null checking, and generate the html file(s). So, I committed my changes and created a [pull request](https://github.com/LostButton/my-button-ssg/pull/12) and asked the author for a review. Though with how smoothly the coding part went, I had completely forgotten to update the documentation. Once that was updated, my PR was merged into the main branch.

My rost_gen ssg project also received a [PR](https://github.com/Eakam1007/rost_gen/pull/38) about adding config file parsing. After reviewing the changes, I decided to test it locally by setting up a tracking branch using git. This was fairly simple to do, and I can't believe I did not try this before. Since I have not added any automated tests, I previously did this by looking at the code. However, as more features get added, it is not possible to check if the code will work as you think. By using a local tracking branch, I was able to easily test the changes and find some formatting issues by using VS code's auto formatting. I requested the author to resolve these and merged the PR by merging the branch into the master branch.

Overall, I found the process to be fairly straightforward. While I like the fact that I can close a PR by merging the branch locally and pushing the changes, I still prefer to use the GitHub UI as I find it easier to navigate.
How to get class name and module name in Ruby
Published: 2022-10-07 02:59:54

## How to get the class name

To get the class name:

```ruby
class User
  def call = puts self.class.name
end
User.new.call #=> User
```

This will work even if the name is namespace inside a module: 

```ruby
module Authenticated
  class Visitor
    def call = puts self.class.name
  end
end
Authenticated::Visitor.new.call #=> Authenticated::Visitor
```

## How to get the module name

Will not work if you call `class.name`
```ruby
module Authenticated
  def self.call = puts self.class.name
end
Authenticated.call # will return Module!!
```

But Module defines an accessor named `name`
```ruby
module Visitors
  def self.call = puts self.name
end
Visitors.call # will return Visitors
```

Yes there is a constant `name` defined on a Module.

You can of course redefine that if you want:

```ruby
module Guest
  def self.name = "Another name"
  def self.call = puts self.name
end
Guest.call # will return "Another name"
```

## Bonus: How to get the current method name

Use `__method__` for that: 

```ruby
class Admin
  def call(...) = puts __method__
end
Admin.new.call # "call"
```
Could not access to the React Bootcamp course (already paid)
Published: 2022-10-07 02:38:57

Hi Everyone,

I was enrolled in the course React Bootcamp from Reed Barger as paid for the course on 01-Oct-2022. Link: https://reactbootcamp.com/

My problem is i did not receive any confirmation email and could not access the course. I was trying to contact to Reed by response email from the React Bootcamp but no responses.

I checked my bank account and see the transaction is still pending.

Anyone can assist me with the incident.
**_#Reed Barger:_** If you have read the post, please support me and contact me via email: thangtruong1808@gmail.com

Best regards,
Thang Truong
open source no-signup online text editor
Tags: serverless, productivity, webdev, opensource
Published: 2022-10-07 02:34:42

I found it hard to find an easy way to share a doc with a friend collaboration.

I try using vercel, MongoDB, and jquery. The simplest way to build a free product.


![no-signup online text collaboration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h8hsrkosy55x7kqc3b04.jpg)


No Signup is required, use a random id as a secret and every doc has a share code change every day.


![doc with unique editable url](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lijpp2h9nvgb4scd4lal.jpg)


**Try it here. https://doc.op52.com
Source code here: https://github.com/tans/online-editor.git**

I want to know how to keep user content secret because I can read everybody's writing directly in MongoDB. 

Thank's to vercel and mongo, I could build software so easily, with no server fee, and no maintenance work.
LeetCode's Palindrome Number Solution - Java
Tags: leetcode, tutorial, algorithms, java
Published: 2022-10-07 02:31:45

# 9. Palindrome Number

## Intuition

I began by mentally walking through the given test cases and recording the steps I took to solve the problems. I used this to create some pseudocode that modeled my thinking. Following that, I translated my pseudocode into Java. I was confident that my program worked after some thorough testing in addition to the auto tests.

## Approach

To allow for string indexing and length, I first converted the int to a string. Then I looped through the string until I reached the halfway point, comparing the numbers on the left and right sides. If they weren't the same, I exited the program immediately by returning false. At the end of the program, if the numbers on the left and right sides were the same, I returned true, indicating that the number entered by the user is a palindrome.

## Complexity

- Time complexity:
O(n)

## Code

GitHub: <https://github.com/Verisimilitude11/LeetCode-Problems/tree/main/9.%20Palindrome%20Number>

```java
class Solution {
    public static boolean isPalindrome(int x) {
        String num = Integer.toString(x);
        for (int i = 0; i < num.length() / 2; i++) {
            char rightChar = num.charAt(num.length() - i - 1);
            char leftChar = (num.charAt(i));
            if (!(leftChar == rightChar)) {
                return false;
            }
        }

        return true;
    }
}
```

Follow me on Medium: https://medium.com/@VerisimilitudeX/leetcodes-palindrome-number-solution-java-13466d472c8e
My first usage of git remotes!
Tags: beginners, opensource, git, github
Published: 2022-10-07 02:08:28

## Hello everyone!

Today, I worked on adding a new feature for my friend's command-line tool. I was implementing the support for config file. So, the users could specify all of their SSG options in a JSON formatted configuration file instead of having to pass them all as command-line arguments.

As usual, I opened [an issue](https://github.com/rokaicker/StaticSiteGenerator/issues/29) with the feature's description and forked his repo to work on the copy, not the original. 

I opened a [Draft Pull Request](https://github.com/rokaicker/StaticSiteGenerator/pull/30) at first as I was still making the changes, but when I completed all the updates I changed the state to "Ready for review". I had to explain my work as the author had a few comments but at the end everything was accepted. 

I also received [an issue](https://github.com/gulyapulya/SSGulnur/issues/10) on my repo with my SSG tool. I labeled it as an enhancement as it was not a necessary part but good to have. I checked the [PR](https://github.com/gulyapulya/SSGulnur/pull/11) and realized that there was a need for a few changes by testing the work. For that, I added them as a remote to my local repo, fetched and set a tracking branch. I contacted the author of PR through Slack and explained all necessary updates. I also summarized them in the PR itself as things to do, so I remember what to check for when everything is ready. 

Generally, if the PR is about a small change viewing the "files changed" tab is enough. I can go line by line and figure out if everything is good. However, when it is something big as a new feature, testing locally is required. That is when remotes come handy. 

So far - so good!
LeetCode's Two Sum Solution - Java
Tags: leetcode, java, algorithms, tutorial
Published: 2022-10-07 01:26:53

# Two Sum

## Intuition

I first considered how I would go about searching for two numbers that equaled the target number. My initial thought was to loop through the list, looking for numbers 'n-1' and 'n+1' away from the current number. However, I soon realized that the two numbers that add up to target could be anywhere on the list.

## Approach

I first loop through all of the numbers in the list that was entered, and then I loop through the list again, beginning with `i + 1'. This is because if you start at 0, it will look at the same element twice, and if that number added to itself is target, it will be counted twice. If I come across two numbers that are equal to target, I add them to a list and return them. Otherwise, I return an empty list.

## Complexity

- Time complexity:
O(n^2)

## Code

GitHub: <https://github.com/Verisimilitude11/LeetCode-Problems/tree/main/1.%20Two%20Sum>

```java
class Solution {
    public int[] twoSum(int[] nums, int target) {
        for (int i = 0; i < nums.length; i++) {
            int num1 = nums[i];
            for (int j = i + 1; j < nums.length; j++) {
                int num2 = nums[j];
                if (num1 + num2 == target) {
                    int[] output = {i, j};
                    return output;
                }
            }
        }
        int[] output = {};
        return output;
    }
}
```

Follow me on Medium: https://medium.com/@VerisimilitudeX/leetcodes-two-sum-solution-java-579179e1ac12
Hacktoberfest - DNAnalyzer
Tags: hacktoberfest, dnanalyzer, opensource, github
Published: 2022-10-07 01:24:35

New to open source and Hacktoberfest '22?
Looking for eligible repositories which you can contribute to? Meet DNAnalyzer.

**DNAnalyzer**
> A highly efficient, powerful, and feature-rich algorithm for analyzing DNA sequences

**Repository:** https://github.com/Verisimilitude11/DNAnalyzer

The current algorithm just finished thorough testing with DNA samples from a variety of species. DNAnalyzer identifies proteins, amino acids, start and stop codons, high coverage regions, regions susceptible to neurodevelopment disorders, transcription factors, and regulatory elements in DNA strings. Researchers are working to extract valuable information from such software to better understand human health and disease. 

**Ways to Help**
I'd be grateful for any help, whether in testing, science, code, formatting, accessibility, or anything else. If you know __**Java or a similar language**__, your assistance with adding new features would be greatly appreciated (including a CLI and GUI). Similarly, if you are more **__familiar with biology__**, I (and the rest of the team) would appreciate feature requests and bug reports. It even has scopes for those who want to contribute to documentation / no code. You can open issues regarding features or bug reports, and I will add `hacktoberfest` label if appropriate. If you want to take over any issues, just comment there and I'll assign you with the task. In any case, even if you aren't interested in contributing, please visit the repository and **__give it a star__**. The developer team is excited to see the flow of pull requests in the coming weeks!

If you're interested in contributing, please do make sure to connect with me on LinkedIn: https://www.linkedin.com/in/piyush-acharya/
ASM.JS & SIMD.JS - Awesome JavaScript performance
Tags: javascript, architecture, webdev, algorithms
Published: 2022-10-07 00:49:46

Hello,

Here we are again, and within this blog post, we will be talking about some tricks that will level up (or maybe just level-down your JS into a low-level syntax) your code into something beautifully ugly but with huge performance improvements...

So why do someone could have the need to increase by 2x up to 6x and more the performance of his own code in JavaScript? Well, Javascript let you declare dynamics type of variables, so when you compare or add "1" within a "for" statement it doesn't know (the just in time compiler) which type of data is to add, very dumb things but nevertheless logical.

Meanwhile we will see later on how to rig the type of data to mostly unsigned integer, and integer (meaning entire number without floating decimals) within "for", huh ok let's see it now!

```js

var fast_array = Uint8Array.of(1, 128, 255, 51, 128, 128, 128, 255) // Let's imagine we have RGBA, RGBA, ...
var length = fast_array.length;
for(var i = 0; (i|0) < (length|0); i = (i + 4 | 0) >>> 0) { // "|0" will round the number and force it to be an integer while ">>>0" will force it to be positive
    fast_array[i>>2] = 0; // "x >> 2" will divide the number by 4, it operate a shift of bits so we're editing "R" within RGBA
}

// Inspired from: https://mbebenita.github.io/LLJS/
```

Just follow the link, really faster is this code, more than that, it ensure using a typed array that memory is used with less garbage collecting operation from the javascript engine and also it to be faster since they have !!warning!! fixed length...

THIS WAS HOW WE CAN WRITE LOW-LEVEL JS! And yes, http://asmjs.org/ is how it works when it compile C code into Javascript using emscripten but you can write some similar code independently from it! It uses the same "hack".

---

SIMD.js is a bit more complicated, we had to use a similar structure for computing color within the pixel art editor into our interface (demo at https://pixa.pics/), and it (https://github.com/tc39/ecmascript_simd) operate on "rows" of data just like that:


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

So we can assume that "operation will get into a kind of supercache making it being as fast to do 1 operation as to do four of them! (This is what they said)


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


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

LOOKS NEAT!

It was in fact introduced with the language "Dart" from Google... and it was supported by the Intel team.

---

Conclusion:

At building our software, the week we discovered those two library, our code then was some kind of 300% faster, really, so let's share and like, awesome devs could need it^^.

---

Thanks for reading.