DeHackEd

DeHackEd t1_jegltx8 wrote

"Keys" are selections of column in a table that are indexed in some way, intended to allow for much faster searching. Typically the index is stored in a different file from the raw table records. With that said...

A "primary key" is the key designed to uniquely identify rows in a table. So if a primary key is defined on columns (a,b,c) then a search with condition "WHERE a=1 AND b=2 AND c=3" will turn up exactly 0 or 1 rows. 2+ rows are impossible. As a result, rules that may allow multiple row matches, especially where NULL is involved, are forbidden. For example, if you run a shopping store, then products could be uniquely identified by their barcode numbers. Duplicate of that should never happen, and if they do then yeah you have a problem that needs solving anyway.

A "foreign key" is a cross-reference between tables. Table X may have a column named A and it's a foreign key reference to table Y which also has a column named A (typically the same name to help reinforce they are the same piece of information for that cross-reference). The database may refuse to allow you to delete information in one table because the other references it, or the act of deleting from one table may cause deletion of data in the other table to keep the foreign key requirements met, depending on settings. It also helps software visualize the relationship between the tables. For example, if you have a table of customers, and a table of outstanding orders, you may not delete a customer if they have any outstanding orders placed, but deleting orders is fine.

"Clustered index" means the actual raw records on disk are sorted to this ordering. There can be advantages to that if you are fetching large amounts of data and you want it delivered pre-sorted... if you ask for it in the same sort order that the clustered index is provided in, then the DB just does sequential disk reads and gets data back pre-sorted, solving that problem without needing to actually perform a sort in memory or anything.

Now let's go back to the primary key: a unique way to identify rows. How do you actually do that? There's 2 common strategies: a unique number typically starting at 1 and counting up indefinitely, or finding some set of columns that are actually enough to uniquely identify a row. The former is what we call a "surrogate" key - something we introduced to assist. The latter is what we call a natural key - something already provided. For our list of products, barcodes make a pretty good natural key. For our customers, names aren't unique, even addresses aren't uniqu and we don't have anything we can give them (damned customers keep refusing our loyalty cards) so we just give them a customer number and each new customers gets the next number. That's a surrogate key. Customers might see the number on their invoices, but by itself the number doesn't mean thing.

56

DeHackEd t1_je80ygv wrote

Health Insurance is something you have to get like any other type of insurance, paying a monthly fee (or getting someone like your employer to pay it for you) and all the fun of shopping around and discovering what is and isn't covered, and what other catches might exist.

By contrast, for example, I had my appendix removed. I'm a Canadian citizen. Was in and out of the hospital, never even discussed a bill or price. Procedure was basically paid for by my (and everyone else's) taxes. Everyone is covered for life-saving procedures for sure at any hospital.

11

DeHackEd t1_jdno3mv wrote

The wheels of a car really need to be perfectly aligned. If the left wheel is facing exactly straight, then the right wheel should NOT be 0.5 degrees turned in either direction. But various bumps on the road and general stress may cause little errors like this to develop. Other variations exist where the wheels become just a little bit "off" from perfectly aligned.

This causes increased wear and tear, especially on the tires, and reduced mileage.

Getting that checked and corrected can be done as part of regular vehicle maintenance.

9

DeHackEd t1_j6oqaxs wrote

A router's job is to find a subnet match in its list of routes, and forward data to that destination. It does this at the binary level. In hardware routers, there's a lookup table that has 3 types of "bits": match 0, match 1, and don't care (X). In particular the don't-care bits must be at the right-most edge and grouped.

Your first /26 is, in the router's table as a 32 bit prefix:

00001010 00000000 00000000 00XXXXXX
     (10)   (0)     (0)     (0-63 range)

The tolerable range of bits is:

00001010 00000000 00000000 00000000
   to
00001010 00000000 00000000 00111111

(When writing a subnet, you always have the don't-care bits as 0, and most software will assume that if you set any of them to 1, it's a mistake to be pointed out)

This means the subnet MUST be split along a binary point. So you 10.0.0.64 through 10.0.1.63 subnet (which is actually the size of a /24) doesn't work because the numerical range is:

00001010 00000000 00000000 01000000 (10.0.0.64)
   to
00001010 00000000 00000001 00111111 (10.0.1.63)

Can't put in "don't care" bits to get the coverage you want.

1

DeHackEd t1_j6na8mr wrote

The metric system was designed to, as much as possible, use scientifically measurable things for its units and that the "bigger versions" of units are just multiples or fractions of 10, 100, 1000, etc.

Most of the measurements involve water. A litre of water on earth at sea level (average conditions, admittedly) weighs exactly 1 kilogram and in a square shape would be exactly a box 10cm by 10cm by 10cm. Similarly a square of water 1m on each side is 1000 kg, or a ton. So now you have a way, given only the definition of a meter, to get the weight of a kilogram or vice versa.

Whereas the imperial system has a "foot" defined by... I'm not sure what really, but it divides into 12 inches, or can be combined by 3 to make yards, or 5280 to make miles. Eww, what terrible numbers. In metric a kilometer is just 1000 meters. A kilogram is 1000 grams. Etc. Nice consistent numbers.

11

DeHackEd t1_j2bwtot wrote

First, microwaves only heat up certain types of materials and its effectiveness varies. I have largely the opposite result: the plate is fine and the food is reasonably warm/hot. Water is one of the things it will heat up, which is good since it's common in foods. Interestingly it performs worse with ice, which is a problem for frozen foods.

Second, the microwave effect inside has hot-spots and cold spots. A microwave is basically a high power radio wave generator and the effects of waves cancelling each other out and amplifying each other come into play inside. It's why there is a turntable at the bottom of most microwaves: to keep the food moving around so that no one spot stays in a hotspot or a coldspot. But right at the center of said turntable doesn't actually move.

These combine to make frozen foods in microwaves pretty bad. Lucky hotspots are prone to have little pockets of ice melt into water, which then heats up more rapidly since water reacts better to the microwave in general. This is why you're instructed to take it out and stir. Microwave's doing a crap job and needs help.

Your plate doesn't normally get hot, but if a hotspot is touching the plate, heat will spread normally.

1

DeHackEd t1_iy3mcrz wrote

People often ask why deleting files is faster than creating files. The answer is because the bulk of the file's data is NOT erased, because that's considered wasted effort. When the new file comes along it will write over the data, completely unaware of what was once there. So actually blanking out the old data doesn't really accomplish anything and the "delete" is really fast by just dealing with the file listing paperwork.

...unless there's privacy concerns that warrant actually clearing the data, specifically because preventing undelete from being possible is the goal. This is sometimes called "secure delete". But if you're uninstalling a video game, who cares?

4

DeHackEd t1_ixtg83n wrote

Are you renaming them after saving them to disk, or changing the URL to have a different name?

Some web sites offer the same file in multiple formats. Changing the URL means you're requesting the file in a different format, and some sites can oblige and actually give you the alternate formats.

−2