teleren/devto huggingface dataset:
Datahub offloading inventory issue due to 'contents' exceeds the size limit of 32000 characters
Tags: iot, cumulocity, inventory, offloading
Published: 2023-08-17 10:20:41

---
title: Datahub offloading inventory issue due to 'contents' exceeds the size limit of 32000 characters
published: true
date: 2023-07-31 06:40:41 UTC
tags: iot, cumulocity, inventory, offloading
canonical_url: https://tech.forums.softwareag.com/t/datahub-offloading-inventory-issue-due-to-contents-exceeds-the-size-limit-of-32000-characters/281568
---

 

_products versions - {Datahub version 10.11 and above}_

## Introduction

Datahub offloading inventory issue due to ‘contents’ exceeds the size limit of 32000 characters.  
If the collection to be offloaded has JSON attributes consisting of more than 32,000 characters, its data cannot be offloaded. One specific case where this limitation applies is Cumulocity IoT’s application builder, which stores its assets in the inventory collection when being used.  
Offloading jobs will throw the error as below.

[![image](https://global.discourse-cdn.com/techcommunity/optimized/3X/e/2/e20cf0faff5451c5462df2faa8e57c2510724fe2_2_690x105.png)](https://global.discourse-cdn.com/techcommunity/original/3X/e/2/e20cf0faff5451c5462df2faa8e57c2510724fe2.png "image")

As the datahub is using dremio to offload and query the data from datalake. This limitation is from dremio.

[![image](https://global.discourse-cdn.com/techcommunity/optimized/3X/c/f/cf5edd8d42e35824a69a4513e8248e1ce1300d94_2_690x89.png)](https://global.discourse-cdn.com/techcommunity/original/3X/c/f/cf5edd8d42e35824a69a4513e8248e1ce1300d94.png "image")

## Steps to follow

**To change the limitation at dremio end.**

1. Login to Dremio UI using administrator user

2. Go to setting support and paste limits.single\_field\_size\_bytes is support keys and click on show  
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i776l6i3h7hq0d3zk7yg.png)

3. After click on show it will display the default value as below:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t17jw6pljr5s7eki8yoo.png)

4. This value can be change as per the requirement max till 256000 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vt155ix101k99ay9ca7f.png) 

5. Once change click on the save.

## Useful links | Relevant resources

{% embed https://docs.dremio.com/current/get-started/cluster-deployments/architecture/limits/ %}

[Read full topic](https://tech.forums.softwareag.com/t/datahub-offloading-inventory-issue-due-to-contents-exceeds-the-size-limit-of-32000-characters/281568)
Postgresql Optimization- shared_buffers
Tags: postgres, apacheage
Published: 2023-07-31 05:54:30

# shared_buffers

This parameter determines how much system memory is allocated to Postgres database for data caching. 

## Advantages of a high buffer
Having higher shared_buffer value allows more data to be saved in caches and then reduce necessary disk reads. It is the simplest way to improve the performance of a Postgres database server. 
By default the `shared_buffer` value is normally set to 32MB which is pretty low for most modern hardware. On a system having more than 1 GB memory, it is good practice to allocate 25% of the total RAM, in case of a system having less than 1 GB RAM, allocate 15% out of total RAM is good.

Let us consider the effect of `cache size` in the next article.
Unlock Innovation: How to Rewire Your Brain for Out-of-the-Box Thinking
Tags: thinking, innovation, creativity, psychology
Published: 2023-07-31 05:21:32

> Challenge assumptions, disrupt routines, and stimulate creativity using the B.R.A.I.N. framework.

{% embed https://www.seeratawan.me/blog/unlock-innovation-how-to-rewire-your-brain-for-out-of-the-box-thinking/ %}
Why I Move from Pixels (px) to Relative Units (rem) in CSS
Tags: css, a11y, webdev, responsiveness
Published: 2023-07-31 05:17:22

> Switching from pixels to relative CSS units like rems improves accessibility, responsiveness, and maintenance of sites over time.

{% embed https://www.seeratawan.me/blog/why-you-should-move-from-px-to-rem-in-css/ %}
My LetsGrowMore (LGM) Virtual Internship Experience (Web Development)
Published: 2023-07-31 04:40:25


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

I am Abdul Rehman, a Computer Science from Pakistan. Today, I am happy and excited to share my experience as a **Web Development Intern** at **LetsGrowMore (LGM) Virtual Internship Program**.

_Internship Duration: 1 Month_

**Completed Tasks:**
_**1. TODO List App using HTML, CSS & JS:**_

I completed Task 1 of LetsGrowMore Internship Program. I created a fully functional To-Do List App using HTML, CSS, and JavaScript.

**Name: TODO List App**
Repo Link: [Click to View](https://github.com/AbdulRehmanGHub/LGMVIP-Web-Task1_TODO_List)
Site Link: [Click to View](https://abdulrehmanghub.github.io/LGMVIP-Web-Task1_TODO_List/)

Introduction Video: [Task Video](https://youtu.be/LoPqQzMCdT4)

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

_**2. Calculator App using HTML, CSS & JS:**_

I completed Task 2 of LetsGrowMore Internship Program. I created a fully functional Calculator App using HTML, CSS, and JavaScript.

**Name: Calculator App**
Repo Link: [Click to View](https://github.com/AbdulRehmanGHub/LGMVIP-Web-Task2_Calculator_App)
Site Link: [Click to View](https://abdulrehmanghub.github.io/LGMVIP-Web-Task2_Calculator_App/)

Introduction Video: [Task Video](https://youtu.be/wzoKgxYTPfM)

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

I learned a lot during this program. It really helped me and boosted my skills practically. I am really very grateful to LGM Team (letsgrowmore.in & letsgrowmore.in/vip) and specially Aman Kesarwani Sir for providing me with this opportunity.

In the last part of this article, I will suggest every student from a CS background go with this program if they really want to improve their skills and have some practical knowledge.

**My LinkedIn Post about LetsGrowMore Internship Program:**
Task 1: [Click to Visit](https://www.linkedin.com/feed/update/urn:li:activity:7088028450992660480/)

**Task 2:** [Click to Visit](https://www.linkedin.com/feed/update/urn:li:activity:7088030628759187456/)

**Tags:**
#Internships, #WebDevelopment, #Letsgrowmore, #Experience, #Projects
Ensure Nvidia settings on restored on reboot - PopOs 22.04
Published: 2023-07-31 04:20:59

I struggled NVidia on my Linux box for for years. On every reboot / disconnection of my Laptop, Nvidia settings would reset.  


## My Setup


2 display ports, and 1 HDMI port on my laptop = 4 displays.

The steps to have these set to specific orientations on startup are:

1) capture the current configuration from the xorg.conf file
2) write a script that writes the orientation/location/main monitor settings via nvidia-settings command line option
3) run the script at startup

# Let's begin:

## 1) Capture the current configuration
Open the nvidia GUI through your OS, or via the command-line by typing: nvidia-settings.

Next, click "X Servier Display Configuration" set the orientation and location of each display, and the main display.

## 2) Grab the X Configuration settings

A popup appears, click "Show Preview"

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



Copy the preview text into an editor.

## 3) Search for `nvidiaXineramaInfoOrder`
We will set `XineramaInfoOrder` in the script below to this value

## 4) Search for `metamodes`. We will set `CurrentMetaMode` in the script below with this value

## 5) Write the Script:
So I created a script using the above attributes and the values from the xorg preview:

    mkdir ~/bin
    cd ~/bin
    sudo nano nvidiaStartup.sh

Now paste in the command:

    nvidia-settings --assign <attributeName>="<your setting from xorg.conf"

example:

    #!/bin/bash
    nvidia-settings --assign CurrentMetaMode="DP-0: nvidia-auto-select +0+0, HDMI-0: nvidia-auto-select +0+1050, DP-1: nvidia-auto-select +1920+1080, DP-3: nvidia-auto-select +4480+1080 {rotation=right}"
    nvidia-settings --assign XineramaInfoOrder="DP-1"


## 6) Set startup applications
Next, set the permissions of the script

    sudo chmod u+x ~/bin/nvidiaStartup.sh

To access start startup settings:

    gnome-session-properties

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



gnome-session-properties

press add

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



Now it will start up each time you load your OS.

To test it simply type

    sh nvidiaStartup.sh

Hope this helps!

  [1]: https://i.stack.imgur.com/5uQEh.png
  [2]: https://i.stack.imgur.com/mD1AR.png
  [3]: https://i.stack.imgur.com/xG64e.png
  [4]: https://i.stack.imgur.com/TO1p3.png
Curso| Solidity | funciones
Tags: solidity, blockchain
Published: 2023-07-31 04:13:17

##Hola##
Continuando con el curso hoy toca funciones 

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

contract Funciones{

    function suma(uint a, uint b) external pure returns(uint){

        return a + b;

    }

    function resta(uint a, uint b) external  pure returns(uint)
    {
        return a - b;

    }
}

```


SPDX-License-Identifier: MIT: Esta es una directiva especial llamada "SPDX-License-Identifier" que se utiliza para especificar la licencia bajo la cual se distribuye el contrato inteligente. En este caso, el contrato está bajo la licencia MIT, que es una licencia de software libre muy común y permite que otros puedan utilizar, modificar y redistribuir el código con ciertas condiciones.

pragma solidity 0.8.13: Esta es otra directiva que especifica la versión del compilador de Solidity que se debe utilizar para compilar el contrato. En este caso, se está utilizando la versión 0.8.13 de Solidity.

contract Funciones: Aquí se define el contrato inteligente llamado "Funciones".

function suma(uint a, uint b) external pure returns(uint): Esta es una función llamada "suma", que toma dos parámetros de tipo uint (números enteros sin signo) y devuelve un resultado uint. La palabra clave "pure" indica que esta función no modifica el estado del contrato ni lee datos del mismo; es decir, es una función que solo realiza cálculos internos y no interactúa con el blockchain de Ethereum.

function resta(uint a, uint b) external pure returns(uint): Esta es otra función llamada "resta", que también toma dos parámetros de tipo uint y devuelve un resultado uint. Al igual que la función "suma", es una función "pure" que solo realiza cálculos internos.

Ambas funciones son declaradas como "external", lo que significa que pueden ser llamadas desde fuera del contrato (por ejemplo, desde otros contratos o desde una transacción externa a través de una interfaz de usuario).

En resumen, este contrato inteligente proporciona dos funciones, "suma" y "resta", que realizan operaciones matemáticas simples y no modifican el estado del contrat

Para poder ejecutar la funcion tenemos que pasarle los datos en este caso se pasan los parametros separados por una coma.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pbczxe0pzr3vj85h36f0.png)
ViewModels should not expose suspending functions
Tags: android, viewmodel, codequality, sonarlint
Published: 2023-07-31 03:45:36

---
title: ViewModels should not expose suspending functions
published: true
cover_image: https://s3-us-west-2.amazonaws.com/my-blogresources/IMAG1121.jpg
description: Use best practices to avoid exposing suspend functions from ViewModels
tags: android, viewModel, quality, sonarlint
series: Quality Quest
---
## Why

Sometimes the developer may add a `suspend` keyword to a function that calls another suspending function as that's the first auto-suggestion/warning provided by the IDE. 

![IDE warning](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3valpyh9vlkp5ama2fwu.png)

IDE makes it easy for the developer to auto-fix the warning by adding the `suspend` keyword to the function.

![IDE auto-suggestion](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7zsi6yscw4unrozh84sj.png)

But, this breaks the rule **Classes extending "ViewModel" should not expose suspending functions**. 

Views should not be responsible for directly triggering coroutines. Hence, ViewModel classes should prefer creating coroutines instead of exposing suspending functions to perform some piece of business logic. This approach allows for easier testing of your application, as ViewModel classes can be unit tested, whereas views require instrumentation tests.

## What to do

When you find a function in a ViewModel which breaks this rule, follow these steps to refactor it:

1. Find the need for the `suspend` keyword in the function, i.e., check if the function is calling any other suspending function
   - e.g., `listOfPlants.collectLatest` is a suspending function
2. See if you can wrap the suspending function call in a coroutine & use the appropriate scope & dispatcher
   - e.g., `viewModelScope.launch` can be used to wrap the suspending function call
3. Remove the `suspend` keyword from the function
4. Remove creating coroutines from the caller of the function if it is not needed anymore

## How to do

The example,

```kotlin
// In ViewModel
suspend fun listenForUpdates() {
    listOfPlants.collectLatest { plants ->
        plants.filter { it.isFavorite }.let { favorites ->
            // do something with favorites
        }
    }
}

// In Fragment
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
    super.onViewCreated(view, savedInstanceState)
    lifecycleScope.launchWhenStarted {
        viewModel.listenForUpdates()
    }
}
```

could be refactored to,

```kotlin
// In ViewModel
fun listenForUpdates() {
    viewModelScope.launch {
        listOfPlants.collectLatest { plants ->
            plants.filter { it.isFavorite }.let { favorites ->
                // do something with favorites
            }
        }
    }
}

// In Fragment
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
    super.onViewCreated(view, savedInstanceState)
    lifecycleScope.launchWhenStarted {
      viewModel.listenForUpdates()
    }
}
```

## References

- [Coroutines: Best practices](https://developer.android.com/kotlin/coroutines/coroutines-best-practices#viewmodel-coroutines)

---
🎤🎶 Elevate Your Sound Game: Recording and Processing Audio with Python! 🎧🔊
Tags: python, opensource, audioprocessing, github
Published: 2023-07-31 03:12:42

🎵Explore functionalities like **recording voice, applying filters, visualizing waveforms, and more**!
Check out my GitHub repo for a collection of **Python scripts** for **audio recording, playback, and processing**. 🚀 #Python #AudioProcessing 

**GitHub:** [Python/Audio Recorder](https://github.com/ThisIs-Developer/Python/tree/main/Audio%20Recorder)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3dsemu5elpa0fgwv15ou.png)
**Source Code:** [Python/Audio Recorder/record audio.ipynb](https://github.com/ThisIs-Developer/Python/blob/main/Audio%20Recorder/record%20audio.ipynb)
```
import os
import librosa
import librosa.display
import matplotlib.pyplot as plt
import warnings
import numpy as np
warnings.filterwarnings("ignore", category=RuntimeWarning)

def load_audio(file_path, duration=None, offset=0):
    audio_data, sample_rate = librosa.load(file_path, duration=duration, offset=offset)
    return audio_data, sample_rate

def plot_waveform(audio_data, sample_rate, output_path):
    plt.figure(figsize=(10, 4))
    librosa.display.waveshow(audio_data, sr=sample_rate)
    plt.title("Waveform")
    plt.xlabel("Time (seconds)")
    plt.ylabel("Amplitude")
    plt.savefig(os.path.join(output_path, "waveform.png"))
    plt.show()
    plt.close()

def plot_spectrogram(audio_data, sample_rate, output_path):
    plt.figure(figsize=(10, 4))
    spectrogram = librosa.feature.melspectrogram(y=audio_data, sr=sample_rate)
    librosa.display.specshow(librosa.power_to_db(spectrogram, ref=np.max), y_axis='mel', x_axis='time')
    plt.colorbar(format='%+2.0f dB')
    plt.title("Spectrogram")
    plt.savefig(os.path.join(output_path, "spectrogram.png"))
    plt.show()
    plt.close()

if __name__ == "__main__":
    input_file = "recorded_voice_sounddevice.wav"
    output_path = "."  # You can change this to the desired output directory

    audio_data, sample_rate = load_audio(input_file)

    # Print some information about the audio file
    print(f"Audio data shape: {audio_data.shape}")
    print(f"Sample rate: {sample_rate} Hz")

    # Plot the audio waveform and spectrogram
    plot_waveform(audio_data, sample_rate, output_path)
    plot_spectrogram(audio_data, sample_rate, output_path)

    print("Plots saved as 'waveform.png' and 'spectrogram.png' in the current directory.")
```
Harnessing Database Connectivity with Oracle C++ Call Interface (OCCI)
Published: 2023-07-31 03:08:38



## Introduction:
Welcome to the realm of seamless database connectivity with the Oracle C++ Call Interface (OCCI). In this blog, we'll embark on an exciting journey to explore the power of OCCI, a C++ API designed to interact with Oracle Database. Whether you're an experienced C++ developer or a curious newcomer, OCCI empowers you to unleash the full potential of Oracle Database right from your C++ code. Let's dive in and discover how OCCI enables us to harness the magic of database connectivity in C++.

## Getting to Know OCCI:
OCCI is Oracle's C++ Call Interface, providing a high-level, object-oriented approach to working with Oracle Database. As a C++ API, it offers a seamless way to access and manipulate data in Oracle Database, empowering us with a rich set of features and functionalities.

## Establishing a Connection:
The first step in our journey is establishing a connection to Oracle Database using OCCI. With just a few lines of C++ code, we can create a connection object, specify the database credentials, and connect to the desired database, opening the door to a world of data interaction.

## Executing SQL Statements:
OCCI makes executing SQL statements a breeze. We can prepare and execute queries, bind variables, and fetch results effortlessly, making it easy to handle data retrieval and manipulation tasks with grace and efficiency.

## Managing Transactions:
Database integrity is crucial, and OCCI equips us with powerful transaction management capabilities. With OCCI, we can initiate and manage transactions, ensuring the consistency of our data even during complex operations.

## Embracing Object-Relational Mapping (ORM):
OCCI's object-oriented approach allows us to embrace Object-Relational Mapping (ORM) techniques. We can map C++ classes to database objects, making data access feel like a natural extension of our application's logic.

## Error Handling and Diagnostics:
As in any endeavor, errors may arise. But fret not! OCCI empowers us with robust error handling and diagnostics, helping us detect and gracefully handle errors, enhancing the reliability and stability of our applications.

## Optimizing Performance:
OCCI doesn't stop at basic interactions. We can leverage advanced features like statement caching, bulk operations, and data prefetching, optimizing the performance and efficiency of our database interactions.

## Going Global with Unicode Support:
In a diverse world, supporting multiple character sets and languages is crucial. OCCI makes it easy to handle Unicode data, ensuring our applications cater seamlessly to global audiences.
Top 10 Technology Trends in 2023 and Beyond
Tags: technology, technologytrends, ai, infographics
Published: 2023-07-31 03:05:55


This comprehensive infographic discusses the transformative effects of cutting-edge [technological advancements](https://www.yondu.com/articles/top-10-technology-trends-in-2023-and-beyond/) across various industries. Through a detailed exploration of advanced technologies like Artificial Intelligence (AI) and Machine Learning, we uncover the vast possibilities of smart automation and decision-making. Moreover, it also tackles the Internet of Things (IoT) and its potential to revolutionize how businesses and society function by facilitating seamless connectivity and collaboration.


![Image description](https://www.yondu.com/wp-content/uploads/2022/08/Yondu-Infographic-Top-10-Technology-Trends-in-2023-and-Beyond.png)
Clase 2| SOLIDITY | Creación de variables
Tags: solidity, blockchain
Published: 2023-07-31 02:36:51

#Hola a todos#

Continuando con el curso de solidity vamos a ver los tipos de variables

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;


contract Variables {

    string public miNombre = "Rodrigo";
    int256 public entero = 12313123;
    int8 public otro_entero = 2;
    address public direccion = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;

}

```

En resumen, este contrato define cuatro variables públicas:

miNombre: Es una variable de tipo string (cadena de caracteres) y tiene asignado el valor "Rodrigo". Esta variable es pública, lo que significa que cualquier persona o contrato que interactúe con este contrato puede leer su valor.

entero: Es una variable de tipo int256 (entero de 256 bits) y tiene asignado el valor 12313123. Al igual que la anterior, esta variable es pública y su valor puede ser leído por cualquiera.

otro_entero: Es una variable de tipo int8 (entero de 8 bits) y tiene asignado el valor 2. También es pública y su valor es accesible por cualquier persona o contrato.

direccion: Es una variable de tipo address (dirección de Ethereum) y tiene asignado el valor 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4. Al ser pública, la dirección almacenada puede ser consultada por cualquiera.

Las variables tipo direccion sirve para tener la dirección de una cartera.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mpmy715agr19zftyfaar.png)
Como subir tu codigo en un repositorio de Github
Tags: github, git, vscode, html
Published: 2023-07-31 02:10:58

1. Crear un nuevo repositorio en Github
![new repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojzmdp135zivrxwk0qo4.png)
2. Ir a la carpeta de archivos que queremos subir y abrir git bash
![new repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ffw155uyru19h67schc.png)
3. Una vez abierto, inicializamos nuestro repositorio con el comando `git init`, causando que automaticamente nos cree una carpeta escondida llamada .git
![new repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v2hujgtdf5bxq4bmlh42.png)
4. Para confirmar todos los archivos que queremos añadir dentro de la carpeta, usamos el comando `git add .`
5. Para comprobar que nuestros archivos estan seleccionados, usamos el comando `git status`
![new repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s3a44rfqv1wjsdn2f3uo.png)
6. Para realizar el commit, usamos el comando `git commit -m` y le añades el comentario para realizar tu cambio entre comillas
![new repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y4qqknofbkok42np0lyc.png)
7. Creamos la rama principalcon el comando `git branch -m main
`
![new repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uoqg3fimioyqa64pvsdg.png)
8. Volvemos a Github y copiamos. Tambien podemos tipearlo `git remote add origin https://github.com/user/file.git`
![new repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ozcee28qrzmp1crxn3fs.png)
9. Finalmente usamos el comando `git push -u origin main`
testing for the repository layer of an entity with multiple relationships
Tags: springboot, datajpatest
Published: 2023-07-31 01:21:20

What's up friends, could you help me to solve a doubt, how would be the appropriate way to test the repository layer of an entity that has several @OneToOne relationships?

Is it necessary to inject the dependencies of the repositories corresponding to their relationships and do those operations or is there another mechanism?
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w0znyhfadu8c7qh8nfe9.png)