teleren/devto huggingface dataset:
[Optimise] App size reduction by 22% using Computer Vision
Tags: reactnative, ai, algorithms
Published: 2023-11-01 15:01:08

---
series: Best way to serve images on React Native
---

## How it began
In a team code review session, someone asked, "Why is this image here? I thought we have saved it elsewhere, why didn't we just use that?"

## My thoughts
True, it seems possible it was saved elsewhere. And... if someone could make this mistake here, it's likely others did too.

## Wait but why?
Our react-native app used to be a multi-bundle architecture that only loaded each bundle when required by the user, which was meant to optimise load times. Naturally, images were not shared between bundles. However, it resulted in plenty of bugs and random edge cases after taking into account Push Notifications, Deeplink and other things.

Today, we use pretty much monolith, but surprisingly, no one has done the optimisation to check for duplicate images!

## Initial plan
It seemed perfect to use Computer Vision with openCV library to parse each pixels in the image into 0/1 and compare the pixelmap to see which images' ones were similar and report it. I was too lazy to try to construct the algorithm so I asked ChatGPT to do it:

![ChatGPT's OpenCV Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vpn8ri5hsqoetpse4z6v.png)

## Problem
After letting it run for a bit, I realised it was taking really long, so I added print logs. Considering there were 1033 images to compare, turns out it would take:
```javascript
1033 * 1033 = 1,067,089 seconds = 296.41 hours = 12.35 days !!??!?!!??!
```
I figured the fact that they were comparing each image to all others was the problem. If 'n' denotes the length of images, this was a O(n^2) solution. We have to do faster.

## Optimised plan
Rather than compare both, I decided I want a one-pass solution and just store the existing solution in a set / hashmap, and then for each image append to the set that has the same pixel-map value. It took me less than 30 seconds to write it up:

![ChatGPT's ImageHash Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cmgivfy89143cfz3tf5y.png)
P.S Thanks to ChatGPT
How long did it take now?
```javascript
5 seconds
```
Anyway, turns out the app size would be reduced a whopping
```javascript
22.2%
```

## Next Up:
All that's left was to get the go-ahead from team lead, and it would be scheduled for December!

- **Short term:** Manually check these duplicates and keep 1 copy, delete all others (just in case there are precision errors in the image-hash technique)
- **Medium term:** Also identify and remove images that are present but no longer imported by code.
- **Long term:** Add a check that runs on commits to warn of any duplicate image. Also include developer contact so any issues can be reported and rectified.
- ~~**Long long term:** Migrate these images to a CDN (edit 11 Nov: see part 2 on why this might be a bad idea)~~

References: https://apiumhub.com/tech-blog-barcelona/introduction-perceptual-hashes-measuring-similarity/
Hacktoberfest Week 3
Published: 2023-11-01 07:34:36

For my third [Hacktoberfest](https://hacktoberfest.com/) PR out of a required four, I continued worked on a project called [Ordspel](https://github.com/avikantz/ikea-word-games) by [avikantz](https://github.com/avikantz).

Project Repository: https://github.com/avikantz/ikea-word-games
Issue: https://github.com/avikantz/ikea-word-games/issues/41
My Pull Request: https://github.com/avikantz/ikea-word-games/pull/42
## Issue

A quick recap - Ordspel is a collection of linguistics games based on furniture names from the Ikea store. You can play it here - https://ikeawordgames.com

What was interesting was that not only was this a project I had previously worked on before ([my previous PR](https://github.com/avikantz/ikea-word-games/pull/40)), but this was an issue I posted myself. While working on disabling the non-solution characters in the Jumble keyboard ([issue](https://github.com/avikantz/ikea-word-games/issues/37)), I noticed that the keyboard would act funny. If there were more characters entered than allowed in the virtual keyboard, the characters would "overflow" and persist beyond the normal limit. It made for an unsatisfying user experience since you couldn't tell the bug was happening just by looking at it - you'd only realize the issue when you tried to backspace.

## The Solution

Coming fresh off the previous issue, I was familiar with this project already (you can read my experiences [here](https://dev.to/paulkim26/hacktoberfest-week-2-4648)). The solution was to truncate the stored input value in the keyboard component (accessed via the keyboard component reference) if the value exceeded the maximum input size ([link](https://github.com/avikantz/ikea-word-games/pull/42/files#diff-2207c6f6ccf81324c5e22842f260a3578efb8944ca56cf91edee0b33435e620a)). This was an unfortunate circumstance of the keyboard's input value "desynchronizing" from the rest of the code. Since this input value was not maintained using React state but rather the simple keyboard API, there needed to be some extra checks and balances to make sure it was properly being watched.

## Takeaways

It surprised me that such a bug was there and unreported until I discovered it. It really goes to show how selective all of our perceptions and experiences around the same software are. We all experience software uniquely and catch onto certain issues that other's won't know. It goes to show the power of the open source community and having an extra set of eyes watching over one's shoulder 👀.

Thanks for reading!
Tips to be productive while working from home as a software developer
Tags: productivity, remotework, developers, development
Published: 2023-11-01 14:57:15

## Use the Pomodoro technique
This means work for 20-25 minutes and then take a 5 minute break. This means you don't have to commit to getting the work done but you have to just commit to 20 minutes. More often than not, you will want to continue working after the 20 minute mark. You can also use apps to implement this technique in your daily life. Or you can use a physical time. 

## Seek help when stuck
When you have a bug or an error which you are not able to solve, try explaining it to someone else. More often than not, just explaining the problem to someone else might help you reach a solution. If not, the other person might be able to help. But beware to not interrupt other people's work all the time with your bugs, first try to solve it yourself.

## Code with someone else
Maybe meet up with a friend and both of you do your own coding work. This way, you might be able to feel more motivated since you can see someone else coding too and this will give you a boost of motivation. You both can also try to learn new technological things together.

## Listen to music
I don't know if this works for everyone but try to listen to music while coding. This might put you in the flow and also keep you entertained. 

## Seek feedback
Get your code reviewed regularly and get your designs reviewed too. This will give you a second perspective on your work and it will open room for improvement in your product and your code.

## Push your code!
Aim to do at least one meaningful push everyday. This makes it easier for you to measure if you were productive on that day or not. And let's be honest, it is true that what gets measured, gets managed.
What Does The Future Hold According To The Japan Mobility Show 2023?
Published: 2023-11-01 14:56:03

In the 2007 movie "Transformers," Sam Witwicky assumes the alien robots are Japanese due to their advanced technology. Japanese innovation is often associated with cutting-edge tech. This is evident in the Tokyo Motor Show, which showcases futuristic automotive technologies, offering a glimpse into the future of transportation, even if some concepts may never become commercially available.

**What Is The Japan Mobility Show All About?**

- The Tokyo Motor Show has been rebranded as the Japan Mobility Show.
- The rebranding is due to the show's inclusion of startups and established companies from various industries, not just the automotive sector.
- This change comes after 46 previous editions of the show dating back to 1954.
- The pandemic caused the cancellation of the show for the first time in its history.
- The Japan Mobility Show takes place at the Tokyo Big Sight, running from October 28 to November 5, 2023.
- The 2019 edition had 192 participants, while the 2023 edition features a substantial increase to 475 participants.

Read more at [TechDogs](https://www.techdogs.com/tech-news/td-newsdesk/what-does-the-future-hold-according-to-the-japan-mobility-show-2023)
The Evolving Landscape Of Software Development With AI Agents
Tags: webdev, programming, ai, softwaredevelopment
Published: 2023-11-01 14:48:43

The ever-evolving realm of software development mirrors a complex cinematic masterpiece, **"Tenet."** AI agents are the enigmatic protagonists reshaping this landscape, ushering in a new era of innovation. 

The software development landscape is experiencing a monumental shift, and the catalyst for this transformation is AI agents. These digital heroes are rewriting the rules of software creation, much like characters in a Hollywood blockbuster. Software engineering, with AI agents as its protagonist, is a tale of perpetual change and boundless possibilities. These agents delve into uncharted code territories, transforming the software development narrative from manual to automated. 

It's akin to the mind-bending concepts in Christopher Nolan's "Tenet," where AI agents learn from the past to craft the future. In this adventure, we'll explore the rising significance of AI agents in software engineering, from natural language interfaces to automated bug tracking.
[
**How Do AI Agents Enable Better Software Development?**](https://www.techdogs.com/td-articles/miscellaneous/the-evolving-landscape-of-software-development-with-ai-agents)

- Automated Code Generation

- Code Review And Quality Assurance

- Predictive Analytics

- Natural Language Interfaces

- Bug Detection And Resolution

- Agile Development And Continuous Integration


Read the article in depth and know more about [software development 
](https://www.techdogs.com/td-articles/miscellaneous/the-evolving-landscape-of-software-development-with-ai-agents)
Hacktoberfest Results!
Tags: hacktoberfest, hacktoberfest23, hack23contributor
Published: 2023-11-01 14:42:49

🎉 Hacktoberfest 2023 Results 🎉

I'm so excited to share my Hacktoberfest 2023 results! It's been an amazing journey contributing to open source projects and growing as a developer. 🚀🌟 #Hacktoberfest #OpenSource

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/klj166q4hi7t7xant6qa.png)
⏩ 1-minute concept: HTTP Cache-Control
Tags: webdev, learning, programming, http
Published: 2023-11-01 14:26:34

HTTP Caching is an optional feature of the HTTP protocol that significantly reduces latency and network overhead by reusing response messages. It relies on a set of headers to dictate the behavior of local and intermediary cache stores.

As developers, we should utilize HTTP caching to enhance apps' and websites' performance and support a seamless user experience.

An example of configuring cache strategy for a route in Remix:

![React code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f0bmv7oscwzonl0txbxy.png)

> Check out my 2-part series [here](https://dev.to/yishai_zehavi/http-caching-explained-part-1-theory-3j4m) to learn more about the `Cache-Control` header and how to set it up in your application.

{% link https://dev.to/yishai_zehavi/http-caching-explained-part-1-theory-3j4m %}
My First Hacktoberfest Experience
Tags: hack23contributor, hacktoberfest, hacktoberfest23
Published: 2023-11-01 14:17:26

## Intro
Hello, my name is Mandeep Singh from London, England. A former I.T support professional for 10 years now turned programmer at the start of 2023. I have learnt a lot during my short time but I am completely new to the world of open source and have never delved into it so as part of my learning journey, I wanted to take part in my very first Hacktoberfest and try out a new learning experience. This also happens to be my very first post on this platform so there's no better time to make it. 

## Highs and Lows
I started out on a low because I must admit, I was nervous at first. The world of open source seemed very scary to me but after seeing the participation instructions on the Hacktoberfest website and the amount of repositories taking part in Hacktoberfest, I felt much more relaxed and thought "Just go for it" and "What I have got to lose?".

I saw as it as a learning experience and chance to improve myself. Once I had signed up, and started browsing the repos, it all came together nicely. I was learning more about open source repositories, contributing guidelines, licences, git, version control, pull requests, merging, etc. Ultimately this improved my confidence and even more so when I had a contribution accepted for a FreeCodeCamp repository. (I'd never thought say that before I started.)


## Growth
As I am still a newbie to the world of programming, I felt I did not really have the skillset to be able to make a meaningful code contribution so I contributed to beginner repo's and did some minor changes. E.G - flagging and fixing minor issues, updating documentation, etc. But as they say "every little bit helps". The main goal was to get a better understanding of open source. Anything else would be a bonus.

Pleased to say, I did gain an understanding, I learnt a lot and am now ready to build on that going forward. Start making some more meaningful contributions as my skillset improves, keep taking part in Hacktoberfest and the main thing: keep learning. 


## Thank you
For taking the time to read this post. Please feel free to check out my [GitHub](https://github.com/mandeep-s1ngh) to check the contributions I made and feel free to connect with me on [LinkedIn](https://www.linkedin.com/in/mandeep-singh-2999685b/).
Day 2 Of 100 Days of Code Challenge:- Improved code and Revised List Comprehensions
Published: 2023-11-01 14:12:10

Today I improved the code in the previous android app that I made using the View.OnClickListener() interface, reducing the lines of code and improving program readability. 

The code is here:- 
https://github.com/harsha-art/FiveSongApp

I also solved some questions on python list comprehensions and looked through all the programming notes I made on python revising list and dictionaries. I plan to solve some exercises on them to memorize their functions properly. Maybe even do sets, tuples, Hashmaps and Hashsets in java.
the (not so big) Bang!
Tags: typiscript, null
Published: 2023-11-01 14:12:06

## Premise

So I've just read [this article here](https://dev.to/gingerchew/the-super-power-that-lets-you-tell-typescript-what-is-actually-happening-22mo) in which the author basically throws typescripts warning regarding potentially `undefined` values into the wind with the bang operator.

In short this allows you to do something like this:
```typescript
const maybeElement = document.getElementById("foo");
maybeElement!.addEventListener(...); // <-- notice the ! before the .
```
So with this we can tell typescript to ignore the problems of accessing a property on a potentially null value.

My initial thoughts on this were "yeah, and if you'd use that in my codebase without a comment we'd have a stern talk" and while I stand by that - at least put a comment there on why you're sure it's not nullish - there is something to be said in favor of telling typescript to shut up; especially in a case like hers.

## The Problem

So lets assume we don't want to do this and we just use the elvis operator (`?.`) instead -> `maybeElement?.addEventListener`. Great, now our code doesn't crash when the element isn't defined.

But think again... in such a scenario, what would be easier to trace? If the id of the element changes, `maybeElement` becomes null and with the bang operator it crashes "loudly" a few lines below.

If we just mindlessly change the `!` into a `?` it doesn't crash - but the event listener also isn't added which in turn means that we probably have a far more intricate and difficult to track bug on our hands. Maybe that bug even isn't discovered for a day or two and then what? Are you confident enough that you'll find the mistake within the same amount of time and effort as when the `!` was still there?

## The solution

Be mindful about your operators. It's not like `?.` has no drawbacks and failing early is typically better. If you want to express "I need this to be non nullish" using `!` could be acceptable - of course the best solution here would be to take a step back and think about what to do in case the element isn't found, which is why typescript warns you in the first place.

## Conclusion

- no such thing as mindless programming
- `?.` can easily be abused to delay surfacing of errors
- using `!` probably means you should think harder about proper errors. Maybe an either/result monad as encapsulated by various libraries like `fp-ts` and `effect`?
How to migrate from Confluence to Docusaurus
Tags: documentation, webdev, docusaurus, node
Published: 2023-11-01 13:53:26

Table of content

- [What is Confluence](#what-is-confluence)
- [What is Docusaurus](#what-is-docusaurus)
- [Step 1: Export Space from Confluence to HTML](#export-space-from-confluence-to-html)
- [Step 2: Convert HTML to Markdown (md)](#convert-html-to-markdown)
- [Step 3: Setup Docusaurus](#setup-docusaurus)


#### What is Confluence
Confluence is a tool that helps teams work together on projects and share information. It's made by Atlassian, and it works with other Atlassian products. Confluence is popular for storing and organizing team knowledge, documenting projects, and helping teams collaborate.

#### What is Docusaurus
Docusaurus is a free and open-source documentation website builder made by Facebook. It makes it easier for people, groups, and open-source projects to create and keep up-to-date documentation for their software or products. Docusaurus provides a simple, customizable, and easy-to-use documentation platform with features like versioning, search, and the ability to work with different content sources. It is often used by developers and teams to create well-organized and easy-to-navigate documentation sites.

####Export Space from Confluence to HTML

1. Log in to your Confluence instance as a user with administrative or space admin privileges.
2. Navigate to the space you want to export.
3. In the left-hand sidebar, click on "Space settings."
4. In the Space Settings menu, look for "Content tools" and select "Export."
5. In the "Export Space" dialog, you can choose the export format. Select "HTML" from the list.
6. You can specify various export options, such as the file format, whether to include attachments, and other settings.
7. Click the "Next" or "Export" button to initiate the export process.
8. Confluence will generate an HTML version of the entire space, which you can download as a zip file.
9. Once the export is complete, click the link to download the HTML file to your computer.


#### Convert HTML to Markdown (md)
HTML and Markdown are both lightweight markup languages used to create formatted text. HTML is more complex and widely used, but Markdown is simpler and easier to read and write.

Follow the details on [Article](https://dev.to/myogeshverma/convert-html-to-markdown-md-1dk9)

#### Setup Docusaurus
It is a straightforward process. After installing Node.js and Yarn, you can create a new Docusaurus project using the command-line tool. Customize your documentation by editing Markdown files, and configure the site's appearance and functionality using the provided configuration files. Docusaurus simplifies the creation of professional-looking documentation websites, making it an excellent choice for developers and teams seeking an efficient and user-friendly solution.

Follow the details on [Article]()
Jaipur Premier Overseas University Fair 2023
Tags: ielts, toefl, abroadeducati, webdev
Published: 2023-11-01 13:17:51


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

Hello everyone! 

Excited to present the Jaipur Premier Overseas University Fair on November 4th! This event is perfect for families with students aged 16-21 who are considering overseas education and education counselors seeking distinctive collaborations. Don't let this customized opportunity pass you by!

🔍 What to expect?

1:1 sessions for university preparation
Guidance on country selection based on your preferences
Budget-friendly options to ensure the best education for your child

📈 Why attend?

Multiply your child’s admission chances by a whopping 200% in renowned universities in the US, UK, Canada, and more! With an exceptional admission success rate of 98.7% globally, our partner schools offer flexible learning options starting from just $850 per year.

📌 Date: November 4th
📍 Location: Jaipur
Don't miss out on this chance to secure a brighter future for your child. Register now and book your slot!

🔗 Book Your Place Here 🔗

http://info.educate-online.in/facebook_groups_event
Research Data Analytics: A Breakthrough for Market Research and Study
Tags: researchdataanalytics, dataanalytics
Published: 2023-11-01 13:04:58

Research data analytics involves more rigorous, efficient, and cutting-edge methods to conduct complex surveys and research work.

Implementing [big data analytics and insights](https://www.bluent.com/business-services/data-analytics/) is crucial for firms relying on market trends and customer behavior patterns. They can deploy modern BI solutions to their existing databases to analyze their productivity, sales, and marketing outcomes and make the right business decisions.

Every business takes insights from research papers and surveys from healthcare to, medical researchers, economists, and leading industrialists before applying any strategy or plan. 

Numerous research analysts and consultants publish factual resources and research findings for different industries & business domains. Regardless of being an independent research analyst or strategic decision-maker, data science can do wonders for your profession and the enterprise you're for.

As per a report, the global market research services revenue share was $76.37 bn in 2021 and is projected to increase at a CAGR of 1.87% to reach $108 bn by 2026.

Let's get a clear picture of how data analysis revolutionizes the research industry.

**What Is Research Data Analytics?**

It's a process that uses data analysis in research to churn out a factual story or reports from a vast volume of datasets and interpret insights from the same.

Most researchers and analysts combine big data and advanced BI tools to summarize tons of data into fragments and analyze them to generate real-time reports.

Source by: [https://www.bluent.net/blog/research-data-analytics/](https://www.bluent.net/blog/research-data-analytics/)