teleren/devto huggingface dataset:
Python Programming Bootcamp #9 - True and False
Tags: python, beginners, programming, tutorial
Published: 2022-12-07 04:23:00

---
title: Python Programming Bootcamp #9 - True and False
published: true
description: Most things are True in Python
tags: python, beginners, programming, tutorial
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
published_at: 2022-12-07 04:23 +0000
canonical_url: https://code-maven.com/programming-bootcamp-for-scientists-9
series: bootcamp
---

{% youtube TmKPo40p608 %}

00:00 Intro to this video
02:10 How to get MS Windows not to close the cmd when the program ends?
04:00 Associate file extension with a program in MS Windows
09:30 Solution of [Number guessing game level 0](https://code-maven.com/slides/python/solution-number-guessing-game-0).
13:38 Solution of [Fruit Salad](https://code-maven.com/slides/python/solution-fruit-salad).
19:05 [Comparison and Boolean](https://code-maven.com/slides/python/boolean)
20:30 Comparison operators
20:40 Compare numbers, compare strings (ASCII, Unicode)
24:35 Do NOT Compare different types!
28:03 Complex if statement with boolean operators (and, or, not)
31:14 Boolean truth tables
32:08 Boolean values: True and False
35:00 Flag
37:15 Toggle
38:10 Short circuit
42:10 Does this value count as True or False?
43:15 True and False values in Python
43:58 [Incorrect use of conditions](https://code-maven.com/slides/python/incorrect-use-of-conditions)
45:49 "False" is True
48:02 What is the type of True and False?
49:10 Exercises: compare numbers; compare strings
Things I learned this week - Week 49 (2022 ed.)
Published: 2022-12-07 10:49:04

1. Export logs from Giigke cloud logging to BigQuery

{% embed https://www.youtube.com/watch?v=s8w426fwNIo %}

2. How McDonalds implements Event Driven Architectures

https://blog.quastor.org/p/mcdonalds-uses-event-driven-architectures

3. Dashboard with Data Studio and Big Query 

{% embed https://www.youtube.com/watch?v=WNA9SJ-x-kc %}

4. Logger in Javascript

{% embed https://www.youtube.com/watch?v=m2q1Cevl_qw %}

5. ID Tokens vs Access Token

{% embed https://www.youtube.com/watch?v=M4JIvUIE17c %}
AWS API Gateway Tutorial | How to Create REST API With API Gateway
Tags: aws, cloud, webdev, beginners
Published: 2022-12-07 13:39:30

This AWS API Gateway Tutorial will help you understand the API Gateway service provided by AWS including the pricing, important concepts, as well as a hands-on demonstration on how to create the API Gateway for REST API.

{% embed https://www.youtube.com/watch?v=qnVfWG8N7Fw %}
I'm having issue to Add/Update array of object based on key
Published: 2022-12-08 06:36:48

I'm having data like this,

   let employeeDetails1 = [
    { name: "Raju", age: 26 },
    { name: "Kumar", age: 31 },
  ];

  let employeeDetails2 = [
    { name: "Raju", age: 26 },
    { name: "Siva", age: 35 },
  ];

i'm expecting format like, 

  let employeeDetails = [
    { name: "Raju", age: 26 },
    { name: "Kumar", age: 31 },
    { name: "Siva", age: 35 },
  ];
CCNA Exam v1.0 (200-301) Cisco
Published: 2022-12-08 09:33:31

[Cisco 200-301 Exam Dumps](https://dumpsboss.com/cisco-exam/200-301/) Conclusion Passing 350-401 take a look at and incomes the selected Cisco certification out of the above-noted 4 alternatives enables you develop your profession. During the education classes furnished by means of Cisco, you'll recognize ideas associated with community assurance, automation, virtualization, and safety. Becoming Cisco licensed will permit you to get admission to higher-paid jobs in worldwide corporations because of your new sought-after competencies. Cisco’s legitimate education alternatives are extraordinarily beneficial to byskip the examination. However, you'll get a deep expertise of the examination’s goals in case you [Cisco 200-301 Dump](https://dumpsboss.com/cisco-exam/200-301/)s down load the examination dumps to be had at Exam-Labs. Put all of your efforts into research and passing the examination and shortly you’ll be a demanded expert with a broadly identified Cisco credential. The CCNP 350-401 might have the ability that will help you out in expertise a candidate’s know-how approximately imposing middle organization community technology, which might be such as the dual-stack architecture (IPv4 and IPv6), infrastructure, virtualization, community assurance, safety, and automation. 

Click Here For More Info >>>>> https://dumpsboss.com/cisco-exam/200-301/
Hoy aprendí php🐘
Published: 2020-05-18 22:28:49

Hey amigos de la comunidad DEV, me presento soy Jose Luis Ramos T. Quiero compartir lo aprendido, es por eso que hoy escribo sobre PHP.

Sin más iniciemos.

PHP es un lenguaje preprocesador de hipertexto. Se usa para procesar datos. Funciona a través de un servidor web cuando el usuario trafica datos que luego será devuelto por un navegador web (Firefox, chrome, safari).

Bien. La respuesta del navegador web viene o es devuelto en un HTML plano sin formatos por lo que el contenido es solo texto.

Los archivos PHP terminan en .php

Con PHP podemos manipular archivos de un servidor, recopilar datos de un formulario, envíar y recibir cookies, modificar datos de una base de datos, controlar el acceso de los usuarios, encriptar datos y más.

Para usar PHP en la PC diríjase a la web oficial de PHP http://php.net/manual/en/install.php
Aquí encontrarás el manual de instalación.

SINTAXIS PHP. La sintaxis del lenguaje nos indica que para poder programar en php, primero debemos crear un archivo con la extensión .php, que quede en claro que podemos inventar el nombre del archivo pero no la extensión. Ejemplo: pagina_uno.php O gato_negro.php 

Siguiente paso iniciamos el lenguaje este es el primer script PHP

<?php Aquí en medio va el código ?>

Les adelanto; las instrucciones php terminan en un punto y coma, así (;)

Algunas palabras claves que les adelanto y en futuras notas compartiré, son; if, else, while, echo

Una variable en PHP se hace así, $color
El signo de dólar se usa para hacer una variable y el nombre de la variable puede ser a lo referente.
Es decir digamos que quiero imprimir en pantalla de que color es mi carro.

<?php 
$color = "azul";
echo "Mi carro es" . $color . "<br/>"; ?>

El resultado en pantalla sería 
Mi carro es azul
Y bueno temo que hemos llegado al final. Me despido con COMENTARIOS PHP.

Los comentarios se usan para comentar el desarrollo. Útil para el programador y no para el cliente (el usuario). Gracias a los comentarios podemos trabajar años más tarde en el mismo código pues los comentarios nos describirán lo que en el pasado hicimos, claro si documentamos comentarios específicos.

Bien, podemos comentar nuestro código de tres maneras, podemos usar //, # y /**/

Usamos // para hacer solo una línea de comentario. O # para lo mismo, comentarios de una sola línea.

Usamos /**/ para hacer varias líneas de comentarios.

// Soy una línea de comentario.

# Soy una sola línea de comentario.

/* Yo soy varías líneas de comentarios, aquí puedes hacer párrafos de comentarios.*/
How to run Mongo DB local as a replica set
Tags: mongodb
Published: 2022-12-21 01:25:06

In this post you will see how to run a Mongo DB server with replica set.

For this, we will use mongodb community that you can install [from your therminal](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/).

First, create a folder to store your data, like:
`mkdir /data/mongodb/db0`

Then, start your server with this command.
`mongod --port 27017 --dbpath /data/mongodb/db0 --replSet rs0 --bind_ip localhost`

After first start, you will need to start the replica set.
Open your SGBD (you can use Mongosh) and run this command:
`rs.initiate()`

Now, you can restar your server to apply all changes:
Run `netstat -vanp tcp | grep 27017` in your therminal to get PID application, and kill then.
`kill -9 81094` (modify 81094 to your PID)

Then, run
`mongod --port 27017 --dbpath /data/mongodb/db0 --replSet rs0 --bind_ip localhost`

That's It!
How do you get the most out of dev tutorials?
Tags: webdev, productivity, codenewbie, discuss
Published: 2022-12-21 10:31:31

I recently started following [Amy Duttons](https://twitter.com/selfteachme) [Everything Svelte](https://www.everythingsvelte.com/) course (highly recommend, by the way, it's super helpful and well made 🙏) and feel like I'm learning a lot. The longer I followed the different classes, however, the more I noticed that I was listening and kind of following along with the project, copying the code into my local project step by step; _but it was quite passive_. 

**This can not be the best way to do this 😄 What do you do to make the most out of the tutorials you follow?** I'm grateful for any words of advice 🙌 (or just hearing that I'm not alone in this🙈)

I now started taking physical notes and applying some of the things I learned in a different project - this is already really helpful to my own learning style but I'm curious to hear if there are other things I could do ✨

Thank you so much 🙏
Harfli uchburchak yaratish!
Tags: beginners, cpp, programming
Published: 2022-12-21 12:39:20

```cpp

#include <iostream>
using namespace std;
int main() {
cout << "  A\n";
cout << " A A\n";  
cout << "AAAAA";
return 0;
}


```

bunda birinchi navbatta `<iostream>` kutubxonasini chaqirib olamiz va keyin `using namespace std;` ni xam yozamiz . albatta `int main (){` ni kiritib keyin 
 `cout << "  A` ( etibor qaratamizz bu yerda A dan oldin joy tashladm chunki `console`dagi javobda A lar uchburchakni xosil qilish kerak!)
 va uninhg oldiuga albatta `\n` ni joylaymiz chunki  bular qatori alohida bolishi kerak!

qatorimiz tugaganida oxiriga `; ` belgisini qoyamiz!

oxirida albatta `return 0;` va eng oxirida `}` belgisini qoyishimiz zarur!


@dawroun
Quà Tết cho bố mẹ vợ ấn tượng
Tags: webdev, javascript, beginners, programming
Published: 2022-12-22 08:10:30

Bạn đã có ý tưởng gì để mua quà Tết cho bố mẹ vợ chưa? Tham khảo ngay bài viết của SagoGifts để có ngay đáp án!
https://goeco.link/ApwDn
#hopquatet #hopquatet2023 #gioquatet #quatet2023 #quatet #quatetcaocap #hopquatetcaocap
https://www.facebook.com/Gi%E1%BB%8F-Qu%C3%A0-T%E1%BA%BFt-106905578800951/
https://twitter.com/GQuatet
https://www.instagram.com/gioquatet2023/
https://www.linkedin.com/in/gio-quatet-438b56248/
https://www.youtube.com/@sagogifts-quatangletetcaoc9744
https://www.google.com/search?

![Uploading image](...)q=knowledge+graph+search+api&kponly&kgmid=/g/11j39xr8kc
834. Leetcode Solution in Java
Tags: java
Published: 2022-12-22 13:16:04

```java
class Solution {
  public int[] sumOfDistancesInTree(int N, int[][] edges) {
    int[] ans = new int[N];
    int[] count = new int[N];
    Set<Integer>[] tree = new Set[N];

    Arrays.fill(count, 1);

    for (int i = 0; i < N; ++i)
      tree[i] = new HashSet<>();

    for (int[] e : edges) {
      final int u = e[0];
      final int v = e[1];
      tree[u].add(v);
      tree[v].add(u);
    }

    postorder(tree, 0, -1, count, ans);
    preorder(tree, 0, -1, count, ans);
    return ans;
  }

  private void postorder(Set<Integer>[] tree, int node, int parent, int[] count, int[] ans) {
    for (final int child : tree[node]) {
      if (child == parent)
        continue;
      postorder(tree, child, node, count, ans);
      count[node] += count[child];
      ans[node] += ans[child] + count[child];
    }
  }

  private void preorder(Set<Integer>[] tree, int node, int parent, int[] count, int[] ans) {
    for (final int child : tree[node]) {
      if (child == parent)
        continue;
      // count[child] nodes are 1 step closer from child than parent
      // (N - count[child]) nodes are 1 step farther from child than parent
      ans[child] = ans[node] - count[child] + (tree.length - count[child]);
      preorder(tree, child, node, count, ans);
    }
  }
}
```
#leetcode
#challenge
Here is the link for the probem
https://leetcode.com/problems/sum-of-distances-in-tree/description/
The Role of Agile Principles in Software Development
Published: 2022-12-25 05:00:00

Agile principles are a set of values and guiding practices that are used to guide the development of software products. They emphasize flexibility, collaboration, and continuous improvement. In this post, we'll take a look at some of the key agile principles and how they can be applied in software development.

Individuals and interactions over processes and tools: Agile emphasizes the importance of individuals and their interactions in the development process. It recognizes that people are more important than processes and tools, and that effective communication and collaboration are key to success. 

Working software over comprehensive documentation: Agile recognizes that the most important measure of progress is the delivery of working software. It emphasizes the importance of delivering value to customers as quickly as possible, rather than spending time on comprehensive documentation. 

Customer collaboration over contract negotiation: Agile emphasizes the importance of working closely with customers to understand their needs and deliver value to them. It recognizes that the best way to do this is through ongoing collaboration, rather than through upfront contract negotiation. 

Responding to change over following a plan: Agile recognizes that change is a constant in the software development process. It emphasizes the importance of being flexible and responsive to change, rather than following a rigid plan. 

Conclusion

Agile principles are a set of values and guiding practices that emphasize flexibility, collaboration, and continuous improvement in software development. By applying these principles, teams can more effectively deliver value to customers and respond to changing needs and requirements.
Upload a file from AWS S3 bucket to another S3 bucket using AWS Lambda (Nodejs)
Tags: node, aws
Published: 2022-12-23 11:45:32

By using Aws lambda (Nodejs) we can upload a file to from source s3 bucket to the s3 bucket we want to upload.

```
const AWS = require('aws-sdk');
const s3 = new AWS.S3();

exports.handler = async (event) => {
console.log('event',event);
//Reading Source file from source bucket
const sourceFile = await s3.getObject({ Bucket: event.sourceBucket, Key : event.sourceFilePath}, (err,data) =>{
if(err) throw err;
else{
return data.Body.toString('utf-8');
});

//uploading to destination bucket
const param = {
Bucket : event.destination,
Key : event.destinationFilePath,
Body : sourceFile,
ContentType : 'csv'
};

await s3.putObject(params).promise().then((data) =>{console.log('uploaded');
return data}).catch((err) =>{console.log('err',err)
return err;});
```
How to import or use js file configuration into any vue page in your nuxt app
Tags: javascript, vue, api, nuxt
Published: 2022-12-23 10:37:43

```
hello

i have a nuxtjs project of listing booking

I have done all my API calls and configurations on " index.js in the store folder " and would like to display the listing data  gotten from the API call on my "listing.vue page " please how do I call do to print my data gotten or make my index.js accessable all over the app 

app setup

{
"name": "lisngbook,,
"version": "1.0.0",
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
  },
"dependencies": {
"@nuxtjs/axios": "^5.13.6",
"core-js": "^3.9.1",
"nuxt": "^2.15.3",
  },
"devDependencies": {
"@nuxtjs/moment": "^1.6.1"
  },
```
```
My Journey in Open Source - rate-limiter-fn
Tags: javascript, typescript, opensource, github
Published: 2023-01-24 14:00:00

[Link to the repo](https://github.com/Cadienvan/rate-limiter-fn)

## What is this?

A higher-order function to provide a Rate Limiting mechanism to the given function.

## How do I install it?

```bash
npm install rate-limiter-fn
```

## How can I use it?

```javascript
const rateLimiter = require('rate-limiter-fn');

const rateLimitedFn = rateLimiter(fn, {
  limit: 10,
  interval: 1000,
});

rateLimitedFn();
```

## API

The module exports a single function (`rateLimit`) that takes two arguments:

- `fn` - The function to be rate limited.
- `options` - An object with the following properties:
  - `limit` - The number of times the function can be called within the given interval.
  - `interval` - The interval in milliseconds.
  - `onLimitReached` - A function that will be called when the limit is reached. It will be called with the following arguments:
    - `limit` - The limit that was reached.
    - `interval` - The interval that was reached.
    - `fn` - The function that was rate limited.
    - `args` - The arguments that were passed to the function.
  - `identifierFn` - A function that will be called to get the identifier for the rate limit. It will be called with the following arguments:
    - `fn` - The function that was rate limited.
    - `args` - The arguments that were passed to the function.

## Tests

You can run the tests by using the following command:

```bash
npm test
```
Runtime check on borrowing rule with RefCell
Tags: rust, refcell
Published: 2022-12-24 02:39:54

Rust does compile time check on borrowing rule. But there are some scenarios we need to defer it to runtime. Let me show a simplified version from one of the examples in [the book](https://doc.rust-lang.org/book/ch15-05-interior-mutability.html)

We have a trait with one method. No change on internal states is allowed inside this method. (`&self` is used instead of `&mut self`)

```rust
pub trait Messenger {
    fn send(&self, msg: &str);
}
```

What if we want to store the messages sent? (e.g. it's common when we create a mock object for testing) It means we need to change the internal states. For some reasons (e.g. it is from 3rd party), we can't modify this trait, so we can't change to `&mut self`. Anyway, let's do it first and see what will happen.

```rust
struct MyMessenger {
    messages: Vec<String>
}

impl MyMessenger {
    fn new() -> MyMessenger {
        MyMessenger { messages: vec![] }
    }
}

impl Messenger for MyMessenger {
    fn send(&self, msg: &str) {
        self.messages.push(String::from(msg));
    }
}
```

On the line `push` method is called, the compiler complains.

```
cannot borrow `self.messages` as mutable, as it is behind a `&` reference

`self` is a `&` reference, so the data it refers to cannot be borrowed as mutablerustcClick for full compiler diagnostic

main.rs(2, 13): consider changing that to be a mutable reference: `&mut self`
```

We want to make it passes the compilation. Let's rewrite it with `RefCell`.

```rust
use std::cell::RefCell;

struct MyMessenger {
    messages: RefCell<Vec<String>>
}

impl MyMessenger {
    fn new() -> MyMessenger {
        MyMessenger { messages: RefCell::new(vec![]) }
    }
}

impl Messenger for MyMessenger {
    fn send(&self, msg: &str) {
        self.messages.borrow_mut().push(String::from(msg));
    }
}
```

We use `borrow_mut` to borrow a mutable value. Compilation passes this time.

The borrowing rule is still checked in runtime. Runtime error will occur if we do this.

(This violates the rule "At any given time, we can have either one mutable reference or any number of immutable references".)

```rust
let x = RefCell::new(String::from("Hello World"));
let y = x.borrow_mut();
let z = x.borrow(); // Error occurs here in runtime
```
Day 24: CI for perl5-MIME-Types
Tags: perl, ci, programming, devops
Published: 2022-12-24 07:47:00

---
title: Day 24: CI for perl5-MIME-Types
published: true
description: Sometimes it is very easy.
tags: perl, ci, programming, devops
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
published_at: 2022-12-24 07:47 +0000
canonical_url: https://code-maven.com/ci-for-perl5-mime-types
series: ci-2022-12
---

After the heavy-lifting of the previous entry in the Daily CI series this was a very easy task. Looking at [CPAN Digger](https://cpan-digger.perlmaven.com/) I saw [MIME-Types](https://metacpan.org/dist/MIME-Types). That sounded like a simple Perl module and indeed adding CI was straight forward.

[Pull-request](https://github.com/markov2/perl5-MIME-Types/pull/14) It was already accepted.

## Conclusion

There are many projects that are low-hanging fruits where you can add GitHub Actions in a matter of minutes and get the benefits immediately.
Free Developer T-Shirt Design
Tags: free, freedesign
Published: 2022-12-24 14:08:04

Download My Free T-Shirt Design and follow me for more.

[The Link](https://ahmedonour.gumroad.com/l/Developer-t-shirt-design)
## if you want any custom design i am available free of charge just DM me in [twitter](https://twitter.com/ahmed_onour)
New Joiner of Dev platform
Tags: python, aws, beginners, knowledge
Published: 2022-12-24 18:02:52

Hi All, 
Firstly I would like to introduce myself I'm Shivani Goyal(25F) from India. I'm working in IT field as a System Engineer. I have completed MCA degree in 2021. I'm new joiner on this Dev platform. I would be very thankful to all of you if you'll give my some guidelines, tips and tricks, guidance, knowledge etc. Anything which will be helpful to enhance my knowledge. **If someone wanna connect with me please lemme know in terms of knowledge sharing, guidance only.** I hope we all are here to help each other and enhance the knowledge and programming skills as well. 

## > I wish you Merry Christmas and Happy New Year to you and your family. Spread good thoughts, knowledge and happiness.
My new portfolio which is built on top of next 13 app directory
Tags: nextjs, portfolio, webdev, javascript
Published: 2022-12-25 06:21:39

I have been working around with my portfolio website in last two week ago. I forgot to grab review from dev community.
I am warmly welcome to grab your review and feedback.

**My website is alive here.**

[https://www.aungmyatmoe.me/](https://www.aungmyatmoe.me/)

## Project can be found here

https://github.com/amm834/aungmyatmoe.me

## See review

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

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

I inspired tailwind's portfolio template. It is so cool and elegant to me. So, u don't need to invent a new wheel with figma 👻.

Figma is a bit hard for small screen. 

I use,

- Next
- Tailwind

to accomplish my app's domain and then I inspired tailwind's open source documentation website to config my tailwind config.

It's open source by default. I love open source projects. They give me an opportunity to learn their code and how should I improve well in future.

## Lighthouse Result


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