Skip to content

Latest commit

 

History

History
554 lines (388 loc) · 30.4 KB

2021-06-12.md

File metadata and controls

554 lines (388 loc) · 30.4 KB

< 2021-06-12 >

2,264,208 events, 1,196,246 push events, 1,795,151 commit messages, 108,016,402 characters

Saturday 2021-06-12 02:04:53 by Scrungel

What's up, it's me, bruce, And have I got an update for you. Deets in description

Yeah there's the player changes and that wacky camera man, uhh it kinda works, kinda doesn't. Doesn't update for the player going down yet because it's being a bastard but also for going up it's a little bit shit if I'm honest. The grand plan I had is actually wank in practice so maybe we'll have to fiddle around with it a bit to make it good.

Oh yeah there's the interface and shit now as well.


Saturday 2021-06-12 02:43:10 by Miguel de Icaza

Embrace the magic that is keyboardLayoutGuide and get out of the hell that was univese of half hacks for tracking the terminal


Saturday 2021-06-12 05:03:28 by Vladimir Oltean

net: dsa: add support for the SJA1110 native tagging protocol

The SJA1110 has improved a few things compared to SJA1105:

  • To send a control packet from the host port with SJA1105, one needed to program a one-shot "management route" over SPI. This is no longer true with SJA1110, you can actually send "in-band control extensions" in the packets sent by DSA, these are in fact DSA tags which contain the destination port and switch ID.

  • When receiving a control packet from the switch with SJA1105, the source port and switch ID were written in bytes 3 and 4 of the destination MAC address of the frame (which was a very poor shot at a DSA header). If the control packet also had an RX timestamp, that timestamp was sent in an actual follow-up packet, so there were reordering concerns on multi-core/multi-queue DSA masters, where the metadata frame with the RX timestamp might get processed before the actual packet to which that timestamp belonged (there is no way to pair a packet to its timestamp other than the order in which they were received). On SJA1110, this is no longer true, control packets have the source port, switch ID and timestamp all in the DSA tags.

  • Timestamps from the switch were partial: to get a 64-bit timestamp as required by PTP stacks, one would need to take the partial 24-bit or 32-bit timestamp from the packet, then read the current PTP time very quickly, and then patch in the high bits of the current PTP time into the captured partial timestamp, to reconstruct what the full 64-bit timestamp must have been. That is awful because packet processing is done in NAPI context, but reading the current PTP time is done over SPI and therefore needs sleepable context.

But it also aggravated a few things:

  • Not only is there a DSA header in SJA1110, but there is a DSA trailer in fact, too. So DSA needs to be extended to support taggers which have both a header and a trailer. Very unconventional - my understanding is that the trailer exists because the timestamps couldn't be prepared in time for putting them in the header area.

  • Like SJA1105, not all packets sent to the CPU have the DSA tag added to them, only control packets do:

    • the ones which match the destination MAC filters/traps in MAC_FLTRES1 and MAC_FLTRES0
    • the ones which match FDB entries which have TRAP or TAKETS bits set

    So we could in theory hack something up to request the switch to take timestamps for all packets that reach the CPU, and those would be DSA-tagged and contain the source port / switch ID by virtue of the fact that there needs to be a timestamp trailer provided. BUT:

  • The SJA1110 does not parse its own DSA tags in a way that is useful for routing in cross-chip topologies, a la Marvell. And the sja1105 driver already supports cross-chip bridging from the SJA1105 days. It does that by automatically setting up the DSA links as VLAN trunks which contain all the necessary tag_8021q RX VLANs that must be communicated between the switches that span the same bridge. So when using tag_8021q on sja1105, it is possible to have 2 switches with ports sw0p0, sw0p1, sw1p0, sw1p1, and 2 VLAN-unaware bridges br0 and br1, and br0 can take sw0p0 and sw1p0, and br1 can take sw0p1 and sw1p1, and forwarding will happen according to the expected rules of the Linux bridge. We like that, and we don't want that to go away, so as a matter of fact, the SJA1110 tagger still needs to support tag_8021q.

So the sja1110 tagger is a hybrid between tag_8021q for data packets, and the native hardware support for control packets.

On RX, packets have a 13-byte trailer if they contain an RX timestamp. That trailer is padded in such a way that its byte 8 (the start of the "residence time" field - not parsed by Linux because we don't care) is aligned on a 16 byte boundary. So the padding has a variable length between 0 and 15 bytes. The DSA header contains the offset of the beginning of the padding relative to the beginning of the frame (and the end of the padding is obviously the end of the packet minus 13 bytes, the length of the trailer). So we discard it.

Packets which don't have a trailer contain the source port and switch ID information in the header (they are "trap-to-host" packets). Packets which have a trailer contain the source port and switch ID in the trailer.

On TX, the destination port mask and switch ID is always in the trailer, so we always need to say in the header that a trailer is present.

The header needs a custom EtherType and this was chosen as 0xdadc, after 0xdada which is for Marvell and 0xdadb which is for VLANs in VLAN-unaware mode on SJA1105 (and SJA1110 in fact too).

Because we use tag_8021q in concert with the native tagging protocol, control packets will have 2 DSA tags.

Signed-off-by: Vladimir Oltean [email protected] Signed-off-by: David S. Miller [email protected]


Saturday 2021-06-12 06:25:31 by ElectroPerf

Revert Latency Commits To Fucking Fix The Ghost Touch Issues

  • This thing made users spam me to suck my balls.. bruh..
  • Authorship? No Fucking kangers dont give authorship.. so fuck those who die for authorship.
  • Ok so keep these bitches aside, its Ryuuji who suggested me that X00TD's gay NVT touch drivers dont support low latencies.

This reverts commit 6fd057dc601c88f8be660a13fcd01ef3e160f41d.

Co-Authored-by: RyuujiX [email protected] Signed-off-by: ElectroPerf [email protected]


Saturday 2021-06-12 07:37:01 by Marko Grdinić

"8:50am. I am up. Let me chill a bit and then I will start. Actually, let me fix some bugs I figured out during the night first so I do not forget them.

    inl full_house() =
        let rec loop_triple rank =
            if 0 <= rank then
                if count_suits hand (rank:) = 3 then
                    inl c1,c2,c3,_ = find_suits hand (rank:)
                    let rec loop_pair rank' =
                        if rank = rank' then loop_pair (rank'-1)
                        elif 0 <= rank' then
                            if count_suits hand (rank:rank') = 2 then
                                inl c4,c5,_ = find_suits hand (rank:rank')
                                hand_score {score=Score.full_house; hand=c1,c2,c3,c4,c5}
                            else loop_pair (rank'-1)
                        else flush()
                    loop_pair (NumRanks-1)
                else loop_triple (rank-1)
            else flush()
        loop_triple (NumRanks-1)

The first problem is here.

if count_suits hand (rank:rank') = 2 then

This should be <=. The pair in a full house could be a part of trip.

    inl flush() =
        let rec loop_suit suit =
            let rec loop rank (x0,s0 as state) =
                if 0 <= rank then
                    inl (hand,count as state) =
                        if has_card' hand (suit:rank:) then update5 x0 s0 (full (suit:rank:)),s0+1
                        else state
                    if count = 5 then hand_score {hand score=Score.flush}
                    else loop (rank-1) state
                else loop_suit (suit+1)
            if suit < NumSuits then loop (NumRanks-1) ((-1, -1, -1, -1, -1), 0)
            else straight()
        loop_suit 0

The second problem is here. I simplified the complicated flush I had yesterday, but this code is only correct for poker variants that have less than 10 cards in a hand. Which admittedly Holdem and Omaha do, so there is no chance of having to pick between two different flushes there, but this would break for an arbitrary game. The version I had before was right. Let me dig it out.

    inl flush() =
        let rec loop rank (q0,q1,q2,q3 as state) =
            if 0 <= rank then
                inl state =
                    inl f suit (x0,s0 : _ * u8) = update5 x0 s0 (full (suit:rank:)),s0+1
                    if has_card' hand (suit:0 rank:) then f 0 q0, q1, q2, q3
                    elif has_card' hand (suit:1 rank:) then q0, f 1 q1, q2, q3
                    elif has_card' hand (suit:2 rank:) then q0, q1, f 2 q2, q3
                    elif has_card' hand (suit:3 rank:) then q0, q1, q2, f 3 q3
                    else state
                match state with
                | (hand,5),_,_,_ | _,(hand,5),_,_ | _,_,(hand,5),_ | _,_,_,(hand,5) => hand_score {hand score=Score.flush}
                | _ => loop (rank-1) state
            else straight()
        inl x = (-1, -1, -1, -1, -1), 0
        loop (NumRanks-1) (x,x,x,x)

This should be good. It is awkward to keep passing 20 args into a single function here. It might be better to first get a count and then pick out the cards from the suit, but forget that. I do not feel like doing even more work...

No, let me do it. I want to speed up the hand scorer as much as possible.

9:20am.

    inl flush() =
        inl find_hand ~suit =
            let rec loop rank (h,c as state) =
                inl (h,c as state) =
                    if has_card' hand (suit:rank:) then update5 h c (full (suit:rank:)),c+1
                    else state
                if c = 5 then hand_score {score=Score.flush; hand=h}
                else loop (rank-1) state
            loop (NumRanks-1) ((-1, -1, -1, -1, -1), 0)
        let rec find_suit rank (q0,q1,q2,q3 as state) =
            if 0 <= rank then
                inl state =
                    if has_card' hand (suit:0 rank:) then q0+1, q1, q2, q3
                    elif has_card' hand (suit:1 rank:) then q0, q1+1, q2, q3
                    elif has_card' hand (suit:2 rank:) then q0, q1, q2+1, q3
                    elif has_card' hand (suit:3 rank:) then q0, q1, q2, q3+1
                    else state
                match state with
                | 5u8,_,_,_ => find_hand 0 | _,5u8,_,_ => find_hand 1
                | _,_,5u8,_ => find_hand 2 | _,_,_,5u8 => find_hand 3
                | _ => find_suit (rank-1) state
            else straight()
        find_suit (NumRanks-1) (0,0,0,0)

This should do it for the flush. I realized another bug. It is in the straight.

if -1 <= rank then

I should have put rank as being i8. This way of doing it will mess things up. I'll probably get an error during peval saying that -1 can't be an u8.

// The hand is represented as a bitfield in an 64-bit integer.
type hand = u64
type card = i8
type suit = i8
type rank = i8

inl suit card : suit = card / 13
inl rank card : rank = card % 13

inl full (suit:rank:) : card = suit * 13 + rank
inl has_card' (hand:) v = ((hand : hand) &&& (1 <<< i32 (full v))) <> 0
inl has_card x v : u8 = if has_card' x v then 1 else 0
inl any_suit x (rank:) = inl f suit = has_card' x (suit:rank:) in f 0 && f 1 && f 2 && f 3
inl count_suits x (rank:) = inl f suit = has_card x (suit:rank:) in f 0 + f 1 + f 2 + f 3

nominal hand_score = {score : i8; hand : card * card * card * card * card}
instance comparable hand_score = fun a b =>
    inl f (hand_score {score hand=c0,c1,c2,c3,c4}) = score, rank c0, rank c1, rank c2, rank c3, rank c4
    comp (f a) (f b)

inl Score = {
    high_card = 1i8
    pair = 2i8
    two_pair = 3i8
    triple = 4i8
    straight = 5i8
    flush = 6i8
    full_house = 7i8
    four_of_a_kind = 8i8
    straight_flush = 9i8
    }

inl update4 (x1,x2,x3,x4) (i : i8) v =
    if i = 0 then v,x2,x3,x4
    elif i = 1 then x1,v,x3,x4
    elif i = 2 then x1,x2,v,x4
    else x1,x2,x3,v

inl NumSuits = 4i8
inl NumRanks = 13i8

inl find_suits hand (rank:) =
    let rec loop (xs, (i : i8)) suit =
        if suit < NumSuits then
            loop (if has_card' hand (suit:rank:) then update4 xs suit (full (suit:rank:)),i+1 else xs,i) (suit+1)
        else xs
    loop ((-1, -1, -1, -1), 0) 0

Hmmm, I did not have to change much since in most places the type of rank is inferred.

9:25am. This was a good, short bug fighting session.

I am not sure whether the flush redesign will speed it up in isolation, I think it will, but I have to consider that for the vast majority of cases, the flush case will fail. So there is no point in accumulating the hands only to throw them away. If the case will fail the vast majority of the time, it makes sense to do an efficient check and only then gather the hand if it succeeds.

9:35am. Let me chill a bit here. That was my plan for the morning. Once I feel ready, I should get started on the Holdem game. No rush."


Saturday 2021-06-12 10:08:03 by Tincy Thomas

Create Buggy Code (Part 4)

Emmy has written a function that returns a greeting to users. However, she's in love with Mubashir, and would like to greet him slightly differently. She added a special case in her function, but she made a mistake.

Can you help her?

Examples greeting("Matt") ➞ "Hello, Matt!"

greeting("Helen") ➞ "Hello, Helen!"

greeting("Mubashir") ➞ "Hello, my Love!"


Saturday 2021-06-12 14:45:10 by Wilmer Adalid

Updates for: Your love life will be happy and harmonious.


Saturday 2021-06-12 16:32:41 by Marko Grdinić

"10:25am. Did the chores and caught up to Her Majesty's Swarm. Let me finish the chapter of what I reading now and then I will do some work.

10:45am. Ok, that was enough fun for the morning. Fiction is always more fun when you are not dead tired.

10:50am. Good, the Start Server command now works properly.

10:55am. I need some time off from programming to think about it. Yesterday and during the night, my mind was still on the hand scorer. I hadn't thought about the game in any detail.

It won't be hard at all, but I need to run it in my head for a bit first. Let me take a nap here. The weather is so nice, the temperature is moderate, the musquitoes still haven't arrived. If it was like this all year round, life would be great. It is the ideal time to sleep a bit.

I should roll the game in my mind until I have a handle on it, and then do it and the UI for it. Then I'll be able to move to agent training.

1:10pm. Done with breakfast. Let me have fun for a bit and then I will go back to bed. I haven't even been thinking about the game, so my motivation is not all there. I need to connect it to the task at hand, and staying away from the screen and the distractions for a while will do me good.

1:30pm. Let me go back to bed. I need to find my focus instead of frittering it away on leisure activities.

I need to think. I just need to do the game and the UI for it.

As a programmer, I am not close to my ideal. I might not be a normie now, but throughout my life, I've always kept an eye on the other side. I thought that if tech turns out to be false, I would commit myself to joining society. But instead coming to an understanding of the self improvement loop was a huge blow to me.

The urge to program is there. Programming is the one activity that most rewards creativity.

I just do regret my behavior so much. If I knew it would be like this, I would never have spent time with other people and would have active run away from school. It seems absurd to say it. But that is what my beliefs are telling me. I made a mistake to passively resist mundanity.

People have their own path, but I regret my path being a path of evil. I thought that infinite power could be used for infinite good, but the structure of the universe prevents that. Differences exist for a reason, red is not blue and naive algorithms like a map will never sort an array no matter how much their inputs are varied. One's will does not matter in this. There is always the naive hope that if one pushes harder, the square peg will fit into a round hole, but it never does.

I regret having my foot on two paths in past. Whatever mistake normies have made, they are right to follow only one thing. I'll give them that.

I do not want the pain, suffering and humiliation on being on two paths anymore.

It is my destinity to find my own power and create my own side.

I need to feel that. I need to feel the urge to work towards it.

I want to get over my regrets. I want to leave behind my sadness. This is the burden that I've been carrying for six years, and I do not indent to truck it for the rest of my life. There is rage, but that is pointless too. The only thing that needs to be accepted is the coldness of rationality.

The normies are fucked as it is, there i no point in crying about the meaninglessness of it all.

My heart does not need to turn cold. It just needs to turn warm for the task at hand.

I need to get rid of the thoughts such as 'for how long will this continue' and 'just when will I get my first success.' I know when I am going to get my first success - very soon.

I managed to clear Leduc and even got the reward scale invariant training scheme to work. There is not a single reason to suspect that I might fail the next part.

If I start, I could implement the game, the UI and the first agent in less than a week.

And I could have an excellent if not top of the line agent trained in a month. And I going to groan and bitch about how much work it would take to automate and fight the online dens after that?

It is this weak mentality and the self doubt that resurfaces over and over in me. I am close to being an expert, in terms of programming skill I am all the way there, but I lack the self assurance and the real world confidence. Six years ago, I found my path and I've persevered, but I am being a bit too open minded. I cannot find it in me to forgive myself for failing my old ideals. I cannot find the strength to play life like a game.

But the perspective is there. If I could fully internalize it my pace could become very steady and I could regain some of the lost vigor of my youth.

2pm. I have a lot of grief inside of me. It took me a lot of time to get good at roguelikes. When I was a kid, I'd play them like Diablo. I'd find an enemy, fight rinse and repeat. If you do that in roguelikes, you die pretty quickly because there are situations that need to be avoided. In Diablo you just mop the map like a janitor.

It goes back to when I was a kid. When I was a kid, I wanted to grow up being the strongest in the world. I thought that if I could channel the the desire for long enough, I could find some real life cheats. Running away would deny me the valuable practice and experience.

But just look at me now. If my soul got sent backward in time, just what advantage would my elder experinece give me?

Compared to the 14 year old me, is the almost 20 year old older me better in any way? Not at all.

I never got any stronger in physical sense. The boring adult things never became fun. I never found meaning in responsibilities and expectations. The society never gave me clear goals and rewards for reaching them.

Yes, I know about the self improvement loop. I know programming. But being transported back, none of the things would help me in the classroom or the playground. With the power I have now, if I had to go back the only smart move would be to run.

I wanted to become strong in my youth, but in my older age the only thing I found was the wisdom of escape.

2:10pm. I did not want to create my own side, I thought that since all paths converge to omnipotence, that I'd be able to see eye to eye with other people eventually. My that path is for one in a million. Expecting other people to accept it is nothing more than a delusion.

Ultimately, sides exist for a reason. Different tribes existing is not just a matter of fashion, though it might seem that way these days.

It is not so much that I will create my own side, but rather than the awareness of its existence will come naturally at some point.

2:20pm. I regret it. In my youth I looked down on the normal side and its people, but now that there is a proof of how fucked they are, I regret it. I feel as if it is my fault, but I am just a messenger. Maybe the accusation of being too arrogant is true.

There is no need to be emotional about doom. It is not I who should be suffering here.

They do not deserve pity either. The only thing they deserve is for me to challenge them with my full power.

My style was always to build up my methods in secret. Yes, I have this journal, so it hardly counts as being secret, but I doubt anybody takes me seriously. Hell, half my brain does not take me seriously.

2:20pm. Ah, how great it would be if I could start programming the Holdem game without the slightest bit of hesitation. How great it would be if I could fully commit to my path.

It is not other people that I want to convince, but myself most of all. I am not a rationalist, so I do not believe my rationality without tangible evidence.

2:25pm. It do not need to tell 'it' to others. I need to tell 'it' to myself. Maybe it is not the others that I want to run from, but myself. Maybe it is my weakness which I should stop running away from. Without feeling regret, pity or remorse.

Let me go back to bed. I need to get these emotions out of my system.

6:05pm. I spent this time in bed.

In order to get rid of my regrets, I need to convince myself that the fact that I thought was enough. Maybe I'll have great accomplishments in the future, but that does not matter. Whatever it is today is in the past, whatever the time was, I spent my time thinking and pondering. Where the others raced on a threadmill and looked down on me for not getting ahead wasn't I the one who was looking down on them?

The story of my life is not about others, but about myself.

If the worth of the thoughts passing through my mind is nothing, and we only look at results, the my life is worthless. But if the time I spent in thought is worth something, then I am the richest person there is.

6:10pm. I won't accept the regrets. Sure, my thoughts might not have been good back then as they are now, but if I wasn't the kind of person to keep the inspiration going back then, I would not have managed to understand the things I do now.

So I need to accept this as the value of my worth.

I might not have done much programming today, but this thinking that I am doing is what should count as my work. A parallel reality that I am creating in my own mind.

I really won't get anywhere competing with the normies on their own term.

6:20pm. I need to find my power. In my youth I had the dreams of having big muscle when I got older, but it would be a step forward if instead I thought about using my own fists to get my way, I use the power of the machines do deal with obstacles. The dream of a man is nothing but a scam. Strike another with your first, and you will land in jail. Use killer robots, and you will conquer the world and devour the universe.

Make no mistake, using drones to deal with all your problems isn't manly or brave. It is not even smart when all you are doing is just pushing a button to make things happen.

But who cares about manliness? Who cares about strength, coordination and intelligence? Who cares about social skill? Those ways of competing are how the uninspired fight. The inspired use algorithms and base their power on accumulated thinking.

This is the side I need to join. This is the side I need to make. This is the side I belong to.

Who cares about ways of fighting that will only give you slight ego bumps. This is the real world, and I am aiming to grasp the stars. No ordinary effort will suffice.

6:25pm. One day I will turn my algorithms into real world spells.

I do not know whether I will feel like working on the Holdem game tomorrow. But whether I shake of my regrets or not, I will continue to think. I will continue to push my mind forward. I will not say that I've done enough. My brain can cool when I am dead.

I will loosen my clenched fist so that I might grasp the heart of the machine."


Saturday 2021-06-12 17:19:02 by nadic

FUCK YOU

Fixed boombox detection and added funny.


Saturday 2021-06-12 21:44:32 by usharajam

Update README.md

Assignment 1

The goal of this assignment is for you to understand and try out basic NetworkX methods to create a simple graph. The requirements for the graph are:

The graph should represent a real-world use case, for example, friendships in a social network, emails in a communication network, roads and cities in a transportation network, etc.

The graph should contain at least two different kinds of nodes. In other words, nodes should represent at least two different kinds of entities. For example, a social network could contain nodes representing people and events that they participated in, while a transportation network could contain nodes representing cities and countries.

The graph should contain at least two different kinds of relationships. In other words, the relationships should represent at least two real-life connections between entities. So, for example, two people could be connected with relationships that represent friendships and acquaintanceships.

The graph should contain at least 20 nodes and 20 edges.

You don’t have to create the graph manually by adding every node explicitly, you can just use local files to import data. Don’t use graph generators because they will be covered in the next lesson.

You need to use some of the following methods in your code: G.add_node(): Reference guide G.add_nodes_from(): Reference guide G.add_edge(): Reference guide G.add_edges_from(): Reference guide

You will need to visualize the graph using nx.draw() (Reference guide).


Saturday 2021-06-12 21:48:15 by iwantmods82

Update compressor.hjson

fuck fucking fucking retarded ass fucking shit


Saturday 2021-06-12 23:35:18 by Kirill A. Shutemov

x86/traps: Add #VE support for TDX guest

Virtualization Exceptions (#VE) are delivered to TDX guests due to specific guest actions which may happen in either user space or the kernel:

 * Specific instructions (WBINVD, for example)  * Specific MSR accesses  * Specific CPUID leaf accesses  * Access to TD-shared memory, which includes MMIO

In the settings that Linux will run in, virtual exceptions are never generated on accesses to normal, TD-private memory that has been accepted.

The entry paths do not access TD-shared memory, MMIO regions or use those specific MSRs, instructions, CPUID leaves that might generate #VE. In addition, all interrupts including NMIs are blocked by the hardware starting with #VE delivery until TDGETVEINFO is called.  This eliminates the chance of a #VE during the syscall gap or paranoid entry paths and simplifies #VE handling.

After TDGETVEINFO #VE could happen in theory (e.g. through an NMI), but it is expected not to happen because TDX expects NMIs not to trigger #VEs. Another case where they could happen is if the #VE exception panics, but in this case there are no guarantees on anything anyways.

If a guest kernel action which would normally cause a #VE occurs in the interrupt-disabled region before TDGETVEINFO, a #DF is delivered to the guest which will result in an oops (and should eventually be a panic, as we would like to set panic_on_oops to 1 for TDX guests).

Add basic infrastructure to handle any #VE which occurs in the kernel or userspace.  Later patches will add handling for specific #VE scenarios.

Convert unhandled #VE's (everything, until later in this series) so that they appear just like a #GP by calling ve_raise_fault() directly. ve_raise_fault() is similar to #GP handler and is responsible for sending SIGSEGV to userspace and cpu die and notifying debuggers and other die chain users.  

Co-developed-by: Sean Christopherson [email protected] Signed-off-by: Sean Christopherson [email protected] Signed-off-by: Kirill A. Shutemov [email protected] Reviewed-by: Andi Kleen [email protected] Reviewed-by: Tony Luck [email protected] Signed-off-by: Kuppuswamy Sathyanarayanan [email protected]


< 2021-06-12 >