Linux 3.6 released - <AUTHOR> https://lkml.org/lkml/2012/9/30/152 <comment><USER2> OK, so here's a question. I've always wanted to spend some time reading through the Linux kernel - I really enjoyed operating systems when I studied it (and reading through MINIX src) but I don't really know where/how to start with Linux.

I mean, I guess I can just dive in, and maybe that's the best approach, but is there a strategy anyone would recommend for reading the Linux source in terms of it making sense as a combined unit of code (as opposed to a collection of algorithms, if that makes sense)?

<comment><USER3> I recently did exactly what you describe. My first contribution to the Linux kernel actually shipped with this release. If I recall correctly it took me about 80 hours to go from no knowledge to first patch. Assuming no knowledge, it is a two step process.

(1) Learn basic OS concepts through xv6.

xv6 is a reimplementation of an early version of Unix, designed to be as simple as possible and accompanied by a whole book of commentary. Get the book and the source cost listing printed and bound: <http://pdos.csail.mit.edu/6.828/2012/xv6.html>. Work through the book and exercises. Use the lecture videos from 6.828 from 2011 if you need extra material in order to understand: <http://pdos.csail.mit.edu/6.828/2011/schedule.html>.

(2) Pick a part of OSes that you are interested in. Contribute to that part in Linux.

Figure out where that part is in the Linux kernel. Find a bug in the bug tracker and submit the patch. I found filesystems interesting, so I fixed a small bug in one of the filesystems. Use a cross reference, it will save you a lot of time: <http://lxr.free-electrons.com/source/include/linux/cpu.h>. Also feel free to subscribe to the Linux kernel subreddit: <http://www.reddit.com/r/kernel>. I've set up the sidebar with a lot of useful links.

The Linux kernel is large and complex. You need to equipe yourself with a mental model of an OS through xv6 and then pick one small, specific part to attack in Linux. Be tactical! Otherwise you will be overwhelmed.

\--

As an aside, I'm actually currently working on a tool that parses the Linux source code to find symbol definitions and then works its way back through the Git history to find the commit message for when the symbol was first defined. These commit messages usually contain really useful information about the original intent of the symbol and implementation details. Currently fighting with a few bugs in my C grammar, but should be able to work through those soon. Please feel free to email me at email@example.com if you want to be pinged when the tool is released.

<comment><USER4> _As an aside, I'm actually currently working on a tool that parses the Linux source code to find symbol definitions and then works its way back through the Git history to find the commit message for when the symbol was first defined._

Are you just doing something similar to cscope to find the definition of a symbol, then running git blame on that line? Or are you actually checking earlier revisions as well, to see if the symbol was moved or changed types?

<comment><USER3> I'm finding the definition of a symbol using a parsing expression grammar for C. I haven't yet decided upon the particular algorithm for finding the first commit, but I plan on using libgit2 to work directly with the repository. In the simplest case, you just iterate through all versions of a file and find the earliest one with the string in question. Obviously care is required when walking the repository history.

</comment></comment></comment></comment><comment><USER5> See the Kernel newbies page for a good summary of the news in 3.6.

<http://kernelnewbies.org/Linux_3.6>

</comment><comment><USER6> I'd really like to see btrfs start to stabilize and become more mainstream, but everything still seems to say that it's experimental.

The main reasons that I want it on my desktop are:

      * easy backups
      * checksums
      * maybe it will become integrated with package manager (I'm on ubuntu) so that I can roll back package updates if they don't work properly

<comment><USER7> It will be marked as experimental for a long time. There isn't a magical point at which it will suddenly be perfect and bug free. That said kernel 3.2 was a major point of stability. [https://btrfs.wiki.kernel.org/index.php/FAQ#Is_btrfs_stable....](https://btrfs.wiki.kernel.org/index.php/FAQ#Is_btrfs_stable.3F)

It is integrated with the package manager on Ubuntu already. I just upgraded my laptop to Quantal and part of the upgrade process spotted I was using btrfs and created a snapshot. (It was a complete waste of time as I have automatically created hourly, daily, weekly and monthly snapshots.) Doing regular package updates is very slow with btrfs. This is due to fsync() being called several times per file.

You'll also want Quantal for an updated btrfs-tools package. For example it lets you do scrubbing. You also need it (and kernel 3.3+) to change raid levels after filesystem creation. The Ubuntu 12.04 installer does create and install to btrfs but didn't let you configure things like raid level so you were stuck with whatever it did.

I've been running all my systems on btrfs for several months now on Ubuntu 12.04 (kernel 3.2) on both SSD and HDD including using RAID 0, RAID 1, dmcrypt/LUKS, inplace conversion from ext4 and who knows what else. (Across my server, workstation, laptop and HTPC.)

The only problem I have had is when filesystems fill up. I've never lost data but it can be quite frustrating trying to find files to delete (also need to be removed from snapshots), rebalancing etc to get things running smoothly again. The various ways of doing df are mostly a work of fiction.

My data is duplicated to offline backups, Dropbox, multiple systems and git/hg repositories so the failure of any system would be annoying but I'd never lose anything. You should make sure you are in that position first, independent of what filesystems are being used.

<comment><USER6> "Doing regular package updates is very slow with btrfs. This is due to fsync() being called several times per file."

You mean that fsync()s are more expensive on btrfs, or ubuntu calls them more often when using btrfs for some reason?

<comment><USER7> The former - fsyncs are more expensive because they involve copy on write updates all the way up the tree to the root. Some of the fsyncs are there because of ext4 quirks. That all said, every kernel release brings big improvements in btrfs especially metadata handling. IOW it is currently the worst it will be.

<comment><USER6> Why not just sync the data change and sync the metadata changes only to a write-ahead log? Or if the data is logged also, you only need to sync the log.

I assume btrfs uses a log, right?

<comment><USER7> A tree is the main data structure. The inspiration is this pdf <http://www.usenix.org/events/lsf07/tech/rodeh.pdf>

There is a log to help with fsyncs. <http://en.wikipedia.org/wiki/Btrfs>

</comment></comment></comment></comment></comment></comment><comment><USER8> TCP Fast Open (client side) is quite interesting. Is anyone aware of testable server examples/implementations yet?

<comment><USER9> I suppose [some] Google services may be the server side with Fast Open support: [http://googlecode.blogspot.com/2012/01/lets-make-tcp- faster....](http://googlecode.blogspot.com/2012/01/lets-make-tcp-faster.html)

</comment></comment><comment><USER10> And I still can't sleep my Powerbook /w Radeon because post KMS radeon doesn't support it yet (no one ported the pre-KMS code from the X driver portion of radeon into the post-KMS radeon kernel driver).

OTOH, I can just leave KMS off and have no 2D or 3D acceleration.

/rant

</comment><comment><USER11> Looking forward to Linux 3.7 with its support for ARM64:

[http://www.phoronix.com/scan.php?page=news_item&px=MTE5N...](http://www.phoronix.com/scan.php?page=news_item&px=MTE5NjQ)

<comment><USER12> The code is already out there, all 3.7 integration would represent is a stamp of approval. Consider that there is no hardware for the architecture yet, I don't know why approval would be very interesting:

[http://git.kernel.org/?p=linux/kernel/git/cmarinas/linux- aar...](http://git.kernel.org/?p=linux/kernel/git/cmarinas/linux-aarch64.git)

</comment></comment><comment><USER13> Lots of goodies!

<comment><USER14> From the desktop perspective, I really like the "Suspend to disk and memory at the same time" part. It's great that you don't have to think anymore if you're going to use your laptop in the next 2 days or not. If it runs out of power, it does - nothing gets lost!

Adding bufferbloat pieces into the main release is also good news (although that probably won't hit the servers that really need it for many more months...)

<comment><USER15> Do you think this will obsolete the 'hybrid suspend' functionality in pm- utils? I think that works by suspending to ram, waking up in 10 minutes then immediately suspending to disk.

Maybe a combination of these two approaches could be useful.</comment></comment></comment>


What's inside Python 'for' loop? - <AUTHOR> https://theailearner.com/2018/10/08/whats-inside-python-for-loop/ <comment><USER2> Fun side-effect of this: if you're writing a Python interpreter, you need to implement exceptions+"try...except" before you can fully implement the "for" loop. And to implement this "except", you need classes and basic inheritance.

EDIT: the second code in the article is slightly wrong. The for loop is actually equivalent to:

        iter_object = iter(my_list)
        while True:
            try:
                number = next(iter_object)
            except StopIteration:
                break
            sum += number # <-- the body of the original loop is here, outside the "try"
        print(sum)

because if the body of the original "for" loop raises a "StopIteration", the loop doesn't catch it.

</comment><comment><USER3> I'm not a particularly experienced programmer. It is a sign of my immature taste to find this ugly? The idea of assuming _any exception thrown_ will be the exception we expect (outside iteration limits) seems like an unnecessary abuse of the exception system. I'm really surprised it's the way such a fundamental construct in the language is written.

Is the idea here that all other exceptions will be thrown at the line "iter_object= iter(my_list)"? I guess this makes sense. But it still makes me uncomfortable. Should I become more comfortable with writing constructs like this?

<comment><USER4> That's not how it works.

"except StopIteration" only watches for the specific StopIteration exception coming from the next() call on the Iterator (the bit included in the try block).

If there was then an, for example, "except Error" line afterwards, then anything that causes an Error exception (ValueError, TypeError etc) would call those lines.

If you get any exception that has not been explicitly referenced in an except clause, then the program will halt, with _that_ exception as the error output.

<comment><USER3> Duh- reading comprehension fail- cheers. Same question though, there is still something that makes me uncomfortable about using exceptions as an expected- case control flow structure (as in, this is expected to catch an exception once every for loop call). Is that something I should get over, and should I write more code that uses exceptions in this fashion?

<comment><USER5> Python's official implementation is very slow and they don't care about performance. I wouldn't try to take any lessons from the way Python is implemented.

</comment></comment></comment></comment><comment><USER6> What's the overhead of exceptions like in Python? With .NET at least, especially with a debugger attached, this would have a pretty considerable impact!

<comment><USER7> Python is already so slow that it's comparable to normal iteration. But here's an example:

      timeit('next(x)', 'x = iter(range(1<<30))', number=1<<22)  # 0.22

      timeit('''try: raise StopIteration()
      except StopIteration: pass''', number=1<<22)  # 0.78

<comment><USER4> I pray for the day that Tensorflow has an official rust (or scala) api.

</comment></comment></comment><comment><USER8> The "inside" part is slightly wrong, the payload is outside of the try/except clause:

        while True:
            try:
                number = next(iter_object)
            except StopIteration:
                break
            sum += number

You can check this by throwing StopIteration inside the loop, and watching it propagate outside normally.</comment>


Ethernet Turns 40 - <AUTHOR> http://theinstitute.ieee.org/technology-focus/technology-history/ethernet-turns-40#.UffhEKgcEeI.hackernews <comment><USER2> The introduction to the article is a bit overblown. We were connecting computers, sharing printers and files and playing multiplayer games, long before we used Ethernet.

Now we all use Ethernet, and Ethernet has been around so long that devices are available at practically every price point. But for a long time, Ethernet was not the only choice.

As a Mac user, I was using AppleTalk (later called LocalTalk) until the late 90's. The controllers were built into every Mac, and the PhoneNet transceivers and wiring were extremely cheap. We just used plain, common, thin telephone wiring, daisy-chained from computer to computer. No need for hubs or carefully categorized cabling. The devices configured their own addresses, so we only had to give them names that meant something to humans, and not memorize all these 192.168 numbers.

LocalTalk was slow (230kbps), and the lack of DMA on most of the controllers really sucked, but it was a nice and easy way to start a network.

<comment><USER3> How were the name lookups done? It seems we still can't get this right in 2013 (mDNS & NMB)

<comment><USER4> The Mac broadcasted a packet and collected all the response packets from other Macs which responded to the broadcast packet. This gave AppleTalk a reputation for being chatty as all lookups resulted in a broadcast.

Documentation: [http://developer.apple.com/legacy/library/documentation/mac/...](http://developer.apple.com/legacy/library/documentation/mac/pdf/Networking/NBP.pdf)

</comment></comment></comment><comment><USER5> FTFA:

""In 1973, the Internet [which at that time was basically the ARPANET] on a good day ran at 50 kb/s," Metcalfe reflected in his oral history. "Ethernet ran at 2.94 megabits per second." Over the years, people urged Metcalfe to round the number up to 3. He always resisted, as a matter of emphasis: If one rounds 2.94 Mb to 3 Mb, the rounding error is more than 50 kb/s. "Ethernet's round-off error was bigger than Internet," said Metcafe. "That's how fast Ethernet was running.""

</comment><comment><USER6> Robert Metcalfe recently did a reddit AMA: [http://www.reddit.com/r/IAmA/comments/1erq51/youre_probably_...](http://www.reddit.com/r/IAmA/comments/1erq51/youre_probably_connecting_to_reddit_through_a/)

</comment><comment><USER7> What a wonderful thing to read just as I'm starting work for the day; put me right into a productive mood (washing all of the sociopolitical-hogwash from the rest of the front page right out of my head in the process.)

</comment><comment><USER8> Ethernet arose from Aloha Net

[http://www.isa.org/InTechTemplate.cfm?Section=InTech&templat...](http://www.isa.org/InTechTemplate.cfm?Section=InTech&template=/ContentManagement/ContentDisplay.cfm&ContentID=55888)

From the article: During the 1970s, a Harvard graduate student named Robert Metcalfe read a paper about something called Aloha Net. It was a radio system used in the Hawaiian Islands to send small messages, also called data packets, between islands. ... The packet communications network he designed became the worldwide standard we know today as Ethernet.

</comment><comment><USER9> "By using the word ether in its name, the PARC people alluded to the possibility that Ethernet could be based on coaxial, twisted-pair or optical fiber wiring and, eventually, on Wi-Fi."

Still waiting on that last one. ;) Hooray for 802.11.

</comment><comment><USER10> Ethernet is really great, I can't wait for affordable 10Gbps cards - right now the most you can get is 2Gbps (which is still enough to write/read seamlessly to even the fastest hard drives with the right setup).

<comment><USER11> 10G NICs have been around $400 for years; I've given up hope on them ever getting cheaper.

<comment><USER10> I think it's because people didn't really need 10Gb until now. With widespread use of NAS and SSDs in homes and offices, hopefully these adapters will become cheaper.

</comment></comment></comment><comment><USER12> Interview with Bob Metcalfe, worth watching (11 mins.):

[http://standards.ieee.org/events/ethernet/index.html](http://standards.ieee.org/events/ethernet/index.html)

</comment><comment><USER13> I think we're a little late to the party - this story is from July 15 and the facebook page for this dates back to May 15.

</comment><comment><USER14> While this is only tangentially related: I wish there was an easy way to use 10base5 Ethernet from a microcontroller.</comment>


Mathematically optimal markup with HTML5 - <AUTHOR> http://shinyplasticbag.posterous.com/mathematically-optimal-html

<comment><USER2> I hope that in determining which HTML is optimal _bandwidith_ wise, there is also some consideration of what HTML is optimal _rendering_ wise. (obvious cost savings of going hard down the bandwith optimizing aside)

Knowing how the parser treats certain constructs and deviations from the spec. probably gives us some insight into how long things will take to parse. Or is client side _that_ much faster than waiting on normal network latency?

<comment><USER3> The parsing time is probably negligible. I would guess that parsing HTML5 would be a few if not dozens of megabytes per second on modern hardware.

<comment><USER4> Parsing speed depends on the markup. One example is text layout, which is O(N) in the size of the text area. So 1 MB of text might be a lot slower to parse than 1 MB of no-op tags.

<comment><USER5> I would not say text layout is done during parsing, it is done when the parse tree that parsing produced is used to produce a render tree ('execution time'?)

</comment></comment></comment></comment><comment><USER6> I love how the author uses omitted-</p> as their example, when that's one of the things that was actually already defined in HTML4 and isn't a syntax error.

<comment><AUTHOR> Yeah, I know that. Another random example is <li>, which doesn't require a closing tag. It was just included as an example. Finding a genuine example would require actually grokking the HTML5 parsing algorithm and starting to try to find optimizations.

</comment></comment><comment><USER7> I suppose some day I'll have to start writing my HTML to be read by machines, rather than humans. Right now I treat it like code: proper indentation, helpful comments, and the occasional hidden message for the reader.

<comment><USER8> If you _write_ it, then surely you should be able to read it. Then you have a minifier convert it into non-human-readable form, if you like.

<comment><USER9> Except he doesn't write it. It's output from a program. Compilers don't emit readable output either.

I'm not saying I'm against clean HTML. But the argument you give is probably invalid.

</comment></comment></comment><comment><USER10> Interestingly, the HTML serialiser in html5lib[1] actually defaults to omitting omittable tags; I wanted a small script like htmltidy that used the HTML5 parsing algorithm, so I hooked up the html5lib parser and serialiser, and wound up with output even more chopped and cryptic than what I put in.

Luckily, setting the include-optional-tags option gave me much more readable output.

[1]: <http://code.google.com/p/html5lib/>

</comment><comment><USER11> <sarcasm> Sure, let's just start to omit ending tags from HTML. Who cares about older browsers that will fail to properly render our sites. I'm _sure_ that every business and user keeps their browsers up to date. </sarcasm>

<comment><AUTHOR> Actually, the HTML5 parsing algorithm was derived by reverse engineering the existing browser parsers. It's pretty compatible.

</comment></comment><comment><USER12> Does anyone have more details or examples of Google's "crige-worthy" HTML for efficiency?

<comment><USER13> Go view the source of Google.com

No </body> or </html> tags for one.

<comment><USER14> A friend of mine worked for Google when that was introduced and said it was purely a rendering speed optimization. Someone did some tests and found the page pops a little faster if you leave out those closing tags. I can't seem to find any articles on it but it seems more reasonable than trying to save a couple bytes, given the other markup that's been mentioned here.

<comment><USER15> Friend of mine did tests on this and found there is no significant performance difference in either direction. So dropping them is certainly worth it.

</comment></comment></comment></comment><comment><USER16> I have hard time understanding why browers' parsing algorithms should be standardized or why it's a good idea to do so. Shouldn't a language be defined declaratively using a grammar?</comment>


Japanese scientists create ice cream that doesn't melt using natural substance - <AUTHOR> https://phys.org/news/2017-08-japanese-scientists-ice-cream-doesnt.html <comment><USER2> so they made ice-cream from pupping? If it doesn't get melt at all on you tounge, it's not ice-cream :)

</comment><comment><USER3> Ice cream research: So hot right now.</comment>


Show HN: Human Programming Interface - <AUTHOR> https://beepb00p.xyz/hpi.html <comment><USER2> do you know a good python course?

<comment><AUTHOR> To be honest, not really..

I mean, I'm sure they exist, but for me it has been a really long time since I started using Python. And prior to that, I knew other programming languages, so for the most part leart by googling/stackoverflow.</comment></comment>


The Stuxnet Dossier (2010) [pdf] - <AUTHOR> http://www.symantec.com/content/en/us/enterprise/media/security_response/whitepapers/w32_stuxnet_dossier.pdf

<comment><AUTHOR> This is really an amazing read. I can't wrap my head aroung all the effort that went into creating Stuxnet. Also, in the dossier it's mentioned several times that the attackers compromised two digital certificates. After Snowden, I don't think those were compromised, but more likely "just given" to the attackers.</comment>


UCLA Health System reports patient data breach; 4.5M may be affected - <AUTHOR> http://www.latimes.com/business/la-fi-ucla-medical-data-20150717-story.html

<comment><USER2> The US government's "cybersecurity policy" is completely and utterly inadequate. Their thinking so far has been "well, let's leave aside the _actual security_ stuff, and focus on getting _cyber-weapons_ \- the more cyber-weapons we have, the scarier we'll be and nobody will touch us!"

Yeah, _maybe_ that can work against a mid-level country like Iran. But what about China or Russia? Are they really going to be dissuaded from hacking US agencies and private companies because the US will hack them back? Are they going to be afraid that US threatens them with actual war? Nope.

Then there are also the "guerrilla hackers", which could be anyone from random hacker groups, to cartels in Mexico to North Korea who doesn't care if you hack back its hundreds of PCs. Your scary cyberweapons aren't going to dissuade them either.

The US government needs to stop making encryption and strong security (that itself can't hack) public enemy #1, and instead actually promote them in every single agency and raise security standards that private companies have to meet as well, _especially_ if they are storing sensitive customer data.

As Schneier said earlier, the US has the most to lose out of all the countries by _actively trying to keep_ the web vulnerable.</comment>


Show HN: PluginStash.com– Free directory of 'everything' to build your startup - <AUTHOR> http://www.pluginstash.com <comment><USER3> Looks good. How does it compare to [http://startupstash.com/](http://startupstash.com/) ?

<comment><AUTHOR> It contains more resources than startupstash. It has more marketing resources to take your startup to the next level.

</comment></comment><comment><USER4> Found some great resources that I can put to use today. Thanks! Agree that a switch from red would be a nice change.

<comment><AUTHOR> Thanks for your feedback. We are considering a different color. We are in the process of changing the color now. Thanks

</comment></comment><comment><USER5> Do you have resources on how to incorporate your startup ?

<comment><AUTHOR> Yes. I am updating that shortly. I am uploading the same set of documentation that we used to incorporate our own startup - <USER2>

<comment><USER5> Thanks! Generally speaking it would be helpful to have info on the business side of things, such as incorporation, taxes, bookkeeping and I probably missed a bunch.

<comment><AUTHOR> Yes. I agree. I am uploading those shortly. Please stay tuned

</comment></comment></comment></comment><comment><USER6> sweet, great tool. the red is a little harsh imo. also went to send you an email via that plugin and no-go

<comment><AUTHOR> I have now changed the color for the boxes. Please let me know if this looks better

</comment></comment><comment><USER7> Love it!

<comment><AUTHOR> Thanks</comment></comment>


Mark Cuban: The Best Equity is Sweat Equity - <AUTHOR> http://www.blogmaverick.com/2008/01/02/the-best-equity-is-sweat-equity/ <comment><USER2> _"... The reality is that for most businesses, they don't need more cash, they need more brains. ..."_

Nice quote and a reality for a lot of software companies and is a key JOS essay: _"... convert money to code through programmers ..."_ ~ <http://www.joelonsoftware.com/articles/fog0000000074.html>

The suggestions here are pretty useful but the title, _Sweat equity_ left a bitter taste. Sweat equity works okay where you are a founder not a hired hand. It really means lower wages with a _chance_ of payoff at the mercy of founders.

More reason for starting your own startup.

<comment><USER3> Agreed. The term sweat equity is a negative one, but if you are joining a company at the stage Cuban is referring to (i.e. when it has little to no cash) you should be getting a reasonable amount of equity -- at least enough to make your hard work worthwhile.

</comment></comment><comment><USER4> I first read the Mark Cuban blog a few days / weeks back when he did a repost of his own success story. I was impressed and wanted to read more. The last couple of posts have not been so insightful as the first and leave large "what if"s unanswered. I will keep checking back for sure to see if another gem appears though. Maybe I am too wrapped up in looking for the bridge that takes me from intent and effort to success.

</comment><comment><USER5> Something about Mark Cuban just pisses me off.

</comment><comment><USER6> It's hard to take a tech commentator who still writes "MicroSoft" seriously.

<comment><USER7> Hey, sometimes old habbits die hard. It hardly makes the article less credible.</comment></comment>


InspirePay Launches - <AUTHOR> https://inspirepay.com/

<comment><AUTHOR> More info here: <http://www.inspirecommerce.com/>

From what I read a while back, I believe this is supposed to offer more international payment options than is typical, although I don't know how far they are along with that yet.

</comment><comment><USER2> The landing page is quite light on details. I signed up, and it allows you to setup a payment page that links to your Stripe, Authorize.net, Sage, or their (Inspire) gateway. That seems to be the long and short of it.

<comment><AUTHOR> Also, just a note that I am not connected with them in any way, just signed up a while back and got an email. I run a little business and it is a pain to take international payments in the same way I can with something like Square.

On the Inspire Commerce signup, you will see that there are options for both a US or a Global Merchant Account.

</comment></comment><comment><USER3> Went to the site - inspirepay.com, Got a list of features but no 'About' page, no 'Contacts' page?</comment>


How to Hire—and Get Hired—in a Recession - <AUTHOR> http://www.businessweek.com/smallbiz/content/apr2009/sb20090414_087017.htm

<comment><AUTHOR> There's some overreaching hyperbole (typical for calacanis, of course), but the article also has some good interview advice. We're looking for a new hire right now, and it's hard to find someone with a motivation and skill set that compliments your own.

</comment><comment><USER2> thanks for posting.</comment>


William Stein: mathematical software and me, a very personal recollection [pdf]  - <AUTHOR> http://wstein.org/mathsoftbio/history.pdf

<comment><USER2> It was interesting to read how sage developed. I use it all the time, but had never known...

The Magma stuff sounds nasty. All the more reason to avoid proprietary software.</comment>


PHP 7: Introducing a domain name validator and making the URL validator stricter - <AUTHOR> http://dunglas.fr/2014/11/php-7-introducing-a-domain-name-validator-and-making-the-url-validator-stricter/

<comment><USER2> What about PHP 6? I've looked recently on php.net, but there are no news about it over there.

<comment><USER3> [https://wiki.php.net/rfc/php6](https://wiki.php.net/rfc/php6) PHP 7 was voted to be the next version for the reasons stated on that page

</comment></comment><comment><USER4> This does not sound like a very exciting feature. I understand its use and necessity, but it doens't sound that exciting for a language that is being accused of being "in the past."

 _Disclaimer: I currently do and have used for some time PHP at my job._

</comment><comment><USER5> [https://publicsuffix.org/learn/](https://publicsuffix.org/learn/)

<comment><USER6> From your link

 _Some people use the PSL to determine what is a valid domain name and what isn 't. This is dangerous, particularly in these days where new gTLDs are arriving at a rapid pace, if your software does not regularly receive PSL updates, because it will erroneously think new gTLDs are not valid._</comment></comment>


Delegate or die: the self-employed trap - <AUTHOR> http://www.sivers.org/delegate/ <comment><USER3> A few of my savvier (small-ish) software buddies use this system:

1) We have an onboarding Google Doc for everyone at the company. It is grouped into headings. One heading might be, e.g., "Common Customer Support Questions" followed by "Query: A customer complains they can't log into the software. Common phrasings for this: X, Y, Z." Research: "Go to page X in the dashboard [detailed in Internal Tools]. Search for... . If you find the customer, use the password reset tool, then copy/paste the following response to the customer, adding in their first name if you can reasonably guess it. If the tool reports no results, forward email to firstname.lastname@example.com and send no response."

2) Every time the proprietor gets tired of a genre of emails, they improve either the internal tools or the business rules to optimize themselves out of that workflow.

3) There is frequently a catch-all rule saying something like "If you have a novel situation and think you can handle it for under $100, do so [see: Getting Access To A Company Card], and fill in why the situation was novel, how you handled it, and what you spent on your weekly report Google doc. Don't worry, we trust you to use your judgement." (This is probably among the best pieces of actionable advice Tim Ferris ever gave.)

4) Capturing this state machine as a Google doc means the business has a memory longer than the individual workers, which is _particularly_ important in a virtual-company sort of situation where you're dealing with VAs/freelancers who a) will often not pan out and b) when they _do_ pan out have an expected lifetime tenure with the company of 6 ~ 24 months only.

<comment><USER4> Another solution for this is a wiki instead of a Google doc. I've seen it work well. But the important part is to make it easy to use, easy to search, and easy to update. Then just make sure as many questions as possible are answerable by the wiki. About to type an email with an answer? It better have the link to the wiki in it.

<comment><USER5> I've also seen wikis that just turn into gigantic repositories of stale data that just sit around while tribal knowledge is passed around by word of mouth. This seems to be the default state of the company wiki, really.

<comment><USER6> Any document is only as good as it is maintained. A wiki has to be searchable, editable for the most basic of user as well that would be modifying it.

<comment><USER7> I agree, and so it always puzzles me why wikis are so hard to maintain. We use Google Sites at my job, and I've never found them particularly fluid, intuitive or efficient.

A markdown based wiki would be a decent start, but I still overall feel like this is an unsolved problem.

<comment><USER8> I think a lot of the problem is whenever you don't easily "see" all the information. In a document you can scan it beginning to end, and get an idea of what needs work. In a wiki you need to click through to other pages to see whether subsidiary pages need work.

Perhaps a wiki that allows pulling in "snippets" from linked pages could help.

<comment><USER9> MediaWiki has a templates feature.

<https://www.mediawiki.org/wiki/Templates>

</comment></comment></comment></comment></comment></comment></comment><comment><USER10> This is excellent advice, so often you see great capable people buckling from stress and worse because they don't know how to delegate.

The way I prefer to do it is to give everyone a piece of the project that they own. I don't want to know how or when they do their part, I just want to know that it gets done, works and that it plays well with what other people on the project are doing.

Recently I was in charge of a live webcast from a rocket launch in the middle of the Baltic Sea. A hard problem for several reasons. It involved high-speed Wi-fi over a 40 kilometer distance by having a parabolic antenna on land that tracks its counterpart at sea; using software written in C to control a videomixer in the middle of the ocean from the Internet, getting the right camera angles, mounting cameras, etc.; setting up a live studio on land where technicians could control videofeeds and move the cameras at sea, webcasting to thousands of users, making sure there was a competent speaker, creating filler videos, getting the logistics about everything right and much more. Also, since this is an opensource project there was no money, and I had to find the crew myself.

It isn't really that hard, if only you accept a few things.

1) You're not the smartest guy. There's someone smarter than you that can do whatever part of the project you have trouble with.

2) Let people take ownership of a part of their project and don't tell them what to do. Tell them what the goal is and let them do it however they want.

2) When they do awesome stuff make sure you tell them. People are capable of much more than they think it only they're motivated to so so.

3) Make sure it's fun.

4) Your job as a project manager is to make sure that the awesome stuff people do plays well with the awesome stuff other people do. You're in charge of the interfaces between people.

5) Your job as a project manager is to make sure people can do their job well. That means moving obstacles in the form of meetings, budgets, politics, etc.

5) Don't take credit for what you didn't do.

<comment><USER11> number 2 and number 2 are golden.

(yes I mean this to be funny, but it's also true. Especially the first #2.)

<comment><USER10> ah sorry about that, and thanks for taking it in good stride :-)

<comment><USER12> FWIW, the fives are equally sound as well.

</comment></comment></comment></comment><comment><USER13> There is a fine balance to be achieved here. If you've read more of Derek's (excellent) posts, you'll know that his complete hands-off style led to the company almost collapsing. Delegating like this is a great step, but a leader's responsibility is to lead, not hide away.

<comment><USER14> _If you've read more of Derek's (excellent) posts, you'll know that his complete hands-off style led to the company almost collapsing._

I would like to see these posts. Could you link them?

<comment><USER15> <http://sivers.org/trust-but-verify>

In his book there's also a story about how, when asked which profit share scheme the company should use, he said "you decide" - 6 months later his accountant rang and said _all_ the profits were being shared amongst the employees - so scrapped the scheme and never spoke to them again. I can't find the post on his site though.

<comment><USER16> Interesting. While I really enjoyed the post, something that stuck out for me was: what if they don't apply your philosophy as you expect? Isn't this how great companies fall down, when the founder's philosophy is lost and replaced by internal politics? Some how you should be able to review the decisions being made without having to waste even more time doing the review.

<comment><USER15> I think there's a fundamental difference between being a "manager" and being a "doer".

If you're a "doer" (for example, a developer) your to-do list for today is likely to have three or four items on it - each a couple of hours in length - and context switches (interruptions, changing task) are _expensive_ (half an hour or so).

If you're a manager, your to-do list is actually about a hundred items long - but each item only takes a few minutes to complete (also meaning that it's probably not written down and it's hard to enumerate what you actually did today). And most importantly - context switches are cheap.

So reviewing someone else's work is actually only a ten minute job (it doesn't need to be detailed - just check to see if it fits with your philosophy).

But for a developer that's ten minutes plus an hour of context switching - making it very expensive.

For a manager that's ten minutes, plus a minute of context switching - <USER2> it cheap.

</comment></comment></comment></comment></comment><comment><USER17> If you read Dune from Frank Herbert, you might recall Paul observing his father's soldiers doing their jobs in silence due to Leto (the father) giving little to no orders to them.

"If you command something once, you'll have to command it again all the time." (Paraphrased as I didn't read the English version.)

Apparently, Derek "uncommanded his soldiers."

</comment><comment><USER18> A subtle and yet key thing from this article: the guy delegated writing the answer into the manual; irritatingly, I know that that is a step I would have missed (leaving me now in charge of formatting a manual).

</comment><comment><USER19> The step before this one also seems to be hard for many small organisations that I've worked with. Before you can delegate - you have to have somebody to delegate to.

I've lost count of the number of folk who slog themselves to the bone _long_ after the time when it would have been sensible to grow the company with a few extra people. For some people having other people in the company, let alone actually letting them make decisions, seems to be a chasm they find it hard to cross.

</comment><comment><USER20> "The E-Myth Revisited" is a great book that deals with this problem (amongst other things).

<comment><USER21> I see it's from 1995. Is there something more updated? With the prominence of programming life-style businesses I'd imagine there are new things to be taught.

<comment><USER22> It's still a pretty valid book:

"Work on your business, not in your business"

the problems are the same - technology can help you solve them, but fundamentally it's an issue of how to scale up in terms of people. Here's another one:

<http://www.amazon.com/dp/B004IYISQW/?tag=dedasys-20>

with a cute story, but the concepts are pretty similar.

Rob Walling also covers this, briefly and more to the point in Start Small, Stay Small:

<http://www.amazon.com/dp/B003YH9MMI/?tag=dedasys-20>

Which is also full of real, practical advice for people doing small software businesses.

<comment><USER23> were the affiliate tags really necessary?

<comment><USER22> Something I wrote about those a few days ago:

<http://news.ycombinator.com/item?id=4360330>

I took the time to recommend some books that were very specific to the thread at hand, that I had taken the time to read and evaluate. Getting a few extra dollars to buy more books with, that costs those clicking nothing, seems like a mutually beneficial transaction in that it makes me more likely to read some interesting books I can recommend in the future.

So: yes, they were. If you don't like them, don't click on them. If you think my account is a spam account, created for the purpose of spamming HN with affiliate links, feel free to report it to Paul Graham.

<comment><USER24> I don't have a problem at all that you put in the affiliate link and didn't even notice it.

Otoh I think the disclaimer that you made above is good and informs people of why you did what you did so it might be an idea to include it. If the parent thought that, I'm sure others did as well. (Of course this might encourage others to do the same who don't put the same effort in that you did to read and evaluate.)

This is somewhat similar to when someone at a store makes a suggestion and adds "I'm not on commission". Here you are saying "I am on commission but I use this product and can vouch for it". Nothing wrong with that.

(I'd like a suggestion on a learning rails book by the way.)

<comment><USER25> Ruby:

[free] <http://ruby.bastardsbook.com/toc/> [free] <http://ruby.learncodethehardway.org/> [free] <http://mislav.uniqpath.com/poignant-guide/book/>

[$$$] The Well-Grounded Rubyist

Rails:

[free] <http://ruby.railstutorial.org/>

</comment></comment></comment></comment></comment></comment></comment><comment><USER26> More comments from one year ago: <http://news.ycombinator.com/item?id=2132591>

</comment><comment><USER24> "The next day, as soon as I walked in the door, someone asked, "Derek, someone whose CDs"

To me interruptions are the thing I hate the most. What has worked for me in the past is to insist (despite "open door philosophy") that all questions are queued and asked at a single time, as practical. Sure the person asking wants immediate relief, but there is no reason you need to answer questions according to their schedule, unless it is urgent, if they can be combined with other questions they (or others) have.

That's actually one of the benefits of email vs. a telephone call. You can handle it w/o getting interrupted or knocked out of a zone.

<comment><USER27> I hate interruptions as well, but if you're going to be a manager, I think you have to learn to live with them.

Managers exist to support the managed. Front-line employees are the ones doing the actual work, and I think the actual work should always have the highest priority.

As Derek demonstrates, the way to reduce interruptive employee questions isn't to hide them by driving people away. (If you do that, people will just make shit up or dither, and both are terrible habits.) It's to keep improving things until they don't need to ask.

</comment></comment><comment><USER6> My experiences:

Learn why: Figure out why you do things the way you do. Write it down, make screen casts, whatever.

Teach why: The how can always be evolving and updated. Store it in a wiki. Google docs aren't searchable.

Don't prematurely automate: Be sure to systemize your business before automating it. If you automate a process that isn't reasonably mature manually, you will have lots of pains.

</comment><comment><USER28> This remains still great stuff, but it leaps from the "doing everything yourself" dilemma straight to handling several employees asking you questions, skipping the "first employee" problem. The gap between those two situations remains _vast_ and more reading on going from being time stressed and doing everything to having that first employee would be awesome.

</comment><comment><USER29> reading this felt like reading an Aesop's Fables :). Very useful

<comment><USER30> Sivers is one of the few writers on the subject of business/startups that is reliably good.

A few reasons this is the case:

1\. He's not some professional blogger pontificating on things he doesn't know about. He started a real business and his posts are from his experiences starting and scaling up a successful business. He's not the usual mountebank type you get here.

2\. His real business involved selling actual products that made people happy, he wasn't agglomerating eyeballs for wholesale to the advertising industry. The value proposition is very explicit.

3\. He thinks like an engineer and applies the rational processes normally demanded of programmers/engineers/etc. to the business. It's not Six-Sigma certification lessons, it's him analyzing and responding to discrete business, engineering, and product problems.

You could just bundle up a dump of every post he's made about programming, products, and businesses and sell it as a book and be distributing something far more useful than 99% of what exists on the business advice book market or what gets posted to HN day to day. Toss in a bonus pack of Patrick's advice on business, SEO, A-B testing, statistics, marketing, etc and you've got a great batch of material to start with.

The stuff is timeless (relative to the internet) in a way that Norvig's post on his sudoku solver for demonstrating dynamic programming and constraint solving was.

<comment><USER31> Agreed. Actually there is a Sivers book, it's called "Anything you want"

</comment></comment></comment><comment><USER32> Delegation is important but you need the financial capacity to afford it. As a consequence, outsourcing some tasks such as accounting is usually more feasible at the beginning since hiring comes with its own many costs and risks – especially in countries with a more restrictive labor law than in the US.

</comment><comment><USER33> Thanks for reminding me to step back and look at my business (and read the e-myth again). Read the e-myth many years ago but it's time for another read</comment>