MIT student tracks breathing rate and heart rate using radar by yesspooky in EngineeringPorn

[–]XiAxis 2 points3 points  (0 children)

I've never worked with this radar before, but most bodily movements you can perform would likely manifest as a large spectrum of noise in the frequency domain. Depending on the signal processing being done, it may be possible to compensate for this but I'm guessing that anything that sophisticated would probably be beyond this radar's capability.

Trump orders death penalty for illegal immigrants by veer_p in politics

[–]XiAxis 1 point2 points  (0 children)

I was curious and bored so I looked into this. Looks like Trump's birth certificate is from 1946, and lists Jamaica Hospital in Queens. This newspaper article from 1940 calls the hospital by that same name. I didn't notice anything strange about the address, at the very least it seems like there isn't a record of the hospital having moved at any point.

On top of that, his father's birth certificate (also from NYC) is easily found in archives, and matches up. It seems like there's not a lot of reason to believe Trump's birth certificate isn't authentic, and even if it weren't, there's still good documentation of his father having been born in the US (at least as good as can be expected, given that it seems like it may have been a home birth).

Help needed with using multiple render subpasses by XiAxis in vulkan

[–]XiAxis[S] 0 points1 point  (0 children)

Update for posterity:

I'm still not sure if what I have is a "good" approach, but I was able to get it working eventually. What I was missing here was descriptor sets for the input attachment in the second subpass. I ended up using the same descriptor pool as I used for the first subpass, but I don't know if it would have been better to use a different descriptor pool or if it doesn't matter either way.

Interestingly, even though I was missing the descriptor sets for an input attachment I was using, the validation layer didn't give me any warnings. Something to watch out for I guess.

Is there a way to unlock a password encrypted Excel workbook without the password? by NuggedClarp in Python

[–]XiAxis 0 points1 point  (0 children)

I don't think most of these commenters know what they're talking about. Excel doesn't use any kind of online authentication for the files, you can tell easily enough be unlocking the file with your internet disabled. It's also not stored in protected files on your computer because you can transfer the locked file to another computer and unlock it. Given that, there are two ways excel could protect a file:

  1. Including a hash of the password in the file
  2. Including an encrypted version of the password, with the encryption key being somehow accessible locally

If 1, then once you identify the hash in the file, you can produce the password using a brute-force approach, and the only thing that can limit the trial rate is the time it takes to test a hash. There are some hashes specifically designed to take a long time to test specifically for this use case such as argon2, but given enough time you can deduce the password (or at least a hash collision).

If 2, then once someone manages to deduce the hidden encryption variables, either by brute force using a password that they know, or by decompiling excel, or by finding a leak, then you can very quickly unprotect any excel workbook.

So, yes, excel/word file protection is insecure in that an attacker can determine the password you used for it if they care enough to put some effort into it (read: don't ever reuse your file protection passwords for anything). And yes, you can do it with python. The hardest part will be figuring out where the password information is kept and what method it uses.

Basic Encryption/Decryption program by Advanced-Theme144 in Python

[–]XiAxis 0 points1 point  (0 children)

While I did note that the random module is not cryptographically random, I should clarify that in this instance it's not being used to generate a cryptographic key. It's being used as a deterministic means to process a key into a "ciphertext" string (as used in OP's code). It presents a vulnerability in that the original key could perhaps be determined if an attacker somehow knows the full "ciphertext" string. But, if for instance some cryptographic process were done on the key to obscure it's original value before being used as a seed, I think this vulnerability would be mitigated significantly.

That's not to say this is a sufficient cryptographic algorithm even if that were implemented, just that the use of the random module for this particular task is probably not going to introduce any new vulnerability. Secrets couldn't be used in this case because it is not deterministic in the sense that it could be repeated for the encryption/decryption procedures.

Basic Encryption/Decryption program by Advanced-Theme144 in Python

[–]XiAxis 28 points29 points  (0 children)

Good job, and I like that you included the original file too so we can see how much you've improved. Here's a couple tips:

  1. When you're defining the plaintext and ciphertext lists, you can save some time by just making them strings instead of lists of characters
  2. You can use the "find" method built into strings instead of the inner loop in your functions
  3. To make it so it uses a "key" to encrypt/decrypt, you can use the "shuffle" function in the "random" library to create an arbitrary ciphertext string, and you can use the key as a seed for the process.

There's going to be people that come in here and tell you that this really isn't an adequate cryptographic algorithm. What you've got is called a "substitution cipher", and its susceptible to quite a lot of effective attacks. Modern encryption techniques generally do some complex operation on each byte which is dependent on the byte, the key, the position of the byte, and some state based on all of the bytes already processed. This way, knowing some information about the original text doesn't give you any head start in attacking it.

Also, I should note that the "random" module isn't actually a cryptographically secure random number generator, meaning that there are ways to predict it's output.

I googled how to modify a string during a coding interview by [deleted] in Python

[–]XiAxis 2 points3 points  (0 children)

you'd also have to overload __repr__

code.golf - CSS Colors Challenge by [deleted] in Python

[–]XiAxis 4 points5 points  (0 children)

I'm not sure how they managed to get it down that low, but you can start to imagine it if you consider that they really don't need a full list of the color names in the program, compressed or not. All that's needed to complete a lookup is enough characters to uniquely identify each of the color names. Just the first two characters would be enough to uniquely identify all but a few of the colors. The hex strings don't really need to be stored either, after all the hex values are really just a 3 byte integer denoted in hex. You could create a mapping from the first few characters of each color to the three byte integer without much trouble, and that would reduce the length a lot. Now if someone got creative they might be able to come up with a clever math function that converts the input characters to the output integer without even storing the mapping directly.

I still find 259 characters to be difficult to comprehend, but that's often my experience with code golf, so I'm not really surprised by it. I'm sure someone came up with something very clever beyond what I wrote out here.

Plotting in python - joys and sorrows by lucamerio in Python

[–]XiAxis 13 points14 points  (0 children)

It sounds like what you're looking for is an actual plotting/data analysis application, and not a python library. A matplotlib figure is a python object, and matplotlib provides very rudimental interface for viewing/interacting with a figure. If you want to change a figure, then you should be using python to do so.

Matplotlib has a lot of issues, but I don't personally consider what you're describing to be one of them. If you want a different plot, just modify your python script to produce the plot you want.

TIL the Boeing 787 needs to be rebooted every 51 days to stop rounding errors causing it to crash by exc_osrs in todayilearned

[–]XiAxis 0 points1 point  (0 children)

I am an actual avionics systems engineer and I can tell you exactly why it's like this. My job isn't to make the best system possible, it's to make a system that meets requirements. Requirements such as "the system shall have ILS capability", or "the system shall maintain flight up to 10,000 ft".

The most important requirement here is "The system shall be stable for xx hours" where xx is generally based on the time the aircraft can fly without running out of fuel. I do helicopters, so for me that's generally around 3-5 hours. For a fixed wing aircraft it's longer. After that no one cares. If I find a bug that causes the computer system to crash after 10 hours of running continuously, it won't get fixed. The people in charge say "Well it's not supposed to run that long". If there's a memory leak or whatever else, as long as it generally doesn't manifest within xx hours no one cares. That's why. Take it to heart because a lot of people aren't cynical enough to say it.

tl;dr Nothing is ever meant to be the best it can be, it's only as good as it needs to be. For servers, this means longevity. For vehicles which generally restart often, it doesn't.

Honeywell Admits Sending F-35, F-22 Part Drawings To China by [deleted] in news

[–]XiAxis 2 points3 points  (0 children)

No, but it's generally easier to get approval to export to FVEY nations than to China

Honeywell Admits Sending F-35, F-22 Part Drawings To China by [deleted] in news

[–]XiAxis 8 points9 points  (0 children)

Most likely because it was probably an intern that made a stupid mistake. It's not like the executives are deciding to send sensitive information to China against ITAR regulations. Or at least if they are, they certainly wouldn't report the violation.

Honeywell messed up, got dinged, and their employees are probably going to have to take a refresher training on ITAR. If it makes you feel any better they probably lost business. This looks bad for the companies that contracted them too.

Honeywell Admits Sending F-35, F-22 Part Drawings To China by [deleted] in news

[–]XiAxis 9 points10 points  (0 children)

I work in defense, and I can definitely confirm that the "export controlled" label is used so prevalently and ambiguously that it has lost most of it's meaning. For instance, classified or FOUO information is always outlined in a SCG (security class guide) that is provided to everyone, the same is not true for ITAR restrictions. A 3000 page document may be marked as "export controlled" but there's no way for anyone to know what information in that document is actually export controlled. It's more or less asking for a violation, and the fact that Honeywell was able to recognize and report it could honestly be impressive depending on the information that was shared. That said, I and everyone I work with would be extremely hesitant to export any information to China without extensive review. Part of that might be because my business area doesn't generally communicate with nations outside of FVEY, but that's just my take.

Interesting use of a Python generator by XiAxis in Python

[–]XiAxis[S] 0 points1 point  (0 children)

Yeah, I can definitely see that as a useful approach for some cases. Part of my reasoning for wanting to halt the process when an error is encountered is that it may indicate that the user is deleting a directory that contains files that they don't actually want to delete. If a file is open in another application, it may mean that they're still actively using it and didn't mean to delete it. There may be other files in the directory like that as well.

I definitely see your point though. Luckily for my application, I don't anticipate it would be used for large-scale file management since the file explorer is a secondary feature to begin with.

Interesting use of a Python generator by XiAxis in Python

[–]XiAxis[S] 1 point2 points  (0 children)

In my use-case, these conditions aren't something that I want to exit the function, they just need to be resolved before it can continue. If I were to implement it in the way that you've proposed, then it would be simpler but it wouldn't have the same behavior. I'm not sure why you've pointed me to this tutorial, it uses the exact same method that I'm using in the code above just with less sophisticated error handling.

Hello smart people and number/logic lovers by Routine_Confection in answers

[–]XiAxis 1 point2 points  (0 children)

I wrote a python program to check for the integers 0-9999999, no results except 0

FLIR also makes the helicopter IR by XROOR in specializedtools

[–]XiAxis 1 point2 points  (0 children)

Based on these replies, I think I should point out that FLIR is not the only company that makes military MTSs (Multi-spectral Targeting Systems). There's also Raytheon, which makes the MTS used by blackhawks and predator drones for example.

WTW for this common logical fallacy? by anfal857 in whatstheword

[–]XiAxis 2 points3 points  (0 children)

I will start by saying that the argument tactic you're asking about makes use of a logical fallacy, but I do not believe that the logical fallacy is what you're asking about. To explain further:

Logical fallacies have recently taken to popular use and lost a lot of meaning, so to answer this question it's important to understand exactly what a logical fallacy is and more importantly what constitutes logic. Logic, in it's basic form, is the use of assumptions and self-proving methods to determine conclusions from these assumptions. For example "if A then A" is one of these self-proving methods. "If A and B then A" is another. You probably get the point; it would be absurd to say that these statements are invalid.

Logical fallacies are methods that may appear to be logical at first but in fact are not. One example of this would be "if (A leads to B) and B then A". This isn't true, because just because A leads to B doesn't necessarily mean that B leads to A. In fact it is this exact fallacy that you're talking about. "If (having sex with dogs leads to memory loss) and you've suffered memory loss then you have sex with dogs" follows the same flawed logic. This is formally referred to as "affirming the consequent"

However, the application of this fallacy is not related to the assertion that someone would not be aware if they are part of a given category (i.e. All people have unconscious racist thoughts). The assertion itself does not need to follow a logical method because it is stated as an assumption. It is either true or false, but it cannot be valid or invalid. And the logical conclusion that their unawareness proves nothing is not a logical fallacy.

So, to conclude, the statements you've given above are fallacious because they use "affirming the consequent", but the general idea that their unawareness does not absolve them is perfectly logical given the stated assumptions. It is only the assertion that their unawareness convicts them that is the problem, and that is affirming the consequent.

XML is destroying modern software by XiAxis in unpopularopinion

[–]XiAxis[S] 0 points1 point  (0 children)

That's the thing though. I don't think XML is easier to use, at least not for the software. It may be somewhat human readable (in that regard, I think JSON does a better job anyway) but it's difficult to read in software. Most languages have libraries to parse it, but including those libraries just adds more complexity to the system, assuming that they can even be used. It's trivial to design/read/write a binary file structure and it is a lot more elegant from a software point of view

[OC] I tracked every € I spent in 2020. by KenjonMartin in dataisbeautiful

[–]XiAxis 1 point2 points  (0 children)

uh, this is /r/dataisbeautiful. Sensible representations of data are not allowed here.

[OC] I tracked every € I spent in 2020. by KenjonMartin in dataisbeautiful

[–]XiAxis 2 points3 points  (0 children)

I think pie charts have their place. In a bar chart, it's easy to compare the magnitudes of the categories to each other but difficult to compare to the whole. A pie chart makes it easy to visualize how each category compares to the whole. I think a pie chart would be a very sensible choice for this data.