Hacker Newsnew | past | comments | ask | show | jobs | submit | 171243's commentslogin

input: "bcabc"

  1. "b"
  2. "bc"
  3. "bca"
  4. "bca"
  5. "bca"
What am I missing?


Take all the possible answers with duplicates removed, and return the first one in alphabetical order.

input: "bcabc"

output: "abc"


Nothing. I hadn't fleshed out my idea yet and that's the error I thought could exist. My solution is wrong.


that is a single line of code in javascript, assuming you just want the value in #5 const foo = [...new Set('bcabc'.split(''))].join('')


Interesting. As an informal evaluations of the premise of the top comment in this thread I read your bio. I am posting the comment and your bio here for other interested individuals:

The comment:

>I know two people on the “30 under 30” list. Both of them are incredibly charismatic and charming in person. Their Instagram and Twitter accounts churn out constant brand building material. They both have pseudo-startups with noble causes and vibrant websites. Their startups have a list of impressive advisers, including B-list senators and industry executives. However, neither of them have made any progress on building an actual business. One of them has supposedly been developing the same simple product for almost 7 years now, but they’ve never been able to produce even a proof of concept prototype. I thought I was missing something for the longest time, until I let go of the idea that they were really trying to build a company. They’re not. They’re building their personal brand, and succeeding wildly thanks to publications like the “30 under 30” list that have an insatiable appetite for underdog success stories. Surely some of these companies are legitimately successful with great business models, but they’re mixed into these lists with the brand builders who know how to game the system. I’d be interested in reading an honest “Where are they now” follow up series that checks in with these founders at the 5-year mark after they make this list to see who the real successes are.

And your bio:

>Tyler Menezes is the Executive Director at SRND, where he works to increase diverse Computer Science enrollment across North America by inspiring underrepresented students to give coding a try. Born in Canada but raised in the Pacific Northwest, he briefly attended the University of Washington before dropping out to start a Y Combinator and venture-backed social video startup in 2011. This, combined with stints working in machine learning at Microsoft Research and as a programmer at several Seattle startups, led to his work finding data-driven solutions to increasing CS diversity and enrollment since 2014. In his free time, Tyler helps run the Projects in CS class at Garfield High School, and organizes the public speaking event Ignite Seattle.


I don't really understand what you're trying to suggest from my bio??...

>Their Instagram and Twitter accounts churn out constant brand building material. >They’re building their personal brand

I don't even have an Instagram? And literally I made two business-related tweets in the last month, one of which was a RT of someone commenting on how the org I run is valuable. Which brings me to...

>They both have pseudo-startups

I run a nonprofit that's had about 42,000 students attend mostly physical, in-person events in 53 cities, over the last 10ish years. We are profitable and have employees. Our programs have a NPS of 70-80 and we get grants from a bunch of big companies on the basis of our outcomes. This has been my full-time job and only livelihood for the last 5 years.

>I’d be interested in reading an honest “Where are they now” follow up series that checks in with these founders at the 5-year mark

We've been around for 10 years, and I've been the ED for 5. We have continued to grow and improve our key metrics although we're not a startup and I'm not going for meteoric growth.


You may have been confused, yet you've elaborated GPs point for us very nicely. Two rather different impressions of people on the list in question.


Hi, Tyler is one of the kindest, humblest, and most thoughtful people I've ever met. CodeDay, one of the programs he runs, was also one of the most formative experiences I had as a teenager.

Please don't confuse the need to storytell to funders when running a nonprofit with vapid self-promotion.


The joke was not lost on me.


I actually went and read part of there post history and

    "My wife lost the diamond in her wedding ring and we were talking about getting it replaced. I have two daughters in their early 20s and they were aghast at the idea..."
So make that 8+!


HN is funny. There is always a response to questions posed in this manner explaining why some extraordinary circumstance is true rather than just agreeing with the premise raised by your question.

There was a question posed the other day "What car could you possibly be driving that would mean 10% of your driving tickets is a number greater than 1?" Instead of saying the figure may have been an exaggeration the answer was basically, "I drive a racecar."


Correct me if I am wrong but isn't the central premise of the book that if you take a late project and add more people to the team it takes the project longer???

I've literally never met a manager that practiced this. Is the book still relevant? Not disagreeing, just curious.


It's been ages since I read that book, but there is more to it that just the tag line you mention. It is very common to take a plan for work and to say, "This would take 10 people 1 year to developer, but we need it in 1-2 months. So let's put 100 programmers on the team". This is very much more obvious in Enterprise space and government contracting, but you see the reasoning everywhere.

Here's quite a famous example: https://www.statista.com/statistics/272140/employees-of-twit... It shows a graph of the number of employees at Twitter over time. In Jan '08, there are 8. In Jan '09 there are 29. In Jan '10 there are 130. In Jan '11 there are 350. In Dec '13 there are 2712.

Although a lot of that staff are going to be sales and marketing (and probably the growth is justified), the development team is also growing exponentially during that time. The Mythical Man Month would say that probably they are spending a lot more money than they need to to get the growth they needed.

I used to work for a manufacturer of telephony equipment. On one of the products I worked on they had 5000 developers! (A single piece of code!!!). The average amount of code deployed was 1 line of code per day per developer. As much as we can argue that KLOC is a bad measure of productivity, if your average developer is only producing considerably less than 1 KLOC in an entire year, you know you have really, terrible, terrible problems. One of the questions you might want to ask is, if you want to write about 5000 lines of code a day, where is the sweet spot, actually? I think we can agree it's not at 5000 programmers. However, it's often really, really difficult to talk to non-technical management and get them to understand that more programmers does not usually equal more productivity.

I could regale you with literally hundreds more examples, but I think it's sufficient to say that, yes, the Mythical Man Month is still really relevant these days.


You've never been on a project that was behind and management decided to add resources to it? Impressive!

The book is worthwhile, not just for the central lesson, but WHY (TL;DR: communication overhead between different individuals increase as you add "nodes" - interestingly, you can make analogies to L2 cache expiration problems and others) and also a nice view at IBM of the past. And it was written in an era where there wasn't the need to make every book 300 pages long, so it's generally a lot more meat/page, though hardly perfect.


> I've literally never met a manager that practiced this.

Yeah it's a pretty universal idea.

> Is the book still relevant?

Yes, precisely because that idea is so universal. Its advice has been relevant, insightful, and mostly ignored ever since it was written.


To be honest, it is incredibly effective? Have you ever given it a shot?


Really? You don't see a different in regionally accredited or non-accredited schools?


So just to clarify, this behavior seems to be by design. In that case it does seem the original comment is objectively wrong if the code is readable and maintainable and accomplishes the desired behavior.


As parent comments mention, sending back the whole-page response when you vote on a comment is a great idea if you have JavaScript disabled or aren't logged in.

But it'd be a quick performance win if it didn't do that when you were logged in with JavaScript enabled. The actual JavaScript part of this is actually already implemented -- that's why the page doesn't refresh when you upvote my comment -- so you'd just need one if-statement on the server side to send a blank response instead of a redirect.

Sure, 10 KB of download and the server CPU time needed to re-generate the listing page is probably pretty negligible, but multiply that by the number of votes casted on Hacker News every day and it starts to add up.


Exactly, and it even adds up quickly for a single user in common cases like voting on a bunch of comments while reading a thread.

If someone loads this thread right now, the initial page load is 61KB (gzipped). If they read down the thread and vote on 30 comments while they're doing it, they transfer an additional 480KB (16KB/vote [1]). There's no reason that they should be receiving 8x more data by voting on a relatively low number of comments (~10% of the thread) than they did when loading the entire page originally. It also has to re-generate the page an extra 30 times unnecessarily - a repeatedly voting user becomes like a heavy multiplier to your traffic.

[1]: Also, I just noticed that the responses back from voting actually aren't the full page, they're truncated. It seems like maybe the response size is capped at 16KB gzipped? That implies that there's already some kind of special handling for the voting responses.


From what i can see, the response only contains the comment you upvoted and its children. It's important for people like me who don't have Javascript, but the JS voting system could probably do with a simple HEAD request.


Seconding. Sending back the whole page on AJAX upvote seems unnecessarily wasteful, and sounds like something trivially fixable.

Taking data from 2.5 years ago[0], HN has ~300k daily uniques. Assuming 10% of that are users, each upvoting one story, that's 30k unnecessary page renders per day. That's ~2% of the total views (though the more expensive views - AFAIK when you're logged out, you get cached pages?), so on the one hand it's not much, but on the other hand the fix should be trivial and have minimal impact on code readability.

--

[0] - https://news.ycombinator.com/item?id=9220098


Didn't this recently change? Prior to 2018 was it not considered a "like for like" transaction?


Only against the advice of most accountants. Exchanges between different grades of the same precious metal aren't considered like kind transactions, so it seems pretty unlikely this "trick" would work for crypto.


> Prior to 2018 was it not considered a "like for like" transaction?

It's "far from certain" [1]. Tax diligence is part of investing; these questions should be approached before one trades an asset, not after.

[1] https://www.coindesk.com/owe-irs-crypto-crypto-trades


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: