Javascript – dialog flow how to play next time it is available in Google Calendar

how are you? English is my mother tongue, so I apologize immediately.

What I have is a bot in the flow of dialogue that marks events on the agenda with some interactions.

an example:

Bot: Hello, welcome to the hairdresser. Would you like to make an appointment?

User: Yes

Bot: What's your name?

user:: Welyson

Bot: What day do you want?

User: morning

Bot: What's the time?

User: 3 pm

  • If you have space in the Google Calendar

Bot: Okay, you were scheduled for February 21 at 3 p.m.

-If you don’t have space on Google Calendar

Bot: Oops, it seems that we don't have any vacancies for this day or time check try another time.

Where I got the code from as an example

The following code does this:

 'use strict';

 const functions = require('firebase-functions');
 const {google} = require('googleapis');
 const {WebhookClient} = require('dialogflow-fulfillment');

 // Enter your calendar ID below and service account JSON below
 const calendarId = "id google agenda ";
 const serviceAccount = {json file}; // Starts with {"type": "service_account",...

 // Set up Google Calendar Service account credentials
 const serviceAccountAuth = new google.auth.JWT({
   email: serviceAccount.client_email,
   key: serviceAccount.private_key,
   scopes: 'https://www.googleapis.com/auth/calendar'
 });

 const calendar = google.calendar('v3');
 process.env.DEBUG = 'dialogflow:*'; // enables lib debugging statements

 const timeZoneOffset = '-03:00';

 exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
   const agent = new WebhookClient({ request, response });
   const appointment_nome = agent.parameters.nome;


   function makeAppointment (agent) {
     const dateTimeStart = new Date(Date.parse(agent.parameters.date.split('T')(0) + 'T' + agent.parameters.time.split('T')(1).split('-')(0) + timeZoneOffset));
     const dateTimeEnd = new Date(new Date(dateTimeStart).setHours(dateTimeStart.getHours() + 1));
     const agendamentoString = FormtData(new Date(agent.parameters.date.split('T')(0))) + " às " + agent.parameters.time.split('T')(1).split('-')(0); 

     // Check the availibility of the time, and make an appointment if there is time on the calendar
     return createCalendarEvent(dateTimeStart, dateTimeEnd, appointment_nome).then(() => {
       let mensagem = `Okay, you were scheduled for *${agendamentoString}* ✅.`;
       response.json({"fulfillmentText": mensagem});
     }).catch(() => {
        let mensagem = `Oops, it appears that we have no vacancies for that day or time, type **check** to try another time.`;
       response.json({"fulfillmentText": mensagem});
     });
   }

   let intentMap = new Map();
   //intentMap.set('Schedule Appointment', makeAppointment);  
   intentMap.set('Default Welcome Intent - yes', makeAppointment);
   agent.handleRequest(intentMap);
 });



 function createCalendarEvent (dateTimeStart, dateTimeEnd, appointment_nome) {
   return new Promise((resolve, reject) => {
     calendar.events.list({
       auth: serviceAccountAuth, // List events for time period
       calendarId: calendarId,
       timeMin: dateTimeStart.toISOString(),
       timeMax: dateTimeEnd.toISOString()
     }, (err, calendarResponse) => {
       // Check if there is a event already on the Calendar
       if (err || calendarResponse.data.items.length > 0) {
         reject(err || new Error('Requested time conflicts with another appointment'));

       } else {
         // Create event for the requested time period
         calendar.events.insert({ auth: serviceAccountAuth,
           calendarId: calendarId,
           resource: {summary:"Cliente: " +  appointment_nome, description: "Cliente: " +  appointment_nome,
             start: {dateTime: dateTimeStart},
             end: {dateTime: dateTimeEnd}}
         }, (err, event) => {
           err ? reject(err) : resolve(event);
         }
         );
       }
     });
   });
 }

 function FormtData(date){
    var nomesMes = (
        "Janeiro", "Fevereiro", "Março", 
        "Abril", "Maio", "Junho","Julho", 
        "Agosto", "Setembro", "Outubro", 
        "Novembro", "Dezembro"
    );

    var dia = date.getDate();
    var mesIndex = date.getMonth();
    var ano = date.getFullYear();

    return dia + ' ' + nomesMes(mesIndex);

 }

But the problem If my schedule is scheduled too many times, the schedule becomes tiring for the user!

I thought of something like

Bot: Do you want to plan a haircut?

User: Yes

Bot: How about February 21st at 1pm?

-If the user agrees The time is noted on the agenda:

User: Yes

Bot: Okay, you were scheduled for February 21 at 1 p.m.

-If the user disagrees he goes to the next available time:

User: No

Bot: How about February 21 at 2pm?

I tried something with the CalDAV API to read the Google calendar. I have made no progress
Does anyone have any idea how I would do it? Thanks in advance

java – LibGDX Box2D how to play an animation once and then reset the status

So I have some animations in LibGDX that I want to get going. Running animations are currently working perfectly, but attacking is not. I want the attack animation to play once and then set the status back to WALKING.

I've been experimenting with up attacks (that's why the code is different) and all it does is blink and walk again. The other three directions only show and hold the last frame of the animations. Does anyone know how to get this to work? I've looked at the similar questions, but none of them help.

This method contains a lot of code, so I apologize in advance:

private TextureRegion getFrame(float dt) {
        TextureRegion region = null;
        if (currentState == State.WALKING) {
            switch (currentDir) {
                case UP:
                    if (b2body.getLinearVelocity().x == 0 && b2body.getLinearVelocity().y == 0) {
                        stateTimer = 0;
                        region = heroWalkUp.getKeyFrame(stateTimer, false);
                        stateTimer = 1;
                    } else {
                        region = heroWalkUp.getKeyFrame(stateTimer, true);
                    }
                    break;
                case RIGHT:
                    if (b2body.getLinearVelocity().x == 0 && b2body.getLinearVelocity().y == 0) {
                        stateTimer = 0;
                        region = heroWalkRight.getKeyFrame(stateTimer, false);
                        stateTimer = 1;
                    } else {
                        region = heroWalkRight.getKeyFrame(stateTimer, true);
                    }
                    break;
                case LEFT:
                    if (b2body.getLinearVelocity().x == 0 && b2body.getLinearVelocity().y == 0) {
                        stateTimer = 0;
                        region = heroWalkLeft.getKeyFrame(stateTimer, false);
                        stateTimer = 1;
                    } else {
                        region = heroWalkLeft.getKeyFrame(stateTimer, true);
                    }
                    break;
                case DOWN:
                default:
                    if (b2body.getLinearVelocity().x == 0 && b2body.getLinearVelocity().y == 0) {
                        stateTimer = 0;
                        region = heroWalkDown.getKeyFrame(stateTimer, false);
                        stateTimer = 1;
                    } else {
                        region = heroWalkDown.getKeyFrame(stateTimer, true);
                    }
                    break;
            }
        } else if (currentState == State.ATTACKING) {
            switch (currentDir) {
                case UP:
                    region = heroAtkUp.getKeyFrame(stateTimer, true);
                    if (heroAtkUp.isAnimationFinished(stateTimer)) {
                        currentState = State.WALKING;
                    }
                    break;
                case LEFT:
                    region = heroAtkLeft.getKeyFrame(stateTimer);
                    break;
                case RIGHT:
                    region = heroAtkRight.getKeyFrame(stateTimer);
                    break;
                case DOWN:
                    region = heroAtkDown.getKeyFrame(stateTimer);
                    break;
                default:
                    region = heroWalkDown.getKeyFrame(stateTimer); //should never happen
                    break;
            }
        }

        stateTimer = currentDir == previousDir ? stateTimer + dt : 0;
        previousState = currentState;
        previousDir = currentDir;
        return region;
    }

GM techniques – How do I play masks to find out what's changing instead of figuring out what's going on?

Many Powered by the Apocalypse games make an agenda item to play with to find out what happens by discarding the notions of "This will be my bow and a certain scene will be made of it" and look at the unexpected for maximum fun and excitement to achieve.

Masks: a new generation has a particularly different phrase: "play to find out what changes", and the long description tells me many things that are more like "play to find out what happens" with a new coat of paint.

They don't know exactly what will happen in the course of the game. You don't know who the PCs will be. They don't know how they will change the city. That's why you play primarily – because you're excited to find out! MASKS is a game about change, about growing up young people, about reacting and reshaping the city in response to the people in it. Don't plan for a single course of events to come true – just plan to push and nudge the characters and setting to see what could become of them.

What is the key to understanding this agenda item and how can I best fulfill it without relying too heavily on a? Dungeon World Background (as a GM and as a player)?

Python – Play with the bug that nothing pygame appears

The goal of the game is to enter as many countries as possible on the screen (obviously without spelling mistakes). Most of the configuration and screen work is done. My part is to complete the game's validation functions. The number of points a word can type well, remove it from the screen if you have already entered it and refresh it one by one. The point is that everything I do doesn't show anything on the screen, even if I update positions and the list of countries that actually need to appear on the screen. Anyway, I leave the link to everything I've done. If you find the mistake I have, please let me see why I don't see it! Thanks in advance!

YouTube doesn't play my videos in high resolution

I uploaded some 1080 x 1920 pixels (portrait) MP4 H.264 videos to my YouTube channel, but YouTube only allows playback with a maximum resolution of 480p. How can I get them to allow playback at the original resolution?

Enter the image description here

The videos were recorded on a LG H932 Android phone with software version H93230d.

The codec info according to VLC:

Stream 0
Codec: H264 - MPEG-4 AVC (part 10) (avc1)
Language: English
Type: Video
Video resolution: 1920x1080
Buffer dimensions: 1920x1088
Frame rate: 30.011402
Decoded format: 
Orientation: Left bottom
Color primaries: ITU-R BT.601 (525 lines, 60 Hz)
Color transfer function: ITU-R BT.709
Color space: ITU-R BT.601 Range
Chroma location: Left

Stream 1
Codec: MPEG AAC Audio (mp4a)
Language: English
Type: Audio
Channels: Stereo
Sample rate: 48000 Hz
Bits per sample: 32

Based on the upload encoding settings recommended by YouTube, I tried ffmpeg to move the moov atom to the top of the file and upload it again with the following command, but it made no difference.

ffmpeg -i input_video_file.mp4 -vcodec copy -acodec copy -movflags faststart output_video_file.mp4

If it matters, I have no subscribers on my YouTube channel and the videos are set for private visibility.

Google Play Store – The pop-up prevents me from accessing my settings

Try as I could, the popup prevents me from accessing a program and especially my settings where I can force it to stop, cache, update, etc. I tried to boot the device hard as it is not good for this type of treatment. I'm finished and I'm thinking about emptying the very expensive Samsung S10

Sell ​​- yesporn.site adult tube site. Play Pornhub Video on JWplayer | Proxies-free

14k videos are imported, all videos are played on custom JW players. No visitors redirect to certain websites. By uploading, simply copying and pasting Pornhub links, all elements such as title, description, thumb, duration, tags are automatically updated. Only Pornhub and RedTube videos are played on custom websites jwplayer. see demo – yesporn.site

Google Play Services (gms) Play Store (play) honey pot?

I cannot use the game store because I am in China. (And Google ended its apps when VPN mode is detected.) I tried to install Google Play services 20.04.12 and Google Play Store 18.6.33 via apks from https://www.apkmirror.com/.

Enter image description here
According to Google Play services, it is version 18.7.19 …

Enter image description here
Play Store says it's version 18.7.18 …

Problem is after me adb install /path/to/gms/apk it says successful, but the app information says that it is not the version I installed. I did pm list packages | grep android.gmsand it records:

package:com.google.android.gms

And pm list packages | grep vending, it listed:

package:com.android.vending

Both seem to be fine. I did dumpsys package com.google.android.gms | grep versionName and dumpsys package com.android.vending | grep versionNameBoth confirmed that I was in the wrong version. Then I replaced it with apk file in /data/app directly and reboot – does not help.

Is that a honey pot? How can I replace these two apks?