1 With 80 Zeros

0 views
Skip to first unread message

Gaetan Boren

unread,
Aug 5, 2024, 12:57:44 AM8/5/24
to discwigoldclic
Ihave an array, S, like this [x x x] (one-dimensional). I now create a diagonal matrix, sigma, with np.diag(S) - so far, so good. Now, I want to resize this new diagonal array so that I can multiply it by another array thatI have.

There is a new numpy function in version 1.7.0 numpy.pad that can do this in one-line. Like the other answers, you can construct the diagonal matrix with np.diag before the padding.The tuple ((0,N),(0,0)) used in this answer indicates the "side" of the matrix which to pad.


sigma.resize() returns None because it operates in-place. np.resize(sigma, shape), on the other hand, returns the result but instead of padding with zeros, it pads with repeats of the array.


However, this will first flatten out your original array, and then reconstruct it into the given shape, destroying the original ordering. If you just want to "pad" with zeros, instead of using resize() you can just directly index into a generated zero-matrix.


I m looking for best and fastest way to remove all my data From hard drive.I M on linuxOf you know something with doing this operation on a USB stick share with me.Other ways are also acceptableAnything quickBest regards


with SSD you can take advantage of TRIM, For example (in windows) if you have win10 running and the SSD in question mounted as a secondary drive such as D: then it's as easy as re-GPT'ing the disk and making one large partition on the entire SSD and then using Tools on D: to cause TRIM to happen, which will zero out the SSD. How to manually cause TRIM to happen in linux on mounted file systems is with fstrim which is provided by the util-linux rpm.


And there is always the tried and true dban which is dariks boot and nuke which is a bootable linux that you put on cd or usb, and it boots a stripped down linux OS giving only the menu option of which disk to choose and various wipe methods. On an 8+ terabyte hard drive of today, choosing a 7-pass wipe method, would not be fast, but it does offer a quick zero out menu option. DBAN is often the easiest when you have one pc, one disk which is your operating system, and you can't entirely nuke a running operating system disk while it's in operation.


In the enterprise space, if you are using a self-encrypting disk (SED) which I believe are always an SSD, all you have to do is in the BIOS/EFI under the RAID card menu is change the encryption key of the disk which is one mouse click... while it does not zero out data the existing data is lost because it can no longer be self-decrypted. There's a fancy term for this... basically amounts to a "secure delete" where the AES encryption algorithm in affect no longer has the key on the existing data.


There is method to my madness I have need to relocate a sector on my root partition which is at the end of the drive so I'm forcing a write on the sector to let the drive electronics re-map it, I'm also testing the rest of the drive (just in case), my Veeam backups were failing on snapshot backup until I found out why, it fixed it.


The other idea was to run an ANOVA with linear contrast. I'm looking for input about using a GLM vs ANOVA and linear contrast? How do we decide which is appropriate? And how do you deal with zeros in log transformed data?


As a follow-up there is a package called bestNormalize which will test out multiple "normalizing" transformations for you, you can try that if you want. If you inspect the log_x transformation it does exactly as I described, adds a small constant to every data point (max(0, -min(x) + eps)).


An ANOVA is just another way to compare two linear models. You can do an ANOVA on a GLM! So first you have to decide what kind of model to fit. From what you've written your response variable is virus, so work through these questions to see if they help you decide what kind of model to fit. This is a cut down version of a handout I give my ecological statistics students.


My company has recently implemented ArcGIS Pro and I am completely useless when using it (so it feels). In ArcMap I could simply highlight a column with numbers in it, right click, choose properties and then pad with zeros so that every number has the same amount of digits. With Pro on the other hand, everything seems to be in Python, or else I would have to add padding manually...This is really putting a damper on my project which is due in a few weeks...any suggestions? Image below is what I want Pro attribute table to look like, but Pro attribute table gets rid of padding!


If you go ArcGIS Pro's new "Fields" view, there is a column for Number Format. Double click fields that are Numeric and a "..." should appear. Click that to open the number format options which should look familiar. It should have the same ArcMap options like Rounding, Alignment, and Pad with zeros. Make your changes and then be sure to "Save" the field changes.


dd is an incredibly versatile means to convert and copy a file. The documentation contains a full list of the operands that are available, but I'll just focus on the items in the command above, one element at a time.


Reading /dev/zero will result in an endless series of zeroes. There are a number of alternatives that people might reach for if a zero is either unnecessary or not ideal, such as /dev/random and /dev/urandom which are random number generators.


The /dev/sdc location is a storage device. If there is a number after the final letter, such as /dev/sdc1, then it is a distinct partition on that storage device. By writing to /dev/sdc rather than /dev/sdc1 you are telling dd to essentially scrub the storage medium of its superblock and all media descriptors, effectively eliminating any partitions that might have existed on the device.


I generally run this command on all new storage devices when I first buy them. It allows me to completely scrub anything that might already exist on the drive while also testing write speed and looking for bad blocks. Twice I have found problems with USB sticks by doing this, and I was able to exchange them with the seller for properly working ones without any trouble after showing the results of the dd and subsequent disk checks. It is a very handy utility but, be warned, it will never ask "Are you sure?" before obliterating a partition, and there is no undo. If you make a mistake, you need to have good, recent backups ready.


First, when you write any given data to a rotational magnetic-storage drive, that data gets transformed into magnetic domains that may actually look very different from the bit pattern you are writing. This is done in part because it's much easier to maintain synchronization when the pattern read back from the platter has a certain amount of variability, and for example a long string of "zero" or "one" values would make it very hard to maintain synchronization. (Have you read 26,393 bits, or 26,394 bits? How do you recognize the boundary between bits?) The techniques for doing this transformation between computer data bits and storable chunks have evolved over time; for example, look up Modified Frequency Modulation, MMFM, Group Code Recording and the more general technology of run-length limited encodings.


Second, when you write new data to a sector, the magnetic domains of the relevant portions of the platter are simply set to the desired value. This is done regardless of what the previous magnetic domain was at that particular physical location. The platter is already spinning under the write head; first reading the current value, then writing the new value if and only if it's different, would cause each write to require two revolutions (or an extra head for each platter), causing write latency to double or greatly increasing the complexity of the drive, in turn increasing cost. Since the limiting factor in hard disk sequential I/O performance is how quickly each bit passes under the read/write head, this wouldn't even offer any benefit to the user. (As an aside, the limiting factor in random I/O performance is how fast the read/write head can be positioned at the desired cylinder and then the desired sector arrives under the head. The major reason why SSDs can be so fast in random I/O workloads is that they completely eliminate both of these factors.)


As pointed out in Giacomo1968's answer, one reason why you might want to overwrite the drive with some fixed pattern (such as all zeroes) would be to ensure that no remnants of previously stored data can be recovered, either deliberately or accidentally. But doing so will not have any effect on the drive's performance going forward, for the reasons stated above. Another reason, which could conceivably be said to "improve performance", as pointed out by liori's comment, is to help compression of unused portions of stored disk images, but even that doesn't improve the performance of the system in use.


So if security and privacy is a concern, then you might want to write zeros to the drive to make sure all free space is truly wiped. But security and privacy is the absolute only reason you would ever wipe out free space with zeros since doing something like that never improves performance.


Later i will explain why, but steps would be ˋddˋ to fill entire SSD, use bs=1M, much faster than bs=1, and forget the count parameter to make it go till end (it will give the error of no more space when reach the end, that is spected so don't worry to see such error, it must be shown); after full fill use gparted or whatever you want to write a master table (MBR/GPT/etc) as needed, this will 'trim' all the disk, then create partitions with desired format, etc.


My experience: Using software to read / test the whole SSD (it tells you how much time takes to read each 'sector') i was getting a lot of pairs of '512byte secttors' (1KiB blocks) that are unreable, and their position changes randomly and number of fails varies from 2 to 24, etc.; after full fill with zeroes and recreate the master table (that vauses trim) no more unreadable sectors.

3a8082e126
Reply all
Reply to author
Forward
0 new messages