+ = vs push | which is better to add data to an array

Hello guys,
To summarize, I read a file with a file reading API, then cut the readable data into pieces and sent them to another function to reassemble them to avoid reading a large amount of data.
Part of the code would look like this:

var data = '';
request.on('data', (chunk) => {
    data += chunk;
}).on('end', () => {
    // do something with the data
Code (marked):

Then I discovered that someone does it like this:

var data = ();
request.on('data', (chunk) => {
Code (marked):

+ = vs push | which is better to add data to an array

PHP / JSON: how to know if JSON data is empty or not

Just a very simple mistake that I faced now. Currently, I create a table that shows data from the database (JSON). In that table, I want to verify if the data exists or not. Let's say that if the data is empty, I want to show "There is no reservation data available at this time".

The problem is that I don't know how to verify existing data. For now, if the data is empty, the table appears alone and without words "No reservation data is available at this time".

Below is my current code

    echo "
No booking data available at this moments"; }else{ echo "
"; echo "
"; echo "

All Booking

"; echo ""; echo ""; echo ""; echo ""; foreach ($json->bookingList as $row) { $status=$row->status; if($status=="Approve"){ $color="color:green"; }else if($status=="Pending"){ $color="color:blue"; }else{ $color="color:red"; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo ""; echo "
# Requester Factory Room Purpose Status Action
" . $row->bookNo. "" . $row->requestedBy. "" . $row->facID. "" . $row->roomName. "" . $row->desc. "" . $status .""; echo "View"; echo "

"; echo "
"; echo "
"; } ?>

uninstallation: how can I delete the data from "Automatic backup" to get a clean installation?

When I delete and then add an application again, the application does not begin to "clean up." Instead, "remember" things from the last time the application was installed, which I don't want.

I have tried settings > (specific app) > storage > clear data Y settings > (specific app) > storage > clear cache, but despite those actions, there are things that the application remembers. And even if I delete the application at that point, then reinstall it, remember things, so this is not a clean installation.

How can I delete the application data or delete the application data or delete the application data that is saved (and then restored) through the automatic Android backup process?

vba: SQL to Excel and then to CSV file for data loading

Before I begin, I must inform you of critical information: due to the permissions within an external database, I am DO NOT allowed to create even temporary tables in the database from which I get the data.

That said: all the code below works as expected, but I would like a review because I know there has to be a more efficient way to write both the SQL string and the script within VBA.

Steps in the process

  1. Obtain data from an SQL server (note that I only get the first 20 rows as a set of data to test, but the final result will exceed 10,000 rows of data)
  2. Excel VBA macros to capture data with the following SQL string
  3. Save file as a CSV file (This has already been completed and works, so it is not necessary to address this item.

SQL string

SELECT cfcif# AS "Customer Number",
                 cffna AS "First Name",
                 cfmna AS "Middle Name",
                    NULLIF(cflna,''),cfna1) AS "Last Name",                
                        RTRIM(LTRIM(cfpfa1))|| ' '|| RTRIM(LTRIM(cfpfa2)),''),RTRIM(LTRIM(cfna2))|| ' ' || RTRIM(LTRIM(cfna3))) AS "Street Address",
                    NULLIF(cfpfcy,''),cfcity) AS "Street City",
                    NULLIF(cfpfst,''),cfstat) AS "Street State",
                    NULLIF(LEFT(cfpfzc, 5), 0), LEFT(cfzip, 5)) AS "Street Zip",
                 RTRIM(LTRIM(cfna2))|| ' ' || RTRIM(LTRIM(cfna3)) AS "Mailing Address",
                 cfcity AS "Mailing City",
                 cfstat AS "Mailing State",
                 LEFT(cfzip, 5) AS "Mailing Zip",
                 NULLIF(cfhpho,0) AS "Home Phone",
                 NULLIF(cfbpho,0) AS "Business Phone",
                 NULLIF(cfssno,0) AS "TIN",
                    WHEN cfindi = 'Y' THEN '1'
                    WHEN cfindi = 'N' THEN '2'
                  AS "Customer Type",
                    WHEN cfdob7 = 0 THEN NULL
                    WHEN cfdob7 = 1800001 THEN NULL
                    ELSE cfdob7
                  END) AS "Date of Birth",
                 cfeml1 AS "Email Address"
    FROM bhschlp8.jhadat842.cfmast cfmast
    WHERE cfdead = 'N'
    ORDER BY cfcif#


Private Sub Workbook_Open()
End Sub

The following code is in a standard module called ConstVars

Option Explicit
Public Const BRANSONSERVER As String = "bhschlp8.jhadat842.cfmast cfmast"
Public Const CHARLOTTESERVER As String = "cncttp08.jhadat842.cfmast cfmast"
Public Const CONNECTIONERROR As Long = -2147467259
Public Const CONNECTIONSTRING As String = Redacted for public viewing

The following code resides in a standard module called CiF

Option Explicit
Sub GetData()


End Sub
Private Function getDBGrabTestRecord(arrNames)
    Dim conn As Object
    Set conn = CreateObject("ADODB.Connection")

    Dim rs As Object
    Set rs = CreateObject("ADODB.Recordset")

    Dim nm


    For Each nm In arrNames
        Dim SQL As String

        SQL = getDBGrabSQL(CStr(nm))

        On Error Resume Next
        rs.Open SQL, conn
        Dim okSQL As Boolean
        If Err.Number = 0 Then okSQL = True
        On Error GoTo 0
        If okSQL Then
            If Not rs.EOF Then
                Sheet1.Range("A2").CopyFromRecordset rs
            End If
            Exit For
        End If
    Next nm

End Function
Private Function getCIFDBGrabTestRecord(arrNames)

    Dim SQL As String

    On Error Resume Next


    SQL = getDBGrabSQL(TableName)

    rs.Open SQL, conn

    tDBGrabRecord.ErrNumber = Err.Number

    If Not (rs.BOF And rs.EOF) Then
        Sheet1.Range("A2").CopyFromRecordset rs
    End If


End Function
Private Function getDBGrabSQL(ByVal TableName As String) As String
    Dim SelectClause As String
    Dim FromClause As String
    Dim WhereClause As String
    Dim OrderClause As String
    Dim FetchClause As String

    SelectClause = GetSelectClause

    FromClause = "FROM " & TableName
    WhereClause = "WHERE cfdead = " & "'" & "N" & "'"
    OrderClause = "ORDER BY cfcif#"
    FetchClause = "FETCH FIRST 20 ROWS ONLY"

    getDBGrabSQL = SelectClause & vbNewLine & FromClause & vbNewLine & WhereClause & vbNewLine & OrderClause & vbNewLine & FetchClause

    Debug.Print getDBGrabSQL

End Function
Private Function GetSelectClause() As String
    Const Delimiter As String = vbNewLine
    Dim list As Object
    Set list = CreateObject("System.Collections.ArrayList")

    With list
        .Add "SELECT cfcif#,"
        .Add "cffna,"
        .Add "cfmna,"
        .Add "COALESCE("
        .Add "NULLIF(cflna,''),cfna1),"
        .Add "COALESCE("
        .Add "NULLIF("
        .Add "RTRIM(LTRIM(cfpfa1))|| ' '|| RTRIM(LTRIM(cfpfa2)),''),RTRIM(LTRIM(cfna2))|| ' ' || RTRIM(LTRIM(cfna3))),"
        .Add "COALESCE("
        .Add "NULLIF(cfpfcy,''),cfcity),"
        .Add "COALESCE("
        .Add "NULLIF(cfpfst,''),cfstat),"
        .Add "COALESCE("
        .Add "NULLIF(LEFT(cfpfzc, 5), 0), LEFT(cfzip, 5)),"
        .Add "RTRIM(LTRIM(cfna2))|| ' ' || RTRIM(LTRIM(cfna3)),"
        .Add "cfcity,"
        .Add "cfstat,"
        .Add "LEFT(cfzip, 5),"
        .Add "NULLIF(cfhpho,0),"
        .Add "NULLIF(cfbpho,0),"
        .Add "NULLIF(cfssno,0),"
        .Add "(CASE"
        .Add "WHEN cfindi = 'Y' THEN '1'"
        .Add "WHEN cfindi = 'N' THEN '2'"
        .Add "END),"
        .Add "(CASE"
        .Add "WHEN cfdob7 = 0 THEN NULL"
        .Add "WHEN cfdob7 = 1800001 THEN NULL"
        .Add "ELSE cfdob7"
        .Add "END),"
        .Add "cfeml1"

    End With

    GetSelectClause = Join(list.ToArray, Delimiter)

End Function

The following code resides in a standard module called Formatting (I have not yet given the names of Sheet or Cells)

Option Explicit
Public Sub AddHeaders()

    Sheet1.Range("A1") = "Customer Number"
    Sheet1.Range("B1") = "First Name"
    Sheet1.Range("C1") = "Middle Name"
    Sheet1.Range("D1") = "Last Name"
    Sheet1.Range("E1") = "Street Address"
    Sheet1.Range("F1") = "Street City"
    Sheet1.Range("G1") = "Street State"
    Sheet1.Range("H1") = "Street Zip"
    Sheet1.Range("I1") = "Mailing Address"
    Sheet1.Range("J1") = "Mailing City"
    Sheet1.Range("K1") = "Mailing State"
    Sheet1.Range("L1") = "Mailing Zip"
    Sheet1.Range("M1") = "Home Phone"
    Sheet1.Range("N1") = "Work Phone"
    Sheet1.Range("O1") = "TIN"
    Sheet1.Range("P1") = "Customer Type"
    Sheet1.Range("Q1") = "Date of Birth"
    Sheet1.Range("R1") = "Email Address"

End Sub

Graphical user interface design: shows a hierarchical data set in a digestible format

I have a set of data that uses the hierarchy and the breakdown of categories, subcategories and tags that have a value:

Category 1:
    Sub-Category 1:
        Label 1: 4
        Label 2: 3
    Sub-Category 2:
        Label 2: 2
        Label 3: 5
Category 2:
    Sub-Category 3:
        Label 1: 6
        Label 2: 2
        Label 3: 4

My goal is to design an interface that shows the breakdown of categories and gives the user the ability to see and verify any value in the hierarchy. We use the data primarily as a step for another process, therefore, the fewer clicks to see all the necessary information (the tag level), the better. It is expected that there will be between 1 and 5 rows in each nested group, but larger categories may have ~ 10 subcategories.

I currently have a table that shows each category with nested rows for the breakdown. To make it easier for the user to see the structure, I added styles when the user scrolls a group to highlight its content. This is an example with placeholder data:

Any ideas on alternative formats or ways to improve my current design?

Windows: how can I repair damaged data after a failed partition merge?

I tried to merge a deleted partition with C (the current Windows partition), using a tool called "AOMEI Partition Assistant Standard Edition 8.6",
but the power was cut in the middle of the first operation.

There were two operations that had to be completed.
1) The first if I can remember correctly was to move another partition (different from these two) to another sector (I don't know what was the reason for that).
2) the second operation was to merge the deleted partition with that of C.

so after First The operation was canceled, I started on Windows, most of my files are damaged. I can read some, but most of them are illegible.
Interestingly, some folder seems to be converted to records and has a size of 0 bytes.

One thing to keep in mind: right after the operations failed and started in my window, I could read most of my files. and the converted folder It was a normal folder. there were some files that were damaged but not as much as now

Google spreadsheets: I want to incorporate already filtered data into a new spreadsheet

I have a master spreadsheet that shows the hours worked on different projects. Then I created a new spreadsheet and used the importrange formula to link the data from the master spreadsheet to this new spreadsheet.

Now, when I filter data in the master spreadsheet, I want to see only that data filtered in the new spreadsheet.

Is it possible to refer to filtered data from one sheet to another in Google sheets?

The goal of the new sheet is to have our logo, contact information and highlighted rows, so if we need to share with customers, it will look more professional.

18.04 – What is this application that uses a lot of moble data?

Since the last two days, my data usage has increased, I don't even have anything other than normal data browsing. I installed nethogs and found that this application (/ usr / bin / freshclam) drank my data ridiculously. Can someone help me with this? What is this and how to remove it completely?

enter the description of the image here

One more thing I wonder if an application can upload my document data to your server without my permission (it would be a nightmare).

php – Does not save data from another table

I have a registration landing where you put email and province, and the data is saved in the REGISTRATION table.

All provinces are loaded in another table (called idxProv), then select your province from the dropdown and go.

The problem is when selecting the province the following error arises:

Notice: Undefined index: idxProv in
  C: xampp htdocs web site creartestdrop.php on line 48 Error:
  INSERT INTO registration (email, idxProv) VALUES ('a@a.com', '') Incorrect
  integer value: '' for column sitio_website.registro.idxProv at
  row 1

It seems that it does not identify the provinces.

This is the form in .php (I have no problem showing and selecting the provinces):



Create record:


    // Variable $count hold the result of the query
    $count = mysqli_num_rows($result);

    // If count == 1 that means the email is already on the database
    if ($count == 1) {
    echo "";
    } else {    

    If the email don't exist, the data from the form is sended to the
    database and the account is created
    $email = $_POST('email');

    $idxProv = $_POST('idxProv');

    // Query to send Email and Provincia hash to the database
    $query = "INSERT INTO registro (email, idxProv) VALUES ('$email', '$idxProv')";

    if (mysqli_query($conn, $query)) {
        echo "";     
        } else {
            echo "Error: " . $query . "
" . mysqli_error($conn); } } mysqli_close($conn); ?>