HN user

fdomingues

16 karma
Posts3
Comments10
View on HN
10g Upgrade 2 months ago

What are the use cases for multi gbps home network or internet access? With a 1/1 Gbps link we could use 500 Mbps to transfer 5 TBytes per day of home assistant backups, time machine deltas, security footage..., and still have the other 500 Mbps to do whatever we want.

A valid HTML zip bomb 12 months ago

That content shift on page scroll is horrendous. Please don't do that, there is no need to auto hide a side bar.

Is useful to do code generation/transformation, for example in this utility[1] it uses the information provided on the declaration of the class to generate the methods required by the base class.

The user of the utility write this:

    class Book(objects.Object):
        title: Optional[str]
And the generated class code is:
    class Book(Base):
        __slots__ = ('title', )
        title: typing.Optional[str]
    
        def __init__(self, title=None):
            self.title = title
    
        @classmethod
        def from_data(cls, data):
            title = data.get('title', None)
            return cls(title=title)
    
        def to_data(self):
            data = {}
            if self.title is not None:
                data['title'] = self.title
            return data
    
        @classmethod
        def from_oracle_object(cls, obj):
            return cls(title=obj.title)
    
        def to_oracle_object(self, connection):
            obj = connection.gettype('Book').newobject()
            obj.title = self.title
            return obj
[1]https://github.com/domingues/oracle-object-mapping

C++ Is NOT 9.4 Times Faster Than Python in Prime Number Test

I added 3 lines to the Python code and got it 10x faster:

    (venv) $ python prime.py 
    Number of primes between 0 to 1000000 = 78498
    Elapsed time: 6.502481937408447
    (venv) $ python prime.py 
    Number of primes between 0 to 1000000 = 78498
    Elapsed time: 0.6258630752563477
Diff:
    3c3,5
    < 
    ---
    > import numba
    >  
    > @numba.njit
    14a17
    > @numba.njit
$PHP = ; 8 years ago

$=${$}[$]; $($);

Actually some time ago I found some piece of alien PHP code (a backdoor) in my server, and I couldn't understand it! I did't know the $($); syntax. After searching for that and not finding anything I discovery that exist one special Unicode character that is invisible.

Full code here: https://imgur.com/a/Cggdx