teleren/devto huggingface dataset:
Coloring Canvass Generator!
Tags: cloudflarechallenge, devchallenge, ai
Published: 2024-04-12 22:45:16

*This is a submission for the [Cloudflare AI Challenge](https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99).*

## What I Built

Generate a printable coloring canvass in PDF format based on 

any themes, genres powered by Artificial Intelligence.


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

## Demo
https://illah-creatives.pages.dev/

Step 1
{% embed https://youtu.be/V-gGSn5ad2M %}

Step 2
{% embed https://youtu.be/uhRGX6cNiJU %}

Step 3
{% embed https://youtu.be/VaItaKymCTs %}

**Sample outputs**

Promt of _Cyberpunk Motorcycle hero will generated_ [this](https://drive.google.com/file/d/1vMHBd46HPp405tLp3yTESetN75TbI57k/view)

Prompt of _Lion, Bear, Wolf and Owl_ will generate [this](https://drive.google.com/file/d/1X1_cCeSAPahIAtsaim65ub0JekirlAs-/view).

## My Code
Web App
https://github.com/MarkMatute/illah-creatives

Microservices
https://github.com/MarkMatute/illah-creatives-text-generator
https://github.com/MarkMatute/illah-creatives-image-generator
https://github.com/MarkMatute/illah-creatives-art-assistant

## Journey

I am currenlty in the journey of learning and exploring Machine Learning and Artificial Intelligence when I came accross the post. With this momentum I decided to pick a simple project that me or my family can use. 

With this project that can generate almost unlimited pages of coloring books with any themes you want or based on who you are, or whatever preferences you have.

With this project, I learned alot about different type of models and how to leverage them. It also exposed me from what I do not know as of the moment, like proper prompting etc. Also opened doors for me to use Cloudflare more than its normal use case. The platform itself trully is cool! I am just proud to come up with this idea that surely some people can enjoy. 

**Tasks types used:**
1. Text-To-Image
   1. Theme to canvass cover image
   2. Each themes to coloring page image
2. Text-Generation
   1. Illah's chat assistant that focuses on generating themes 
      for user
   3. Cool canvass titles that matches context with generated 
      themes
   2. Cool names for generated canvass pages

**Models used:**
1. @hf/mistral/mistral-7b-instruct-v0.2
2. @cf/meta/llama-2-7b-chat-fp16
3. @cf/stabilityai/stable-diffusion-xl-base-1.0

**Improvements for this project:**
1. Parallel generation of each canvass page for faster processing
2. More tailored chat assistant, not only for generating themes but also for more tasks.
3. To add an image to image generation of canvasses

**Multiple Models and/or Triple Task Types**

Models used:
1. @hf/mistral/mistral-7b-instruct-v0.2
2. @cf/meta/llama-2-7b-chat-fp16
3. @cf/stabilityai/stable-diffusion-xl-base-1.0


<!-- Thanks for participating! -->
AI enthusiasm #3 - AlphaFold2, a game-changer🧬
Tags: opensource, learning, bigdata, ai
Published: 2024-04-12 22:00:51

#AI solves the protein folding problem
## A tough challenge
One of the longest standing-by problems of Life Sciences was protein folding. 

For starters, folding is the process through which a protein is turned from a linear string of amino-acids to a three-dimensional working unit, suitable for carrying out all sorts of tasks in living cells. 

This is a key problem not only because proteins are _the_ fundamental building blocks of life, but also because **mis**folding (i.e. errors that occur while building the 3D structure) is at the heart of lots of human and animal diseases and abnormalities. Moreover, proteins are a target for lots of drugs (antibiotics, for example) and they can also be employed in a wide variety of industrial fields (most of clothes detergents contain enzymes to remove dirt and stains, e.g.).

In this sense, knowing the 3D structure of a protein thanks to a fast, reliable and scalable _in silico_ method, such as a predictive algorithm, is much easier than exploiting slow and expensive laboratory procedures, such as crystallography (which is, nevertheless, still considered the golden standard for protein structure reconstruction).

For 50 years, 3D structure prediction has been a real struggle for bioinformatician, because no algorithm seemed to get accurate results, but then Google Deepmind team came, and the rules of the game changed.

## Alphafold, a game changer
In 2020, AlphaFold 2 won the Critical Assessment of Structure Prediction - 14 (CASP14), a protein fold competition, with unprecedented results. 

In this competition, participants are evaluated according to GDT, Global Distance Test: the score ranges from 0 to 100, with 100 meaning that all amino-acids in the predicted 3D structure of the protein are exactly where they are supposed to be, or within a threshold distance. Formally, a GDT of 90 is considered to be competitive with laboratory procedures: in 2020, AlphaFold 2 got a median score of 92.4 overall, with the lowest being around 87. Considered that no one, not even AlphaFold (base version), had surpassed 60 in the previous editions of CASP, that was a shockingly impressing result.

Now AlphaFold 2 can be used as a research tool by everyone: you can either run it within Colab ([here](https://colab.research.google.com/github/sokrypton/ColabFold/blob/main/AlphaFold2.ipynb)) or you can search through the [AlphaFold database](https://alphafold.ebi.ac.uk/), which encompasses more than 200,000,000 predicted structures: if you scrape through it long enough, you may also come across a protein structure that no one has ever seen!

So, now comes the big question: should we trust AI and rely on that for a task as delicate and critical as protein structure prediction? Share your thoughts in the comments below!
DevLog #10 - Product Backlog
Tags: agile, backlog, sprint
Published: 2024-04-12 21:57:47

Product backlog plays a main role in Agile practice that enables the clear representation about what should be developed to deliver value to the customer. Product backlog should be a dynamic entity that always open to updates and refinements with based on feedbacks of customers, changes in business requirements, new market trends and learnings through developments.

According to our project, we have been maintaining our backlog through out the project development period up to now as discussed above. Based on the actual customer requirements, we added new user stories into the backlog. From leaning through our developments, we removed some details showing stories since our current development has catered that feature already and we could deprioritised some user stories. Normally we expected to have login screen for the user in the first app opening and we changed it to have a login while applying for the shift based on new market trends.

As I explained above I think we can maintain product backlog though out the project adding, refining, removing and prioritising backlog items. It will help to deliver the best value to the customer end of the project.
Omnilingual AI - Talk with AI in your language
Tags: cloudflarechallenge, devchallenge, ai, flutter
Published: 2024-04-12 21:30:57

---
title: Omnilingual AI - Talk with AI in your language
published: true
tags: cloudflarechallenge, devchallenge, ai, flutter
---
![Omnilingual AI in action](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c5amorqzitsrsm05qtz7.png)
*This is a submission for the [Cloudflare AI Challenge](https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99).*

## What I Built

"**Omnilingual AI**" - Your Multilingual Conversation Companion! 
Talk with AI in your preferred language and receive responses translated instantly. You can customize the AI model, the input and the output language.

## Demo
Try out the demo at: https://omnilingual-ai.dragan.workers.dev/

The UI frontend, powered by **Flutter**, ensures a consistent user experience across all devices, including browsers, mobile phones, tablets, and desktops.

## My Code
Check the code on GitHub: [https://github.com/drashmk/omnilingual-ai](https://github.com/drashmk/omnilingual-ai).

## Journey

The journey of building "Omnilingual AI" was an interesting and challenging one. Most AI LLMs work best in English, which can be challenging for many, especially kids, whose primary language isn't English. "Omnilingual AI" solves this by understanding and responding in multiple languages, making AI accessible to everyone, regardless of their language.

To make it work, the worker utilizes the [@cf/meta/m2m100-1.2b](https://developers.cloudflare.com/workers-ai/models/m2m100-1.2b/) translation model. It translates the input into English, sends it to the selected text generation LLM and then translates the response in the selected language. 

I chose Flutter for the UI frontend due to its versatility and ability to run on various platforms. 
Its widget library makes crafting visually appealing and responsive user interfaces a breeze(also because my day job is backend developer, this helped me to make the prototype faster while ensuring it didn't look like made by a BE dev:grin:).

Each bubble contains an "**Original->**" button, which reveals the original response from the LLM before translation.

**Multiple Models and/or Triple Task Types**

* [Text Generation](https://developers.cloudflare.com/workers-ai/models/#text-generation) Models for the conversation with AI, configurable from the dropdown in the :gear:Settings menu
* [@cf/meta/m2m100-1.2b](https://developers.cloudflare.com/workers-ai/models/m2m100-1.2b/) for translating between the user and AI
SYSTEM DESIGN SERIES TOPIC: A PERCURSOR TO APPROACHING YOUR SYSTEM DESIGN
Published: 2024-04-12 21:10:39



The Design of Software systems vary according to technical requirements. It is common practice for engineers to adopt a particular approach to every system they design, based on common requirements across lots of systems previously worked on.
It is correct to quickly ask the right questions, such as:
1) What is the Data Model (Nature and Structure) we are dealing with here?
2) What is the type of processing the system will be handling? We know it is necessary to be certain if the system will be doing either extremes of real-time processing, batch processing, or if its somewhere along the middle.
3) What are the security requirements?
4) Are we running on multi-threaded or single-thread technology? What are the implications on underlying Computing resources? What is the expected efficiency of the underlying Operating System's Process Control Block (PCB) and scheduler in managing the monitoring and allocation of resources for the concerned processes? Among many other questions. 

However, it's also important to note that beyond API gateways, load balancers, Queues, Caches, Shards, etc, there are important factors that must be determined presently, and established, which will guide the inclusion of system components, and their varying manners and degrees of "inter-actions" before just rushing on to couple them together. This is not a call towards perfectionism; as that in itself is detrimental.

Rather, it is a call for efficient and solid design of systems, that are able to "grow" into their future versions without technical and business losses. It is also an attempt to transform the field of system design while helping engineers build better, lasting, and futuristic systems.
Every system is unique in its own rights. When we maintain this posture to determining the components and nature of interactions that should make up a system, we are often blessed with a result that stands through time, the various tests that successful systems are often faced with. And that begs the ultimate guiding question, what is a successful software system?
 
From my research and studies, I have determined a successful system is one that proves its possession of the following characteristics:
 
1) Functionality
2) Flexibility
3) Reliability
4) Security
 
In the subsequent article next week, I will break down the 4 characteristics above. Stay tuned!
#StayWithTemy
#SystemDesign
Expand your Future, extensions in Dart
Tags: dart, learning, coding, flutter
Published: 2024-04-12 21:02:34

## Extend a class

In Dart, you can extend a class to add new class or instance methods.

```dart
extension FutureDelayed on Future {
 Future<T> delayed(int milliseconds) {
    return this.then((value) => Future.delayed(Duration(milliseconds: milliseconds), () => value));
  }}

void main() {
  Future<int> futureValue = Future.value(42).delayed(2000);

  futureValue.then((value) {
    print("here after 2 sec!");
  });
}
```

## Extend an async function

**In Dart, you can do something even more special!**

You can extend functions, and if these functions are asynchronous, you can create something truly remarkable. 

Let's dive into some practical and simple demonstrative examples.

### retry future
```dart
/// This extension enables us to create new methods 
/// for a function that takes a "remainingTimes" parameter 
/// as input and returns a Future with a generic T.
extension Retry<T> on Future<T> Function(int remainingTimes) {
  Future<T> retry(int count) async {
    while (true) {
      try {
        final result = await this(count);
        return result;
      } catch (e) {
        if (count > 0) {
          count--;
        } else {
          rethrow;
        }
      }
    }
  }
}

void main() {
 // wrap "asyncFunc" in an anonymous function 
 // that receive an input "remain" (this(count) written above in "retry")

 // asyncFunc will be retried up to a maximum of 3 times 
 // in case of an error. 
 ((remain) => asyncFunc()).retry(3)
}
```

### count elapsed time
```dart
/// This extension enables us to create new methods 
/// for a function without parameters 
/// and returns a Future with a generic T.
extension FutureMeasure<T> on Future<T> Function() {

  Future<T> measure() async {
    Stopwatch stopwatch = Stopwatch()..start();
    try {
      final result = await this();
      return result;
    } catch (e) {
      rethrow;
    } finally {
      stopwatch.stop();
      print(stopwatch.elapsedMilliseconds);
    }
  }
}

void main() {
 // wrap "asyncFunc" in an anonymous function 
 // without parameter

 // will print the elapsed asyncFunc time
 (() => asyncFunc()).measure()
}
```

This way, it's easy to understand how to create your own extensions that **enhance asynchronous functions with specific capabilities tailored for your app**.
Navigating the Resilience Landscape: Polly & Temporal
Tags: dotnet, temporal, development, polly
Published: 2024-04-12 20:34:15


Both Polly and Temporal have become cornerstones in the quest for resilience in software systems. Polly is a library that boosts the resilience of .NET applications, effectively managing transient failures through strategies like retries, timeouts, and fallbacks. Temporal, on the other hand, manages long-running, reliable workflows, ensuring systems are fault-tolerant.

Polly's fluent API allows developers to easily create and manage retry policies, complementing Temporal's capabilities in orchestrating complex workflows. Although they operate at different levels of abstraction, both frameworks are united in their goal to architect systems that are robust against failures.

Polly's architecture allows for detailed policy configuration, which can dictate how often to retry an operation, or manage multiple bulkhead instances to prevent system overloads. Temporal's strength lies in its ability to maintain state across retries and even in the face of system failures, which is critical for applications requiring high reliability over long execution times.

Technical deep dive reveals that both frameworks are not just about preventing failures but also about managing them so efficiently that systems can continue to operate and recover without losing critical data or functionality. By leveraging both Polly and Temporal, developers are equipped with a full spectrum of tools to enhance application reliability and resilience.

This approach emphasizes the technical prowess of both frameworks without sounding too rigid, appealing directly to developers looking for robust solutions.

Resources:
https://learn.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/implement-http-call-retries-exponential-backoff-polly

https://thepollyproject.azurewebsites.net/about/

https://temporal.io
Quick dip: Use Google Cloud Vertex AI SDK with the Vercel AI SDK
Tags: genai, vercel, googlecloud, nextjs
Published: 2024-04-12 20:00:49

> _🏊‍♀️ This post is a quick dip. The opposite of a deep dive._

The [Vercel AI SDK documentation](
https://sdk.vercel.ai/docs/guides/providers/google) includes code samples for hooking up the SDK to different providers like [Anthropic](https://sdk.vercel.ai/docs/guides/providers/anthropic), [OpenAI](https://sdk.vercel.ai/docs/guides/providers/openai), and others.  This list includes [Google](https://sdk.vercel.ai/docs/guides/providers/google), but only shows you how to use the [Google AI JavaScript SDK](https://www.npmjs.com/package/@google/generative-ai). Here's some sample code of how to hook it up to the [Vertex AI SDK](https://www.npmjs.com/package/@google-cloud/vertexai):
 
```typescript
// app/api/chat/route.ts
import { VertexAI } from "@google-cloud/vertexai";
import { GoogleGenerativeAIStream, Message, StreamingTextResponse } from "ai";

const project = process.env.GOOGLE_CLOUD_PROJECT || "";
const location = "us-central1";

const vertexAI = new VertexAI({ project: project, location: location });

// Google GenAI API can use the edge runtime. This will not work with Vertex AI
// export const runtime = 'edge';

// Instantiate Gemini models
const generativeModel = vertexAI.getGenerativeModel({
  model: "gemini-pro",
});

const buildGoogleGenAIPrompt = (messages: Message[]) => ({
  contents: messages
    .filter(
      (message) => message.role === "user" || message.role === "assistant"
    )
    .map((message) => ({
      role: message.role === "user" ? "user" : "model",
      parts: [{ text: message.content }],
    })),
});

export async function POST(req: Request) {
  // Extract the `prompt` from the body of the request
  const { messages } = await req.json();

  const geminiStream = await generativeModel.generateContentStream(
    buildGoogleGenAIPrompt(messages)
  );

  // Convert the response into a friendly text-stream
  // GoogleGenerativeAIStream class decodes/extracts the text tokens in the
  // response and then re-encodes them properly for simple consumption.
  const stream = GoogleGenerativeAIStream(geminiStream);

  // Respond with the stream
  return new StreamingTextResponse(stream);
}
```
To run the above code, follow the instructions for the [Getting Started tutorial](https://sdk.vercel.ai/docs/getting-started) and use it for the `app/api/chat/route.ts` file. (Skip the API key step).

## Notes

Some differences between this Vertex AI SDK example and the one for the Google AI JavaScript SDK:
- We don't indicate the runtime as `'edge'` because it is not compatible with the Vertex AI SDK. [Click here for more information on the Edge Runtime and Node.js modules](https://nextjs.org/docs/messages/node-module-in-edge-runtime).
- Instead of API keys, Vertex uses a project ID indicated via the `GOOGLE_CLOUD_PROJECT` environment variable and application default credentials indicated via the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
HOW TO TELL YOUR PARTNER IS CHEATING; CYBERPUNK PROGRAMMERS
Tags: hack, phone, hire, hacker
Published: 2024-04-12 19:54:49

HOW TO TELL YOUR PARTNER IS CHEATING; CYBERPUNK PROGRAMMERS

Though most cheating involves sex, it is rarely just about sex itself. It’s about the efforts one puts in to communicate with a third party. Smartphones and social media platforms have made it easier than ever for people to cheat. It allows people to connect with others they wouldn't normally be able to. A phone placed face down is a known warning sign and is seen as a red flag that a person can be cheating or might be hiding something. Because it is known to cause suspicion of cheating the solution for many cheaters is to turn off their notifications or hide them to avoid questions. How can one get to know what their partner is up to on their phone without them knowing? CyberPunk Programmers has the solution. With their cutting edge technology and team expertise, the company is capable of helping you to access phones remotely, allowing you to stalk everything your person is up to at the comfort of your own phone. Simply visit their website CYBERPUNKERS DOT ORG or email CYBERPUNK @ PROGRAMMER . NET
Weekly Updates - Apr 12 2024
Tags: couchbase, community, database
Published: 2024-04-12 19:15:46

It's time for our Weekly Updates! 🎉 👋

- 🖥️ **New Release: Capella Terraform Provider v1.1.0 released!** We are happy to annouce the launch of v1.1.0 with the ability manage lots of resources, such as Scopes, Collections, Import Sample Buckets, App Services on/off on demand, and more! [*Read our release documentation here>>*](https://registry.terraform.io/providers/couchbasecloud/couchbase-capella/latest/docs/guides/1.1.0-upgrade-guide)
&nbsp;

- 📺 **Webcast: "Coding with AI: Vector Search and RAG"** Join us on April 16/17 for our "Coding with AI" Webcast. We will offer practical tips on how to use AI with vector search and vector embedding to make searching more meaningful, intuitive, and tailored to user needs. [*Read more and register here >>*](https://info.couchbase.com/webinar_Coding_With_AI_Vector_Search_RAG_2024M4_LP.html)
&nbsp;

- 📚 **New Blog - Embracing AI from Cloud to Edge With Google Distributed Cloud and Couchbase**  Our longtime trusted partner Google announced the Google Cloud Ready Distributed Program. [*To read more about what this means for you, read Mark's blog here >>*](https://www.couchbase.com/blog/google-distributed-cloud-and-couchbase/)
&nbsp;

- 🎓 **Couchbase Certifications** - Not only do we have training via [Couchbase Academy](https://www.couchbase.com/academy/), we also offer certifications. [*Learn more here >>*](https://www.couchbase.com/academy/certification/)
&nbsp;

- 🔊 **Join a Couchbase Meetup!** Checking out meetups is one of the best ways to get to know us and what we do. [Come find us on Meetup.com >>](https://www.meetup.com/pro/couchbase/). 
*Can't find a meetup near you? Let us know where you are and we will see what we can do!*
&nbsp;

Have a great weekend!
There is a fundamental change coming...
Tags: plang, learning, programming, ai
Published: 2024-04-12 19:13:02

> This article is about the Plang programming language, intent based programming language written in natural language. For more info checkout [plang.is](https://plang.is)

[![Eric describes coming times](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fkdek8vr20t594if6sxc.jpg)](https://youtu.be/gZZan4JMwk4?si=zz8XqIc7J12zXQpf&t=668)

_"The key insight is that any person can take an idea and make it happen."_

I think I let [Eric Schmidt finish that](https://youtu.be/gZZan4JMwk4?si=zz8XqIc7J12zXQpf&t=668). Video starts at 11:08, watch until 12:18.



Well, you can do it today with Plang. Well, almost, I mean, it's only at version 0.1 😉

## DraftIdea
DraftIdea is a plang app, that takes your idea and generates the plang source code for you.

You can check out [my video of where I create a movie database app](https://youtu.be/6JFJWS6rpMQ), by me describing what I want.

The code is not perfect, I do have to make some changes, not because of syntax error or outdated library reference, but because it doesn't know the Plang language. Think of this way: 

**GPT4 does not know the Plang programming language, I need to teach it the whole Plang language in the request 🤯 **

With that knowledge, can you imagine the power that an LLM can do in Plang when it has thousands and millions of apps to read and learn from.