@tecoholic Maybe the simple solution would be to dump the CSV into a database and let the database take care of grouping the records?
Not as fun as coding it yourself, but it might be (a lot) faster.
@tecoholic There might be cases where you can use knowledge about your records to group them, e.g. if your records are people and you want to group them by age.
Do a linear search to find the min and max age.
Create (max-min)+1 buckets.
Then look at each record again and drop it in the correct (age-min) bucket.
But it all depends on what you're trying to do, so I think we need a little bit more information before we can give a meaningful suggestion.
@tecoholic N!? What algorithm are you using?
Sorting the records should only be something like O(n^2).
After doing that, the duplicate records will be next to each other, so you can find them by doing a linear search, O(n).
@danny You can't without either changing "_if" in "expression" to a pointer to a "if_expression" or changing "condition" in "if_expression" to a pointer to a "expression".
Think of it this way: You're trying to press something (an "if_expression") the size of a "token", an "expression" and two "block_statement"'s into something (an "expression") the size of just an "expression". That obviously isn't possible.
@arkedos The reason it works for the first group is you also want to match the operator (+,-,*,/).
If the reg.exp. picks the wrong pattern in the first subexpression, it can't match the operator. It therefore has to abandon that pattern and try the other one.
If you switch the two possible patterns in the subexpression, i.e. "(\d+\.\d+|\d+)" it works as intended.
I guess the reg. exp. isn't as greedy as I had expected it to be.
@arkedos You might want to escape the "." otherwise it count match a digit.
E.g. \d+.\d+ matches both 3.14 and 314
\d+\.\d+ on the other hand only matches 3.14
@graffen Just because the link on eth0 goes down, doesn't mean the eth0 interface goes down too. it can still be up and keep its addresses.
But other than that I'm out of ideas.
@graffen I don't think it's best practice to give one interface an address that belongs on a net segment on another interface, but I could be wrong.
But it sounds a bit like you want to bridge eth0, eth1, etc. and give the bridge, br0, a bunch of IP-addresses?
@graffen I'm not even sure I know what you mean by "extra IPs on the loopback interface". Isn't 16M addresses enough?
I'm not surprised the lo configuration isn't in dhcpd.conf.
I mean, yes, the machine could send a DHCP-request on the lo interface, but who's going to send the DHCP-response?
The machine itself?
Sure. But from what IP?
What exactly are you trying to accomplish? Maybe there's an easier solution.
@graffen Any hints why it doesn't work?
Is it because "up"/"down" doesn't work at all or is it because "iproute2" isn't installed and you have to use "ifconfig" from the "net-tools" package?
Maybe you need to use stuff like "eth0:1"?
@graffen Doesn't "up" and "down" commands work on Raspbian?
On real Debian systems, I have used something like "up ip addr add 192.0.2.123/24 dev $IFACE" and "down ip addr del 192.0.2.123/24 dev $IFACE" in /etc/network/interfaces without any problems.
@glip Sounds a bit like what happened to wilw. I'm not sure if he's on another instance now, so no @, but he wrote about it on his blog: http://wilwheaton.net/2018/08/the-world-is-a-terrible-place-right-now-and-thats-largely-because-it-is-what-we-make-it/
We're really worried that this could affect services like ActivePub/Mastodon instances, opening them up to lawsuits or requiring expensive filters.
The night is dark and full of standard errors.
My opinions are my own. Nobody else wants them...
Toots in Danish, English and C.
The original server operated by the Mastodon gGmbH non-profit