teleren/devto huggingface dataset:
10 ways to optimize your Python code
Tags: python, develope
Published: 2022-10-21 21:55:53

1. Use PEP 8
PEP 8 is the official style guide for Python code. It includes recommendations on how to format your code to make it more readable.

2. Use the right data structures
Python has a number of built-in data structures that you can use to store your data. Choosing the right data structure will help you optimize your code.

3. Use the built-in functions
Python has a number of built-in functions that you can use to manipulate data. Using the built-in functions will help you optimize your code.

4. Use list comprehensions
List comprehensions are a powerful feature of Python that allows you to create lists from other data structures. Using list comprehensions will help you optimize your code.

5. Use generators
Generators are a powerful feature of Python that allows you to create iterators. Using generators will help you optimize your code.

6. Use the right libraries
Python has a number of libraries that you can use to extend its functionality. Choosing the right library will help you optimize your code.

7. Use profiling
Profiling is a powerful technique that allows you to identify bottlenecks in your code. Using profiling will help you optimize your code.

8. Use caching
Caching is a powerful technique that allows you to store data in memory for faster access. Using caching will help you optimize your code.

9. Use multiprocessing
Multiprocessing is a powerful technique that allows you to use multiple processors to run your code. Using multiprocessing will help you optimize your code.

10. Use the right tools 
Python has a number of tools that you can use to optimize your code. Choosing the right tool will help you optimize your code.
React, the need for better code
Tags: webdev, react, javascript, programming
Published: 2022-10-21 21:10:09

Back in the days when web development was boiled down to 4 technologies: **HTML**, **CSS**, **JavaScript**, and **PHP**, it was probably sheer madness to dare to write JavaScript without **jQuery**. This was a library that allowed to add an AJAX interaction layer between the web and the applications, controlling events, creating animations and different effects to enrich the user experience.

As you can imagine, over the years technologies are becoming deprecated with the emergence of new needs and tools.

In 2011, the developers of **Facebook** began to face several problems when it came to maintaining the code. As the app grew and gained more functionality, the team needed to invest in employees to keep the app running smoothly. Over time, the application became increasingly difficult to scale and manage.

There came a time when Facebook engineers couldn't keep up with the updates that came out. His code required an update as soon as possible to become more efficient.

Thanks to this need, **Jordan Walke** built a prototype that made processes more efficient. And so, in 2013, **React.js** was officially born.

## What is react?

- It's one of the most popular JavaScript libraries, with almost 200,000 stars on GitHub.
- It's a library, not a framework.
- It's an open-source or open source project created by Facebook.
- It's used to create user interfaces (UI) on the front-end.
- It's the view of an MVC (Model View Controller) application

One of the most important things about React is that you can create reusable and customizable HTML elements to build user interfaces quickly and efficiently.

Thanks to React, the way data is handled is also streamlined, using states and props.

## Why use React?

Thanks to what we read earlier, we already know that thanks to React we can create dynamic and scalable applications, with a better order and less code.

But it never hurts to learn more benefits of this technology:

- It facilitates the development of front-end applications.
- It offers greater performance, flexibility and code organization.
- Prevents the entire page from being rendered, dynamically generating the DOM.
- It provides greater fluidity in interfaces and interactivity, guaranteeing a better user experience.
- It allows the encapsulation of the code in components, making it more dynamic and reusable.

## Conclusion
At first, React may be a bit scary, but over time you will realize that it is easy to learn.

My advice is don't marry a technology, always be open to new possibilities. You can research other alternatives to React, such as Vue or Svelte, and choose your favorite.

Cheers! Thanks for getting here.
small-logger
Tags: php, logger, symfony, showdev
Published: 2022-10-21 21:55:47

Small php logger is a simple php logger you can easily extends for your own need.

Basically, it implements possibility to log to :
Standard output
File (With log rotates)
Http service such as logstash

It it easy to implement your own Formatter or Output writer.

SwitchLogicInterface allow you to implements your own logic to manage multiple log streams.

It also possible to add shortcut to logger for easier use by final developer.

There is two composer packages :
sebk/small-logger which allow using for "from scratch" projects : [https://github.com/sebk69/small-logger](https://github.com/sebk69/small-logger)
sebk/small-logger-bundle is a symfony bridge for sebk/small-logger : [https://github.com/sebk69/small-logger-bundle](https://github.com/sebk69/small-logger-bundle)
shirates-core 1.1.1 released
Published: 2022-10-21 21:03:09

## Shirates (shirates-core)
Shirates is an integration testing framework that makes it easy and fun to write test code for mobile apps.
shirates-core is core library.

[shirates-core 1.1.1](https://github.com/ldi-github/shirates-core/releases)

- [Update environments](https://github.com/ldi-github/shirates-core/blob/1.1.1/doc/markdown/environments.md)
- Fix Unit tests
- Introduced new [parameter](https://github.com/ldi-github/shirates-core/blob/1.1.1/doc/markdown/basic/parameter/parameters.md) "appiumProxyReadTimeoutSeconds"
- Update doc & tutorial
Setup Stimulus on Vite
Published: 2022-10-21 20:55:34

[Overview](https://dev.to/chmich/setup-vite-svelte-inertia-stimulus-bootstrap-foundation-on-rails-7-overview-1bk1)

The `connect` method of Stimulus and `this.element` is what we mostly need.

# Comparisions

Stimulus and Svelte having totally different strengths: 

Svelte holds JS and html in one file and is a, as handy as mighty, tool for making complex things or user-interactions super easy. It is able for running conditions or loops in the html template, like known in rails views.

[Stimulus](https://stimulus.hotwired.dev/), built from the rails team, is a «modest» library for connecting js to the rails-views! Its the part that we previously built with cumbersome initializers or jQuery.

Thats the difference!

Without Stimulus there would be failing one part of the symphony. 

# Setup

```
$ npm i @hotwired/stimulus vite-stimulus-initializer
```

`application.js`

```
import { initStimulus } from "vite-stimulus-initializer";

const controllers = import.meta.glob('../javascript/**/*-controller.js', { eager: true })
initStimulus(controllers, 2, { debug: true, exclude: ['components', 'views'], folderSeparator: '-'  })
```
See naming options on [vite-stimulus-initializer](https://gitlab.com/sedl/vite-stimulus-initializer)

# Test Code

`javascript/controllers/hello-controller.js`

By the filename, the controller will be hooking on any element with `data-controller="admin-hello"`.

```
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {

    connect() {
        // connect fires after the controller has found a corresponding element.
        console.log("Stimulus is connected", this.element)
    }

    static targets = [ "name" ]

    greet() {
        const element = this.nameTarget
        const name = element.value
        console.log(`Hello, ${name}!`)
    }
}
```
`any view in .haml`

```
%div{ 'data-controller' => 'admin-hello' }
  %input{:type => "text", 'data-admin-hello-target' => 'name'}/
  %button{ 'data-action' => "click->admin-hello#greet" } Greet
```

same in `html.erb`
```
<div data-controller="admin-hello">
  <input data-admin-hello-target="name" type="text">/</input>
  <button data-action="click->admin-hello#greet">Greet</button>
</div>

```

by loading this you should see a «Stimulus is connected» in the console. Writing «John» in the input and clicking the button should print out a «Hello John!» on the console.

⚠️ Together with turbo you may see a double «Stimulus is connected» on the console (connect fires 2 times). Based on my Tests it is first firing on the old, element then turbo replaces this and then its firing on the new element, so it should't matter and the new element is not a double-initialized.

Continue with [Stimulus Handbook](https://stimulus.hotwired.dev/handbook/introduction)

Good luck!

[Overview](https://dev.to/chmich/setup-vite-svelte-inertia-stimulus-bootstrap-foundation-on-rails-7-overview-1bk1)
Days 14-16
Tags: blog, 100daysofcode, nextjs, webdev
Published: 2022-10-21 20:34:20

I decided that I would get back into Dennis Ivy's Hackathon. I plan use NextJS, although I want to learn Tailwind CSS, I want to take everything one step at a time. I created a Figma design for reference. I spent days 15-16 working on the hackathon. I didn't really code on day 14 because I had to work on my high school and college classes. Sorry for making this so boring!
Node Core Dev Starter Kit
Published: 2022-10-21 20:25:20

[Node TODO](https://www.nodetodo.org/) let's fire up the TODO app and commit a PR to node core.

[Matteo Discord](https://discord.gg/platformatic)

[Matteo Livestream on Twitch every Thursday at Noon EST](https://twitch.tv/matteocollina/schedule?seriesID=eyJzZWdtZW50SUQiOiJhMDkwM2I1OS0xNDhiLTRkMmItODM4My05Yzk3YjAxOGIwZmUiLCJpc29ZZWFyIjoyMDIyLCJpc29XZWVrIjo0M30=)

[Changelog Podcasts](https://changelog.com/podcasts) where you will find discussions with Matteo Collina (@matteocollina) who talks about the details.

[At Databases](https://www.atdatabases.org/) because you don't need ORM.
Using CodeCommit with AWS free-tier
Tags: devops, aws
Published: 2022-10-21 20:20:57



First I created a budget to alert me of any charges accrued on my account


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


Then added an admin user to perform duties within my account 


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


Granted the necessary user permissions

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

Downloaded the csv file created for the user


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

Able to sign in with credentials

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

Changed the auto-generated password


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

Created a repository via CodeCommit

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

Downloaded necessary access information for HTTP connection

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

Copied clone link to initiate the session in VScode

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

Pasted the clone link

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

Started a new WSL terminal from within VScode

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

Using `git add` , able to put the demo files onto staging 

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

Next, `git commit -m "<message>"` and `git push` can be used to complete the upload. Because this connection occurs over HTTPS, it will be necessary to insert the CSV credentials downloaded previously each time.

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

Versioning and can editing can now be done from within CodeCommit

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

Demo JSON code shown from w3schools

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

I can select edit and add any code

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

Highlighted where the change has been made

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

Code commit will log the changes and show exactly where the changes were made. If this were a production case, the change can then be reviewed here before being pushed to the master branch

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/okuw91iedsevr8h5o8cy.png)
Day-18 of Machine Learning:
Tags: machinelearning, python, dsa, tensorflow
Published: 2022-10-21 20:10:53

Day-18 of Machine Learning:
- Got a brief intuition on **AGI (artificial general intelligence)** and realised **ANI (artificial narrow intelligence)** had made tremendous progress and values and so on **AI** as compared to AGI with lots of valid reasons. 
- Learnt how to implement **Forward propagation** using **NumPy** instead of TensorFlow and it gave me a basic idea about how **dense function** is working under the hood in TensorFlow.
- Learnt TensorFlow uses **matrix** to store training-set parameters in instead of vector/list for efficient computation. **weight-parameters for i-th** unit/neuron is arranged in **i-th column** of the matrix whereas **row is the list of values of a parameter for units/neurons** and TensorFlow utilizes a **1-D** representation to store **bias parameter**. Also, inside dense function, matrix multiplication and sigmoid function implementation are performed.

Also,
- Practiced some basic DSA questions on LinkedList.
- Created a simplistic animation effect (gif) on python using [Pillow Library] (https://pillow.readthedocs.io/en/stable/), inspired by CS50P
How to build a testing strategy?
Tags: testing, qa, testdev, tutorial
Published: 2022-10-21 20:09:52

Tips to develop successful QA test strategy:

- **Have a look at test strategy templates** available on the internet. They may give you some inspiration even if the described project comes from a completely different industry
- **Consult other stakeholders** to make sure that the test strategy aligns with the business goals
- **Ensure that your test strategy slots** well into the test hierarchy. Don’t go too high-level if you have a test policy to lean on. Don’t go too low-level if you know there is a test plan coming as well.
- **Find the right QA tools**. This is a key part of implementing a test strategy: you need a reliable test management solution with integrations to handle all other QA tools.

What is the testing strategy exactly, and how to build a successful one? Find answers in this [article](https://aqua-cloud.io/testing-strategy/?utm_source=devto&utm_medium=article&utm_content=tania&utm_campaign=distribution)
Fastest way to transfer file within Ubuntu to Ubuntu or Mac to android on same network
Tags: node, apple, macos, ubuntu
Published: 2022-10-21 20:03:05


## Install 
[http-server](https://www.npmjs.com/package/http-server)
`npm install --global http-server`

# open CMD,type in this
`http-server`
it returns

```
Starting up http-server, serving ./

http-server version: 14.1.1

http-server settings: 
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none

Available on:
  http://127.0.0.1:8080
  http://192.168.0.116:8080
Hit CTRL-C to stop the server

```

in other laptop open chrome,type this
http://192.168.0.116:8080

And start downloading

## In Mac
Open terminal,Navigate to Downloads folder
```sh cd Downloads```
Type in this command

```http-server ./ -p 1313```

./ specifily will serve only the content in Download folder

-p is the port

```sh
Starting up http-server, serving ./

http-server version: 14.1.1

http-server settings:
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none

Available on:
  http://127.0.0.1:1313
  http://192.168.0.108:1313
Hit CTRL-C to stop the server
```

In Your android , open up chrome
Type in the url
http://192.168.0.108:1313

And select the file, it'll start downloading 
![in Android mobile](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nh7zq2jr1dyvab3sm009.jpg)
Chuyên trang cá cược bóng đá trực tuyến
Published: 2022-10-21 20:00:01

https://keonhacai89.com/ ✔️ Trang cung cấp thông tin kèo nhà cái mới nhất hôm nay✔️ Xem tỷ lệ kèo bóng đá trực tuyến các trận cầu diễn ra vào tối nay và ngày mai✔️✔️✔️
keonhacai89vn@gmail.com
0936887896
89 Võ Oanh, Phường 25, Bình Thạnh, Thành phố Hồ Chí Minh, Việt Nam
https://trello.com/keonhacai89
https://www.diigo.com/profile/keonhacai89
https://slides.com/keonhacai89
https://solo.to/keonhacai89
https://scrapbox.io/keonhacai89
https://wakelet.com/@keonhacai89
WELCOME TO SNGVFX
Published: 2022-10-21 19:36:12

Welcome to my coding page. Here you will find a list of my current and past coding projects....  Created using a combination of the following programming languages: **_Python, Javascript, CSS, PHP, Linux/Bash and Database MySQL, PostgreSQL and MongoDB_**.

My projects include:

1. Simple Password Manager
2. Pro Password Manager V.1
3. FolderDeletor V.1
4. Video Processor V.2
5. Serato Live Track Reader V.1
6. Simple Music File & Folder Organizer V.1

and more...
I will be sharing some here and on GITHUB.
How to add Bulma Into Your Nextjs Web App
Published: 2022-10-21 19:05:47

First of all create the application using npm or yarn

```
npx create-next-app
yarn create-next-app
```
Second Thing is To READ the documentation of [Bulma.io](https://bulma.io/)

Install Bulma into your app
```
npm install bulma
```
Just like how you import the bootstrap package in your _app.jsx .Do That with Bulma 

```
import "bulma/css/bulma.css";

```
Build your portfolio at the .NET Conf Student Zone
Tags: beginners, programming, dotnet, csharp
Published: 2022-10-21 18:43:55

⭐Come to the .NET Student Zone this year at [.NET Conf](https://www.dotnetconf.net/)⭐ 

On **November 7**, come build some awesome projects with Microsoft experts and learn all about .NET. You will walk away with a project portfolio on your very own portfolio website – don't worry, we will build it right along with you.   

In each 30-minute session, you will build an app or project to add to your .NET portfolio. You will build web apps, a mobile app, an ML project, and more! At the end of the event, we will give you the tools you need to ace your next coding assignment with Visual Studio!  

### Register 
**Session 1** - [Europe, Middle East, Africa, Asia Pacific - Register Now](http://aka.ms/dotnetstudentemea)
**Session 2** - [North and South America - Register Now](http://aka.ms/dotnetstudentamerica)


## More Details
### When: November 7, 2022 
 
Session 1 (12:00PM UTC | 07:00AM EST): Europe, Middle East, Africa, Asia Pacific Timezones
Session 2 (10:30PM UTC | 05:30PM EST): North and South America Timezones

### Agenda:
Session | Title | Speaker
------ | ------|----------
1      | Welcome to the Student Zone     | Scott Hanselman, Katie Savage
2      | Create a GitHub Profile     | Bethany Jepchumba
3      | Build your Project Portfolio website with .NET     | Vincent Nwonah
4      | Detect water bottle consumption from IoT sensors      | Krzysztof Wicher
5      | Use machine learning to estimate future water consumption      | Carlotta Castelluccio
6      | Add a backend to your website      | Chris Noring
7      | Build a mobile app to track water consumption     | Someleze Diko
8      | Build a water consumption tracker website       | Justin Yoo
9      | Ace your next assignment with .NET        | Diego Colombo

## Want more? Join the Challenge!
After enjoying the .NET Conf Student Zone, you will be ready to complete the .NET Conf Student Zone Cloud Skills Challenge. The challenge is open to all students who registered for .NET Conf on November 7 and three lucky winners will get a .NET Conf **SWAG** bag! 🎁🎉

Enter the challenge by filling out this form:[http://aka.ms/dotnetstudententry](http://aka.ms/dotnetstudententry)
IaSQL and Skyplane: Open Source Projects to Boost Your AWS Deployments
Published: 2022-10-21 18:40:13

As a cloud editor for [InfoQ](https://www.infoq.com/profile/Renato-Losio/), I often cover news about cloud open source projects. Two that really caught my attention in 2022 are **IaSQL** and **Skyplane**.

[IaSQL](https://blog.iasql.com/os-iasql/) is a project that provides Infrastructure as SQL on AWS and that can be configured to manage existing deployments,connecting an AWS account to an IaSQL instance. 

[Skyplane](https://github.com/skyplane-project/skyplane), is an open source tool developed at UC Berkeley to optimize the transfer of large datasets between cloud providers, reducing transfer times and costs. It creates an overlay network on top of the cloud providers so it can route around congested cloud network links.

Below you can find the articles I wrote about the two projects. Have you tried any of them? Do you have other recent open source projects to recommend that helped you improve your deployments on the cloud or migrations to AWS? Let me know in the comments 👇 or on [LinkedIn](https://www.linkedin.com/in/rlosio) ✅.

**Infrastructure as SQL on AWS: IaSQL is Now Open Source and SaaS**

IaSQL, the company behind a service that models AWS infrastructure using SQL, has recently announced that IaSQL is available as open source and software as a service. Mapping cloud APIs into SQL tables, IaSQL manages a two-way connection between an AWS account and a hosted PostgreSQL database to describe an AWS deployment. [Read more on InfoQ](https://www.infoq.com/news/2022/04/iasql-aws-infrastructure-cloud/).

{% twitter 1520525272965079040 %} 

**Open Source Skyplane Targets Faster and Cheaper Data Transfers between Clouds**

A team of researchers at the RISELab at UC Berkeley has recently released Skyplane, an open source tool to optimize the transfer of large datasets between cloud providers, reducing transfer times and costs. Designed to be cloud agnostic, Skyplane currently supports transfers between object storages on AWS, Google Cloud, and Azure. [Read more on InfoQ](https://www.infoq.com/news/2022/10/skyplane-data-transfer-cloud/).

{% twitter 1582098330112299009 %}