teleren/devto huggingface dataset:
Use Chat GPT 4 for Free ✨
Tags: ai, gpt4
Published: 2024-04-10 03:01:27


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


- Tabnine
- Codium


- glbgpt
- flowgpt


> Suggest more in comments I want to know and also if there is any llm model that is at or above the level of GPT4 then also comment 🚀

Alternatives
- Ollama
- perplexity.ai
Learn programming by peeling back layers of abstractions
Tags: webdev, programming, learning
Published: 2024-04-10 02:35:41

Learn by peeling back layers of abstractions

Here’s my programming hot take 🌶️: Libraries are amazing, but they might also make you and me “dumber”. Let me explain.

Preface: Libraries, frameworks, and code sharing in general is absolutely fantastic. The programming world wouldn’t have existed if we weren’t able to utilize other’s well-written and battle-tested code and everyone had to reinvent the wheels every time. Efficiently using the right libraries for the job is one of the best ways to quickly and securely deliver an impactful product.

However, recently I realized that I have been using so many libraries mindlessly without considering what exactly do they abstract. Some libraries masterfully cover away so many painful complexities that using them feel so easy-breezy that I began to take them for granted.

And that is dangerous because not always will you have access to these libraries. Companies may have strict permission policies that prevents you from installing certain tools. Moreover, not understanding how the libraries work - what are they good at and what are their shortcoming - hinder my abilities to put them into a bigger picture. When tasked with a similar but more complex situations, I won’t be able to identify and comprehend how a library can help or what are some limitations I need to be aware of. When a new technology revolutionizes the space, I won’t be able to contrast and compare them with each other to recognize why this new thing is so valuable.

That’s why I have been striving to dig deeper and understand more about the mechanisms at work and let curiosity guide my next journeys. And I definitely encourage everyone, especially beginners to do the same.

You don’t have to know it all to the tiniest details, but having a general idea how the technology fits into the big picture helps a lot.

Seek to (and struggle to) learn by peeling back layers of abstractions.
Consider building projects without your favorite libraries.

- If you have been building in React/Vue/Angular, try building an app with vanilla JavaScript and/or traditional server-rendered templating so as to see what areas JavaScript framework actually helps.
- If you have been using an ORM, try making a small project using raw SQL
- If you have been doing AI with PyTorch and Hugging Face, consider re-building a classic ML architecture using more native technologies (I learned a lot from a school project where we built a simple neural net with just `numpy`)
- Or just start reading, listening, and watching more on the topics of what’s going on under the hood

I have found these basic projects to make me grow a lot by helping me understand what exact "pains" my libraries are abstracting away and help me be less confused about which features are natively-provided vs. library-specific.

Let me know if you have been doing the same thing to. Would love to hear your success stories!
TECNO Security Author Program: Come and share your security research and bug bounty practices!
Tags: news, security, mobile, writing
Published: 2024-04-10 02:15:23

TECNO Security Response Center is committed to protecting product security and guarding user privacy, we cooperate with outstanding security researchers around the world. We hope to give security researchers a bigger opportunity and space for growth, and spread more technical, in-depth, and insightful security voices!

This is a Security Author Program for security researchers to share security technology research and bug bounty experience. We want to have more in-depth technical communication with all security researchers and spread more security voices of outstanding researchers from you.

**Article Topics:** Security technology research,security tool research, and bug bounty practice.

**Article rewards:** 1000-3000 credits / per article, Honor Badges, Exclusive Column, Security Training chance

**Important:** For the first 3 months, you can get double credits for every article.

Details：[TECNO Security Author Program: Come and share your security research and bug bounty practices!](https://security.tecno.com/SRC/blogdetail/231?lang=en_US)
Why Coding is Scary and How To Learn Better
Tags: webdev, javascript, beginners, programming
Published: 2024-04-10 02:02:00

Learning to program is hard.

I am still learning to program.

I have been at this for 9 years. I am still learning but I feel like an idiot all the time.

When you first start programming you will realize that the language is scary, the environments are scary and the people are scary.

In the online spaces especially Twitter(X), you will find people throwing crazy jargons.

## Bad Beginner Advice

There are a lot of advices online from people. Great programmers will tell you to start programming by writing a simple game. 

They will say things like "You want to program, just start by writing a simple game like Tetris or Tik-tak-Toe." 

If you have ever tried to write Tetris, it is not simple.

Another person will tell you, "Start with C++. That is what they use in the industry. Especially in the gaming community, that is what they use to write gaming engines."

I have no problem with C++ but to begin with it, is madness. 

Also: [Fastest way to learn a Programming Language](https://karlgusta.substack.com/p/fastest-way-to-learn-a-programming)

## How To Learn Better

Things you need to know when you are starting your coding journey is that:

- Coding has only about eight main concepts. You get them and you are done. The concepts are universal across languages. For those who know multiple languages, they know this is true.

Your first language will be hard, the second and the third, you will start to see patterns.

By the fourth or fifth language, you will be given a project and you can even do it in a weekend.

- Write out the concepts first, then convert to code later. If you are lost in coding, it is almost because you shouldn't be coding yet. Write out the concepts first, then convert to code later.

It is the same concept as an architecture when they start constructing a building. They come up with the designs first, then from the designs they can come up with the building.

- Most beginners think they don't understand what code to write. The real problem is they don't really understand the problem they are trying to solve. They try to figure out how to do it instead of what to do.

That's it.

Happy Coding!

P.S. I'm moving all my blogs and articles to my newsletter. DON'T MISS OUT. [Subscribe here now.](karlgusta.substack.com)
Entendiendo el patrón Abstract Factory
Tags: php, pattern
Published: 2024-04-10 02:01:17

El patrón Abstract Factory provee una interfaz para crear familias de objetos relacionados o dependientes sin especificar sus clases concretas, y es un patrón de diseño creacional.

Imagina que es una fábrica de fábricas; donde cada "fábrica" puede crear diferentes tipos de objetos que están interconectados.


[Leer más](https://angelcruz.dev/post/patron-abstract-factory-php?utm_source=devto&utm_medium=social&utm_campaign=promotion)
１０章5
Published: 2024-04-10 01:07:09

このJavaのコードを見ると、`main` メソッドから `test` メソッドが `null` を引数にして呼び出されています。`test` メソッドでは、受け取ったオブジェクトの `toString` メソッドを呼び出し、結果をコンソールに出力しようとしています。

コードのフローは以下のようになります：

1. `test(null)` が `main` メソッドから呼び出される。
2. `test` メソッドの `try` ブロック内で、`obj.toString()` が呼び出される。`obj` は `null` なので、`NullPointerException` がスローされる。
3. `catch` ブロックが実行され、「A」がリターンされる前に、コンソールに出力される（しかし、まだリターンはされない）。
4. `finally` ブロックが実行され、「B」がコンソールに出力される。
5. そして、`catch` ブロックのリターン文が実行され、「A」が `main` メソッドに返される。
6. `main` メソッドは、`test` メソッドから返された値を受け取り、コンソールに出力する。

結果的にコンソールには次のような出力がされます：

- 「B」が `finally` ブロックから出力される。
- 「A」が `main` メソッドによって出力される。

したがって、答えは「[B] [A] と表示される」、すなわち選択肢 C になります。

では、コードにコメントを付け加えて説明しましょう。

```java
public class Main {
    public static void main(String[] args) {
        // mainメソッドからtestメソッドを呼び出し、その返り値を出力します。
        // testメソッドにはnullが渡されます。
        System.out.println(test(null));
    }

    // testメソッドはObject型の引数を受け取ります。
    private static String test(Object obj) {
        try {
            // ここでobj.toString()を呼び出していますが、objがnullなので
            // NullPointerExceptionが発生します。
            System.out.println(obj.toString());
        } catch (NullPointerException e) {
            // 例外が捕捉されたら、"A"をリターンする前に
            // ここで"A"をリターンする意図を示しますが、実際にはまだリターンしません。
            return "A";
        } finally {
            // finallyブロックは例外があってもなくても実行されます。
            // ここで"B"を出力します。
            System.out.println("B");
        }
        // tryブロックが正常に終了した場合はここで"C"をリターンしますが、
        // 今回はcatchブロックから"A"がリターンされます。
        // このリターン文は実行されません。
        return "C";
    }
}
```

プログラムの実行フローは次のとおりです:

1. `main` メソッドが `test` メソッドを `null` を引数にして呼び出します。
2. `test` メソッド内で `obj.toString()` が呼び出されると `NullPointerException` がスローされます。
3. `catch` ブロックが例外を捕捉し、"A" を返すことを示しますが、実際には `finally` ブロックが実行されるまでは返されません。
4. `finally` ブロックが実行され、「B」がコンソールに出力されます。
5. `finally` ブロックが終了すると、`catch` ブロックからのリターンが実際に行われ、"A" が `main` メソッドに返されます。
6. `main` メソッドは "A" を受け取り、これをコンソールに出力します。

結果としてコンソール上には「B」が先に出力され、「A」が後に出力されます。
Encoding
Tags: encoding, base64, go, ittools
Published: 2024-04-10 00:59:27

In computing, encoding is the process of transforming a sequence of characters (letters, numbers, punctuation, special characters, symbols) into a format that is efficient for transmission and storage. The format commonly used is . It works something like this:

```
package main
​
import (
  b64 "encoding/base64"
  "fmt"
)
​
func main() {
  // Here is the string to be encoded.
  data := "abc123!?$*&()'-=@~"
​
  // We performed the encoding.
  sEnc := b64.StdEncoding.EncodeToString([]byte(data))
  fmt.Println(sEnc)
​
  // We performed the decoding.
  sDec, _ := b64.StdEncoding.DecodeString(sEnc)
  fmt.Println(string(sDec))
}
```

---
Output

```
YWJjMTIzIT8kKiYoKSctPUB+
abc123!?$*&()'-=@~
```

---
"Okay, but what will we use this for?" You might be wondering.

Imagine yourself needing to transfer a snippet of code to another computer.

Here's an example:

```
package main
​
import (
    "fmt"
    "net/url"
)
​
func main() {
    s := "this will be esc@ped!"
    fmt.Println("http://example.com/say?message="+url.QueryEscape(s))
}
```

---

We have new lines, special characters, etc...
Perhaps some information may be lost in the middle of this process depending on the content being transmitted.
So transmitting this value here is better, isn't it?

Base64

```
cGFja2FnZSBtYWluCgppbXBvcnQgKAogICAgImZtdCIKICAgICJuZXQvdXJsIgopCgpmdW5jIG1haW4oKSB7CiAgICBzIDo9ICJ0aGlzIHdpbGwgYmUgZXNjQHBlZCEiCiAgICBmbXQuUHJpbnRsbigiaHR0cDovL2V4YW1wbGUuY29tL3NheT9tZXNzYWdlPSIrdXJsLlF1ZXJ5RXNjYXBlKHMpKQp9
```

---

You can test it yourself with the [IT-TOOLS](https://it-tools.tech/base64-string-converter).

---
Before we move on to the next topic, it's worth remembering:
**Encoding is NOT CRYPTOGRAPHY.**
１０章４
Published: 2024-04-10 00:59:09

このJavaのコードは、try-catch-finallyブロックを使って例外処理を行っています。ここで、コメントアウトを加えてコードの流れを説明します。

```java
public class Main {
    public static void main(String[] args) {
        try {
            // ここではnullを参照しているオブジェクトを使ってtoStringメソッドを呼び出しているため、
            // NullPointerExceptionが発生します。
            Object obj = null;
            System.out.println(obj.toString());
            // この行はNullPointerExceptionが発生するため実行されません。
            System.out.println("A");
        } finally {
            // finallyブロックは、例外が発生しても、しなくても必ず実行されるブロックです。
            // そのため、"B"がコンソールに出力されます。
            System.out.println("B");
        } // catchブロックはfinallyブロックの後に来るため、ここは構文エラーです。
          // 正しくは、catchブロックがfinallyブロックよりも前に来る必要があります。
        catch (NullPointerException e) {
            // ここでNullPointerExceptionを捕捉して、"C"をコンソールに出力します。
            System.out.println("C");
        }
    }
}
```

このコードは実際には構文エラーを引き起こします。なぜなら、`finally`ブロックが`catch`ブロックの前に記述されているためです。Javaでは`try`の後に直接`finally`を書くことはできますが、その場合は`catch`ブロックを省略する必要があります。`catch`を使用する場合、`try`の直後に書かなければなりません。

ただし、質問文にある答えとしての「D」とは、「コンパイルエラーが発生する」という意味です。これは、先述の通り、`finally`ブロックが`catch`ブロックの前に来ているため正しいです。Javaの文法では、`try`ブロックの直後に`catch`ブロックが来なければならず、その後に`finally`ブロックを置く必要があります。ですので、コードの順番を次のように修正する必要があります。

修正後のコード：

```java
public class Main {
    public static void main(String[] args) {
        try {
            Object obj = null;
            System.out.println(obj.toString());
            System.out.println("A");
        } catch (NullPointerException e) {
            System.out.println("C");
        } finally {
            System.out.println("B");
        }
    }
}
```

この修正を行った後のコードでは、「C」が例外発生時に出力され、「B」は`finally`ブロックによって必ず出力されることになります。「A」は例外が発生するため出力されません。ですが、与えられたコードは修正前のものであり、このままではコンパイルエラーが発生するため、「D」が正しい答えとなります。
Cutting-Edge Strategies for Minimizing Latency
Tags: performance, softwaredevelopment, softwareengineering
Published: 2024-04-10 00:29:01

Latency is a critical performance metric in software engineering. Let’s dive deep into advanced techniques for reducing latency, providing practical examples and advice for software engineers.

1. **Load Balancing**
Load balancing is a technique used to distribute network traffic across multiple servers. For instance, if you’re developing a microservices-based application, you could use a load balancer like Nginx or HAProxy to distribute incoming requests evenly across your services. This prevents any single service from becoming a bottleneck, reducing latency.

2. **Content Delivery Networks (CDNs)**
A CDN is a network of servers distributed globally. When a user makes a request, the CDN redirects it to the nearest server, reducing latency. As a software engineer, you can leverage CDNs to serve static assets of your web applications. Services like Cloudflare and AWS CloudFront can help you set up a CDN for your application.

3. **Database Optimization**
Database queries can be a source of high latency. Techniques for optimization include indexing, query optimization, and denormalization.

For example, if you’re developing a web application with a user login feature, you could create an index on the username field in your users table. This would make the lookup of a user by username much faster, reducing latency.

4. **Compression**
Data compression reduces the size of the data to be transferred, reducing latency. For instance, you can use Gzip or Brotli compression in your web server to compress your HTML, CSS, and JavaScript files. This reduces the amount of data sent over the network, leading to faster load times and lower latency.

5. **Caching**
Caching involves storing copies of frequently accessed data in a fast-access cache. For example, if you’re developing a news website, you could cache the top news stories and serve them from the cache instead of generating them for each request. This could significantly reduce latency. Redis is a popular in-memory database used for caching in many applications.

6. **HTTP/2 and HTTP/3**
HTTP/2 and HTTP/3 are newer versions of the HTTP protocol with features for reducing latency. For example, HTTP/2 introduces multiplexing, allowing multiple requests and responses to be sent simultaneously over a single connection, reducing the overall latency. As a software engineer, you can enable HTTP/2 or HTTP/3 in your web server to take advantage of these features.

7. **Using a Real-Time Operating System (RTOS)**
For systems requiring real-time processing, an RTOS can help reduce latency. For example, if you’re developing embedded software for a drone, an RTOS could help you process sensor data in real-time with very low latency.

**Final Thoughts**
Reducing latency is a critical aspect of software engineering. By employing advanced techniques like load balancing, using CDNs, database optimization, compression, caching, and leveraging newer HTTP protocols, software engineers can significantly reduce latency, leading to a smoother and more responsive user experience.
Welcome Thread - v271
Tags: welcome
Published: 2024-04-10 00:00:00

---
published_at : 2024-04-10 00:00 +0000
---
![Blue HELLO text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ec4t4extvx6pkzb9b4t0.gif)

---

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself. 

2. Reply to someone's comment, either with a question or just a hello. 👋

3. Share your wins from this week in our weekly ["What was your win this week?](https://dev.to/t/weeklyretro) thread.
HIRE A CERTIFIED CRYPTOCURRENCY RECOVERY EXPERT // DIGITAL WEB RECOVERY
Published: 2024-04-09 23:58:50

Imagine the fear that comes with discovering that your well-earned money has been stolen. Suddenly losing $100,000 in cryptocurrency can be a terrifying experience. But fear not, for there is a hero in the digital realm who can assist in recovering your lost funds and bringing back peace of mind. Meet Digital Web Recovery - the solution to your worries. The prevalence of cryptocurrency theft is on the rise, as cyber criminals constantly develop new tactics to target innocent individuals. Whether it be through phishing schemes, breaching exchanges, or exploiting weaknesses in digital wallets, anyone is susceptible to falling victim to crypto theft, regardless of their level of caution. As I rolled out of bed one morning and checked my crypto wallet, I was greeted with the harsh reality that $100,000 had magically disappeared. Panic ensued as I pondered how to reclaim such a hefty sum. Would I have to wave goodbye to it forever? In my hour of need, I stumbled upon Digital Web Recovery - the crypto superheroes who specialize in rescuing stolen funds. With their genius minds and top-notch tech, they vowed to assist me in reclaiming my lost funds and putting the bad guys behind bars. No grass grew under the sleek shoes of Digital Web Recovery as they sprang into action. With the determination of a bloodhound on a scent, they dove headfirst into unraveling the mystery of the stolen funds. Following the digital breadcrumbs through the intricate world of blockchain, they skillfully unmasked the dastardly hackers behind the heist. Through a dazzling display of analytical prowess and seamless teamwork with the authorities, they managed to retrieve every last penny of my $100,000. What wizards, indeed. By leveraging the expertise and technology of Digital Web Recovery, you can turn the tide against crypto theft and emerge victorious. Don't let hackers get away with your hard-earned money - take action now and protect your digital assets. Remember, when it comes to crypto security, prevention is always better than cure. Talk with a representative of Digital web recovery on: digitalwebrecovery@mail-me.com
Telegram user; @digitalwebrecovery
website https://digitalwebrecovery.com
Thanks.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/phk9oe8arw66jqqec8vl.jpg)
Bioinformatics: PackagesNotFoundError on osx-arm64 Platform
Tags: bioinformatics, cli, beginners
Published: 2024-04-09 23:51:52

I was following the Biostar Handbook up until where I was supposed to create an environment and install the Bioinformatics tools required for the rest of the project when I encountered the error that brought you here: `PackagesNotFoundError`.
I had to surf the internet for solutions, and I found bits and pieces of them, which took quite some time. Don't worry; all of the research has been done to streamline the implementation process for you, allowing you to save more time.

**Why the Error**
The error is a result of the architecture/platform (osx-arm64) introduced to the M-chip MacBook systems, as opposed to the osx-64 platform in the preceding Intel versions. The packages obtained from channels like conda-forge and bioconda are not yet available on the osx-arm64 platform, hence the error.

**The Solution**
The solution is to find a way to set the platform for the environment created to osx-64 platform (which has all the required packages downloadable via the channels) by following the steps below in this order:

1. Install [miniconda](https://docs.anaconda.com/free/miniconda/#quick-command-line-install).
2. Add channels to fetch packages like bioconda and conda-forge to the base environment in that order using `conda config --add channels bioconda` and `conda config --add channels conda-forge`.
3. Create an environment, e.g., bioinfo, using the code line `conda create --name bioinfo -y`. This is done to containerize the packages to avoid conflicts like version conflicts.
4. Activate the created environment using `conda activate bioinfo`.
5. After that, set your environment platform to _osx-64_ instead of the default _osx-arm64_ to enable the installation of packages, as they have not yet been migrated to the _osx-arm64_ platform. The CLI command used is: `conda config --env --set subdir osx-64`.
6. Then, install the required package, specifying the version if needed. For example, to install Python version 3.6 on the environment, use the command `conda install python=3.6`.
7. Finally, install all the tools required for bioinformatics in the environment using `curl http://data.biostarhandbook.com/install/conda.txt | xargs conda install -y`.
10章3
Published: 2024-04-09 23:24:21

了解しました。こちらのJavaコードにコメントを追加し、なぜ選択肢E「コンパイルエラーが発生する」が正しいのかを説明します。

```java
// SampleExceptionというカスタム例外クラスを定義しています。
public class SampleException extends Exception {}

// SampleExceptionから派生したSubSampleExceptionというカスタム例外クラスを定義しています。
public class SubSampleException extends SampleException {}

// メインクラスです。
public class Main {
    // Javaアプリケーションのエントリーポイントであるmainメソッドです。
    public static void main(String[] args) {
        try {
            // sample()はSampleExceptionをスローするため、次の行は実行されません。
            sample();
            // したがって、sub()メソッドは呼び出されません。
            sub();
        } 
        // ここでSampleException（またはそのサブクラス）をキャッチします。
        catch (SampleException e) {
            // SampleExceptionがキャッチされたら、"A"を出力します。
            System.out.println("A");
        } 
        // ここでSubSampleExceptionをキャッチしようとしていますが、
        // このブロックは到達不能です。なぜならSubSampleExceptionはSampleExceptionの
        // サブクラスであり、既に上のcatchブロックで捕捉されてしまうからです。
        // Javaコンパイラはこのブロックが到達不能であると判断し、コンパイルエラーを発生させます。
        catch (SubSampleException e) {
            // コンパイルエラーが発生するため、この行は決して実行されません。
            System.out.println("B");
        }
    }

    // SampleExceptionをスローするsampleメソッドです。
    private static void sample() throws SampleException {
        throw new SampleException();
    }

    // SubSampleExceptionをスローするsubメソッドです。
    private static void sub() throws SubSampleException {
        throw new SubSampleException();
    }
}
```

Javaでは、`catch`ブロックを配置するときには、最も具体的な例外タイプから順に捕捉するようにする必要があります。つまり、`SubSampleException`のようなサブクラスの例外を先に捕捉し、その後で`SampleException`のようなスーパークラスの例外を捕捉するべきです。

このコードでは、`SampleException`を先に捕捉するため、`SubSampleException`を捕捉するブロックが到達不可能となります。このような到達不可能なコードはコンパイラによってエラーとして報告されます。したがって、コンパイラはこのコードをコンパイルできず、結果としてコンパイルエラー（選択肢E）が発生するのです。

## 追記

コンパイルエラーを回避するには、`catch`ブロックの順序をサブクラスの例外が先になるように変更する必要があります。最も特定の例外タイプ、つまりサブクラスから始めて、その後により一般的な例外タイプ、スーパークラスの例外をキャッチするようにします。

修正されたコードは以下のようになります：

```java
public class Main {
    public static void main(String[] args) {
        try {
            sample();
            sub();
        } 
        // サブクラスの例外を先にキャッチします。
        catch (SubSampleException e) {
            // SubSampleExceptionがキャッチされたら、"B"を出力します。
            System.out.println("B");
        }
        // その後に、より一般的な例外をキャッチします。
        catch (SampleException e) {
            // SampleExceptionがキャッチされたら、"A"を出力します。
            System.out.println("A");
        }
    }

    private static void sample() throws SampleException {
        throw new SampleException();
    }

    private static void sub() throws SubSampleException {
        throw new SubSampleException();
    }
}
```

この変更によって、`SubSampleException`をキャッチする`catch`ブロックが先にあり、その後に`SampleException`をキャッチする`catch`ブロックが配置されています。これにより、コンパイルエラーは発生せず、特定の例外が適切にキャッチされるようになります。