analytics – Order line filtering log by date and legitimate requests in Analog

Is there a way for Analog to report the number of visits per day and the number of different IP addresses that are legitimate readers? I define "legitimate" readers as hits that (1) are not robots and (2) do not generate 404 errors. In other words, I need Analog to browse my log file, ignore the IP addresses that access robots.txt and / or generate 404 errors, then count the number of unique IP addresses per day from the Linux command line. So the output would be something like:

2020-03-01 523
2020-03-02 479
2020-03-03 1,203
2020-03-04 745
...
etc.

Is there a way for Analog to do this?

terminal – Need help setting up a script to change the date and time Mac OS Catalina

hoping someone can help with that. I am trying to write a PLC terminal script in Mac OS Catalina which will disable WiFi, disable automatic date and time settings and set my mac to a date and time specific to the system. I really have no programming experience, but what I have so far is working to disable wifi and change the system date and time … but the script doesn’t not go out in the automat … it continues to run. You don't know how to get the Sudo -S command to exit once it has set the system date and time. Here is what I have so far:

networksetup -setairportpower en0 off

echo "password" | sudo -S date 0101000120

So this will disable wifi, and pass my password (can also do it via a dialog box but that's not my problem) and set the system date … then the wheel ; automaton simply turns …

  1. Any ideas how to get the terminal script to exit and go to the next command … or should I just run it and then exit the script as a rotation, which is not ideal but works also
  2. command to activate and deactivate the automatic update of the date and time of the mac system?

Thank you very much for reading and greatly appreciate any help.

javascript – Group data by date to fill a Material Angular table with span lines

I have this method which attaches the year and the year spanpan for a TD and Quarter and a quarterpan rowpan for the TD.

The year and the quarter are two columns in a table of angular materials which are calculated from an array of objects whose property of the object is a date string.

Here is a demo of the code: https://stackblitz.com/edit/angular-ynpmdk

This is my method that works well, I wanted to review if I can shorten this method, it looks very ugly. Open to suggestions.

/**
 * Gets the year/quarter span information and filters what data is to be shown in tabs
 * @param data launch data all
 * @param mode which tab we are on
 */
getGroupData(data: DATA()) {
  data.sort((a:DATA, b:DATA) =>
    !a.date ? -1
      : !b.date
        ? -1 : (new Date(a.date).getTime() - new Date(b.date).getTime())
  );
  let cYear = data(0);
  let cQuarter = data(0);
  for (let i = 0; i < data.length; i++) {
    if (data(i).date) {
      const curDate = new Date(data(i).date);
      const dateYear = new Date(cYear.date);
      const dateQuarter = new Date(cQuarter.date);

      // Get Year span and Year values
      data(i).year = curDate.getFullYear();
      cYear.year = dateYear.getFullYear();
      if (cYear.year === data(i).year) {
        cYear.yearSpan = (cYear.yearSpan || 0) + 1;
      } else {
        cYear = data(i);
        cYear.yearSpan = 1;
      }
      // Get Quarter span and Quarter values
      data(i).quarter = this.getQuarter(curDate.getMonth());
      cQuarter.quarter = this.getQuarter(dateQuarter.getMonth());
      if (cQuarter.quarter === data(i).quarter) {
        cQuarter.quarterSpan = (cQuarter.quarterSpan || 0) + 1;
      } else {
        cQuarter = data(i);
        cQuarter.quarterSpan = 1;
      }
    } else {
      cYear = cQuarter = data(i);
      cYear.yearSpan = cYear.quarterSpan = 1;
      cYear.year = cYear.quarter = 'TBD';
      if (i === data.length - 1) {
        break;
      } else {
        cYear = cQuarter = data(i + 1);
      }
    }
  }
  return data;
}

/**
 * Get the quarter info from month index
 * @param month month index
 */
private getQuarter(month: number): string {
  return `Q${Math.ceil((month + 1) / 3)}`;
}

An example of a data object looks like

{position: 1, name: 'Hydrogen', date: '2016-01-11', symbol: 'H'}

when the method is invoked, the record becomes

{
  position: 1, 
  name: 'Hydrogen', 
  date: '2016-01-11', 
  symbol: 'H', 
  year: 2016, 
  quarter: 'Q1', 
  yearSpan: 5, // The other records have 5 entries pertaining to this year
  quarterSpan: 2, // The other records have 2 entries pertaining to this quarter of this year
}

Here is a demonstration of the code: https://stackblitz.com/edit/angular-ynpmdk?file=src%2Fapp%2Ftable-basic-example.ts

8 – The date picker libraries are missing in a specific page

I'm adding the jquery date selection function using the date field in the profile editing page, it works fine.

But when I add the same datepicker jquery in the custom module, the datepicker function doesn't work.

After seeing the source of the viewing page, I found that these three libraries are included in the profile editing page where the date picker works.




But I am unable to understand why these libraries are not included in the custom form page.

SQL server – Reformatting date with pivot or unlocking

I'm having trouble converting the format of a table with the following fields:

Customer | Fiscal year | Amount of September | Amount of October | Amount of November | …

at:

Customer | Fiscal year | Month | Amount

I tried pivot and unpivot but I did not succeed.

Thank you!

android studio – How to open open and start DatePickerDialog with a specific date? (Not the current date)

I have 2 edittext, the first edittext opens a DatePickerDialog showing the current date, with the onDataSet method of the selector I can select a date in the calendar, the problem is that I need the second edittext to start "mark" with the date which was selected in the first edittext. Is it possible to do it?

I leave you a part of my code:

 /******* VARIABLES GLOBALES *****/

final Calendar myCalendar = Calendar.getInstance();

final Calendar myCalendar2 = Calendar.getInstance();

private int pYearFI, pYearFF;
private int pMonthFI, pMonthFF;
private int pDayFI, pDayFF;
private int GuardarAño, GuardarMes, GuardarDia;

String fecha_inicio_guardada;

DatePickerDialog.OnDateSetListener selector_fecha_inicio,selector_fecha_fin;

DatePickerDialog dialog_fecha_inicio, dialog_fecha_fin;

/****** dentro del onCreate() *****/

et_fecha_inicio_del_evento_nuevo_responsable = (EditText) 
findViewById(R.id.et_nuevo_responsable_fecha_inicio_evento_formulario_patrocinio_supervisor);


selector_fecha_inicio = new DatePickerDialog.OnDateSetListener() {

            @Override
            public void onDateSet(DatePicker view, int year, int month,
                              int day) {



                pYearFI = year;
                pMonthFI = month;
                pDayFI = day;


                // TODO Auto-generated method stub
                myCalendar.set(Calendar.YEAR, pYearFI);
                myCalendar.set(Calendar.MONTH,pMonthFI);
                myCalendar.set(Calendar.DAY_OF_MONTH,pDayFI);


                updateLabelFechaInicio();



            } /**** Fin del método onDataSet ****/

    }; /*********** Fin del método setOnClickListener ***********/


        dialog_fecha_inicio = new DatePickerDialog(this, selector_fecha_inicio, pYearFI,
                pMonthFI, pDayFI);


        dialog_fecha_inicio.getDatePicker().setMinDate(new Date().getTime());



        et_fecha_inicio_del_evento_nuevo_responsable.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {

                dialog_fecha_inicio.show();

            } /**** Fin del método onClick ****/


        }); /*********** Fin del método setOnClickListener ***********/



      et_fecha_fin_del_evento_nuevo_responsable = (EditText) 
      findViewById(R.id.et_nuevo_responsable_fecha_fin_evento_formulario_patrocinio);

      selector_fecha_fin = new DatePickerDialog.OnDateSetListener() {

        @Override
        public void onDateSet(DatePicker view, int year, int monthOfYear,
                              int dayOfMonth) {



            pYearFF = year;
            pMonthFF = monthOfYear;
            pDayFF = dayOfMonth;


            // TODO Auto-generated method stub
            pYearFF= myCalendar2.get(Calendar.YEAR);
            myCalendar2.set(Calendar.MONTH,pMonthFF);
            myCalendar2.set(Calendar.DAY_OF_MONTH,pDayFF);

            updateLabelFechaFin();



        } /**** Fin del método onDataSet ****/

    }; /*********** Fin del método setOnClickListener ***********/

// I PASS IT AS PARAMETERS: THE YEAR OF START_DATE, THE MONTH OF START_DATE, THE DAY OF THE FIRST DATE OF MODIFICATION BECAUSE I WANT THE DATEPICKDIALOG TO BEGIN ON THE DATE THAT I AS SELECTED USER OF DPDialog.

       dialog_fecha_fin = new DatePickerDialog(this, selector_fecha_fin, pYearFI, pMonthFI, pDayFI);

// ON THIS SELECTED DATE, YOU MUST TRANSMIT IT TO MILLISECONDS SO THAT: BY OPENING THE DatePickerDialog THE MARKER IS POSITIONED ON THE DATE YOU SELECT IN THE FIRST MODEL, AND THE DATES BEFORE THE SELECTED DATE ARE NOT DISABLED (however not even position myself on the current date, but on a very old date (year 1900))

  dialog_fecha_fin.getDatePicker().setMinDate(ConvertirFechaEnMilisegundos(pDayFI,pMonthFI,pYearFI));


        et_fecha_fin_del_evento_nuevo_responsable.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

             dialog_fecha_fin.show();



             }

        });




   /******* FUERA DEL onCreate()*******/

// WITH THIS FUNCTION, IT IS POSSIBLE TO CONVERT A DATE IN MILLISECONDS TO USE IT IN THE setMinDate METHOD (long)

    public static long ConvertirFechaEnMilisegundos(int day, int month, int year) {
    Calendar calendar = Calendar.getInstance();
    calendar.set(year, month, day);
    return calendar.getTimeInMillis();
}

// WITH THIS FUNCTION WHAT I DO IS PASSING THE DATE IN A SIMPLE FORMAT (simpleFormat) chain.

   private void updateLabelFechaInicio() {

    String myFormat = "dd/MM/yyyy"; //In which you need put here

    SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.US);

    fecha_inicio_guardada = sdf.format(myCalendar.getTime());

    et_fecha_inicio_del_evento_nuevo_responsable.setText(fecha_inicio_guardada);

} /******************** FIN DE LA FUNCIÓN updateLabelFechaInicio() *******************/

// THIS FUNCTION FULFILLS THE SAME ROLE AS THE PREVIOUS

    private void updateLabelFechaFin() {

    String myFormat = "dd/MM/yyyy"; //In which you need put here

    SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.US);

    String fecha_fin_guardada = sdf.format(myCalendar2.getTime());

    et_fecha_fin_del_evento_nuevo_responsable.setText(fecha_fin_guardada);

} /******************** FIN DE LA FUNCIÓN updateLabelFechaFin() *******************/

Calendar zoom buttons – Should they zoom from the current position or the current date?

I have a calendar and there are 3 buttons to zoom in and display either a week, a month or a year. When you click on one of them, the zoom center should it be the current date or the center of the window.

github – How to keep an old project up to date with git subtree,

I subdivide a project that started in a repository, creating sub-repositories based on specific teams. Doing git subtree push from a certain pasture everything is fine, but when I check if you hear changes to mix with the local folder, I do it using the command git subtree pull, it indicates that it cannot execute the command by giving the following final message: fatal: refusing to merge unrelated histories.

When you run the command git subtree push it informs that everything is updated, without any error, how should I proceed to keep the subtree updated with the principal and vice versa?

Below is the original typed sequence, with the third error command as if the histories were not linked:

git remote add software git:github.com/makers-vs-covid-19/opeventilator-software
git subtree push --prefix=07_software software master_original
git subtree pull --prefix=07_software software master_original

SQL Server – SQLServer Format Date to YYYYMMDD

Please your help.

I have the following table DATE_REG SqlServer.

ID | DATED
1 | 20180424020549
2 | 20180424020500
3 | 20180424080010

SELECT TRXSF.iD, TRXSF.DATE FROM [DIAGRAM]. [Dbo]. [DATE_REG] AS TRXSF;

Expected result:

ID | DATED
1 | 20180424
2 | 20180424
3 | 20180424

I have to delete the hour, minute and second.

data recovery – is it possible to go back to an earlier date on my Samsung Galaxy Tab A?

Battery exchange network

The Stack Exchange network includes 175 question and answer communities, including Stack Overflow, the largest and most reliable online community for developers who want to learn, share knowledge and develop their careers.

Visit Stack Exchange