teleren/devto huggingface dataset:
Scaring a stray cat away using ML
Tags: raspberrypi, iot, opensource, machinelearning
Published: 2022-11-19 20:04:45

I recently began to face an issue at my place that was causing a lot of stress. A stray cat wandered into my apartment and started to poop on my doormat. First, I thought it was a one-off and had the rug washed. But then it did it again. I then kept my doormat in for a couple of weeks and put it back later hoping the cat got a different place to relieve itself. But this continued.

So I figured let's use technology and put my Raspberry Pi Zero to a different use than just a [homebridge server](https://dev.to/mohsin/enabling-my-iot-devices-on-apple-watch-alc). So I purchased [a pi camera module](https://robu.in/product/5mp-raspberry-pi-camera-module-w-hbv-ffc-cable), and began to code away. Took me a couple of days to get the whole thing running coz I had to juggle between an ongoing freelance project and this fun personal project but I was quite satisfied with the end result. The crazy thing is that I've never worked with Python in the past so this was technically my first python project.

Anyway, without further ado, here's how a video demo of me setting this up:
{% embed https://www.youtube.com/watch?v=Ii_dgGC3IoM %}

The way it works is this:
1. Keep the camera video open and running forever.
2. Whenever there's a motion detected, start the recording and detection process.
3. The recording basically stored video continuously until motion stops for at-least 5 seconds, so I get a nice slice of recorded motion (however long it maybe).
4. The detection process takes one image every 10 seconds, sends it to Amazon Rekognition where their deep learning algorithm classifies labels on the image. If there is a cat then it sounds an alert.
5. The alert is basically a dog barking sound that should scare the cat away. While there is no audio, I would still get a recording of this in action so if that happens, I'll post that here. In the meantime, here's a demo of the project barking to a cat image from the internet:

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

I'm yet to actually see if this solves my cat issue and am more curious if the cat "figures it out". Will add some videos with results when it happens. Also, it would be interesting to try using a different group of sounds to see if that behaviour changes. Anyway, if you're interested to look at the code, feel free to check it out here.
{% embed https://github.com/mohsin/cat-detection %}
The Future Of Programming in Uganda.
Tags: programming, afric, webdev, beginners
Published: 2022-11-19 20:03:56

Is the future of Programming Dead In Uganda? Many have asked this question and questions related to this discussion but sadly, no answers have been found.

Uganda as a country, is one of the countries with the youngest population in the world having an average age of 16.7 (years). Over 80% of the country's population is under the age of 30. But even with these statistics, the use and adaptation of new technologies such as Artificial Intelligence, Machine Learning, Robotics etc. is still low due to many factors such as the high poverty rates and increased data charges. These factors have made it hard for the adventurous youth to explore the various services on the internet. 

I think programming and coding should be added to Uganda's Primary and Secondary learning curriculum, just as it was done in Kenya recently, to enable the young kids get an insight of what how to interprete and play around with codes in order to practically execute their ideas to enhance their learning.

Despite the lack of knowledge in the programming field among many youths in Uganda, companies such as Code Academy Uganda have emerged to teach people and children the purpose of programming and how it could change the lives of many people in the country. They have taught many kids the basic of programming using the Scratch interface, which is more user friendly and then advanced on to the Web Developing languages such as HTML, CSS and JavaScript.

As a young programmer at the age of 17, I also try to do my level best to show people around my communities what programming is all about. Hopefully, I inspire many young people in many other communities with my projects so they could embrace the idea of coding and programming.

The struggle continues, but I still believe the future of Programming in Uganda is not yet dead though it might be suffocating in the Intensive Care Unit but I believe we have what it takes to make it rise again. 

Together as We Can.
How did I build my first browser extension ?
Tags: webdev, javascript, react, beginners
Published: 2022-11-19 19:57:51

> I am not going to write code, it's the story behind building an extension.

As Michael Bierut said **“ The problem contains the solution. ”**
As I am always reading articles and following tutorials online, it is obvious that I will jot down notes, thoughts and ideas. 

But the problem was that I had to leave my browser and write it down in a notepad before saving it, which meant that I would have a lot of files scattered around my laptop, making it difficult to find a specific note.

My brother, who is a data scientist by the way, came up and said, "It would be nice to make yourself an extension and store your thoughts there so you don't have to go out and do it. Think about it."

Then, the process began.

## Design

Because a notes app will not have a complex interface, the design did not take long, especially since I previously created a notes app using Vanilla JavaScript.
My little brother picked the colors.

## Jumping to code

I spent most of my time in VS Code and in browser's console ; exploring bugs and errors ; .
It took me around 20 days to finish it and finally [publish it](https://github.com/lotfijb/bullet-journal-extension).

## Good news after publishing it

After publishing the source code to GitHub, I wanted to add Bullet Journal to [Mozilla add-ons](https://addons.mozilla.org/en-US/firefox/addon/bullet-journal/) and here are good news : 
* It underwent the automatic review
* Content review was successful
And after 15 hours, I received an email saying that Bullet Journal was approved after passing the technical code review and basic functionality testing.
It is now available for Firefox users and you can [download it here](https://addons.mozilla.org/en-US/firefox/addon/bullet-journal/)

## Conclusion
It is obvious that the Internet is filled with project ideas, but an idea that solves a problem is always a better idea.
Don't look far away to find your next project; focus on what you're missing and what can make something easier for people, and start working on it.
What is Kubernetes?
Tags: kubernetes, containerapps, beginners, tutorial
Published: 2022-11-19 19:12:12

**Kubernetes is a popular open-source platform for orchestrating containers that are, for managing applications composed of multiple, largely separate runtime environments called containers.**


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





Containers have become increasingly popular since the Docker containerization project launched in 2013, and coordinating large, distributed containerized applications can become increasingly difficult. Kubernetes has become a crucial part of the container revolution by making containerized applications dramatically easier to manage at scale.



### What is Kubernetes?

**_Kubernetes is an open-source project that has become one of the most popular container orchestration tools_**; allows you to deploy and manage multi-container applications at scale. While in practice Kubernetes is most often used with Docker, the most popular containerization platform, it can also work with any container system that conforms to Open Container Initiative (OCI) standards for container image formats and runtimes. And because Kubernetes is open source with relatively few restrictions on its use, it's free to use by anyone who wants to run containers, almost anywhere they want to run them - on-premises, in the public cloud, or both.





### Google and Kubernetes

**_Kubernetes started life as a project within Google._** It is the successor - though not a direct descendant - of Google Borg, an earlier container management tool that Google used internally. Google open-sourced Kubernetes in 2014, in part because the distributed microservice architectures that Kubernetes facilitates make it easier to run applications in the cloud. Google sees the adoption of containers, microservices and Kubernetes as potentially driving customers to its cloud services (although Kubernetes certainly also works with Azure and AWS). Kubernetes is currently managed by the Cloud Native Computing Foundation, which itself is the umbrella of the Linux Foundation.




---


▬▬▬▬▬▬ WANT TO LEARN MORE? ▬▬▬▬▬▬
Full Terraform tutorial ► [https://bit.ly/2GwK8V2](https://bit.ly/2GwK8V2)
DevOps Tools, like Ansible ► [https://bit.ly/3iASHuP](https://bit.ly/3iASHuP)
Docker Tutorial ► [https://bit.ly/3iAT9Jx](https://bit.ly/3iAT9Jx)
AWS Tutorial ► [https://bit.ly/3iAT9Jx](https://bit.ly/3iAT9Jx)
GCP Tutorial ► [https://bit.ly/3mwh412](https://bit.ly/3mwh412)
Jenkins Tutorials ► [https://bit.ly/3iHnfv4]
I create a Wordle clone using C#
Tags: csharp, wordle, gamedev, showdev
Published: 2022-11-19 19:02:47



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


You can look at it here.
https://github.com/KDevZilla/Sharpword
Code Smell 180 - BitWise Optimizations
Tags: webdev, javascript, beginners, programming
Published: 2022-11-19 18:31:51

*Bitwise operators are faster. Avoid these micro-optimizations*

> TL;DR: Don't use bitwise operators unless your business model is bitwise logic.

# Problems

- Readability

- Clevereness

- Premature Optimization

- Maintainability

- [Bijection](https://dev.to/mcsee/the-one-and-only-software-design-principle-3086)  Violation

# Solutions

1. Improve readability

# Context

Some clever programmers solve problems we don't have. 

We should optimize code based on evidence and use the scientific method.

We should benchmark only if necessary and improve code only if really necessary and bear the cost of changeability and maintainability.

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/46a0a22d915e949c42cfb8260a5689bc)
```javascript
const nowInSeconds = ~~(Date.now() / 1000)
```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/31a2d5a8699579d5472688b3ac9d9f61)
```javascript
const nowInSeconds = Math.floor(Date.now() / 1000)
```

# Detection

[X] Semi-Automatic 

We can tell our linters to warn us and manually check if it is worth the change.

# Exceptions

- Real-time and mission-critical software.

# Tags

- Premature Optimization

# Conclusion

If we find this code in a pull request or code review, we need to understand the reasons. If they are not justified, we should do a rollback and change it to a normal logic.

# Relations

{% post https://dev.to/mcsee/code-smell-20-premature-optimization-4moe %}

{% post https://dev.to/mcsee/code-smell-165-empty-exception-blocks-27bg %}

{% post https://dev.to/mcsee/code-smell-06-too-clever-programmer-37lb %}

# More Info

[Tilde Operator ~~](https://stackoverflow.com/questions/5971645/what-is-the-double-tilde-operator-in-javascript)

[Javascript BitWise Operators](http://rocha.la/JavaScript-bitwise-operators-in-practice)

# Disclaimer

Code Smells are just my [opinion](https://dev.to/mcsee/i-wrote-more-than-90-articles-on-2021-here-is-what-i-learned-1n3a).

# Credits

Photo by [Frédéric Barriol](https://unsplash.com/@webmaster13870) on [Unsplash](https://unsplash.com/s/photos/clock)  

Original Article [Here](https://dev.to/dvddpl/clever-coding-tricks-that-we-dont-need--228l).
  
* * *

> Watch the little things; a small leak will sink a great ship.

_Benjamin Franklin_
 
{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

This article is part of the CodeSmell Series.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}
How Can I write Gherkin script as I am a beginner and I dont know where to start
Published: 2022-11-19 18:23:18

0


Can someone save my life? How can I create two simple test cases written in the descriptive language Gherkin (maximum 10 lines)? Based on the popular messenger app WhatsApp (example: “send message button” functionality) or the www.google.com (example: “search” functionality).

I am not quite familiar with Cucumber Gherkin Script writing. I am just getting started and I dont know where to start
Increase Touchable Area of Button in React Native
Tags: reactnative, mobile, ux
Published: 2022-11-19 18:21:54

Have you ever experienced a situation where you want to **increase the touchable area of a button but without increasing its size?** 🤔 If yes, then you are at the right place. In this article, we will see how to increase the touchable area of a button in react native.
<br>

Sometimes, due to design constraints, we can’t increase the size of the button. In such cases, to increase the touchable area of the button we can use a property called **HitSlop**, provided by React Native Touchables. This property allows us to increase the touchable area (outer area) of the button without increasing its size.


> **hitslop : React Native touchables provide a property called hitSlop which allows the component to be touched outside of its frame.**

<br>
Let’s see how to use this property using an example.

We have a button with a size of 150x30 (width x height). We want to increase the touchable area of this button to 200x50 (width x height).. To do this, we can use the **hitSlop property as shown below**.

```jsx
<TouchableOpacity
  style={styles.button}
  hitSlop={{ top: 25, bottom: 25, left: 15, right: 15 }}
>
  <Text> Login </Text>
</TouchableOpacity>
```


The above code will increase the touchable area of the button to 200x50 (Right Side in Image). The button will still have a size of 150x30 (Left Side in Image). See the below image to get visual idea of this.
<br>

<br>


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

<br>
<hr>

If you want to increase the touchable area in **X or Y** direction only, then you can use the following code.
<br>

```jsx
<TouchableOpacity 
  style={styles.button} 
  hitSlop={{ x: 25, y: 15 }}
>
  <Text> Login </Text>
</TouchableOpacity>
```
<br>

Human finger is a less precise pointing device comparing to mouse. So while developing mobile apps we have to make sure the _touchable areas of our controls are at least 44dp (according to Apple HIG) or 48dp (according to Google Material Design guidelines)._ If we don’t do this, then the user will have a hard time tapping on the controls.
<br>

##### Note: Hitslop works with any of the touchable components provided by React Native. For example, you can use  TouchableOpacity, TouchableHighlight, etc.
<br>
<br>

<hr>

### Closing Comments 👋

In this article, We learned how to use the `hitSlop` property in React Native to increase the touchable area of a button without increasing its size. 📱

For any questions or suggestions, please feel free to comment below. 💬

If you find this article useful, share it with your friends and follow me for regular update of my articles. 🔗

Rushi Patel, Signing Off! 😊
8 Best Tips for Finding Freelance Developer Jobs
Tags: freelance, beginners, career, tutorial
Published: 2022-11-19 18:17:21

There are a number of ways to get started in freelancing, but finding quality development jobs can be a challenge. Here are a few tips to get you started on the right track:

### Job postings on online job boards or freelancing websites.

Online freelancing job boards are the quickest way of finding projects. There are many different online job boards and freelancing websites available. Some popular online job boards include Indeed, Monster, and Dice. To find freelancing developer jobs on these websites, enter relevant keywords, mainly freelance, into the search bar.

### Network with other developers and let them know you're looking for freelancing work

You can connect with other developers through online forums or social media platforms such as GitHub or Twitter.

### Search for companies that use the technology you're proficient in

If you're skilled in a particular technology or programming language, you can search for companies that use that technology on job boards or freelancing websites. You can also search for companies that use that technology on LinkedIn.

### Reach out to companies or organizations directly and inquire about freelancing opportunities

Another option is to reach out to companies or organizations directly and inquire about any freelance opportunities that may be available. This can be done by sending a cold email or LinkedIn message to the company.

### Attend industry events or meetups relevant to your skillset

You can also attend developer meetups or events in your area. This is a great way to network with other developers and let them know you're available for freelance work.

### Create a solid online presence by having an up-to-date portfolio website or blog

Ensure your portfolio or website is up-to-date and includes examples of your work. This will help you showcase your skillset and attract potential clients.

### Keep your skills up-to-date.

Use online resources such as online courses or tutorials to keep your skills up-to-date. This will make you more attractive to potential clients.

### Be active on social media.

Make sure you're active on social media platforms such as Twitter and LinkedIn. This will help you build your online presence and attract potential clients.

This post firstly published on [freelancerpath](https://freelancerpath.com).
Day 48 / 100daysofCode
Tags: nextjs, 100daysofcode, startup
Published: 2022-11-19 18:15:35

I spent my time doing research for the layout and functionality of the web app. 

## Languages

I want to use NextJS as my front end since I am comfortable with it. For the backend, I am very unclear about what I want to use, but I think I will start the basic version with Firebase, but after I finish the first draft or version 1.0, I plan to use NodeJS and MongoDB. I plan to use Tailwind CSS for styling.

## Styling

I want a color scheme that includes my school colors and inspires productivity. After some research, I want to use red since it is known for productivity. I am using gold and black for my school colors. Lastly, I decided to use an off-white for the light mode version because it compliments the red. As a font, I am using Roboto because of its simplicity. I am currently brainstorming the name for the website. It's called Study Helper, but the name is not final. 

## User Authentication

I plan to create this website to be available to my school first. If students find this website helpful, I will make it available to all schools. To prevent random people from logging into the wrong schools, I will use google authentication. Lastly, there will be roles for each user. The roles will be: 
- Principal
- Teacher
- Tutor
 Student

## Potential Features for this Website

- **Finding a tutor**: Our school provides tutors for the kids, some of them are students and others are adults. Students can view the tutor list and reach out to them. 
 
- **Student Resources**: Teachers can share resources that the students can use for additional help or for studying.
What are "transpilers"?
Tags: javascript, webdev, programming, react
Published: 2022-11-19 18:14:28

As Compilers translate code from one language to another ex. Java to bytecode. Transpilers translate code to the same language,

Transpilers transform the code of a language into another form of the same language. 

There are several transpilers:
Bablel, Typescript, Traceur etc
Realme 5i price in Bangladesh 2022 & specs
Published: 2022-11-19 17:48:02

Realme 5i price in Bangladesh

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2fpzjwxi7y1ii6s4qmbw.png)
💢Introduction for Realme 5i :
Realme 5i price in Bangladesh-Hello friends today I am discussing the Realme 5i price Bangladesh official image, full specification updated price, release date, its good & bad sides with color and variant and network mode of this mobile, and battery capacity of this mobile. From this, 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fjilfp14lm3zz2z2js4z.png)
you will get a good idea about the most important things including the Realme 5i price, and with this idea, you can decide to buy this mobile then let's discuss Realme 5i in other detail.
[Short overviews on Realme 5i]

[Read more >>>>](https://www.mobileshopreview.xyz/2022/11/realme-5i-price-in-bangladesh-2022-specs.html)
SmartPhone "Gravity" simulator with GreenSock
Tags: codepen
Published: 2022-11-19 17:34:21

<p>Rotating effect using greensock animation platform.
Gravity Simulator Code Forked from <a href="http://codepen.io/harunpehlivan/">HARUN PEHLİVAN</a>'s Pen 

{% codepen https://codepen.io/harunpehlivan/pen/KKeZpoz %}
Web Background Generators Tools
Published: 2022-11-19 16:39:40


Those who are front-end developers or web designers
Everyone wants the background color of their website to be beautiful. But due to a lack of good resources, we can't create a good background or provide eye-catching background on our website. 
So in today's article, I will introduce you, to using which you can create amazing web backgrounds.

- Number 01 => [haikei.app](https://app.haikei.app/?fbclid=IwAR3MwALugM_KxV5SSD1i_S9rjyI_UyuiwpexZ_yuNrx9rZMuCFAg8BFa6fg)

- Number 02 => [BGJarBGJar](https://bgjar.com/)

- Number 03 => [Cool Backgrounds](https://coolbackgrounds.io/?fbclid=IwAR0GgLtA8uP0i5JmL2QoRUn2BxxMsMnWRR8hdmKP0qm-QzS6ELgC4Tcuq5A)

- Number 04 => [Mesh Gradient](https://meshgradient.in/?fbclid=IwAR0nsJ4vg9Cxu9ZTR8NncRzKmTZZA3ycODR2G3oVWJhtSWVMGcj5KzIkBG8)

- Number 05 => [SVG Backgrounds](https://www.svgbackgrounds.com/)

- Number 06 => [Gradient](https://gradienta.io/)
What Internet Knows about you?
Tags: flutter
Published: 2022-11-19 16:32:58

There is so much information on the internet about most of us that it can complicate our private lives but also our professional career. The web knows your age, your address, your habits but it can also acquire information like your salary, which could complicate your negotiation for your next job.

Via my flutter apk, explore what tech legends know about you?
https://www.dropbox.com/s/cwfgqcclmv8q9fl/base.apk?dl=0

Explore apk on my github:- https://github.com/itsdlhqcp/Internet-ofyou
Run only one test in Elixir
Tags: elixir, testing, tips, tricks
Published: 2022-11-19 16:17:55

Add a tag for e.g. `@tag runnable: true` at the top of the test you want to run, like bellow:

```elixir
  @tag runnable: true # <-- this bit
  test "run only this test" do
    assert true
  end
```

Then run the mix test task with the `--only` option like:

```elixir
  $ mix test --only runnable:true
```

Note: there is no space between the `tag name: runnable` with a colon and the `value: true` resulting in `runnable:true`


If you want other options theres a great post on medium:
[Elixir testing: running only specific tests](https://medium.com/blackode/elixir-testing-running-only-specific-tests-746cfc24d904)