computer networks – Calculating minimum frame size

I’m actually quite stuck on a question I have for an assignment…I’d appreciate any help with this:

Consider a CSMA/CD network with maximum cable length of 8km and where the ratio of propagation speed to bandwidth (i.e. propagation speed/bandwidth) is 10 meters per bit. What is the minimum frame size in bytes?

I know that frame size, S >= 2BL where B is bandwidth, and cable length is L but I can’t quite get it done.

command line – How to annotate each frame with timestamp from filename when using converting to video

I have a slew of images in different folders and I combine them all into 1 video file using:

ffmpeg -y -f concat  -safe 0 -i + fileList + -pix_fmt yuv420p output.mp4  : -y -f concat  -safe 0 -i + fileList + -pix_fmt yuv420p output.mp4

Where fileList would look something like this (as an example):

file ‘c:2020102416220201024160204974.1.6639d37e-ca60-44a9-b185-cf1799930941.jpg’
duration 0.5

file ‘c:2020102416220201024160205015.1.6639d37e-ca60-44a9-b185-cf1799930941.jpg’
duration 0.041

file ‘c:2020102416220201024160205076.1.6639d37e-ca60-44a9-b185-cf1799930941.jpg’
duration 0.061

file ‘c:2020102416220201024160205114.1.6639d37e-ca60-44a9-b185-cf1799930941.jpg’
duration 0.038

file ‘c:2020102416220201024160205156.1.6639d37e-ca60-44a9-b185-cf1799930941.jpg’
duration 0.042

file ‘c:2020102416220201024160205247.1.6639d37e-ca60-44a9-b185-cf1799930941.jpg’
duration 0.091

file ‘c:2020102416220201024160205287.1.6639d37e-ca60-44a9-b185-cf1799930941.jpg’
duration 0.04

file ‘c:2020102416220201024160205343.1.6639d37e-ca60-44a9-b185-cf1799930941.jpg’
duration 0.056

The timestamp is contained in the filename:


Where the format is:

2020 – year
10 – month
24 – day
16 – hour
02 – minute
05 – second
616 – milliseconds

and I would like to overlay each image with their own timestamp.

I could save each image via code add the timestamp but that would increase the processing time.

Is there a way to add an option/switch to the original command line that would do this?


python – PySide2 // Como mudar frame sem ocultar botões?

Criei uma janela com 4 frames que se alternam ao clicar nos botões correspondentes, mas ao clicar em qualquer botão, o frame muda para o correspondente mas os botões somem, onde eu errei? Podem me ajudar?

Segue o código:

from PySide2.QtWidgets import QApplication, QWidget,QPushButton, QFrame
from PySide2.QtGui import QFont
import sys
class Window(QWidget):
    def __init__(self):

        self.setStyleSheet('background-color: black')


    def define_formulario(self):

    # DEFINIÇÃO DE FONTE ----------------------------------------
        self.fonte = QFont('fontes/Montserrat-Bold.ttf')

    # BOTÕES ----------------------------------------------------

        self.btn_cadastrar = QPushButton('Cadastrar', self)
        self.btn_cadastrar.setStyleSheet('background-color: #99ff66')

        self.btn_pesquisar = QPushButton('Pesquisar', self)
        self.btn_pesquisar.setGeometry(0, 50, 170, 50)
        self.btn_pesquisar.setStyleSheet('background-color: #99ff66')

        self.btn_relatorio = QPushButton('Relatório', self)
        self.btn_relatorio.setGeometry(0, 100, 170, 50)
        self.btn_relatorio.setStyleSheet('background-color: #99ff66')

        self.btn_editar = QPushButton('Editar', self)
        self.btn_editar.setGeometry(0, 150, 170, 50)
        self.btn_editar.setStyleSheet('background-color: #99ff66')

    # FRAME CADASTRAR ---------------------------------------------

        global frm_cadastrar
        self.frm_cadastrar = QFrame(self)
        self.frm_cadastrar.setGeometry(170, 0, 630, 600)
        self.frm_cadastrar.setStyleSheet('background-color: white')

    # FRAME PESQUISAR ---------------------------------------------

        global frm_pesquisar
        self.frm_pesquisar = QFrame(self)
        self.frm_pesquisar.setGeometry(170, 0, 630, 600)
        self.frm_pesquisar.setStyleSheet('background-color: green')

    # FRAME RELATORIO ---------------------------------------------

        global frm_relatorio
        self.frm_relatorio = QFrame(self)
        self.frm_relatorio.setGeometry(170, 0, 630, 600)
        self.frm_relatorio.setStyleSheet('background-color: yellow')

    # FRAME EDITAR ------------------------------------------------

        global frm_editar
        self.frm_editar = QFrame(self)
        self.frm_editar.setGeometry(170, 0, 630, 600)
        self.frm_editar.setStyleSheet('background-color: red')

    # OCULTAÇÃO DE FRAMES -----------------------------------------

        global meus_frames
        self.meus_frames = (self.frm_cadastrar,self.btn_pesquisar,
                            self.btn_relatorio, self.btn_editar)

    def ocultar_frm(self):
        global meus_frames
        for f in self.meus_frames:
            if f.isVisible() == True:

    def frame_cadastrar(self):
        global frm_cadastrar

    def frame_pesquisar(self):
        global frm_pesquisar

    def frame_relatorio(self):
        global frm_relatorio

    def frame_editar(self):
        global frm_editar

def executa():
    myApp = QApplication.instance()
    if myApp is None:
        myApp = QApplication(sys.argv)

    window = Window()



python – How can the game graphics be stabilised when after each frame hundreds of calculations are taking place?

I am building a very basic 2D game purely using pygame library in Python 3x. The “game object” is blit(ed) onto the screen using a loop and after each pass, there are calculations taking place in the background for example, to test for collision. Now as the game get’s more complex with more features, the calculations take longer and hence the “game object” is put onto the screen once, but disappears for a split second when the calculations are taking place and appears again during the second pass, meaning it flickers. How can I tackle this problem? I cannot move ahead with more complex calculations for other features without avoiding the flickering due to more time required for the calculations.

java – ¿Hola alguien me puede auxiliar con este Frame en Netbeans?

regenerated by the Form Editor.
private void initComponents() {

buttonGroup1 = new javax.swing.ButtonGroup();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
CajaTotal = new javax.swing.JTextField();
CajaNum1 = new javax.swing.JTextField();
CajaNum2 = new javax.swing.JTextField();


jPanel1.setBackground(new java.awt.Color(255, 0, 0));

jLabel1.setFont(new java.awt.Font(“Tahoma”, 0, 18)); // NOI18N
jLabel1.setText(“SUMA DE DOS NUMEROS”);
jLabel1.setBounds(110, 20, 240, 22);

jLabel2.setFont(new java.awt.Font(“Tahoma”, 0, 18)); // NOI18N
jLabel2.setText(“Captura el segundo numero”);
jLabel2.setBounds(10, 160, 260, 22);

jLabel3.setFont(new java.awt.Font(“Tahoma”, 0, 18)); // NOI18N
jLabel3.setText(“Captura el primer numero”);
jLabel3.setBounds(10, 80, 220, 22);

jButton1.setFont(new java.awt.Font(“Tahoma”, 0, 24)); // NOI18N
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1.setBounds(50, 220, 150, 40);

CajaTotal.setFont(new java.awt.Font(“Tahoma”, 0, 24)); // NOI18N
CajaTotal.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CajaTotal.setBounds(250, 220, 100, 40);

CajaNum1.setFont(new java.awt.Font(“Tahoma”, 0, 24)); // NOI18N
CajaNum1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CajaNum1.setBounds(250, 70, 100, 40);

CajaNum2.setFont(new java.awt.Font(“Tahoma”, 0, 24)); // NOI18N
CajaNum2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CajaNum2.setBounds(250, 150, 100, 40);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 465, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 351, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))


dnd 5e – Is there an absolute rest frame in Forgotten Realms or D&D cosmology?

Frame Challenge: The rules of D&D are not a physics simulator.

This question goes beyond what the rules are concerned with, and beyond what is necessary for adjudicating the rules. If there are any edge cases that actually depend on a substantive answer to this question (there aren’t), it will be entirely up to the DM.

That said, I use a reference frame argument in this answer about casting tiny hut upside down, but the calculus employed there is largely unnecessary most of the time (it was probably unnecessary there too).

I recall reading a thread on 4chan where a DM decided that an immovable rod had a fixed position with respect to all reference frames:

A while ago I got my hands on an Immovable Rod. I placed it in the air and told it to stay. The GM asks whether i’m stading to the east or west fo the rod. I say west. The GM states that I die. The rod shot forward at the same speed the earth revolves around the sun, as the rod is stuck in a universal stillpoint and the earth moved away from under it. The rod also cut its way through a large area of woods before being ejected into space.

To directly answer the question, no. The rules do not define an absolute reference frame. A DM is obviously free to do so, but if that ruling yields results like an immovable rod cutting through the earth, that DM should probably reconsider.

lens – APS-C lenses on full frame Mirrorless bodies

Since the adapter moves the lenses further from the sensor, I’d imagine that the coverage of the lens would be larger, and that the adapter or body alters focus to compensate. Is this thinking correct?


The entire point of the EF→RF adapter is to place an EF or EF-S lens at exactly the same distance from the sensor when used with an RF mount camera as the lens is placed when used with an EF mount camera.

The adapter moves the lens away from the camera so that the lens is the same distance away from the sensor as it would be when mounted on a camera for which it is designed. The image circle at the sensor is the same size whether an EF-S lens is used with an APS-C EF mount camera or with an RF mount camera + EF→RF adapter. The EF-S lens will always converge focused light 44mm behind the flange ring.

The design registration distance (sometimes colloquially referred to as the flange focal distance) for EF-S lenses is 44mm. This is the distance from the sensor to the flange on EF mount cameras, including all FF, APS-H, and APS-C models.

EF and EF-S lenses are designed to focus the light they project 44mm behind the lens flange ring.

The design registration distance for RF cameras and lenses is 20mm. This is the distance from the sensor to the flange on all RF mount cameras.

RF lenses are designed to focus the light they project 20mm behind the lens flange ring.

The EF → RF adapter is 24mm thick. When placed on an RF mount camera it provides a flange 44mm in front of the sensor on which an EF or EF-S lens can be mounted. The light projected by the EF-S lens will then come into focus 44mm behind the lens flange, just as it would when the lens is mounted on an EF mount camera.

Your intuition is partly correct, though, in a reverse sort of way. If it were possible to mount the EF-S lens closer than 44mm from the sensor of an RF mount camera, the image circle would be smaller than it would be at 44mm behind the lens’ flange ring. Of course, in such a case if the lens were focused at infinity the sensor would be too close to the lens and the entire image would be too blurry.

To increase the image circle of an EF-S lens larger than the size it is projected onto the sensor of an EF mount camera, the lens would either need to be moved even further forward than the 24mm the EF→RF adapter provides or magnifying optical elements would need to be placed between the lens and the EF→RF adapter. It would be exactly the same as using extension rings or a teleconverter/extender on an EF mount camera, except the extension rings or teleconverter/extender would need to be placed in front of the EF→RF adapter when using an EF-S lens on an RF camera.

At least not in the way you are thinking.

With some zoom lenses the projected image circle enlarges as the lens is zoomed to longer focal lengths. If one uses such an APS-C only zoom lens on a full frame (FF) camera, at the longer focal lengths the image circle might expand enough to fill the FF sensor. Though not an APS-C lens, the Canon EF 8-15mm f/4 L Fisheye is a lens that has an expanding image circle as it is zoomed.

  • At 8mm, the entire image circle is enclosed within a FF sensor.
  • At 10mm, the image circle is large enough to cover an APS-C sensor.
  • At 12mm, the image circle is large enough to cover an (now defunct) APS-H sensor.
  • At 15mm the image circle is large enough to cover a FF sensor.

enter image description here

Any EF-S lens that zooms in this way might be used with a FF camera when zoomed to the longer part of its range of focal lengths. That’s assuming that the camera would allow one to use the camera in FF instead of “crop” mode when an EF-S lens is attached to the EF→RF adapter. When an EF-S lens is adapted to an RF camera, the camera automatically crops the image to APS-C size dimensions in the center of the sensor. I’m not sure if any of the RF mount cameras have a menu item that would allow the user to override that. The menu item that allows for cropping third party APS-C only EF mount lenses¹ may or may not allow for telling the camera to use a Canon EF-S lens in FF mode.

¹ Every third party EF mount APS-C only lens I’ve seen has a standard EF mount, rather than including the extra tab used on Canon EF-S lenses that prevent them from being mounted to Canon FF cameras. The third party APS-C lenses will mount on FF Canon EF cameras, but of course the image circle will not be large enough to cover the full 36mmx24mm sensor. Apparently there is no electronic communication from the third party lens informing the camera that it has a smaller than FF sized image circle.

lens – APS-C lenses on full frame bodies

I was wondering about the use of lenses designed for smaller sensors on full frame bodies. This originally comes up regarding a discussion of Canon EF-S lenses with adapters on full frame bodies with RF mounts and the adapter. Since the adapter moves the lenses further from the sensor, I’d imagine that the coverage of the lens would be larger, and that the adapter or body alters focus to compensate. Is this thinking correct?

c# – How can I get directly response initial dialog in chat bot developed by Microsoft bot frame work

I’m now developing chat bot that reply the question the customer asked. I want to delete the first communication line “Type some words for reply the question”. However, I can’t find the way.

Initialize the communication.

if (member.Id != turnContext.Activity.Recipient.Id)
    var reply = MessageFactory.Text("質問を続けるには何か入力してください。");
    await turnContext.SendActivityAsync(reply, cancellationToken);

Ask a customer for a question.

private async Task<DialogTurnResult> InputQuestionAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        var promptOptions = new PromptOptions { Prompt = MessageFactory.Text("ご質問を話し言葉で入力して下さい。") };
        return await stepContext.PromptAsync(nameof(TextPrompt), promptOptions, cancellationToken);

Reply the question.

private async Task<DialogTurnResult> ShowCardStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        var receivedMessage = (string)stepContext.Result;
        var userProfile = await _userProfileAccessor.GetAsync(stepContext.Context, () => new UserProfile(), cancellationToken);
        userProfile.Question = receivedMessage;
        msg = msg + sec.ToString() + ".知りたい質問がありませんnn" + third.ToString() + ".質問を変えるnn";
        var reply = MessageFactory.Text(msg);
        await stepContext.Context.SendActivityAsync(reply, cancellationToken);

        var promptOptions = new PromptOptions { Prompt = MessageFactory.Text("番号を押してください") };
        return await stepContext.PromptAsync(nameof(TextPrompt), promptOptions, cancellationToken);

image of the dialog flow

python – Como fazer operações no mesmo data frame porém com posições de elementos diferentes?

Como fazer operações no mesmo data frame porém com posições de elementos diferentes?
Esta dando esse erro: KeyError: ‘Open’

posicao = 3
for posicao in df:
if df[‘High’][posicao]>df[‘Pivot’][posicao – 1]:
df[‘Compra Pivot’][posicao] = df[‘Close’][posicao] – df[‘Pivot’][posicao – 1]
df[‘Compra Pivot’][posicao] = 0
posicao = posicao +1;