teleren/devto huggingface dataset:
React Native will use TypeScript by default
Tags: reactnative, typescript, mobile, javascript
Published: 2023-01-09 10:53:04

### Introduction
TypeScript is a programming language developed by Microsoft. It is a typed superset of JavaScript and includes its own compiler. Being a typed language, TypeScript can catch errors and bugs at build time, long before your app goes live.

> superset of JS means that it introduces new features and expands the capabilities of JavaScript

React Native `next` version will use TypeScript. New projects created by React Native CLI will use TypeScript by default. 
So you don't need to 
- Add TypeScript as a dependency to your project
- Configure the TypeScript compiler options

### React Native + TypeScript component example
- **React.FC**: It provides `typechecking` and `autocomplete` for static properties like `displayName`, `propTypes`, and `defaultProps`.
- **Props**: An interface for a React Component's Props and State `React.Component<Props, State>` will provide type-checking and editor auto-completing when working with that component in JSX.

```javascript
import React from 'react';
import {Button, Text, View} from 'react-native';

export type Props = {
  name: string;
  baseEnthusiasmLevel?: number;
};

const Hello: React.FC<Props> = ({
  name,
  baseEnthusiasmLevel = 0,
}) => {
  const [enthusiasmLevel, setEnthusiasmLevel] = React.useState(
    baseEnthusiasmLevel,
  );

  const onIncrement = () =>
    setEnthusiasmLevel(enthusiasmLevel + 1);
  const onDecrement = () =>
    setEnthusiasmLevel(
      enthusiasmLevel > 0 ? enthusiasmLevel - 1 : 0,
    );

  const getExclamationMarks = (numChars: number) =>
    numChars > 0 ? Array(numChars + 1).join('!') : '';

  return (
    <View>
      <Text>
        Hello {name}
        {getExclamationMarks(enthusiasmLevel)}
      </Text>
      <View>
        <Button
          title="Increase enthusiasm"
          accessibilityLabel="increment"
          onPress={onIncrement}
          color="blue"
        />
        <Button
          title="Decrease enthusiasm"
          accessibilityLabel="decrement"
          onPress={onDecrement}
          color="red"
        />
      </View>
    </View>
  );
};

export default Hello;
```

### Using JavaScript instead of TypeScript
React Native defaults new applications to TypeScript, but JavaScript may still be used. Files with a `.jsx` extensions are treated as JavaScript instead of TypeScript, and will not be type-checked.

### Helpful links to learn TypeScript
- [React with TypeScript](https://reactjs.org/docs/static-type-checking.html#typescript)
- [React + TypeScript Cheatsheet](https://github.com/typescript-cheatsheets/react#reacttypescript-cheatsheets)

### Wrapping up
TypeScript is #5 on the list of the most popular scripting, programming, and markup languages. Also, many tech companies use TypeScript in their tech stack. So learning TypeScript in 2023 will be helpful for a front-end developer overall. 

Thank you for reading!
Contact me
- [Twitter](https://twitter.com/Aneeqa_Khan25)
- [LinkedIn](https://www.linkedin.com/in/aneeqa-khan-990459135/)
- [GitHub](https://github.com/AneeqaKhan)
Adding better DX to the fastest Python WebFramework
Tags: python, showdev, webdev
Published: 2023-01-09 10:30:11

---
title: Adding better DX to the fastest Python WebFramework
published: true
description: socketify now is easier to use and more powerful!
tags: #python #showdev #webdev
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-01-09 10:27 +0000
---

After more than a year of active development, I finally publish my package to PyPI!

```bash
pip install socketify
```

After some people asks to also create a WSGI and ASGI server to improve projects using other frameworks, I worked hard to get it right.

But in the end, we outperform uvicorn and meinheld with Flask, Django, Emmett, FastAPI, and Falcon in TechEmPower plaintext with our WSGI and ASGI servers!

And we got the Top 1 with socketify itself! 

https://www.techempower.com/benchmarks/#section=test&runid=7ce481b2-49ec-4a4d-952d-bb1334d4a4ad&test=plaintext&l=hra0hr-35r

Also added a CLI tool with very familiar options for uvicorn and gunicorn users

CLI: https://docs.socketify.dev/cli.html

Also added lifespan (start and shutdown) events to socketify itself, and added an improved DX for routing and support to Extensions/Plugins.


```python
# main.py
from socketify import App

def run(app: App):
    @app.on_start
    async def on_start():
        # we can start connection pools here
        pass
    
    @app.on_shutdown
    async def on_shutdown():
        # and here we can clean connection pools
        pass

    router = app.router()
    api = app.router(prefix="/api")
    private = app.router("/api", auth_middleware)

    @router.get("/")
    def home(res, req):
        res.send("Hello, World!")

    # will serve in /api/hello
    @api.get("/hello") 
    def hello(res, req):
       res.send("Hello API!")

    # will serve in /api/users and use auth_middleware
    @private.get("/users")
    def get_users(res, req, auth):
       res.send("Hello private API!")
```

```bash
 python3 -m socketify main:run --port 8080 --workers 2
```
About Extensions: https://docs.socketify.dev/extensions.html

My focus until v0.1.0 now will be to add features to help developers and add more optimizations.

Are there any features that you want to see in the future? I will love to get community feedback!

Project: https://github.com/cirospaciari/socketify.py

Issues and Planned Features: https://github.com/cirospaciari/socketify.py/issues

Releases: https://github.com/cirospaciari/socketify.py/releases
Java Quick Start, a new Section Added to Foojay.io
Tags: java, foojay, tutorial, gettingstarted
Published: 2023-01-09 10:25:59

[Foojay.io](https://foojay.io) aims to be the starting point for “all-things OpenJDK,” but during one of my morning walks the idea struck me that this site really needs complete beginner materials, too.

As we want to spread the love for OpenJDK, i.e., Java, Kotlin, and other OpenJDK languages, the JVM, and all related technologies, we were missing an important audience: someone who is interested in an OpenJDK language, such as Java, but has no experience with it yet, and ends up on Foojay.io.

So... today we're announcing a new section: [Java Quick Start](https://foojay.io/java-quick-start/) (with hopefully more quick starts to follow, e.g., 'Kotlin Quick Start'), which you can reach via the main menu, which includes a 30 minute [video-series](https://www.youtube.com/playlist?list=PL-3Bf_FLNZLCI7MEiWscgdIwSB8p2Z7Xb) with an introduction to the Java programming language:


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

## What You Will Learn

The quick start is divided into these sections.

* [Installing Java](https://foojay.io/java-quick-start/#1-install-java). Before you can run any Java source code, you need the OpenJDK to be installed. First, we check if you have access to an OpenJDK version 11 or later. If this is not the case, we give you download instructions, including screenshots for Windows, Mac OS X, and Linux.
* [Quick Start Tutorial](https://foojay.io/java-quick-start/#2-get-started). In 10 short screencasts, code samples are provided to explain the basics of using Java. Of course, there is a lot more to learn! But in these videos (in total about 30 minutes), each with a page describing the code, you will see some use cases that can be used to experiment and get a feeling of how to code with Java.
* [Next Steps](https://foojay.io/java-quick-start/#3-next-steps). We'd like to end by convincing you to dive further into the Java world. There are many more free sources to learn here on Foojay.io and other websites! This is the place where we list a few of these and can easily add more.

We hope [this new section](https://foojay.io/java-quick-start/) will help new users to start programming with Java, so please spread the word.

## Conclusion

I do these morning walks together with my dog Wifi. If you hear some snoring during the videos, that's because she is also my not-so-very-active-office-assistent, and you can see her behind me in the movies.

Some Raspberry Pi's "infiltrated" into the example code. That's because this quick start tutorial is part of my book "[Getting Started with Java on the Raspberry Pi](https://webtechie.be/books/)", but has been slightly modified to better fit Foojay.io.
Ddosify Latency Testing GitHub Action
Tags: webdev, testing, tutorial, github
Published: 2023-01-09 10:17:44

In this article, we will demonstrate how to use the [Ddosify GitHub Action](https://github.com/ddosify/ddosify-latency-action) to periodically test the latency of our target endpoints from 60+ cities worldwide. By configuring the action to run on a schedule, we can ensure that the performance of our locations is consistently monitored. If the latency of any of our locations exceeds the expected value, we will receive an email notification alerting us to the issue. By using this action, we can proactively identify and address potential performance issues before they impact our users.


📌 Check out the blog post: 

{% embed https://ddosify.com/blog/ddosify-latency-testing-github-action %}

📌 Check out the Ddosify Latency Action: 

{% embed https://github.com/ddosify/ddosify-latency-action %}
LET ME PLAY GTA 4 Apk using circuit python
Published: 2023-01-09 10:14:46

m making a custom tile system for my [GTA 4 Apk](https://www.gtabeast.com/gta-4-apk). Its my first time and didnt expect to go that far without a tutorial. So i did my best and made something that works when i render in a tile with the blit method but when i use pygame.sprite.Sprite sprites it doesnt work. I need it to be with pygame's sprite system because it makes it easier doing other stuff and im positive its a rookie mistake i just cant find it.

**Code:**

# Importing libraries
try: 
    import pygame
    from pygame.locals import *
    from time import *
    from os import *
    from random import *
    import sys
    print("All Libraries imported successfully \n")
except :
    print("Error while importing modules and libraries")
    sys.exit()
    
# Creating Screen

screen_width = 640
screen_height = 640
tile_size = int(screen_width / 10)
screen_res = (screen_width, screen_height)
clock = pygame.time.Clock()
running_fps = 144

screen = pygame.display.set_mode(screen_res)
pygame.display.set_caption(f"GTA Circuit Hack FPS:{running_fps}, {screen_width} x {screen_height}, Tile Size: {tile_size}")

# Loading images

#    Background image:
backgroundImg = pygame.image.load("Background.png")
backgroundImg = pygame.transform.scale(backgroundImg, screen_res)

#    Not walkable tile image:
noWalkTileImg = pygame.image.load("unwalkTile.png")
noWalkTileImg = pygame.transform.scale(noWalkTileImg, (tile_size, tile_size))

# making tiles

tiles = []
tile_y = 0
tile_x = 0
for i in range(10):
    
    if i > 0:
        tile_y += tile_size
        
    
    for i in range(10):
        if i > 0:
            tile_x += tile_size
            
            
        tiles.append((tile_x, tile_y))
    tile_x = 0
    
tile_x = 0
tile_y = 0
        
# creating object classes

class BadTile (pygame.sprite.Sprite):
    def __init__(self, tile):
        pygame.sprite.Sprite.__init__(self)
        self.image = noWalkTileImg
        self.tile = tile
        self.rect = self.image.get_rect()
        self.x = self.tile[0]
        self.y = self.tile[1]  
        
    def update(self):
        self.x = self.tile[0]
        self.y = self.tile[1]  

# creating objects

tile1 = BadTile(tiles[99])
game_tiles = pygame.sprite.Group()
game_tiles.add(tile1)

run = True
while run:
    clock.tick(running_fps)
    screen.blit(backgroundImg, (0,0))

    # rendering
    
    game_tiles.update()
    game_tiles.draw(screen)
    
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            run = False
            
    pygame.display.update()

pygame.quit()
print ("Exited with no errors")
sys.exit()
What conferences do you want to go to in 2023?
Tags: discuss, conferences, codenewbie, watercooler
Published: 2023-01-09 10:06:00

---
title: What conferences do you want to go to in 2023?
published: true
description: 
tags: discuss, conferences, codenewbie, watercooler
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4dhbcpr384yfrtg2halz.png
# Use a ratio of 100:42 for best results.
published_at: 2023-01-09 10:06 +0000
---

It's a new year, and that means time for a new year of conferences! What conferences--virtual or in-person--do you want to attend this year? Are you speaking, sponsoring, or going as an attendee?

I'm starting the year off strong, speaking virtually at [You Got This!](https://yougotthis.io/events/broadcasting-service/) on January 14th and then live at [THAT Conference](https://that.us/activities/BojrAo0dd8x62Arj8s6U) on January 18th.
React-JS Prevent re-rendering
Tags: react, javascript
Published: 2023-01-09 10:01:45

How to prevent specific state in functional component effects of its component ( causes re-render it) on declaration step.

I am trying to handle this issue (functional component) in declaration of State, the syntax should be like this:

const [state,setState] ==false= React.setState('test') ???

Find the right syntax for the upon State declaration regarding to make the state ineffective to its component...
Arlo sign in | Arlo Setup | My Arlo
Tags: arlologinmyaccount, myarlologin, myarlo
Published: 2023-01-09 09:56:21

The Arlo Login page can be used to gain access to the **[Arlo setup](https://basestation-offlines.com/)** wizard. Here, you can head to the Arlo account and view the recorded videos and images easily. You can use the Arlo app or the default web address my.arlo.com to access the same. Download the app from Google Play Store or Apple App Store and proceed with the login steps easily.
How to set ringtones on Android phones 2023
Tags: mobile
Published: 2023-01-09 09:48:47

Android phones already have a ringtone cutter on the system so you can cut the ringtone you like, without having to cut the ringtone on your computer and then transfer it to your phone. Besides, you can also choose a ringtone for each phone number in the contact list to make a separate ringtone. All operations are done right on the phone with a simple implementation. The following article will show you how to cut ringtones on Android.

## 1. Instructions for cutting Android ringtones

**Step 1:**

At the music album on your Android phone, click on the song you want to choose as a ringtone. Then in the music playback interface, click on the scissors icon below. Then switch to the interface to cut segments as ringtones. Depending on the type of Android phone and Android version you are using, this interface may be different.
**Step 2:**

You find the music you want to cut by moving the first and last 2 bars to select the music. A preview of the music can be heard by pressing Play. Finally press the Set as ringtone button and you're done.
In case your phone does not have a ringtone cutting mode right on the phone, then we have to cut the ringtone from the outside and then transfer it to the phone, then select the ringtone from Settings.

**Tip:** You can spread millions of ringtones available and constantly updated with the latest at **[Suonerie Mp3 Gratis](https://suonerie-mp3-gratis.com/)** - **[suonerie android](https://suonerie-mp3-gratis.com/)**

## 2. How to change ringtones on Android
**Step 1:**

Go to Settings and select Sound & vibration. Then click on Ringtone to choose a ringtone.
**Step 2:**

Click to select more ringtones and then click Select ringtone on your device, or press the Add button. Now you need to go to the music album on your phone and select the song you want to set as a ringtone
Powering Smart City Solutions with AWS IoT & GovCloud(US)
Tags: awscloud, iot, govcloud
Published: 2023-01-09 09:47:45

Learn how Anblicks helped Ubicquia in building a smart city and street light IoT platforms and helped in saving cost by migrating 400+ servers and 1000s of databases to AWS.

**Register here:** [Powering Smart City Solutions with AWS IoT & GovCloud](https://www.anblicks.com/insights/webinars/powering-smart-city-solutions-with-aws-iot-govcloud?utm_source=linkedin&utm_medium=group&utm_campaign=aws-webinar&utm_id=sai&utm_term=Powering+Smart+City+Solutions)
How to find twitter accounts with similar profile picture?
Tags: javascript, node, twitter
Published: 2023-01-09 09:26:57

I want to build a service that can tell us what profiles on Twitter have a particular profile picture(Sample: [https://www.nftinspect.xyz/twitter-search/nft?chain=ETH&token=4081&contract=0x8a90cab2b38dba80c64b7734e58ee1db38b8992e](https://www.nftinspect.xyz/twitter-search/nft?chain=ETH&token=4081&contract=0x8a90cab2b38dba80c64b7734e58ee1db38b8992e)), I have gone through all references of Twitter APIs ([https://www.nftinspect.xyz](https://developer.twitter.com/en/docs/api-reference-index)) but was not able to find one to resolve my problem, and thought about scanning via search but that doesn't sound scalable, any folks with previous or similar experiences? I would really appreciate the help :)
Note, I have found one tool([https://www.nftinspect.xyz](https://www.nftinspect.xyz)), but unfortunately, it is shutting down on 17th Jan.
How To Find Remote Tech Jobs On LinkedIn
Tags: career
Published: 2023-01-09 09:26:41

Many people working in tech are tired of:

- Long commutes.

- Having to spend money on public transport.

- Having less time for themselves and their loved ones.

And many other factors causing people to prefer remote working over hybrid or in-office working.

**Be Careful**

Many websites list remote tech jobs. 

However, be careful because often job descriptions are misleading or poorly written.

"Remote" can carry different meanings depending on the company that is hiring.

It can mean:

- You can work anywhere **within** the country. For example, if a company hires for a remote role in the UK, you must be based anywhere within the country to be eligible to apply. 

- You can work anywhere **within a specific geographical region**. For example, some companies may hire for a role within the EMEA region (Europe, Middle East and Africa). It means you must be based anywhere in that geographical location. 

Either way, a remote job is a role which allows you to work 100% from home. 

It's your choice whether you want to go to the office

A company advertising a role as "remote" but requesting employees to be in the office even once a week is not a remote role. In this case, it's hybrid. 

> **Related**: [How To Create A Job-Winning Resume For The Tech Industry In 2023](https://techwithmaddy.com/how-to-create-a-job-winning-resume-for-the-tech-industry-in-2023)

**How to Find Remote Tech Jobs on LinkedIn**

LinkedIn is a business-focused social media platform.

Over the years, it has become better at advertising jobs by offering several levels of filters.

Here's how you can search for a remote tech job on LinkedIn.

Assuming you have a LinkedIn account and you're on a browser:

Go onto the Jobs tab. 

![linkedin-jobs-tab](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/csl4povaaj7e5va5b46w.jpg)

On the left-hand search bar, search for "Software Developer" (or anything you want).


![linkedin-search-bar](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8bsfaxs6b5z4o3667obc.jpg)

Then, click on the On-site/remote tab.


![linkedin-remote-option](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dcki9f4w1a9iwv77ne1e.jpg)

Select **Remote** and then **Show results**.


![linkedin-remote-jobs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z5gjg7a2636p8ylxoex6.jpg)

You can apply even more filters to your search if you click the **All filters** tab. 

If you scroll in the **All filters** tab, you can select the location you want the job to be based. 

Let's select **Paris** (or any other city) as an example and then **Show results**.


![linkedin-paris-remote-jobs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w80gxvchgator22dx5bd.jpg)

> **Related**: [How To Choose A Software Engineering Job](https://techwithmaddy.com/how-to-choose-a-software-engineering-job)

**Conclusion**

This article has shown you how to search for remote tech jobs on LinkedIn.

LinkedIn is a powerful tool for job searching (and other tasks). I hope you'll use it more often.

Until next time!

🙋🏾‍♀️
Oracle All Table bytes
Tags: uyumsoft
Published: 2023-01-09 09:19:14

```
SELECT owner,
segment_name,
segment_type,
tablespace_name,
bytes/1048576 MB,
initial_extent,
next_extent,
extents,
pct_increase
FROM
DBA_SEGMENTS
WHERE
OWNER = 'UYUMLOG'

ORDER BY  bytes/1048576 DESC
```
How to install/update Go development Tools using apt on Ubuntu
Tags: beginners, go
Published: 2023-01-09 09:12:19

The default way of installing Go development tools via apt is to use the below command

  `sudo apt install golang`

This installation, in most cases, will contain a slightly older version of the Go development tools. If we want to update to the latest version of Go, then we can use the [Golang Backports](https://launchpad.net/~longsleep/+archive/ubuntu/golang-backports) PPA which hosts the latest versions of Go.

Below is how we can use the [Golang Backports](https://launchpad.net/~longsleep/+archive/ubuntu/golang-backports) PPA

- Add the repository

  `sudo add-apt-repository ppa:longsleep/golang-backports`

- Update apt

  `sudo apt update`

- Install Go

  `sudo apt install golang-go`

- Alternatively, we can provide specific versions as well

  `sudo apt install golang-1.19`


The above-mentioned method works for both standalone and WSL installations of Ubuntu (tested with Ubuntu 22.04 on WSL2).
python3.11 latest changes
Tags: python, webdev, programming
Published: 2023-01-09 09:05:19

brief overview of some of the latest changes and features in Python 3.11:

1. Time Functions with Nanosecond Resolution: Python 3.11 introduces a new set of time functions with nanosecond resolution. These functions include `time.perf_counter_ns(), time.process_time_ns()`, and `time.monotonic_ns()`.

2. Positional-Only Parameters: Python 3.11 introduces a new syntax for defining positional-only parameters in function definitions. Positional-only parameters are parameters that can only be specified using their position, and not by using their name.
3. New Dictionary Methods: Python 3.11 introduces several new methods for dictionaries, including `dict.fromkeys_ex()`, which allows you to create a new dictionary with a set of keys and a default value for all of the keys.

4. Improved Error Handling: Python 3.11 includes several improvements to error handling, including the ability to specify a traceback message when raising an exception, and the ability to specify a from_cause parameter when raising an exception from another exception.

5. Improved Performance: Python 3.11 includes several performance improvements, including faster dict lookups and faster attribute access.