Hacker News new | past | comments | ask | show | jobs | submit | candl's comments login

Not DOS, but I remember playing a copy of Settlers III and was surprised when iron smelters produced pigs instead of iron.


That one was quite famous. Also the CD came with some sub-channel data, that only one program was able to copy. It had sheep on it but forgot its name


That must have been CloneCD then: https://en.m.wikipedia.org/wiki/CloneCD


At least some games in the Arma series have also used a copy protection that messes with gameplay if it judged the game to be pirated. I don't know if it used tricks to trip crackers, though -- Wikipedia mentions intentional errors on optical media that didn't get passed on by disc copy software.

https://en.wikipedia.org/wiki/FADE


Should one use the result type for handling errors or exceptions or both? What's the rule in F#?

When should you prefer immutability over mutability since both are possible in F# and it probably has a measurable impact on performance?

When should you use objects instead of records or unions in F#?

Since mutability is possible, any reason to not allow an explicit return or continue? It makes certain code patterns much less nested and easier to read.


I recently had to script reading a large Excel XLSB file. Using pyxlsb it took about two minutes. I found an alternative library with significally better performance - python-calamine, but this one reads all the data to memory consuming GBs of RAM, so was a no starter. Then I tried PyPy and miraculously the same script with pyxlsb takes 15 seconds.


Years ago I was discouraged that there is a lack of a grid component like WPF's Grid or Delphi's TGridPanel. Something that I can specify the number of rows/cols and their sizing. Has this changed since? Or perhaps this is achievable nowadays with (nested?) TFlowPanels?


If i understand what you mean, i don't think you need TFlowPanel at all and you can just use a regular TPanel (for small grids) or TScrollBox (if you want scrollbars) and modify ChildSizing with Layout set to cclLeftToRightThenTopToBottom and ControlsPerLine to the number of columns you want. You can also set the spacing properties to allow space between the controls and/or the Enlarge/Shrink Horizontal/Vertical properties to force children use the full width/height. I did a quick test[0] and seems to work fine. Note that as this uses the controls' automatic sizing, the controls will always be resized to match their autosize, however you can use the Constrains property to set a minimum (or maximum) size and/or use a TPanel for a "cell" so you can specify whatever size you want (or have cells with multiple controls).

[0] https://i.imgur.com/DZBrSvh.png


For scripts I use Python, but I like to use PHP for short quick scripts when a database is involved since all it takes is to install php and php-pdo to have a consistent api for db access to get started with, which for python is not the case. But from time to time I am reminded how bad PHP and outright dangerous can be. Just the other day I had an array like this: ["123"=>"foo", "321" => "bar"] on which I used array_keys expecting to get ["123", "321"] as a result. Surprised why my script was not working the way it was supposed to I found out that the result was actually [123, 321] instead. Yep, PHP casts strings to numbers in this case when it can. I will hit a "gem" like this every now and then, there are plenty of such dumb things scattered in PHP that will bite you the least expected way that makes me stop and think to use something else.


> all it takes is to install php and php-pdo to have a consistent api for db access to get started with, which for python is not the case

What's the difference between that and `pip install psycopg2` (which actually seems easier to me)?


pdo is a common interface layer for databases for php, like jdbc in java or ado.net in C# so I can use the same api for any supported database. In python technically dbapi standard exists for the same task, but the driver apis annoyingly vary so much between themselves that if i have to i go with sqlalchemy, but it's no longer a lightweight solution


That makes sense, thanks. It seems I somehow forgot that databases other than Postgres exist.


Haven't touched Blazor in 2 years. In the context of blazor server, what's the recommended pattern for state management? Does it make sense to use MVVM (e.g. via MVVM Community Toolkit for source generated observable properties etc) or plain C# objects would suffice with manually calling StateHasChanged() whenever necessary? (I guess that since rerenders are driven by DOM events the situations where manually calling StateHasChanged() is quite low)


I've been using blazor since release in 2019 and can count on one hand the amount of times a call to StateHasChanged() was used and actually needed when doing a peer review

Most of the time I've seen that function used it was due to improperly written asynchronous code.


The only gripe I have with PHP is that the standard library while extensive is a total inconsistent mess. Would rather see that addressed first.


It's unlikely to happen. 10-20 years of use for many of those community generated functions is a lot to break. It may happen eventually, but I wouldn't count on it.


Question to those familiar with IPv6. My company has /24 IPv4 PI blocks. We are not a LIR. Can I request a /48 or larger IPv6 prefix from my sponsor LIR (what is the largest IPv6 prefix that can be obtained this way?) Can such IPv6 prefix (not being a LIR) be further distributed to customers? (e.g. we offer some internet access) - afaik there were some restrictions when not being a LIR. I am not sure what the current state of IPv6 policy is.


If you're talking about the RIPE region, then; - Can I request a /48 or larger IPv6 prefix from my sponsor LIR -> Yes. Something bigger than a /48 might be hard, but /48 shouldn't be any problems. - Can such IPv6 prefix be further distributed to customers? -> No. A IPv6 PI assignment can only be used by yourself and your own infrastructure and not assigned to customers[0].

Other RIRs will have the information on their website, or your sponsoring LIR will be able to answer any questions :)

[0] https://www.ripe.net/publications/docs/ripe-738 section 7


Thank you. Just to make things clear, customer from section 7 also equals end user? That is, if I were given for example a /48 from a sponsor LIR then I am forbidden to divide that and delegate resulting prefixes via DHCP/PPPOE to end user CPEs to whom I want to simply provide dual stack internet access?


Yes that's exactly whats not allowed for PI space. But you can get a PA subnet from your sponsoring LIR and use that for your end users.


Can someone enlighten me on the LIR acronym? Google is no help


Local Internet Registries

Solved it googling "lir ripe"


Usually the easiest way: https://en.wikipedia.org/wiki/LIR


I am fearful of adopting Flutter for this reason.


Flutter is different as it is 100% OSS so if Google cancels it, its development could theoretically be continued outside of Google. Of course, this depends on the presence of enough demand for that. Mozilla has laid off their full time Rust staff (including some people whose actual responsibility was different but they still contributed to the Rust compiler) and the Rust project survived. Instead these people got hired by companies like Amazon and Futurewei. Some are less involved in Rust now, some return. Some risk remains though, as if nobody is using Flutter, nobody will keep it alive.


Is OpenBSD still largely single-threaded or have there been SMP improvements in the network stack over the years? The feature set OpenBSD has is impressive, but is there a large gap in networking perf compared to Linux/FreeBSD?


From my $work computer:

    $ uname -a
    OpenBSD XXXXX 6.9 GENERIC.MP#3 amd64


    $top
    load averages:  0.83,  0.62,  0.44                                                                                                                                                            
    94 processes: 93 idle, 1 on processor                                                                                                                                                                       
    CPU00 states:  0.5% user,  0.0% nice,  0.2% sys,  0.3% spin,  0.6% intr, 98.4% idle
    CPU02 states:  6.5% user,  0.0% nice,  1.9% sys,  0.4% spin,  0.0% intr, 91.1% idle
    CPU04 states:  4.9% user,  0.0% nice,  1.6% sys,  0.3% spin,  0.0% intr, 93.1% idle
    CPU06 states:  4.0% user,  0.0% nice,  1.1% sys,  0.3% spin,  0.0% intr, 94.6% idle
    CPU08 states:  1.4% user,  0.0% nice,  0.6% sys,  0.2% spin,  0.0% intr, 97.8% idle
    CPU10 states:  1.4% user,  0.0% nice,  0.5% sys,  0.2% spin,  0.0% intr, 98.0% idle
    CPU12 states:  0.6% user,  0.0% nice,  0.3% sys,  0.1% spin,  0.0% intr, 99.0% idle
    CPU14 states:  0.7% user,  0.0% nice,  0.3% sys,  0.1% spin,  0.0% intr, 98.8% idle
    Memory: Real: 3292M/5988M act/tot Free: 9109M Cache: 1692M Swap: 0K/15G


The person you're responding to was asking about network performance. I imagine specifically regarding pf (packet filter, the firewall component).

To the grandparent: PF is still single threaded. If you had performance issues with that before you may still have them, but CPU improvements over time may have negated that impact. It's worth trying it out again.


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

Search: