teleren/devto huggingface dataset:
¿Cómo se emiten los votos en un caucus?
Tags: webdev, news, periodismo, habilite
Published: 2023-12-15 16:34:33

Para los [republicanos](http://capitaldigitalnews.com), los sustitutos de los candidatos dan las presentaciones finales después de que comienzan las [asambleas ](http://vanguardsglobal.com)electorales y luego se distribuyen las boletas de papel a los asistentes a las [asambleas](http://phoenixofdetroit.com). Se cuentan en el lugar y los resultados se comparten con el [partido](http://opiniondream.com).
Hello World
Tags: openai, assistantsapi, ai, beginners
Published: 2023-12-15 16:33:30

**I'm building an OpenAI Assistant's API Chatbot and looking for Community**
👋 Hi everyone! I'm new here, thanks for having me 😊
For the last few weeks I have been working on building my own AI chatbot with a custom knowledge base behind it. ChatGPT is an amazing helper, but at times I wished I had more of a community to learn and grow together.
Do you know someone who is working on OpenAI Assistant's API software and would be interested in regular exchanges?
In terms of software I'm currently using Python, Flask, Heroku, Celery, and Redis (WIP), but as a new developer I still find myself frequently adapting this.

If you are curious I sometimes share code snippets on my website [gregorschafroth.com](url)

So, if you know someone or have a ideas where I could find a community to work on this together with others please let me know!
¿Qué es un caucus?
Tags: news, informacion, publicidad, tutorial
Published: 2023-12-15 16:30:41

Los caucus no son primarias. Las elecciones primarias se llevan a cabo como otras elecciones [estadounidenses](http://vanguardsglobal.com): en los lugares de votación y mediante votación secreta, se llevan a cabo durante todo el día y, por lo general, también con votación [anticipada ](http://opiniondream.com)y en ausencia.
Los caucus son otra cosa. Son [esencialmente ](http://capitaldigitalnews.com)reuniones dirigidas por partidos políticos, convocadas a una hora específica: las 7 pm CT en Iowa. Dado que no se trata de una elección tradicional, el desempeño de un candidato en Iowa a menudo se considera una [prueba ](http://phoenixofdetroit.com)de la fortaleza organizativa de su campaña.
Prepárese para los caucus de Iowa. ¿Todavía importan?
Tags: news, page, information, webdev
Published: 2023-12-15 16:28:55

La primera [prueba ](http://capitaldigitalnews.com)de las elecciones presidenciales de 2024 llegará el 15 de enero, cuando los republicanos de Iowa se reúnan en [gimnasios ](http://vanguardsglobal.com)de escuelas secundarias, edificios comunitarios e iglesias.
Los caucus, el primer evento del [calendario ](http://phoenixofdetroit.com)de primarias del partido en el último medio siglo, brindarán un momento inicial de verdad para el intento de regreso del [expresidente ](http://opiniondream.com)Donald Trump y podrían ayudar a los republicanos cansados de Trump a decidir a cuál de sus rivales apoyar.
Advent of Code 2023 - December 15th
Tags: advent, adventofcode, python, december
Published: 2023-12-15 16:12:16

---
title: Advent of Code 2023 - December 15th
published: true
description: My progress with the 2023 version of Advent of Code
tags: advent, adventofcode, python, december
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/36qayk14ewje7rvykeg5.jpg
series: Advent of Code 2023
# published_at: 2023-12-01 17:41 +0000
---

In this series, I'll share my progress with the 2023 version of [Advent of Code](https://adventofcode.com/2023).

Check the first post for a short intro to this series.

You can also follow my progress [on GitHub](https://github.com/robvanderleek/adventofcode).

## December 15th

[The puzzle of day 15](https://adventofcode.com/2023/day/14) was surprisingly easy. The first part was so trivial it made me nervous for the complexity of the second part. But also part two was really straightforward. A nice start of the weekend :smile:

__My pitfall for this puzzle:__ Not really, this day was way easier than previous days.

{% spoiler Solution here, do not click if you want to solve the puzzle first yourself %}

```python
#!/usr/bin/env python3
import re

with open('input.txt') as infile:
    lines = infile.readlines()
parts = lines[0].strip().split(',')

def calc_hash(l):
    result = 0
    for c in l:
        result += ord(c)
        result = result * 17
        result = result % 256
    return result

boxes = []
for _ in range(256):
    boxes.append([])

for p in parts:
    label = re.split('[=-]', p)[0]
    box = calc_hash(label)
    if p[-1] == '-':
        boxes[box] = [b for b in boxes[box] if not b.startswith(label)]
    else:
        focal_length = p[-1]
        for idx, lens in enumerate(boxes[box]):
            if lens.startswith(label):
                boxes[box][idx] = f'{label} {focal_length}'
                break
        else:
            boxes[box].append(f'{label} {focal_length}')

total = 0
for idx_b, b in enumerate(boxes):
    for idx_l, lens in enumerate(b):
        total += (idx_b + 1) * (idx_l + 1) * int(lens[-1])
print(total)
```

{% endspoiler %}

That's it! See you again tomorrow!
Spin Rewiter
Published: 2023-12-15 16:10:01

Spin Rewriter là một công cụ bài viết hoặc nội dung quay lại mà ghi đè lên nội dung về đoạn văn, từ và mức độ câu. Máy quay có công nghệ “ENL Semantic Spinning” mạnh mẽ để tạo ra.
Công cụ Spin Rewriting dễ dàng viết lại văn bản trong một cú nhấp chuột mà không gặp bất kỳ rắc rối nào khi đăng ký và cài đặt ứng dụng. Chỉ cần sao chép và dán nội dung của bạn vào trang web Spin Rewriter, nó sẽ viết lại nội dung của bạn trong vài giây.
Mua ngay tại: https://www.wsovn.net/mua-chung-spin-rewriter-11-wsovn
5 React / JS ⚛️ Libraries To Integrate ChatGPT Into Your Web App
Tags: webdev, javascript, react, ai
Published: 2023-12-15 16:09:54

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2t89sq5mxlul06jywvl.gif
---

Adding an AI-powered conversational interface will soon become a must-have for any compelling web or mobile application user experience. Chatbots enable personalised and natural interactions, provide intelligent support, and improve user engagement. And React JS developers have more options than ever to embed incredibly smart capabilities into their apps.

Here are 5 top open-source React / Javascript libraries for rapidly integrating feature-rich AI chatbots:

⭐️ `Don't forget to show support and star them on GitHub` ⭐️ 😊

1. **[NLUX](https://github.com/nlkitai/nlux)** ⚛️ 🟨 – NLUX provides React components and adapters to build AI chatbots and seamlessly connect to LLMs such as ChatGPT, LLAMA2, and more. Whether creating a smart knowledge base, virtual support agents, or feature-rich AI assistants, it will handle the heavy lifting so developers can deliver next-gen conversational AI to customers faster.

2. **[Botanic](https://github.com/hubtype/botonic)** ⚛️ - Botonic is a react framework to build a conversational app. It is more than creating simple text-based chatbots. It is built for developers and offers a full-stack serverless solution. It allows the developer to create chatbots and modern conversational apps that work on multiple platforms like web, mobile and messaging apps such as Messenger, Whatsapp, and Telegram.

3. **[Bottender](https://bottender.js.org/)** 🟨 - Bottender is a framework for building conversational user interfaces and is built on top of Messaging APIs. This framework has an easy setup, it has been optimized for real-world use cases, automatic batching requests, and dozens of other compelling features such as intuitive APIs.

4. **[React Chatbot Kit](https://fredrikoseberg.github.io/react-chatbot-kit-docs/)** ⚛️ - React-chatbot-kit was designed as a way to get started building chatbots on the frontend in a quick and easy manner. The chatbot works by importing it and giving it a messageparser, a config and an actionprovider. 

5. **[OpenAI JS SDK](https://platform.openai.com/docs/libraries)** 🟨 - OpenAI provides an official JavaScript SDK to access their industry-leading LLM ChatGPT. While intended for backend usage, developers can build a lightweight Node.js server and React front-end to deliver fast and integrated conversational experiences. For those wanting maximum control, the uncomplicated OpenAI JS API could be a good option.

Happy coding! 🧑‍💻🙂

⚛️ → _React JS Library_
🟨 → _Vanilla Javascript Library_

![Programmer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2t89sq5mxlul06jywvl.gif)
Trying to establish on discord?
Tags: developer, service
Published: 2023-12-15 15:57:55

Hello!

I am Rnvr, a _Discord professional service provider_ with a specialization in elevating online communities. If you're a business, game development company, or publisher seeking to establish or enhance your presence on Discord, I have the expertise you need!

**Services I Offer:**

- Strategic server creation and setup
- Seamless bot integration (music, moderation, security, etc.)
- Expert moderation and community management
- Tailored promotion and engagement strategies
- Efficient event planning and management
- Reliable administrative and HR support

**Why Choose Me?**

- Competitive pricing starting from as low as $5
- Customized solutions tailored to your specific needs
- Swift and efficient delivery
- Guaranteed results exceeding expectations

**Explore my work:**

Check out my [Fiverr](https://www.fiverr.com/rnvrkrn) profile for detailed service offerings.
Review examples in my [portfolio](https://rnvrs.wordpress.com/).

Let's Connect:
Discord Tag: paksaucify

Located in the GMT+5 timezone, I prioritize timely communication and delivery.

I would love to discuss how my services can contribute to the success of your Discord community. Please feel free to reach out on Discord or through Fiverr.

Looking forward to the opportunity to work together!

Thank you devs!
create PDF from WORD
Published: 2023-12-15 15:48:11

1. từ trên menu, chọn File 
2. trong panel trái chọn Save As, trong drop down file type chọn PDF
3. bấm Save 

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



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4zdasdmumsc34mhawd3v.png)
Collecting data for Gamedev.js Survey 2023
Tags: gamedevjs, gamedev, javascript
Published: 2023-12-15 15:54:18

---
title: Collecting data for Gamedev.js Survey 2023
published: true
date: 2023-12-15 15:47:53 UTC
tags: gamedevjs,gamedev,javascript,gamedevelopment
canonical_url: https://end3r.medium.com/collecting-data-for-gamedev-js-survey-2023-f22fd54de123
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jfdlfkn5b5m8iqgw4rxo.png
---

The third yearly edition of [Gamedev.js Survey](https://gamedevjs.com/survey/2023/) is open for a week now, and will close next week, on Friday December 22nd - if you haven’t [filled the form](https://gamedevjs.com/survey-2023-form) yet, **please do so**!

As you can see we’re running this late, since the two past editions were conducted in February-March. Plus they ran for an entire month, while this one it only two weeks. Still, there was a risk we’d miss the whole year and end up with a blank spot for 2023, so I guess it’s **better late than never**.

The new approach this year is a pre-survey ask for help updating the questions, which the community answered. We had multiple [Pull Requests on GitHub](https://github.com/GamedevJS/Gamedev.js-Survey/pulls?q=is%3Apr+is%3Aclosed) with valuable additions, which we then [rewarded](https://github.com/GamedevJS/Gamedev.js-Survey/issues/14). It all wouldn’t be possible without this year’s partner: we had support from **Grant for the Web** in [2021](https://gamedevjs.com/survey/2021/), **OP Games** in [2022](https://gamedevjs.com/survey/2022/), and 2023 was **saved by** [**Poki**](https://poki.com/), for which we’re incredibly grateful.

We’re planning to release raw data on GitHub before the end of this year, and publish a full report at the beginning of 2024. Make sure to [fill the form](https://gamedevjs.com/survey-2023-form), since the more answers we collect the better from the statistical point of view. If you did that already - **thank you**!
BabyEncryption Hack The Box
Tags: cybersecurity, hackthebox, hacking, reverseengineering
Published: 2024-01-05 16:18:15

---
title: BabyEncryption Hack The Box
published: true
date: 2023-12-15 14:33:13 UTC
tags: cybersecurity,hackthebox,hacking,reverseengineering
canonical_url: 
---

#### **HTB | Crypto Challenge**

![hackthebox](https://cdn-images-1.medium.com/max/1024/1*jh_88Pqk7cOMTt0aHP0taQ.png)

> You are tasked with discovering the flag by deciphering the provided ciphertext. The challenge includes a Python script for decryption, but you need to modify the script before executing it. As a newcomer to Hack The Box (HTB), it’s uncertain whether this approach is standard or specific to this challenge. Let’s proceed without delay.

#### Unzipping the file

![](https://cdn-images-1.medium.com/max/1024/1*xArgzof4gPJ1UGnRlCQw3g.png)

> **_Password_** _ : hackthebox_

- Upon extracting the archive, two additional files emerge: **chall.py** housing the Python script for deciphering the ciphertext, and **msg.enc** which stores the encrypted text. Now, let’s examine the contents of these files.

![](https://cdn-images-1.medium.com/max/1024/1*xCkmDRTayRcFD_2zKVUl7g.png)
_chall.py & msg.enc_

- Executing the script will result in the following error messages.

![](https://cdn-images-1.medium.com/max/1024/1*73MNGVxNAKnTjqfpFNBesA.png)
_error script_

> After spending a few moments attempting to resolve the errors, I opted to abandon that approach and chose to modify the script instead.

![](https://cdn-images-1.medium.com/max/1024/1*oZSBCwWisbvQtS0eaGX8Rg.png)
_Decode Script_

```
def decrypt(msg):
    pt = []
    for char in msg:
        char= char-18
        char=179*char%256
        pt.append(char)
    return bytes(pt)

with open("msg.enc") as f:
    ct=bytes.fromhex(f.read())
print(decrypt(ct))
```

- The value 179 is used in the decryption script as part of the reverse operation to undo the multiplication and modulo operation performed during encryption. In the encryption script, there’s a line:

```
ct.append((123 * char + 18) % 256)
```

This means during encryption, each character (char) is multiplied by 123, then 18 is added, and finally, the result is taken modulo 256.

In the decryption script, the goal is to reverse this process. The line:

```
char = 179 * char % 256
```

performs the reverse calculation. It uses 179 as the modular multiplicative inverse of 123 modulo 256. In modular arithmetic, the modular multiplicative inverse of a number a modulo m is a number b such that (a \* b) % m == 1. In this case, 179 is chosen because (123 \* 179) % 256 == 1, allowing the decryption process to reverse the effect of the original multiplication and modulo operation.

#### Let’s execute it …

![](https://cdn-images-1.medium.com/max/1024/1*3aDPUJtp7gvMElUzjXVp2w.png)
_Flag_

The task was not too challenging, and we successfully obtained the flag:

> **_HTB{l00k\_47\_y0u\_r3v3rs1ng\_3qu4710n5\_c0ngr475}_**
Claude 2.1 Unleashed: The AI Revolution That's Outshining GPT-4
Tags: ai, claude, programming, productivity
Published: 2023-12-15 15:46:00

# Claude 2.1: The AI Game Changer

As a seasoned Claude user, I've consistently been impressed, often favoring it when GPT doesn't quite meet my needs. But now, Claude 2.1 isn't just another option—it's a game changer.

## Why Claude 2.1 is Grabbing Headlines

While the tech world is all abuzz about Gemini, Claude 2.1 is making strides that demand attention. This isn't just any update; it's a leap into the future of AI.

### Claude 2.1 vs GPT-4: The New Frontier

#### Expanded Context Window
Claude 2.1's 200K token context window far exceeds GPT-4's 32K limit, opening the door to deeper and more complex conversations—a feature that, as a user, I find invaluable.

#### Precision and Reliability
Claude 2.1 boasts a 50% reduction in hallucinations from its predecessor, marking a significant improvement in accuracy. Having experienced both, I can attest to Claude 2.1's superior reliability when it counts.

#### Tool Use: A Leap Beyond
The beta tool use feature propels Claude 2.1 beyond GPT-4, enabling real-world interactions, data retrieval, and complex problem-solving. This isn't just a response generator; it's a dynamic AI companion.

#### Personalized Experience with System Prompts
Customization is crucial in AI, and Claude 2.1's system prompts offer a tailored experience, transforming it from a mere tool into a personalized partner.

#### Accessibility for All
With its user-friendly access via Anthropic's API and chat interface, Claude 2.1 is available to all, with free and Pro tiers making it more accessible than GPT-4.

## In Conclusion

I've watched Claude evolve, and with 2.1, we're witnessing not just an evolution but a revolution in AI. It's time we give Claude 2.1 the spotlight as the true game changer it is.

### A Savvy Investment

The battle of the subscriptions is on, and we're becoming smarter about where to place our $20 bets. It's shaping up to be a clash of the streaming titans!

---

[🔍 Dive deeper into the Claude 2.1 updates on the official site.](https://www.anthropic.com/index/claude-2-1)
C# - System.Text.Json Source Generators
Tags: csharp, programming, tutorial, beginners
Published: 2023-12-15 15:30:00

C# introduced a feature in .NET 6 that significantly improves the performance of JSON serialization and deserialization - `System.Text.Json` source generators. This feature allows for compile-time generation of serializers for your data models, reducing the runtime overhead typically associated with reflection in JSON processing.

Here’s how to use `System.Text.Json` source generators:

1. **Setup Your Project:**
   Ensure your project targets .NET 6 or later. You need to install the `System.Text.Json` NuGet package if it's not already included.

2. **Declare Partial Serializer Context:**
   Create a partial class that inherits from `JsonSerializerContext` and use the `[JsonSerializable]` attribute to specify which models you want to generate serializers for.

3. **Use Generated Serializers:**
   When serializing or deserializing, use the `JsonSerializer` methods that take your generated context as a parameter.

Example:

```csharp
using System.Text.Json;
using System.Text.Json.Serialization;

[JsonSerializable(typeof(WeatherForecast))]
public partial class MyJsonSerializerContext : JsonSerializerContext
{
}

public class WeatherForecast
{
    public DateTime Date { get; set; }
    public int TemperatureCelsius { get; set; }
    public string? Summary { get; set; }
}

public static void Main()
{
    var forecast = new WeatherForecast
    {
        Date = DateTime.Now,
        TemperatureCelsius = 25,
        Summary = "Sunny"
    };

    string jsonString = JsonSerializer.Serialize(forecast, MyJsonSerializerContext.Default.WeatherForecast);
    var deserialized = JsonSerializer.Deserialize<WeatherForecast>(jsonString, MyJsonSerializerContext.Default.WeatherForecast);

    Console.WriteLine(jsonString);
}
```

In this example, a `JsonSerializable` attribute is used to generate a serializer for the `WeatherForecast` class. By using the generated context in serialization and deserialization, the process becomes more efficient as it avoids the use of reflection at runtime.

`System.Text.Json` source generators are a powerful way to optimize JSON operations in .NET applications, particularly beneficial for high-performance scenarios like web services and applications dealing with large amounts of JSON data.
How to Export Global Variables in Node.js
Published: 2023-12-15 15:27:01

Imagine you are using Koa.js to create a route, and within that route, you retrieve a key that you intend to use in another router, function, or elsewhere. In such cases, you may want to use the easiest method to export that key for subsequent use.

One of the easiest case are export that key with global variable, to do that you may try weird thinngs likes me 



```js
let key = ''
const router = new Router();

router.get('/createkey', async (ctx: ParameterizedContext) => {
  const tokenData = await getToken();
  key= tokenData.access_token ;
  await client.set('createkey', tokenData.access_token, { EX: 2399 });
  ctx.body = 'Key created'
  console.log('Key created')
  console.log(key)
});
 
export { key, router as default };
```
Trust me, that doesn't work. The easiest way to achieve this in Node.js is by using the global object.

```js
global.key 
```


```js
const router = new Router();

router.get('/createkey', async (ctx: ParameterizedContext) => {
  const tokenData = await getToken();
  global.key= tokenData.access_token ;
  await client.set('createkey', tokenData.access_token, { EX: 2399 });
  ctx.body = 'Key created'
  console.log('Key created')
  console.log(global.key)
});
 

export default router;
```

With that object, you can access and modify your global variable in every part of your project.
How to fix error `operation aborted by callback` with OpenAI PHP SDK
Tags: php, openai
Published: 2023-12-15 15:26:37

During uploading a file to OpenAI API you can receive an error:
```bash
Fatal error: Uncaught Exception: operation aborted by callback in /var/www/html/vendor/orhanerday/open-ai/src/OpenAi.php on line 962
```

Here is my code which produces this error:
```php
require 'vendor/autoload.php';
use Orhanerday\OpenAi\OpenAi;
$openAi = new OpenAi($_SERVER['OPEN_AI_KEY']);
$pricesFile = curl_file_create(__DIR__ . '/../data/file.json');
$file = $openAi->uploadFile([
    'file' => $pricesFile,
    'purpose' => 'assistants',
]);
```

## Solution
The problem is that I didn't have the file on the provided path: `__DIR__ . '/../data/file.json`. You need to check and fix the path and then run your script again.

Follow me on [X (prev Twitter)](https://twitter.com/iamkirillart)
Don’t Live with Broken Windows
Tags: codenewbie, softwaredevelopment
Published: 2023-12-15 15:20:50

| 🔴 **Disclaimer**: This post is enhanced with AI assistance.|
|--------------|


> Fix bad designs, wrong decisions, and poor code when you see them. ~ Tip #5 - The Pragmatic Programmer

---

In realms of code, where logic weaves its spell,
A broken window, a tale to tell.
Not panes of glass, but flaws unseen,
In functions wonky, logic unclean.

Bad designs, like weeds that choke the ground,
Spread their tendrils, where clarity's drowned.
Wrong decisions, like cracks in the wall,
Threaten the structure, ready to fall.

Poor code, a whisper in the dark's embrace,
A ticking time bomb, a potential disgrace.
Don't live with these windows, don't let them reside,
For in their shadows, progress will hide.

Fix them, dear developer, with a steady hand,
Refactor, rewrite, make the code understand.
Polish the logic, let beauty take hold,
Replace the brittle with stories untold.

Embrace the challenge, the struggle to mend,
For in the fixing, your skills ascend.
Each broken window, a chance to refine,
To build a system, that's truly divine.

Don't let inertia hold you in its sway,
Confront the flaws, let the sunlight play.
For in a landscape, where code takes flight,
Broken windows mended, reveal only light.

So shine your light, on every line you write,
Banish the shadows, with all your might.
Let your code whisper, "I'm built to endure,"
And in its perfection, your legacy ensure.

---

> Powered by: Google Bard