Left-linear and right-linear grammars – Computer Science Stack Exchange

My task is to find left-linear and right-linear grammars for the following languag:

L1:={w ∈ {a,b}*|w does not include the subword abaab}

My solution for right-linear:

$$text{S → bS | aA | λ}\text{A → aA | bB | λ}\text{B → aC | bS | λ}\text{C → aD | bB | λ}\text{D → bE | aA | λ} \text{E → aE | bE}$$
Could this be right? If yes, how does it look linear for left-linear?
Maybe like this:
$${S_{0}}text{→ E | D | C | B | A | S}\text{S → λ| Sb}\text{D → Ca}\text{A → Aa | Sa | Da}\text{B → Ab | Ca}$$

Could someone tell me if my solutions are right? Thank you.

c++ – Agenda Telefonica – Stack Overflow en español

estoy escribiendo una agenda telefonica en C++ usando struct. El problema es que, por alguna razon, cuando quiero ingresar los valores de los distintos campos, hay uno que se salta, y no me permite ingresarlo.

La idea es esta: Una agenda de (por ahora) 4 contactos, con campos a rellenar. Cuando lleno los campos del primer contacto esta perfecto, pero cuando toca completar los campos del segundo, se saltea el campo correspondiente al nombre y pasa derecho al apellido. Dejo el codigo abajo.

#include<iostream>
#include<string.h>
using namespace std;
struct agenda_telefonica{
    char nombre(30);
    char apellido(30);
    int prefijo;
    int telefono;
    } 
    contacto(4);
    
    int main(){
        int i;
        cout<<"ttt***Agenda Telefonica***"<<endl;
        for(i=0;i<4;i++){
            cout<<"Ingrese su nombre: ";
            cin.getline(contacto(i).nombre,30,'n');
            cout<<"ingrese su apellido: ";
            cin.getline(contacto(i).apellido,30,'n');
            cout<<"Ingrese el prefijo: ";
            cin>>contacto(i).prefijo;
            cout<<"Ingrese su telefono: ";
            cin>>contacto(i).telefono;
        }
        for(i=0;i<4;i++){
            cout<<"Contacto "<<i+1<<": "<<endl;
            cout<<contacto(i).nombre<<" "<<contacto(i).apellido<<"n";
            cout<<contacto(i).prefijo<<"-"<<contacto(i).telefono<<endl;
        }
       return 0; 
    }

Gracias por la ayuda!!!

Operating system scheduling doubt – Computer Science Stack Exchange

Consider a uniprocessor system executing three tasks T1,T2 and T3 each of which is composed of an infinite sequence of jobs (or instances) which arrive periodically at intervals of 3, 7 and 20 milliseconds, respectively. The priority of each task is the inverse of its period, and the available tasks are scheduled in order of priority, which is the highest priority task scheduled first. Each instance of T1,T2 and T3 requires an execution time of 1, 2 and 4 milliseconds, respectively. Given that all tasks initially arrive at the beginning of the 1st millisecond and task preemptions are allowed, the first instance of T3 completes its execution at the end of_____________________milliseconds.

I understand how to answer this question but I have one doubt please help,

The priority of each task is the inverse of its period, and the available tasks are scheduled in order of priority.

I’m confused with this line, Do they mean Burst time as a period or the time which Task arrive periodically.

BTW for this question it doesn’t matter what we take In the end T1 will always has higher priority but can you help me here

Ayuda ListView Flutter Json – Stack Overflow en español

soy nuevo en esto de Flutter y tengo una duda de como cargar datos de un JSON a mis ListView , hasta ahora tengo esto , es todo lo que he podido encontrar en la RED y guiandome en tutoriales y todo eso

import 'dart:convert' show jsonDecode;
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;


void main() {
  runApp(new MaterialApp(home: new HomePage()));
}

class HomePage extends StatefulWidget {
  @override
  HomePageState createState() => new HomePageState();
}

class HomePageState extends State<HomePage> {
  List userMap;

  Future<String> getData() async {
    var userResponde = await http.get(
        "https://wixitools.000webhostapp.com/hiperbarica/Ajax/Aj_Referido.php?Requerimiento=CargarDoctorReferidowebservice");

    Map<dynamic, dynamic> userMap = jsonDecode(userResponde.body);

    userMap.forEach((key, value) {
      print(value);
    });

    

    return "Success!";
  }

  void initState() {
    this.getData();
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
          title: new Text("Listviews"), backgroundColor: Colors.blue),
      body: new ListView.builder(
        itemCount: userMap == null ? 0 : userMap.length,
        itemBuilder: (BuildContext context, int index) {
          var user = userMap(index);
          return new Container(
            child: new Text('$user'),
          );
        },
      ),
    );
  }
}


y mi JSON luce asi tal cual, es un JSON hecho en GET aunque medio extraño pero si logro traer todos los values en un PRINT al momento de ejecutar a aplicacion

{
  "0": {
    "0": "1",
    "1": "DOCTOR 1",
    "id": "1",
    "datos": "DOCTOR 1"
  },
  "1": {
    "0": "2",
    "1": "DOCTOR 2",
    "id": "2",
    "datos": "DOCTOR 2"
  },
  "2": {
    "0": "6",
    "1": "DOCTOR 3",
    "id": "6",
    "datos": "DOCTOR 3"
  }
}

en el print que mando si me retorna los valores del json pero no se porque no cargan en el ListView

Screenshot App suggestion – Android Enthusiasts Stack Exchange

Can someone suggest me an app for taking screenshots that:

• Can change the storage location of screenshots to SD Card

• Won’t be an assistant

• Takes screenshot by some means apart from a floating button

• Is a no ads freeware

Thanks in advance :]

PS: This is my first post, please forgive me if I have erred anyway.

Chrome extension security – Information Security Stack Exchange

I am a newbie in crypto-assets.

I want to install a chrome extension called metamask. I do not trust this kind of software. (Maybe because i am a newbie)

What i want to do is to know what a chrome extension can do on my computer ? Is it possible for example for a chrome extension to read a local file, sniff my network interface, keylog my keyboard ?

Does chrome extension run in a sandbox (like a javascript in a webpage for example)

Thanks

In Pathfinder 1E, how do Greater Magic Fang and Amulet of Mighty Fists stack

Assuming nothing else about the animal companion, if it wears a frost amulet of mighty fists, and the companion is the subject of a greater magic fang spell so that its natural weapon gains a +3 enhancement bonus, the companion benefits from both the amulet and spell.

While the magic weapon special ability frost is priced as a +1 enhancement bonus and that +1 enhancement bonus counts toward the +10 maximum virtual enhancement bonus that a weapon can possess (“A single weapon cannot have a modified bonus (enhancement bonus plus special ability bonus equivalents, including those from character abilities and spells) higher than +10” and see here), the magic weapon in question doesn’t have any actual enhancement bonus until the greater magic fang spell, so the greater magic fang spell functions normally and completely, granting its full bonus.

Were this instead a *+1 frost amulet of mighty fists, the greater magic fang spell’s numeric enhancement bonus would overlap with the amulet‘s numeric enhancement bonus, and only the bigger enhancement bonus would apply. Further, the amulet‘s frost weapon special ability would continue to function normally in this case, too.

Understanding Clean Architecture – Software Engineering Stack Exchange

Below is my understanding of the projects involved .However my confusion comes from the difference between Application/Core/Domain . Is it also correct to say Core = Application + Domain because i have come across some projects without core?

Api

Accepts input in the form of http requests over the network (e.g., GET/POST/etc.) and returns its output as content formatted as JSON/HTML/XML, etc.

Application

Contains business logic and types. (Implements Cases)

Core

Our External Interfaces get defined here. The code in this layer is mostly pure C# – no network connections, databases, etc. allowed. Interfaces represent those dependencies, and their implementations get injected into our use cases

Infrastructure

In here, we define data entities, database access , integrations with external services. This project/layer contains the physical implementation of the interfaces defined in our core project.

Python assignment – Code Review Stack Exchange

Given the weight of a letter in grams, determine the cost of the postage:
•up to 30g: 60¢
•up to 50g: 90¢
•up to 100g: $1.15
•30¢ for each 50g (or less) after that.
e.g. if the weight is 225 grams, you need to pay $2.05 ($1.15 + 30c + 30c + 30c)

so far I have this but I can’t figure out the last case.

weight=float(input("Enter the weight of the letter in grams "))
if weight<=30:
  print("The cost is $0.60")
elif weight<=50:
  print("The cost is $0.90")
elif weight<=100:
  print("The cost is $1.15")
elif weight>100: