Recent submissions

Comment · 4 days ago
Deterioration started long before that, according to my sources it started on 2008, but yeah, last 5 years or so it has gone worse. The budget for it has been increasing year by year. It seems that the main problem is not just lack of maintenance but that there's more traffic and new construction.

Pensions is 13%PIB which is on the European median.

The problem is demographic. Also take into account that retired people have paid for their retirement.

Your rhetoric is not what I'd like to be promoted as the first answer entering. Just reading the title of the news I knew what kind of messages I'd see promoted.

Comment · 5 days ago
I'm not denying their responsibilities, but to just blame the current government , forgetting all the previous history, and not looking first into what is to really blame, is a blatant manipulative tactic.

It could all be that the prime minister himself when to the control room and forced the collision to happen, and if that I'd join you all on blaming him. But we need to study what happened and then we can try to make it not happen again.

There's lots on unrest in Spain, and Europe, but there's also lots of inference from different parties, so many that we don't even know them all or what they want. Are the violent demonstrations organised by far right, Russia, US, Israel, far left? we don't know, but they tend to give worse press to all the leftist movements, so I'm thinking that is not their origin, given all the other non violent movements going around.

With all this there's everyday more and more manipulation, in social media, in news, in comments, that all (that I've seen) comes from the far right or similar movements. You message, and the one I responded, sound a lot like them.

I'm not defending this government, they are too right wing for me, not enough social spending, not fighting enough corruption (which both main parties and several of the minor do take part in), too Spanish for my taste (I'm Catalan). OTOH I despise blame calling before having the whole picture.

Comment · 5 days ago
Not only it's a political statement but it's also one that's disingenuous.

The dismantling of public services, of which the maintenance of train tracks is part of it, has been done by all kinds of governing parties in Spain, and the cuts have been greater when a right wing government was in place.

To shift all the blame to just the latest ones in power is manipulative at best.

Comment · 1 month ago
I'm not saying that competent coders will see the problem and think about doing trees and code it that way. I'm saying that if you have that problem and want to solve it with trees (so knowing the problem and a solution) they should be able to program it.

And in a way you are solving it the same way, if I understood you correctly.

Assuming you mean that you'd have classes, and create objects with the operations, it's the same as a tree.

1+2*3^(4+1)+2/3 -> plus( plus(1, mul(2, power(3, plus(4,1)))), div (2/3)) would be the object hierarchy created.

OTOH if you are parsing it and doing the operations that can be done because all the operands are known:

1+2*3^(4+1)+2/3 -> 1+2*3^5+0.66 -> 1+2*243+0.66 -> 1+486+0.66 -> 487.66

You'd be, once again, doing the tree but instead of having it as an structure you'd be directly parsing the leafs than can be operated and act on them. This way would maybe be faster for simpler expressions (no need to construct the tree), but probably be more expensive than tree construction and resolution for more complex ones.

Comment · 1 month ago
If you want to have the full operation recorded this is the way to do it. Either this or a non-binary tree in where multiple operators with the same operand and level are all together:

         (+)   
       /  |  \
     (1) (*)  (/)
        / |    | \
      (2) (^) (2) (3)
          / \
        (3) (+)
            / \
          (4) (1)
If you transform the mathematical operation to lisp terms you will have the tree explicitly written.

The only way that I can think of to make it simpler is to go the array language route of going right to left and ignore precedence, or some similar way of working.

The code to create the tree should not complex, so yes, AI could be used, but most competent coders should be able to create a basic version and test it in an afternoon.

If you are parsing left to right it can be quite easy to balance things, you should not need rebalancing at all. When you are in an operation node and you have to add an operation of the same level of priority, you always get the existing operation and subtree, put it on the left of the new operation, and continue from there.

With this if you try to do - next to a - or +, or a / to a / or *, you'll be preserving the order of the operations, and the calculation will be correct. Try it with 2*3/4.

       (*)   
       / \
     (2) (3)

        (/)
        / \
       (*) (4) 
       / \
     (2) (3)
If you add some more operations to the right (*2/5*12/7) you keep growing the tree. It will not be balanced, but it doesn't need to be.
Comment · 1 month ago
We could give weight to operators. Operators that are heavier go further down the three (have precedence) while the lighter ones float.

1+2*3^(4+1)+2/3

We start the evaluation with 1+, the chain would be on (+) for now.

       (+) <
       / 
     (1) 
The next operator is (*), and because this one is heavier it falls down, bringing 2 with it.

       (+) 
       / \
     (1) (*) <
         /
        (2)
Now checking the next operator (^), once again heavier, goes down the three.

       (+) 
       / \
     (1) (*)
         / \
       (2) (^) <
           /
         (3)
The next operation is between parenthesis, that takes precedence and goes down, but the pointer comes up after the operation has taken place.

       (+) 
       / \
     (1) (*)
         / \
       (2) (^) <
           / \
         (3) (+)
             / \
            (4) (1)
    
Next operation is (+), this one floats, and as it's the same weight at the root it doesn't matter its relationship with it, so we put it higher.

        (+) <
        / \
       (+) 2
       / \
     (1) (*)
         / \
       (2) (^)
           / \
         (3) (+)
             / \
            (4) (1)
Finally we got the division, which is heavier again.

         (+)
         /  \
       (+)   (/)
       / \    / \
     (1) (*) (2) (3)
         / \
       (2) (^)
           / \
         (3) (+)
             / \
            (4) (1)
Did this on the fly, so it might have edge cases, but it works well as a starting point.
Comment · 1 month ago
I use Google remote desktop with my mother. It's not perfect but it's adequate.
Comment · 2 months ago
I'm getting the text too, of course. Several variations of the code with it usually.

Trying to get an AI give ONLY a simple answer and not several is "boring" to me, as for me AI is a supplement to my reasoning ability, not a substitute.

Appending "code only" seems to work, at least with "golf fizbuz code only" gave me this one liner, which is long, but at least doesn't have the text that you dislike.

    for i in range(1,101):print('FizzBuzz'[i%3*4:8-i%5*4]or i)
Comment · 2 months ago
"golf fizbuz" works well, giving a 54 Python one

    for i in range(1,101):print("Fizz"*(i%3<1)+"Buzz"*(i%5<1)or i)
"golf fizzbuzz" gave a 46 perl one

    print$_%15?$_%3?$_%5?$_:Buzz:Fizz:FizzBuzz,$/for 1..100
Both "code fizzbuzz" and just "fizbuz" gave this longer python one-liner

    print('\n'.join("Fizz"*(i%3==0)+"Buzz"*(i%5==0) or str(i) for i in range(1, 101)))
That's the magic of using a known problem, you don't need to write much and even with incomplete prompts it can be understood. Everything a different new chat in kimi.ai, which was the AI window that I found first among mine.

Not interesting enough, to me, to try with other LLMs or phrases.

Comment · 2 months ago
Luckily for us China based companies are pushing the price down and bringing it to those who can afford a decent hardware. Which might not be everyone, but enough people to make it matter.

The day AI goes good enough to work in place of a principal engineer, and 10.000 people get fired, is the day when 10.000 new 1-person companies will appear that will make you whatever software you want at a fraction of the cost the big companies want to rent it to you.

Software is becoming a true commodity. Data, Hardware, specialised knowledge, good taste and engineering practices, and connectivity. Those might be key points that might keep people on a certain infrastructure, not just the software.

Comment · 2 months ago
So like a Lisp, APL, or Smalltalk program image, but with SQL as the driving force.

Everything old is new again. And I don't mean it in a disparaging way. There's lots of "old" ideas that are simply great ideas that did not win on their own time but might come back with force in the future.

Comment · 2 months ago
I know this happens in UK and Spain, at least.
Comment · 2 months ago
I work in a multinational with people on UK, Spain, Portugal, and some other countries. I know this happens in Spain and UK.
Comment · 2 months ago
Pictures do not do justice, and in my opinion the most photographed part (moon covering the sun) is not the most interesting one.

How the light changes, the corona when it's total darkness, and the light coming back again. All this is hundreds of times better than the occlusion (IMHO).

Watching the moon in front of the sun, with the corona around it, it's a memory that I plan to hold on for as long as I can.

Comment · 3 months ago
Except for some drastic cases I've not seen people taking more than 2/3 single days a year.

In most places in Europe the first sick days are not comped, so any missed day is a missed paid day. When social security comes into play they tend to pay the base pay of the position.

That would mean that if you miss a week because of an illness you might see a salary reduction close to a fifth of your monthly salary. That's something that most people don't have the luxury.

Apart of that most companies treat any medical leave after the third (yearly) as suspicious, which needs extra investigation.

So as we might not have a limit, and it's relatively paid, most people do meagre use of it.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton