teleren/devto huggingface dataset:
do{}while()_c++;
Tags: beginners, programming, javascript, webdev
Published: 2023-06-08 00:26:02

1. 

```
int main()
{
	int son;

	cin>>son;
	int i=1;

	do
	{
		cout<< son <<"*"<<i<<"="<<son*i<<endl;
		i++;
	}
	while(i <= 10);
	
}
```

```
int main()
{
	int son,i=1;

	cin>> son;

	while(1 <= 10)
	{
		cout<<son <<"*"<< i << "="<<son*i<<endl;
		i++;
	}
}
```

**bu kodda avval biz int toifasida son degan ozgaruvchi yaratib olyapmiz va uni cin qilib console da oqiyapmiz keyn do bilan statement yani son,qowtirnoq ichida kopaytiruv belgisi,i,ten belgisi va son kopaytirilgan i ni chiqar deyapmiz yozyapmiz va while bilan shart beryapmiz agar aks holda i ondan kichkina yoki teng bolsa deyapmiz bunda birinchi bolib kompyuter do ni oqib olayapti va chiqaryapti keyn while da berilgan shart togri bolsa yana do kiryapti aks holda avtomaticheskiy koddan chiqib ketadi do while ni oddiy while dan farqi shundaki while da shart true bolsa kiradi aks holda yoq do while da esa 1marta bolsa ham statementni chiqarib keyn flase bolsa koddan chiqib ketadi **
How to Brew the Perfect Coffee with Machine Learning
Tags: ai, machinelearning, learning, howto
Published: 2023-06-08 00:25:19

Ever been stuck in a deep caffeinated conundrum, pondering whether machine learning can aid your quest for the ultimate brew? Behold, Java-loving mortals! We are here to *espresso* our thoughts on this groundbreaking combination.

## The Perfect Blend of Beans and Bits

Machine learning, much like coffee, is all about finding the right blend. Data scientists and coffee connoisseurs, don’t you feel like a match made in heaven? Let’s stir things up!

## A Bean Counter’s Algorithm

Before we begin, take a deep breath and embrace the aroma of possibilities. Data and coffee share a common trait: when freshly ground, they’re both at their peak! Now, to brew coffee using machine learning, we need to track the most beantastic parameters:

- **Grind Size**: Too coarse, and you’ll be left with water that's barely coffee. Too fine, and it’s like trying to read binary code without your glasses.
- **Brew Time**: Imagine your computer takes ages to process data. Painful, right? Same with brewing – it's an art of timing.
- **Water Temperature**: If Goldilocks were a coffee bean, she'd tell you the water can’t be too hot or too cold; it has to be just right!
- **Coffee-to-Water Ratio**: This one’s the Holy Grail. You wouldn’t mix Python with ancient Latin, would you?

## Be The Bean: Training your Model

Collect data like a squirrel collects acorns. Your machine learning model needs to know its coffee as well as a barista knows the difference between latte and flat white.

Remember, a model is only as good as the data it consumes. Feed it well, and you might just end up with a model that challenges even the great Italian masters of espresso!

## Predicting Greatness

With your model trained, it’s time to put it to the test. Input your morning grogginess level, and let it prescribe the perfect coffee. Who needs human interaction before caffeine anyway?

## Deep Latte Networks

Just as you thought it couldn't get any better, I present to you the Deep Latte Network. It’s a neural network so good at making coffee, it could probably write a poem about the experience in the time it takes to froth milk.

## Results? Java-tastic!

You sip the coffee made by your very own machine learning model. The heavens open up, the code compiles, and suddenly, the meaning of life seems as clear as freshly brewed coffee. What more could you ask for?

## But Wait, There’s Mug!

I know you’re ready to sprint to your lab (or kitchen), but don’t forget to make a pitstop at [PAIton and Crossovers](https://www.youtube.com/channel/UCzUBm8oODJRZCHYVQtArgyA?sub_confirmation=1). This YouTube channel will perk up your machine learning skills, just like a good ol’ cup of joe. Subscribe now, and don’t let your machine learning brew go cold! 😉
How to Train Your AI to Choose Tonight’s Dinner: Bon Appétit, Bots! 🤖🍔
Tags: python, programming, ai, machinelearning
Published: 2023-06-08 00:20:35

Good evening, food enthusiasts, and welcome to the future of dinner decision-making! Tired of the age-old “What’s for dinner?” conundrum? Fear not, for your knight in shining armor is here, and it’s... an AI! Who needs a personal chef when you can have a silicon sous-chef! 🍳

**Step 1: Pick Your AI-Pprentice**

First off, let’s get you started with selecting an AI. There's a buffet of options, from ChatGPT to Siri, and Alexa to Google Assistant. Just like your taste in food, your AI should be to your liking. Extra cheese, please! 🧀

**Step 2: Gather Your Ingredients**

Before your AI can whip up a recipe, it needs to know what's in your pantry. Think of this as the “mise en place” of AI cooking. Now, don't overdo it; we don’t want the AI thinking you're making a sandwich for a giant. No infinite sandwich loops, please! 🥪

**Step 3: Spice It Up with Preferences**

Remember, an AI is only as good as the information it’s fed. Teach it your dietary preferences. Vegetarian? Keto? In a relationship with pizza? (aren't we all?) The more you spice up your AI with your tastes, the tastier your dinner plans will be! 🍕

**Step 4: Time to Sizzle and Simmer**

Ask your AI for recipe suggestions. It might occasionally suggest an oddball, like spaghetti tacos, but hey, variety is the spice of life. Experiment and give feedback. The more you cook together, the more your AI will evolve. Just like a fine wine, or a suspicious cheese that becomes surprisingly delicious. 🍷

**Step 5: Bon Appétit, Bots!**

Now, it's time to let your AI take the reins. Don't worry if it suggests 'robot ratatouille' or 'digital dumplings', it’s learning! Revel in the randomness, and soon, your AI will be choosing meals that make your taste buds sing like an operatic octopus in a spaghetti sea! 🐙

**In Summation…**

With patience, feedback, and an appetite for adventure, your AI will be serving up hot tips for your dinner plate! Just don’t forget to share your meal on social media with #BonAppétitBots and let the world marvel at the gourmet genius of your digital dinner partner!

Aaaaand, if you want to see AI and humans cooking up even more crossover magic, you better check out this stellar YouTube channel 🌟 [PAIton and Crossovers](https://www.youtube.com/channel/UCzUBm8oODJRZCHYVQtArgyA?sub_confirmation=1) 🌟! It’s like finding the secret sauce to make everything more awesome! 🍝

Happy dining, humans (and AIs)! 🥂
Principles for platform engineering
Tags: devops, tooling
Published: 2023-06-08 00:12:29

_Originally published [on my blog](https://robinwinslow.uk/principles-for-platform-engineering)._

I've learned a lot about how to build a good engineering team in my time at Canonical. An important piece of this was a term I ran into about a year ago, although it's definitely been around significantly longer than that: [Platform engineering](https://thenewstack.io/devops-is-dead-embrace-platform-engineering/).

Platform engineering is the deliberate design of an "internal developer platform" (IDF) to support developers in performing tasks to support the development and deployment of their projects. And, to me, it's a really essential component of good DevSecOps practice, to deliver projects in the most reliable way.

I've been reading [a lot more about](https://octopus.com/devops/platform-engineering/patterns-anti-patterns/) platform engineering recently, and mostly as an exercise to myself to solidify this knowledge, I'm going to write down some principles of good platform engineering:

1. *Invest in the platform*: If you develop a platform that falls into disrepair or is abandoned entirely, you will have done more harm than good. Don't steal good developers for the creation of the platform without replacing them - instead fully staff a new team to support the platform.
2. *Solve developer needs*: Start from key functions that the engineers actually need solved. Don't imagine use-cases, and don't create an overly general platform. Help out the developers. Test with developers. Ask for their feedback.
3. *Start small*: Don't try to solve everything at once. Find the most impactful place to create a platform enhancement and do that first, in isolation. Evolve from there.
4. *Create golden paths*: The most powerful part of platform engineering is the ability to create default paths for the most common use-cases that work out of the box.
5. *Focus on usability*: It's essential that the platform be simple, straightforward, easy to use. Use usability principles to make a well-described and pleasant interface.
6. *Empower developers*: Be very careful not to overly obfuscate or restrict developers' exposure to the underlying technologies. Platform tools should be deeply configurable, and, if possible, should act as progressive enhancements of the existing tools. Developers should be able to bypass the platform tools if needed.
7. *Encourage contributions*: While platform tools should be owned by a platform team, input and contributions should be encouraged from engineers and operations. It's best to operate in an open source model ([InnerSource commons](https://innersourcecommons.org/)).
8. *Avoid silos*: Platform engineering is a strategy for Dev(Sec)Ops, so its whole purpose is to create cohesion and overlap between developers, operations, security etc. This needs to be baked into the mission of platform development.
AWS IAM: Allowing a Role to Assume Another Role
Tags: aws, security
Published: 2023-06-09 00:07:10

---
title: AWS IAM: Allowing a Role to Assume Another Role
published: true
date: 2023-06-08 00:00:00 UTC
tags: aws, security
canonical_url: https://nelson.cloud/aws-iam-allowing-a-role-to-assume-another-role/
---

To allow an IAM Role to assume another Role, we need to modify the **trust relationship** of the role that is to be assumed. This process varies depending if the roles exist within the same account or if they’re in separate accounts.

## Roles in the Same Account

Let’s say we have two roles, `Role_A` and `Role_B`. If we want to allow `Role_A` to assume `Role_B`, we need to modify the trust relationship of `Role_B` with the following:

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::111111111111:role/Role_A"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

```

This is all that’s needed to allow a role to assume another role within the same account.

Note the `Principal` element where we specify the role that we want to give permissions to. In general, the `Principal` element is used in policies to give users/roles/services access to other AWS resources. However, the `Principal` element cannot be used in policies attached to Roles. It can only exist in the trust relationships of roles (you’ll get errors if you try to use the `Principal` element in an IAM Role policy).

You can read more about this element in the [AWS docs](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html).

## Roles in Different Accounts

Let’s say `Role_A` and `Role_B` are in different accounts. In this case, the process from above stays the same. `Role_B` needs to have its trust relationship modified to allow `Role_A` to assume it. The difference here is that `Role_A` will need an additional policy with `sts:AssumeRole` permissions. So the final result is as follows:

The `Role_B` trust relationship stays the same:

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::111111111111:role/Role_A"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

```

And `Role_A` needs the following attached as a policy:

```
{
  "Version": "2012-10-17",
  "Statement": {
    "Effect": "Allow",
    "Action": "sts:AssumeRole",
    "Resource": "arn:aws:iam::222222222222:role/Role_B"
  }
}

```

Now `Role_A` will be able to assume `Role_B` even if they’re in different accounts.
how i recovered my lost bitcoin without been scammed again
Published: 2023-06-07 23:49:49

Hi. Please be wise, do not make the same mistake I had made in the past, I was a victim of bitcoin scam, I saw a glamorous review showering praises and marketing an investment firm, I reached out to them on what their contracts are, and I invested $28,000, which I was promised to get my first 15% profit in weeks, when it’s time to get my profits, I got to know the company was bogus, they kept asking me to invest more and I ran out of patience then requested to have my money back, they refused to answer nor refund my funds, not until a friend of mine introduced me to the CYBERTRACE SERVICE, so I reached out and after tabling my complaints, they were swift to action and within 3 Days I got back my funds with the due profit. I couldn’t contain the joy in me. I urge you guys to reach out to CYBERTRACE SERVICE  on their support email: cybertraceservice@usa.com
How to Train Your AI: Making it Predict the Next Simpsons Episode Like a Psychic
Tags: python, ai, machinelearning
Published: 2023-06-07 23:46:14

🎩🔮*Cue the spooky music and fog machines*🔮🎩

Welcome, fellow technomancers and couch potatoes, to the digital cauldron of AI wizardry, where we shall unveil the secrets to train an Artificial Intelligence to predict The Simpsons episodes like Nostradamus on a sugar rush! But be warned, for this journey is peppered with puns, dad jokes, and yellow cartoon characters! 🧙‍♂️🛋️

### Step 1: Gather thy Data 📚
As the wise Homer Simpson once said, “Mmm... data.” Well, he might have been talking about donuts, but same thing, right? To train your AI, you'll need every Simpsons script ever conjured. The more data, the merrier - just like Homer’s love for donuts and Duff beer.

### Step 2: Conjure the Neural Network 🧠
We need a brain for our crystal ball! Get your digital wand and create a neural network. You can choose RNN (Recurrent Neural Network) - but beware! It's not an acronym for "Really Nice Nachos." I know, disappointing.

### Step 3: Get your Training Montage On! 🏋️
Now, it's time for the montage scene! Picture your AI lifting heavy tomes of scripts, sweating 1s and 0s, as it learns the essence of every “D’oh!” and “Eat my shorts!”. This step might take a while - you could binge-watch The Simpsons while your AI sweats it out. It’s called moral support.

### Step 4: Test the Waters 🧪
Is your AI babbling Springfield lingo yet? Test it by asking it to predict a snippet of the next episode. If it talks about aliens abducting Flanders, you're on the right path!

### Step 5: Season with Salt, and Maybe Some Bugs 🐞
Fine-tune your AI by throwing in some quirks. Why not make it predict a crossover where Bart becomes the king of Westeros or Lisa discovers the Upside Down? The wackier, the better!

### Step 6: Invite the Townsfolk 🎉
Unveil your AI at your next watch party! Challenge your friends to tell the difference between a real episode and one that your AI dreamed up after binging on digital Krusty Burgers.

### Step 7: Predict, Laugh, and Repeat 🔄
Finally, gather round as your AI spins tales of Springfield that would make Matt Groening’s head spin. From Marge taking on Godzilla to Grandpa Simpson’s time-travel adventures, the possibilities are as endless as Homer’s appetite!

🎊 Congratulations, you’ve just trained your AI to be the Springfield Psychic! 🎊

🌟*But wait, fellow spellcasters!*🌟

The fun doesn't end here. I have loads more humor, quirkiness, and good times waiting for you over on my YouTube channel. You won't want to miss it, trust me. Click [PAIton and Crossovers](https://www.youtube.com/channel/UCzUBm8oODJRZCHYVQtArgyA?sub_confirmation=1) to check it out and continue the fun journey with me.
Kayseri diş hekimi
Tags: kayseridis
Published: 2023-06-07 23:20:54

Kayseri Diş Hekimleri Arasında Seçim Yapmak
Kayseri'de bir diş hekimi seçmek, sağlığınız için önemli bir karardır. Sağlıklı bir diş ve ağız sağlığı, genel sağlığınızın bir göstergesi olarak kabul edilir. Bu nedenle, sizin için doğru diş hekimini seçmek oldukça önemlidir.
Kayseri'de yaşayan biri olarak, iyi bir diş hekimine sahip olmak isteyebilirsiniz. Ancak, bu bölgede birçok seçenek olduğundan, hangi diş hekiminin sizin için doğru olduğunu seçmek zor olabilir. Bu nedenle, Kayseri'deki diş hekimleri arasında seçim yaparken nelere dikkat etmeniz gerektiğine bir göz atalım.
Diplomaları ve Yetkileri Kontrol Edin
Hangi diş hekiminin sizin için doğru olduğunu seçerken, diplomalarını ve yetkilerini kontrol etmek önemlidir. Sadece yetkili bir diş hekiminden hizmet almanız, sağlığınızın güvence altına alınmasına yardımcı olur. Bu nedenle, diş hekiminizin diplomalarını ve geçerli yetkilerini kontrol etmenizi öneririz.
Referanslarını Kontrol Edin
Bir diş hekimi seçmeden önce, geçmiş müşterilerin yorumlarını okuyarak referanslarını kontrol etmek de önemlidir. https://www.sifadent.com.tr/
What is Strict Mode? Or, "The Day JavaScript Morphed Into My Mother"
Tags: javascript, webdev, beginners
Published: 2023-06-07 22:55:17

Hey, you remember your mother's "Strict Mode"? Those fond memories of teenage years when she transformed into an unyielding warden, barring you from staying out past midnight or using the family PC for anything other than "educational purposes?" Oh, the joy.

Well, Strict Mode is an ES5 feature, when JavaScript decide to pay tribute to your Mum, adopting a "Strict Mode" of its own. Quite the trendsetter, isn't it?

```javascript
"use strict";
var lateNight = "fun";
```
Try pulling that little line of code and you're instantly teleported back to your teen years, complete with a virtual mom wagging her finger at you.

## Turning On Mom Mode, Err... Strict Mode
Sliding into JavaScript's Strict Mode is as simple as entering your teenage years - just add "use strict"; at the beginning of your script. Yes, those were the magical words that turned your cool, lenient mom into a strict, no-nonsense matriarch.
```javascript
"use strict";
let party = "no";
```

## The Joy of Conforming: Benefits of Mom, I Mean... Strict Mode
Strict Mode's benefits are like those brussels sprouts mom forced you to eat. You hated them but they were good for you, right?

**Prevents Evil Twins:** Just like mom would never let you hang out with your evil doppelgänger, JavaScript refuses to let you declare identical variables. I mean, come on, who needs two 'Bobs' anyway?
```javascript
"use strict";
let bob = "happy";
let bob = "sad"; // Error: Bob already exists!
```

**Blocks Naughty Behavior:** Just like mom's grounding kept you from sneaking out at night, Strict Mode keeps you from using undeclared variables. Ah, the joys of discipline.
```javascript
"use strict";
sneakyVariable = "I'm out"; // Error: Declare your variables, young person!
```

**Mutes Silent Errors:** Silent errors are like mom's cold shoulder - no noise, but you knew you were in for it. Strict Mode turns these silent errors into loud, screaming tantrums.
```javascript
"use strict";
delete Object.prototype; // Error: What were you thinking?!
```

Well, folks, that's JavaScript's Strict Mode for you. A relentless taskmaster, sure, but one that's got your best interests at heart. Just like dear ol' mom!
ADRV9009 and zc706 Working
Tags: petalinux, fpga, opensource
Published: 2023-06-07 22:10:50

PetaLinux built successfully for the ADRV9009 and zc706 in our Remote Lab at Open Research Institute. 

See the instructions here:https://github.com/OpenResearchInstitute/documents/blob/master/Remote_Labs/Working-With-FPGAs.md
Day 757 : Recognize
Tags: hiphop, code, coding, lifelongdev
Published: 2023-06-07 22:03:43

_liner notes_:
- Professional : Pretty good day. Followed up with some community questions. Had a meeting. Started looking to updating an old demo application.

- Personal : Last night, I went to the OrlandoJS meetup. I was planning on streaming the event, but I think I took the wrong cable because, my computer wouldn't recognize my camera. I was able to give a quick lightning talk though. Had a really good time and spoke with a bunch of folks.

![A lake in 3 Brothers, CA with snow on the shore and trees without the leaves and pine trees and snow covered mountains in a mist in the distance ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zycmnnlri9caw0wh26oi.jpg)

Going to finish up the layouts for my next side project and maybe spin up an app to get started. Run through tracks for the radio show. Definitely want to watch some anime. Thinking I may look into some land again.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube aHQxIMCBUnM %}
Phlex is the ruby way to build your views
Tags: phlex, rails, ruby
Published: 2023-06-07 21:02:08

[Phlex](https://www.phlex.fun) is an incredibly refreshing gem created by [Joel Drapper](https://github.com/joeldrapper). It introduces a remarkable way to build views in pure Ruby, as exemplified below:


```ruby
class Nav < Phlex::HTML
  def template
    nav(class: "main-nav") {
      ul {
        li { a(href: "/") { "Home" } }
        li { a(href: "/about") { "About" } }
        li { a(href: "/contact") { "Contact" } }
      }
    }
  end
end
```

Initially, you may wonder: Why? Why would you do that when HTML is already perfectly readable? Using Ruby here seems odd, detached from the underlying HTML I want to write.


However, let's examine a typical partial, such as the one from the .
[rubygems.org search show page](https://github.com/rubygems/rubygems.org/blob/5092832ce44d07b24a834f74afa9408e339d1ebf/app/views/searches/show.html.erb)

The specific details aren't crucial; I'm only presenting an excerpt. Take note of the nested conditionals within.


```erb
<% @title = "search" %>
<% if @error_msg %>
  <div class="errorExplanation">
    <p><%= @error_msg %></p>
  </div>
<% end %>
<%= link_to t("advanced_search"), advanced_search_path, class: "t-link--gray t-link--has-arrow" %>
<% if @yanked_filter %>
  <% @subtitle = t('.subtitle', :query => content_tag(:em, h(params[:query]))) %>

  <% if @yanked_gem.present? %>
    ...
```

In this case, we find a significant amount of view logic nested within the HTML structure. To comprehend this template fully, one must examine both the HTML and the embedded Ruby code.

With Phlex, however, we can fundamentally transform how we perceive and write these views. We can easily isolate the logic from the HTML nesting, resulting in something like this:


```ruby
class Searches::Show < Phlex::HTML
  def template
    error_messages
    if @yanked_filter
      yanked_search
    else
      header
      aggregations
      if @gems.any?
        search_results
      else
        suggestion_results
      end
    end
  end
end
```

The `template` method clearly displays the actual view logic of the full template. The appropriate instance methods provide the HTML. For me, Phlex isn't really about the HTML; in a way it is about everything else.

**We can write ruby and Phlex provides us the html tag methods we need.**

We have the freedom to choose the most suitable level of abstraction and refactor as we see fit. We have the elegance of Ruby at our disposal.

I am genuinely enthusiastic about Phlex. It has completely transformed how I approach views, paving the way for elegant abstractions [this one for forms](https://fly.io/ruby-dispatch/component-driven-development-on-rails-with-phlex/#a-form-component-that-automatically-permits-strong-parameters).

Working with your views as enjoyable as writing other ruby code.

[this article first appeared on rstuder.ch](https://rstuder.ch/phlex-is-fun/)
Tutorial How To Exit Vim
Tags: vim, tutorial
Published: 2023-06-07 21:55:48


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

If you are in a window similar to this one and can't get out, fear nothing I am here. 

Just press `Esc` and after that ``:q!``

Your welcome for this useless tutorial. :)
Just launched a collection of UI components and effects, crafted with React and Tailwind CSS
Tags: react, tailwindcss, ui
Published: 2023-06-07 20:59:23

I've built most of them for my blog over the last month. Now, you can easily view and use them. Visit the component page, copy the code, paste into your project. And it's free of course 🙃


https://ui.ibelick.com