teleren/devto huggingface dataset:
Building any open-source projects this weekend?
Tags: weekend, opensource, beginners, discuss
Published: 2023-07-21 15:38:37

Weekends are my _sacred_ time ... where I **build** my open-source projects. 


![Weekend Meme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pverlxjj3nw41b5mbr51.jpg)



## Papermark - the open-source DocSend alternative.
This weekend, I'll be building on Papermark. It's an open-source project for securely sharing documents with built-in real-time, page-by-page analytics.

I would be absolutely thrilled if you could give us a star! Don't forget to share your projects and thoughts in the comments section ❤️

https://github.com/mfts/papermark


## Live Updates 🔴
I will share periodic updates as I'm building :)

---
I'm interested in what you are working on (this weekend)? Any open-source projects?
Writing a NES game, day 9, my friend ChatGPT
Tags: blog, nes, retroprogramming, chatgpt
Published: 2023-07-21 15:24:50

Yesterday I started to do some more complicated code. That in assembler can be a REAL pain. At some point nothing was working and I didn't have a clue on why. In "normal" programming languages that can be easy to debug and fix and easy to see where the problem is (well, not all the time but you have a lot of hints), in this thing it is HARD, VERY HARD.
In my desperation I asked chatgpt if he can help me with 6502 nes code and said yes.
I had to copy all my code to the chat and after several iterations it started to work again.

Now I think that chatgpt is not perfect and he misses the point some times, but it resembles me of coding with friends, see what is wrong and try to fix things. It is not a solution but a GREAT help.

Now I have to fix something with the looping (seems that every time I release, the character goes again to the starting position but I think I know why...)
Multi-Cloud Networking Market Future
Published: 2023-07-21 15:12:17

From 2023 to 2032, the size of the global Multi-Cloud Networking market is projected to grow at a CAGR of 24.5%, according to research done by CMI Team. The size of the market is expected to be worth USD 3.02 billion in 2023. It is expected that the value will hit USD 20.55 billion by 2032.

Several changing factors drive the rise and change of the Multi-Cloud Networking market. Among these factors are:

Trends in using the cloud: The Multi-Cloud Networking market is mostly driven by the fact that more and more businesses are using cloud computing. As more companies move their applications and workloads to the cloud, there is a growing need for solutions that make it easier to connect to and manage various cloud environments.

Initiatives for Digital Transformation: Organisations all over the world are using digital transformation to improve business efficiency, agility, and the customer experience. Multi-cloud networking lets different cloud services and data work together without any problems. This helps digital transformation plans by creating a single, connected infrastructure.

Hybrid Cloud Deployments: Many businesses choose hybrid cloud models, which combine both public and private cloud services. Multi-cloud networking is a key part of making sure that communication and data flow are smooth between these different settings. This lets businesses use the benefits of both types of cloud.

Use of Specialised Services: Different cloud service companies offer services and tools that are tailored to the needs of a business. Organisations use multi-cloud strategies to take advantage of these different offerings and improve the speed and functionality of their apps and services by making the most of what each cloud has to offer.

Vendor Diversity and Vendor Lock-In: Organisations choose more than one cloud vendor to escape being stuck with a single cloud provider. This approach gives them more freedom to negotiate better terms, get prices that are competitive, and spread risk among different providers.

Contact Us:

Joel John

CMI Consulting LLC

1333, 701 Tillery Street Unit 12,

Austin, TX, Travis, US, 78702

USA: +1 801-639-9061

India: +91 20 46022736

Email: support@custommarketinsights.com

Web: [https://www.custommarketinsights.com/](https://www.custommarketinsights.com/)
Mock PrimeNg ChartModule con Spectator
Tags: angular, spectator, jest, testing
Published: 2023-07-21 15:08:06

Recientemente, migramos algunas librerías a Jest y nos encontramos con problemas en los tests que habíamos creado para un componente que utilizaba el módulo de gráficos de PrimeNg (que a su vez es un wrapper de ChartJS).

A primera vista, identificamos que el problema radicaba en la falta de soporte de Jest para Canvas, MutationObserver y otras APIs del navegador necesarias para ejecutar los tests (Usábamos Karma).

Finalmente, nos dimos cuenta de que teníamos dos opciones: hacer mock de estas APIs del navegador o hacer mock del módulo de ChartModule. Como estábamos utilizando Spectator para realizar los tests, logramos hacerlo fácilmente (después de mucha búsqueda, prueba y error).

En primer lugar, creamos un mock para reemplazar lo que necesitábamos. En este caso, dado que PrimeNG sigue utilizando módulos, creamos un componente y un módulo de prueba específicamente para este propósito.

```
// Componente que contiene chart.js en ChartModule de PrimeNG
@Component({
    selector: 'p-chart',
    template: 'PrimeNg Chart - mocked component'
})
class MockUIChart {
    // Aquí agregamos todos los imputs que estemos utilizando
    @Input()
    data: unknown;
    @Input()
    options: unknown;
    @Input()
    plugins: unknown;
}
// Módulo que importa y exporta el componente
@NgModule({
    declarations: [MockUIChart],
    exports: [MockUIChart]
})
export class MockChartModule {}
```

Y en nuestro test hacemos:

```
describe('ComponentStandalone', () => {
    let spectator: Spectator<ComponentStandalone>;

    const createComponent = createComponentFactory({
        component: ComponentStandalone,
        overrideComponents: [
            [
                ComponentStandalone,
                {
                    remove: { imports: [ChartModule] },
                    add: { imports: [MockChartModule] }
                }
            ]
        ]
    });
});
```

Con esto evitamos que el componente de p-chart en el OnInit trate de instanciar ChartJS que era la raíz de todos los warnings en Jest.

¿Tienes alguna experiencia con Jest, PrimeNg o herramientas de testing que te gustaría compartir? ¡Déjame tus comentarios!
Primer to integrate Android Views in Jetpack Compose
Tags: android
Published: 2023-07-21 15:08:36

---
title: Primer to integrate Android Views in Jetpack Compose
published: true
date: 2023-07-21 15:06:12 UTC
tags: Android
canonical_url: https://www.rockandnull.com/views-in-jetpack-compose/
---

 ![Primer to integrate Android Views in Jetpack Compose](https://images.unsplash.com/photo-1528569937393-ee892b976859?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8c2VhcmNofDF8fGxlZ2FjeXxlbnwwfHx8fDE2ODk5NTE4MjV8MA&ixlib=rb-4.0.3&q=80&w=2000)

Jetpack Compose is a great tool for creating user interfaces (UI) in your app. It makes the process of building views more enjoyable. However, traditional Android views have been used for the past 10 years. So, if you're developing a reasonably sized app, you might come across some older widgets that you want to use in your new shiny app built with Compose.

No worries though! The Compose team has come up with a solution—a backward-compatible API that allows you to use Android Views in your Compose app in a relatively easy and elegant way. This means you can integrate those older widgets seamlessly into your new Compose-based app.

This is a super quick primer into the basic usage of the Android Views compatibility API that can be used in Compose apps to use a "legacy" Android View widghet.

```
    AndroidView( // 1.
        factory = { context -> // 2.
        
            val linearLayout = LinearLayout(context).apply {
                orientation = LinearLayout.VERTICAL
            }
            val view = TextView(context).apply {
                tag = "my_view"
            }
            linearLayout.addView(view)
            linearLayout
            
        },
        update = { viewCreatedFromFactory -> // 3.
        
            val myView =
                viewCreatedFromFactory
                    .findViewWithTag<TextView>("my_view") // 4.
            [...]
            
        },
    )
```

1. The compatibility layer is implemented with the `AndroidView` composable function. 
2. First, you need to create or inflate the Android View using the `factory` method. You are provided with the Android `Context`. For example, you can manually create a `LinearLayout` and add a `TextView` inside it.
3. The `update` method is called on every recompose. This can be used to update the view element after is has been created. Remember that since this is called for **every** recompose, you would need to use a `remember` or keep track on what this update method has "consumed" in your `ViewModel`.
4. You can use any method you want here to obtain references to views. Notice that the `update` method provides the parent view that has been created in the `factory` method above.

And that's it! You've learned the basics of embedding your existing Android Views into your Compose app. If you want more in-depth information, check out the excellent [documentation](https://developer.android.com/jetpack/compose/migrate/interoperability-apis/views-in-compose) on the official website. Happy coding!

Happy coding!
Prompt Engineering | what is Prompt Engineering 🤖
Tags: promptengineering, ai, programming
Published: 2023-07-21 15:02:46

Prompt engineering is a cutting-edge technique in the realm of artificial intelligence (AI) that focuses on crafting text prompts used to interact with AI systems. The main objective of prompt engineering is to optimize AI system performance by providing them with more specific and informative prompts.

Prompts serve as instructive cues guiding AI systems in various tasks such as writing poetry, translating sentences, or answering questions. The efficacy of a prompt lies in its ability to effectively convey the desired task to the AI system.

This relatively new field of AI, prompt engineering, already shows great promise. By meticulously designing prompts, AI engineers can significantly enhance AI system performance across a diverse range of tasks.

Examples of prompt engineering techniques include:

**Chain-of-Thought (CoT) Prompting:** A method that prompts AI systems to solve multi-step problems by providing step-by-step breakdowns. This aids the system in arriving at correct solutions.

**Attention Prompting:** A method to prompt AI systems to focus on specific parts of a prompt. It helps AI systems understand complex prompts and concentrate on specific aspects of a problem.

**Negative Prompting:** A method to prompt AI systems to avoid generating certain types of outputs. Negative prompts help AI systems stay on topic and prevent generating offensive or inappropriate content.

Prompt engineering is an ever-evolving domain with novel techniques continuously emerging. As AI systems advance in sophistication, the importance of effective prompt engineering will only grow.

Advantages of prompt engineering include:

**Improved Performance:** Prompt engineering significantly boosts AI system performance across diverse tasks.

**Increased Flexibility:** AI systems become more adaptable and flexible to handle new tasks through prompt engineering.

**Reduced Bias:** By fine-tuning prompts, prompt engineering helps mitigate bias in AI systems.

However, prompt engineering also faces several challenges, such as:

**Complexity:** The prompt engineering process can be intricate and time-consuming.

**Lack of Standards:** Currently, there are no universally accepted standards for prompt engineering.

**Interpretability:** Understanding how prompts influence AI system performance can be challenging.

In conclusion, prompt engineering holds great potential for enhancing AI system performance. Although certain challenges require attention, the continued progress of prompt engineering promises to revolutionize the field of artificial intelligence. As this methodology advances, it will undoubtedly play a pivotal role in shaping the future of AI applications.
Meetup #001 AWS Brasília User Group
Published: 2023-07-21 14:52:10

Ontem foi um dia especial, pois realizamos com sucesso o nosso primeiro meetup da AWS User Group Brasília! Gostaria de expressar minha imensa gratidão a todos os participantes que estiveram presentes neste evento marcante. Foi uma experiência incrível compartilhar conhecimentos, ideias e perspectivas sobre a AWS e a computação em nuvem.

A jornada até aqui foi repleta de dedicação e empenho de nossa equipe, e ver o interesse e o entusiasmo de cada um de vocês foi verdadeiramente inspirador. O nosso AWS User Group Brasília nasceu da paixão em torno da tecnologia e da vontade de aprender e crescer juntos. Hoje, mais do que nunca, tenho certeza de que fizemos a escolha certa ao criar essa comunidade.

Agradeço imensamente aos nossos palestrantes, que compartilharam seus conhecimentos de forma tão generosa e cativante. Cada apresentação foi enriquecedora e trouxe uma nova perspectiva para todos nós. Essa colaboração e espírito de comunidade são fundamentais para o nosso crescimento coletivo.

Estamos apenas começando nossa jornada juntos, e tenho certeza de que temos um futuro promissor pela frente. Vamos continuar a realizar mais encontros, workshops e eventos que nos permitirão aprofundar nossos conhecimentos e fortalecer nossos laços como uma comunidade.
Algumas fotos do evento: 


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


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4h7p8c1x75la1ru6qydt.jpeg)
Adianti - Nginx rewrite rules
Tags: adianti, nginx, rewrite, rules
Published: 2023-07-21 14:49:12


No tutorial de "[Serviços RESTful no Adianti Framework 7](https://adiantiframework.com.br/forum/view_4701?servicos-restful-no-adianti-framework-7
) ", especificamente no item "Configurando as rotas" podemos encontrar as configurações que devem ser aplicadas no servidor Apache.

```
#RESTFUL routes
RewriteRule ^contacts/([A-Za-z0-9]*)$ rest.php?class=ContactRestService&method=handle&id=$1&%{QUERY_STRING} [NC]
RewriteRule ^contacts/([A-Za-z-_0-9]*)/([A-Za-z-_0-9]*)$ rest.php?class=ContactRestService&method=$2&id=$1&%{QUERY_STRING} [NC]
RewriteRule ^contacts$ rest.php?class=ContactRestService&method=handle&%{QUERY_STRING} [NC]
```

Com a regra acima, podemos fazer chamadas como http://localhost/sistema/contacts/1 ao invés de http://localhost/sistema/rest.php?class=ContactRestService&method=handle&id=1.

Muito legal, não é mesmo?

Sim, é legal, mas perceba que para cada serviço Rest do seu sistema você terá que repetir essas regras.

Mas, como fazer se nosso webserver for o Nginx?

Edite o arquivo de configuração do seu domínio hospedado no nginx e procure pelo bloco location.

Ex:

```
location / {

    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ =404;

    #
    # Adianti REST services
    #
    rewrite ^/auth$                          /rest.php?class=ApplicationAuthenticationRestService&method=getToken last; # Autenticar usando método POST (Recomendável)
    rewrite ^/api/([\w]+)/([\w]+)$           /rest.php?class=$1RestService&method=handle&id=$2&$args              last;
    rewrite ^/api/([\w]+)/([\w]+)/([\w]+)$   /rest.php?class=$1RestService&method=$3&id=$2&$args                  last;
    rewrite ^/api/([\w]+)$                   /rest.php?class=$1RestService&method=handle&$args                    last;
  }

```

Verifique se está tudo configurado corretamente e reinicie ser servidor nginx.

Agora a grande sacada é o fato de utilizarmos expressões regulares para identificar o nome do serviço Rest.

Ex:

Se você tiver um Modelo chamado Contact, basta criar o arquivo rest com o nome ContactRestService.php e o serviço já estará funcionando.

Se tiver outro model chamado Product, crie o arquivo rest com o nome ProductRestService.php.

Prático, não?
Meet The Gnarnians: Erik
Tags: softwareengineering, culture, community
Published: 2023-07-21 14:34:56

## **Gnarnian [nahr-nee-uhn] _noun_:** An employee of The Gnar Company

In our _Meet The Gnarnians_ series, we unravel the stories, experiences, and passions that drive the folks on our talented team at The Gnar. Through a collection of interview-style questions, you’ll get a sneak peek into daily life on our fully-remote team, some epic origin stories, and answers to some questions as weird and wonderful as our team itself.

**The Basics**

**Where are you located?** Chicago, IL

**What is your Role?** Software Engineer

**When did you join the Gnar?** December 2021


## What’s the last song you played or are listening to right now?

Ballroom Blitz. The Crucial Taunt version.


## What was your career journey up until joining the Gnar?

I started out in networking and servers and took a nice long education break before coming back as a developer, then worked for a nonprofit for a long time before joining an early stage startup. In general, I've just stayed curious by doing what I want and things have worked out pretty well.


## In your role, do you have any specializations or areas of focus you really enjoy doing?

I really enjoy designing software systems: Thinking in terms of architectural patterns, how best to model the real world concepts involved, how you can play to the strengths of your chosen language, and so on. There's something very satisfying about producing things that are easy to understand and do what you expect, and the design phase is generally where you're closest to what stakeholders really want in the end, whether it's a feature or a greenfield app.


## What is your ideal work/desk set-up?

A standing desk, (not a convertible, which I will not convert) with good light, decently-but-not-maximally clackety keyboard, enough screen real estate to read a browser tab and a terminal (dark text, light background) at the same time. Zsh, tmux, vim, asdf. Good headphones for music, which I will feel weird about wearing for meetings. Coffee, for which my taste is utterly gauche.


## What has your experience been at Gnar?

I've gotten to be involved in a long standing state project with a really interesting back end architecture, which is maybe not the first thing you picture working on going into a Rails consulting shop. It's very satisfying to see features through not just to completion but all the way through fine tuning them in the real world. The best answer here though is the people--- folks at Gnar are really welcoming and supportive.


## What advice would you give someone who is just starting out in your industry?

Don't let popular opinion tell you what success looks like for you. There are a ton of great jobs out there in the world, so keep an open mind and figure out what makes you happy and keeps you curious. And it's ok to go slow.


## Outside of work, what do you enjoy doing? 

Music. Listening to it, playing it, recording it, talking about it, etc.


## If you weren’t in your current role, what would you be doing?

Live sound guy.

_Learn more about [The Gnar and our team](https://www.thegnar.com/about)._
HISTORY OF PHP
Tags: html, programming, beginners, codepen
Published: 2023-07-21 14:32:27

PHP is a general-purpose scripting language geared toward web development.
It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementation is now produced by The PHP Group. PHP was originally an abbreviation of Personal Home Page, but it now stands for the recursive initialism PHP: Hypertext Preprocessor.

PHP development began in 1993 when Rasmus Lerdorf wrote several Common Gateway Interface (CGI) programs in C, which he used to maintain his personal homepage. He extended them to work with web forms and to communicate with databases, and called this implementation "Personal Home Page/Forms Interpreter" or PHP/FI....

Read more https://medium.com/@storyarchives360/introduction-to-php-php-is-a-general-purpose-scripting-language-geared-toward-web-development-93c4fb97fc0
Building a REST API with FastAPI, Async SQLAlchemy, and PostgreSQL
Published: 2023-07-21 14:15:45

In this video, we shall be Building a REST API with FastAPI, Async SQLAlchemy, and PostgreSQL. We explore the Async  SQLAlchemy 2.0 features and also some new features of Pydantic. We also use PostgreSQL as our data store for this project.

{%youtube nC9ob8xM3AM%}
Experimente meu game de Dragon Ball no Scratch
Tags: gamedev, scratch
Published: 2023-07-21 14:09:21

Experimente meu jogo feito dentro do scratch!

Foi um projeto desenvolvido como tarefa para um curso na edX e gostaria de apresentar a vocês essa maravilha de projeto.


![Dragon Ball no Scratch](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9myz022ky7ewn756yc1p.png)

Ainda falta muita coisa, mas já dá pra notar que pode se tornar algo bem bacana no futuro. Vou adicionando outros recursos, personagens, assets com o passar do tempo e vou atualizando aqui dentro do `DEV`

Espero que goste da trilha sonora! ~~SINTA A NOSTALGIA~~

Aqui está o link para jogarem:
https://scratch.mit.edu/projects/770653435/

E se você tiver algum feedback, deixe abaixo aqui. Caso queira contribuir de alguma maneira, basta entrar em contato comigo pelo email: duartewgo@gmail.com

Espero que tenham gostado! ~~BRIGADUH!~~
ASK: Tips for upskilling wanted
Tags: learning, onboarding, devex, devrel
Published: 2023-07-21 13:57:27

I was recently on the [HackerEarth discord](https://discord.com/channels/1017052886775115817/1060855341186826291/1130157633542824016) and had a the following question so I figured I would post it here with some thoughts an simple form.  Based on your feedback I'll share the results...maybe I'll have the ambition to create a fun infographic.

I love hackathons to build learn new skills, but how do you stay motivated between hackathons? Also, what do you do if you need a skill and there isn't a hackathon going on?

1. **Self-Assigned Projects:** I like assigning myself small projects.  I like having a deadline in a hackathon. I also like there is finished product in the end so you have something tangible to show for your work.  Lastly, I like that you have to share your work.  Winning a prize is cool, but the real value is having to think through how to communicate the problem your project is solve for the world.

2. **Learning Paths:** Many large tech companies like Google, Amazon and Microsoft have learning paths on their websites to help developers build skills in a specific order.  This is great and can help lead to getting some certifications too.  But this is limited to that technology or company.

Questions:
- How do you build skills across technologies?  
- What if you need to learn something for work, like a custom app your team built internally on java and your going extend it with a mobile app in React Native?  There are ton of good resources on learning React Native, but you also need your team to learn about the existing app or some other internal process, like how your devops pipelines work?
- How do you decide what skills to build?
- How do you set goals and track progress?
- What challenges do you have in staying motivated?
- Do you use any tools for yourself or your team now to help with this challenge?  Do you pay for them?

Feel free to share your thoughts in the comments or in this [survey](https://forms.gle/XyqTooYXYjcb3Lbm7).