teleren/devto huggingface dataset:
DEV's Sorting Hat: What's Your Developer's Hogwart "'House"?
Tags: discuss, watercooler
Published: 2023-08-15 07:00:00

_We're going back to coding school with Nostalgia Bytes this week! Don't forget your TI calculators, Trapper Keepers, Lisa Frank folders, and USB drives. Each decade has its own story to tell. So get ready to relive the past and share your nostalgic memories with fellow developers!_

🧠 If you could enroll in a developer's Hogwarts, which programming language would be your chosen 'House,' and why?

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}
The Kinesis Analytics & Apache Flink Playlist
Tags: kinesis, flink, aws, serverless
Published: 2023-08-15 06:44:32

I've spent a few years working with Apache Flink, more recently on Kinesis Analytics, and here is my attempt at documenting the lessons learned and example code for some of the usecases I encountered.

This post is going to be a living document or playlist of sorts that I hope to keep updating with links to all the relevant content I create for Apache Flink & Kinesis Analytics.

[This Github repository](https://github.com/karthiks3000/kinesis-analytics-example) is going to host the example Kinesis Analytics application (Java 11) that is discussed in the content posted below.

To kick things off, here is my first attempt at a video tutorial explaining how to build a stream processing architecture with Kinesis Data Stream, Kinesis Analytics & S3.

**Batch & Stream Processing Architecture - Part 1**
{% embed https://www.youtube.com/embed/s6iQiddfELA %}

**Batch & Stream Processing Architecture - Part 2**
Coming soon..
How to reduce Large FIFO Length of camera module?
Published: 2023-08-15 06:38:54

My code ensures that an image is taken every six seconds and uploads it to an SD card. It is able to successfully take a picture and upload it to the SD card but the images don't fully load. All my images cap at 256 KB. Is there a way to increase this cap or lower the quality and resolution of the image. I have tried to change the buffer to a higher amount like 16777216 but that still does not work!

Seriel Monitor
SPI interface OK.
SD Card detected.
OV2640 detected.
start Capture
Capture Done.
The fifo length is :8388607
Image save OK.
My code ensures that an image is taken every six seconds and uploads it to an SD card. It is able to successfully take a picture and upload it to the SD card but the images don't fully load. All my images cap at 256 KB. Is there a way to increase this cap or lower the quality and resolution of the image. I have tried to change the buffer to a higher amount like 16777216 but that still does not work!

Seriel Monitor
SPI interface OK.
SD Card detected.
OV2640 detected.
start Capture
Capture Done.
The fifo length is :8388607 (Which is around 8 MB)
Image save OK.




Please view my code at:
[this raw cloudinary link](https://res.cloudinary.com/js-create/raw/upload/v1692081493/message_a32xjk.txt)
Abysmal Shorthand Syntax
Tags: ruby
Published: 2023-08-15 06:24:16

I'm ready to conclude about the Ruby 3.1 [hash shorthand syntax](https://bugs.ruby-lang.org/issues/14579).

The new syntax allows you to write more concise code where you pass-on local variables to methods or hashes.

```diff
@@ -1,3 +1,3 @@
 def log_json(level:, message:)
-  Logger.log({ level: level, message: message }.to_json)
+  Logger.log({ level:, message: }.to_json)
 end
```

I think this is useful, but only in rare cases, for example if there is a lot of redirection.

But there is one really big issue with the new syntax:
_rubocop_ choose the wrong default ([`EnforcedShorthandSyntax: always`](https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/HashSyntax)).

The following reasoning would speak for the much better default setting `EnforcedShorthandSyntax: either`.

## 1. It's hard to spot

For example try to distinguish between the following two statements which mean something completely different.

```rb
expect(RealtySnapshot.all).to all(have_attributes(realty:))
expect(RealtySnapshot.all).to all(have_attributes(:realty))
```

## 2. It's not good prose

```rb
build(:realty, address:)
```

It indicates to my mind that `address` is empty. My mind replaces the non-existent anything after the colon with `nil`. 

## 3. Maintaining consistency is cumbersome.

Assume you call a _FactoryBot_ factory like this:

```rb
build(:realty, address:)
```

As soon as you add another parameter you'll need to change the whole parameter list to be consistent.

```rb
build(:realty, address: address, active: true)
```

## Conclusion

I see that the hash shorthand syntax should bring us some joy over from the _JavaScript_ world, but I don't think this went well. The shorthands just works better in _JavaScript_ because the role of the colon is much more limited.
Fun Testing Challenge bypass html 5 validations
Published: 2023-08-15 06:22:00

Solving testing riddles or challenges is fun if you are a tester or an IT enthusiast.
In this article I want to see how we can solve the below challenge
What do we need to do
Visit : http://testingchallenges.thetestingmap.org/challenge2.php

**What is the challenge?**
We have a field on the page that has a html5 validation.
The field only accepts integers.
We need to make it accept somenthing else.
I have also made a video about the process that you can check out. However I would recommend before viewing the video to try and solve it yourself.

**Try 1 - Entering data from the keyboard**
Just to make sure that there are no blufs from the creator of the challenge I wanted to try the following input from the keyboard
Letters
Special characters
Copy pasting into the field

_No luck. So we need to try somenthing else._

**Try2 - Injecting input**
Since entering data did not seem to work I was thinking I could try and inject values in the input with the help of Bug Magnet.


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

No luck again. Only integers were allowed

**Try3 - Going under the hood**
Having pretty much tried what I wanted to try on the frontend I decided to open the developer tools and see how the input is configured.
The first thing that caught my eye was the type of the field. It had a type of number.




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

_I was in luck. This solved the challenge_
I hope you had fun with the challenge. Now this is not the only way to solve this challenge. Comment how you solved it. Comment if you have questions.

Check the video and the other article for more interesting content.

https://www.youtube.com/watch?v=OuHQ4CJElEk&ab_channel=ResterTest
Use Custom CA to Bypass SELF_SIGNED_CERT_IN_CHAIN Error
Published: 2023-08-15 05:59:41

As a developer you might need to install packages that are hosted on artifact repositories that your VPN / fireware does not allow to access. E.g.

```
Downloading Chromium 116.0.5845.82 (playwright build v1076) from https://playwright-akamai.azureedge.net/builds/chromium/1076/chromium-mac-arm64.zip
Error: self signed certificate in certificate chain
    at TLSSocket.onConnectSecure (node:_tls_wrap:1539:34)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket._finishInit (node:_tls_wrap:953:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:734:12) {
  code: 'SELF_SIGNED_CERT_IN_CHAIN'
}
```

In such case, you can set Custom CA while downloading.

Install OpenSSL:
`brew cleanup && brew update
brew install openssl -f`

Generate the private key to become a local CA:
openssl genrsa -des3 -out myCA.key 2048

```
mkdir certs
cd certs
```

Generate a root certificate:
`openssl req -x509 -new -nodes -key myCA.key -sha256 -days 1825 -out myCA.pem`

You should now have two files: 
myCA.key (your private key) and myCA.pem (your root certificate).

Ref: https://deliciousbrains.com/ssl-certificate-authority-for-local-https-development/

Now you can set CA while installing from remote:
`NODE_EXTRA_CA_CERTS="{path}/certs/myCA.pem" npx <forbidden_pacakge> install`
Wakapi - Open-Source Time Tracking for Devs
Tags: showdev, opensource, selfhosted, go
Published: 2023-08-15 05:49:00

---
title: Wakapi - Open-Source Time Tracking for Devs
published: true
description: 
tags: showdev, opensource, selfhosted, go
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sgwmrlyh6bre3wsu3n05.png
# Use a ratio of 100:42 for best results.
published_at: 2023-08-15 05:49 +0000
---

Hi all!

I want to share with you an open-source project that I started back during my studies and am passionately improving ever since. Back then, I wanted statistics about my coding (what language, editor, projects, etc.), just like WakaTime.com, but as a student I wouldn't be willing to pay for it. Because I'm a developer, I simply decided to build my own instead. It has become my no. 1 hobby project and after years I still love to spend my evenings coding on it. 

The project has reached more than 1,700 GitHub stars now, the hosted service at [wakapi.dev](https://wakapi.dev) got 1,800 registered users today and a super friendly, small community has evolved on GitHub - things, which I am super happy and appreciative about!

Wakapi is entirely open-source and can be self-hosted. But there is also a paid subscription plan for the official service, that gives users unlimited data history and a few other small perks and covers hosting, domain, etc. 

Go check it out and, if you like Wakapi, consider opting for a paid subscription. I'd appreciate your support a lot! 

P.S.: [Consider sponsoring open-source](https://muetsch.io/consider-sponsoring-open-source.html) 😊.
Help regarding a secure section on Static-Site.
Tags: help, netlify
Published: 2023-08-15 05:41:31

I had built a simple hugo blog for my mother, and hosted it with a Forestry.io + Github + Netlify combo. Forestry provided a nice wysiwyg editor to write her blogs, and netlify hooks would generate static site and update the site. 

Now that forestry is gone, I am looking a way to integrate some way of having a secure page where I can self host a cms like setup. How do I do it, in Static-site? There is no backend server for it.
WhatsApp Token Generation
Published: 2023-08-15 05:29:14

I wanna experiment WhatsApp messaging implementation but I am stuck with token generation part. After surfing various platforms I found that

Token = MessageDigest of (
            "PdA2DJyKoUrwLw1Bg6EIhzh502dF9noR9uFCllGk" // A constant
            + $Timestamp    // WhatsApp build release time
            + $Phone_Number // Client Mobile number
         )
But unfortunately, I couldn't find the timestamp for every WhatsApp version that I use to login.

It would be great if anyone can tell me the way to find / calculate the timestamp of a particular WhatsApp version. Or, is there any other ways to generate the Token ?

P.S : I have checked my code with some old WhatsApp versions and its timestamps which I got from GitHub WhatsApp repositories and its working fine upto login. I want to login with the latest [WhatsApp](https://gbwadownload.pro/gb-whatsapp-download/) version but unable to get its timestamp.
Running Mobile BERT Model with DataType.INT32 on Android using TensorFlow Lite
Tags: android, nlp, tensorflow20, tensorflowlite
Published: 2023-08-15 05:06:04

Running Mobile BERT Model with DataType.INT32 on Android using TensorFlow Lite
------------------------------------------------------------------------------

TensorFlow Lite is a popular framework for running machine learning models on mobile and embedded devices. It allows developers to deploy their models efficiently, taking advantage of the hardware capabilities of the target devices. Mobile BERT is a variant of the BERT (Bidirectional Encoder Representations from Transformers) model, which has been optimized for mobile devices.

When running a Mobile BERT model on Android using TensorFlow Lite, one important consideration is the data type used for the input tensors. By default, TensorFlow Lite uses DataType.FLOAT32 for input tensors, which provides a good balance between accuracy and performance. However, in some cases, using DataType.INT32 can be more beneficial.

Using DataType.INT32 for input tensors can lead to faster inference times on certain hardware, such as CPUs with SIMD (Single Instruction, Multiple Data) support. This is because INT32 computations can be more efficiently parallelized compared to FLOAT32 computations. Additionally, using INT32 can reduce the memory footprint of the model, allowing it to fit in memory more easily.

To run a Mobile BERT model with DataType.INT32 on Android, you need to follow these steps:

1.  Convert the Mobile BERT model to TensorFlow Lite format using the TensorFlow Lite converter.
2.  Specify the input and output data types as INT32 in the TensorFlow Lite model.
3.  Integrate the TensorFlow Lite model into your Android app.
4.  Preprocess the input data to match the expected input format of the Mobile BERT model.
5.  Run inference using the TensorFlow Lite interpreter.

It's important to note that using DataType.INT32 may result in a slight decrease in model accuracy compared to using DataType.FLOAT32. However, the trade-off in performance and memory efficiency can be worth it, especially on resource-constrained devices.

So, if you're developing an Android app that requires running a Mobile BERT model and performance is a priority, consider using DataType.INT32 for the input tensors. Just make sure to evaluate the impact on model accuracy and test thoroughly to ensure the desired results.

Remember, in the world of software development, sometimes you have to make funny compromises. But hey, who said coding couldn't be entertaining?

### References:

*   TensorFlow Lite documentation: [https://www.tensorflow.org/lite](https://www.tensorflow.org/lite)
*   Mobile BERT research paper: [https://arxiv.org/abs/2004.02984](https://arxiv.org/abs/2004.02984)
*   TensorFlow Lite converter documentation: [https://www.tensorflow.org/lite/convert](https://www.tensorflow.org/lite/convert)
Nguy cơ từ những nhà cái mới và mẹo tránh bẫy nhà cái tại bet69us.
Published: 2023-08-15 03:35:33

Nhà cái thường có chiến thuật điều chỉnh tỷ lệ cược đột ngột, ngay trước và sau khi trận đấu diễn ra, nhằm gây rối loạn tư duy của người chơi. Điều này tạo ra một "bẫy" mà trong đó, nhiều người chơi dễ bị cuốn vào, mất phương hướng và đổi ý đặt cược mà không rõ ràng về tỷ lệ đúng.
Không chỉ tỷ lệ cược, mà cả thông tin phụ trợ cũng thường được nhà cái sử dụng như công cụ gây xao lạc, đặc biệt trong các kì Euro, World Cup hay các sự kiện thể thao quốc tế khác.
Chính vì thế, người chơi nên giữ tinh thần lúc nào cũng minh mẫn, và tìm hiểu kỹ lưỡng để né tránh bẫy rình rập từ những nhà cái, cùng với việc nhận diện chính xác tỷ lệ cược và các thông tin đi kèm.
Xem chi tiết tại: https://bet69.us/meo-tranh-bay-nha-cai-moi-nhat-2023/ 
Trang liên quan: https://www.facebook.com/bet69uus
#meotranhbaynhacai #bet69 #bet69us
The Journey from Problem to Solution: Introducing AsyncFlow
Tags: dotnet, backenddevelopment, webdev, cloud
Published: 2023-08-15 03:24:40


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

It was a typical Tuesday afternoon when Ahmed, an astute developer, faced a daunting challenge. The request-response paradigm that he had always relied on was suddenly insufficient. With a growing user base and an expanding application, long-running tasks became the bane of his existence.


Frequent timeouts, aggravated users, and sleepless nights were all Ahmed seemed to know. The pressure of scaling without compromising user experience was weighing him down.

One evening, Ahmed stumbled upon the Job-based Asynchronous Processing Pattern. This was a game-changer! This pattern could handle time-consuming tasks in the background, and users could check the task's status or retrieve the results at their leisure. It was the perfect solution Ahmed had been searching for.

However, implementing it was no walk in the park. He needed something that would simplify this pattern's integration into his application.

Enter **[AsyncFlow](https://github.com/TheFo2sh/AsyncFlow)**.

Ahmed found AsyncFlow, a library that brought the power of this pattern right into the .NET ecosystem. Built atop Hangfire's robust infrastructure, AsyncFlow made it a breeze for him to implement asynchronous task processing.

Setting it up was a walk in the park:
```csharp
builder.Services.AddHangfire(x => x.UseMemoryStorage());
builder.Services.AddHangfireServer();
builder.Services.AddMemoryCache();
builder.Services.AddAsyncFlow(options => options.UseMemoryCache());
```

Ahmed just had to write his business logic, implement the IAsyncFlow interface, and voila, his endpoints were up and running:
```csharp
builder.Services.AddTransient<GenerateDataJob>();
app.MapFlow<GenerateDataJob, GenerateDataRequest, GenerateDataResponse>("dataGeneration");
```

It didn't stop there. Ahmed was also able to leverage Hangfire's capabilities, including its insightful dashboard and exceptional load balancing.

Elated with his discovery, Ahmed felt the need to share this gem with the world. If you're facing challenges like Ahmed and seeking a seamless way to implement the Job-based Asynchronous Processing Pattern in .NET, give [AsyncFlow](https://github.com/TheFo2sh/AsyncFlow) a glance. And if it helps you as much as it did Ahmed, consider giving it a star!
How to resolve the configuration problem with 2 application.properties in Springboot?
Tags: java, springboot, junit, springdatajpa
Published: 2023-08-15 03:02:41

Have you ever encountered the dreaded configuration problem with 2 `application.properties` files in your Spring Boot project? Fear not, for we have the solution for you!

Spring Boot is a popular framework for developing Java applications, known for its simplicity and convention-over-configuration approach. However, sometimes it can be a bit tricky to manage the configuration files, especially when there are multiple `application.properties` files in the project.

So, let's dive into the problem and explore how to resolve it.

The Configuration Problem
-------------------------

Imagine you have a Spring Boot project with two `application.properties` files: one in the `src/main/resources` directory and another in the `src/test/resources` directory. Both files have different configurations, and you want to make sure that the correct file is loaded at runtime.

By default, Spring Boot uses the `application.properties` file in the `src/main/resources` directory. However, during testing, it loads the `application.properties` file in the `src/test/resources` directory, which can lead to unexpected behavior if the configurations differ.

The Solution
------------

To resolve this configuration problem, you can use the `@TestPropertySource` annotation provided by Spring Boot. This annotation allows you to specify the location of the test-specific configuration file.

Here's how you can use it:

`@RunWith(SpringRunner.class)`  
`@SpringBootTest`  
`@TestPropertySource(locations = "classpath:test-application.properties")`  
`public class MyTest {`  
`    // Test methods go here`  
`}`

In this example, we're using the `@TestPropertySource` annotation to specify that we want to use the `test-application.properties` file located in the `src/test/resources` directory.

By using this annotation, you can ensure that the correct configuration file is loaded during testing, avoiding any conflicts with the main `application.properties` file.

Conclusion
----------

The configuration problem with multiple `application.properties` files in a Spring Boot project can be easily resolved by using the `@TestPropertySource` annotation. This allows you to specify the location of the test-specific configuration file, ensuring that the correct file is loaded during testing.

So, the next time you encounter this problem, remember to use the `@TestPropertySource` annotation and save yourself from any configuration headaches!

References:
-----------

*   [Spring Framework - TestPropertySource](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/context/TestPropertySource.html)
*   [Spring Boot - TestPropertySource](https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/test/context/TestPropertySource.html)
MY DATA SAFE AND SECURE
Published: 2023-08-15 02:33:49

IS MY DATA SAFE AND SECURE WHEN USING AN ONLINE NOTEPAD?
Data safety and security assurance are critical considerations when utilizing an online notepad, especially when dealing with rich text content encompassing a range of personal and confidential information. The degree of data protection hinges on the robustness of the security measures implemented by the chosen online notepad platform. Reputable services emphasize data security, employing many advanced strategies to mitigate potential risks.
**[Here](https://quirkyquillsq.blogspot.com/my-data-safe-and-secure)**
大规模 AI 高性能网络的设计与实践
Published: 2023-08-15 02:24:37

本次分享我们分为三个小节。首先从大模型的分布式训练出发，分析大模型训练对网络的核心需求。然后基于这些需求讨论 AIPod 高性能网络的设计。最后将讨论一些做大模型训练的实践经验。

1. 大模型训练对网络的要求
我们先来聊聊大模型训练对网络的需求。

最近半年以来大模型持续火爆。虽然关于大模型的发展与应用还有很多的争论，但可以肯定的是，大模型能力已经成为了接下来人工智能发展的基础。

和以前的小模型相比，大模型对大规模的分布式并行训练有更强的诉求。

这一方面是因为模型本身非常大。受制于今天的 GPU 显存限制，我们不得不把一个模型分拆到很多个 GPU 上来存储。比如说，百度的文心大模型有 2600 亿个参数，但是实际上一个 80G 显存的 A800，算上训练中间的计算状态，也只能存放大概 10 亿-20 亿参数。那显然光是存放 2600 亿的模型本身，就需要一两百块 GPU。这已经是一个比较大的规模了。

另一方面，因为训练更多的参数需要更多的计算量，因此我们必须得引入更大规模的 GPU 来进行加速，所以我们需要的 GPU 又要有一个数量级的提升。

在百度我们根据一个任务的 GPU 卡数来命名训练的规模。比如百卡以下我们叫小规模，百卡到千卡我们叫中规模，千卡以上我们叫大规模，超过万卡我们则以超大规模进行命名。依照这个命名方式，我们可以说，千卡以上的大规模并行训练是大模型成功的基础。
Manager Handbook for Distributed AntDB-T - P14
Tags: database
Published: 2023-08-15 02:13:43

## Online capacity expansion
_**Capacity expansion background**_

Distributed database usually faces massive data scenarios, and the continuous incremental data tends to reach the storage bottleneck in advance, at this time we need to add nodes to the cluster for expansion operation to ensure the healthy and stable operation of the database cluster.

**_Capacity expansion preparation_**

The expansion process will take up more network and IO resources, if the database operation cannot be reduced during the expansion period, some parameters need to be adjusted appropriately to ensure the successful completion of the expansion.

I. Appropriate adjustment of the number of wal keep according to the database load.

```
set datanode mastere all (wal_keep_size = 102400);
```
  
Although wal_keep_size is configured, in many cases, due to the huge amount of data in master node, the number of wal generated during the expansion may far exceed 102GB. From a more secure perspective, it is recommended to turn on archive mode.

```
set datanode master all (archive_mode = "on");  
set datanode master dm0 (archive_command = "rsync -a %p /data2/antdb/data/arch/dm0/%f"); 
```
 
2.The default value of wal_sender_timeout is 60 seconds. The server will disconnect replication connections that are inactive for more than the specified number of milliseconds.

If, for some reason, the chain building fails within 60s during the establishment of stream replication, the whole expansing process will be affected.

It is recommended to adjust this parameter to 0 during the expansion period and keep waiting for connections to be established.

After the expansion is finished, then revert to the default 60s.

```
set datanode all (wal_sender_timeout = 0); 
```