teleren/devto huggingface dataset:
Stuck on what to learn next...
Published: 2024-04-01 22:06:42

Im a relatively experienced programmer and have been coding for almost 8 full years now (starting in 8th grade). Im a college senior and have learned the basics of / in depth of just about everything.

Im looking for this (not so) simple answer:

What do people feel is worth learning in 2024?

I've learned:

Web Development (React/CSS/HTML/JS and Vue)
App Development (Flutter/Swift)
Languages at expert level (Java/Python/C)
Know essentials of (Rust, C++, Ruby... various other highly used languages)
Swift字典键值的查找时间复杂度
Tags: swift, datastructures, ios
Published: 2024-04-01 21:59:12

## SEO

Swift Dictionary Keys lookup time complexity contains O(1) O(n) constant time

## 太长不看

先说结论，下面两种访问字典键值/查找一个键值是否存在于字典中的方法，时间复杂度同为amortized O(1)。

```swift
if d["key"] != nil {
    // ...
}
if d.keys.contains("key") {
    // ...
}
```

## 细节

在Swift 4.0也就是大约2019年以前，使用第二种方法时，查找字典键值的时间复杂度为O(n)。因为当时 `Dictionary.Keys` 只是一个普通的符合 `Collection` 协议的集合。大家发现语言里存在这个问题，会导致下标访问和 `contains` 的时间复杂度不同，不符合预期，因此提出了如下提议

- [0154 - Provide Custom Collections for Dictionary Keys and Values](https://github.com/apple/swift-evolution/blob/main/proposals/0154-dictionary-key-and-value-collections.md)

这个提议的具体内容就是用自定义的类型 [`Keys`](https://github.com/apple/swift/blob/826515fbf38536d283cb68ba94e49190a607332e/stdlib/public/core/Dictionary.swift#L1287) 和 `Values` 代替默认生成的符合 `Collection` 协议的集合，从而实现一些自定方法，以提高随机查找的效率。

由于字典、集合等（哈希）散列数据结构的实现，多采用“不够就再扩容”的思想，因此这个方法的最坏时间复杂度并非常数时间O(1)，而是线性时间 n ；但均摊分析amortized下的时间复杂度仍是O(1)。

⚠️ 需要注意的是，如果嵌套了以前 cocoa 中的 `NSDictionary` 类型，则时间复杂度不再是一个确定的值。 

## 参考资料

- https://forums.swift.org/t/does-dictionary-keys-contains-have-o-1-time-complexity/21647/14
- https://stackoverflow.com/questions/28129401
- https://github.com/apple/swift/blob/main/stdlib/public/core/Dictionary.swift
O que é uma Memória RAM ECC? Para que serve e quando usar?
Tags: beginners, hardware, computer, rammemory
Published: 2024-04-01 21:57:35

**ECC (Error Correcting Code)** é um tipo de memória de computador que detecta e corrige os casos mais comuns de deturpação de dados, geralmente encontrada em servidores. É uma memória com um custo mais elevado, no entanto garante que a memória dificilmente, quiça nunca, será corrompida, tendo uma proteção extra contra a corrupção. Pentes de RAM normais como as que usamos tem chances de devolver 1 bit errado, mesmo que raro.

Erros de memória são o resultado de interferência elétrica ou 
magnética no computador. Essa interferência pode fazer com que bits individuais da **DRAM (Dynamic Random Access Memory)** mudem espontaneamente para o estado oposto. A interferência elétrica e magnética existem na forma de radiação de fundo e a interferência aumenta com a altitude.

Erros de bit único podem não ter impacto substancial nos dados, mas como as células de memória estão correlacionadas, os efeitos das alterações de um bit podem ter efeito por todo o sistema. Durante o processamento dos dados, a memória ECC analisa o código constantemente com um algoritmo especial para detectar e corrigir erros de um único bit na memória.

A memória ECC possui mais bits e controladores de memória que controlam os bits extras em um chip no módulo. A memória ECC usa bits extras para armazenar o código criptografado ao gravar dados na memória e também armazena o código ECC. Quando os dados são lidos, o código ECC gerado quando os dados foram lidos é comparado com o ECC armazenado. Se o código lido for diferente do código armazenado, ele é descriptografado por bits de paridade para determinar qual bit está com erro e corrige esse bit imediatamente. Sendo as tabelas de síndromes o método matemático usado para identificar esses bits instáveis ​​e corrigi-los.

Em áreas como a financeira e científica, a memória ECC é fundamental para garantir a integridade dos dados. A maior parte da memória do servidor é ECC devido à sua importância em aplicativos de servidor multiusuário.

De modo geral, a memória ECC é mais cara e pode ser um pouco mais lenta que a memória não ECC, reduzindo o desempenho do computador em cerca de 2%. O restante dos componentes do sistema, como CPU e placa-mãe, precisam suportar memória ECC; portanto, a menos que você precise de ECC, é melhor usar memória sem paridade.
I built an open-source tool that helps add usage-based billing for your LLM projects
Tags: openai, anthropic, llm, ai
Published: 2024-04-01 21:51:20

Nowadays, it is a huge hassle for projects built on top of OpenAI and Anthropic to implement monetization. You have to figure out:

- What is my OpenAI and Anthropic cost for each user?
- How much should I charge each user?
- How do I impose a usage limit on each user to ensure profitability for each pricing tier?

BricksLLM helps you answer all of these questions via a highly scalable API gateway built specifically for LLMs.

Here is a quick demo:

For example, for each user, you could create a proxy API key (through the REST endpoint) that has a spend limit of $100/month and a rate limit of 10000 requests/month:

![Creating an API key with a monthly spend limit and rate limit](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kz1r9budyme8wuf1cxql.png)

Then, you can redirect your OpenAI/Anthropic requests to us and start using the key:


```js
// OpenAI Node SDK v4
import OpenAI from 'openai';

const openai = new OpenAI({
 apiKey: "MY-SECRET-KEY", // key created earlier
 baseURL: "http://localhost:8002/api/providers/openai/v1", // redirect to us
});
```

That's it. Just start using OpenAI/Anthropic as you would normally.

You can query usage metrics via key id, model, custom id and user id:

![Retrieving usage metrics from our API](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ysrzxlzfej3m3diggry.png)

The usage data can be used both for analytics and Stripe integration. BricksLLM is free and open-source! You can spin it up using a single docker command. Under the hood it's just a Go web server with a PostgreSQL db and a Redis cache.

Check us out and let me know what you think!

Here is the repo if you want to learn more about it: https://github.com/bricks-cloud/bricksllm
🌟FREE Microsoft Exam Vouchers With AI Skills Cloud Skills Challenge⚡🔥🚀
Tags: programming, learning, certification, aws
Published: 2024-04-01 21:46:35

You can get a FREE exam vouchers for these Cloud Skills Challenges! It has been a couple of years. These free exam vouchers help those without any money upskill and reskill.

📝Note: The challenge period runs from March 19 Through April 19, 2024

Complete ONE Cloud Skills Challenge and receive ONE exam voucher. Each challenge is tied to a corresponding exam.

The four certification exam vouchers are:

· AI-900 Azure AI Fundamentals

· AI-102 Azure AI Engineer

· DP-100 Azure Data Scientist

· DP-600 Fabrics Analytics Engineer

📌If you are interested in getting a FREE Microsoft certification then [register to participate](https://www.microsoft.com/en-us/cloudskillschallenge/ai/registration/2024?ocid=aisc24_csc_aihub_cnl&wt.mc_id=studentamb_371890)


📌Here are the official [rules](https://www.microsoft.com/en-us/cloudskillschallenge/ai/officialrules/2024#terms-and-conditions?wt.mc_id=aisc24_cloudskillschallenge_webpage_cnl&wt.mc_id=studentamb_371890)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/maei4edzfknb98n2qgwn.png)
Happy Learning!
🌟 Microsoft is now offering FREE certification courses.🔥🚀😍
Tags: productivity, programming, career, learning
Published: 2024-04-01 21:43:20

Yes, you read that right: No Fee ✔️ No Subscription ✔️ No Registration Required ✔️ Just grab your laptop and start learning!

📌1. Social.Msdn.Microsoft.com
-> Course: Introduction to Web Development
-> Duration: 4 weeks
-> Code: WEB101
-> Link: https://learn.microsoft.com/en-us/training/paths/web-development-101/?wt.mc_id=studentamb_371890

📌2. Learn.Microsoft.com
-> Course: Learn Python Programming
-> Duration: 6 weeks
-> Code: PY101
-> Link: https://learn.microsoft.com/en-us/learn/paths/python-first-steps/?wt.mc_id=studentamb_371890

📌3. social.technet.microsoft.com
 -> Course: Networking Fundamentals
-> Duration: 5 weeks
-> Code: NETFUN101
-> Link: https://learn.microsoft.com/en-us/shows/networking-fundamentals/?wt.mc_id=studentamb_371890

📌4. Startups.Microsoft.com
-> Course: Startup Essentials
-> Duration: 6 weeks
-> Code: START101
-> Link: https://www.microsoft.com/en-in/startups?wt.mc_id=studentamb_371890

📌5. Code.Visualstudio.com/docs
-> Course: Visual Studio Code Essentials
-> Duration: 3 weeks
-> Code: VSCE101
-> Link: https://code.visualstudio.com/docs/introvideos/basics/?wt.mc_id=studentamb_371890
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6mzp6jsvqxdofpvpol8e.png)
Understanding React's useMemo and useCallback Hooks: A Comprehensive Guide
Tags: react, 100daysofcode, webdev, learning
Published: 2024-04-01 21:38:32


In React development, optimizing performance is vital for delivering seamless user experiences. Two essential hooks, `useMemo` and `useCallback`, play a crucial role in achieving this by memoizing values and functions. Let's explore these hooks and their impact on React application efficiency.

## Understanding the Problem
In React, components re-render whenever their state or props change. When a component in React re-renders, everything inside it, including objects and functions, gets recreated.  Due to JavaScript's nature, even identical objects or functions are treated as separate instances. Consequently, React's `memo` function fails to prevent unnecessary re-renders in such scenarios.

### Memoization Challenge
Memoization, a technique to cache results, faces challenges when dealing with objects or functions passed as props. Passing objects or functions as props to child components results in the child component viewing them as new props upon re-rendering, thereby impeding the effectiveness of memo.


## Introducing useMemo and useCallback
To address this issue, React offers `useMemo` and `useCallback` hooks. These hooks enable developers to stabilize objects and functions, preserving them between renders.

**useMemo**: Memoizes any value to be preserved across renders.
**useCallback**: Memoizes functions to prevent recreation on each render.

## How Memoization Works
Memoization involves storing a computed value in memory and returning it on subsequent renders if the inputs (dependencies) remain unchanged. Both `useMemo` and `useCallback` accept a **_dependency array_**, similar to `useEffect`, to specify when to recompute the value or function. If one dependency changes , the value is re-created.

## Common Use Cases
**Optimizing memo Function**: The primary use case involves stabilizing props (objects or functions) to prevent wasteful renders, thus maximizing the efficiency of the memo function.

**Avoiding Expensive Recalculations**: Use `useMemo` to cache results of computationally intensive operations, such as deriving state from large datasets, to eliminate redundant calculations on every render.

**Preventing Infinite useEffect Loops**: Memoize values used in dependency arrays of other hooks, like `useEffect`, to prevent unintended re-renders and avoid infinite loops.

## Best Practices
While `useMemo` and `useCallback` offer significant performance improvements, it's essential not to misuse them. Reserve their usage for specific use cases rather than applying them indiscriminately. Overusing these hooks can lead to unnecessary complexity and hinder code maintainability.

## Conclusion

By mastering `useMemo` and `useCallback`, React developers can optimize performance and enhance the responsiveness of their applications. These hooks provide a powerful mechanism for memoization, enabling efficient management of values and functions across renders. With careful implementation and adherence to best practices, React applications can achieve optimal performance and responsiveness.
Some great new posts from new authors in March 💞
Tags: doabarrelroll
Published: 2024-04-01 21:32:49

---
title: Some great new posts from new authors in March 💞
published: true
tags: doabarrelroll
---

Happy April!

It's [April Fools' Day](https://en.wikipedia.org/wiki/April_Fools%27_Day) in the U.S. so @ben committed this crime on DEV today, and I guess I perpetuated it further. 😛

{% link https://dev.to/ben/introducing-some-awful-new-dev-tags-ne1 %}

Hope it gave you a good laugh and that you didn't get sick like I did! 

Anyway, like last month and the month before, I took a look at all the posts published by new authors in March, and wanted to highlight a few that I'm particularly fond of. 

These posts are all from brand new authors - folks that are either totally new to the community or past lurkers who have finally been awarded their writing debut badge :) 

For your reading pleasure: 

{% link https://dev.to/awenath/its-just-another-language-8o3 %}

{% link https://dev.to/honeykeys/why-i-switched-my-personal-computer-to-linux-17d4 %}

{% link https://dev.to/ericbsantana/build-your-own-curl-in-go-2p71 %}

{% link https://dev.to/larastewart_engdev/how-i-would-learn-devops-if-i-could-start-over-5amp %}

{% link https://dev.to/fischi20/why-i-keep-an-eye-on-the-vue-ecosystem-and-you-should-too-4nhk %}

Happy Coding!
Use your own neural net to generate images
Tags: generativeart, javascript, images
Published: 2024-04-01 21:09:48

---
title: Use your own neural net to generate images
published: true
description: Use your own neural network to generate images
tags: generativeart, javascript, images
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/56h44tpidrqoyfsw6z5n.png
# Use a ratio of 100:42 for best results.
# published_at: 2024-04-01 20:44 +0000
---

As we all know, the most important thing in art is having an idea. Just an idea. A prompt is more important than years of expertise. It's OK to take all that expertise from someone else, put it though an algorithm and sell it off as your own, no recompense, no credit.

So I give you generative art where you just have to hold that prompt in your head and select pictures that most evoke that idea in you and then, the master work will appear before your eyes. No artistic talent necessary. Also, this won't take half as much power as anything like midjourney or Dall-e.

http://mellen.github.io/picturechoice/index.html

I want 10 anime babes and 13 fantasy landscapes on my desk by 12am.
Music Monday — What are you listening to? (Covers Edition)
Tags: watercooler, discuss, music
Published: 2024-04-01 20:55:24

_cover image source: [Giphy](https://giphy.com/gifs/muppetwiki-sesame-street-muppets-ernie-PrTCHhXyn6ZtNF5nly)_

**Ya gotta love a good cover song! For those who haven't heard the term, a cover song is when somebody remakes a song that was already created and released by someone else; you can [read about cover versions here on Wikipedia](https://en.wikipedia.org/wiki/Cover_version). Notably, I've sometimes heard folks distinguish "cover versions" of songs from "tribute versions" by saying that a tribute tries to stay true to the original, but a cover regularly puts its own spin on the material. That said, I think all tribute songs are cover songs, but not all covers are tributes. Hope that makes sense! Anywho, whether it's a tribute song that is a made to be a replica of the original, or a cover song that sounds _almost_ entirely different, I wanna hear some covers!**


![A shot of Tenacious D from the music video for "Tribute" — they are standing out on the crossroads at night and playing music to try to defeat the devil and they come a break in the song where Jack Black sings an angelic "ahhhhhh" while a force of wind and bright light shines behind he and Kyle Gas as they rock out beautifully.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/97rx1qyxk42vyuntp3ej.gif)

***

## How we do 

In this weekly series, folks can chime in and drop links to whatever it is they've been listening to recently + browse others' suggestions. You can follow the suggested genre if you'd like, but don't feel confined to it; you're free to suggest whatever you wanna. 🙌  

If you're interested in having other discussions about music, consider following the aptly named [#music discussions](https://dev.to/music-discussions) organization.

{% embed https://dev.to/music-discussions %}  

***

Can't wait to hear what y'all uncover! 😉

_Note: you can embed a link to your song using the following syntax `{% embed https://... %}`. This should work for most common platforms!_

Looking forward to listening to y'all's suggestions! 🎶

***

**🚨_p.s. Check out @rachelfazio's sister series to Music Monday, [Podcast Palooza](https://dev.to/rachelfazio/series/26422)!_🚨**
TryHackMe: Chrome (post #2)
Tags: cybersecurity, google, security, writing
Published: 2024-04-01 20:35:22

The master key used for DPAPI encryption can be found in AppData/Roaming/Microsoft/Protect/_SID_. 


![master key](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e89bgrpmyyzge78ardzc.png)

In order to retrieve the password, we need to convert the master key and this is done using [this python script](https://github.com/openwall/john/blob/bleeding-jumbo/run/DPAPImk2john.py).
DPAPImk2john belongs to the plethora of dependencies of [john](https://www.kali.org/tools/john/).

I'll use **python3 DPAPImk2john.py --sid="_SID_" --masterkey="_masterkey_" --context=local > hash.txt** 👇 

![DPAPI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8wu11esurccv9kdgljyy.png)

After obtaining the hash, we can crack it using john. Additional details about how to employ this tool can be found [here](https://www.freecodecamp.org/news/crack-passwords-using-john-the-ripper-pentesting-tutorial/).

With that being said, let's crack the password! 🦁

![john](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yb0ezmnu35oo4k7nnr7j.png)

There's a lot of advancing!👏We get closer and closer to the passwords stored in Google's Password Manager.

The next step is to _Decrypt the masterkey_. This can be done either with [Mimikatz](https://github.com/ParrotSec/mimikatz) or [Pypykatz](https://github.com/skelsec/pypykatz). I'll continue to use the second one. 👀

In order to retrieve the URLs and the associated passwords, we need to align the following 3 files:
🕐Local State (file type: json) (file location: AppData/Local/Google/Chrome/User Data/ Local State)

🕑Login Data (file type:  DB) (file location: AppData/Local/Google/Chrome/User Data/Default/Login Data)

🕒master key (file type: data) (file location: AppData/Roaming/Microsoft/Protect/<SID>)


![3files](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5fpslll4pk8wa8ij4w85.png)

I extract the pre-keys **pypykatz dpapi prekey password "_SID_" _password_** 👇


![prekey](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1o31z1ou6zdxo5gw5ekw.png)


And now, I'll decrypt the master key trying any of the pre-key. The first pre-key is also the one that's working.
_Note that -o stands for output. The output is mkey.json. You can name the file however you want, provided that it preserves the type, i.e JSON_.😉

![answers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oafx3c8npp409lvufgf2.png)

Commands used:

- 
pypykatz dpapi masterkey -o ./mkey.json _masterkey_ _prekey_


- 
pypykatz dpapi chrome --logindata Login_Data ./mkey.json Local_State

- strings Login_Data | grep -i http

Also, note that the name file was changed to Local_State. Originally, you'll find it under the name Local State.

 Congratulations!👏
------------------------
What are your thoughts so far? 🤔
Let me know how it goes for you. If you get stuck, feel free to leave a comment!🤗
HackerRank SQL Preparation: Revising the Select Query I(MySQL)
Tags: sql, writeups, hackerrank
Published: 2024-04-01 20:08:23

**Problem Statement:**
Query all columns for American cities in the **CITY** table with populations larger than `100000`. The **CountryCode** for America is `USA`.

**Link:**[HackerRank - Revising the SELECT Query](https://www.hackerrank.com/challenges/revising-the-select-query/problem)

**Solution:**

```sql
SELECT * FROM CITY WHERE POPULATION > 100000 AND COUNTRYCODE = 'USA';
```

**Explanation:**
This SQL query retrieves all columns (*) for cities in the **CITY** table where the population is greater than `100000` and the **CountryCode** is 'USA'. Here's a breakdown of each part:

- `SELECT *`: Selects all columns from the **CITY** table.
- `FROM CITY`: Specifies the table from which to retrieve data, which is the **CITY** table in this case.
- `WHERE POPULATION > 100000`: Filters the rows to include only cities with a population larger than `100000`.
- `AND COUNTRYCODE = 'USA'`: Further narrows down the selection to cities located in America (USA) based on the **CountryCode** column.
Boost Your YouTube Channel with UltraBot: The Ultimate Tool for Growth!
Tags: boost, views, youtube, usa
Published: 2024-04-01 20:08:18

Are you a YouTuber dreaming of more views, subscribers, and likes on your videos? Well, there's good news! UltraBot is here to help make your dreams come true. In this article, we'll explore how UltraBot can supercharge your YouTube channel and make it stand out from the crowd.

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

What is UltraBot?
UltraBot is a special tool made just for YouTubers like you. It's like having a superpower for your channel! With UltraBot, you can get more people to watch your videos, subscribe to your channel, and like your content. It's really easy to use and helps you grow your channel faster.

Unlimited Views:
Do you want more people to watch your videos? With UltraBot, you can get as many views as you want! Whether you're sharing your latest vlog or showcasing your talents, UltraBot can help you reach more people and get your videos seen by a bigger audience.

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

Endless Subscribers:
Building a big audience of subscribers is important for your YouTube channel. With [UltraBot](https://ultrabot.io/shop/premium-monthly/), you can attract more subscribers who love your content and want to see more from you. Say goodbye to slow growth and hello to a big, happy audience cheering you on!

Lots of Likes:
Everyone loves getting likes on their videos—it's like getting a virtual high-five! With UltraBot, you can get lots of likes on your videos, showing the world that people enjoy what you're sharing. More likes mean more people are enjoying your content and want to see more from you.

Customized for You:
UltraBot understands that every YouTuber is unique. That's why it lets you customize how you want to grow your channel. You can choose which videos or channels to focus on, and UltraBot will help you reach your goals in the way that works best for you.

Conclusion:
If you're ready to take your [YouTube channel](https://www.youtube.com/@YouTube/channels) to the next level, UltraBot is here to help. With its easy-to-use features and powerful capabilities, UltraBot makes it easier than ever to get more views, subscribers, and likes on your videos. Say goodbye to slow growth and hello to big success with UltraBot by your side!