teleren/devto huggingface dataset:
Introducing: montyhallsim!
Tags: python, github, showdev, programming
Published: 2022-07-07 17:30:25

I am proud to announce that I have created my first Python package and uploaded it to PyPI. It's called montyhallsim, and it serves as a command-line interface for simulating the [Monty Hall problem](https://en.wikipedia.org/wiki/Monty_Hall_problem).

The package consists of only one Python module, so it's easy to copy the source code into a project. It also only occupies about 4 kilobytes of disk space, so it's not as big as compared to other Python command-line interface packages.

The current version of montyhallsim as of July 7, 2022 is [v1.0.1](https://github.com/mrwolferinc/montyhallsim/releases/tag/v1.0.1). I am looking forward to having more contributors to work with, as I am unfortunately the only contributor on the montyhallsim GitHub repository right now. Hopefully, this post will make more people want to contribute to montyhallsim. 😔

The PyPI page for this project can be found [here](https://pypi.org/project/montyhallsim/), and the GitHub repository for this project can be found [here](https://github.com/mrwolferinc/montyhallsim).

I want this Python package to become popular, as it is my very first one. I also think that it can sometimes be useful when you want to try a test scenario of the Monty Hall problem. I want it to become widely installed and used around the world both personally and commercially, **making me famous.**

Anyways, that's all for now, and I hope you guys like my project!
What is JDBC and its components
Tags: java, sql, database, mysql
Published: 2022-07-07 17:10:56


Java Database connectivity ( JDBC ) released 📢in 1997 an is developed🧑‍💻 by oracle . We 👨‍👩‍👦‍👦can use JDBC for any platform🚉. It works with non-relational and relational databases🗃️. Code is easy 💡to understand. The  JDBC API 💡 is a java API that can access💡 any kind of tabular📏 data, especially data is stored📏 in a relational database. JDBC helps⛑️ you to write java application. Java API is to connect🔌 and execute 🧨the query with the database. It is a specification from sun microsystems . That manage 3 programming activites🚩. That's are :

1) Connect to data source🗄️
2) Send queries🗄️
3) Update statements to the database🆕

There are 4 main components:
o   JDBC API🔗
o   JDBC test suit👔
o   JDBC Driver Manager💼
o   JDBC ODBC bridge driver🌉

## JDBC API
  Jdbc API provides universal 👽data access from the java programming language. Using the jdbc api you can access 🔓virtually any data source from relational database to spreadsheets📊, JDBC API provides 2 packages📦:
Java.sql
Javax.sql

## JDBC test suite🧥
  The JDBC test 📝suite helps you to determine that JDBC drivers will run🏃 your program. These test are not comprehensive or exhaustive💨, but they do exercise🏋 many of the important features ✨in the JDBC API.

## JDBC Driver Manager
  Driver 🚗manage class in the java.sql package and it extends object 🧊class. The major purpose of the driver manager is to provide the basic📌 service to manage the set🥪 of drivers that are available to use in the application 🖥.Driver manager is the responsible ⚗️for maintaining the single instance🟡 of each registered✍🏼 driver. Driver manager eliminates❌ having multiple instances of the same👭 driver.

## JDBC ODBC bridge driver🌉
  The JDBC ODBC bridge🌉 allow application written📝 in the java 📝programming language to use the JDBC API with many existing🖇️ ODBC drivers. The bridge is itself a driver based on JDBC technology🤖.
Bionic Reading - New reading Method
Tags: webdev, beginners, discuss, productivity
Published: 2022-07-07 16:30:05

At [allinone.tools](https://allinone.tools/text-list/bionic-reading-converter), we are constantly working on new tools that can make your life easier, "Bionic Reading Converter" is one of them.
Bionic Reading is a new reading method that consists of guiding your eyes through the text in order to read faster. In other words, your reading speed increases drastically.

The images below show you the difference between a text without bionic reading and a text with bionic reading technique. You can definitely feel the difference.

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

## Bionic Reading Converter: 
With allinone.tools's Bionic Reading Converter, you are able to convert your text into bionic reading and download it.


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

Link: https://allinone.tools/text-list/bionic-reading-converter
Contact: contact@allinone.tools
C# Tip: Convert ExpandoObjects to IDictionary
Tags: csharp, dotnet
Published: 2022-07-07 16:21:14


In C#, `ExpandoObjects` are dynamically-populated objects without a predefined *shape*.

```cs
dynamic myObj = new ExpandoObject();
myObj.Name ="Davide";
myObj.Age = 30;
```

`Name` and `Age` are not part of the definition of `ExpandoObject`: they are two fields I added without declaring their type.

This is a dynamic object, so I can add new fields as I want. Say that I need to add my City: I can simply use

```cs
myObj.City = "Turin";
```

without creating any field on the `ExpandoObject` class.

Now: how can I retrieve all the values? Probably the best way is by converting the `ExpandoObject` into a `Dictionary`.

## Create a new Dictionary

Using an `IDictionary` makes it easy to access the keys of the object.

If you have an `ExpandoObject` that will not change, you can use it to create a new `IDictionary`:

```cs
dynamic myObj = new ExpandoObject();
myObj.Name ="Davide";
myObj.Age = 30;


IDictionary<string, object?> dict = new Dictionary<string, object?>(myObj);

//dict.Keys: [Name, Age]

myObj.City ="Turin";

//dict.Keys: [Name, Age]
```

Notice that we use the `ExpandoObject` to create a *new* `IDictionary`. This means that after the Dictionary creation if we add a new field to the `ExpandoObject`, that new field will not be present in the Dictionary.

## Cast to IDictionary

If you want to use an IDictionary to get the `ExpandoObject` keys, and you need to stay in sync with  the `ExpandoObject` status, you just have to **cast that object to an IDictionary**

```cs
dynamic myObj = new ExpandoObject();
myObj.Name ="Davide";
myObj.Age = 30;

IDictionary<string, object?> dict = myObj;

//dict.Keys: [Name, Age]

myObj.City ="Turin";

//dict.Keys: [Name, Age, City]
```

This works because **`ExpandoObject` implements `IDictionary`**, so you can simply cast to IDictionary without instantiating a new object.

Here's the class definition:

```cs
 public sealed class ExpandoObject : 
	IDynamicMetaObjectProvider, 
	IDictionary<string, object?>, 
	ICollection<KeyValuePair<string, object?>>, 
	IEnumerable<KeyValuePair<string, object?>>, 
	IEnumerable, 
	INotifyPropertyChanged
 ```

## Wrapping up

Both approaches are correct. They both create the same `Dictionary`, but they act differently when a new value is added to the `ExpandoObject`.

Can you think of any pros and cons of each approach?

Happy coding!

🐧
JS1024, the most challenging JavaScript/GLSL competition
Tags: javascript, codegolf, programming, webdev
Published: 2022-07-07 16:20:55

JS1024 is a competition where people submit short demos under 1024 bytes, made in JS, HTML or GLSL.

Some of you might be familiar with [JS1K](https://js1k.com/) or [js13kGames](https://js13kgames.com/). Both of them are code-golfing competitions. "Code golf" is a type of recreational computer programming competition in which participants strive to achieve the shortest possible source code that solves a certain problem.

### Timeline:

• 1st of July - theme is announced, competition starts, submission form is open
• 15th of July - deadline!!! submission form is closed, you can rate other projects
• 1st of August - no more ratings!
• a few days later - boom, the results are published and winners are announced

### Demo Categories

**Classic Canvas**
• a = the canvas element
• b = the body element
• c = the 2d context
• d = the document element
• M = a bool that indicates if the user is on mobile

**Shader demo**
• Write your entry like a Shadertoy demo (WebGL1 / GLSL ES 1.0 only)
• Canvas is responsive but its ratio is fixed: 16/9
• Shader inputs: iResolution (w, h), iTime (float), iTimeDelta (float), iFrame (int), iMouse (x, y, clickx, clicky), iDate: float

**No shim**
• It's an empty HTML file, lol. You start from scratch. Anything is allowed (2d canvas, 3d, etc...)

### Rules

• Your source code mustn't take up more than 1 KiB
• No malicious/harmful code allowed
• You're not allowed to extract personal data from users
• No external files allowed (external scripts and images will be automatically blocked)
• Do not share your private participant key. You will use it to rate other projects
• Upload a readable version (+ comments) of your code to help people understand it (optional)

#### [Press here for more details.](https://js1024.fun/) Check it out, the entry is free. Good luck!
Strict mode in JavaScript
Tags: javascript, webdev
Published: 2022-07-07 16:20:04

JavaScript wasn't originally created as a full-fledged programming language. It's original purpose was to add some interactivity to web pages. It was created as a very flexible language, forgiving to those who are new at programming.

However, the language started to be use in more complex contexts, that "sloppiness" started to become a problem. Complex software requires language to be more restricted because it makes it easier to maintain.

For that reason a new mode was introduced to the language, this is the strict mode.

## How to access strict mode

One way to enable strict mode is by putting the string `"use strict";` in the first line of the JavaScript file.

Another way is to use native JavaScript modules. If you're using Node.js, modules are JS files with the filename extension *.mjs* rather than *.js*. In the browser, you should add the attribute `type="module"` to the `<script>` tag.

Code inside classes is always under strict mode too.

## What changes under strict mode

Under the previous mode (often called "sloppy mode", but it's not an official name), you can create variables without declaring them with `const`, `let`, or `var`:

```javascript
name = "Stephanie";
console.log(`Her name is ${name}`);
```
In the old sloppy mode, the first line is correct, it creates a new variable called `name`. But under strict mode, it throws an error.

The problem with creating variables without declaring is that if you reassign an existing variable but you add a typo, you end up creating a new variable without realizing.

Under sloppy mode, many errors were swept under the rug. They didn't work, but the code continued running as if nothing happened. For example:

```javascript
var undefined = true;
var NaN = 25;
delete Object.prototype;
```
In the examples above, you're messing with built-in objects and keywords of the language. You can't change or delete them, but in sloppy mode, these changes are ignored. If you run this code under strict mode, it will throw errors.

Another big difference occurs with [the `this` keyboard](https://nicozerpa.com/why-does-this-work-like-this). When you're calling a function which is not a method of any object, in strict mode the value of `this` is `undefined`. Under "sloppy mode", the value of `this` was the global object (i.e. in the browser, the `window` object.)

```javascript
"use strict";
function logThis() {
    console.log(this);
}
logThis(); // Outputs undefined
```
```javascript
// sloppy mode
function logThis() {
    console.log(this);
}
logThis(); // Outputs [object Window]
```

## When to use it
Nowadays, it's highly recommended that you always use strict mode. The only caveat is that if you are dealing with older code that doesn't use it, you shouldn't necessarily switch to strict mode until you fix all possible errors.

---

If you liked this article, you'll love my JavaScript Newsletter.
Every other Monday, I'll send you easy and actionable steps to level up your JavaScript skills. Check it out: https://nicozerpa.com/newsletter
My portfolio but in dark mode
Tags: webdev, javascript, programming, tutorial
Published: 2022-07-07 16:18:42

I've been updating my portfolio today for quite a lot now. So for last changes i wanted to add a dark mode option and i don't have any idea on how to do it in faster way and no idea where do i gonna add the dark mode icon or option.

So i come up with a crazy idea of copying my webvium force dark mode js and paste it on my site and by detecting if the user tripple click it it'll turn on/off dark mode.

This is my site looks like light mode:
![My site header in light mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u3s0oap89jd1781qgwng.png)
![My site footer in light mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fygxh7l1w557wj4wn08r.png)

This is what my site looks like when user tripple click to turned on the force dark mode:
![My site header in dark mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2hply9u5e0fpvqrjs1l2.png)
![My site footer in dark mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jnbpx93benzssxykqklh.png)
It's just an inversion of the color but so far it's looks cool.

This is the code i used:
``` JavaScript
window.addEventListener('click', function (evt) {
  if (evt.detail === 3) {
      javascript: (
  function () { 
      var css = 'html {-webkit-filter: invert(100%);' +
                '-moz-filter: invert(100%);' + 
                '-o-filter: invert(100%);' + 
                '-ms-filter: invert(100%);}' +
                'img, iframe, video, canvas, svg, picture {-webkit-filter: invert(100%) !important;' +
                '-moz-filter: invert(100%) !important;' + 
                '-o-filter: invert(100%) !important;' + 
                '-ms-filter: invert(100%) !important;}',
      head = document.getElementsByTagName('head')[0], style = document.createElement('style');
      if (!window.counter) { 
          window.counter = 1;
      } else { 
          window.counter ++;
          if (window.counter % 2 == 0) { 
              var css = 'html {-webkit-filter: invert(0%); -moz-filter: invert(0%); -o-filter: invert(0%); -ms-filter: invert(0%); }' +
                  'img, iframe, video, canvas, svg, picture {-webkit-filter: invert(0%) !important; -moz-filter: invert(0%) !important; -o-filter: invert(0%) !important; -ms-filter: invert(0%) !important;}'
          }
      };
      style.type = 'text/css';
      if (style.styleSheet) {
          style.styleSheet.cssText = css;
      } else {
          style.appendChild(document.createTextNode(css));
      }
      head.appendChild(style);
  }
());
  }
});
```

my website: [https://mrepol742.github.io](https://mrepol742.github.io?utm_source=new%20updates)
Luos technology: Basics
Tags: opensource, microservices, tutorial, luos
Published: 2022-07-07 15:59:01

Luos engine is the engine provided by Luos that will manage your services on all your nodes.

Let’s define what is a node, a package, a service, a service detection, a routing and a message!

⏩ https://www.luos.io/docs/luos-technology/basics/concept

Thanks to this article, you will be better informed about our specific language.
YouTube coding channel for absolute beginners 💖
Tags: javascript, beginners, codenewbie, gamedev
Published: 2022-07-07 15:57:45

Hello dev.to community,

I recently decided to start a youtube channel with coding lessons and projects for absolute beginners and "recreational coding" hobbyists.

The channel is recommended also for parents and educators that want to teach coding to kids in a friendly way.

📽️ You can find the main channel here:
[https://www.youtube.com/c/CodingAdventures](https://www.youtube.com/c/CodingAdventures)


![Breakout clone](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t72tulg7n55r08v22znn.jpg)

![Bubble sort](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7x6ddb22hu95mqkuono4.jpg)

![VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9qjcy5cqvg3s4ff3na9h.jpg)

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


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

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

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


I hope you like the videos!
Full-length tutorial on deploying Flask app on AWS with Docker + RDS + Secrets Manager
Published: 2022-07-07 15:57:33

The playlist details how to take a `flask` application from your local machine and have it deployed on AWS with the following components:

* database hosted on AWS
* domain name from AWS with SSL certificate
* CI/CD pipeline with GitHub actions to automate all changes
* pushing the Docker container of your `flask` app to AWS using the CI/CD pipeline

[All the code for the video is on GitHub](https://github.com/programmingwithalex/aws-ecs-demo) as well, with the link in the video description.

---

If you find the video helpful you can greatly help me by doing one or all of the following:

* [supporting me on Patreon](https://www.patreon.com/programmingwithalex)
* [subscribing to my YouTube channel](https://www.youtube.com/channel/UC4UApj67YtJq2a2PAzmbQAQ)
* liking and/or commenting on the video
* sharing the video or [channel](https://www.youtube.com/channel/UC4UApj67YtJq2a2PAzmbQAQ) on any platform ([reddit](https://old.reddit.com), [twitter](https://twitter.com/), [discord](https://discord.com/), etc.)
* [starring the GitHub repo](https://github.com/programmingwithalex/aws_ecs_demo)
* [following me on GitHub](https://github.com/programmingwithalex)

---

Any questions or requests, just leave a comment.
If you could add one feature to DEV, what would it be?
Tags: discuss, meta, community
Published: 2022-07-07 15:48:05


![little girl waving arms dramatically and saying "I want it"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/avpef7vzmhon9pzblkep.gif)

**If you could add one feature to DEV, what would it be?**

Feel free to take an existing feature and describe how you might adjust it if that's your preference. If you like someone else's idea in the comments below, please upvote it (❤️).
Amazon Web Services (AWS)
Tags: aws, beginners, cloud, amazonwebservices
Published: 2022-07-07 15:23:22

**What is Amazon Web Services?**

Amazon Web Services(AWS) is the world's most comprehensive and broadly adopted cloud platform. In 2006, AWS began offering IT infrastructure services to business in the form of web services now commonly known as cloud computing. Now, AWS has more than 200 services offered. AWS provides a highly reliable scalable low cost infrastructure platform in the cloud that powers hundreds of thousands of businesses. In, 190+ countries around the globe AWS has architected to be the most flexible and secure cloud computing environment available today. 

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

This is the AWS global infrastructure it has 26 launch region with multiple availability zones. The regions are the clusters of data centers. Each region has maximum of three availability zones as you can see the in the picture the blue dots are the availability zones and the yellow dots are upcoming regions. AWS has 84 availability zones around the globe. It has 400+ Edge Locations and 13 Regional Edge Caches(410+ Points of Presence). 

**Why you should pick AWS?**

AWS is leading cloud infrastructure service provider in the industry with the largest share of 33%. AWS offers low pay, as you go pricing. With no upfront expenses or long-term commitments. You pay only for what you use. It is scalable and supports higher performance. AWS provides a massive global cloud infrastructure that allows you to quickly innovate experiment and iterate instead of waiting weeks or months for hardware. You can instantly deploy a new application instantly scale up as per your workload requirement. You can instantly scale down as well based on the demand. Whether you need one virtual server or thousands. Whether you need them for a few hours or 24/7. You still pay for what you use so this is a benefit of AWS. AWS offers flexible environment. AWS is a language and operating system agnostic platform you choose the development platform or programming model that makes the most sense for your business. You can choose which services you use, choose how you use them. This flexibility allows you to focus more on innovation less on infrastructure.
Understanding the way obfuscator software works
Published: 2022-07-07 15:22:01

- 
The word obfuscate refers to something made in a hazy way such that understanding it is not easy. When it comes to computing, the meaning is still the same. It makes reference to software protection. Developers of software create some codes that help in making it hard for other people to copy their original work. The NET obfuscator from Skater is one typical example. This obfuscation software utilizes a set of codes that are not easily comprehensible. Mainly, the practice among programmers is to make their programs in a simple way. They then use an obfuscator which makes it hard for another person to copy those programs.

- 
The idea behind [NET obfuscator](http://skaterpro.net) [url: http://skaterpro.net] technology is to make programs more secure. In these days when hacking is prevalent, software protection is not an option. As a programmer, the software you create is an intellectual property. If you do not take proactive measures, someone else might use your codes and come up with parallel software. They may end up benefit unfairly from your hard work. Through obfuscation, you are able to protect software from unauthorized people. Only a few people belonging to the software owner’s team are able to read the codes. Besides, using encrypted software hastens the processing speed.

- 
You should always bear in mind that any person who is determined to crack your software will still do so. Nonetheless, NET obfuscator ensures that any attempt at reverse engineering is thwarted. That way, no person can get into the product of your intellect easily. Software protection means a lot to any business. You can imagine what would happen if someone gains unauthorized entry into your company’s computer system. There is no telling what such unscrupulous people would do. Some would steal your data and share it with competitors. That would be a big blow to your operations.

- 
The Skater .NET software provides code protection in numerous ways. Examples that are worth of mention include mangling names, encoding strings and control flow. Once you have acquired the software, downloading and installing it takes a short time. Usually, this is in the range of 3-5 minutes. You should first talk to your software provider about the needs of your organization. Skater has designed their obfuscating software for use per machine. You can also go for an option that runs from a server. You also need to inquire about technical support. In the event that you need an update every year, this can also be arranged.

- 
One last word, you should not forget the way such software works. All it takes is for you to interconnect the program with its appropriate obfuscator. Other people trying to copy the same will see the program working in the way it was intended. What they cannot crack is the intricacies. You can equate this with someone trying to solve a puzzle whose end result does not make any sense. That is how your program’s safety is boosted. Anyone trying to crack your codes will not get through to doing so. It also protects your programs when you are doing upgrades.