SQL, NFC, pktmon, IPv4, HubSpot


  1. Nice post about SQL databases and schemas: A terrible schema from a clueless programmer (@ rachelbythebay.com). So true, but in many cases performance doesn't even matter. Most important thing quite often is actually as simple and bug free solution. Adding some performance improvements by adding complexity, which of course can astronomically improve performance, can also add lots of development time and bugs. Especially in situations where same data is modified by multiple separate programs. Been there, done that, over and over again. I do very simple schemas and solutions when data amounts are small and there's no (expected!) reason to assume that there will be so much data that performance would matter. Anyway, there could have been also bloom filters and in-memory caching optimizations and stuff with the solution. So the final solution in the blog post was still far from perfect. It still hits the database and index. When performance does matter, I've usually add some slight internal caching and filtering optimization and that can easily give 10x boost in execution performance. For simple checks like the one, I've often use single key value table, where key is binary hash of the tuple. Value is data + timestamp, if that data is even required. If there's no risk of collisions, ie, unique key values, then the timestamp alone is enough. Another horrible thing which I do from time to time, is store all state data in JSON or pickle-file. Because if all data is being touched on every run, there's no especial reason to use for database, just read data, process it and save back. - Yet I strongly believe at this point I'm repeating myself, so over and out.

  2. I've been repeatedly annoyed by bad user experience when paying with NFC contactless credit card. Problem is that the terminal says that the transaction failed and got rejected, instead of saying that you'll need to enter PIN. That problem has persisted for quite a while (years!). But what's the reason behind it? After some thinking, it's probably a bad protocol design and changing security requirements that indirectly created the problem. Maybe the requirement for PIN code was originally triggered by the smart card itself. After some potential security issues, it's probably been changed so that when the backend says that PIN is needed it just starts rejecting transactions. Reason for this is that the backend probably only is able to give a simple answer passed or rejected. This leads to the problem. Now the terminal doesn't ask for PIN anymore, it just starts randomly rejecting transactions. That's the best guess and reasoning I can come up with little experience I have. See: Contactless Payment (@ Wikipedia)

  3. I don't know how I did miss it, but Windows 10 got built-in packet capture feature. Just run pktmon and you're able to record packet level network traffic easily. The recorded ETL file can be then analyzed with Microsoft Network Monitor. No need to install pcap (@ Wikipedia) / Wireshark (@ Wikipedia) anymore for light analysis, which isn't always preferable especially when analyzing production environment(s). See: pktmon (@ learn.microsoft.com)

  4. IPv4 Cleanup Project (@ GitHub). This one made me smile. Oh why, why? Why just no IPv6, doing stuff like this would break so many things.

  5. I've been helping a friend with HubSpot (@ Wikipedia) HubL language and templates and functions. HubL itself seems to be pretty straightforward and simple language. But what makes it hard, is that all web developers don't have great programming or straddling skills. As example editing wrong function several times and wondering why it's not working. Well, when you change code which isn't even being called / used, it usually has no effect. As old developer I'm learned to always first check using any very crude means that the segment of code, CSS, HTML, template, configuration file, whatever is even being used and effective. Break it down on purpose, or change something which very easy to see and confirm. Only then continue figuring out what really needs to be done. HubL: Functions and filters, etc, accessing data structures and so on.

  6. Something different? Small Modula Reactors (SMR) article from IAEA (@ iaea.org), is this the future of nuclear power?

  7. Side note! Google probably has finally fixed the Google Sites saving content (or so I thought). It doesn't anymore end up in error state randomly as it did earlier, which was absolutely enraging. Yet they still haven't fixed the race condition / randomity in new page creation. Quite randomly the page is generated in different style. Either with or without title, and using different fonts. I can't believe how incompetent they are. And just when I said that first thing, now the saving of this document failed again. Reconnecting... Saving failed. Omfg. Oh well.

2023-01-15