#subtrees
Explore tagged Tumblr posts
Note
do you play jp do we ever get planes made out of anything other than paper and glue (5.7 rn)
my only fully grinded tree is jp and no
7 notes
·
View notes
Note
I’ve been going down a little rabbit hole of Twilight today, found your blog and have been thoroughly enjoying your meta on Bella and Renesmee’s powers. Do you have any thoughts on what their powers could truly be classified as? Like, Bella makes sense as some sort of self-preservation thing, but Renesmee’s honestly sounds more like mind control.
Thank you!
I don't really love the classification system that's used in Twilight, as it reminds the nerd in me of how unsupervised k-means AI classification will work: it looks at the data points and says "Okay, these are different enough from the rest and similar enough to each other that they're probably related. Alright alright, this cluster must be blue."
You also, when doing this type of classification, want to tell the computer how many categories it's looking for, which depends on the size of the data set, and the type.
It's not a perfect analogy to what Eleazar is doing, but he reminds me more of a k-means cluster than he does Charles von Linné, who was a brilliant biologist who invented the modern system of naming and categorizing organisms that we use today.
He looks at the gifted vampire he is presented, compares it to other gifts he has known, and assigns a similar category if he finds one that's similar. This, famously, leads to such differences as psychic and physical gifts (which to me is such a "Are you a computer trying your best with unlabelled classification? Are you having a hard time?" thing to which the computer would sadly admit "yes :(") where what's assigned a physical gift and what's assigned a psychic gift seems so incredibly arbitrary and contradictory that I can only assume somebody got ahead of themselves with "A and B are similar. B and C are similar. A, B, and C must be the same category!" and now they have a problem.
As an example: Aro and Edward are similar. They both read your mind. They have clear differences, however, as Aro requires physical touch to do so and Edward requires doesn't, while Aro is able to read all the thoughts you've ever had while Edward can read every mind within the area. You can classify them as mind readers, sure. Now you have a category describing "vampire who can read minds".
Demetri, according to Edward himself, is also similar to Edward. They both sense a person's mind, without need of touch. However, Demetri senses location, Edward doesn't, and Edward senses thoughts, Demetri doesn't. Edward is limited by geographical distance, Demetri is limited by one degree of Kevin Bacon. But if we want to classify them, then mind sensing might be the best way to do so. Both can stand in a room and, without moving a muscle, have a sense of every mind around them and they will gain information others can't.
Aro and Demetri, however, have very little in common. Their common denominator is that it "has to do with the mind".
Now for added difficulty: how do we classify Renesmee? She can by touching people convey her thoughts. This seems to be something she needs to block rather than choose to show, as people can touch her to see her thoughts when she's unconscious.
Is she then in the same category as Aro and Edward, or we create a parent category for "something to do with mind reading" and Aro and Edward are a shared subcategory for reading the minds of others well Renesmee is in sharing her mind, or is Edward off on his own with non-tactile mind-reading while Aro and Renesmee get a shared subcategory for tactile mind-reading-related? Does Demetri belong higher up in the tree, at the "mind sensing" junction before the others split off into the "something to do with mind reading" subtree?
The reason why I ask these questions, is to illustrate how meaningless it all is. There are so few gifted vampires in Twilight that we don't have enough data points to start looking for meaningful classification or similarities. Aro, Demetri, Edward, and Renesmee are all unique, with gifts unique to them. God knows that if my theory that Renesmee's real gift is to make people not want to hurt her, then she's suddenly in the same camp as Renata, who makes people forget what they were doing when they try.
Except Renata's gift is to disorient people when they get physically close, Renesmee's is to make them not want to hurt her in the first place. If we classify them together, then I don't think Renata can be classified as a shield anymore. The impenetrable space around her would only be a materialization of her gift, which is to dissuade attackers from entering that space.
Which brings me to the next point: the so-called psychic vs. physical gift division.
It depends entirely on how you classify these gifts. What makes Jasper and Alice's gifts physical? Jasper can manipulate and sense emotions, how is that different from Alec, Jane, Kate, and Zafrina manipulating your sense reseptors? Alice can see things which may happen, how is that physical if Edward seeing thoughts and Zafrina creating elaborate illusions isn't?
Benjamin, surely, must be physical. Except his gift is the only one of its kind in canon, no similarities to anyone else, which means he proves that vampire gifts can truly be anything and there's no point in trying to classify them in relation to one another when the population is so small and the unknown potential for gifts so vast.
I think I have argued here in favor of tags, or attributes: you identify something a gift can do, and you don't try to draw similarities, for yonder lies nothing but subjective opinion.
Renesmee can be similar to Aro for "shares thoughts by touch", to Jane by "imparts illusions on one individual at a time", potentially to Renata for "dissuades attackers", and is canonically compared to her father's gift. It depends entirely on how you interpret and want to classify their gifts. And sure, you can do that, no one is stopping you from classifying in any way you want, but the trouble is that you now have a system that's extremely vulnerable to expansion and changes to entries.
There's also the matter of usefulness - the tracker category, which encompasses all vampires who are good at finding others, is a useful one. Some vampires will be able to use their gift, whatever it is, to find you, others won't. I respect that category. I also respect calling Aro and Edward mind readers, it's what they are.
What I don't respect is wanting to categorize every gifted vampire, nor attempting larger classification and to cluster them. The similarities are just that, similarities.
Eleazar is overzealous.
69 notes
·
View notes
Note
If u don’t mind could u explain how u unfucked redfin’s changes. because I was trying to help my uncle with house searching, but it’s literally so unusable now that he won’t do any searching himself. If I can set it back to the old layout for him then that’d be swell
Yeah sure haha! I assume you're talking about the same layout change I got (which is that the map switched to the right side of the page, and the listings now take up way more space than before yeah?)
It's actually easy to unfuck because the way Redfin did it was by adding style overrides based on a particular className added to affected Dom elements (pretty smart for A/B rollout, tbh).
Lucky for me that makes it easy to put it back. You can do it too if you do this
Go to Redfin
Open the Dev Tools (either by F12, or by your browser's menu > tools > devtools. You can look it up for your particular browser)
Find the console
Paste this text and then hit enter
```
const config = { attributes: true, childList: true, subtree: true }; const className = 'reversePosition';
const revertLayout = () => { document.querySelectorAll(`.${className}`).forEach(element =>{ element.classList.remove(className); }); }
const observer = new MutationObserver((mutationList, observer) => revertLayout());
observer.observe(document, config);
revertLayout();
```
After that it'll be unfucked!
(If you close that tab and open Redfin again you'll have to do it again tho.)
Here's a video of me unfucking Hollywood Hills. I originally tried to make it a gif but I'm the engineer person not the media production person
#DISCLAIMER IN THE TAGS BECAUSE ID FEEL GUILTY OTHERWISE: the runtime efficiency of this is Not production worthy#the revertLayout callback triggers on any mutation of any element of the DOM#absolute shotgun approach because I do Not care enough to figure out which DOM mutations are putting that damn class back on elements#and I Do Not care about the runtime efficiency of Redfin#this probably isn't even user noticeable but my ass would never check this kind of thing in at actual work#I have standards#but anyway by my own testing (doing shit in a tab where I have the change and one where I don't) i dont see any noticeable difference
55 notes
·
View notes
Text
I have a set of points distributed on the surface of a sphere, just like on this page. I have their Delaunay triangulation and Voronoi diagram as well. I want to draw a texture, at reasonably good resolution, showing the Voronoi diagram on an equirectangular projection. For 25 points, it looks something like this:
The naive way to draw this would be to take each coordinate on the texture, and check it against every point in the point list, either for whether it is closest or whether it lies inside the bounds of the Voronoi cell for that point. The latter is slightly more efficient, since you can just break off checking once you find a match, but you still might have to check the whole map.
This is obviously slow as balls, especially because I want to be able to generate such a texture for many thousands of points. I need a heuristic or a search structure that reduces how many points I have to check against. A nearest-neighbor search via octree gets a result like this:

because each division in the subtree creates arbitrary boundaries. I think I could combine an octree search with a does-this-coordinate-actually-lie-inside-the-polygon-of-its-point search, but so far my attempts to do this have been... flawed:
Which, to be clear, may be a result of my implementation rather than the approach being fundamentally in error. But this method also seems to be pretty slow for some reason.
(The reason I want to do all this is that when the player clicks on the surface of the sphere, I want a fast way to detect what cell/point is closest to where they clicked. The image is a human-readable proxy for an array of values which are the actual point IDs; by translating the coordiantes of the click to the array, and checking the nearest value on that array, we can easily get the ID of the point without having to do any complicated lookup stuff once all this data has been generated and saved.)
25 notes
·
View notes
Text
Yet Another Anchor Positioning Quirk
New Post has been published on https://thedigitalinsider.com/yet-another-anchor-positioning-quirk/
Yet Another Anchor Positioning Quirk
I strongly believe Anchor Positioning will go down as one of the greatest additions to CSS. It may not be as game-changing as Flexbox or Grid, but it does fill a positioning gap that has been missing for decades. As awesome as I think it is, CSS Anchor Positioning has a lot of quirks, some of which are the product of its novelty and others due to its unique way of working. Today, I want to bring you yet another Anchor Positioning quirk that has bugged me since I first saw it.
The inception
It all started a month ago when I was reading about what other people have made using Anchor Positioning, specifically this post by Temani Afif about “Anchor Positioning & Scroll-Driven Animations.” I strongly encourage you to read it and find out what caught my eye there. Combining Anchor Positioning and Scroll-Driven Animation, he makes a range slider that changes colors while it progresses.
Amazing by itself, but it’s interesting that he is using two target elements with the same anchor name, each attached to its corresponding anchor, just like magic. If this doesn’t seem as interesting as it looks, we should then briefly recap how Anchor Positioning works.
CSS Anchor Positioning and the anchor-scope property
See our complete CSS Anchor Positioning Guide for a comprehensive deep dive.
Anchor Positioning brings two new concepts to CSS, an anchor element and a target element. The anchor is the element used as a reference for positioning other elements, hence the anchor name. While the target is an absolutely-positioned element placed relative to one or more anchors.
An anchor and a target can be almost every element, so you can think of them as just two div sitting next to each other:
<div class="anchor">anchor</div> <div class="target">target</div>
To start, we first have to register the anchor element in CSS using the anchor-name property:
.anchor anchor-name: --my-anchor;
And the position-anchor property on an absolutely-positioned element attaches it to an anchor of the same name. However, to move the target around the anchor we need the position-area property.
.target position: absolute; position-anchor: --my-anchor; position-area: top right;
This works great, but things get complicated if we change our markup to include more anchors and targets:
<ul> <li> <div class="anchor">anchor 1</div> <div class="target">target 1</div> </li> <li> <div class="anchor">anchor 2</div> <div class="target">target 2</div> </li> <li> <div class="anchor">anchor 3</div> <div class="target">target 3</div> </li> </ul>
Instead of each target attaching to its closest anchor, they all pile up at the last registered anchor in the DOM.
The anchor-scope property was introduced in Chrome 131 as an answer to this issue. It limits the scope of anchors to a subtree so that each target attaches correctly. However, I don’t want to focus on this property, because what initially caught my attention was that Temani didn’t use it. For some reason, they all attached correctly, again, like magic.
What’s happening?
Targets usually attach to the last anchor on the DOM instead of their closest anchor, but in our first example, we saw two anchors with the same anchor-name and their corresponding targets attached. All this without the anchor-scope property. What’s happening?
Two words: Containing Block.
Something to know about Anchor Positioning is that it relies a lot on how an element’s containing block is built. This isn’t something inherently from Anchor Positioning but from absolute positioning. Absolute elements are positioned relative to their containing block, and inset properties like top: 0px, left: 30px or inset: 1rem are just moving an element around its containing block boundaries, creating what’s called the inset-modified containing block.
A target attached to an anchor isn’t any different, and what the position-area property does under the table is change the target’s inset-modified containing block so it is right next to the anchor.
Usually, the containing block of an absolutely-positioned element is the whole viewport, but it can be changed by any ancestor with a position other than static (usually relative). Temani takes advantage of this fact and creates a new containing block for each slider, so they can only be attached to their corresponding anchors. If you snoop around the code, you can find it at the beginning:
label position: relative; /* No, It's not useless so don't remove it (or remove it and see what happens) */
If we use this tactic on our previous examples, suddenly they are all correctly attached!
Yet another quirk
We didn’t need to use the anchor-scope property to attach each anchor to its respective target, but instead took advantage of how the containing block of absolute elements is computed. However, there is yet another approach, one that doesn’t need any extra bits of code.
This occurred to me when I was also experimenting with Scroll-Driven Animations and Anchor Positioning and trying to attach text-bubble footnotes on the side of a post, like the following:
Logically, each footnote would be a target, but the choice of an anchor is a little more tricky. I initially thought that each paragraph would work as an anchor, but that would mean having more than one anchor with the same anchor-name. The result: all the targets would pile up at the last anchor:
This could be solved using our prior approach of creating a new containing block for each note. However, there is another route we can take, what I call the reductionist method. The problem comes when there is more than one anchor with the same anchor-name, so we will reduce the number of anchors to one, using an element that could work as the common anchor for all targets.
In this case, we just want to position each target on the sides of the post so we can use the entire body of the post as an anchor, and since each target is naturally aligned on the vertical axis, what’s left is to move them along the horizontal axis:
You can better check how it was done on the original post!
Conclusion
The anchor-scope may be the most recent CSS property to be shipped to a browser (so far, just in Chrome 131+), so we can’t expect its support to be something out of this world. And while I would love to use it every now and there, it will remain bound to short demos for a while. This isn’t a reason to limit the use of other Anchor Positioning properties, which are supported in Chrome 125 onwards (and let’s hope in other browsers in the near future), so I hope these little quirks can help you to keep using Anchor Positioning without any fear.
#amazing#amp#anchor positioning#animation#animations#approach#Articles#attention#browser#change#chrome#code#colors#comprehensive#CSS#eye#fear#focus#Future#game#gap#grid#how#inset#it#Method#One#Other#positioning#Read
3 notes
·
View notes
Text
What is "founder mode"?
We held a YC event a couple of months ago where Brian Chesky from Airbnb gave a passionate talk about his experience running Airbnb over the last 17 years. He believed that as Airbnb hired more professional managers, he lost a close connection with the details of the end product and the company suffered as a result.
It clearly touched a nerve with a lot of people present. It was uncomfortable to realize that I made many of the same mistakes when I ran my startup, yet somehow comforting to know I was in good company.
Paul Graham wrote an essay about a few weeks later, the now-famous Founder Mode, which I want to explore today.
Leaders in "manager mode" will “treat subtrees of the org chart as black boxes. You tell your direct reports what to do, and it's up to them to figure out how. But you don't get involved in the details of what they do.”
On the other hand “there are things founders can do that managers can't” - this is “founder mode” - and it’s left largely undefined. PG’s essay is perhaps best read as an invitation to founders to compare notes to discover a better way of running companies at scale.
But the essay left me questioning whether "founder mode" and "manager mode" are useful labels. They certainly generated a lot of controversy online, but if you hire bad executives and let them run your company with minimal intervention or oversight, you’re in for a bad time whether you’re a founder or not.
And, empirically, we can point to numerous examples of both founders and hired CEOs who have either been extremely successful or totally useless. Whether someone is a founder seems largely orthogonal to whether they’re a competent leader.
Maybe my quibble is just a semantic one - these labels distract from the debate. I do believe there is a really interesting question here - how do good leaders stay in the detail and run great companies at scale? Are there areas where founders really do have a persisting advantage? And that’s what I want to explore in more detail here.
I think the general pattern that Brian was identifying was the following. A young, inexperienced founder with limited management experience is running a rapidly scaling company. Famous VCs invest a lot of money and join the board. Headcount passes 100 and quickly grows beyond 1000. The VCs (who often have never run anything themselves) encourage the founder to hire "executives" with "scaling experience".
The founder is told to "empower" these executives, who typically then implement techniques that worked for them at previous companies. But, too often, these techniques fail in the new company. The founder is too nervous to intervene - these people are supposed to be "experts" - or is rebuffed by the experienced executives for "micromanaging". Things don't go well, and the company slowly stagnates. The founder gets sad and eventually quits or is pushed out.
Now, it's very common to hire executives who are ineffective. Every CEO has that experience. But it's not sensible to give those executives unverified trust and free reign from day one. I don’t think any competent CEO should treat "subtrees of the org chart as black boxes".
As a leader, of course you constantly need to do skip-level meetings with people further down in the organization. You need to have your finger on the pulse of the company and be able drill down into each area when necessary.
The process of building and maintaining trust between a CEO and an exec involves the CEO repeatedly going incredibly deep on niche subjects, verifying that the exec really knows what's going on in their department, and has a good grasp on the problems. As the exec builds trust, these deep-dives can become less frequent, but they never totally disappear. If the exec repeatedly doesn't have a good grasp of the details as you dive deep into their domain, you quickly realize that you need to replace them.
To do this, leaders need an extremely detailed and nuanced understanding of their business. There’s a cliched idea of clueless MBAs jumping from company to company, treating them as black boxes that might as well be making widgets. They clearly don’t have the domain expertise to dive into any kind of detail. This is not a successful way to run a company.
Over time, and without constant pruning, companies do seem to accumulate layers of management who do very little. These managers spend their time coordinating people, trying to establish consensus, and padding out their promotion packets to ascend to the next rung of the corporate ladder. Instead, I believe that great leaders have to be able to dig into the details, have an incredibly high bar for quality, and ultimately do great IC work themselves. Great managers have to manage the work - they should primarily be responsible for quality and speed of output. Managing people must be secondary to managing the product.
At Monzo, we experimented with some pretty wacky management structures at times. There was a period when our middle managers were basically just responsible for "pastoral care" of each employee. They were not connected at all with the output that the ICs were producing. It was totally insane and overlapped with our period of lowest productivity by far.
As you scale a company, you do have to figure out which executives you can trust with what kind of work, and delegate decisions to them appropriately. The limiting factor in any scaling company is usually management bandwidth. I believe one of the best articulations of this idea is Keith Rabois's Barrels vs Ammunition (at 14:32, but the whole video is excellent)
If you think about people, there are two categories of high-quality people: there is the ammunition, and then there are the barrels. You can add all the ammunition you want, but if you have only five barrels in your company, you can literally do only five things simultaneously.
Finding those barrels that you can shoot through — someone who can take an idea from conception to live and it’s almost perfect — are incredibly difficult to find. This kind of person can pull people with them. They can charge up the hill. They can motivate their team, and they can edit themselves autonomously.
Once someone demonstrates "barrel-like" ability, you should quickly put more on their plate. Often, the best leaders at your company will have been promoted from within, over a period of several years. They’ve established huge amounts of trust and have deep domain knowledge. Constantly micromanaging these people is a waste of your time and will actually limit the great work your company can do. You must empower them.
On the other hand, trying to hire in senior executives from outside the company is fraught with difficulty. Sadly, many really are just “professional fakers”. These people have run hundreds of job interviews in their career and are experts at “managing up” to a CEO. This makes standard interviews almost entirely useless. Instead, I would try to pick previous projects they’ve run and dig into as much detail as you can. See how granular they can go on the problems they encountered, the decisions they made and the results they achieved. I would do a very large number of reference checks - try to find bosses, peers and subordinates and talk to them in detail about the person you are about to hire. Every time I failed to do detailed reference checks on an executive hire, I deeply regretted it. Spend significant time with the person before hiring them. I spent about a year meeting TS Anil (the now-CEO) before hiring him at Monzo, and 9 months meeting with Sujata, the COO. They are two of the best executive hires I ever made, and I’m sad I didn’t get to work with them for longer.
Once you’ve hired someone, you need to ensure they’re doing a good job before giving them free-reign in your company. Are they really a “barrel”? Sadly, at least 50% of executive hires don’t work out. It’s essential that you identify these people early and weed them out. And the way you do this is dive deep with them into their domain and see if they can keep up. When a CEO takes their eye off the details, the career politicians and bureaucrats thrive.
I've heard from many founders that their senior managers - C levels and VPs - react badly when young founders want to dig into the details. They seem to say "You hired us to be the experts here. Now you need to get out of the way while we run the company." As PG's essay says, "Founders feel like they're being gaslit from both sides — by the [VCs] telling them they have to run their companies like managers, and by the [execs] working for them when they do." They "hire professional fakers and let them drive the company into the ground." This is also the pattern that Brian identified in his talk, and I think it’s absolutely destructive.
I have to say that this generally wasn't my experience - I had access to all metrics from across the company, on dozens of pages of real time dashboards. I'd frequently roam the office and sit next to a random employee and start talking to them about their work. Teams would often have their dashboards up on walls and I loved digging into what the data was showing. I had an obsession with extremely granular metrics - it cost us £4.40 to onboard a single customer, split between KYC cost, debit card manufacturing, postage and packaging. Our CAC varied between £10.50 and £14.00 depending on channel. Our NPS started at +78 and declined to +71 (and we spent a really long time trying to figure out why). The average customer transacted on their Monzo card 7.4 times a week, with an average spend of £14.10 per transaction. They deposited £600 month (which grew to £950 after 18 months of using Monzo) and they opened the app 22 times per week. I could go on and on - I was obsessed with these metrics.
We insisted that everyone at Monzo - including the entire senior management team - do customer service for one day a month. This was a great way to make sure everyone stayed closely connected to the issues customers really cared about. We stopped doing this in about year 4 or 5, and it seemed to coincide with a sharp reduction in the pace of execution.
Sadly, I hired a number of bad executives, but the techniques above generally allowed me to identify them pretty quickly, and we ended up firing a lot of senior people. There were certainly times when I was too busy and didn't have the time, or I didn't feel like I had the expertise to really dive in. Certain teams' work was so alien to me that I couldn't effectively go deep. In retrospect, they were also the lowest performing teams when I was there.
I think that the final part of successful leadership is the ability to make hard decisions in the absence of complete information. At some point or another, companies will encounter these bet-the-company moments, and maybe this is one area that founders do have an advantage over professional managers. Having the moral authority to take a really hard decision comes with the founder title. Zuckerberg’s decision to go all-in on mobile 2012 is an example of this. Professional managers inevitably have a level of risk aversion due to the insecurity of their job position - if it goes wrong, the founder is less likely to lose their job. Zuckerberg’s bet on the Metaverse would probably have gotten a professional CEO fired.
But there are relatively few of these bet-the-company decisions. Everything slows to a crawl if the CEO needs to be consulted every time a decision needs to be made. You want your (competent) execs and your top ICs to be making great decisions every day - and you as the CEO should dive in only occasionally to spot-check these decisions. This is how you scale leadership.
I’ve worked at a startup where the founder CEO came in every Monday with a new idea. He seemed to spend every weekend talking to investors and then turned up with heaps of enthusiasm for a new initiative. But we never had time to actually make progress on the idea before he’d change his mind again. This kind of leadership thrash is depressingly common with inexperienced founder-CEOs.
I encountered a similar thing at my own company - I learned that I had to be really careful about sharing half-formed opinions and ideas, especially with less experienced team members (and as the company grew past 1000 people). I would sometimes get enthusiastic about a new half-formed product idea, or make an off-the-cuff remark about something I found interesting. Without intending to, I’d derail an entire team for weeks. You need to be deliberate and intentional about CEO-level interventions when you’re running a company of thousands.
I learned that if I wanted the company to focus, I had to have a singular message that I repeated endlessly. I would write a 3-4 page letter to the entire company about every 6 months, outlining the one or two things we needed to focus on. At our weekly all-hands, I would just repeat the same message in different ways. I think I said “fix unit economics” several thousand times in 2018. It became a meme at the company. But it worked.
I sat in every weekly product review meeting with my CPO and CTO, even as we got to 2000 team-members. Our main input to the teams was typically to try to cut scope and launch faster.
I learned to save my open-ended product brainstorming for a much smaller group - VP Marketing, VP Design, CPO, CTO, and a couple of very senior engineering ICs. We’d meet every 2-3 weeks and spend a couple of hours jamming on the kinds of things we could build in future. These meetings were the most fun I had at Monzo. Some of these became a core part of the product, others were just a fun way to blow off steam without distracting the company.
I’m not saying I have all the answers here - and I was far from a perfect CEO. I don’t think I really ever figured out how to balance the extremely onerous regulatory constraints of running a bank with a desire to move quickly and delight our customers. Especially as we grew past 500 people, I think we lost a lot of the early intensity and focus that I loved so much. We raised hundreds of millions of dollars, so when new employees turned up to a fancy office with catered lunches they believed they had joined a company like Google, and everything slowed down.
Personally, I was in the detail to such an extent that I couldn’t ever really disconnect from the company. I treated every criticism of Monzo as an attack on me personally. I found it impossible to keep a sense of perspective or any balance in my life, and ultimately I burned out. I believe this is the biggest danger for founders once they’ve hit product-market-fit.
I return to the original questions - how do good leaders stay in the detail and run great companies at scale? Are there areas where founders really do have a persisting advantage? I’ve shared some of my views here - I would insist that all CEOs stay connected to the details of their product, have an incredibly high bar for quality, manage for output, and delegate only to the extent that your leaders have earned your trust. Don't feel embarrassed about the way you want to run your company.
I would love to hear how others run their companies, whether you're founders or not.
6 notes
·
View notes
Text
> spend the last 45 min of my algorithms exam today frantically searching for a fix for a problem I found with my code > fail > no time to proofread my other answers because of it, there's at least one mistake I made I def would have caught > hand it in, not the end of the world, still did pretty well all things considered I think
> they upload the correct solutions immediately afterwards > the solution they gave to that problem was my incorrect one > send a question to the lecture's online forum about how it can be correct with that error in it > 45 min later the professor replies along the lines of "what why its all correct seems fine to me" > and then she immediately deletes that reply like thirty seconds later > hasnt replied again in the 30 min or so since
🙃
in case you care the problem was to check whether a given binary tree is a search tree in at most ten lines of code and supposedly the answer was this:
which I'm almost certain doesnt work because it only checks the left and right children and not the whole subtrees (and doing that requires like 20-30 lines of code at least and probably a helper function)
12 notes
·
View notes
Text
i'm in the chunk of hell game coding where i'm determining specific nouns for body configurations. human w/ bull head: minotaur. human with goat legs: satyr. but also like, gryphon, manticore, peryton. turns out there are a lot of names for weird monsters made from mashing different animals together. so now i'm doing a lot of subtree matching to try to match the Archetypal Pegasus Bodytree to the pc's bodytree. this is made a little more annoying b/c of how in practice there's a certain level of cousin interaction between parts (if you have a core node w/ a human tag and then a legs node coming from the core node, i still count those as human legs even though they're not specifically tagged. the species rule is 'first attached animal node, or first attached animal node on parent, or first attached animal node on grandparent, etc'. this becomes complicated when you want to check for has-this-animal-node or has-no-node-but-parent-has-this-animal-node. thankfully the limb hierarchy only goes two steps deep or else things would really get messy)
something something the usual statement about the arrogance of trying to categorize things. it's difficult to find hard and fast rules in this tiny toy domain i made specifically to be legible! already i have to make duplicate rules sometimes to catch slightly different permutations of body configurations that i've decided should be treated as equivalent. the "i've decided" is the important part there; that's the part where intentionality and meaning are injected into this whole process.
3 notes
·
View notes
Text
You can learn Git easily, Here's all you need to get started:
1.Core:
• git init
• git clone
• git add
• git commit
• git status
• git diff
• git checkout
• git reset
• git log
• git show
• git tag
• git push
• git pull
2.Branching:
• git branch
• git checkout -b
• git merge
• git rebase
• git branch --set-upstream-to
• git branch --unset-upstream
• git cherry-pick
3.Merging:
• git merge
• git rebase
4.Stashing:
• git stash
• git stash pop
• git stash list
• git stash apply
• git stash drop
5.Remotes:
• git remote
• git remote
• add git
• remote remove
• git fetch
• git pull
• git push
• git clone --mirror
6.Configuration:
• git config
• git global config
• git reset config
7. Plumbing:
• git cat-file
• git checkout-index
• git commit-tree
• git diff-tree
• git for-each-ref
• git hash-object
• git Is-files
• git Is-remote
• git merge-tree
• git read-tree
• git rev-parse
• git show-branch
• git show-ref
• git symbolic-ref
• git tag --list
• git update-ref
8.Porcelain:
• git blame
• git bisect
• git checkout
• git commit
• git diff
• git fetch
• git grep
• git log
• git merge
• git push
• git rebase
• git reset
• git show
• git tag
9.Alias:
• git config --global alias.<alias> <command>
10.Hook:
• git config --local core.hooksPath <path>
11.Experimental: (May not be fully Supported)
• git annex
• git am
• git cherry-pick --upstream
• git describe
• git format-patch
• git fsck
• git gc
• git help
• git log --merges
• git log --oneline
• git log --pretty=
• git log --short-commit
• git log --stat
• git log --topo-order
• git merge-ours
• git merge-recursive
• git merge-subtree
• git mergetool
• git mktag
• git mv
• git patch-id
• git p4
• git prune
• git pull --rebase
• git push --mirror
• git push --tags
• git reflog
• git replace
• git reset --hard
• git reset --mixed
• git revert
• git rm
• git show-branch
• git show-ref
• git show-ref --heads
• git show-ref --tags
• git stash save
• git subtree
• git taq --delete
• git tag --force
• git tag --sign
• git tag -f
• git tag -I
• git tag --verify
• git unpack-file
• git update-index
• git verify-pack
• git worktree
3 notes
·
View notes
Text
Chris Bumstead Describes His Training Recovery Process
New Post has been published on https://eazyfitness.net/chris-bumstead-describes-his-training-recovery-process/
Chris Bumstead Describes His Training Recovery Process


Chris Bumstead Describes His Training Recovery Process – Breaking Muscle
0)lazyLoadInstance.update());var b=document.getElementsByTagName(“body”)[0];var config=childList:!0,subtree:!0;observer.observe(b,config),!1)]]> Source
2 notes
·
View notes
Video
youtube
LEETCODE PROBLEMS 1-100 . C++ SOLUTIONS
Arrays and Two Pointers 1. Two Sum – Use hashmap to find complement in one pass. 26. Remove Duplicates from Sorted Array – Use two pointers to overwrite duplicates. 27. Remove Element – Shift non-target values to front with a write pointer. 80. Remove Duplicates II – Like #26 but allow at most two duplicates. 88. Merge Sorted Array – Merge in-place from the end using two pointers. 283. Move Zeroes – Shift non-zero values forward; fill the rest with zeros.
Sliding Window 3. Longest Substring Without Repeating Characters – Use hashmap and sliding window. 76. Minimum Window Substring – Track char frequency with two maps and a moving window.
Binary Search and Sorted Arrays 33. Search in Rotated Sorted Array – Modified binary search with pivot logic. 34. Find First and Last Position of Element – Binary search for left and right bounds. 35. Search Insert Position – Standard binary search for target or insertion point. 74. Search a 2D Matrix – Binary search treating matrix as a flat array. 81. Search in Rotated Sorted Array II – Extend #33 to handle duplicates.
Subarray Sums and Prefix Logic 53. Maximum Subarray – Kadane’s algorithm to track max current sum. 121. Best Time to Buy and Sell Stock – Track min price and update max profit.
Linked Lists 2. Add Two Numbers – Traverse two lists and simulate digit-by-digit addition. 19. Remove N-th Node From End – Use two pointers with a gap of n. 21. Merge Two Sorted Lists – Recursively or iteratively merge nodes. 23. Merge k Sorted Lists – Use min heap or divide-and-conquer merges. 24. Swap Nodes in Pairs – Recursively swap adjacent nodes. 25. Reverse Nodes in k-Group – Reverse sublists of size k using recursion. 61. Rotate List – Use length and modulo to rotate and relink. 82. Remove Duplicates II – Use dummy head and skip duplicates. 83. Remove Duplicates I – Traverse and skip repeated values. 86. Partition List – Create two lists based on x and connect them.
Stack 20. Valid Parentheses – Use stack to match open and close brackets. 84. Largest Rectangle in Histogram – Use monotonic stack to calculate max area.
Binary Trees 94. Binary Tree Inorder Traversal – DFS or use stack for in-order traversal. 98. Validate Binary Search Tree – Check value ranges recursively. 100. Same Tree – Compare values and structure recursively. 101. Symmetric Tree – Recursively compare mirrored subtrees. 102. Binary Tree Level Order Traversal – Use queue for BFS. 103. Binary Tree Zigzag Level Order – Modify BFS to alternate direction. 104. Maximum Depth of Binary Tree – DFS recursion to track max depth. 105. Build Tree from Preorder and Inorder – Recursively divide arrays. 106. Build Tree from Inorder and Postorder – Reverse of #105. 110. Balanced Binary Tree – DFS checking subtree heights, return early if unbalanced.
Backtracking 17. Letter Combinations of Phone Number – Map digits to letters and recurse. 22. Generate Parentheses – Use counts of open and close to generate valid strings. 39. Combination Sum – Use DFS to explore sum paths. 40. Combination Sum II – Sort and skip duplicates during recursion. 46. Permutations – Swap elements and recurse. 47. Permutations II – Like #46 but sort and skip duplicate values. 77. Combinations – DFS to select combinations of size k. 78. Subsets – Backtrack by including or excluding elements. 90. Subsets II – Sort and skip duplicates during subset generation.
Dynamic Programming 70. Climbing Stairs – DP similar to Fibonacci sequence. 198. House Robber – Track max value including or excluding current house.
Math and Bit Manipulation 136. Single Number – XOR all values to isolate the single one. 169. Majority Element – Use Boyer-Moore voting algorithm.
Hashing and Frequency Maps 49. Group Anagrams – Sort characters and group in hashmap. 128. Longest Consecutive Sequence – Use set to expand sequences. 242. Valid Anagram – Count characters using map or array.
Matrix and Miscellaneous 11. Container With Most Water – Two pointers moving inward. 42. Trapping Rain Water – Track left and right max heights with two pointers. 54. Spiral Matrix – Traverse matrix layer by layer. 73. Set Matrix Zeroes – Use first row and column as markers.
This version is 4446 characters long. Let me know if you want any part turned into code templates, tables, or formatted for PDF or Markdown.
0 notes
Text
Assignment--Right Threaded-BST
struct rightThreadedBSTNode struct rightThreadedBSTNode { { int key; int key; int size; // Total no of nodes in the subtree rooted at the node. int size; // Total no of nodes in the subtree rooted at the node. int rightThread; // 1, if right link is a thread to its inorder successor int rightThread; // 1, if right link is a thread to its inorder successor struct rightThreadedBSTNode *leftChild;…
0 notes
Text
Ah, neat: there's now (as of Firefox 125, early-ish last year) browser-native CSS for optimizing infinite scroll rendering performance—basically everything Tumblr's "virtual scroller" code does but with less hacks (I assume control-f searching works seamlessly). Of course, production websites presumably want to support older browsers than "came out early last year," so this isn't actually useful, but still.
0 notes
Text
一時的な要素をDevToolsで効果的に検査する方法
イベントリスナーを活用した要素の捕捉 ウェブページ上で素早く消える要素を調査するには、イベントリスナーを活用するのが効果的です。 DevToolsのElementsパネルで対象の要素を選択し、右クリックメニューから「Break on」>「Subtree modifications」を選択します。 この設定により、選択した要素やその子要素に変更が加えられた時点で、JavaScriptの実行が一時停止します。 開発者は要素が変更される瞬間を捉え、詳細な調査を行うことができます。 アニメーション制御パネルの活用 DevToolsには、アニメーションを制御するための専用パネルが用意されています。 このパネルを使用すると、ページ上のアニメーションを一時停止したり、スローモーションで再生したりすることが可能です。 アクセス方法は、DevToolsの右上にある三点メニューから「More…
0 notes
Text
Exploring the :has() Selector in CSS
CSS has progressed greatly over time, introducing a number of advanced selectors that improve the ability to style web pages with precision and flexibility. One of the most recent additions to the CSS selector is the :has() pseudo-class. This blog will go over the details of the :has() selector, including its usage, benefits, and practical examples to help you use this powerful tool in your web development projects.
What is the :has() Selector?
The :has() selector is a relational pseudo-class that lets you choose an element depending on the presence of a descendant or a more complicated relationship within its subtree. In simpler terms, it allows you to style a parent element if it contains specific child components.
Syntax:
element:has(selector) { /* CSS properties */ }
Key Features
Relational Selection: Unlike typical CSS selectors, which focus on the element or its immediate children, :has() selector looks at the content within the element to see if it fits a specified conditions.
Dynamic Styling: It can dynamically apply styles based on the presence or absence of specific elements, resulting in more interactive and context-aware designs.
Please check out nine examples of the :has selector by clicking on the link.
follow- https://www.linkedin.com/company/skillivo/
#html#css#javascript#web design#web development#programming#coding#advanced css#css3#html5#frontenddevelopment#webdevelopment#css tutorial#skillivo
1 note
·
View note
Text
Peer-graded assignment - Running a Classification Tree - Classification tree analysis to test nonlinear relationships among candidate possible predictors related to alcohol, tobacco and drug use and lifetime major depression
A classification tree analysis has been performed to test nonlinear relationships (predictive, classification tree model) among a set of 12 candidate possible predictors (explanatory variables) related to
alcohol, tobacco and drug consumption status
ethnicity such as White, Black, Hispanic, Asian, Native American
and drugs user experience (ever experienced cannabis, opioids, inhalants),
and a binary, categorical target variable (response variable), lifetime major depression.
All possible binary (categorical) splits (decisions) based on the value of the explanatory variables have been assessed that best describe subgroups of the sample with either high or low proportions of the target variable, and the entropy “goodness of split” (cost complexity algorithm criterion respectively) is being used to grow the tree (for pruning the full tree into a final subtree respectively).
Below the picture of the final decision, classification tree generated by a SAS program, that was grown with data from NESARC dataset.
In this decision tree there happens to be 2 terminal nodes showing larger rates of U.S. population 18 years and older sample who have lifetime major depression: as the tree diagram illustrates, persons who have in common the use of cannabis, but with the exclusive addition of opioids use in one case, and exclusive inhalants use in the second case, are more likely to have lifetime major depression (62.3% and 64.3% respectively).
Besides, there are 2 terminal nodes indicating subgroups with lower risk for lifetime major depression:
the first, at the right side of the tree, one group including people who did not smoke cannabis at all (21.6%),
the second, at the left side of the tree, including people who made the experience of cannabis, but neither of opioids nor inhalants (33.8%).
On the other way round, ever experienced cannabis is the first variable to separate the sample into two subgroups.
U.S. population 18 years and older who ever experienced cannabis is more likely to have lifetime major depression compared to those not (42.9% vs. 21.6%).
Of the population who have experienced cannabis, a further subdivision is made with the binary variable of opioids user experience. People who reported having experienced opioids are more likely to have experimented lifetime major depression (62.3%). People who experienced cannabis but had never consumed opioids are less likely to have experimented with lifetime major depression (36.5%).
Of the population who have experienced cannabis, but never experienced opioids, a further subdivision is made with the binary variable of inhalants user experience. People who reported having experienced cannabis and never experienced opioids, but experienced inhalants, are more likely to have experimented lifetime major depression (64.3%). People who experienced cannabis, but had never consumed opioids or inhalants, are less likely to have experimented with lifetime major depression (33.8%).
Model information table
Looking at the model information table, it shows that the decision tree has 39 leaves before pruning and 4 leaves following pruning.
In the original NESARC dataset, lifetime major depression as 1 equals “yes” and 0 equals “no”. But because SAS predicts the lowest value of the target variable, this caused the model event level to be zero, or no. So a recoding of the life time major depression was needed in such a way that the no's were recoded to a two, keeping one equal to yes.
Model event level confirms that the tree is predicting the value one, that is yes, for our target variable lifetime major depression.
The number of observations read from the data set is 43,093 while the number of observations used is only 693. The latter figure represents the number of observations with valid data for the target variable, and each of the explanatory variables. Those observations with missing data on even one variable have been set aside.
A vertical reference line is drawn for the tree with the number of leaves that has the lowest cross validated ASE: in this case, the 4 leaf tree.
The horizontal reference line at 0,35 represents the average standard error plus one standard error for this complexity parameter.
The 1-SE rule is applied since the pruning with the cost-complexity method is being applied, to potentially select a smaller tree that has only a slightly higher error rate than the minimum ASE: selecting the smallest tree that has an ASE below the horizontal reference line is in effect implementing the one minus SE rule. As a result, a model with 3 split levels and 4 leaves is achieved, with splits on ever experienced cannabis, opioids, and inhalants.
A model-based confusion matrix is being generated too which shows how well the final classification tree performs.
The total model correctly classifies 21.5% (sensitivity) of those who have lifetime major depression and 95% (specificity) of those who have not. As a result, it is clearly better possible to predict who are protected against lifetime major depression, and less likely to predict those who are at risk for lifetime major depression.
Furthermore, a receiver operator (ROC) characteristic curve is being displayed, which shows sensitivity, that is the true positive rate, and specificity, the true negative rate plotted against each other.
Hereinunder the SAS code used to generate the present analysis
PROC IMPORT DATAFILE ='/home/u63783903/my_courses/nesarc_pds.csv' OUT = imported REPLACE; RUN; DATA new; set imported;
/* lib name statement and data step to call in the NESARC data set for the purpose of the decision classification tree analysis */
LABEL MAJORDEPLIFE = "MAJOR DEPRESSION - LIFETIME" ETHRACE2A = "IMPUTED RACE/ETHNICITY" WhiteGroup = "White, Not Hispanic or Latino" BlackGroup = "Black, Not Hispanic or Latino" NamericaGroup = "American Indian/Alaska Native, Not Hispanic or Latino" AsianGroup = "Asian/Native Hawaiian/Pacific Islander, Not Hispanic or Latino" HispanicGroup = "Hispanic or Latino" S3BQ1A3 = "EVER USED OPIOIDS" S3BQ1A5 = "EVER USED CANNABIS" CONSUMER = "DRINKING STATUS" CurrentDrinker = "Current drinker" SMOKER = "TOBACCO USE STATUS" CurrentTobaccoUser = "Current tobacco user" S3BQ1A6 = "EVER USED COCAINE OR CRACK" S3BQ1A8 "EVER USED INHALANTS" DGSTATUS = "DRUG USE STATUS" DrugUser = "Current drug user" OPIOIDSExperiencer = "Opioids experiencer" CANNABISExperiencer = "Cannabis experiencer" COCAINEExperiencer = "Cocaine or crack experiencer" INAHALNTSExperiencer = "Inhalants experiencer"; if ETHRACE2A=1 then WhiteGroup=1; else WhiteGroup=0;
if ETHRACE2A=2 then BlackGroup=1; else BlackGroup=0;
if ETHRACE2A=3 then NamericaGroup=1; else NamericaGrouGroup=0;
if ETHRACE2A=4 then AsianGroup=1; else AsianGroup=0;
if ETHRACE2A=5 then HispanicGroup=1; else HispanicGroup=0;
if CONSUMER = 1 THEN CurrentDrinker=1; else CurrentDrinker=0;
if MAJORDEPLIFE = 1 then MajorDepLifeRecoded = 1; if MAJORDEPLIFE = 0 then MajorDepLifeRecoded = 2; /* To be able to interpret the tree correctly, a recoded of MAJORDEPLIFE is needed: the no's for lifetime major depression is recoded to a two, keeping one equal to yes */
if S3BQ1A3 = 1 then OPIOIDSExperiencer = 1 ; if S3BQ1A3 = 2 then OPIOIDSExperiencer = 0 ; if S3BQ1A3 = 9 then S3BQ1A3 = . ;
if S3BQ1A5 = 1 then CANNABISExperiencer = 1 ; if S3BQ1A5 = 2 then CANNABISExperiencer = 0 ; if S3BQ1A5 = 9 then S3BQ1A5 = . ;
if S3BQ1A6=1 then COCAINEExperiencer = 1; if S3BQ1A6=2 then COCAINEExperiencer = 0; if S3BQ1A6=9 then S3BQ1A6 =.;
if S3BQ1A8=1 then INAHALNTSExperiencer = 1; if S3BQ1A8=2 then INAHALNTSExperiencer = 0; if S3BQ1A8=9 then S3BQ1A8 =.;
IF DGSTATUS=1 THEN DrugUser=1; ELSE DrugUser=0;
IF SMOKER=1 THEN CurrentTobaccoUser=1; ELSE CurrentTobaccoUser=0;
if S3AQ3C1=99 THEN S3AQ3C1=.;
IF S3AQ3B1=9 THEN SS3AQ3B1=.;
IF S3AQ3B1=1 THEN USFREQMO=30; ELSE IF S3AQ3B1=2 THEN USFREQMO=22; ELSE IF S3AQ3B1=3 THEN USFREQMO=14; ELSE IF S3AQ3B1=4 THEN USFREQMO=5; ELSE IF S3AQ3B1=5 THEN USFREQMO=2.5; ELSE IF S3AQ3B1=6 THEN USFREQMO=1;
NUMCIGMO_EST=USFREQMO*S3AQ3C1;
if S2AQ7D = 99 then S2AQ7D = . ;
if S2AQ7B = 99 then S2AQ7B = . ;
IF S2AQ7B=1 THEN USFREQALCMO=30; ELSE IF S2AQ7B=2 THEN USFREQALCMO=30; ELSE IF S2AQ7B=3 THEN USFREQALCMO=14; ELSE IF S2AQ7B=4 THEN USFREQALCMO=8; ELSE IF S2AQ7B=5 THEN USFREQALCMO=4; ELSE IF S2AQ7B=6 THEN USFREQALCMO=2.5; ELSE IF S2AQ7B=7 THEN USFREQALCMO=1; ELSE IF S2AQ7BA=8 THEN USFREQALCMO=0.75; ELSE IF S2AQ7B=9 THEN USFREQALCMO=0.375; ELSE IF S2AQ7B=10 THEN USFREQALCMO=0.125;
NUMALCMO_EST=USFREQALCMO*S2AQ7D;
PROC SORT; BY IDNUM;
ods graphics on; /* Activation of the Output delivery system (ODS) managing the output displyed in HTML */
proc hpsplit seed=15531; /* Procedure building tree based statistical models for classification regression */ /* Insertion of the seed option allowing the speficiation of a five digit random number seed used in the cross validation process */
class MajorDepLifeRecoded OPIOIDSExperiencer CANNABISExperiencer CANNABISExperiencer WhiteGroup BlackGroup NamericaGroup HispanicGroup AsianGroup CurrentDrinker CurrentTobaccoUser COCAINEExperiencer INAHALNTSExperiencer DrugUser; /* class statement including both the binary categorical target variable as well as categorical explanatory variables being considered within the model */
model MajorDepLifeRecoded = OPIOIDSExperiencer CANNABISExperiencer CANNABISExperiencer WhiteGroup BlackGroup NamericaGroup HispanicGroup AsianGroup CurrentDrinker CurrentTobaccoUser COCAINEExperiencer INAHALNTSExperiencer DrugUser; /* Insertion of the keyword model, the target or response value, followed by the full list of explanatory variables */
grow entropy; /* grow statement for starting with a large tree based on the randomly selected training sample, specifying the split of internal nodes into additional parent and child nodes */ /* entropy as option in the grow statemnet to minimize the nodes impurity or error*/
prune costcomplexity; /* prune statement for pruining the large tree, i.e. finding a smaller sub tree: results in a low air rate on both the training and validation samples */ /* Pruning through Cost-complexity method: requested for either a categorical target variable as in this case */ /*making trade-off between the size tree complexity and the error rate to prevent from over-fitting */
RUN;
0 notes