error in c++ Segmentation fault (core dump)when i run the code

This the code that resulted the error
this code is writen in c++
when i run this code it write segmentation fault(core dump)
What should i do
please help me

    #include<iostream>

    using namespace std;

    int main(){

        int size,a,b,c;

        int input(100);

        cin>>size;

        for(int i=0;i<size;i++){

            cin>>input(i);

        }

        for(int i=0;i<size;i++){

            for(int j=i+1;i<size;j++){

                if (input(i)>input(j)){

                    c=input(i);

                    input(i)=input(j);

                    input(j)=c;
                }

            }

        }

        for(int i=0;i<size;i++){

            cout<<input(i);
        }

    }

segmentation error

I need to run a coin toss simulation 100 times

I need to run a coin toss simulation where I toss a coin 100 times, then run this experiment 100 times while plotting my number of Heads and Tails for each time the experiment is ran. Is there anyone that can help me design a code to conduct this experiment and present a graph of the results?

php – Run if comment date more (+ 1hour) current time

Example:

Server date and time 04.05.2021 9:00

If comment date and time 04.05.2021 9:58 – NOT run

If comment date and time 04.05.2021 10:02 – RUN

$now = current_time( 'mysql' ); 
    
    $datacomm = strtotime( get_comment_date( 'Y-m-d h:i:s', $comment ));
    $later = strtotime( date( 'Y-m-d H:i:s', strtotime( $now ) + 7200 )); //3600 seconds = 1 hour
    
    
    if( $datacomm > $later ) {
    
    // run this
    
    }

My code not work 🙁
Sorry for my English

google sheets – Trying to run two functions onEdit

I have found two scripts that work independently, but fail when combined. I get this error message (ReferenceError: myfunction2 is not defined
onEdit @ Code.gs:3). I want one field to populate the date time a record was created and another field to populate the date and time of the last edit, basically to track how long it took to close the status on that record. Obviously, I am new to this, so please use lingo I can understand 🙂 Here is my code:

function onEdit(e) {
myfunction1(e);
myfunction2(e);
}
var SHEET_NAME = ‘Sheet1’;
var DATETIME_HEADER = ‘Call Time’;

function myfunction1(e) {

function getDatetimeCol(){
var headers = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(SHEET_NAME).getDataRange().getValues().shift();
var colindex = headers.indexOf(DATETIME_HEADER);
return colindex+1;
}

var ss = SpreadsheetApp.getActiveSheet();
var cell = ss.getActiveCell();
var datecell = ss.getRange(cell.getRowIndex(), getDatetimeCol());
if (ss.getName() == SHEET_NAME && cell.getColumn() == 1 && !cell.isBlank() && datecell.isBlank()) {
datecell.setValue(new Date()).setNumberFormat(“MM/dd/yyyy hh:mm:ss A/P”);
}

function myfunction2(e) {

var range = e.range;
var spreadSheet = e.source;
var sheetName = spreadSheet.getActiveSheet().getName();
var row = range.getRow();

if(sheetName == ‘Sheet1’)
{
var new_date = new Date();
spreadSheet.getActiveSheet().getRange(row,11).setValue(new_date).setNumberFormat(“MM/dd/yyyy hh:mm:ss A/P”);
}

}

};

How do I run Snap Store? Snap Store in installed apps list has no Launch button

I am trying to install and run the Canon proprietary ScangearMP2, but no luck, so I’m trying to get it to run it from Snap, but I am unable to run Snap Store, because it has no Launch button in the Installed Apps section. How do I run Snap Store?

Run Charts off of Webform Submissions table?

I’m getting ready to hire a developer, and have an architecture question.

I’m setting up a Drupal 8 site (D9 soon) with a lot of charts. The charting software requires data in JSON format. The data types are basic — just Booleans, dates, and integers. There are no fields with multiple values.

I plan to use Webform to collect data from users, then run the charts off the Webform Submissions table. I’d like to use SQL to query the table, then use some PHP to convert to JSON.

I know Webform can export to JSON format, but think it would be easier to just query the Webform Submissions table using SQL.

I could run the charts through the Drupal DB API. But since the data just gets saved once and not updated after that, I don’t think I need the Drupal DB API, which would allow the data to be updated.

With Views, I think I’d need custom programming for granular control. SQL seems like it has tighter control of queries.

I realize I could have problems with forward compatibility if the structure of the Webform Submissions table is changed.

My questions:

— Is my analysis correct? Does the above approach seem reasonable?

— Any reasons to not run off of the Webform Submissions table? Scaling issues? Security problems?

— Advantages and disadvantages of using SQL instead of the Drupal DB API?

— Is there doc. or other discussion I should read? Alternate approaches to consider?

I run clamav and throws me: error: getcwd() failed with errno 2/No such file or directory

I compile the latest version of clamav from source.

And by executing the following command

sudo clamscan –infected –recursive /home

In the end it throws me the following error

error: getcwd() failed with errno 2/No such file or directory

error: Could not determine current working directory. Is your locale set correctly?

How can I solve that?

I’ve read that getcwd is = get the pathname of the current working directory.

I think I am missing a directory, but I don’t know what it is.

I would like to fully understand why the above happens

———– SCAN SUMMARY ———–

Known viruses: 8525167

Engine version: 0.103.2

Scanned directories: 14538

Scanned files: 388293

Infected files: 0

Data scanned: 23363.42 MB

Data read: 59186.47 MB (ratio 0.39:1)

Time: 2491.630 sec (41 m 31 s)

Start Date: 2021:05:02 13:04:16

End Date: 2021:05:02 13:45:47

error: getcwd() failed with errno 2/No such file or directory

error: Could not determine current working directory. Is your locale set correctly?

Apart from WHMCS or its alternatives, what other tools do you use to run your web hosting business?

I know most of us use WHMCS or its alternatives for billing, but what other tools do you use for inventory management, helpdesk/livechat sup… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1844675&goto=newpost

gnome – What are the steps to run Wayland on 21.04 with nVIDIA?

The settings I adapted are:

add
options nvidia_drm modeset=1
to
/etc/modprobe.d/nvidia-graphics-drivers.conf

ensure #WaylandEnable=false is commented in:
/etc/gdm3/custom.conf

comment all lines with # in:
/usr/lib/udev/rules.d/61-gdm.rules

reboot

check (output should be wayland):
echo $XDG_SESSION_TYPE

My experience with Wayland:

Matlab and VMWare Workstation Player complain about missing OpenGL hardware acceleration. But overall I am very happy with Wayland. No special tricks needed for many applications like Spotify and Matlab which previously did not scale in Xorg. With Wayland Matlab scales perfectly out of the box. Also resume from suspend to RAM now works for the first time on this laptop. Though it takes 1 minute 45 seconds from power button to lock screen. VLC full screen also works great, previously not possible in Xorg.

Waiting for nVIDA 470 series to have OpenGL hardware acceleration… https://www.phoronix.com/scan.php?page=news_item&px=NVIDIA-470-Wayland-Friendly

Up to now I only have one issue: connecting an external monitor to the HDMI connector freezes Ubuntu completely. Nothing is shown on the external monitor and power button hard reset is the only option.

Is there some configuration required for this?

private – Erro, o bot não liga e fica dando esse erro ao usar o RUN. Uso o python | visual studio code

Meu code:

import discord
from discord.ext import commands
import random

client = commands.Bot(command_prefix = "^", case_insensitive = True)

@client.event
async def on_ready():
  print('Entramos como {0.user}'  .format(client))

@client.command()
async def olá(ctx):
  await ctx.send(f'olá, como vai {ctx.author.mention}? o que está fazendo?')

@client.command()
async def creditos(ctx):
    await ctx.send('Feito por: `slay#0261`')
    await ctx.send('Um agredecimento de coração aos corretores de bugs e amigos do dev: `BerserkerWS#9666` e `arpanet_01#0093.` <3')


@client.command()
async def dado(ctx, numero):
  variavel = random.randint(1,int(numero))
  await ctx.send(f'O número que saiu no dado é {variavel}')

@client.command()
async def ping(ctx):
    latency = round(client.latency * 1000, 1)
    await ctx.send(f'Olá, meu ping é equivalente a: {latency}ms')


@client.command(description='Mutes um usuário específico.')
@commands.has_permissions(manage_messages=True)
async def mute(ctx, member: discord.Member, *,reason=None):
    guild = ctx.guild
    mutedRole = discord.utils.get(guild.roles, name='Muted')

    if not mutedRole:
        mutedRole = await guild.create_role(name='Muted')

        for channel in guild.channels:
          await channel.set_permissions(mutedRole, speak=False, send_messages=False, read_message_history=True, read_messages=False)

    await member.add_roles(mutedRole, reason=reason)
    await ctx.send (f'**Offender:**{member.mention}. __mute case__. **Motivo:** {reason}')
    await member.send(f'Você foi mutado no {guild.name}. Motivo {reason}')


@client.command(description='Unmute um usuário específico')
@commands.has_permissions(manage_messages=True)
async def unmute(ctx, member: discord.Member):
    mutedRole = discord.utils.get(ctx.guild.roles, name='Muted')

    await member.remove_roles(mutedRole)
    await ctx.send(f'Unmuted {member.mention}')
    await member.send(f'Você foi unmuted no {guild.name}')


@client.event
async def prune(message):
        await ctx.channel.purge(limit=amount)
        await message.channel.purge(limit=100)

@client.command()
@commands.has_permissions(ban_members=True)
async def ban(ctx, member: discord.Member, *,reason=None) :
     await member.ban(reason=reason)
     await ctx.send(f'**Offender:**{member}. __ban case__. **Motivo do banimento:** {reason}')

@client.command()
@commands.has_permissions(kick_members=True)
async def kick(ctx, member: discord.Member, *,reason=None) :
     await member.kick(reason=reason)
     await ctx.send(f'**Offender:**{member}. __kick case__' )


@client.command()
async def commands(ctx):
  embed = discord.Embed(
    title = 'Esta mensagem é em virtude de explicar alguns de meus comandos.',
    description = 'meus comandos aparecerão logo abaixo. Lembrando que meu prefixo é `>` sempre coloque meu prefixo antes de executar um comando.',
    colour = 11598249
  )

  embed.set_author(name='Autor', icon_url='https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQVqSDwovMLYW4SjmOqNob_wjD_D_t201LFnQ&usqp=CAU.jpeg')

  embed.set_thumbnail(url='https://eletrobrazil.com/wp-content/uploads/2020/04/spotlight.png')


  embed.set_footer(text='Commands foi atualizado pela última vez・28/04・9am')

  embed.add_field(name='Comando: `olá`', value='Resposta ao comando executado: irei enteragir com você não darei spoiler, sobre o comando a seguir  ', inline=False)
  embed.add_field(name='Comando: `dado ( número de lados do dado )`', value='irei rodar um dado com o número de lados escolhidos.', inline=True)
  embed.add_field(name='Comando: `ping`', value='Você irá ver meu ping. Mas o que é ping? Ping é um utilitário para testar a conectividade entre equipamentos.', inline=True)
  embed.add_field(name='Nome do Field', value='Ainda vou fazer', inline=True)

  await ctx.send(embed = embed)

client.run(Token)

Problema:

ImportError: cannot import name ‘PrivateChannel’ from partially initialized module ‘discord.abc’ (most likely due to a circular import) (C:UsersAppDataLocalProgramsPythonPython39libsite-packagesdiscordabc.py)
PS C:UsersOneDriveÁrea de TrabalhoStar Universe>