[ Other – Society & Culture ] Open Question : How come smarter people tend to be less sheepish and don’t follow what most generic boring people do just to fit In with society?

examples include einstein , copernicus, Galileo, plato, da vinci, MLK, malcom x, the founding fathers of america, Stephen hawking, abe Lincoln, nelson Mandela, Charles Darwin, carl sagan, Johannes kepler Isaac newton, noam Chomsky, Ghandi, @ioerr its not a stereotype, and I never implied that smart people don’t conform to social norms, my point is that smarter people are less likely to be generic normies

Generic method to transfer file from Ubuntu to Andoid and Windows share

As we know SMB can be used to transfer file to Windows share from Ubuntu. And SFTP can be used to transfer from Ubuntu to Android mobile device(with FTP server on mobile side).

I would like to ask if there any generic method/solution for transferring files ubuntu to Windows share and Android mobile?

Designing a generic associative table

I need the ability to associate two entities of the same or different types. Take the concept of planes and trucks that have the ability to radio to each other.

+----------------------+ |        Airplane      | +----------------------+ | AirplaneId           | | Wingspan             | | MaxTakeoffWeight     | | etc...               | +----------------------+  +----------------------+ |         Truck        | +----------------------+ | TruckId              | | CargoCubicFt         | | IsResidential        | | etc...               | +----------------------+  +----------------------+ | CommunicationBetween | +----------------------+ | [AirplaneOrTruckId]  | | [AirplaneOrTruckId]  | +----------------------+ 

What’s the best way to accomplish these associations?

Notes

I can’t combine or abstract out the two entities (e.g. can’t combine planes and trucks into a Vehicles table) because each entity has many unique properties that the other doesn’t have.

The only other idea I have is to create a table like this:

+----------------------+ | CommunicationBetween | +----------------------+ | Entity1              | -- "Airplane" or "Truck" | Id1                  | -- AirplaneId or TruckId | Entity2              | -- "Airplane" or "Truck" | Id2                  | -- AirplaneId or TruckId +----------------------+ 

… but that’s not an elegant solution.

gdb error for keepassx/keepassxc: “Cannot find user-level thread for LWP” “generic error”

I tried to run gdb on keepassxc, but encountered an unfamiliar error:

$   gdb /usr/bin/keepassxc GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.  Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /usr/bin/keepassxc...Reading symbols from /usr/lib/debug/.build-id/80/9b2f2d5157a8872dcd140977ba01adfca0e7ad.debug...done. done. (gdb) run Starting program: /usr/bin/keepassxc  [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Cannot find user-level thread for LWP 15111: generic error (gdb) quit 

The GDB FAQ gives some common causes for errors like “Cannot find user-level thread for LWP 15111: generic error” (the number after LWP is different each time):

9. GDB reports “Cannot find user-level thread for LWP 23957: generic error”, how do I fix this?

There are several common causes:

  • You have a mismatch between libthread_db.so.1 and libpthread.so.0 (this most often happens when you have multiple installations of glibc, or when you debug a program on remote target, and host and target have different glibc versions).

  • You are using 64-bit debugger to debug 32-bit program, and your kernel has a 32-bit ptrace emulation bug. FIXME: add reference to specific kernel fix.

This has also been known to happen when one of DOSEMU’s signal handlers is invoked from DPMI context, where the $ gs register has a value different from what GDB and/or libthread_db.so.0 expect; SamuelBronson found running the program under gdbserver to alleviate the problem, at least with version 6.8.50.20090620-cvs on i386.

https://sourceware.org/gdb/wiki/FAQ

I am running a 64-bit machine with i386 enabled:

$   getconf LONG_BIT 64 $   dpkg --print-foreign-architectures i386 $   dlocate libthread_db.so.1 libc6-i386: /lib32/libthread_db.so.1 libc6:i386: /lib/i386-linux-gnu/libthread_db.so.1 libc6:amd64: /lib/x86_64-linux-gnu/libthread_db.so.1 $   dlocate libpthread.so.0 libc6-i386: /lib32/libpthread.so.0 libc6:i386: /lib/i386-linux-gnu/libpthread.so.0 libc6:amd64: /lib/x86_64-linux-gnu/libpthread.so.0 

and keepassxc does use libpthread.so.0:

$   ldd /usr/bin/keepassxc | grep thread         libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f889b803000) 

but so does texstudio:

$   ldd /usr/bin/texstudio | grep thread         libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007efd2a09e000) 

and I can load texstudio just fine.

$   gdb /usr/bin/texstudio  GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.  Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /usr/bin/texstudio...Reading symbols from /usr/lib/debug/.build-id/8c/49a9b8c208b2b75fbd3dc0ad9d9bf009886a47.debug...done. done. (gdb) run Starting program: /usr/bin/texstudio  [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffe915a700 (LWP 20816)] [New Thread 0x7fffda55f700 (LWP 20822)] [New Thread 0x7fffcb7e9700 (LWP 20823)] [New Thread 0x7fffca2fe700 (LWP 20824)] [New Thread 0x7fffc96d9700 (LWP 20825)] [New Thread 0x7fffc0937700 (LWP 20826)] [Thread 0x7fffc0937700 (LWP 20826) exited] [Thread 0x7fffc96d9700 (LWP 20825) exited] [Thread 0x7fffca2fe700 (LWP 20824) exited] [Thread 0x7fffe915a700 (LWP 20816) exited] [Thread 0x7fffcb7e9700 (LWP 20823) exited] [Thread 0x7fffda55f700 (LWP 20822) exited] [Inferior 1 (process 20796) exited normally] (gdb) quit 

Furthermore, keepassxc is a 64-bit executable:

$   file /usr/bin/keepassxc /usr/bin/keepassxc: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=809b2f2d5157a8872dcd140977ba01adfca0e7ad, stripped 

The closest thing to any existing information I could find was this bug that the owner could not reproduce after a reboot (for what it’s worth, I can reproduce after a reboot):

Segfault: new in version 2.0.2, Ubuntu MATE 16.04

Application segfaults/exits with a bus error, sometimes on launch, sometimes later.

This is a new development after updating to version 2.0.2.

Trying to launch with GDB produces:

Starting program: /usr/bin/keepassx [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Cannot find user-level thread for LWP 5299: generic error 

https://bugs.launchpad.net/ubuntu/+source/keepassx/+bug/1752353

That’s actually a bug in keepassx, not keepassxc, but I get the same behavior in both.

$   gdb /usr/bin/keepassx GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.  Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /usr/bin/keepassx...(no debugging symbols found)...done. (gdb) run Starting program: /usr/bin/keepassx  [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Cannot find user-level thread for LWP 14893: generic error 

One debugging strategy I’ve found is to use set verbose on before running the executable. Here is the output in case that is of use:

Starting program: /usr/bin/keepassxc  Using PIE (Position Independent Executable) displacement 0x555555554000 for "/usr/bin/keepassxc". Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/ld-2.27.so...done. done. Reading symbols from system-supplied DSO at 0x7ffff7ffa000...(no debugging symbols found)...done. Reading in symbols for rtld.c...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libsodium.so.23...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libQt5Network.so.5...Reading symbols from /usr/lib/debug/.build-id/46/2cebeefa58e5ccff5415b007f6a24425f29ada.debug...done. done. Reading symbols from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5...Reading symbols from /usr/lib/debug/.build-id/f2/5f1c8a72b396ac28a985f7297d3ba0ed6cd567.debug...done. done. Reading symbols from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5...Reading symbols from /usr/lib/debug/.build-id/d2/9dfc2cdd3a3ae0e1110f0c87c2778c8998efbe.debug...done. done. Reading symbols from /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libykpers-1.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libzxcvbn.so.0...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libargon2.so.0...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libgcrypt.so.20...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libz.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5...Reading symbols from /usr/lib/debug/.build-id/06/31cf3ce1c914e12696428ca4ed84951f588f6e.debug...done. done. Reading symbols from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5...Reading symbols from /usr/lib/debug/.build-id/fb/710113d79e6ddae5d5495d0721dfe1b70d5e82.debug...done. done. Reading symbols from /usr/lib/x86_64-linux-gnu/libstdc++.so.6...Reading symbols from /usr/lib/debug/.build-id/57/0bf32e8698fce3bfacc4a8b010827f842d1dd6.debug...done. done. Registering libstdc++-v6 pretty-printer for /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ... Registering xmethod matcher '%s' with %s' ... Registering xmethod matcher '%s' with %s' ... Registering xmethod matcher '%s' with %s' ... Registering xmethod matcher '%s' with %s' ... Registering xmethod matcher '%s' with %s' ... Registering xmethod matcher '%s' with %s' ... Registering xmethod matcher '%s' with %s' ... Registering xmethod matcher '%s' with %s' ... Registering xmethod matcher '%s' with %s' ... Registering xmethod matcher '%s' with %s' ... Registering xmethod matcher '%s' with %s' ... Registering xmethod matcher '%s' with %s' ... Registering xmethod matcher '%s' with %s' ... Registering xmethod matcher '%s' with %s' ... Registering xmethod matcher '%s' with %s' ... Reading symbols from /lib/x86_64-linux-gnu/libm.so.6...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libm-2.27.so...done. done. Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libc-2.27.so...done. done. Reading symbols from /lib/x86_64-linux-gnu/libpthread.so.0...Reading symbols from /usr/lib/debug/.build-id/28/c6aade70b2d40d1f0f3d0a1a0cad1ab816448f.debug...done. done. Registering glibc-pthread-locks pretty-printer for /lib/x86_64-linux-gnu/libpthread.so.0 ... [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Reading symbols from /usr/lib/x86_64-linux-gnu/libGL.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libpng16.so.16...Reading symbols from /usr/lib/debug/.build-id/d5/32f2230c3c84289a0833fc0c1352aaac5892c6.debug...done. done. Reading symbols from /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libgcc_s.so.1...Reading symbols from /usr/lib/debug/.build-id/41/bdc55c07d5e5b1d8ab38e2c19b1f535855e084.debug...done. done. Reading symbols from /usr/lib/x86_64-linux-gnu/libnghttp2.so.14...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libidn2.so.0...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/librtmp.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libpsl.so.5...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libnettle.so.6...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libgnutls.so.30...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libyubikey.so.0...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libusb-1.0.so.0...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libjson-c.so.3...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libgpg-error.so.0...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libdbus-1.so.3...Reading symbols from /usr/lib/debug/.build-id/c1/63c9bb03410c4c05458a989a804ff527d4f63f.debug...done. done. Reading symbols from /usr/lib/x86_64-linux-gnu/libicui18n.so.60...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libicuuc.so.60...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libdouble-conversion.so.1...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libdl.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libdl-2.27.so...done. done. Reading symbols from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0...Reading symbols from /usr/lib/debug/.build-id/75/81e089260b8198caa28c2e16bd2353e7a62225.debug...done. done. Reading symbols from /usr/lib/x86_64-linux-gnu/libGLX.so.0...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libfreetype.so.6...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libgraphite2.so.3...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libunistring.so.2...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libhogweed.so.4...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libgmp.so.10...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libp11-kit.so.0...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libtasn1.so.6...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libkrb5.so.3...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libk5crypto.so.3...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libcom_err.so.2...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libkrb5support.so.0...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libresolv.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libresolv-2.27.so...done. done. Reading symbols from /usr/lib/x86_64-linux-gnu/libsasl2.so.2...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libgssapi.so.3...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libudev.so.1...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libsystemd.so.0...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libicudata.so.60...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libpcre.so.3...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libX11.so.6...Reading symbols from /usr/lib/debug/.build-id/44/1896d78103c8cf264ba06687cd49c700a2c5b5.debug...done. done. Reading symbols from /usr/lib/x86_64-linux-gnu/libffi.so.6...Reading symbols from /usr/lib/debug/.build-id/35/55b5f599c9787dfddbf9e8df6f706b9044d985.debug...done. done. Reading symbols from /lib/x86_64-linux-gnu/libkeyutils.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libheimntlm.so.0...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libkrb5.so.26...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libasn1.so.8...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libhcrypto.so.4...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libroken.so.18...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/librt.so.1...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/librt-2.27.so...done. done. Reading symbols from /lib/x86_64-linux-gnu/liblzma.so.5...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/liblz4.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libxcb.so.1...Reading symbols from /usr/lib/debug/.build-id/3d/49ac024ca8f7e36f5296a7d0d7f083ab1c8a62.debug...done. done. Reading symbols from /usr/lib/x86_64-linux-gnu/libwind.so.0...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libheimbase.so.1...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libhx509.so.5...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libcrypt.so.1...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libcrypt-2.27.so...done. done. Reading symbols from /usr/lib/x86_64-linux-gnu/libXau.so.6...(no debugging symbols found)...done. Reading symbols from /usr/lib/x86_64-linux-gnu/libXdmcp.so.6...(no debugging symbols found)...done. Reading symbols from /lib/x86_64-linux-gnu/libbsd.so.0...(no debugging symbols found)...done. Cannot find user-level thread for LWP 17450: generic error Current language:  auto The current source language is "auto; currently c". 

Version information:

$   apt-cache policy keepassx keepassxc gdb keepassx:   Installed: 2.0.3-1   Candidate: 2.0.3-1   Version table:  *** 2.0.3-1 500         500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages         100 /var/lib/dpkg/status keepassxc:   Installed: 2.3.1+dfsg.1-1   Candidate: 2.3.1+dfsg.1-1   Version table:  *** 2.3.1+dfsg.1-1 500         500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages         100 /var/lib/dpkg/status gdb:   Installed: 8.1-0ubuntu3   Candidate: 8.1-0ubuntu3   Version table:  *** 8.1-0ubuntu3 500         500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages         100 /var/lib/dpkg/status 

My questions are:

  • Is this reproducible on other machines and versions of Ubuntu?

  • If so, is this a bug in gdb, a bug in both keepassx and keepassxc, a bug in libc-dbg, or somewhere else?

Looking for a generic name substitute in Elvish, Draconic, Celestial, or Sylvan

I have a Far Traveler Sorcerer High Elf character who has lost most of his early memories so he does not remember his name. I am looking for a generic word or name substitute to make him more playable in one of the languages he is fluent in (see title). Some suggestions for a translation would be “the sorcerer” or “wanderer” or “traveler” or even “name”. Thanks in advance.

Is there a generic way to boot the installed OS using a usb device?

I have tried to install Lubuntu 18.04 on an Acer Switch 3 (which allows only EFI boot, has no legacy mode). For more than a week I have not managed to make the system start.

Today I have restarted the tablet after a long time, and very suprisingly, Lubuntu has booted immediately. Then, after a lengthy update, I was asked to restart, and now it does not start anymore. Instead I get the message

Default Boot Device Missing or Boot Failed. Insert Revocery Media and Hit any key Then select ‘Boot Manager’ to choose a new Boot Device or to Boot Recovery Media

Since the system is there, I would like to boot it nevertheless. Unluckily, I forgot to create a boot media.

So this is my question: Is there any “generic” way to boot the installed system using a usb device? A tool or something that can analyze the disk and reckognize a bootable OS?

Thanks in advance!

Why do we need to supply a prealoccated array to the generic ArrayList toArray() function? [on hold]

We must supply a preexisting array of the correct type to the .toArray() method when converting an ArrayList<> to a typed Java array…

    //Convert to string array     String[] array = list.toArray(new String[list.size()]); 

Why the extra ceremony?

Why cant the .toArray() method allocate the array of the correct type for us and just return it like this…

    // DOES NOT COMPILE BECAUSE THE .toArray() method returns Object[]     //Convert to string array     String[] array = list.toArray(); 

If it was just a matter of avoiding changing the signature of the .toArray() method from before generics, couldn’t there be a .toTypedArray() method or something like that?

Should I do a runtime type check inside generic constructors?

Given this generic class and constructor,

class A<E extends Number> {      A(E number, Comparable<E> comparable) {         //...     } } 

it is ensured that a call to the generic constructor will check the arguments’ types at compile time:

new A<>(Integer.valueOf(4), Integer.valueOf(4)); // ok new A<>(Integer.valueOf(4), Long.valueOf(4)); // error: Cannot infer type arguments for A<> 

(of course, even explicitly stating the parametrized type instead of letting the compiler infer the type gives the same end result because the relation cannot be satisfied).

However, the raw constructor allows both calls to compile:

new A(Integer.valueOf(4), Integer.valueOf(4)); new A(Integer.valueOf(4), Long.valueOf(4)); 

with the warning on both invocations:

Type safety: The constructor A(Number, Comparable) belongs to the raw type A. References to generic type A<E> should be parameterized 

My question is, should the constructor perform type checks (e.g., instanceof, isAssignableFrom or isInstance) in its body to ensure that the class is not created in an invalid state in case the raw constructor is called?
These type checks are completely redundant if the constructor call is parametrized. Is the compiler warning about type safety a good enough excuse to not do these checks?

Creating generic DAL project in .net

I am looking to create generic DAL project in .net/.net core so it can be used for multiple projects like it will act as template etc.

I am right now aiming to use entity framework to suffice this requirement. Our requirements are as below.

  1. Reading ConnectionString, making connection to DB etc should be already setup. We will make minor changes in config file and it should be ready.
  2. Methods should be generic which will work with all DBs upto extent.
  3. We will create a package of this project and use it in other projects

Though I agree it will differ DB to DB and important part is creation of models per DB, but definitely I am not looking for it.

So, I am looking for the path/guidance to start over it. I have following some below links which uses generic repository pattern(But its way of patters not the project).

Entity Framework Core Generic Repository

https://blog.codingmilitia.com/2019/01/16/aspnet-011-from-zero-to-overkill-data-access-with-entity-framework-core

Any help on this appreciated !