teleren/devto huggingface dataset:
5 Well-known JavaScript Obfuscation and Encryption Tools
Published: 2023-08-20 00:07:29

There are many useful JavaScript obfuscation and encryption tools available in the market. Some of the popular and widely used tools include:

UglifyJS (Romania): UglifyJS is a highly popular JavaScript toolkit that allows you to compress, obfuscate, beautify, and format JavaScript code. With UglifyJS, you can control the compression level and set obfuscation options by adjusting the parameters.

JScrambler (Portugal): JScrambler is an advanced JavaScript tool used for obfuscating and protecting JavaScript applications. It offers a wide range of features, including string hiding, pointer obfuscation, code virtualization, control flow transformation, and more. JScrambler provides effective protection for web and mobile applications, including frameworks like React, Angular, Vue, etc.

JShaman (China): JShaman is an online JavaScript obfuscation and encryption tool. It helps generate powerful and hard-to-read JavaScript code, supporting ES6 and other commonly used JavaScript versions. JShaman allows customizing the obfuscation strength to provide the most suitable protection settings for your code.

JavaScript Obfuscator (United States): JavaScript Obfuscator is another popular JavaScript obfuscation library that compresses, obfuscates, and encrypts JavaScript code while preserving its functionality. It provides various setting options, making it easier for users to customize the obfuscation process.

Babili (Australia): Babili is one of the plugins in the Babel toolchain that performs JavaScript compression and obfuscation during the Babel lifecycle. It uses UglifyJS as the default compressor and adds optimizations implemented through static analysis of ECMAScript 2015+ features.

These are all highly recommended JavaScript obfuscation and encryption tools, each with its own features and functionalities. You can choose the one that best suits your needs.

Note: The content of this translation is based on the answer provided by ChatGPT AI, as shown in the image provided.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/be1vkyxlyutjochug1y6.jpg)
Workaround for Unity Personal License Manual Activation Not Supported
Tags: unity3d
Published: 2023-09-02 06:51:53

---
title: Workaround for Unity Personal License Manual Activation Not Supported
published: true
date: 2023-08-20 00:00:00 UTC
tags: unity
canonical_url: https://www.ankursheel.com/blog/unity-personal-license-manual-activation-workaround
---

You decided to add a CI/CD pipeline to your Unity Project using [GameCI](https://game.ci/). You are all pumped up and ready to start.

What's the 1st step? Activating Unity! No biggie, right?

Well, hold on a sec. You generate the **_alf_** file after creating the github action. You carry on with the list and head to [https://license.unity3d.com/manual](https://license.unity3d.com/manual), all set to create that **_ulf_** file.

## Plot Twist

But hold your horses because here comes the twist.

![Unity no longer supports manual activation of Personal licenses](https://www.ankursheel.com/assets/images/posts/unity-personal-license-manual-activation-workaround/no_longer_supported.png)

Unity dropped a bombshell: "Unity no longer supports manual activation of Personal licenses."

Manual activation of Personal licenses? Nope, not happening anymore. Cue the dramatic music. 🎵

But we are not giving up that easily. We disregard the message and upload the **_alf_** file.

Something's fishy. The option to generate an ulf for a personal license? Poof, it's vanished. Instead, it asks us to type in a serial number.

![Activate your license using serial number](https://www.ankursheel.com/assets/images/posts/unity-personal-license-manual-activation-workaround/serial_number.png)

## Time for a bit of trickery

Right-click and inspect the serial number box

Now, hunt down the `<div class="option option-personal clear" style="display: none;">` section

![Html Source](https://www.ankursheel.com/assets/images/posts/unity-personal-license-manual-activation-workaround/html_source.png)

Guess what? We're deleting that pesky `"display: none;"`.

Boom! Like magic, the Unity Personal Edition option reappears. 🎉

![Page With Personal License](https://www.ankursheel.com/assets/images/posts/unity-personal-license-manual-activation-workaround/page_with_personal_license.png)

Hopefully, before this hack stops working, GameCI will have an official workaround :)

### Shoutout

And here's a shoutout to [realpepe](https://reallpepe.itch.io/defendron), who cracked the code and shared the wisdom on Discord. Because in the world of tech, teamwork makes the magic happen.
Event bubbling for Dummies
Tags: webdev, javascript, beginners, tutorial
Published: 2023-08-19 22:27:14

Before we can go into what Event bubbling is, we have to make sure that we understand what an `Event` is.

An `Event` is something that happens on a webpage, for example, a user clicking on a button or an error that occurs.

Events are fired and then handled via an event handler. (Or ignored if we don't have any event handler listing for that Event)

## Events in action

An example of an event being fired and an event handler looks like this.

```html
<button>Click Me</button>
<script>
    document.querySelector("button").addEventListener("click", (event) => console.log(event))
</script>
```

So what is happening here is the following:

1. We search the button via the querySelector
2. We attach an event listener
3. We `console.log` the event

Now let's go into event bubbling.

## Event bubbling

The example above is pretty straightforward, but what happens if we don't attach the event handler to the button directly?

```html
<div>
    <button>Click Me</button>
</div>
<script>
    document.querySelector("div").addEventListener("click", (event) => console.log(event))
</script>
```

In this case, we attach the event handler to the div that is the **parent** of the button.

Even though the event handler is not attached to the button, the event handler still gets called.

This is because the event "bubbles" up from the child element to the parent element and so on.

It is noteworthy that the event will keep "bubbling up" after an event handler has already handled it.

```html
<div>
    <button>Click Me</button>
</div>
<script>
    document.querySelector("div").addEventListener("click", (event) => console.log(event))
    document.querySelector("button").addEventListener("click", (event) => console.log(event))
</script>
```

Both event handlers will be called.
How to delete data from one to many relationship in Laravel?
Tags: laravel10, eloquent, relationships, howto
Published: 2023-09-18 01:28:06

---
title: How to delete data from one to many relationship in Laravel?
published: true
date: 2023-08-20 00:00:00 UTC
tags: ['laravel10', 'eloquent', 'relationships', 'howto']
canonical_url: https://laravelspa.site/blog/how-to-delete-data-from-one-to-many-relationship-in-laravel/
cover_image: https://laravelspa.site/img/laravel-eloquent-one-to-many-relationship-ultimate-guide-2023/en/_hu83baa4aa3f9bb21e729821d4f84a59a4_106809_cd6bd8497b4c0a31f08eb6d464112788.png
---

### Delete data using the user form.

* First go to ***`routes/web.php`*** file and add this route:
```PHP
Route::get('/users/posts/delete', function () {
    $user = User::with('posts')->find(1);
    $user->posts()->whereIn('id', [1, 2])->delete();
    return response()->json($user);
});
```

* We open the browser and go to the new URL ***`http://127.0.0.1:8000/users/posts/delete`*** to find that the post has been deleted successfully.
```json
{
  "id": 1,
  "username": "John Doe Updated",
  "created_at": "2023-09-06T17:24:02.000000Z",
  "updated_at": "2023-09-06T18:49:54.000000Z",
  "posts": [
    {
      "id": 5,
      "title": "Post title 5",
      "body": "Post body 5",
      "user_id": 1,
      "created_at": "2023-09-06T17:29:49.000000Z",
      "updated_at": "2023-09-06T17:29:49.000000Z"
    },
    {
      "id": 6,
      "title": "Post title 6",
      "body": "Post body 6",
      "user_id": 1,
      "created_at": "2023-09-06T17:29:49.000000Z",
      "updated_at": "2023-09-06T17:29:49.000000Z"
    }
  ]
}
```
### Delete data using the publication form.

* First go to ***`routes/web.php`*** file and add this path:
```PHP
Route::get('/posts/user/delete', function () {
    $post = Post::with('user')->findOrFail(2);
    $post->delete();
});
```
* We open the browser and go to the new URL ***`http://127.0.0.1:8000/posts/user/delete`***. We see that the post has been successfully deleted.
![Rcord has deleted](https://laravelspa.site/img/laravel-eloquent-one-to-one-relationship-ultimate-guide-2023/404_huad8a4f887b44a197eb4a715ab4619031_10764_1320x0_resize_box_3.png "Rcord has deleted")

## Conclusion
This article is a continuation of the entire series on __Laravel Eloquent Relationships__ Relationships within __Laravel__. We have covered __one-to-many relationship__ in a complete manner. We have not spared any information for you, and, God willing, we will learn in the following explanation about __the relationship of many to many__.

- You can find the repo of this series on github [here](https://github.com/laravelspa/laravel-relations)
Performance Measurement
Tags: reactnative, redux, reactquery, performance
Published: 2023-08-19 23:20:32

## Overview of Flashlight

To measure performance I utilise [Flashlight](https://flashlight.dev/) - a Lighthouse-like tool tailored for mobile apps.

Flashlight is super easy to use. Simply drag your .apk files (currently support Android only) and receive real-time reports detailing your app's usage.


![How Flashlight works](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6cv624lgow6frbi690hj.png)


<center>(Image from flashlight.dev)</center>


## Performance Before vs After


![before vs after](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77xpke9d8czbek5zgwkl.png)

Thanks to TanStack Query, there's been a substantial enhancement in app performance, leading to a reduction in both CPU and RAM usage. The app now maintains a consistent 60 FPS, resulting in a smoother and more fluid user experience.

Note: This test was conducted using a high-end Android device. Anticipate even more significant performance gains on low-end devices.

Further details regarding performance measurement are available below:

### Before
{% youtube P0BRg9Fr0Ro %}

### After
{% youtube Ff71T2X_u90 %}

---

In summary, migrating to TanStack Query provides you with the right tool for managing **_asynchronous state management_**, effectively removing the complexities of async-spaghetti code. This enhancement not only improves code readability and simplifies maintenance but also accelerates your development experience.

> The truly **globally accessible client state** that is left over after migrating all of your async code to TanStack Query is usually very tiny.

That's it for today. I hope you find this useful.
The 61st Day of the 100 Days of Code Challenge
Published: 2023-08-19 23:04:38

Hey everyone!

This has been quite a good day. I worked on exploring solutions to improve the latency in the assistant project I'm working on and it's looking promising. There's so many new developments in the field of low-latency calls, allowing for performance that isn't any less than insane.

I worked on a way to benchmark the LLM-powered implementation I'm using which looks fairly good and will allow me to analyze the latency a bit further, something I plan to do using Claude (I've been loving it so far!).

I'm optimistic about what's to come next in terms of latency, I'll work on integrating some of these new developments I mentioned above in this implementation and see what it gets me!

To human-like behavior and above, happy coding!
R is Heavily Functional and Classy too
Tags: r, oop, functional, programming
Published: 2023-08-19 22:58:25

I believe that R was primarily made functional because it was intended to be used by Statisticians who are used to functions. For instance, whereas python gives a pandas dataframe object a head method, base R uses a head function to get the first few rows of the dataset been worked on. By base R, it is meant the basic codes, the ground functionalities of R upon which other programs (or packages) can be built.

```{python}
# Python
data_head = data.head()
```
```{r}
# R
data_head = head(data)
```
This is the case with most of the base R in-built features, however, R still allows for object oriented programming too. Meaning that you can also create classes and create objects from them. But suppose you wanted to make a class, how do you do that? 

First, the easiest way to write a class is to use the reference class. 
```{r}
# R
library(methods)
  
Vehicle = setRefClass("Vehicle", 
  fields = list(
     name = "character", 
     engine = "character", 
     weight = "numeric"
  ), 
  methods = list(
     horn = function(){
        # some codes
     },
     move = function(){
        # some codes
     }
  )
)
car1 = Vehicle(name = "Toyota", engine="s8", weight=45)
# print the name of the vehicle
car1$name
# Let the vehicle horn
car1$horn()
# Let the vehicle move
car1$move()
```
Another variant of classes in R is the R6 class illustrated below.
```{r}
# R
library(R6)

Vehicle <- R6Class("Vehicle",
  public = list(
    name = NULL,
    engine = NULL,
    weight = NULL
    initialize = function(name = NA, engine = NA, weight = NA) {
      self$name <- name
      self$engine = engine
      self$weight = weight
      self$horn()
    },
    horn = function(val) {
      # some codes
    move = function() {
      # some codes
    }
  )
)

car1 = Vehicle$new(name = "Toyota", engine="s8", weight=45)
# print the name of the vehicle
car1$name
# Let the vehicle horn
car1$horn()
# Let the vehicle move
car1$move()
```
I guess you understood that in both cases instead of using the **.** operator as in **data.head()** in Python, we are using the **$** operator in R: as in **car1$name**, **car1$horn()** e.t.c. and that the major differences are that **Vehicle$new** was used to create a new Vehicle object ( a car named Toyota), a public access modifier was used and an initializer (constructor) was added in the [R6 class](https://r6.r-lib.org/articles/Introduction.html). while that was not the case with the reference class. An object oriented version of [Shiny](https://shiny.posit.co/r/getstarted/shiny-basics/lesson1/index.html) (for building web apps) called [Tidymodules](https://opensource.nibr.com/tidymodules/articles/tidymodules.html) uses the R6 class in its design. See [1](https://www.google.com/amp/s/www.geeksforgeeks.org/classes-in-r-programming/amp/) and [2](https://rpubs.com/AmarKap/OOPsInR) for more details on the classes available in R. 

R may not have the Python, Java, C++, C# e.t.c type of classes, but similar concepts are addressed in its classes. R still very much supports object oriented programming, even though it is heavily functional.
Figma to React
Tags: programming, beginners, news, frontend
Published: 2023-08-19 22:56:14

[HEROFY](https://herofy.co/)is your secret weapon in frontend development. Transforming your Figma designs into powerful, pixel-perfect React, Vue, and Angular components, we empower developers, agencies, and startups to unleash their true potential. With expert craftsmanship and lightning-fast turnaround, Herofy saves you time and money, providing seamless frontend solutions that take your projects to heroic heights. Embrace the ease and efficiency of Herofy today and elevate your frontend game like never before!👩‍💻🧑‍💻
What is Cache Memory
Tags: computerscience, softwareengineering, development, webdev
Published: 2023-08-19 22:46:03

Cache memory is a high-speed volatile computer memory that stores frequently used data or instructions to provide faster access to the CPU (Central Processing Unit). It acts as a buffer between the CPU and main memory (RAM), helping to reduce the time it takes to retrieve data or instructions that the CPU needs for its operations. Cache memory comes in different levels, such as L1, L2, and L3 caches, each with varying capacities and proximity to the CPU.
Scikit-Learn, from Python to JavaScript
Tags: scikitlearn, javascript, python, programming
Published: 2023-08-19 22:22:31

You may have found Scikit-learn to be a great package for your traditional Machine Learning tasks, especially if you are not creating your own implementations of the algorithms you use - going by a good tip in programming, which says: do not reinvent the wheel. Truth be told, you may feel you have a great tool, until you are about to switch to an entirely different programming language. The problem is how do you carry your Scikit-learn tool to another language? 

If you are switching to R, there is a way around that: you just need to use a package called Reticulate to link Python and R, and then you can still use your Scikit-learn within R, if you really want to stick to Scikit-learn. But what if you were to switch to JavaScript? Well, fortunately, there are two solutions I can recommend.
## 1. Scikit.js
It takes very much after its mother, Scikit-learn from Python, except for four basic differences. With reference to the codes below, these differences are: (1) in JavaScript, while every other function takes in positional arguments (as in Python), class constructors take in objects (in the JavaScript code below, **_object = { fitIntercept: true }_**). Python, however, allows constructors (initializers) to take in positional arguments. 

### Python
```{python}
from sklearn.linear_model import LinearRegression

x = [[3, 2, 5, 7],
     [1, 2, 5, 2], 
     [2, 8, 9, 7]]
y = [45, 32, 52]
model = LinearRegression(fit_intercept = True)
model.fit(x, y)
print(model.coef_)
```

### JavaScript
```{javaScript}
import * as tf from '@tensorflow/tfjs'
import { LinearRegression, setBackend } from 'scikitjs'
setBackend(tf)

let x = [[3, 2, 5, 7],
         [1, 2, 5, 2], 
         [2, 8, 9, 7]]
let y = [45, 32, 52]
let model = new LinearRegression({ fitIntercept: true })
await model.fit(x, y)
console.log(model.coef)
```

(2) While camel case is used in JavaScript, underscore case are used in Python: you can see this from the **_fitIntercept_** (which is a camel case) and **_fit_intercept_** (which is an underscore case) attributes of JavaScript and Python respectively. (3) In JavaScript, there is always an **_await_** keyword written before calls to the **_fit_** method. Python does not await function calls. This can also be seen in the codes above.
(4) JavaScript demands a **_new_** keyword when creating objects while Python does not. This is illustrated in the codes above.  
See [Scikit.js](https://scikitjs.org/) for more details.
## 2. Mljs
This package may not offer the exact functionalities of Scikit-learn, however it is easy to see some similarities  in fitting of models and prediction as illustrated below: 
```{javaScript}
import SimpleLinearRegression from 'ml-regression-simple-linear';

const x = [[3, 2, 5, 7],
           [1, 2, 5, 2], 
           [2, 8, 9, 7]]
const y = [45, 32, 52]
const model = new SimpleLinearRegression(x, y);
console.log(model.coefficients)
```
See [Mljs package](https://github.com/mljs/ml) for me details.
AN INTRODUCTION TO BLOCKESTATE FINANCES. (The real estate model protocol)
Tags: web3, crypto, defi, blockchain
Published: 2023-08-19 22:18:12

**WHAT IS BLOCKESTATE**
BlockEstate is a decentralized community owned real estate protocol built on Blockchain technology utilizing arbitrum network to bring you the best opportunity to invest in the real estate sector while avoiding barriers of entry fees, location barrier, and professional advise.

A lot of people usually face the challenge of entry into the real estate community because of high entry fee, where to invest in, how to get professional advice and earn passive income. Block Estatefi get all these challenges solved offering an opportunity into real estate.
For the sake of transparency block estate utilized it’s native token $BEH Which allows holders from all over the world within the Block Estatef community to actively take part in fractional real estate ownership which in turn yields profit shared among all investors.
Block estate is centered on tourist locations such as Spain, Egypt and other global fast growing tourist locations.



**WHY IS BLOCKESTATE A BETTER OPTION?**
Block estate is handled by professionals who asses risk management and work towards protect it’s investors and lowering the exposure to risk with increased potential for profit. It is a flexible protocol where you can participate and exit at will while attracting partial income. 

**SECURITY**:
Block estate is backed by professionals and contributing to it’s security is a KYC process and utilization of Blockchain contract to encourage transparency.
Block estate utilizes it’s native token $BEH with which investors or $BEH Token holders can participate in community activities.

TOKENOMICS

![piechart of token distribution](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rg00xgfjff2b9qtaxoqd.png) 

**ROADMAP**

![archived milestone](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4qnuvzath4xrxtzdsdwg.jpg)
![expected goal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0rl2bdwi7mh5fq5bg0yc.jpg)

Follow white paper link below for TOKENOMICS and community structure

blockestate.finance/litepaper


For more detailed information about this amazing project, follow our office channels and links below.

Website:
Https://blockestate.finance

Telegram
Https://t.me/blockestate

Twitter
HTTPS://twitter.com/blockestatefi

Discord
https://discord.gg/wbrm5Qwtj9