text:
Q: Replacing an Observable Array with AJAX In our application we have a series of select filters that must be populated dynamically based on the context of the situation. On first load, the default options are inserted into the array via AJAX and it appears on the UI as expected. However, when the select list refreshes, the UI does not reflect the changes even though if you inspect the code the array appears to contain the new values.
I have written the same code for two filters but for some strange reason it only works in one of the situations, I have tried the following to resolve this to no avail:

*

*Populating the array manually using arbitrary data

*Forcing knockout to update with array.valueHasMutated()

*Using the two different types of array clearing functions array.removeAll and array([])

*Using push.apply and push

*Saving the result to a variable and then assigning that to the array

*Making the values inside the array observable

This first instance of the code works as expected when the options change:
     success: function (data) {
                      self.filtersModel.values2.removeAll();

                      var serverData = $.map(data, function (value, i) {
                               return new SelectBoxOption(value.Description, value.Id);
                      });

                      serverData.forEach(function (value) {
                               self.filtersModel.values2.push(value);
                      });
             }

This is the second function that does NOT work:
     success: function (data) {
                      self.filtersModel.values.removeAll();

                      var other;

                      var serverData = $.map(data, function (value, i) {
                               // If the option is "other" save it as a variable and add to array later
                               if (value.Code === "OTHR") {
                                        other = new SelectBoxOption(value.Description, value.Id);
                                        self.filtersModel.othersValue(value);
                               }
                               else if (value.Code == "EQTY") {
                                        var equity = new SelectBoxOption(value.Description, value.Id);
                                        self.filtersModel.equityValue(value);
                                        return equity;
                               }
                               else
                                        return new SelectBoxOption(value.Description, value.Id);
                      });

                      serverData.forEach(function (value) {
                               self.filtersModel.values.push(value);
                      });

                      // Add "other" option to bottom of the array
                      if (other)
                               self.filtersModel.values.push(other);
             }

Any help would be greatly appreciated.
UPDATE
HTML to populate the select list occurs like this:

    Value
    <select id="value" class="form-control" data-bind="value: selectedValue, options: values, optionsCaption: '-- ' + 'Select Value' + ' --', optionsValue: 'optionId', optionsText:  'optionName'"></select>

    Value 2
    <select id="value2" class="form-control" data-bind="enable: $parent.valueIsAuthorisedAndvalueIsEquityOrOther, value: selectedValue2, options: values2, optionsCaption: '-- ' + 'Select Value 2' + ' --', optionsValue: 'optionId', optionsText:  'optionName'"></select>

Example data is returned in this format:
data = [
    {optionId: 1, optionName: "Value 1"},
    {optionId: 2, optionName: "Value 2"},
    {optionId: 3, optionName: "Value 3"},
    {optionId: 4, optionName: "Value 4"}
];

A: If I understand your question, the second code doesn't work because your are updating the self.filtersModel.othersValue and self.filtersModel.equityValue in every iteration.
I rewrote your code, hope it helps:
self.filtersModel.values.removeAll();

var normals = [];
var others = [];
var equities = [];

ko.utils.arrayForEach(data, function (d) {
   if (d.Code === 'OTHR')
      others.push(new SelectBoxOption(d.Description, d.Id);
  else if (d.Code === 'EQTY')
      equities.push(new SelectBoxOption(d.Description, d.Id);
  else
      normals.push(new SelectBoxOption(d.Description, d.Id);
});

self.filtersModel.values(normals.concat(equities).concat(others));

A: After much deliberation, I found that the issue was not related to the ajax function at all but rather a buggy method call I defined before the changing the select list:
self.clearFilters = function() {
    self.filtersModel = new createFiltersModel();
}

function createFiltersModel() {
    return {
        values: ko.observableArray([])
    }
};

This created a new instance of the filtersModel every time the select list changed, so any changes to the model were lost when the ajax call was made. Doh!


text:
Q: Upload File with extra parameters to AWS S3 using iOS Swift Just like on a regular HTTP POST request. we can add unlimited parameters as form data. How about when uploading using the iOS AWS S3 SDK?
My iOS function
let uploadRequest            = AWSS3TransferManagerUploadRequest();
uploadRequest?.body          = NSURL(string: "file://\(path)") as URL!;
uploadRequest?.key           = "file_name";
uploadRequest?.bucket        = aws_s3_bucket_path;
uploadRequest?.contentType   = "image/" + file_extension;

Is there any way I can add more parameters to send to my Lambda Function?

A: You can add extra parameters as metaData to you request.
let uploadRequest            = AWSS3TransferManagerUploadRequest();
uploadRequest?.body          = NSURL(string: "file://\(path)") as URL!;
uploadRequest?.key           = "file_name";
uploadRequest?.bucket        = aws_s3_bucket_path;
uploadRequest?.contentType   = "image/" + file_extension;
uploadRequest?.metadata      = ["PhotoTitle" : " testName", "PhotoCaption" : "TestCaption", "UserName" : "TestName", "UserAge" : "TestAge"]

Thanks:)

redpajama_set_name: RedPajamaStackExchange


text:
Q: What is the purpose of this JavaScript? I was playing around with a Python-based HTML parser and parsed Stackoverflow. The parser puked on a line with
HTMLParser.HTMLParseError: bad end tag: "</'+'scr'+'ipt>", at line 649, column 29

The error points to the following lines of javascript in the site's source:
<script type="text/javascript">
    document.write('<s'+'cript lang' + 'uage="jav' + 'ascript" src=" [...] ">');
    document.write('</'+'scr'+'ipt>');
</script>

([...] replace a long link, which is removed for simplicity)
Out of curiosity, is there a specific reason for what looks to me like artificial 'obfuscation' of the code, i.e. why use the document.write method to concatenate all the chopped up strings?

A: I think it's to fight adblockers.
... + 'uage="jav' + 'ascript" src="http://ads.stackoverflow.com

A: It has been written in that way to avoid the browser thinks it's the closing tag for <script>, which would cause some problems.

A: When the HTML parser encounters document.write('</script>');, it thinks it has found the end of the enclosing <script> tag. Breaking the tag up stops the parser from recognising the closing tag.
The other way I've seen this achieved is by escaping the slash, i.e. document.write('<\/script>');.
The correct way to do this is either:

*

*Enclose the body of the script in a <![CDATA[ ... ]]> block (if serving XHTML), or

*Put the script in an external file, or

*Use the DOM API instead (i.e. create a script node and append that to the document head)

A: Perhaps its there to stop programs that search specifically for script tags.  Ad blockers, for example, look for script tags and object tags.


text:
Q: init.h not installed So, I am trying to build a simple kernel module in manjaro. The following is the code
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>

static int __init helloWorldInit(void)
{
    pr_info("Hello World!\n");
    return 0;
}

static void __exit helloWorldExit(void)
{
    pr_info("Removed kernel module successfully");
}

module_init(helloWorldInit);
module_exit(helloWorldExit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("author");
MODULE_DESCRIPTION("Test kernel module");
MODULE_VERSION("2:1.0");

and here is the makefile
obj-m += helloWorld.o
KDIR = /lib/modules/$(shell uname -r)/build
all:
    make -C $(KDIR) M=$(shell pwd) modules
clean:
    make -C $(KDIR) M=$(shell pwd) clean

The problem is that even though I have installed the linux header file package (linux515-headers), init.h is not available among the header files. What should I do?


text:
Q: Want to generate dynamic control with complete styling Hi I want to have add more button on my page which can replicate the existing form as many times as i want as i click add more button just like what linkedin is doing for education and experience section.
I want dynamic controls with complete styling

Educational information

                    @Html.EditorFor(model => model.educations.Degree_Title, new { htmlAttributes = new { placeholder = "Enter Degree Title ", @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.educations.Degree_Title, "", new { @class = "text-danger" })

                    @Html.EditorFor(model => model.educations.School, new { htmlAttributes = new { placeholder = "Enter School Name", @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.educations.School, "", new { @class = "text-danger" })

                    @Html.EditorFor(model => model.educations.Field_of_study, new { htmlAttributes = new { placeholder = "Enter Field of Study", @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.educations.Field_of_study, "", new { @class = "text-danger" })

                    @Html.EditorFor(model => model.educations.Description, new { htmlAttributes = new { placeholder = "Enter Course/Degree Detail", @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.educations.Description, "", new { @class = "text-danger" })

                    @Html.DropDownListFor(model=>model.educations.Grade, new List<SelectListItem>
  {
      new SelectListItem{ Text="Select Grade", Value = "1" },
      new SelectListItem{ Text="A", Value = "2" },
      new SelectListItem{ Text="B", Value = "3" },
           new SelectListItem{ Text="C", Value = "4" },
                new SelectListItem{ Text="D", Value = "5" },
                     new SelectListItem{ Text="E", Value = "6" },

   }, new { @class = "btn form-text" })
                    @Html.ValidationMessageFor(model => model.educations.Grade, "", new { @class = "text-danger" })

                        @Html.EditorFor(model => model.educations.Start_Year, new { htmlAttributes = new { placeholder = "Enter Start Date", @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.educations.Start_Year, "", new { @class = "text-danger" })

                        @Html.EditorFor(model => model.educations.End_Year, new { htmlAttributes = new { placeholder = "Enter End Date", @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.educations.End_Year, "", new { @class = "text-danger" })

                        Active
                        @Html.CheckBoxFor(m => m.educations.isFinalDegree, new { id = "switch17", name = "switch17", @class = "css-checkbox9 all_check" })

it should generate the above complete code as many times as i click the button


text:
Q: Services Health Check on k8s-Sync Node How to configure the health check for the service that is automatically registered using the Consul sync Catalog.?

A: The health checks Kubernetes performs are called "probes". There are three types of probes - liveness, readiness, and startup - and they are checks on the application/process running in a Container, not the Kubernetes Service(s) in front of the application's Pods. (One Pod can have one or more Containers; usually, as a best practice, a single application/process runs in a given Container)
Automatically syncing Kubernetes Services to Consul has no bearing on the probes executed against Containers running in Pods on the same Kubernetes cluster.
Kubernetes wouldn't check the health of Consul services synced to Kubernetes.
The answer to the question

How to configure the health check for the service that is
  automatically registered using the Consul sync Catalog.?

is "It is not possible to configure Kubernetes probes for the Kubernetes Services synced with Consul or for Consul Services synced with Kubernetes. Kubernetes probes are configured for the application/process running in Container that is in a Kubernetes Pod".


text:
Q: Why I can reference to table being modified in SQL query I am quite new to SQL, and I have a question about some basics:
As I understand while reading Gruber book, it is impossible to use table being modified now in "FROM" sentence as well as in subquery.
So, I have a table:
snum |sname  |city     |comm
----------------------------
1001 |Peel   |London   |0.12
1002 |Serres |San Jose |0.13
1003 |Axelrod|New York |0.1
1004 |Motika |London   |0.11
1007 |Rifkin |Barcelona|0.15
1100 |Bianco |San Jose |0.14

And a query:
INSERT INTO SalespeopleCopy(sname, city, comm)
SELECT sname, city, comm FROM SalespeopleCopy seconddata
WHERE seconddata.city >= (Select MAX(city) from SalespeopleCopy);

Table has changed after executing it:
snum |sname  |city     |comm
----------------------------
1001 |Peel   |London   |0.12
1002 |Serres |San Jose |0.13
1003 |Axelrod|New York |0.1
1004 |Motika |London   |0.11
1007 |Rifkin |Barcelona|0.15
1100 |Bianco |San Jose |0.14
1102 |Serres |San Jose |0.13 (new row)
1100 |Bianco |San Jose |0.14 (new row)

In the third row I reference to SalespeopleCopy table which is in "FROM" sentence. And SalespeopleCopy is being modified at the same time.
Is it a feature of SQLite(3) database? Or I don't understand the basics correctly?
About book i am reading
There is a table named "SJpeople"
We want to insert some rows to it. And we wand to check is a current row already exists in SJpeople table before inserting it.
quote:
"It would be better if you could somehow find out that these values were already inserted into the table, before you try to do it again, by adding another subquery (using operators like EXISTS, IN, <> ALL, and so on) to the predicate.
Unfortunately, in order to do this work, you will need to refer to the SJpeople table itself in the FROM clause of this new subquery, and, as we said earlier, you cannot refer to the table that is involved (in its entirety) in any subquery of the modification command."

A: I guess the query you executed is:
INSERT INTO SalespeopleCopy(snum, sname, city, comm)
SELECT snum, sname, city, comm FROM SalespeopleCopy seconddata
WHERE seconddata.city >= (Select MAX(city) from SalespeopleCopy);

including the snum column, in't it?
by:
Select MAX(city) from SalespeopleCopy

you get:
San Jose

So by:
SELECT snum, sname, city, comm FROM SalespeopleCopy seconddata
WHERE seconddata.city >= (Select MAX(city) from SalespeopleCopy)

you get 2 rows:
1102 |Serres |San Jose |0.13
1100 |Bianco |San Jose |0.14

and these 2 rows are inserted to the table.
In the statement of your query, you reference the name of the table SalespeopleCopy 3 times.
The 2nd reference is aliased to seconddata:
FROM SalespeopleCopy seconddata

you could also write it:
FROM SalespeopleCopy AS seconddata

so the table's name from which you want to SELECT rows will be from now on seconddata
although it is the same table and so in the WHERE part:
WHERE seconddata.city >= ....

there is no confusion to which table's city you are referring to:

*

*the city column of the table where the rows are inserted to or

*the city column of the table where the rows are selected from

This is not a feature of SQLite only, it is standard SQL


text:
Q: NameError: name 'unicode' is not defined when compile with python3 I am trying to compiled caffe with python3. After the compilation when I am trying to import caffe I am getting follwing error
In [1]: import caffe
Failed to include caffe_pb2, things might go wrong!
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-1cca3aa1f8c5> in <module>()
----> 1 import caffe

/library_install_dir/caffe/python/caffe/__init__.py in <module>()
      1 from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver
      2 from ._caffe import set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver, layer_type_list
----> 3 from .proto.caffe_pb2 import TRAIN, TEST
      4 from .classifier import Classifier
      5 from .detector import Detector

/library_install_dir/caffe/python/caffe/proto/caffe_pb2.py in <module>()
    975       name='type', full_name='caffe.FillerParameter.type', index=0,
    976       number=1, type=9, cpp_type=9, label=1,
--> 977       has_default_value=True, default_value=unicode("constant", "utf-8"),
    978       message_type=None, enum_type=None, containing_type=None,
    979       is_extension=False, extension_scope=None,

NameError: name 'unicode' is not defined

*

*The issue is Python 3 renamed the unicode type to str, the old str type has been replaced by bytes.

I tried to modify the proto/caffe_pb2 but it is not working.
Anyone having similar issue with caffe. I have a working caffe with python3 support in my bare metal Now I am trying to dockerize it.
Thanks in advance.

A: I had the same problem. unicode is for Python2. After make pycaffe command you can check /opt/caffe-1.0/python/caffe/proto/caffe_pb2.py file and if there is any unicode in the file the problem still exists. You can delete caffe_pb2.py and run make pycaffe again.
The solution is installing appropriate versions of protoc and protobuf.
A) install protoc >= 2.6.1
(protoc == 2.5.0 not working)
https://cuongba.com/protocol-buffers-and-rabbitmq-on-ubuntu-14-04-part-1
wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
tar -xzvf protobuf-2.6.1.tar.gz
cd protobuf-2.6.1
sudo ./configure
make
make check
sudo make install
sudo ldconfig
protoc --version

B) install protobuf>=3.4.0
pip3 install protobuf>=3.4.0

A: In Python 3, Str is Unicode by default,
so, in the line 977, please replace unicode function with str function
--> 977       has_default_value=True, default_value=Str("constant", "utf-8"),  ## Replace with Str

Hope this helps!!


text:
Q: Arch partition detected but not added to boot menu I have a triple-boot system with Windows, Ubuntu and Arch Linux. I have successfully dual-booted Ubuntu and Windows, and I have set up an installation of the arch in another partition, but I am not able to get a boot entry for Arch from the boot menu. I have run:
$ sudo update-grub

And the command outputs "Found Arch Linux on /dev/sda7", but no entry is added to the menu nor the /boot/grub/grub.cfg
Please advise. I am trying to add the Arch entry to the Ubuntu menu since I have been a long time user of Ubuntu, but I am a newbie to Arch.
Below is the results generated by boot-info-script:
                      Boot Info Script 0.76      [13 April 2017]

    ============================= Boot Info Summary: ===============================

 => Windows 7/8/2012 is installed in the MBR of /dev/sda.
 => Windows 7/8/2012 is installed in the MBR of /dev/sdb.
 => No known boot loader is installed in the MBR of /dev/sdc.

sda1: __________________________________________________________________________

    File system:       NTFS
    Boot sector type:  Windows 8/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:
    Boot files:

sda2: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  Windows 8/2012: FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:
    Boot files:        /efi/Boot/bootx64.efi /efi/Boot/fbx64.efi
                       /efi/ubuntu/fwupx64.efi /efi/ubuntu/grubx64.efi
                       /efi/ubuntu/mmx64.efi /efi/ubuntu/shimx64.efi
                       /efi/Microsoft/Boot/bootmgfw.efi
                       /efi/Microsoft/Boot/bootmgr.efi
                       /efi/Microsoft/Boot/memtest.efi

sda3: __________________________________________________________________________

    File system:
    Boot sector type:  -
    Boot sector info:
    Mounting failed:   mount: /tmp/BootInfo-Tds9bPFc/sda3: unknown filesystem type ''.

sda4: __________________________________________________________________________

    File system:       NTFS
    Boot sector type:  Windows 8/2012: NTFS
    Boot sector info:  According to the info in the boot sector, sda4 has
                       803742856 sectors, but according to the info from
                       fdisk, it has 803743743 sectors.
    Operating System:
    Boot files:        /Windows/System32/winload.exe

sda5: __________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info:

sda6: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:
    Operating System:  Ubuntu 18.04.3 LTS
    Boot files:        /boot/grub/grub.cfg /etc/fstab

sda7: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:
    Operating System:  Arch Linux
    Boot files:        /etc/fstab

sdb1: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:
    Operating System:
    Boot files:

sdc1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  Windows 8/2012: FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:
    Boot files:        /syslinux.cfg /efi/boot/bootx64.efi
                       /efi/boot/HashTool.efi /efi/boot/loader.efi

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________
Disk /dev/sda: 477 GiB, 512110190592 bytes, 1000215216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1                   1 1,000,215,215 1,000,215,215  ee GPT

GUID Partition Table detected.

Partition  Attrs   Start Sector    End Sector  # of Sectors System
/dev/sda1      R          2,048       923,647       921,600 Windows Recovery Environment (Windows)
/dev/sda2               923,648     1,126,399       202,752 EFI System partition
/dev/sda3             1,126,400     1,159,167        32,768 Microsoft Reserved Partition (Windows)
/dev/sda4             1,159,168   804,902,911   803,743,744 Data partition (Windows/Linux)
/dev/sda5           804,902,912   867,403,775    62,500,864 Swap partition (Linux)
/dev/sda6           867,403,776   929,904,639    62,500,864 Data partition (Linux)
/dev/sda7           929,904,640 1,000,214,527    70,309,888 Data partition (Linux)

Attributes: R=Required, N=No Block IO, B=Legacy BIOS Bootable, +=More bits set

Drive: sdb _____________________________________________________________________
Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdb1                   1 1,953,525,167 1,953,525,167  ee GPT

GUID Partition Table detected.

Partition  Attrs   Start Sector    End Sector  # of Sectors System
/dev/sdb1                 2,048 1,953,523,711 1,953,521,664 Data partition (Linux)

Attributes: R=Required, N=No Block IO, B=Legacy BIOS Bootable, +=More bits set

Drive: sdc _____________________________________________________________________
Disk /dev/sdc: 14.7 GiB, 15728640000 bytes, 30720000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdc1                   1 4,294,967,295 4,294,967,295  ee GPT

/dev/sdc1 ends after the last sector of /dev/sdc

GUID Partition Table detected.

Partition  Attrs   Start Sector    End Sector  # of Sectors System
/dev/sdc1                 2,048    30,719,966    30,717,919 Data partition (Windows/Linux)

Attributes: R=Required, N=No Block IO, B=Legacy BIOS Bootable, +=More bits set

"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/loop0                                              squashfs
/dev/loop1                                              squashfs
/dev/loop10                                             squashfs
/dev/loop11                                             squashfs
/dev/loop12                                             squashfs
/dev/loop13                                             squashfs
/dev/loop14                                             squashfs
/dev/loop15                                             squashfs
/dev/loop2                                              squashfs
/dev/loop3                                              squashfs
/dev/loop4                                              squashfs
/dev/loop5                                              squashfs
/dev/loop6                                              squashfs
/dev/loop7                                              squashfs
/dev/loop8                                              squashfs
/dev/loop9                                              squashfs
/dev/sda1        2C4AF6E54AF6AAAA                       ntfs       Recovery
/dev/sda2        18F7-3E33                              vfat
/dev/sda3
/dev/sda4        CE13000512FFEFF7                       ntfs
/dev/sda5        d233d512-fbba-44f9-aff6-046b6703df19   swap
/dev/sda6        b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5   ext4
/dev/sda7        feaa6bde-b426-4d73-a279-5daf052173ba   ext4       Arch
/dev/sdb1        5d00895e-ac24-4e73-864c-a52829b2c35f   ext4
/dev/sdc1        AC98-19EC                              vfat       ARCH_202001

========================= "ls -l /dev/disk/by-id" output: ======================

total 0
lrwxrwxrwx 1 root root  9 Jan 29 23:53 ata-ADATA_SU760_2J4520138012 -> ../../sda
lrwxrwxrwx 1 root root 10 Jan 29 23:53 ata-ADATA_SU760_2J4520138012-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jan 29 23:53 ata-ADATA_SU760_2J4520138012-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jan 29 23:53 ata-ADATA_SU760_2J4520138012-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Jan 29 23:53 ata-ADATA_SU760_2J4520138012-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Jan 29 23:53 ata-ADATA_SU760_2J4520138012-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Jan 29 23:53 ata-ADATA_SU760_2J4520138012-part6 -> ../../sda6
lrwxrwxrwx 1 root root 10 Jan 29 23:53 ata-ADATA_SU760_2J4520138012-part7 -> ../../sda7
lrwxrwxrwx 1 root root  9 Jan 29 23:53 ata-Samsung_SSD_860_EVO_1TB_S5JANE0MB04353M -> ../../sdb
lrwxrwxrwx 1 root root 10 Jan 29 23:53 ata-Samsung_SSD_860_EVO_1TB_S5JANE0MB04353M-part1 -> ../../sdb1
lrwxrwxrwx 1 root root  9 Jan 29 23:53 usb-SMI_USB_DISK-0:0 -> ../../sdc
lrwxrwxrwx 1 root root 10 Jan 29 23:53 usb-SMI_USB_DISK-0:0-part1 -> ../../sdc1
lrwxrwxrwx 1 root root  9 Jan 29 23:53 wwn-0x5002538e09b98170 -> ../../sdb
lrwxrwxrwx 1 root root 10 Jan 29 23:53 wwn-0x5002538e09b98170-part1 -> ../../sdb1
lrwxrwxrwx 1 root root  9 Jan 29 23:53 wwn-0x5707c18100872624 -> ../../sda
lrwxrwxrwx 1 root root 10 Jan 29 23:53 wwn-0x5707c18100872624-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jan 29 23:53 wwn-0x5707c18100872624-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jan 29 23:53 wwn-0x5707c18100872624-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Jan 29 23:53 wwn-0x5707c18100872624-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Jan 29 23:53 wwn-0x5707c18100872624-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Jan 29 23:53 wwn-0x5707c18100872624-part6 -> ../../sda6
lrwxrwxrwx 1 root root 10 Jan 29 23:53 wwn-0x5707c18100872624-part7 -> ../../sda7

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/sda2        /boot/efi                vfat       (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sda6        /                        ext4       (rw,relatime,errors=remount-ro)
/dev/sdb1        /home                    ext4       (rw,relatime)
/dev/sdc1        /media/pipemon/ARCH_202001 vfat       (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)

=========================== sda6/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt6'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6  b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
else
  search --no-floppy --fs-uuid --set=root b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=hidden
    set timeout=10
  # Fallback hidden-timeout code in case the timeout_style feature is
  # unavailable.
  elif sleep --interruptible 10 ; then
    set timeout=0
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30,0; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
    set gfxpayload="${1}"
    if [ "${1}" = "keep" ]; then
        set vt_handoff=vt.handoff=1
    else
        set vt_handoff=
    fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5' {
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt6'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6  b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
    else
      search --no-floppy --fs-uuid --set=root b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
    fi
        linux   /boot/vmlinuz-5.3.0-28-generic root=UUID=b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5 ro  quiet splash $vt_handoff
    initrd  /boot/initrd.img-5.3.0-28-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5' {
    menuentry 'Ubuntu, with Linux 5.3.0-28-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.3.0-28-generic-advanced-b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt6'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6  b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
        else
          search --no-floppy --fs-uuid --set=root b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
        fi
        echo    'Loading Linux 5.3.0-28-generic ...'
            linux   /boot/vmlinuz-5.3.0-28-generic root=UUID=b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.3.0-28-generic
    }
    menuentry 'Ubuntu, with Linux 5.3.0-28-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.3.0-28-generic-recovery-b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt6'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6  b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
        else
          search --no-floppy --fs-uuid --set=root b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
        fi
        echo    'Loading Linux 5.3.0-28-generic ...'
            linux   /boot/vmlinuz-5.3.0-28-generic root=UUID=b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5 ro recovery nomodeset
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.3.0-28-generic
    }
    menuentry 'Ubuntu, with Linux 5.3.0-26-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.3.0-26-generic-advanced-b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt6'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6  b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
        else
          search --no-floppy --fs-uuid --set=root b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
        fi
        echo    'Loading Linux 5.3.0-26-generic ...'
            linux   /boot/vmlinuz-5.3.0-26-generic root=UUID=b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.3.0-26-generic
    }
    menuentry 'Ubuntu, with Linux 5.3.0-26-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.3.0-26-generic-recovery-b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt6'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6  b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
        else
          search --no-floppy --fs-uuid --set=root b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
        fi
        echo    'Loading Linux 5.3.0-26-generic ...'
            linux   /boot/vmlinuz-5.3.0-26-generic root=UUID=b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5 ro recovery nomodeset
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.3.0-26-generic
    }
    menuentry 'Ubuntu, with Linux 5.0.0-23-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.0.0-23-generic-advanced-b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt6'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6  b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
        else
          search --no-floppy --fs-uuid --set=root b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
        fi
        echo    'Loading Linux 5.0.0-23-generic ...'
            linux   /boot/vmlinuz-5.0.0-23-generic root=UUID=b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.0.0-23-generic
    }
    menuentry 'Ubuntu, with Linux 5.0.0-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.0.0-23-generic-recovery-b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt6'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6  b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
        else
          search --no-floppy --fs-uuid --set=root b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5
        fi
        echo    'Loading Linux 5.0.0-23-generic ...'
            linux   /boot/vmlinuz-5.0.0-23-generic root=UUID=b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5 ro recovery nomodeset
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.0.0-23-generic
    }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-efi-18F7-3E33' {
    insmod part_gpt
    insmod fat
    set root='hd0,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  18F7-3E33
    else
      search --no-floppy --fs-uuid --set=root 18F7-3E33
    fi
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
    fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------

=============================== sda6/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda6 during installation
UUID=b1e9c50c-53dd-4ba4-9c32-2d7f8b9ce9b5 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=18F7-3E33  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sdb1 during installation
UUID=5d00895e-ac24-4e73-864c-a52829b2c35f /home           ext4    defaults        0       2
# swap was on /dev/sda5 during installation
UUID=d233d512-fbba-44f9-aff6-046b6703df19 none            swap    sw              0       0
--------------------------------------------------------------------------------

=================== sda6: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)

 422.108402252 = 453.235445760  boot/grub/grub.cfg                             2
 415.407222748 = 446.040109056  boot/vmlinuz-5.0.0-23-generic                  2
 423.603244781 = 454.840520704  boot/vmlinuz-5.3.0-26-generic                  1
 425.095432281 = 456.442744832  boot/vmlinuz-5.3.0-28-generic                  1
 425.095432281 = 456.442744832  vmlinuz                                        1
 423.603244781 = 454.840520704  vmlinuz.old                                    1
 424.157814026 = 455.435984896  boot/initrd.img-5.0.0-23-generic               2
 424.281719208 = 455.569027072  boot/initrd.img-5.3.0-26-generic               2
 425.250030518 = 456.608743424  boot/initrd.img-5.3.0-28-generic               6
 425.250030518 = 456.608743424  initrd.img                                     6
 424.281719208 = 455.569027072  initrd.img.old                                 2

=============================== sda7/etc/fstab: ================================

--------------------------------------------------------------------------------
# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# UUID=feaa6bde-b426-4d73-a279-5daf052173ba LABEL=Arch
/dev/sda7               /           ext4        rw,relatime 0 1

# UUID=18F7-3E33 LABEL=BootEfi
/dev/sda2       /boot/efi       vfat        umask=0077      0 1

# UUID=5d00895e-ac24-4e73-864c-a52829b2c35f
/dev/sdb1               /home       ext4        rw,relatime 0 2

# UUID=d233d512-fbba-44f9-aff6-046b6703df19 LABEL=Swap
/dev/sda5       none            swap        sw              0 0
--------------------------------------------------------------------------------

============================== sdc1/syslinux.cfg: ==============================

--------------------------------------------------------------------------------
DEFAULT loadconfig

LABEL loadconfig
  CONFIG /isolinux/isolinux.cfg
  APPEND /isolinux/
--------------------------------------------------------------------------------

================= sdc1: Location of files loaded by Syslinux: ==================

           GiB - GB             File                                 Fragment(s)

            ?? = ??             syslinux.cfg                                   1

======================== Unknown MBRs/Boot Sectors/etc: ========================

Unknown MBR on /dev/sdc

00000000  41 4b 45 4f fc 31 c0 8e  d8 be 31 7c e8 13 00 be  |AKEO.1....1|....|
00000010  5c 7c e8 0d 00 be 31 7c  e8 07 00 be 87 7c e8 01  |\|....1|.....|..|
00000020  00 f4 ac 3c 00 74 09 b4  0e bb 07 00 cd 10 eb f2  |...<.t..........|
00000030  c3 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |.***************|
00000040  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000050  2a 2a 2a 2a 2a 2a 2a 2a  2a 0d 0a 00 2a 2a 2a 20  |*********...*** |
00000060  45 52 52 4f 52 3a 20 4c  45 47 41 43 59 20 42 4f  |ERROR: LEGACY BO|
00000070  4f 54 20 4f 46 20 55 45  46 49 20 4d 45 44 49 41  |OT OF UEFI MEDIA|
00000080  20 2a 2a 2a 0d 0a 00 0d  0a 54 68 69 73 20 64 72  | ***.....This dr|
00000090  69 76 65 20 63 61 6e 20  6f 6e 6c 79 20 62 6f 6f  |ive can only boo|
000000a0  74 20 69 6e 20 55 45 46  49 20 6d 6f 64 65 2e 0d  |t in UEFI mode..|
000000b0  0a 49 74 20 63 61 6e 20  6e 6f 74 20 62 6f 6f 74  |.It can not boot|
000000c0  20 69 6e 20 42 49 4f 53  2f 4c 65 67 61 63 79 20  | in BIOS/Legacy |
000000d0  6d 6f 64 65 2e 0d 0a 0d  0a 49 66 20 79 6f 75 20  |mode.....If you |
000000e0  77 61 6e 74 20 74 6f 20  62 6f 6f 74 20 74 68 69  |want to boot thi|
000000f0  73 20 64 72 69 76 65 20  69 6e 20 42 49 4f 53 2f  |s drive in BIOS/|
00000100  4c 65 67 61 63 79 20 6d  6f 64 65 2c 20 79 6f 75  |Legacy mode, you|
00000110  0d 0a 73 68 6f 75 6c 64  20 72 65 63 72 65 61 74  |..should recreat|
00000120  65 20 69 74 20 69 6e 20  52 75 66 75 73 20 75 73  |e it in Rufus us|
00000130  69 6e 67 20 74 68 65 20  66 6f 6c 6c 6f 77 69 6e  |ing the followin|
00000140  67 20 73 65 74 74 69 6e  67 73 3a 0d 0a 2a 20 50  |g settings:..* P|
00000150  61 72 74 69 74 69 6f 6e  20 73 63 68 65 6d 65 20  |artition scheme |
00000160  2d 3e 20 4d 42 52 0d 0a  2a 20 54 61 72 67 65 74  |-> MBR..* Target|
00000170  20 73 79 73 74 65 6d 20  2d 3e 20 42 49 4f 53 2e  | system -> BIOS.|
00000180  2e 2e 0d 0a 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000190  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001c0  02 00 ee fe ff 77 01 00  00 00 ff ff ff ff 00 00  |.....w..........|
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200

A: I realized that there had to be a separate /boot partition that is mounted to both Ubuntu and Arch for it to be discoverable by both operating systems. After changing that, I could generate a grub menu for Arch using grub-mkconfig. Then I added the generated grub as a custom menu entry to the Ubuntu operating system configured in /etc/grub.d/40_custom, that way when there is a kernel change in Ubuntu and the grub gets updated, there will allways be a backup boot entry for Arch.


text:
Q: Dynamically append indexes to variable So I have arrays of different lengths
pathes= array(array('f1e9'),
              array('c0d9', '0', 'form_values', '6e13')
);

For each path I would like to use each value as an index to scan a separate array.
foreach ($pathes as $key => $val){

    $new_path = '$array_to_search';

    foreach ($val as $index){
       $newpath .= '[' . $index . ']';
    }
}

So within the loop the $new_path variable would be a string that looked like:
$new_path = '$array_to_search['f1e9']'

and
$new_path = '$array_to_search['c0d9']['0']['form_values']['6e13']'

But then I would have to be able to evaluate this string, and I do not know how to do this.
I think the answer might lie somewhere in variable variables, but I am not sure how to go about this.
Sincere thanks for any help. It is greatly appreciated!

A: I think the following recursive function would be the solution here:
function getByPath($value, array $path)
{
  if (empty($path)) return $value;
  if (!is_array($value)) return;
  if (array_key_exists($path[0], $value)) return getByPath($value[$path[0]], array_slice($path, 1));
}


text:
Q: Passing an unknown enum value into a function This is an elaboration on this question: c# Enum Function Parameters
I created a little sample application to introduce my question:
UPDATE: This is a known difficulty on the C# programming language. I added the used workaround in the code for people that find this in a search engine.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FlexibleEnums
{
    class Program
    {
        public enum Color
        {
            Blue,
            Red,
            Green
        };

        static void Main(string[] args)
        {
            CheckEnum<Color>();
            Console.ReadKey();
        }

        private static void CheckEnum<T>()
        {
            foreach (T item in Enum.GetValues(typeof(T)))
            {
                Console.WriteLine(item);

                // And here is the question:
                // I would like to uncheck this line, but that does not compile!
                //DoSomethingWithAnEnumValue(item);

                // Solution:
                // Not so nice, but it works.
                // (In the real program I also check for null off cource!)
                DoSomethingWithAnEnumValue(item as Enum);

            }

        }

        private static void DoSomethingWithAnEnumValue(Enum e)
        {
            Console.WriteLine(e);
        }

    }
}

I think that I should be doing something like:
private static void CheckEnum<T>() where T : Enum

But that's also giving me compile errors.
Thanks for the help!

A: I think the question can be restated as, 'how to place generic constraints on an enumeration value'.
Jon Skeet has blogged about it here: http://msmvps.com/blogs/jon_skeet/archive/2009/09/10/generic-constraints-for-enums-and-delegates.aspx
The question has been asked previously on SO

A: Since C#7.3, it has been possible to create an enum constraint: Enum constraints
public sealed class MyClass<T> : MyBaseClass, IMyInterface<T> where T : Enum
{
        public MyClass(Args args)
            : base(args)
        {
        }
}

I needed the consumer to pass in one of several enums, where the enum had to exist in a particular namespace.  I threw a run-time exception if a different enum was used:
public sealed class MyClass<T> : MyBaseClass, IMyInterface<T> where T : Enum
{
        public MyClass(Args args)
            : base(args)
        {
            var t = typeof(T);
            if (t.Namespace.IsNotContaining("My.Namespace.Of.Interest"))
            {
#pragma warning disable CA1303 // Do not pass literals as localized parameters
                throw new InvalidEnumArgumentException("The enum provided was not of the expected type.");
#pragma warning restore CA1303 // Do not pass literals as localized parameters
            }
        }
}

A: It is not possible (I could not find a way when I had the same problem) to restrict a generic condition to Enum.
UPDATED
Closest you can get is to a ValueType struct:
where T : ValueType
where T : struct

NOTE: Apologies, yes it was struct thanks to n8wrl.

A: You also need to make sure that DoSomethingWithAnEnumeraterValue(item) is typed to match your T:
private static void DoSomethingWithAnEnumeratorValue<T>(T item) where T : ...
{
}

where T is restricted the same way CheckEnumerator is.


text:
Q: In Event Bubbling, how would you select an element by ID? How would one select an e.target by ID? For instance, you can select an event target by classlist, like e.target.classList.contains('test'), but I can't find any way to select an id like e.target.Id.contains('ID').
Am I going about this wrong? Should I instead declare a variable like: const testVariable = document.querySelector(#id); and then declare that the e.target?
Thanks for any help, I just can't find any documentation on how to declare the event target as an ID.

A: 'id' is unique hence contains cannot be executed on ids where as there could be multiple classes assigned to a an element so contains work for classes not ids.
Also, as mentioned above the correct syntax is event.target.id


text:
Q: Object tracking openCV, questions, advices? Short introduction: project of augmented reality
Goal: load 3D hairstyles templates on the head of someone.
So I am using OpenCV to track the face of the person, then I have to track the cap (We assume that the user has a cap and we can decide of a landmark or everything we need on the cap to detect it) of the user. Once I detected the landmark, I have to get the coordinates of the landmark, and then send it to the 3D engine to launch/update the 3D object.
So, to detect precisely the landmark(s) of the cap I tested a few methods first:

*

*cvFindChessBoardCorner ... very efficient on a plan surface but not a cap (http://dsynflo.blogspot.com/2010/06/simplar-augmented-reality-for-opencv.html)

*color detection (http://www.aishack.in/2010/07/tracking-colored-objects-in-opencv/) ... not really efficient. If the luminosity change, the colors change ...
I came to you today to think about it with you. Do I need special landmark on the cap ? (If yes Which one ? If not, How can I do ?)
Is it a good idea to mix up the detection of colors and detection of form ?
.... Am i on the right way ? ^^
I appreciate any advice regarding the use of a cap to target the head of the user, and the different functions I have to use in OpenCV library.
Sorry for my english if it's not perfect.
Thank you a lot !

A: A quick method, off the top of my head, is to combine both method.
Color tracking using histograms and mean shift
Here is an alternative color detection method using histogram:
Robust Hand Detection via Computer Vision
The idea is this:
For a cap of known color, say bright green/blue (like the kind of colors you see for image matting screen), you can pre-compute a histogram using just the hue and saturation color channels. We deliberately exclude the lightness channel to make it more robust to lighting variations. Now, with the histogram, you can create a back projection map i.e. a mask with a probability value at each pixel in the image indicating the probability that the color there is the color of the cap.
Now, after obtaining the probability map, you can run the meanshift or camshift algorithms (available in OpenCV) on this probability map (NOT the image), with the initial window placed somewhere above the face you detected using OpenCV's algorithm. This window will eventually end up at the mode of the probability distribution i.e. the cap.
Details are in the link on Robust Hand Detection I gave above. For more details, you should consider getting the official OpenCV book or borrowing it from your local library. There is a very nice chapter on using meanshift and camshift for tracking objects. Alternatively, just search the web using any queries along meashift/camshift for object tracking.
Detect squares/circles to get orientation of head
If in addition you wish to further confirm this final location, you can add 4 small squares/circles on the front of the cap and use OpenCV's built in algorithm to detect them only in this region of interest (ROI). It is sort of like detecting the squares in those QR code thing. This step further gives you information on the orientation of the cap and hence, the head, which might be useful when you render the hair. E.g. after locating 2 adjacent squares/circles, you can compute the angle between them and the horizontal/vertical line.
You can detect squares/corners using the standard corner detectors etc in OpenCV.
For circles, you can try using the HoughCircle algorithm: http://docs.opencv.org/modules/imgproc/doc/feature_detection.html#houghcircles
Speeding this up
Make extensive use of Region of Interests (ROIs)
To speed things up, you should, as often as possible, run your algorithm on small regions of the image(ROIs) (also the probability map). You can extract ROI from OpenCV image, which are themselves images, and run OpenCV's algorithms on them the same way you would run them on whole images. For e.g., you could compute the probability map for an ROI around the detected face. Similarly, the meanshift/camshift algorithm should only be run on this smaller map. Likewise for the additional step to detect squares or circles. Details can be found in the OpenCV book as well as quick search online.
Compile OpenCV with TBB and CUDA
A number of OpenCV's algorithm can achieve significant speed ups WITHOUT the programmer needing to do any additional work simply by compiling your OpenCV library with TBB (Thread building blocks) and CUDA support switched on. In particular, the face detection algorithm in OpenCV (Viola Jones) will run a couple times faster.
You can switch on these options only after you have installed the packages for TBB and CUDA.
TBB: http://threadingbuildingblocks.org/download
CUDA: https://developer.nvidia.com/cuda-downloads
And then compile OpenCV from source: http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windows-installation
Lastly, I'm not sure whether you are using the "C version" of OpenCV. Unless strictly necessary (for compatibility issues etc.), I recommend using the C++ interface of OpenCV simply because it is more convenient (from my personal experience at least). Now let me state upfront that I don't intend this statement to start a flame war on the merits of C vs C++.
Hope this helps.


text:
Q: Azure Service Bus Not Detecting Duplicates I have a process that reads a message from an Azure Service Bus Queue and converts that message to a Video to be Encoded by Azure Media Services. I noticed that if the process is kicked off very quickly in a row, the same video was being encoded right after another. Here is my code that adds the Video to the Queue
public class VideoManager
{
    string _connectionString = ConfigurationManager.AppSettings["Microsoft.ServiceBus.ConnectionString"];
    string _queueName = ConfigurationManager.AppSettings["ServiceBusQueueName"];
    QueueClient _client;

    public VideoManager()
    {
        var conStringBuilder = new ServiceBusConnectionStringBuilder(_connectionString)
        {
            OperationTimeout = TimeSpan.FromMinutes(120)
        };

        var messagingFactory = MessagingFactory.CreateFromConnectionString(conStringBuilder.ToString());
        _client = messagingFactory.CreateQueueClient(_queueName);
    }

    public void Approve(Video video)
    {
        // Set video to approved.
        video.ApprovalStatus = ApprovalStatus.Approved;
        var message = new BrokeredMessage(new VideoMessage(video, VideoMessage.MessageTypes.Approve, string.Empty));
        message.MessageId = video.RowKey;
        _client.Send(message);
    }
}

And the process that reads from the Queue
 class Program
{
    static QueueClient client;

    static void Main(string[] args)
    {
        VideoManager videoManager = new VideoManager();

        var connectionString = ConfigurationManager.AppSettings["Microsoft.ServiceBus.ConnectionString"];

        var conStringBuilder = new ServiceBusConnectionStringBuilder(connectionString)
        {
            OperationTimeout = TimeSpan.FromMinutes(120)
        };

        var messagingFactory = MessagingFactory.CreateFromConnectionString(conStringBuilder.ToString());

        client = messagingFactory.CreateQueueClient(ConfigurationManager.AppSettings["ServiceBusQueueName"]);

        Console.WriteLine("Starting: Broadcast Center Continuous Video Processing Job");

        OnMessageOptions options = new OnMessageOptions
        {
            MaxConcurrentCalls = 25,
            AutoComplete = false
        };

        client.OnMessageAsync(async message =>
        {
            bool shouldAbandon = false;

            try
            {
                await HandleMessage(message);
            }
            catch (Exception ex)
            {
                shouldAbandon = true;
                Console.WriteLine(ex.Message);
            }
            if (shouldAbandon)
            {
                await message.AbandonAsync();
            }
        }, options);
        while (true) { }
    }
    async static Task<int> HandleMessage(BrokeredMessage message)
    {

        VideoMessage videoMessage = message.GetBody<VideoMessage>();

        Console.WriteLine(String.Format("Message body: {0}", videoMessage.Video.Title));
        Console.WriteLine(String.Format("Message id: {0}", message.MessageId));

        VideoProcessingService vp = new VideoProcessingService(videoMessage.Video);
        Task task;
        switch (videoMessage.MessageType)
        {
            case VideoMessage.MessageTypes.CreateThumbnail:
                task = new Task(() => vp.ProcessThumbnail(videoMessage.TimeStamp));
                task.Start();

                while (!task.IsCompleted)
                {
                    await Task.Delay(15000);
                    message.RenewLock();
                }
                await task;
                Console.WriteLine(task.Status.ToString());

                Console.WriteLine("Processing Complete");
                Console.WriteLine("Awaiting Message");
                break;
            case VideoMessage.MessageTypes.Approve:

                task = new Task(() => vp.Approve());
                task.Start();

                while (!task.IsCompleted)
                {
                    await Task.Delay(15000);
                    message.RenewLock();
                }
                await task;
                Console.WriteLine(task.Status.ToString());

                Console.WriteLine("Processing Complete");
                Console.WriteLine("Awaiting Message");
                break;
            default:
                break;
        }
        return 0;
    }
}

What I see in the Console Window is the following if I kick off the process 3 times in a row

Message id: 76aca19a-0698-449b-bf58-a24876fc4314
Message id: 76aca19a-0698-449b-bf58-a24876fc4314
Message id: 76aca19a-0698-449b-bf58-a24876fc4314

I thought maybe I did not have the settings correct, but they are there
I am really at a loss here, as I would expect this to be fairly out of the box behavior. Does duplicate detection only work if the message has been completed, so I can't use OnMessageAsync()?

A: The issue is not the completion (as it was in the code), but the fact that you have in essence multiple consumers (25 concurrent callbacks) and it seems like the LockDuration is elapsing faster than the processing takes. As a result of that, message re-appears and re-processed. As a result of that you see the same message ID logged more than once.
Possible solutions are (as I've outlined in a comment above):

*

*Let OnMessage API manage timeout extension for you (example)

*Manually renew the lock as you've done using BrokeredMessage.RenewLock

A: There is a line of code missing from your HandleMessage code.
async static Task<int> HandleMessage(BrokeredMessage message)
{
  VideoMessage videoMessage = message.GetBody<VideoMessage>();

  message.CompleteAsync(); // This line...

  Console.WriteLine(String.Format("Message id: {0}", message.MessageId));
  // Processes Message
}

So yes you have to mark the message with either, Complete, Defer etc..
Also see this Answer, also found this which may be useful in how duplicate detection works


text:
Q: Hint for finding the sum: $\sum_{n=0}^{\infty}\frac{1}{4n^2-1} x^{2n+1}$? I know that $\sum_{n=0}^{\infty}\frac{1}{4n^2-1}$ is a telescoping sum, but $x^{2n+1}$ in the sum complicates it a bit.

A: The sum is $-x+\dfrac {x^3}3+\dfrac{x^5}{15}+\dfrac{x^7}{35}+\dfrac{x^9}{63}+\cdots+\dfrac{x^{2n+1}}{4n^2-1}+\cdots$.
Its derivative is $-1+x^2+\dfrac{x^4}3+\dfrac{x^6}5+\dfrac{x^8}{7}+\cdots+\dfrac{x^{2n}}{2n-1}+\cdots.$
$=-1+x\left(x+\dfrac{x^3}3+\dfrac{x^5}5+\dfrac {x^7}7+\cdots+\dfrac{x^{2n-1}}{2n-1}+\cdots\right)$
$=-1+x\tanh^{-1}x$.
Can you take it from here?


text:
Q: Optional parameters for Request Param is a bad practise? I'm using Optional parameters for my Rest controller, in my case to distinguish which method to call:
@GetMapping("/cars")
@ResponseBody
public List<CarsDTO> getAllCarsByCat(@RequestParam Optional<Integer> cat1,
                                     @RequestParam Optional<Integer> cat2) {
    if (cat1.isPresent() && cat2.isPresent())
        return carsService.getAllCarsByCat1AndCat2(cat1.get(), cat2.get());
    else if (cat1.isPresent())
        return carsService.getAllCarsByCat1(cat1.get());
    else if (cat2.isPresent())
        return carsService.getAllCarsByCat2(cat2.get());
    else
        return carsService.getAllCars();

}

Why does the highest voted response of the thread below propose that "Using Optional parameters causing conditional logic inside the methods is literally contra-productive."?
Why should Java 8's Optional not be used in arguments
I do exactly that and consider it as the most readable and straight forward solution. What is bad with this approach?

A: The only concern using Optional as @RequestParam is performance and creating Optional wrapper using Optional.OfNullable and unwrapping using Optional.get() or checking using Optional.ifPresent(). As a functional perspective it always looks good using Optional but as a good programmer it is an unnecessary additional operations wrapping and unwrapping. In spring Optional is allowed in @RequestParam to declare param as optional

By default, method parameters that use this annotation are required, but you can specify that a method parameter is optional by setting the @RequestParam annotation's required flag to false or by declaring the argument with an java.util.Optional wrapper.

So you can simply make those @RequestParam as optional using required==false and follow the same approach using if else, you can also use Objects.nonNull for more readability or you can also use defaultValue
@GetMapping("/cars")
@ResponseBody
 public List<CarsDTO> getAllCarsByCat(@RequestParam(name="cat1", required=false) Integer cat1,
                                 @RequestParam(name="cat2", required=false) Integer cat2) {
     if (cat1!=null && cat2!=null)
         return carsService.getAllCarsByCat1AndCat2(cat1, cat2);
     else if (cat1!=null)
         return carsService.getAllCarsByCat1(cat1);
     else if (cat2!=null)
         return carsService.getAllCarsByCat2(cat2);
     else
         return carsService.getAllCars();

  }


text:
Q: Using server timestamp for filtering Firebase provides a mechanism to insert server timestamps.
I was wondering if it also can be used for filtering. Like this:
var db = firebase.database();
var path = '/some/path';
var ref = db.ref(path);
ref.orderByChild('ts')
    .startAt(firebase.database.ServerValue.TIMESTAMP)
    .on('child_added', function(snap) {
        //do something
    });

Error: Query: First argument passed to startAt(), endAt(), or
  equalTo() cannot be an object.

A: Assuming you've already set the 'ts' child of a bunch of entries, you would add an actual timestamp to your startAt method like startAt('1473645571228').
You can create the Unix timestamp client side with Moment.js, or if you need it from Firebase, you can quickly set and retrieve it.


text:
Q: Is Tomcat 5.5 compatible with Java 7? My server runs a legacy Debian 4, Tomcat 5.5 and JDK 5. I plan to (if possible) install JDK 7 on the server and let Tomcat 5.5 runs on JDK 7, without upgrading Tomcat.
Is there any compatibility problems I should be aware of?
Thanks.

A: According to this page, Tomcat 5.5 only depends on a >= 1.4 JDK.  So you should be just fine with Java 7.

A: There should be no problem with running Tomcat 5.5 on Java 7.0 (modulo the normal advice of using a version of Java with the latest security patches.)  See the link in Greg's answer for the Tomcat platform requirements.
Running Tomcat 5.5 and / or an ancient Debnian release are more concerning though.  I'd be surprised if you still getting security patches for those platforms.  I'd advise upgrading to Tomcat 6 or 7 and a recent OS release.


text:
Q: No GUI error after installing debian buster I have installed Debian 10 on my laptop Dell Inspiron . But when booting first time into Debian, It directs me into the command-line interface, why?
I am sure, I have chosen Graphical Install during installation.
Is it related to the graphics of my laptop? My laptop has AMD Radeon R2 graphics and I am using the SDDM Display manager. It has AMD APU Dual Core E1 processor.
I have installed KDE plasma, LxDM, and Lxqt in the select and install software step during installation.
I have chosen SDDM as my Display manager between lightdm and sddm.

A: Finally found the solution for this problem, I think the sddm display manager is not working fine and thats's why I am booting into CLI.
So, I just have to install another display manager which should work with my laptop hardware.
A brief explaination on this problem is here:
Sddm is not starting but in theory everything is working!
First step: Update the /etc/apt/sources.list
sudo nano /etc/apt/sources.list

and add the following repositories(just copy and paste it):
deb http://deb.debian.org/debian buster-updates main
deb-src http://deb.debian.org/debian buster-updates main

# non-free firmwares
deb http://deb.debian.org/debian buster main contrib non-free
deb-src http://deb.debian.org/debian buster main contrib non-free

deb http://deb.debian.org/debian buster-updates main contrib non-free
deb-src http://deb.debian.org/debian buster-updates main contrib non-free

deb http://security.debian.org/ buster/updates main contrib non-free
deb-src http://security.debian.org/ buster/updates main contrib non-free

save the file by Ctrl-O and Ctrl-M. Close the file by using Ctrl-X.
run sudo apt-get update
and installed the lightdm display manager,you can install which you want
sudo apt-get install lightdm

Now we have to choose a display manager,so run the command
sudo dpkg-reconfigure lightdm

and choose the lightdm among the other options and reboot now. Problem solved.

A: The problem might be related to graphics-driver issues.
I experienced the same with fresh debian buster kde plasma. In contrast to you, I use nvidia.
To solve this I had to add contrib and non-free to my source.list:
nano /etc/apt/source.list

deb http://ftp.uni-mainz.de/debian/ buster main non-free contrib
deb-src http://ftp.uni-mainz.de/debian/ buster main non-free contrib

deb http://security.debian.org/debian-security buster/updates main non-free contrib
deb-src http://security.debian.org/debian-security buster/updates main non-free contrib

# buster-updates, previously known as 'volatile'
deb http://ftp.uni-mainz.de/debian/ buster-updates main non-free contrib
deb-src http://ftp.uni-mainz.de/debian/ buster-updates main non-free contrib

The next thing was to update and install the linux firmware package:
sudo apt update
sudo apt install firmware-linux
sudo reboot

Right after this procedure I was able to launch kde plasma.

Unfortunately my desktop freezed several times with the stock kernel driver. After having installed the proprietary nvidia drivers, these issues went away. sudo apt install -y nvidia-detect && sudo nvidia-detect. Than install whatever driver nvidia-detect recommends to you or just do sudo apt install nvidia-driver
Tested with GeForce GT 710 and gtx970


text:
Q: Excel: Saving query results directly to CSV file I have a dataset in Excel, of which I have to save an assorted part to a new csv file. I have used SQL to select the part required to be saved. I was hoping somebody would guide me about saving this selection to csv using SQL.
SQL gives me a recordset but I would like to loop through it only as a last resort. I am hoping there is a better approach that directly saves the entire result from within the query itself if possible.
Something like the solution by Remou on Want VBA in excel to read very large CSV and create output file of a small subset of the CSV is what I'm looking for. But unfortunately I can't get that to work.

A: Assuming you are in Excel VBA, has an ADODB opened with a Recordset object connected to a database and you want to save the content into a CSV (from within the Excel VBA).
The easiest is actually still by looping through the records in the recordset.
However, since you already rule that out (for whatever reasons), the next option would be to use the Recordset.Save <StreamObject> method. Create a System.IO.Streamwriter object to pass to the Recordset.Save.
OR, another way if you are using Jet SQL is:
conDB.Execute "SELECT * INTO [Text;Database=" _
               & vsCSVFolder _
               & ";HDR=No;FMT=Delimited].[" _
               & vsCSVFileame _
               & "] FROM Attendance", _
                 DBExport, _
                 adCmdText Or adExecuteNoRecords

Hope this helps.


text:
Q: UITableView does not show new entries when data object conforms to NSCoding When I make an object class conform to NSCoding, the tableView does not show new entries. Suspected it had to do with the object initialization but cannot solve it. Might be very basic but cannot find the error. Here is the code I simplified to post:
Custom Object:
//  DataObject.h
#import <Foundation/Foundation.h>
@interface DataObject : NSObject {
NSString *name;
}
@property (nonatomic, copy) NSString *name;
@end

//  DataObject.m
#import "DataObject.h"
@implementation DataObject
@synthesize name;

- (void)encodeWithCoder:(NSCoder*)encoder {
[encoder encodeObject:name forKey:@"name"];
}

- (id)initWithCoder:(NSCoder *)decoder {
self = [super init];
if (!self) return nil;

name = [[decoder decodeObjectForKey:@"name"] retain];
return self;
}

These is the TableView root controller - Have omitted a few methods:
//  RootViewController.h
#import <UIKit/UIKit.h>
@interface RootViewController : UITableViewController {
NSMutableArray *list;
}
@property (nonatomic, retain) NSMutableArray *list;

- (void)add:(id)sender;
- (NSString *)dataFilePath;

@end

//  RootViewController.m
#import "RootViewController.h"
#import "DataObject.h"

@implementation RootViewController
@synthesize list;

- (void)add:(id)sender
{
DataObject *newEntry = [[DataObject alloc] init];
newEntry.name = @"Willy";
[self.list addObject:newEntry];

[self.tableView reloadData];

// Scroll table view to last row
if ([list count] > 1) {
    NSUInteger index = list.count - 1;
    NSIndexPath *lastRow = [NSIndexPath indexPathForRow:index inSection: 0];
    [self.tableView scrollToRowAtIndexPath: lastRow atScrollPosition:       UITableViewScrollPositionTop animated: YES];
}

[newEntry release];

}

- (NSString *)dataFilePath
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
return [documentsDirectory stringByAppendingPathComponent:@"datafile"];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.rightBarButtonItem = self.editButtonItem;

self.title = @"Names";
self.list = [[NSMutableArray alloc] init];

NSMutableArray *tempArray = [NSKeyedUnarchiver unarchiveObjectWithFile:[self dataFilePath]];
self.list = tempArray;

UIApplication *app = [UIApplication sharedApplication];
[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(applicationWillResignActive:)
                                             name:UIApplicationWillResignActiveNotification
                                           object:app];

// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
self.navigationItem.rightBarButtonItem = self.editButtonItem;

UIBarButtonItem *addButton = [[UIBarButtonItem alloc]
                              initWithTitle:@"Add"
                              style:UIBarButtonItemStylePlain
                              target:self
                              action:@selector(add:)];
self.navigationItem.leftBarButtonItem = addButton;
[addButton release];

[self.tableView reloadData];

}

- (void)applicationWillResignActive:(NSNotification *)notification;
{
[NSKeyedArchiver archiveRootObject:self.list toFile:[self dataFilePath]];
}

- (void)viewWillAppear:(BOOL)animated {
[self.tableView reloadData];
[super viewWillAppear:animated];
}

// Customize the number of sections in the table view.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [list count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }

// Configure the cell.
NSUInteger row = [indexPath row];
DataObject *oneName = [self.list objectAtIndex:row];
cell.textLabel.text = oneName.name;

    return cell;
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {

    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source.
        NSUInteger row = [indexPath row];
        [self.list removeObjectAtIndex:row];
        [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
    }

}

@end

A: Oh, man I am so embarrassed...It had nothing to do with NSCoding directly but when I made the data class NSCoding compliant I added in viewDidLoad:
NSMutableArray *tempArray = [NSKeyedUnarchiver unarchiveObjectWithFile:[self dataFilePath]];
self.list = tempArray;

The first line is fine, but the second assigned a new pointer address to self.list and the tempArray was later autoreleased...
As this line was not executed in the "not NSCoding compliant" version it appeared to work then and not when encodeWithCoder and initWithCoder were implemented.
Because of this self.list was nil instead of being initialized and ready when in the add: method I added a new instance. It was created fine, but never added to the array and therefore never showed in the tableView.
This was easily fixed using instead in viewDidLoad:
NSMutableArray *tempArray = [NSKeyedUnarchiver unarchiveObjectWithFile:[self dataFilePath]];
[self.list addObjectsFromArray:tempArray];

Worst part is that I was pulling my hair because of this and was convinced it was because of NSCoding and the initialization of objects...


text:
Q: Cannot delete corrupted registery key I wanted to run pip install which is some python install-tool when I ran into an error regarding the registry key HKEY_CURRENT_USER\Software\Classes\{057C7771-F320-4C2A-A2EA-747945FA82F2} (the program iterates over all keys in the Classes sub-tree).
When I try to open, edit, view its attributes, change permissions or delete the key with regedt32 (with admin privileges) a message box appears which reads: (summarized and translated from German)
Error opening key
Due to error the key [key name] can not be opened
Details: The system can't find the file

Doing a fast Google search I found that the key is somehow related to the application Fast Picture Viewer which in fact I had once installed. Does anybody know how to force delete that damn key? Thanks.
I found out that at least 5 other keys in the same directory show the same behaviour.
EDIT:
I found that the real key name is {057C7771-F320-4C2A-A2EA-747945FA82F2}\0

A: Try it this way:
You may get the following error message when trying to delete a registry key:

"Error while deleting key"

This can be caused if you attempt to delete a registry key that contains embedded null characters. These characters are not visible when viewing the registry entry.
To delete a registry key that contains an embedded null character, you must first replace the null character with another character. You can accomplish this by using the RegDelNull tool from Sysinternals. This tool is available from the following URL.

A: Looks like your file that contains that part of registry is damaged.
There are many tools to repair registry. One is built-in in Windows (scanreg.exe).
Usage:
scanreg /fix

You need administrator rights.
If this wont help - look at duDE answer (about tool from SysInternals).
You may also run some filesystem check and see loogs in event viewer to find out what caused your problem.

Where HKEY_CURRENT_USER data is stored in Windows?
From Wikipedia (Windows Registry article):

The HKEY_CURRENT_USER key is a link to the subkey of HKEY_USERS that
  corresponds to the user; the same information is accessible in both
  locations. On Windows NT systems, each user's settings are stored in
  their own files called NTUSER.DAT and USRCLASS.DAT inside their own
  Documents and Settings subfolder (or their own Users sub folder in
  Windows Vista and above). Settings in this hive follow users with a
  roaming profile from machine to machine.

(Documents and Settings was renamed to Users in Windows Vista and later)


text:
Q: The Reputation in Stack Exchange Data Dump is of SO I was going through the data dump at https://archive.org/details/stackexchange for Meta Stack Overflow. The reputation field in Users.xml seems to return the reputation of the User on Stack Overflow.
For example, Jeff Atwood's reputation comes to be 43,078 from the MetaSO dump. While the actual current reputations are: MetaSO: 276,369, SO:43,468
Moreover Views field shows 2,770 value. While the actual values are MetaSO: 73,422 SO: 376,594
References: https://stackexchange.com/users/1/jeff-atwood?tab=accounts, https://meta.stackexchange.com/users/1/jeff-atwood, https://stackoverflow.com/users/1/jeff-atwood

A: You've actually made a minor error that many people make.
This site is Meta Stack Exchange. Meta Stack Overflow is a completely different site and it uses the reputation of Stack Overflow as meta sites other than Meta Stack Exchange do not have their own reputation.
As such, the information in the data dump is correct.
For reference, here's Jeff Atwood's Meta Stack Overflow profile. As you can see, the reputation is identical to his Stack Overflow reputation.
Many years ago, the two sites were one, with Meta Stack Overflow being the network-wide meta. The decision was made to split the meta discussion of Stack Overflow away from general discussion and Meta Stack Exchange was created instead.


text:
Q: white flash on dark mode on refreshing page the problem is when the dark mode is enabled, and the page is reloaded for some reason, there's a flicker of white background all over the page before it turns to be dark. It stays a fraction of a second. It just doesn't look professional.
i Know there is already a similar answer i tried, but that one doesn't resolve my problem.
As you can see in the gif flicker
HTML

                    <svg version="1.1" id="logo" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 106.08 30" style="enable-background:new 0 0 106.08 30;" xml:space="preserve">
                        <g id="logo_x5F_brand">
                            <g>
                                <g>
                                    <polygon class="st0" points="34.39,7.99 34.39,22.01 33.05,22.78 30.35,24.34 29,25.12 27.65,25.9 26.31,26.68 24.96,27.45
                                    23.61,28.23 22.26,29.01 20.91,28.23 19.56,27.45 18.22,26.68 16.87,25.9 15.52,25.12 14.17,24.34 11.48,22.78 10.13,22.01
                                    10.13,7.99 11.48,7.22 12.82,6.44 14.17,5.66 15.52,4.88 16.87,4.1 18.22,3.32 20.91,1.77 22.26,0.99 23.61,1.77 26.31,3.32
                                    27.65,4.1 29,4.88 30.35,5.66 31.7,6.44 33.05,7.22           " />
                                </g>
                            </g>
                            <g>
                                <g>
                                    <path class="st1" d="M22.3,10.7c-0.34,0.22-0.66,0.44-1,0.66c0.84,0.56,1.69,1.12,2.54,1.68c2.26,1.5,4.52,3,6.78,4.5
                                    c1.02,0.68,0.89,1.89-0.26,2.45c-0.17-0.37-0.55-0.63-0.94-0.89c-4.51-2.99-9.01-5.97-13.51-8.96c-0.59-0.39-0.59-0.85,0.01-1.25
                                    c1.92-1.27,3.84-2.55,5.76-3.82c0.2-0.13,0.37-0.27,0.6-0.44c0.82,0.56,1.58,1.08,2.36,1.6c2.11,1.4,4.22,2.8,6.33,4.2
                                    c0.53,0.35,0.53,0.72,0.01,1.07c-0.99,0.65-1.98,1.31-2.96,1.97c-0.5,0.33-1.07,0.33-1.57,0C25.06,12.53,23.68,11.62,22.3,10.7z
                                    M19.56,10.17c0.91-0.61,1.82-1.22,2.75-1.84c1.64,1.09,3.28,2.18,4.87,3.24c0.34-0.22,0.66-0.43,0.97-0.63
                                    c-1.95-1.29-3.92-2.59-5.86-3.88c-1.23,0.81-2.48,1.63-3.71,2.45C18.88,9.72,19.2,9.93,19.56,10.17z" />
                                </g>
                                <g>
                                    <path class="st2" d="M27.77,14.46l3.38-2.25v0c0,0.28-0.14,0.54-0.37,0.69l-2.54,1.72v0.01l2.53,1.71
                                    c0.23,0.16,0.37,0.41,0.37,0.69l0,0l-3.36-2.24V14.46z" />
                                </g>
                                <g>
                                    <path class="st1" d="M22.41,19.25c0.34-0.23,0.66-0.44,0.99-0.66c-0.85-0.55-1.7-1.1-2.55-1.66c-2.27-1.48-4.55-2.96-6.81-4.45
                                    c-1.03-0.67-0.91-1.89,0.24-2.45c0.17,0.37,0.55,0.63,0.95,0.88c4.53,2.95,9.05,5.91,13.58,8.86c0.6,0.39,0.6,0.85,0,1.25
                                    c-1.91,1.29-3.83,2.58-5.74,3.87c-0.19,0.13-0.37,0.28-0.59,0.44c-0.82-0.55-1.59-1.07-2.37-1.58c-2.12-1.39-4.24-2.77-6.36-4.16
                                    c-0.53-0.35-0.53-0.72-0.01-1.07c0.98-0.66,1.97-1.32,2.95-1.99c0.5-0.34,1.06-0.34,1.57-0.01
                                    C19.63,17.43,21.02,18.34,22.41,19.25z M25.16,19.76c-0.9,0.61-1.81,1.23-2.74,1.86c-1.65-1.08-3.29-2.16-4.89-3.21
                                    c-0.34,0.22-0.66,0.44-0.96,0.64c1.96,1.28,3.94,2.57,5.89,3.84c1.23-0.82,2.46-1.65,3.69-2.47
                                    C25.83,20.2,25.51,19.99,25.16,19.76z" />
                                </g>
                                <g>
                                    <path class="st2" d="M16.92,15.53l-3.36,2.27l0,0c0-0.28,0.13-0.54,0.36-0.69l2.53-1.74l0-0.01l-2.54-1.7
                                    c-0.23-0.15-0.37-0.41-0.37-0.69v0l3.38,2.21L16.92,15.53z" />
                                </g>
                            </g>
                        </g>
                        <g id="name_x5F_brand">
                            <path class="st1" d="M40.64,18.9c0.66,0.41,1.62,0.74,2.63,0.74c1.5,0,2.38-0.79,2.38-1.94c0-1.06-0.61-1.67-2.14-2.26
                            c-1.86-0.66-3.01-1.62-3.01-3.22c0-1.77,1.47-3.09,3.68-3.09c1.17,0,2.01,0.27,2.52,0.56l-0.41,1.2c-0.37-0.2-1.13-0.54-2.16-0.54
                            c-1.55,0-2.14,0.93-2.14,1.71c0,1.06,0.69,1.59,2.26,2.19c1.93,0.74,2.9,1.67,2.9,3.34c0,1.76-1.3,3.28-3.98,3.28
                            c-1.1,0-2.3-0.32-2.9-0.73L40.64,18.9z" />
                            <path class="st1" d="M50.64,9.31v11.38h-1.47V9.31H50.64z" />
                            <path class="st1" d="M62.8,15.69c-0.08-1.59-0.19-3.5-0.17-4.91h-0.05c-0.39,1.33-0.86,2.75-1.44,4.32l-2.01,5.52h-1.11l-1.84-5.42
                            c-0.54-1.6-1-3.07-1.32-4.42h-0.03c-0.03,1.42-0.12,3.33-0.22,5.03l-0.3,4.88h-1.4L53.7,9.31h1.87l1.94,5.5
                            c0.47,1.4,0.86,2.65,1.15,3.83h0.05c0.29-1.15,0.69-2.4,1.2-3.83l2.03-5.5h1.87l0.71,11.38h-1.44L62.8,15.69z" />
                            <path class="st1" d="M76.52,14.88c0,3.92-2.38,5.99-5.28,5.99c-3.01,0-5.12-2.33-5.12-5.77c0-3.61,2.25-5.98,5.28-5.98
                            C74.51,9.12,76.52,11.5,76.52,14.88z M67.69,15.07c0,2.43,1.32,4.61,3.63,4.61c2.33,0,3.65-2.14,3.65-4.73
                            c0-2.26-1.18-4.63-3.63-4.63C68.9,10.32,67.69,12.57,67.69,15.07z" />
                            <path class="st1" d="M78.43,20.69V9.31h1.6l3.65,5.76c0.84,1.33,1.5,2.53,2.04,3.7l0.03-0.02c-0.14-1.52-0.17-2.9-0.17-4.68V9.31
                            h1.38v11.38h-1.49l-3.61-5.77c-0.79-1.27-1.55-2.57-2.13-3.8l-0.05,0.02c0.08,1.43,0.12,2.8,0.12,4.69v4.86H78.43z" />
                            <path class="st1" d="M95.44,15.35h-4.42v4.1h4.93v1.23h-6.4V9.31h6.15v1.23h-4.68v3.6h4.42V15.35z" />
                        </g>
                    </svg>

                                Home

                                About

                                Qualification

                                Portfolio

                                Contact

CSS Light
/*=============== BASE ===============*/

* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

body {
    background-color: var(--body-color);
    font-size: var(--normal-font-size);
    font-family: var(--body-font);
    color: var(--text-color);
    margin: 0 0 var(--header-height) 0;
}

h1,
h2,
h3 {
    color: var(--title-color);
    font-weight: var(--font-semi-bold);
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

CSS dark
/*========== Variables Dark theme ==========*/

body.dark-theme {
    --title-color: hsl(var(--hue), 12%, 95%);
    --text-color: hsl(var(--hue), 12%, 75%);
    --body-color: hsl(var(--hue), 40%, 8%);
    --container-color: hsl(var(--hue), 24%, 12%);
}

/*========== Button Dark/Light ==========*/

.nav__btns {
    display: flex;
    align-items: center;
}

.change-theme {
    font-size: 1.25rem;
    color: var(--title-color);
    cursor: pointer;
    margin-right: var(--mb-2);
}

.change-theme:hover {
    color: var(--first-color);
}

JAVASCRIPT
/*==================== DARK LIGHT THEME ====================*/
const themeButton = document.getElementById('theme-button')
const darkTheme = 'dark-theme'
const iconTheme = 'uil-sun'

const selectedTheme = localStorage.getItem('selected-theme')
const selectedIcon = localStorage.getItem('selected-icon')

const getCurrentTheme = () => document.body.classList.contains(darkTheme) ? 'dark' : 'light'
const getCurrentIcon = () => themeButton.classList.contains(iconTheme) ? 'uil-moon' : 'uil-sun'

if (selectedTheme) {
    document.body.classList[selectedTheme === 'dark' ? 'add' : 'remove'](darkTheme)
    themeButton.classList[selectedIcon === 'uil-moon' ? 'add' : 'remove'](iconTheme)
}

themeButton.addEventListener('click', () => {
    document.body.classList.toggle(darkTheme)
    themeButton.classList.toggle(iconTheme)
    localStorage.setItem('selected-theme', getCurrentTheme())
    localStorage.setItem('selected-icon', getCurrentIcon())
})

A: This is a common issue called FOUC - flash of unstyled content.
Caused by
What happens is that your page renders (with light style) and then, when the page has finished rendering, the defer script runs (just before DOMContentLoaded).
As the page has already been rendered, you see it with the light styles, until the js has a chance to add your dark-theme to the body tag.
This will have nothing to do with how long it takes to "parse"/"apply" the css, given the assumption that these too are in the  then they will be applied before content is rendered; if this takes a long time then it will still be before the rest of the HTML is rendered (giving a blank page for that duration).
The solution is to run the js as soon as possible within the html document.  eg:

   ... css and other js scripts

   ... rest of body

the script will run at the time it appears in the render process - before the unstyled content is rendered.  So you never see the unstyled content.
Care needs to be taken, for example OPs code also sets a class and a click event on a button; that button won't exist yet.


text:
Q: Prove the multiplicity property for $n!$ I was given this hint in a different problem,

Now use that a prime $p$ occurs in $n!$ with multiplicity exactly $\lfloor n/p\rfloor + \lfloor n/p^2\rfloor  + \lfloor n/p^3\rfloor + \lfloor n/p^4\rfloor +\ldots$
For $$P=\frac{200!}{2^{100}\cdot 100!}$$ And the prime being $p = 3$.

How is the claim for $n!$ true?
Consider $n \ge 6$.
$$n = 6 \implies n! = 720$$
$$720/3 = 240 \to 240/3 = 80 \implies \text{3 comes in twice.}$$
Then, $[6/3] + [6/9] = 2$.
So suppose $3$ occurs in $n!$ with multiplicity,  $\lfloor n/p\rfloor + \lfloor n/p^2\rfloor  + \lfloor n/p^3\rfloor + \lfloor n/p^4\rfloor +\ldots$
It is required to show that, for $(n+1)!$, $3$ occurs in multiplicity,
$\lfloor n+1/p\rfloor + \lfloor n+1/p^2\rfloor  + \lfloor n+1/p^3\rfloor + \lfloor n+1/p^4\rfloor +\ldots$
$(n+1)! = (n+1)n!$.
But I cant prove anything else.
Even intuitively, why does this make sense?

A: Hint: The formula counts the number of multiples of $p$ less than $n$, and then the number of multiples of $p^2$ that are less than $n$, and so on...


text:
Q: Can I use 'Why are you into ~'? Can I say 'Why are you into studying music?' instead of 'How did(do) you happen to study english?'
Is the expression 'Why are you into ~~" grammatically right?

A: Yes, the expression to be into something, like "I'm into bowling" or "Why are you into baseball?" is grammatically correct.
To be into something means that that thing is an interest of yours.  For example, if I said, "I'm into history," that would mean that I have an interest in history and enjoy studying it.
"Why are you into studying ____" does not mean exactly the same thing as "How did you happen to study ____", though.  "Why are you into X?" means why does X interest you?    "How did you happen to study X" means more simply what events caused you to study X?
For example, if I learn that someone had learned Mandarin Chinese, I might simply say, "How did you happen to study Chinese?" and they might say "My work required me to learn Chinese" or "I wanted to be able to talk to my in-laws."  But if I learn that they study languages for fun, I might ask "Why are you into languages?"

A: +1 to @stangdon. Let me add:
To be "into" something is informal. You might say to a friend, "Hey, I hear you're really into football." But you wouldn't write in an academic paper, "After retiring from the presidency, George Washington returned to his home in Mount Vernon and got really into farming."
"Into" can also be used to indicate entering a profession or similar calling. In this case it is used following a version of the verb "to go". Like, "After college, Mr Jones went into accounting." "George decided to go into the priesthood." This usage can be used in formal writing.

A: It's grammatically fine, but that phrase "into ~" is typically used for hobbies and interests, not their work or primary field of study.
I'd also use "How did you get into ~?" instead.


text:
Q: Spring boot default resource I am getting resource with the following manner.
@Value("classpath:user-pass.json")
private Resource resource;

I want to set a default value for the resource if the above resource not found. We can set default value in property extraction as follow
@Value("${some.key:my default value}")
private String string;

I need help in applying a similar formula to resource acquiration.
Resource above is from
package org.springframework.core.io

A: I don't think this is possible. I would say that your best option would be to load the Resource yourself if it is null after Bean creation:
@PostConstruct
private void postConstruct() {
    if (resource == null) {
        resource = new ClassPathResource("default.json");
    }
}