teleren/devto huggingface dataset:
PlanetScale - Creating a table and adding information using PHP
Tags: planetscale, php, tutorial, webdev
Published: 2022-03-26 03:03:50

###I previously made a post about connecting to a PlanetScale database, you can find it [here](https://dev.to/iamluisj/connecting-to-planetscale-with-a-pdo-object-in-php-2h09). 

#Creating a table
You can create a table with PlanetScale's UI or programmatically. I'll be using PHP, but you can use any language you prefer, once you've connected to your instance.

##PlanetScale UI
There is a [web console](https://docs.planetscale.com/concepts/web-console) you can access from your PlanetScale branch that allows you to run SQL code directly.

```
CREATE TABLE `users` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `email` varchar(255) NOT NULL,
  `first_name` varchar(255),
  `last_name` varchar(255)
);
```

##Programmatically creating a table
I use PHP's PDO class, so assuming you have a PDO object $db created.

```
function createTable() {
    global $db;
    $query = 'CREATE TABLE `users` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `email` varchar(255) NOT NULL,
  `first_name` varchar(255),
  `last_name` varchar(255)
)';
    $statement = $db->prepare($query);
    $statement->execute();
    $statement->closeCursor();
}
```

*Note: This will not work if your branch is running in "production" mode. The point of PlaneScale is that you can make schema updates without breaking your database, so they don't let you make modifications directly to that branch. If you already have your main branch in production mode, create a new branch. I called my second branch 'dev' and setup a PDO to the second branch so I can modify the schema there if needed. Then once you are ready you can "deploy request" your branch to the main.

##Inserting data into PlanetScale Database
You can now execute SQL statements as you normally would.

```
function addRow($userEmail, $fname, $lname) {
    global $db;
    //add user to group
    $query2 = "INSERT INTO users (email, first_name, last_name) VALUES (:userEmail,:first_name, :last_name)";
    $statement = $db->prepare($query2);
    $statement->bindValue(":userEmail", $userEmail);
    $statement->bindValue(":first_name", $fname);
    $statement->bindValue(":last_name", $lname);
    $statement->execute();
    $statement->closeCursor();
}

addRow("myTestEmail1231@gmail.com", "TestUser1", "TestLastName");
```

If you are using PHPStorm, I would highly recommend connecting your PlanetScale database to your IDE through DataGrip. [Here is an article on how to do that](https://planetscale.com/blog/using-planetscale-with-jetbrains-datagrip-mysql-gui). This will give you things like autocomplete and make it easier to catch bugs/typos in your SQL statements.

###If you found this helpful or have questions, drop a comment below or ping me on Twitter [@helloLuisJ](https://twitter.com/HelloLuisJ)!
What is TDD?
Tags: tdd, tutorial, testing, qa
Published: 2022-03-26 13:54:53

---
title: What is TDD?
published: true
date: 2022-03-26 02:28:06 UTC
tags: #tdd #tutorial #testing #qa
canonical_url: https://blog.seancoughlin.me/what-is-tdd
---

Test-driven development, or TDD, is a programming style. TDD focuses on improving code by focusing on writing tests first. This is the opposite of typical software development. In most cases, the software is developed first, and test cases are created later.

## The Rules of TDD

The general principle follows just three steps:

1. Write one unit test describing an aspect of the program. The test should fail upon running because the program lacks the needed feature.
2. Write the minimal amount of code possible that will solve the test. The goal should be to keep things simple. We only need to make the test pass.
3. Refactor if necessary to reduce duplicate code or improve quality. Then continue on to repeat the process.

## Benefits of Test-Driven Development

- Test coverage is extremely high because code is written to make test cases pass. This ensures good code quality and keeps defects to a minimum.
- Writing only the very basics to make a test pass keeps code simple and the design cleaner.
- Defects are caught earlier because the test cases are already written.

## Cons of TDD

- TDD is a design pattern, so teams can implement TDD differently. Even within teams developers can have various levels of adherence to the principles.
- TDD can lead to an over-focus on small code chunks and less focus on wider functionality tests.
- Testing becomes part of the project and maintenance can be high if tests are written too rigidly.

## Further Reading

TDD is closely related to [ATDD](https://en.wikipedia.org/wiki/Acceptance_test%E2%80%93driven_development) or acceptance test-driven development and [BDD](https://en.wikipedia.org/wiki/Behavior-driven_development) or behavior-driven development.
Comparison of Azure Data Lake Storage(ADLS) Gen1 vs Gen2
Tags: azure, datalake
Published: 2022-03-26 02:24:18

Azure Data Lake Storage or short name Data Lake is a system or repository of a huge quantity of data in a structured or unstructured form that is stored in its natural format(i.e object blobs or files). Data lakes handle the three Vs of big data (Volume, Velocity, and Variety).

Let’s dig deeper and understand all the topics related to Azure data lake. Hope you will find it helpful for sure.
	

## What is Azure data lake storage?
It is a part of the Microsoft Azure public cloud platform, which is a cloud platform that supports big data storage and analytics of any kind and size.

## What is Azure data lake storage

Data lake storage is the storage of information solutions that has specifically been designed for the analytics of big data. Its working is quite simple. 

Each data lake service underneath always has a container. That container is very often called a file system and just like any file system it has folders and files within it which is fully scalable and secure that supports HDFS semantics while working with the Apache Hadoop ecosystem. 

On each data lake, you can actually have multiple containers, multiple file systems containing any structure of files and folders that you wish to have.

## What are the features of Azure Data Lake?
Some notable features of Azure data lake storage are as follows

- Infinite size of data can be stored in a single repository.
- Both structured and unstructured data in their natural formats can be stored
- There is high availability, durability, and reliability.

### There are 2 types of Azure data lake storage ADLS Gen1 and ADLS Gen2.

Earlier [Azure Data Lake Gen1](https://beetechnical.com/cloud-computing/azure-data-lake-storageadls-gen1-vs-gen2-complete-guide-2021/) was generally used but now Azure Data Lake Gen2 is mostly used and it is also reported that on Feb 29, 2024, Gen1 will be retired, so anyone using  Azure Data Lake Gen1 has to migrate to Azure Data Lake Gen2 by that date.

ADLS Gen1 can be accessed from Hadoop using the WebHDFS-compatible REST APIs. It has all enterprise-grade capabilities such as security, manageability, scalability, reliability, and availability.

ADLS Gen2 is designed for big data analytics which means there is something called azure blob file system or ABFS which is encrypted. This file system is compatible, allowing many of the existing solutions in the market to connect with no hustle.
What is software testing?
Tags: testing, series, qa
Published: 2022-03-26 13:54:09

---
title: What is software testing?
published: true
date: 2022-03-26 02:22:34 UTC
tags: #testing #series #qa
canonical_url: https://blog.seancoughlin.me/what-is-software-testing
---

I started my career with an internship in software quality assurance. Throughout that internship, I learned about the alphabet soup of software testing: TDD, BDD, ATDD, UAT, PT, etc. All of those letters are easy to set your head spinning.

As my career has progressed I've migrated from quality assurance to software development. I've only seen the importance of good testing practices grow and I use testing tools and frameworks on a daily basis.

In this series, I will break down the various ways of testing code in short digestible chunks. I'll provide some background and pros and cons of each method.
What's your editor journey like as a developer?
Tags: discuss, programming, career
Published: 2022-03-26 02:05:11

I stumbled upon this amusing thread on twitter where people were discussing different editors.

{% embed https://twitter.com/InfiniDream1/status/1507266535395508229?s=20&t=x4tMNbOkfPM6fpnOj0Y_rw %}

{% embed https://twitter.com/ModernFaraday/status/1507286498374127624?s=20&t=x4tMNbOkfPM6fpnOj0Y_rw %} 

{% embed https://twitter.com/k_quirapas/status/1507532970646974464?s=20&t=x4tMNbOkfPM6fpnOj0Y_rw %}

Don't get me wrong, I shared these tweets because I find them funny. It also made me look back on my developer journey and the editors I used before.

Here's my Editor journey.

{% embed https://twitter.com/k_quirapas/status/1507535061406859269?s=20&t=x4tMNbOkfPM6fpnOj0Y_rw %}

I was wondering, what's your editor journey like?
Share them down below.
npx gitignore
Tags: tooling, npm, git
Published: 2022-03-26 01:04:06

I've done this a few times on a live stream and there is always someone unaware of this so I wanted to share.

Assuming you have Node.js installed on your machine, you can run `npx gitignore your_language`, e.g. `npx gitignore node`, and it will generate a gitignore file for you for the given language.

Here's a clip from my stream today showing it in action. Maybe you'll find it useful in your next project!

{%embed https://www.youtube.com/watch?v=pSq7bSk3WqU&list=PLcR4ZgxWXeIACx4_zqXqM8m6LN6lIiZZj&index=1 %}

Photo by <a href="https://unsplash.com/@6heinz3r?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Gabriel Heinzer</a> on <a href="https://unsplash.com/s/photos/git?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Setting up TailwindCSS with SASS in RedwoodJS
Tags: redwoodjs, tailwindcss, scss, sass
Published: 2022-03-26 00:51:04

Here's a quick and easy guide on how to setup TailwindCSS, using the SASS preprocessor, in a new RedwoodJS project.

## Requirements

Make sure you have the correct npm / yarn versions installed, the details of which can be found at https://redwoodjs.com/docs/quick-start.

## Setting up tailwind and scss

```
yarn create redwood-app my-app-name
cd my-app-name
yarn rw setup ui tailwind
yarn rw setup webpack
yarn workspace web add -D sass sass-loader
```
*The code above will create a new RedwoodJS project, then set up Tailwind, webpack, and Sass in your project.*

Make sure to change `index.css` to `index.scss` and update the import in your `web/src/App.js` file.

## Conclusion
That should be it!  You're now all set to go :)
Bing Wallpaper Xfce - How to get new daily wallpapers in Xfce
Tags: linux, xfce, bing, wallpaper
Published: 2022-03-26 00:30:33

![Example image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/czr8ccrscgykopnvjzxr.png)
_Screenshot from https://github.com/German-git desktop using the Bing Wallpaper script_

**Gnome, Kde**
So there are a lot of flatpak and snap apps for wallpapers which work on Gnome and Kde, but they almost never work on Kde except Variety which has some critical bugs on Xfce.

**How I found a solution**
I was searching for weeks time to time for a good and easy to use solution. I installed a lot of apps, but they all didn't  worked fine and were broken for Xfce or Propriety Software like Wonderwall. Then I discovered a python script on Github which was created 6 days ago.

**How to use it?**
I just did `git clone https://github.com/kazuki/xfce-bing-wallpaper` in my terminal and then `cd xfce-bing-wallpaper` and `python3 bing-wallpaper.py` to execute it. 2 Seconds later the daily Bing wallpaper showed up on my desktop. After that I went to the Xfce-Settings-Panel and opened Startup-Applications and clicked on the plus button to create a new start app / script. Then I wrote there `python3 /path/to/script/bing-wallpaper.py` and at the next day after rebooting my machine I got the next daily wallpaper.
Thank you for creating this awesome script!
2.9 was exciting
Tags: opensource
Published: 2022-03-26 00:19:19

This week I have the chance to spend more time and mind on Telescope since I don't have to worry about looking for an internship any more and this release has been productive and full of knowledge. 

## What have I done? 
[My parser tests](https://github.com/Seneca-CDOT/telescope/pull/3040) are finally done, thank you David for being patient with this task. I'm pretty sure that I close all connections that are open during the e2e test but something still hangs, I suspected that it comes from `[Bull]`(https://github.com/OptimalBits/bull) but it was hard to figure out what it actually was, therefore, I decided to `--forceExit`[https://jestjs.io/docs/cli]

After the tests were done, I [dockerized the parser service](https://github.com/Seneca-CDOT/telescope/pull/3302), it wasn't too hard as Kevan had done similar Dockerfile refactoring PRs and I had other images as an example. But I still took some time to understand what's going in those docker files. 
* Multi stage build, I guess it speeds up the process, it makes it easier to control data you want to pass to the image.
* User deterministic docker base image tags to achieve more stable build
* Don't execute Node.js app as root but use a `node` (lower privilege user) to improve security and the command `--chown`

## How I helped others and learned as well?
Roxanne put an [autocomplete for authors PR](https://github.com/Seneca-CDOT/telescope/pull/3301) which was very interesting, people were really responsive, it has 42 conversation in a few hours :D. It took me a while to learn what is n-gram, edge n-gram, how we need to the n-gram analyzer to index the database. I pretty much just raised some questions in the PR. Elasticsearch really is complicated, though Roxanne was able to answer most questions, kudo to you. This is also useful for my other project, it came just in time :D

Francesco opened [a PR to implement copy button](https://github.com/Seneca-CDOT/telescope/pull/3281), I found it very interesting so I tried to play and make it work, I made some progress and sent a PR for Francesco to take some inspiration.

I also reviewed some dependency discovery service pieces, I'm not exactly sure how it works yet, will need to talk to Jerry to help him with storing data through parser. Other than these PRs, I left my reviews in different PRs too. 

---

There were a lot of Docker movements the last few days, I want to catch up to them but I guess I need more fundamentals first
JavaScript Features You Need to Look At
Tags: javascript, programming, todayilearned
Published: 2022-03-26 00:01:57

ECMAScript 2022 is right around the corner, but there were many exciting features that were introduced last year:

### replaceAll method
```
const message = "A-message-being-divided";
const processedMessage = message.replaceAll('-', ' ');
```

With replaceAll(), you can replace a given character or set of characters in a string with something else. It takes two arguments - the value you want to replace and the value you want to replace it with.

### Promise.any()
With Promise.any(), you are able to return a promise that resolves as soon as any of the promises passed inside the promise array parameter is fulfilled. If none are, an AggregateError will be thrown.

### Logical Assignment Operators
These can help make code shorter and cleaner! There is the OR & Equals (||=) , And & Equals (&&=), and nullish coalescing assignment operator (??=)

### Numeric Separators
The separators allow you to add underscores between digits, which makes them more readable.
```
let n1 = 1_000_000_000;
console.log(n1) // This will print:1000000000
```

### WeakRef
WeakRef stands for Weak References and allows you o create a weak reference to an object. This is a reference that does not prevent the object from being reclaimed by the garbage collector.

### Conclusion
There are always new methods and developments to learn that enhance our code. What are some of your favorite JavaScript features you use the most often? Always love hearing from everyone!

Happy coding!

<a href="https://www.buymeacoffee.com/tmchuynh" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="20" width="40"></a>
If you don't understand WIP limits, ask your waiter
Tags: wiplimit, wip, flowengineering
Published: 2022-09-21 16:54:26

---
title: If you don't understand WIP limits, ask your waiter
published: true
date: 2022-03-26 00:00:00 UTC
tags: wiplimit,wip,flowengineering
canonical_url: https://jhall.io/archive/2022/03/26/if-you-dont-understand-wip-limits-ask-your-waiter/
---

Last night, to mark our last dinner in the US before returning to Amsterdam today, my wife and son and I went to dinner at a nice Italian restaurant in Galveston, Texas, with my brother-in-law and his family.

We arrived around 5pm, and had to wait just over an hour for our party of 8 to be seated.

While we were waiting near the host’s stand, we could see into the dining room. There were many empty tables. Probably half of the tables were empty at any given time. Other would-be guests kept arriving, and asking for a seat. Parties of 2 were routinely told 45 minutes to wait. Parties of 5 or more were given times of up to 2 and a half hours.

All the while with empty tables.

What gives?

The hostess on duty kept explaining to the new arrivals, “We’re extremely understaffed right now. We do have tables, but we don’t have enough staff to serve the tables.”

This is a perfect example of a WIP limit.

A less experienced hostess may have tried to seat the dining room to capacity. But what would be the result?

That 2-hour wait at the host’s stand would become a 2-hour wait _at the table_.

Actually, it’s worse than that. The wait at the table would inevitably have been longer. Perhaps double or even worse, because serving too many tables is harder and slower than serving at or below the waiter’s capacity (I can say this from experience, having been a waiter for several years in my younger days).

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
How to send large file with curl in PHP
Tags: php, tutorial, laravel, programming
Published: 2022-03-25 22:29:55

To send a large file, **over 2 gigabyte**, in a HTTP request (for example to an external API) with PHP is not easy because we can be limited with the memory_limit.

I was struggling with Guzzle, and the Laravel HTTP Client for days. Even by setting `memory_limit = 5G` i was having memory or write issue like : `fwrite(): Write of xxxx bytes failed with errno=0 No error`

I could finally make it with the PHP curl extension 

```php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://example.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$headers = [];
$headers[] = 'Content-Type: multipart/form-data';
$headers[] = 'Cookie: something...';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, 1);
$path = '/full/path/to/file';
$file = curl_file_create(realpath($path));
$post = [	
	'file' => $file,
	'other_field' => 'value',
];
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$result = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
var_dump($result,$httpcode);
```

I hope it will help you !

In a next article i will explain how to chunk upload large file to your Laravel app and not bein limited by your memory limit.
AlmaLinux for Azure HPC -- Now Available!
Tags: azure, linux, opensource, almalinux
Published: 2022-03-25 22:13:39

Hello HPC Fans. A few weeks ago we updated our images on Microsoft Azure to 8.5. Today we are proud to announce the general availability of [AlmaLinux OS for Azure HPC](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/almalinux.almalinux-hpc
) based on AlmaLinux OS 8.5. This was a tremendous team effort starting from community requests and developed in collaboration between the AlmaLinux community and the team over at our amazing sponsors Microsoft Azure.

We had a couple of goals when we set out on this project. First, is to further enable scientific computing and research. That is something that we feel very strongly about and many across the vast expanse of scientific research have begun to start leveraging the cloud due to the lack of resource constraints there. It is much easier to do you work whether it be simulations or something else if you can add nodes instantly with a quick command in your terminal. Second, HPC is often out of reach for many due to the large investment that is typically required. Combining the benefits of cloud economies-of-scale along with HPC technology opens the door for many to be able to experience what HPC is and what it really do. We hope that it will inspire those already there to explore what more they can accomplish and inspire the next generation of scientists and researchers to begin experimenting.

You can now take advantage of Azure's leading edge H-series CPU and N-series GPU based instances, along with RDMA support and low latency networking to power all of your cloud-based HPC workloads large scale computation, circuit design, fluid dynamic analysis, natural resource exploration and many other HPC workloads.

The image includes a suite of the most popular HPC tools and libraries pre-installed including the NVIDIA/Mellanox OFED drivers, InfiniBand-based MPI Libraries such as HPC-X and OpenMPI, Communication runtimes Libfabric and OpenUCX, AMD BLIS, FFTW and FLAME libraries, Intel oneAPI Math Kernel Library, and a host of other domain-specific libraries and utilities.

[Join us](https://chat.almalinux.org/
). Our team is always on the lookout for more contributors. Report any bugs you may see on the [Bug Tracker](https://bugs.almalinux.org/
). Join the [AlmaLinux Community Chat](https://chat.almalinux.org/
) or our [HPC Forum](https://almalinux.discourse.group/c/sigs/hpc/31
) if you need any help, post a question, or even if you just want to hang out. Reach us on [Reddit](https://reddit.com/r/almalinux
) and on [Twitter](https://twitter.com/almalinux
).

-- Happy Hacking
𝗠𝘂𝗹𝘁𝗶 𝗦𝗰𝗵𝗼𝗼𝗹 𝗠𝗮𝗻𝗮𝗴𝗲𝗺𝗲𝗻𝘁 𝗦𝘆𝘀𝘁𝗲𝗺 𝗶𝘀 𝗮𝘃𝗮𝗶𝗹𝗮𝗯𝗹𝗲 𝘄𝗶𝘁𝗵 𝗦𝗼𝘂𝗿𝗰𝗲 𝗖𝗼𝗱𝗲(𝗪𝗿𝗶𝘁𝘁𝗲𝗻 𝗶𝗻 𝗣𝗛𝗣).
Tags: schoolapp
Published: 2022-03-25 21:27:49


IT'S FREE!!!GRATUIT
#scolaricx
Add me as a contact on WhatsApp. [https://wa.me/qr/WO7BPDXCLJJBO1](https://wa.me/qr/WO7BPDXCLJJBO1)

Free download int GitHub
[https://github.com/carleii/school-management-app-v2](https://github.com/carleii/school-management-app-v2)

And thanks for adding ⭐✨

1.ADMIN PANEL 
2.STUDENT PANEL 
3.PARENT PANEL 
4.TEACHERS PANEl

¶Academic Session Management
All documents uploading for teachers Admin and students
¶Multi Language
¶Easy to Install
¶Different Types of User Login
¶Dynamic Permission with unlimited user role
¶HRM Module
¶Payroll Module
¶Student Management
¶Parent Management
¶Teacher Management
¶User Management
¶Class sections
¶Subject Management
¶Assignment
¶Class Routine
¶Exam Management
¶Mark Management
¶Mark Distribution
¶Syllabus
¶Student Attendance
¶Staff Attendance
¶Financial Account
¶Income & Expense
¶Student Invoice
¶Payment History
¶Library
¶Transport
¶Hostel
¶Message
¶Email
¶SMS
¶Events
¶Notices
¶Powerful Report Features
¶Many More
¶Easy to Use
¶Unlimited Post
¶Unlimited Pages
¶Dynamic Site Navigation
¶Theme Option
¶Slider
¶Many More