teleren/devto huggingface dataset:
Understanding HTTP and REST
Tags: swift
Published: 2023-08-18 13:47:21

In this unit, we will delve into the world of HTTP and REST, two fundamental concepts in the realm of networking. These concepts are crucial for any developer working with web services or APIs.

## Introduction to HTTP

HTTP, or Hypertext Transfer Protocol, is the foundation of any data exchange on the Web. It is a protocol - a set of rules that dictate how data should be exchanged. HTTP operates as a request-response protocol in the client-server computing model.

A client (a web browser or an app, for example) sends an HTTP request to the server, then the server returns a response to the client. The response contains status information about the request and may also contain the requested content.

## HTTP Methods

HTTP defines a set of request methods, sometimes referred to as HTTP verbs, to indicate the desired action to be performed. The most common methods include:

- GET: Requests data from a specified resource.
- POST: Sends data to a server to create a new resource.
- PUT: Updates a current resource with new data.
- DELETE: Deletes a specified resource.

## Introduction to REST

REST, or Representational State Transfer, is an architectural style for providing standards between computer systems on the web, making it easier for systems to communicate with each other.

REST-compliant systems, often called RESTful systems, are characterized by how they are stateless and separate the concerns of client and server. In a RESTful system, the client is responsible for the user interface and user experience, and the server is responsible for processing requests and sending appropriate responses.

## Principles of REST

REST has a set of constraints or principles that a system must adhere to, including:

- Client-Server: There should be a separation between the server that stores the information and the client that accesses it.
- Stateless: Each request from a client to a server must contain all the information needed to understand and process the request.
- Cacheable: Responses from the server can be cached by the client to improve performance.
- Uniform Interface: The method of communication between the client and server should be consistent and uniform.

## Overview of RESTful APIs

A RESTful API (Application Programming Interface) uses HTTP and REST principles to interact with data. These APIs have become a standard method for businesses and organizations to share data with clients, customers, and partners. They allow different software systems to communicate with each other, even if they are built on different platforms.

In the next unit, we will learn how to make API calls using Swift, which will allow us to retrieve, create, update, and delete data from a server.
The Importance Of Immutability In React
Published: 2023-08-24 11:25:51

Immutability is a crucial concept in React. It refers to the practice of not changing the original data structures once they are created. Instead, when modifications are required, new data structures are created to represent the updated state. 

**Why is immutability manually applied?**


In JavaScript, objects and arrays are reference types. When you mutate an object, its reference remains the same, even if the content changes. This can lead to unexpected behavior when comparing objects for equality or when checking for changes. Immutable data ensures that changes result in new references, facilitating accurate comparison checks.

**Why is immutability encouraged in React specifically?**



1. 
    **Predictable Data Flow**: In React, components re-render when their state or props change. If the data within a component's state is immutable, it becomes easier to predict when a re-render will occur. This predictability is essential for maintaining a stable and efficient application performance.

2. 
    **It improves performance**: React uses a virtual DOM to render components. The virtual DOM is a lightweight representation of the actual DOM. When an object is immutable, React can simply compare the old and new objects to see if anything has changed. If nothing has changed, React can skip the rendering step, which can improve performance.


3. 
    **Debugging**: It can help to prevent bugs. When objects are immutable, it is more difficult to accidentally modify the state of an object in a way that can cause a bug.


**How to achieve immutability in React?**



One way is to use the **_const_** keyword to declare variables. Variables declared with the const keyword cannot be changed. 

```
// bad: Because a new object is created every time React renders.

function App() {
  const [visible, stop] = useElementVisibility(ref, {
    root: null,
    rootMargin: "0px",
    threshold: 1,
  });
}

const options = {
  root: null,
  rootMargin: "0px",
  threshold: 1,
};

// good: Because the reference to the object remains unchanged.

function App() {
  const [visible, stop] = useState(ref, options);
}
```


Alternatively, you can choose to use the _useMemo_ function to wrap it.

```
// good: Because the reference to the object remains unchanged.

function App() {
  const options = useMemo(() => {
    return {
      root: null,
      rootMargin: "0px",
      threshold: 1,
    };
  }, []);

  const [visible, stop] = useState(ref, options);
}
```
Warehouse Automation Companies in India
Tags: warehouse, warehouseautomation, conveyorsolutions, conveyor
Published: 2023-08-24 11:24:46

Bricspac is one among India’s few [warehouse automation companies in india](https://bricspac.com/). They not only provide manufactured solutions, but also customize high tech machinery lines to meet the needs of the connected manufacturing era, also known as Industry 4.0.

Bricspac now delivers products and [customised warehouse](https://bricspac.com/) solutions across the entire spectrum of the warehousing needs, with a high degree of localization, short turnaround times, and best-in-class installation and technical support.
Accelerate Your Project with Dedicated Developers
Tags: hirevbdotnetdeveloper, hirededicateddeveloper, hireaspnetdeveloper, hiredotnetcoredevelopers
Published: 2023-08-24 10:58:03

Are you looking to bring your software vision to life, but lack the in-house expertise or resources to do so? **[Hiring dedicated developers](https://www.codzgarage.com/hire-dedicated-developers/)** could be the solution you've been searching for.


## **Why Choose Dedicated Developers?**


**Expertise on Demand:** 
Dedicated developers bring specialized skills and expertise to your project without the long-term commitment of hiring a full-time employee.

**Cost-Effective:** 
Avoid the overhead costs associated with onboarding and maintaining in-house staff. With dedicated developers, you pay for the services you need when you need them.

**Flexibility:** 
Scale your development team up or down based on project requirements. Dedicated developers offer the flexibility to adapt to changing needs.

**Faster Time-to-Market:** 
Leverage the experience of dedicated developers to expedite project timelines. Their focused efforts can help you get your product to market faster.

**Focus on Core Competencies:** 
By outsourcing development tasks, you can concentrate on your core business activities while leaving the technical aspects to the experts.


## **How to Hire Dedicated Developers**


**Define Your Needs:** 
Clearly outline your project's requirements, goals, and expected outcomes to find the right developers with the relevant skills.

**Choose the Right Partner: **
Whether you're working with a freelancing platform, a **[Software Development Agency](https://www.codzgarage.com/)**, or an offshore team, ensure they have a proven track record and positive reviews.

**Communication**: 
Effective communication is key to successful collaboration. Set up regular check-ins and use collaboration tools to keep track of progress.

**NDA and Security: **
If your project involves sensitive information, consider signing a Non-Disclosure Agreement (NDA) to protect your intellectual property.

**Trial Period:** 
Start with a small project or a trial period to assess the developers' capabilities and compatibility with your team's working style.

## conclusion 

whether you're aiming for a seamless software migration or looking to boost your development efforts with dedicated professionals, making informed decisions and planning meticulously will set the stage for success. Embrace the opportunities that modernization and outsourcing bring to your business, and watch your operations flourish.
Sending Love Across Miles: The Art of Gift Delivery in Lebanon
Tags: giftboxes, onlinedelivery, lebanon, ordernow
Published: 2023-08-24 11:19:58

Giving presents has developed into a touching means to transmit feelings of love and affection over long distances at a time when people are increasingly connected but geographically separated. This attitude is particularly unique in Lebanon, a nation renowned for its vibrant culture and close-knit communities. The idea of **[gift delivery in Lebanon](https://qr.ae/py6Kux)** has evolved into an art form that enables people to cross distances and express their emotions concretely and considerately. read the full blog!!
Electronic Compoents
Published: 2023-08-24 11:15:51

Electronics Components are the elementary structure block or physical object in an electronic system like circuits and devices. They are the individual units that perform specific functions within a circuit Electronic divided into three categories and sub categories such as Structural, Electro-Mechanical and Electrical and electronics in this blog we will describe about electronics components.  Electronics components are divided into two sub categories in nature first is Active and last o is other Passive components. 
some common types of electronic components:
active components are Transistors, Diodes, ICs, Amplifiers, controllers, processors etc.
Passive Components are Resistors, Capacitors, Sensors, Batteries etc. 

Transistor: is a type of semiconductor device which amplify frequency of electronic signals and electrical power. Transistors are crucial for digital logic circuits and amplifiers.
Diode: is also a type of active semiconductor device which allow current flow in one direction only. Diodes are used for rectification, signal demodulation, and voltage regulation.
Resistor: A passive component is a type of components that limits the flow of electric current. It is often used to control voltage levels and current flow in devices
Capacitor: also another type of passive component that applied stores and releases electrical energy in the form of an electric field. Capacitors are used for filtering, energy storage, and coupling signals between different parts of a circuit modules.
Inductor: is a type of electronic component applied for stores energy in a magnetic field when current flows through it. It is often used in circuits to control changes in current and filter out certain frequencies.
Integrated Circuit (IC): is also type of microchip or chip, an IC is a complex assembly of multiple electronic components, including transistors, resistors, capacitors, and more, all integrated onto a single substrate. They can perform a wide range of functions, from simple logic operations to complex data processing.
Microcontroller (MCU): is also type of integrated circuit that contains a processor, memory, and input/output peripherals. Microcontrollers are the engine of many embedded systems and electronic devices.
Voltage Regulator: is a type of component that maintains a constant output voltage regardless of changes in input voltage or load. It's commonly used to provide stable power to sensitive components.
Sensor: A device that detects and measures physical properties like light, temperature, pressure, or motion. Sensors are used to gather data from the environment for various purposes.
Hastelloy C22 Washers Exporters In India
Published: 2023-08-24 11:14:16

Due to their heavy-duty construction and exceptional strength, [Hastelloy C22 Washers](https://www.nehametalalloys.com/hastelloy-c22-washers-manufacturers-suppliers-importers-exporters-stockists.html) are ideal for use in extreme temperatures and corrosive environments. They are commonly used in oil refineries, chemical plants, power generation facilities, and other industries that require superior corrosion resistance. Additionally, these washers are used to provide a seal between two parts or surfaces.
[번역]Flutter에서의 네트워킹
Tags: flutter, networking, http, crossplatform
Published: 2023-08-24 10:55:33

Flutter는 인터넷 네트워크 호출에 대한 광범위한 지원을 제공합니다. 이 가이드에서는 Flutter에서의 네트워킹 기본 사항에 대해 안내합니다.

## 플랫폼 간 HTTP 네트워킹

Flutter의 `http` 패키지는 http 요청을 만드는 가장 간단한 방법을 제공합니다. 이 패키지는 Android, iOS, macOS, Windows, Linux 및 웹과 같은 다양한 플랫폼과 호환됩니다.

### 플랫폼 참고 사항

#### Android

Android 애플리케이션의 경우, Android 매니페스트(`AndroidManifest.xml`)에서 인터넷 사용을 선언해야 합니다:

```xml
<manifest xmlns:android...>
 ...
 <uses-permission android:name="android.permission.INTERNET" />
 <application ...
</manifest>
```

#### macOS

반면, macOS 애플리케이션은 관련 `.entitlements` 파일에서 네트워크 액세스를 허용해야 합니다:

```xml
<key>com.apple.security.network.client</key>
<true/>
```

[entitlements 설정에 대해 자세히 알아보기](https://docs.flutter.dev/get-started/editor)

### 샘플

다양한 네트워킹 작업(데이터 가져오기, WebSockets 사용, 백그라운드에서 데이터 파싱 등)에 대한 실용적인 예제는 [네트워킹 쿡북](https://docs.flutter.dev/get-started/codelab)을 참조하십시오.

---

**출처**: [Flutter 공식 문서](https://docs.flutter.dev/data-and-backend/networking)

이것은 제공된 링크의 내용을 기반으로 한 요약된 버전입니다. 더 자세한 정보나 특정 섹션이 필요하면 알려주세요!
Habilitando a sobrescrita do apache no Docker
Tags: apache, docker, htaccess, tutorial
Published: 2023-08-24 10:52:50

Olá pessoal, hoje vamos bater um papo sobre como configurar o apache no seu container docker para aceitar a sobrescrita de regras no .htaccess do se projeto.

Tenho o seguinte .htaccess:

```
RewriteEngine On

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.+)$ index.php [QSA,L]
```

Nesse .htaccess estou alterando a regra para mandar tudo após o diretório home “/” para o meu index.php.

Como no apache do docker está desabilitado a regra de sobrescrita, acaba que sempre que eu ia acessar a minha rota pelo insomnia retornava server error 500.

Como estamos falando de docker, vamos começar pelo Dockerfile, estou usando a imagem php:8.1.11-apache.

Adicionei dois comando run, como pode-se verificar abaixo:

```
RUN a2enmod rewrite
RUN addgroup --gid 1000 appuser; \
    adduser --uid 1000 --gid 1000 --disabled-password appuser; \
    adduser www-data appuser; \
    sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf; \
    service apache2 restart;
```
Nessas dois comandos run, estou habilitando a sobrscrita do apache no container, adicionando um usuário para alterar o apache2.conf e reiniciando o serviço do apache.

Sendo assim, quando eu quando eu subir esse container, o apache já estará configurado e pronto para aceitar as regras do .htaccess do seu projeto.
Cumulocity IoT Alarm Management App : Open Source
Tags: cumulocity, iot, alarms, opensource
Published: 2023-09-08 10:37:40

---
title: Cumulocity IoT Alarm Management App : Open Source
published: true
date: 2023-08-24 10:42:33 UTC
tags: cumulocity, iot, alarms, opensource
canonical_url: https://tech.forums.softwareag.com/t/cumulocity-iot-alarm-management-app-open-source/282030
---

 

## Introduction

The open-source Alarm Management App for iOS and Android is now available on [GitHub](https://github.com/SoftwareAG/cumulocity-alarmapp). Use it to integrate into your applications, giving you a head start in utilizing alarm management features.

Feature Highlights

- Provides visibility of device alarms and events on the Cumulocity IoT platform. ​
- Supports real-time push notifications for alarms as per watch list ​
- Get details like number of alarms, first occurrences, alarm status and alarm recency.​
- Alarms can be viewed, acknowledged and cancelled from the mobile device.​
- Add comments on the alarms to add additional info and use it to collaborate within teams​
- Dark mode

[![cumulocity-alarmapp: The Cumulocity IoT Alarming App brings alarms on your mobile phone! You'll see a handy overview… 2023-08-11 17-19-26](https://global.discourse-cdn.com/techcommunity/optimized/3X/e/b/ebe7f44f98ba88852bbe47d8ed637c07fb27d543_2_689x367.jpeg)](https://global.discourse-cdn.com/techcommunity/original/3X/e/b/ebe7f44f98ba88852bbe47d8ed637c07fb27d543.jpeg "cumulocity-alarmapp: The Cumulocity IoT Alarming App brings alarms on your mobile phone! You&#39;ll see a handy overview… 2023-08-11 17-19-26")

The Alarm Management App is open-source and available on [GitHub](https://github.com/SoftwareAG/cumulocity-alarmapp), making it easy for developers and organizations to integrate it into their applications.

For enabling push notifications requires dedicated microservices to be deployed on your Cumulocity IoT tenant. Read More [here](https://github.com/SoftwareAG/cumulocity-alarmapp/blob/main/microservices/README.md)

## Try it out !

You can download the unsigned .APK for android here and try it out : [GitHub Releases](https://github.com/SoftwareAG/cumulocity-alarmapp/releases)

Below is a GIF that will guide you through a brief demonstration of the application in dark mode  
 ![C8Y IoT Alarm Management Application iOS Dark Mode 2](https://global.discourse-cdn.com/techcommunity/original/3X/c/1/c15779eb4f4dc7b3c8f03b0fc00f835d9bb46c8d.gif)

## Useful links | Relevant resources

Access GitHub Repository here: [GitHub - SoftwareAG/cumulocity-alarmapp: The Cumulocity IoT Alarm App brings alarms on your mobile phone! You'll see a handy overview about all alarms.](https://github.com/SoftwareAG/cumulocity-alarmapp)


[Read full topic](https://tech.forums.softwareag.com/t/cumulocity-iot-alarm-management-app-open-source/282030)
Perks of Utilizing Website Templates
Tags: css, html, writing
Published: 2023-08-24 10:29:38

Website templates offer a number of benefits for creating an effective website. They save time and effort by providing pre-designed layouts and structures, making them ideal for those without design or coding skills. 
 
**_Templates are cost-effective compared to custom designs and their user-friendly interfaces require little technical knowledge._** Thanks to responsive templates, your website will look great on all devices. They are customizable so you can customize the elements to match your brand.  

_**Templates allow you to launch a website quickly, often with community support. Well tested and scalable**_, they are a source of inspiration for design and layout ideas. Although website templates are not suitable for complex projects, they are a convenient option for many individuals and businesses looking for an online presence.
Code commit best practice with commitizen & pre-commit
Tags: githooks, commitizen, husky, git
Published: 2023-08-24 10:26:01

In this opportunity, I will share about Git hooks, Commitizen, and ESLint for linting. Coincidentally, on this occasion, I will be using Angular projects.

Let's say we already have Angular projects. And then, you need to install several dependencies.

**Step 1**
```
npm i -D husky eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin
```

**STEP 2**
You need to setup husky in your project with run this command

```
npx husky install 
```
That command will generate the <u>.husky/pre-commit</u> file. pre-commit file will look like this.

```
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run test
```

**STEP 3**
Setup <u>[commitizen](https://www.npmjs.com/package/commitizen)</u> for template commit message. This is a beautiful feature to organize commit messages, especially when working with a fairly large team. For setup commitizen you need to run this command:

```
npm i commitizen
```

and add this on your <u>package.json</u>

```
"config": {
    "commitizen": {
      "path": "cz-conventional-changelog",
      "jiraOptional": true
    }
  }
```
This isn't finished yet, you need to run the following script.

```
npx husky add .husky/prepare-commit-msg "exec < /dev/tty && git cz --hook || true"
```
If successful, it will create a new file inside the .husky/prepare-commit-msg folder. You can test this by running the commit with empty message:

`git commit -am ""`

![result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pfcm55mf3i2xbmg39hd4.png)
and choose one of the options. in this case i will choose feature

next, you need to fill scope of changes.
![scope changes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ni2bfqufpcez5y141r98.png)

next, you need to fill short description about changes

![short desc](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k2dmhr72lm7oeil3hbsl.png)

and then, they provide for longer description. For this input, it's optional, you can leave it empty.

![long desc](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z6bu66ishvgfbpuc7xfv.png)

And next, they ask whether there are any breaking changes or if there will be any other open issues. If you choose 'y', they will ask for your explanation.

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

commit message on gitlab will look like this:

![sample gitlab](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2e972ui8cyxf5airiylw.png)


It appears tidy and easy to understand for documentation or your code reviewer.

**Conclusion**

> This feature is very helpful for describing what you're doing with code changes and greatly assists code reviewers.
for Linter git hooks / pre commit will posted at next article.
S3 Bucket - Attached Policy Permission
Published: 2023-08-24 10:21:53

To set S3 bucket folder permissions to public, you need to use the AWS Command Line Interface (CLI) or an SDK. Here's the general process:

Install and configure the AWS CLI: If you haven't already installed the AWS CLI and configured it with your AWS credentials, you can follow the instructions in the AWS documentation: https://aws.amazon.com/cli/

Set the bucket policy: You can create a bucket policy to grant public read access to the objects in a specific folder or prefix within the bucket. The policy will allow anyone to read the objects but not modify or delete them.

Here's an example of how you can do it using the AWS CLI:

```
aws s3api put-bucket-policy --bucket YOUR_BUCKET_NAME --policy '{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "PublicReadForFolder",
      "Effect": "Allow",
      "Principal": "*",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/FOLDER_NAME/*"
    }
  ]
}'
```

Replace YOUR_BUCKET_NAME with the name of your S3 bucket and FOLDER_NAME with the folder name or prefix for which you want to grant public read access.

Keep in mind that making objects public can expose your data to anyone on the internet. Ensure that you only grant public access to objects that are meant to be publicly accessible. Always follow security best practices and avoid making your entire bucket public unless it is necessary for your use case.