Hacker Newsnew | past | comments | ask | show | jobs | submit | more BiteCode_dev's commentslogin

Well, if you want to go toward hard games, you have Super Meat Boy, vvvvvv, and Cuphead. Or even games that scales from "finishable" to "very hard to 100%" like Celeste.

So good hard games still exist.

It's just not the default difficulty anymore. Mario, Tomb Raisers, they all became very casual. I don't mind, I still enjoyed the Switch mario. I'm getting older, and I don't want to have to memorize entire levels with a ms timing to get through anymore.

But if you do want that, you can.


Any interaction with authorities should be legally required to be recorded. If you are held for 72h, there should be 72 hours of videos, not one minute less.


Amusingly, any windows or mac python program comes with a TCL interpreter, thanks to the tkinter GUI:

    >>> import tkinter as tk
    >>> tk.Tcl().eval('puts {hello, world}')
    hello, world
    ''


Nooope, not on linux at least

    >>> import tkinter
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.9/tkinter/__init__.py", line 37, in <module>
        import _tkinter # If this fails your Python may not be configured for Tk
    ImportError: libtk8.6.so: cannot open shared object file: No such file or directory


I specifically stated "any windows or mac python program".

Indeed, most linux distro packaging teams decided to split tk in a separate package that is not installed by default. Same for pip and setuptools. Of course, this made getting a congruent python experience extra hard, on a platform with already plenty of gotchas for python setup, but hey, they saved a few Mo.


I didn't know about pip and setuptools being separate packages. That explains some things.


Of my understanding, tkinter is not in python packages because it needs an WM to run correctly


Oh I understand the motivation. I also know it caused a lot of pain, for very little gain.


Manu Linux distributions have tclsh preinstalled.


Just now:

  $ python3
  Python 3.6.9 (default, Jan 26 2021, 15:33:00)
  [GCC 8.4.0] on linux
  Type "help", "copyright", "credits" or "license" for more 
  information.
  >>> import tkinter
  >>> tkinter.Tcl().eval('puts {hello, world}')
  hello, world
  ''
  >>>
Ubuntu 18.04; but it's not on a machine running 20.04


On Debian GNU/Linux Tkinter is provided by the python-tk package (might differ in other distros).


> As a developer I never had much problems building systems in multiple locales.

That's really not the hard part

The hard part is to follow all the legal and social conventions. Formats for dates and money, symbols and colors that you can or cannot use, making sure you get timezones right, serving a right to left design to the middle east, dealing with the various way to enter a phone number or a home address, translating efficiently db content or SPA pieces...

Just translating from a *.po file, yes, it's easy.


I was not talking about translations only.

Formats for dates and money are available in almost every programming language as library. You don't have to invent this yourself. The same for timezones, as long als all dates in your DB are UTC.

And inputs for phone numbers and addresses fall in the category of 'Falsehood programmers believe about...'.

If you store your data normalized all the programming language locale libraries make your life easy.

/2c


> as long als all dates in your DB are UTC.

times don't have to be UTC but need the timezone info attached - be it implicit (all are UTC) or explicit, e.g. in text form rfc3339.

Stripping the time-zone is information-loss and usually not desirable.


All that tells you is the timezone the user was in (or if you're unlucky the timezone the server was in) when the data was recorded. So it's not usually very valuable information.

It doesn't tell you anything about the time zone this particular user would want to see it in today, which depends on quite a few factors including where they are and what the timestamp relates to (booking, event, log of past events etc).


> So it's not usually very valuable information.

then you may be fine with that information loss. But is is one nevertheless.


Well, garbage in garbage out, of course.

But in applications where it matters, you make sure you know the source timezone where the data enters your system.


Which applications does it matter for?


This can matter when timezone definitions change, such as when a country decides to start/stop following daylight saving time.

If I schedule something for 1 pm 6 months from now, and a transition to/from DST is supposed to happen at some point during those 6 months, and then my country decides to not follow DST anymore or to follow DST year-round, once you update your timezone database and convert your UTC stored time to my timezone, it's going to either be 12 or 2 pm now. This is probably not what users want, unless they scheduled the event to happen a certain time interval after some other event that's not affected by timezones.


Thanks, I was thinking more about an application that requires it day to day.

So a future event made before the time zone transition of a country? That's rare enough that I think a one-off transition plan would be fine.

Given the downsides of storing dates with time zones (comparison, confusion etc), it doesn't seem very attractive to me.


Data you store that you later want to analyse in a way that cares about the time of day.

E.g. when during the day is traffic at its worst, when is temperature highest, etc.


You combine UTC with the Timezone of the user when it's rendered out and when you don't have that time (f.e. email to customer) you'll have to get a bit creative and calculate the timezone with the user data you have. If you only have an email and no other data, you include the used timezone so they can calculate their local time from that themselves.


To keep all information, you also need to store the timezone that the event originally was.

E.g. When comparing temperature charts from different places in different timezones, you may want to show them in a way that "noon local time" is on the same place of the X-axis in both cases.

Or more usual: I keep a log of what I do during a day. If I now move to another timezone and want to look at the log, I don't want the times shown in my current timezone. I want the timezone I was in back then.


The debate that started this thread proved my point without needing any effort of my part :)


The sentry team is pretty cool too. Not to mention the product is very well made.

I now almost always setup the free tiers by default on new web projects. I have yet to regret it.


They were at the top of the pyramid, that's what happened.

Same as when Microsoft had IE6, or the French phone market company was a one provider deal, or when Blackberry was eating the smartphone market.

They stop to innovate. They milk the cow.

It works for some times, then a new guy arrive in town, Firefox for IE6, Free for French Telecom, iPhone for Blackberry...


Fact 137: don't read articles with 136 facts, there is no way you can put them in practice or even understand them all, and it will overwhelm you.


Or displaying the street names I'm interested in. Because for some reasons, some are not displayed, and I'm walking on it.


Also, even among the not newbies, most programmers are average.

Because most people are average, thanks to our Gaussian nature for talent. Besides, for most people, IT is a job, not a passion. Like in any industry.

It's true for everything, doctors, electricians, geographers.

So if you love your field, and you are passionate about what you do, enjoy that, but don't expect others to follow.


Unfortunately, it's true, most toolchains are stuck in the past, and don't deal with non-ascii characters or even spaces very well. In fact, I just learned that spaces in .deskop files values could cause trouble after a long debugging.

But it's a shame.

In Europe, we do have a lot of non-ascii characters everywhere. Ubuntu puts a "Vidéo" and a "Téléchargements" directory in my $HOME because I'm french. If I were to use my name as my username I would have even more troubles.

I'm careful with not using special chars in names for work, but it feels like I'm a girl trying to not dress sexy in the wrong part of town: necessary, but I shouldn't have to do this, and it's definitely the others to blame.

All in all, I thank the Gods of encoding for Python 3 unicode handling. Having a scripting language that does the right thing out of the box is wonderful on this side of the pond.


"The right thing" for filesystem entries is transparently copy, do not evaluate. A file path is a mem-copied, length value sized block of identifier you don't ever mangle. If you must mangle it, touch only the necessary areas as directed. (E.G. join with os.pathsep and do not normalize anything).

Want to offer Unicode validation? Sure having that as an OPTION is fine. Forcing it means I can't rely on that tool to handle real world data which happens to not be valid but is still a valid file-system address.


One thing I've noticed is that ext, xfs, btrfs and zfs all explicitly store a length field alongside the filename. There's nothing inherent in the disk layout of these filesystems preventing them from supporting filenames with embedded slash and nul characters - those limitations are imposed by the kernel's VFS implementation. It would be nice to have a special version of open, exec etc. where one could specify a filepath as a length-prefixed array of length-prefixed strings.


ODBC (ISO 9075-3) got it right 30 years ago: all strings are accompanied by the length argument, which also accepts the sentinel value NTS, when you mean a null-terminated string.


I once thought about using JSON arrays for filepaths so all possible strings would be valid filenames.


That the beauty of it with python:

- if you want to treat paths like unicode strings, you can. Which is great for simple scripts where you don't want to deal with complexity. And 99% of the time, it's enough with modern OSes.

- if you want to threat path as bags of raw bytes, you can. Which is necessary to transparently copy and do not evaluate, as you said, for covering edge cases.

- if you need to actually deal with those as strings but don't want to loose data for edge cases, so a mix of the 2 above, you can use surrogate escapes


Where does that filepath come from? A config file; are you going to do your text processing, and interaction, with other modules in byte[] arrays in Python 3+?

Python 2's unicode model was _closer_ to correct, the trivial coercion between byte[] and Unicode.

Conversion also shouldn't imply, force, or check Validation nor Normalization. Labeling a bytestream with an Encoding and validating / normalizing that encoding should be options. Operations on bytestreams with encoding related attributes should set them to either 'unknown' result or to a proper output type if they're aware the manipulations will still yield a valid encoding.

Normalization is more complex, since Unicode strings can be normalized in different ways, then combined, and still be a valid string but no longer uniformly normalized.


No seriously, create a user d'Artagnan.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: