teleren/devto huggingface dataset:
JavaScript Magic Tricks: Fancy Assignment
Tags: javascript, webdev, programming
Published: 2023-09-20 01:07:48

JavaScript Magic Tricks: Fancy Assignment
Today, let's do a test to see how many different ways there are to write simple JavaScript assignment statements. Here are the test statements, only three lines:

```
var a=1;
a=2;
console.log(a);
```

For the assignment statement a = 2 in the second line, let's see how many different forms we can transform it into. The first variation is to write it inside an IIFE (Immediately Invoked Function Expression):

```
var a=1;
(function(){
    a=2;
})();
console.log(a);
```


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



The second variation is to use eval to execute the assignment statement:

```
var a=1;
eval(a=2);
console.log(a);
```


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



These two variations are relatively basic and can be easily understood by beginning programmers. Now let's increase the difficulty a bit. The third variation is using evaluated assignment statement with transformations:

```
var a=1;
var b=["a","=",2];
eval(b[0]+b[1]+b[2]);
console.log(a);
```


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



But it seems that eval can only be played at this level. Let's show some more difficult variations next. 
The fourth variation is to use constructor functions:

```
var a=1;
[].constructor.constructor(a=2);
console.log(a);

```
Or:

```
var a=1;
[].constructor.constructor(a=2)();
console.log(a);
```


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


The fifth change, the upgrade of constructor function:

```
var a=1;
var b=["a","=",2];
[].constructor.constructor(b[0]+b[1]+b[2])();
console.log(a);
```

As with the change in the content of eval, the code executed on the structure is also transformed using the splicing of array content:


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



The sixth variation, deformation of constructor function:

```
var a=1;
var b=["a","=",2,"constructor"];
[][b[3]][b[3]](b[0]+b[1]+b[2])();
console.log(a);
```


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



The seventh variation, obfuscation and encryption: Using JShaman JavaScript Obfuscator to obfuscate above code.

```
var a=0x2c0f8^0x2c0f9;
var b=['a','=',0xe3b2c^0xe3b2e,'constructor'];
[][b[0xa8ddf^0xa8ddc]][b[0xb3a35^0xb3a36]](b[0x3333f^0x3333f]+b[0x84d18^0x84d19]+b[0x50958^0x5095a])();
console['log'](a);

```


The resulting code completely obscures the assignment operation of a=2.
Adminer replace phpmyadmin, run with php build in webserver
Tags: php, adminer, mysql, database
Published: 2023-09-20 01:00:47

Biasanya, budak-budak IT yang baru belajor buat website terutama yang mahu buat sistem berasaskan html, php dan mysql,mereka akan didoktrinkan dengan aplikasi xampp atau aplikasi Laragon yang datang dengan php, mysql, apache2,nginx, phpmyadmin. 

doktrin yang ditanam dalam minda, Jika mahu buat website, wajib install xampp, sehingga ada sesetengahnya menjadikan xampp sebagai production web server. 

Untuk proses pembangunan web di localhost tanpa xampp, boleh guna scoop untuk install php 

ada tutorial install aplikasi menggunakan scoop di https://dev.to/nikolastojilj12/using-scoop-and-cmder-to-make-php-development-on-windows-bearable-8pd

```
scoop install php 
```

```
scoop install mysql 
```
tutorial detail di https://mebee.info/2022/07/01/post-51251/

untuk ganti phpmyadmin, boleh download adminer.php di https://www.adminer.org/

letak dalam satu folder, guna cmder untuk run arahan php untuk aktifkan buildin php web server. 

contoh di bawah. 

```
c:\\adminer\php -S 0.0.0.0:8000
```
buka tab baru dalam cmder,
```
c:\\project\php -S 0.0.0.0:8001
```

untuk run projek, boleh buka url localhost:8001 manakala untuk manage database boleh buka localhost:8000

catatan: aku guna cmder sebagai ganti cmd/powershell, boleh juga guna terminal 

[Google Translate](https://dev-to.translate.goog/hardyweb/adminer-replace-phpmyadmin-run-with-php-build-in-webserver-1hg?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp)

<a href="https://www.buymeacoffee.com/hardyweb" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
Hello
Published: 2023-09-20 00:48:55

No doubt everyone has ever needed to download a video from TikTok. But how to do it, because TikTok does not allow downloading videos of other users? You just need to use the service [https://savetiktok.org](https://savetiktok.org). There you can quickly download any video you are interested in in excellent quality. You do not even need to register, the site does not impose any restrictions on unregistered users, you can even download videos without a watermark. So use savetiktok.org and enjoy TikTok videos without restrictions.
Fix Adsense “Low Value Content”
Tags: tutorial, frontend
Published: 2023-09-20 00:48:38

Many times when we are writing an article for Google adsense approval, we face a problem Low value content. we have observed some facts after a long time analysis that will help you approve it.

Link: Linking to your article with external and internal linking.
Article: Write 20-30 articles up to 1200 words.
Use Feature Image: Used to feature images for every post and Article
Unique Article: Always write your own Article or a 100% unique Article with a unique title that is plagiarism-free and not AI content.
Unique Title: If anyone previously used to title then never use to same title, A unique title that is plagiarism-free and not AI content.
Speed: Make sure the web hosting speed is good.
Header: About us+ contact Us + Categories must create these pages in this section.
Footer: Add important pages (about us + contact us + privacy policy + disclaimer) in the footer.
Index: About us, Contact us, categories and posts will be must index.
No- index: Privacy Policy, Terms and conditions, Disclaimer and tag must be no indexed.
Note: Always try to create your own content for the above pages.
Social Page: Always Add a page (Facebook, Pinterest, Twitter, Instagram)in the footer section.
Theme: Generate Press, News Paper, Astra, oceanWP, Schema, etc.
Written by : SEO Expert Amit Patel
Massive 4K Resolution Woman & Man Class Ground Truth Stable Diffusion Regularization Images Dataset
Tags: ai, news, stablediffusion, sdxl
Published: 2023-09-20 00:17:40


Download link > https://www.patreon.com/posts/87700469

The best ever released Stable Diffusion classification / regularization images dataset just got a huge update

More than 30,000 Man and Woman images are collected from Unsplash, post processed and then manually picked by me

I am using ground truth images because they improve realism significantly and further fine tuning model

Download link > https://www.patreon.com/posts/87700469


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


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


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z9u1rux131evr95ouxyg.png)
From Frontend Web to the iOS Universe
Tags: swift, frontend, ios, javascript
Published: 2023-09-19 23:48:38

Embarking on a new journey in the world of development is always exciting 🧐. For me, this transition meant moving from the familiar territory of **Frontend Web Development** to the intriguing realm of **iOS**. I will begin sharing articles about my experiences, challenges, and insights as I take my first steps into the captivating world of iOS development.

## **The Starting Point: Familiar Grounds**

Having spent considerable time in Frontend web development, I was on solid ground. HTML, CSS, and JavaScript were my trusted companions, and crafting web interfaces was second nature. It was here that my love for designing seamless user experiences was born ❤️

## **Discovering the iOS Frontier: A Brave New World**

The transition to iOS development marked a thrilling departure from my comfort zone. Swift, Apple's modern programming language, beckoned as the primary tool for app creation. Its concise syntax and powerful capabilities were both fascinating and intimidating. 👀

## **Xcode: My New Playground**

Xcode, Apple's integrated development environment (IDE), opened its doors to me 👩🏽‍💻. Navigating its labyrinthine interface and comprehending its debugging tools was akin to exploring a new world . Gradually, Xcode became my playground, where ideas transformed into functional iOS applications.

## **The Art of Interface Design: Interface Builder and Auto Layout**

Coming from a Frontend background, I found Interface Builder's visual approach to interface design intuitive. Creating layouts and designing user interfaces is a delightful experience.

## **Embracing MVC and Architectural Patterns**

Understanding the Model-View-Controller (MVC) architectural pattern was pivotal. It provided a structured framework for organizing code and separating concerns—familiar territory for someone accustomed to frontend frameworks like Angular and React.

## **Community Engagement and Continuous Learning**

Transitioning to iOS development was not without its hurdles. I'm still in the early stages, and I believe that getting involved with development communities 👨‍👩‍👦‍👦 will make this experience more bearable. If you have any recommendations, they would be greatly appreciated.

## **Conclusion: An Exciting Odyssey**

To conclude, if you're considering migrating to another language or improving the one you already know, I encourage you to embrace the adventure 🚌. Development is a realm of unlimited creativity and infinite possibilities.
🌟 Right now, in the fascinating world of ALX Africa, there lives a determined coder named Kelvin Njuiri! 🚀
Published: 2023-09-19 23:28:26

Kelvin is embarking on an epic coding adventure, and, oh boy, what a ride it is! 🎢 At first, he feels like he’s navigating through a dense forest of unfamiliar code, but every day, his passion for coding grows stronger and more vibrant, like a blossoming flower 🌷 under the warm sun. 🌞

But let’s be real, folks — coding is no walk in the park! 😅 Kelvin faces errors and bugs in his code every step of the way, and sometimes, it feels like his computer has a mischievous gremlin living inside, just waiting to sabotage his progress! 👾💻

Yet, our brave hero Kelvin has a secret weapon: determination! 💪🏆 He realizes that coding is like embarking on an epic quest 🌍, filled with challenges and adventures. And just like a true adventurer, he knows that giving up isn’t an option.

So, Kelvin decides to turn those frustrating errors into stepping stones towards greatness! 🌟 Every bug he fixes is a dragon being slain 🐉, and every line of code he writes is a treasure being discovered. 💎

And as the days turn into weeks, Kelvin’s skills are shining brighter than a shooting star in the night sky. ✨ He can see his progress, his consistency building like a strong fortress. 🏰

He realizes that in the world of coding, every “404 Error” is just a detour on the path to “Hello, World!” 🌍👋

As Kelvin continues on his quest, he meets fellow coders, shares his struggles, and celebrates their victories together. 🤝 The coding community is like a magical guild, always ready to lend a helping hand 🤝 and share a laugh or two. 😄

So, my fellow adventurers, if you ever find yourself in a coding conundrum, remember the tale of Kelvin Njuiri! 📜✨ Don’t let those errors and challenges discourage you. 🙅‍♂️ You’ve got the determination, the passion, and the community support to overcome anything that stands in your way!

Keep coding, keep learning, and keep believing in yourself, because the next line of code you write might just be the key to unlocking a whole new world of possibilities! 🌐🚀

And so, Kelvin Njuiri continues his coding journey, one line of code at a time, with a heart full of passion and a spirit that never gives up! 🌈🌟👨‍💻

The end? Nah, it’s just the beginning of your amazing coding adventure, dear Kelvin! 🌠👏🎉
¿Qué es Bun?
Tags: javascript, programming, bunjs, español
Published: 2023-09-19 22:59:16

Si eres programador y usas mucho javascript, pues probablemente has escuchado ya sobre **Bun**, y quizás también te ha pasado como a mí, no tienes idea de que es.

Pues me puse a investigar un poco y terminó llamando mi atención, por lo que decidí hacer un artículo sencillo e introductorio sobre **¿Qué es Bun?**. Además, es mi primer artículo en Dev😅 así que puede que empiece muy fuerte.

## ¿Qué es Bun?

Bun, es un entorno de ejecución de Javascript, así como Node o Deno pero que promete mejores velocidades que ambos.

No obstante, Bun no es solo un entorno de ejecución, es también un empaquetador y un gestor de paquetes, o sea, que busca reemplazar a Node, Webpack y a NPM.

## ¿Qué tiene de bueno Bun?

Pues Bun, promete velocidades mayores no solo en cuanto a ejecución de código, si no también en cuanto a instalación de paquetes y en cuanto al empaquetamiento de tus proyectos.

![Comparación de las velocidades de Node y Bun](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mk1l3oh46vncdppgwh5s.png)

Además, Bun no solo es capaz de ejecutar Javascript, también tiene soporte para Typescript y JSX.

## ¿Si quiero pasarme a Bun, perderé mis proyectos en Node?

Pues, la respuesta es No. 

Bun es compatible con los archivos de configuración package.json de Node, o sea que tus proyectos funcionaran también en Bun sin ningún problema.

### Fin.

Este artículo lo realicé principalmente para probar por primera vez como es publicar en Dev, no pensaba en hacer ningún tutorial ni nada parecido, así que deje un poco de información para que tu investigues más. 

Para empezar, puedes entrar al sitio Oficial de [Bun](bun.sh)


![Meme sobre Bun y Nodejs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b3tj1ll6f8mkqxa8g2zr.jpg)
Bobalob - Free Amazon price checker & comparison tool
Tags: amazon, pricecomparison
Published: 2023-09-19 22:36:55

Did you know Amazon has 9 stores in different countries across Europe? And each store charges different prices for the same thing? Sometimes, the price differences can be huge.

Bobalob makes it quick and easy to check the price of what you're looking for across all of Amazon's European stores. We help you make sure that you get the best price, find deals, and save money when shopping on Amazon.

[https://bobalob.com](https://bobalob.com)
Writing My First Pull Request
Tags: osd600, senecacollege
Published: 2023-09-19 22:25:52

This week in my OSD600 course, I was tasked with contributing to another student's project by implementing a Markdown parsing feature to their static site generator.

One of the cool things I discovered was the ability to [link an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) to the pull request simply by using its number. This was a GitHub feature I never knew about.

I have picked [ez-txt2html](https://github.com/bryce-seefieldt/ez-txt2html) by [Bryce Seefieldt](https://github.com/bryce-seefieldt) since I have never tried writing Python 3 code. My only significant experience with Python was during my high school years when I was developing a Pygame-based evasion game (sadly, I don't have the files to link and show it).


Let's talk about the [pull request](https://github.com/bryce-seefieldt/ez-txt2html/pull/5) and the [issue](https://github.com/bryce-seefieldt/ez-txt2html/issues/4) I was working on this week. 

The process was straightforward. I created an issue on the project, and then the owner assigned it to me. Once I had completed my changes, I posted my pull request and linked it to the issue.

What I did was use the [re](https://docs.python.org/3/library/re.html) library of Python, which allowed me to employ regular expressions. Whenever the program read the .md file, it would parse it with the help of these regular expressions. Since we were constrained from using any markdown parsing libraries, I found this approach to be both easy to understand and modify, as parsing solely depended on the way the regular expressions were written.

The owner of the repo merged it quite quickly since I tried to match the style and structure of the code as closely as possible to the original and touched the main logic as little as possible.

The only problem I encountered was installing the project and getting it to work locally because we had not created proper contribution instructions or a wiki for our projects yet. I had a conflict between the Python version on my computer and the one that the project required.

I learned a lot about contributing to open source, and when my pull request got merged, I felt incredibly proud and happy to see my code in the main branch. This experience fired me up to look for repositories to contribute to during [Hacktoberfest](https://hacktoberfest.com/). Slowly, I started to understand how to participate in open source, although I haven't tried contributing to any big projects yet.
🎉 Java 21 is out... and bookmarks 📑
Tags: java, news, programmers, jkd21
Published: 2023-09-19 22:10:00

## 🙋 About

The aim of this short post is to put some resources about Java 21 LTS release:

{% twitter 1704127335983644701 %}

... which is, according to [`endoflife.date`](https://endoflife.date/java) a LTS one:

{% twitter 1704224212205093301 %}

## 📑 Remarkable tweets

{% twitter 1704165271567470720 %}
Destructuring in JS
Tags: javascript, beginners, react, programming
Published: 2023-09-19 22:03:49

Firstly thanks for reading Ray's React Learning Notes, a React course I purchased from Udemy to document what I've learnt.
Link to the full course: 
https://www.udemy.com/course/the-ultimate-react-course/learn/lecture/37350446#overview

Thanks again to Udemy for the high-quality instructional content.

### In this project, I am learning how to use one basic tool in VScode: Quokka.js
### This plugin can easily to found in the VScode extension store.

#### Quokka.js is used to quickly create JavaScript / TypeScript prototypes. It's easy to run JS files in VScode and helps to troubleshoot bugs.
to run it just sample type: >quokka start at VScode command palette. Then click the 'Start on current file' 

#### It Very important is that he can return the results of the current code in a timely manner in the terminal on the left and below. This is very useful for me to start learning React.

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

## Destructuring
#### Destructuring is getting data out of an object or Array.

### A simple data structure about books is used here:
``` js
const data = [
  {
    id: 1,
    title: "The Lord of the Rings",
    publicationDate: "1954-07-29",
    author: "J. R. R. Tolkien",
    genres: [
      "fantasy",
      "high-fantasy",
      "adventure",
      "fiction",
      "novels",
      "literature",
    ],
    hasMovieAdaptation: true,
    pages: 1216,
    translations: {
      spanish: "El señor de los anillos",
      chinese: "魔戒",
      french: "Le Seigneur des anneaux",
    },
    reviews: {
      goodreads: {
        rating: 4.52,
        ratingsCount: 630994,
        reviewsCount: 13417,
      },
      librarything: {
        rating: 4.53,
        ratingsCount: 47166,
        reviewsCount: 452,
      },
    },
  },
```

Use getBooks() to get all books data
```js
const books = getBooks();  
const title = book.title; 
const author = book.author;
```
Or use getBook(id) to get a specific data
```js
const book = getBook(1);
```

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

There are many other elements in the book object such as author, name, etc. We can use Destructuring to create them all at once.
```js
const { title, author, pages, publicationDate, genres, hasMovieAdaptation } = book;
```

this way you can get the object in the book. This puts the elements of the object together. Passed with console.log.

A similar approach can be used for elements in book, except for book:

```js
const primaryGenre = genres[0];
const secondaryGenre = genres[1];
```

Or:

```js
const [primaryGenre, secondaryGenre] = genres;
```
So we can use ourselves to create an array structure, in a specific location to go to the data we want, similar to the use of [1].
Deploying Hugging Face models on Amazon SageMaker using infrastructure as code
Tags: ai, machinelearning, tutorial, python
Published: 2023-09-19 22:00:32

Here is a quick template and tutorial for bootstrapping Amazon SageMaker to run a LlaMa 2 model from Hugging Face. Everything is deployed as code (Python); no manual tweaking in the SageMaker console.

www.pulumi.com/blog/mlops-huggingface-llm-aws-sagemaker-python/
Integrating Flutter {all 6 platforms} and Python: Part 2, Live Talk
Tags: flutter, python, performance, productivity
Published: 2023-09-19 21:24:37

Last week, I published [this article](https://dev.to/maximsaplin/integrating-flutter-all-6-platforms-and-python-a-comprehensive-guide-4ipo) with a step-by-step guide to integrating Flutter and Python. It gained a lot of attention.

On *Thursday, September 21, 14:00 UTC+0 (19:30 UTC+5:30, 10:00 EDT)*, I've expand the topic with a more complex example, involving:
- gRPC streaming, 
- setting up VSCode, 
- debugging and troubleshooting, 
- and performance tuning. 

I also shared more context to the problem, alternative solutions, a few insights from the production team. Live, sharing screen and tinkering in VSCode.

{% youtube https://www.youtube.com/watch?v=lBnQzLPrqCA %}

[https://wearecommunity.io/events/flutter-and-python-integration-a-practical-guide](https://wearecommunity.io/events/flutter-and-python-integration-a-practical-guide)

[Git repo](https://github.com/maxim-saplin/flutter_python_streaming)

**P.S.:**
Also touched the question of "slow Python". Can it match the release, Ahead-of-Time, build in Dart? 

Yes, it can:)

![Python, Numba, Flutter performance diffs, Julia set generation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/taf6zl0e3le2947ji0wl.png)
Replace a Substring With Replace Method
Tags: webdev, javascript, beginners, programming
Published: 2023-09-19 21:21:43

The replace method returns a new string with the new substring you add as a parameter included in place of the other substring that you add as a parameter to be replaced.

Here is an example of the method being used:

<code>
var poem = "She sells seashells by the seashore. The shells she sells are surely seashells."

// replace all the sea with ocean

poem = poem.replace("sea", "ocean")

poem = poem.replace("sea", "ocean")

poem = poem.replace("sea", "ocean")

console.log(poem);
// -> She sells oceanshells by the oceanshore. The shells she sells are surely oceanshells.

</code>