• 30 Posts
  • 2.02K Comments
Joined 2 years ago
cake
Cake day: June 20th, 2023

help-circle
  • Tldr the new lease on life is they are doing a couple more years of software updates for it. I think there is some wisdom on c/googlepixel about what models to get. I smile when I see the article describing how great it is that you can get a 512GB storage model for $400 and that the huge storage is such an attraction. I can get a 512GB MicroSDXC card for my Moto G for $40, heh heh heh, and 2TB cards are a thing now too (IDK if they will work in my phone). The Pixel’s main benefit as I see it is GrapheneOS, so the new Google P7 software updates aren’t that important.






  • If the drive has bad sectors that it can’t read right now, it likely had other sectors that were marginal and got copied (remapped) to new spare sectors before they became unreadable. So there is still potentially recoverable data in the remapped sectors, and not much you can do about it.

    Basically, writing zeros to the disk is about as good as you can hope for. If your data is s00per seekrit to the point where you can’t stand the possibility of any bits at all being recovered, you basically have to melt the drive. Otherwise, zero it and send it in.

    Next time, set up encryption ahead of time, so your new drives never see plaintext. Some drives have a “secure erase” feature that is basically a crappy version of this built into the drive.








  • Ermph, this is C specific and shouldn’t be extrapolated to other languages. Since you’re writing in C you are trying to show your chops as a low level programmer. Therefore, showing that you know how to implement a hash table is worthwhile, so you should do it yourself. You could add a comment to the code saying something to that effect. Again that’s just for C. Implementing your own hash table in Python instead of using the built-in one would be crazy. Implementing one in C++ instead of using the stdlib or some other one would have to be carefully justified.

    I do have to wonder what you are up to in this day and age, pursuing what sounds like junior level C projects. I would say that whole approach is something of a dead end. You’re more employable with higher level languages than with C these days, I would have to say. Or if you write something in Python that incorporates some C functions that you write using Python’s C API, that shows you can operate at multiple levels at the same time, which is even better.






  • I think it is best to have some understanding of how an OS works, and how Python works, before asking whether you can write an OS in Python.

    Python is basically a scripting wrapper around a bunch of C functions (“builtins”) and there are means of installing additional C functions if you need them. Without any of the builtins, you really can’t do much of anything. For example, “print(2+2)” computes the string “4” (by adding 2+2 and converting the result to decimal), then calls a builtin to actually print the string on the console.

    For an OS, you will need quite a few more C functions, mostly to control timers and task switching, the main functions of an OS. Given enough C functions though, in principle you can write an OS.