HN user

xcombelle

46 karma
Posts1
Comments71
View on HN

" I can't imagine anything else you can possibly store about relative elements besides index and order (and nothing). Graphs are their own other planet, and I don't think we can easily say much about them. So the 3 data structure types you can have are:

1. indexed data structures with an O(n) worst-case operation

2. order-less data structures with an O(1) worst-case operation

3. sorted data structures with an O(log n) worst-case operation

That's it. Let me know what you think"

I disagree.

sorting is a O(n*log(n)) worst-case operation for example.

How I eventually resolve this kind of problems.

    minimum = +Inf
    for b in bar.naz():
        if not some_filter(b):
            continue
        b = some_op(b)
        minimum = min(minimum, b)
    foo(minimum)
Yes, plain old procedural python. data flow from top to bottom. it allows `print` debugging, very usefull to debug some_filter and some_op are broken.

tour de france organisation has a long tradition to do more than closing eyes and even encourage doping/cheating practice (for exemple making the race harder and harder) it is a fair part of how it became a $100M business. source: i’m french

Go with PHP 3 years ago

I just don't get why people in php use lazy comparison when you know that "0e4"=="0e5" in php.

and yes, Laravel use lazy comparison (hundreds of times). And yes at least three bugs where caused by this use.

see: https://github.com/laravel/ideas/issues/698 for why I'm a bit grumpy with php ecosystem

1- try to run the last version of python, there is speed improvement in 3.10 and 3.11

     >>> import sys; sys.version
     '3.10.4 (main, Dec  2 2022, 17:52:13) [Clang 14.0.0 (clang-1400.0.29.202)]'

     51.94417405128479
     37.79175686836243
     100.8145821094513
2- global variable lookup is costly in python, putting the whole thing in a main() function halves the running time
     22.97948908805847
     22.47922682762146
     59.1025867462158
link to my code:

https://gist.github.com/xcombelle/8ac84ccb276f8996ed1a458ee2...

one of the "feature" of ads is that they track you in a cross website way. and as no having cookies & co, gemini makes this job a lot harder for an advertiser.

    sections: [
        "one"
        "two"
        "three"
    ]
and
    sections: [
        "one"
        ["two" "three"]
    ]
exists already and is named rebol (and their derivatives)

if you know the number is a factorial for example

    9! = 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1
you have are half way of having prime factorization, you can just to compute the prime factor from 1 to 9

and you get

   9! = 3^2 x 2^3 x 7 x 3 x 2 x 5 x 2^2 x 3 x 2 x1

it is not json

  # Usual pipewire configuration variant
  wireplumber.components = [
    { name = libwireplumber-module-default-nodes , type = module },
    { name = policy-device-profile.lua, type = script/lua }
  ]

  # Actual JSON
  "wireplumber.components" : [
    { "name" : "libwireplumber-module-default-nodes" , "type" : "module" }
    { "name" : "policy-device-profile.lua", "type" : "script/lua" }
  ]

  # Even more loose syntax without separator characters
  wireplumber.components  [
    { name  libwireplumber-module-default-nodes   type  module }
    { name  policy-device-profile.lua   type  script/lua }
  ]