Learn a Programming Language Faster by Copying Unix - <AUTHOR> http://www.rodrigoalvesvieira.com/copy-unix/ <comment><USER2> <http://www.haskell.org/haskellwiki/Simple_unix_tools>

<comment><AUTHOR> Wow! What a pearl!

</comment></comment><comment><USER3> I write a unit testing framework in every new language I learn. I find it's a great workout because making it usable for yourself is immediately assessable, and it often forces you into deeper areas of the language, including reflection and meta-programming.

<comment><USER4> You might want to have a look at QuickCheck. Trying to port it's techniques to other languages will also give you some insight (and will result in valuable tools).

<comment><USER5> And make you miss the ability to overload functions just on return type. Same thing happens if you use Haskell's regex library or try t port monads to another language.

<comment><USER4> Indeed. Overloading on return type is one of the few things that you can't do in dynamic languages by design (and in most statically typed ones, neither, but that's an accident).

<comment><USER5> Perl is dynamic and does allow return value overloading via the wantarray function.

<comment><USER4> Thanks. I will have to think a bit harder, and see whether I can rescue my statement in modified form.

<comment><USER6> Please do! It's very interesting; I'm not good enough in PLT to try and find out the answer for myself (in such a short amount of free time I have lately) but I'm very curious if it's true that you cannot have overloading on return type in unityped languages by principle.

<comment><USER5> This is not hard to understand: under usual semantics for function calls it is clearly impossible to do return type overloading in a dynamically typed language. But, as I pointed out above, it is perfectly practical to cheat and provide an indication of the desired return type as an extra hidden argument to every function call (this is what Perl does with wantarray: it is a "builtin function" but the effect is really that of an extra boolean parameter to every function call that specifies whether the result should be an array or not).

<comment><USER6> Ok, this much I understand, but I wouldn't call this overloading on return type... It's - clearly - overloading on input type, either implicit (wantarray - I checked the docs, it seems to be a variable set automaticaly depending on context by the interpreter) or explicit, but input type nevertheless.

So, the short answer is - as I thought previously - that no, you can't have implicit dispatch on return type in dynamically typed language.

Contracts are probably getting close, but you still need a version of apply that will get expected return type and a bunch of functions to introspect (or a macro that would do the same, but let's not wander there, as lispy macro systems are equivalent with static type systems anyway).

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER7> For those who want a very clear, concise set of userland code to try translating for practice, consider using 9base: <http://tools.suckless.org/9base>

It's not quite Unix, but it's still quite lovely and it's rather succinct:

"It also contains the Plan 9 libc, libbio, libregexp, libfmt and libutf. The overall SLOC is about 66kSLOC, so this userland + all libs is much smaller than, e.g. bash (duh!)."

<comment><USER8> in the same spirit: unixv6 <https://github.com/guilleiguaran/xv6>

</comment></comment><comment><USER9> This works well as a learning method, most probably because UNIX tools are well documented, and there are readily available binaries. Many introductory programming courses I took and taught back in the day were using UNIX tools as programming assignments.

I believe, any well documented coding problem accompanied with a sample binary implementation should have the effective educational value.

Sites like interviewstreet.com should take this as a guide, even though their audience is not beginners. If you look at sample problems there, they are usually poorly described, and sample outputs are trivial and don't contribute to the textual description.

</comment><comment><USER10> My favourite way to learn new languages & platforms was implementing a du-like ('disk usage') tool. It was also the exercise I proposed to my students. It doesn't require complex algorithms but touches a lot of the basics: recursion, filesystems, command line parsing, output formatting, etc.

<comment><USER11> I am taking Operating Systems at Auburn University, and my professor had us work on the Linux kernel source, learn how to define and implement our own system calls using the SYSCALL_DEFINE[0-6] macro and then implement our own memory snapshot tool. It is similar to /proc/<pid>/statm. We had to get other info on major and minor page faults as well. I learn a lot doing things like this.

</comment></comment><comment><USER12> Rodrigo, I thought you should know that when browsing your site on an iPhone 4, the header overlapped the index. That wasn't a great description, so here is a screenshot: <http://db.tt/7grTPHsL>

You also cannot zoom in, which made it very hard to read.

<comment><AUTHOR> Hi Gabriel,

I'll change it. Thank you very much for reporting the problem. It now allows you to zoom in. I'll take more time to fix the header, tho.

Thanks man.

</comment></comment><comment><USER13> It is a good approach and back say 20 years ago the favorite was to redo the du command and add a conversion to MB (now handled by the -h option for human in the du and ls command).

Cat is also a good example and not just to learn a programming language but the OS. Ask somebody to come up with 20 ways to display a file, you can do it with not just the cat command. Now I'm not saying there are twenty ways, but it is one area which some delving and approach will allow people to try and find them.

Examples are for me the best way to learn a programming language and again with the simple Unix commands you have a common base which people are more likely to ifnd an example. Can't recall but great site on the net which has "Hello World" in about every programming language around.

After a while, you will start to add option to your redeveloped commands, then add entirely new commands and from there you can think about writting your own shell. No graphics or the like to distract you too much. Graphics as a rule in programming languages I have found to be like learning an after thought and also you are more controlled in the mentality behind the API. So I do advise not even looking at graphics for a while until you have learned how to flex the language without the distractions graphics and the way they are handled add a overhead to your code. I'm sure somebody will list a programming language that is easier to do graphicly as apposed to text output, though its a safe rule. SO just because you have windows, don't mean you have to jump into GUI's from day one, if even at all.

<comment><USER14> I remember that hello world site, I think it fell off the internet but there are still many of those types of sites. One of my favs was the 99 bottles song in many languages. There are also larger projects like PLEAC and Rosetta code that are similar.

<http://99-bottles-of-beer.net/> <http://pleac.sourceforge.net/> <http://rosettacode.org/wiki/Main_Page>

</comment></comment><comment><USER15> I learned programming in QBasic by experimenting with graphics, games and fractals.

I honestly think that plotting per-pixel graphics is a much more fun and rewarding way to learn programming, than a cat program.

It's only a shame Linux has no "mode 13h" screen and a PSET function in the C language :)

<comment><USER6> Shouldn't this be doable with simple library wrapping console framebuffer, that you Linux guys have and I suffer lack of on FreeBSD? (I can be very wrong - I'm just a bit jealous, not jealous enough to dive into fb implementation :))

</comment></comment><comment><USER16> When learning a new language, my first project is usually an IRC bot. It gives me a good feel of the language and I need to learn most core structures.

</comment><comment><USER17> I learned both perl and python by using them to replace my sysinit scripts on a Centos box. If you can get through this, I'd say you're "conversational" in a language.

You'll also know Linux better than most ever will.

</comment><comment><USER18> Here's mine: <https://github.com/darius/ung>

It can be fun if you try to put your own spin on things, though with diminishing returns.

 _Edit:_ also [https://github.com/darius/sketchbook/blob/master/regex/grep....](https://github.com/darius/sketchbook/blob/master/regex/grep.c)

</comment><comment><USER19> I feel like this approach might get boring after a couple of languages.

I think most people here could skim through the language intro, and then just start working on a new project in that language (picking up more of the language as they go).

This is the approach I usually use, and it seems more fun than porting the same tools. Just my opinion though :)

</comment><comment><USER20> On a side note, a more concise version of cat in ruby is:

        puts ARGF.read

I know it's besides the point, However I couldn't resist :)

<comment><AUTHOR> Hehe. Thanks.

</comment></comment><comment><USER21> For a purely functional language like Haskell, this would not be a very good advice. Any kind of I/O would involve monads and other imperative constructs. Better implement an algorithm involving trees or graphs to better appreciate a functional language.

<comment><USER22> Not at all. You can start doing I/O in Haskell without knowing anything at all about monads by just treating the do-syntax as an imperative DSL.

In fact, Bryan O'Sullivan (who wrote Real World Haskell) just held a tutorial session on Haskell a couple of weeks ago where people completely new to the language implemented simple Unix tools like "wc". I don't think monads were mentioned at all.

<comment><USER23> This only works if you are a top-down thinker. Many people are bottom-up thinkers.

<comment><USER24> Explain?

With "do" and the coincidental naming of "return", and IORefs if you insist, you can write imperative bottom-up code in Haskell.

</comment></comment></comment></comment><comment><USER25> Your ruby version of cat implements none of the command line switches.

I learned C by going through the FreeBSD code and helping with POSIX compliance. For fun I would implement a lot of the commands in Python. You get the most out of learning both the language and UNIX by implementing all the command line options.

<comment><USER26> And you get a better grounding in the Unix philosophy if you omit the command line switches and make small utilities to handle those cases, because as the paper said, cat -v is harmful (<http://harmful.cat-v.org/cat-v/unix_prog_design.pdf>).

<comment><USER27> The Unix philosophy is somewhat of a myth. <http://cm.bell- labs.com/cm/cs/who/dmr/man12.pdf> shows that that same first edition already had a -t option on ls. Surely, that should have been some | sort, but AFAICT, they did not bother to write that until some later time.

<comment><USER28> Sticking to a philosophy like a zealot makes it a religion. Keeping it as a philosophy means it encourages a certain approach, not that it makes it an absolute unbreakable rule, plus it would only results in bikeshed/flamewar arguments.

as PEP20 says:

        Special cases aren't special enough to break the rules.
        Although practicality beats purity.

<comment><USER27> I said "somewhat" for a reason, but I think there are just too many special cases to keep calling them exceptions. I use awk and sed, pipe things into bzip2, but I more often use tar with a z or j option to compress stuff an in a pipeline. We also do not have separate tools for parsing python/ruby/perl and executing it. If code reuse using pipes were successful, wouldn't we have a separate 'exec' tool that is backend to all scripting languages? Looking at gcc with its zillions of options, pipes sometimes look more like an implementation detail than as the primary way to compose tools.

Also, other kinds of reuse of the things mentioned as examples of the Unix philosophy are rare. What languages on your system use lex and yacc? 'but thise tools are outdated' is not a good revuttal; if they are, how has that come about? I think the Unix philosophy is perfect for prototyping, but 'real' stuff tends to need polish that 'the unix philosophy' cannot provide. As a final example, consider git. As I understand , it started life as a set of scripts, but eventually became a C program.

<comment> qu4z-2 I generally use the -j option to tar primarily because it's less typing. I think the ideal option is for these flags to be provided, but implemented using pipes under the hood so _tar -cj folder_ is just syntactic sugar for _tar -c | bzip2_. Similarly, _tar -cf folder.tar folder/_ could be implemented as _tar -c folder/ > folder.tar_. I think this way you get the conciseness of the flags approach, but also each item of functionality is only implemented once. Just a random thought.

</comment></comment></comment></comment></comment></comment><comment><USER29> Great advice. I've written a simple version of the `column` tool as an entry to the International Obfuscated Ruby Code Contest: <https://github.com/saizai/iorcc/pull/1>

Just a bit of fun, the contest doesn't seem to be very 'official'.

<comment><AUTHOR> nice!

</comment></comment><comment><USER30> A few years back I remember submitting the implementation of a couple of Unix tools in Perl. The idea was to implement as many of the standard tools as possible, in perl.

The project seems to be sleeping, although there are many contributions:

      http://search.cpan.org/dist/ppt/

<comment><USER31> Blimey... I've completely forgotten about Perl Power Tools! Here's the project home page - <http://ppt.sourceforge.net/>

</comment></comment><comment><USER32> The advantage and disadvantage of this approach: you have to already know Unix commands. Inevitably all programmers learn Unix commands - but probably a rough approach for beginners. Although, I'm guessing this advice isn't really aimed at beginners anyway.

<comment><USER33> Other side of the coin: you'll learn unix commands in a very non-superficial way.

</comment></comment><comment><USER34> I had this idea to demo basic python concepts. Here's an implementation of ls with links to further info:

<http://www.pixelbeat.org/talks/python/ls.py.html>

<comment><USER35> Thanks for this script, I'm following and found it very useful with links provided.

</comment></comment><comment><USER36> The example code for cat is only half of cat, which reminds me of Rob Pike's criticism of "cat -v"---Unix programs are often more complicated than they arguably should be, are "reimplementing" Unix programs often means implementing a small subset of the features.

Or, look up the manpage for your locally installed "tree" and see how many non-standard options and features have been bolted on.

I think it would be helpful when reimplementing Unix to try to work in more core features of the language, like its object or module system, which are more important than parsing argv or touching the filesystem.

<comment><USER37> Even if you ignore all of the bolted on options, his simple implementation of cat doesn't even handle "cat -" so I would say less than half. I think this is still a good exercise if you don't dig deep into the plumbing of all the tools you're reimplementing, but it's even better if you do.

</comment></comment><comment><USER38> Unix, as an environment, uses a handful of primitive paradigms. You will not learn much if you're using an advanced language.

If you were to learn Oz[1] in this manner, none of the its powerful features will be called for to implement simple filter programs, transforming text, and crashing when confused by unexpected input.

For languages that support advanced features, you're better off modeling "advanced" systems. Say, in the case of Oz, you might be better off modeling a secure microkernel or a VM; not dumb text processors.

\--

[1] <http://www.mozart-oz.org/>

</comment><comment><USER39> Another good thing about learning UNIX (or using Linux) is the ability to write code snippets that could automate daily chores (you can do in Windows too, but I am not going to speak about it here).

Some of the code I enjoyed writing and using is, code to remember directory paths I visited (I visit lot of them, and it is a pain to type lengthy ones). A wrapper for "ssh" to remember hosts and list them (again I had to visit bunch of them daily, and pain to type fully qualified host names), just like PuTTy-saved sessions.

These tools really boost the productivity and joy to use.

<comment><USER40> I agree with you, having the ability to script everyday tasks is awesome, though however in the case of the ssh wrapper it might be a little overkill, given that you can achieve the same (and more) with a ssh_config file [1] [2]. I would particularly recommend the ControlMaster option.

[1] [http://nerderati.com/2011/03/simplify-your-life-with-an- ssh-...](http://nerderati.com/2011/03/simplify-your-life-with-an-ssh-config- file/) [2] <http://linux.die.net/man/5/ssh_config>

</comment></comment><comment><USER41> Can someone give a non-expert way of going about this learning method?

For instance, what are your options on Windows or Mac? And are the languages you can do this with limited to Ruby, Python, or Javascript?

<comment><USER42> One of the simplifying assumptions that is built into this idea is that the input and output to the program are simple streams ( a file, a terminal ). Not surprisingly that makes things a lot less complex so you can focus on the programming.

Since a Raspberry Pi is only $35 or $50 with enough stuff to program it, that is one way to get started. Of course taking an older tossed of PC and installing Linux on it works too (which can often be done for free if there are businesses around)

<comment><USER43> Or a Linux VM on your Windows/Mac host

<comment><USER42> Aye, that works well, but if you're learning to program sometimes getting a VM installed is more frustration than its worth.

<comment><USER44> You can download complete Linux VM images that just work from the net. VirtualBox is free and is installed in 5 minutes. It's hardly frustrating. Certainly less so than getting a RPi up and running, not to mention you end up with an odd, underpowered device secondary to your regular machine.

That's not to say the RPi isn't an interesting, rewarding experience on its own merits -- that's why I got one --, but I wouldn't recommend it to anybody interested primarily in getting a *nix environment for experimentation or programming.

</comment></comment></comment></comment></comment><comment><USER45> For learning functional programming languages, Project Euler[1] is a really great resource.

[1] - <http://projecteuler.net/>

<comment><USER46> The exercises were paradigm-agnostic last I checked. Any reason why you feel they're specially suited to FP?

<comment><USER47> They could have meant Project Euler is more suited for functional languages than imperative, IO utilities.

</comment></comment></comment><comment><USER48> This is a brilliant idea, and may I suggest that one takes it slightly further than just implementing the core functionality, and aiming for a complete clone (optional parameters and all) with a few enhancements.

Indeed, for a further ego boost, why not also benchmark the performance of your versions against the performance of the native utilities? You never know, your new clone might end up being the new 'less' to the old 'more'!

<comment><AUTHOR> Yes. I think I nice approach would be just cloning core functionality of the program initially in your language of choice, then dealing with parameters and more advanced options as you learn that language better.

</comment></comment><comment><USER49> This is kind of funny since I taught myself a lot of go by porting a bunch of the coreutils. It still amazes me how much there is to learn from unix. Many many times I find myself going back to some programs src (cron, find, etc.) when I need the design/algorithm/feature in my own programs.

</comment><comment><USER50> I agree with this and have done it in the past myself. Its a great learning exercise for new languages. The problems are easily defined and its apparent when you've successfully completed. Once you've done with the easier ones try implementing grep and then diff.

</comment><comment><USER51> He's right. I have versions of "cat" in Java, Perl, Python, and C, all source. Reading from stdin and writing to stdout is the skeleton of a lot of tools, so starting from "cat" source is often the best way to get going on a new tool.

</comment><comment><USER52> I think this advice only really makes sense if you understand and have an appreciation for UNIX tools. Otherwise, I think it would be rather burdensome to come to understand how seemingly abstruse UNIX tools function.

</comment><comment><USER53> Congrats for being 18 and making it to the top of hacker news. You have proven that simple and concise advice can be greater in value than the most complex systems (or technically advanced articles that frequent HN).

<comment><AUTHOR> Thanks man.

</comment></comment><comment><USER31> Also see this HN post from a few months ago about a Linux/Unix distribution written in Perl - <http://news.ycombinator.com/item?id=4395076>

</comment><comment><USER54> tl;dr - this _does_ work to a point, but won't necessarily teach you idiomatic and community practices that come with experience, but it is surprisingly sticky

I had the great pleasure, year ago in my undergrad Operating Systems class, for the class assignment to be "write an OS in Java"...which of course was handed out to a group of students who had never seen Java. By the end of the semester we had written the core guts of a multi-tasking OS, a couple shells and the display systems to handle even displaying things like a unix-like console, a sane piping system, all the major user land utilities (sans some of the compiler things, but things like ls, cat, ps, etc.) a simple text editor and intra-system messaging system, etc. etc. etc.

It was a great curriculum and really was the first time we, as CS students, had the chance to really spend time understanding the subject matter without spending time focusing on stupid language tricks like we had in our various C and C++. The code we wrote was fairly straight forward (we were learning the language as we went, so kept to the KISS method) and focused instead of the material. It was probably among the hardest, and best class I've ever had on any subject.

Did I know Java at the end of it?

To a point -- I knew the pidgin dialect we wrote the OS in. A few semesters later I took a fluff software engineering course and had to hack out some various java server bits and had a roughshod time of it as I ran head first into the now common overengineeringitis that plagues modern Java development. I found the syntax and most of the standard library familiar, but the idiomatic ways of writing the code, community practices, the _shibboleths_ , nearly impenetrable without years buried in an enterprise software house.

I swore off Java and never looked back...moving on to Perl and Python for a spell (incidentally my standard "learn a new language" project is to write a simple non-lexical phrase extractor, it touches I/O, data structures, database connectivity, program flow, and if I get daring, multi-threading and a few other odds and ends and usually gives me a pretty good idea how a language works.

Now years later, taking a look at Android dev, I'm finding that writing code for the platform, _even though it's Java_ , to be like writing code for our old OS. It's pretty simple, there's great library support, and I don't have to wrap simple method calls in hundreds of lines of framework boilerplate nonsense. It's actually pretty fun.

But I've definitely been drawing heavily on that pidgin dialect of Java that I learned way back when -- it's kinda like riding a bicycle, except a few bits have changed here and there. So yeah, I think I did "learn" the language, and it's been amazing how much of it I can recall since it's been a decade since I did _any_ coding in it.

(this method also handily solves the "I need a project, a goal, to learn the language, otherwise I'm just twiddling bits" problem).

<comment><USER55> What is a non-lexical phrase extractor?

I googled it but it leads back to this page.

<comment><USER56> <META>

> I googled it but it leads back to this page.

It blows my mind how often this happens to me, even though I understand how and why. Especially since it's usually just a few minutes after the original comment is written. Google is _awesome_.

</META>

</comment></comment></comment><comment><USER57> I always implement "cat" as a first toy application when learning a new langauge - it's a great introduction tool as it deals with dealing with files, dealing with streams (stdin) and so on.

</comment><comment><USER58> Heh. I've been doing something similar. In my free time, I've been actually re-implementing the `tree` command (with most of the switches as well) in Python.

I'll also be writing some other utilities! :)

<comment><AUTHOR> Nice, man!

Share the code with me if you feel like it. My GitHub is <https://github.com/rodrigoalvesvieira> and my email is rodrigovieira1994 [at] gmail [dot] com

</comment></comment><comment><USER59> How many people learning python for the first time have a good knowledge of unix? This is like saying you should become a stronger first time weightlifter by juggling barbells.

</comment><comment><USER60> My first usable program in python was an implementation of 'wget' and seriously, implementation of such unix based commands do teach you an awesome lot.

</comment><comment><USER61> Knuth and Lamport used a "literate" implementation Unix' wc as example in the manual for Literate Programming tool cweb.

</comment><comment><USER62> Blog post is flawed: Try to recreate sed.

</comment><comment><USER63> It reminds me of the suggestion of learning foreign languages by reading Harry Potter in that translation.

</comment><comment><USER64> Very interesting and unique idea. I will suggest this to everyone. Thanks for sharing!

</comment><comment><USER65> What an awesome Idea! I wish I had thought of this when I was teaching intro to java!

</comment><comment><USER66> Great advice Rodrigo.

</comment><comment><USER67> I disagree. I think writing code to solve whatever small problem you're having right now is better. No point in recreating the wheel ,which is boring, and will result in something you'll never actually use because, well, cat already exists on your system.

But if you use it to start something new, or to add to your repretoire of utilities, then that is something you're more motivated to complete and more useful expenditure of time to boot.</comment>


Meet the Macaronis - <AUTHOR> https://www.historytoday.com/miscellanies/meet-macaronis <comment><USER2> Yankee Doodle went to town

A-riding on a pony,

Stuck a feather in his cap

And called it macaroni.</comment>


Need job to save my relationship - <AUTHOR> Dear HNers I have been reading HN for a while and I've never thought I would reach out to this community for this reason. Guess what, I want to save my relationship, and I'm sure you guys can help me. Here's the problem: my girlfriend can't find a job.
She is very smart (not only because I say she is, she is actually really smart) and has all qualities to be doing awesome work in a startup as a multi-hat talent. She has been a product manager in the valley for a couple years and has project management experience, well appreciated by customers. She is also perfectly trilingual and has a real gift for communication.
But, it's not that simple. She is not a US citizen. She needs a visa to work, and the more we try to understand why she doesn't get any traction after the usual first round of interviews, the more we are convinced that doors close automatically when HR people get to know that they will have to transfer her H1-B visa.
I have been trying to help her myself with my network of friends and acquaintances, but since I'm not particularly well connected, I wasn't able to help in promoting her search. So this is my best bet, probably the last one from my side before she has to abandon her job search and leave the SF Bay Area to return to her country, forgetting me, her nerdy boyfriend who thinks he's gonna "save" her by posting on hacker news. Anyways, I can't believe there are no companies around San Francisco who wouldn't benefit from a person like her to manage in an elegant fashion things related to product / project / customer / partner management.
Any piece or help or advice is appreciated. Thanks!
PS: If you guys feel like reaching out privately I have setup this gmail that I'll be monitoring: email@example.com <comment><USER2> Some thoughts: 1\. Would be good if you had a HN account before now. People are more likely to give help if you have given others help in the past. It gives them confidence that you're legit too.

2\. What is your girlfriends name? What companies has she worked for? What jobs titles has she had?

3\. If you're a US citizen then consider marriage if you are serious about your relationship or consider going to her country if you're not sure yet.

4\. Submit her resume or her HN name so people can check out her past experience.

5\. I googled your name and gmail and came up with no hits. This is one of those times when having a blog, github etc would be a good thing.

6\. Ask her to talk to her old workmates and managers, they are the best source of leads for a job, especially if they know people in big companies that work with Visa issues all the time.

Good luck!

<comment><AUTHOR> Thanks for your constructive feedback. 1\. I had no HN account in the past, I have been following this community for a while but never posted anything. I don't have a blog neither and the email address I added was created for the purpose of this post only so I didn't have to post my regular email address publicly. The name on this address is fake. 2\. In the past she has held the titles of Senior Business Analyst and Marketing Manager. 3\. I am not a US citizen and marriage for a visa is IMHO a direct way to shoot ourselves in the feet. 5\. I'm not a blogger. Just a regular engineer with no blog, and no open source contribs. 6\. She did all this. She got some help, obviously not enough to land a job..

Thanks for your suggestions!

</comment></comment><comment><USER3> You have options: 1\. Marriage 2\. She can apply to a large company. The visa issue isn't even a speed bump. 3\. Long distance relationship

<comment><USER4> There is more: 4. Leave the country with her!

<comment><USER5> +1 there's lot's of great stuff happening all over the world, don't limit yourself =D

<comment><USER6> +1 yes yes :D

</comment></comment></comment></comment><comment><USER7> Apply to m-soft, google, and any other company on the top 100 list of H1-B sponsors.

<comment><USER8> here's that list: <http://www.myvisajobs.com/Reports/2012-H1B-Visa- Sponsor.aspx>

<comment><USER9> HN is a gem

</comment></comment></comment><comment><USER10> Don't marry for a visa. As an American with an English wife and having lived as an expat for the past 8 years in expat communities - marring for a visa is a likely to ruin the relationship. One person will always think it is for love and the other for the visa, and this imbalance is hard to overcome.

<comment><AUTHOR> totally agree.

</comment></comment><comment><USER11> I think you need to consider more options, most likely some further outside of your comfort zone.

Are you madly in love with this woman? If so, be willing to consider leaving your job, and going to live in another country where you can both get residency status.

It may also be an option for you two to spend blocks of time in each others countries so that you stay under the visa-free travel requirements. For example, my girlfriend is from a Schengen country and I'm a California native. We can both spend 90 days out of every 6 months in each others' country, and do a bit of travel together in other countries. This has enabled us to let the relationship progress at a natural pace, and not rush into marriage for visa/citizenship reasons. I think that's really important. Some years ago I was dating a woman from New Caledonia whose ability to stay legally in the US was approaching a deadline. She suggested marriage as a workaround, but it really made me doubt the sincerity of her intentions.

If you're totally and completely in love with this woman, then you'll find a way. Asking around on HN can be one part of that, but more likely, you'll need to step your game up, hustle, maybe work some extra projects to cover travel/legal expenses, and possibly make some real sacrifices. If you love her with a real fire inside you, then the most important thing to both of you will be that you two are together and you'll find/make a way.

Sounds like it's time for you to go hard in the paint. Good luck.

</comment><comment><USER12> you might want to repost this at a different time. perhaps 8-10 hours from now if you want to get better visibility.

</comment><comment><USER13> if you love it put a ring it. first, get yourself a prenup. communal property laws can be.. interesting.

<comment><USER14> "It"? What is this "it"? If you think of your betrothed as an "it" I would suggest you're not ready to marry anyone.

(I know, this meme is out there, but you've given me an opportunity to protest it, so I am.)

<comment><USER15> I assume from the quoted song lyrics, "it" is "her finger." How is that not appropriate?

<comment> qu4z-2 Ah, the ever-catchy "If you love her finger, put a ring on it."

</comment></comment></comment></comment><comment><USER16> Same happened to me. But in my case I was the non US citizen boyfriend. You know what happened? I'm back to my country, shes got a new guy, I'm still alone. Move on. Life is hard. Nevertheless, I'm still looking for a H1-B job for myself. Good luck anyway, marry her!

<comment><AUTHOR> good luck to you too!

</comment></comment><comment><USER17> Marry her

<comment><USER18> This is a good idea.

<comment><USER19> No it's not. Regardless of how well you establish the ground rules, it's socially unacceptable which puts huge pressure on both people to lie about their relationship every time they're asked in the new country. If you split up, even if its as friends, undoing a marriage is a lot more difficult than undoing a regular unmarked relationship.

</comment></comment></comment><comment><USER20> How does one go about looking for an employer who will be able to arrange such a visa? I'm not from the US neither do I live there, but would like to (I'm a Junior Developer).

<comment><USER21> send your resume to firstname.lastname@example.com and i will take a look at it.

<comment><USER20> Thanks, I'm finishing up a little project where I'm designing on top of developing front and backend, so I'll contact you within a few days when I have it up as it's coming together rather nicely and will serve as a latest work sample.

</comment></comment></comment><comment><USER22> At my last startup we looked at trying to get H1-B visas for engineers. I forget the details, but the basic answer was: impossible. Or, rather, too expensive, difficult, and slow to be a useful option in a startup context. (FWIW, E3 visas, which are limited to Australians, were supposed to be much easier.)

As others suggest, I think your best option is to find an established company, one for whom getting visas is a well-established process. Good luck!

<comment><AUTHOR> yes we got to the same conclusions. wise advice. thanks !

</comment></comment><comment><USER23> How much do you love her? How important do you think the relationship is for you? How much do you both value this relationship? Think about those questions..and think about if you should marry her...

</comment><comment><USER24> If she's European, she can likely overstay without too much of an issue and the odds of her getting asked are slim to nil at most smaller companies

<comment><USER25> I don't think people should be encouraged to break immigration law.

People would say similar things to me: "such and such group does it and they never get deported, why don't you?" not realising that what they're advising me to do is risk my family and livelihood based on their unfounded (and often slightly racist) assumptions.

</comment></comment><comment><USER26> Well, good luck with a new job [I'm sure you will get a job for your GF :D)

</comment><comment><USER27> I am happy to see this post.

I am from India. I have no work for now and ready to start working on JS,Html,css & PHP kind of work. I am free from last September where last time I worked on a E-Commerce project.

I have previously worked on ASP.NET MVC. Made more then dozen of site and all of them still alive on internet with a great reputation.

These days I focus on Wordpress Administration, JS framework. bootstrap & jQuery development. This is all I love to work with.

I do work from Home (Remotely). I work on low price that's why people love to got better service at great price.

I have many clients that are return with few more. This will make my service game better. But really I want to do something innovative.

Making my own project never paid me something from #1 days. I have no good funding for my own family so I can't rely on my personal project.

Right now, I am looking for someone who love to get developer work Remotely. It's kind of work like tell in Night and got work done in Morning when you come from sleep and see that work is done whatever you want.

Is this not amazing. That's all Why people love it. Please contact me email@example.com for get some cool response.

Thanks Gupta Anirudha F1beta

<comment><USER28> A guy posts looking for a job and you put up your own ad? C'mon.

</comment></comment><comment><USER29> GO HOME JOB ROBBERS.

TITLE 8, SECTION 1182 - INADMISSIBLE ALIENS says you are BOTH illegals and need to go home right now. We have smart US citizens living in tents and smart US citizen PhDs working at Staples.

GO HOME NOW

You people have destroyed 28 million US jobs since 1998 and now there are not enough jobs to go around, are there? In 1998 the USA had FULL EMPLOYMENT. That was before the dark times, before the poojoos. We were here first and built this place and we're citizens so it's you who have to leave.

You were only supposed to be here temporarily anyway and go home in 2002.

Why are you still here?

I hear there is great demand for someone in India to start toilet factories.

<comment><USER30> Literally 15 seconds of googling: <http://www.infoplease.com/ipa/A0104719.html>

No, America did not have full employment in 1998. Closest was 1.5 unemployment in 1944 (which, to be fair, is really impressive.)

Not to mention the inherent xenophobia and nativism in your post. You should maybe look into labor economics and what Sacco and Vanzetti might have to say about your comments.

<comment><USER31> "Closest was 1.5 unemployment in 1944 (which, to be fair, is really impressive.)"

Could using up surplus workers in a world war have anything to do with that?

<comment><USER30> Of course it does. Doesn't make it not impressive.</comment></comment></comment></comment>


Backdoor Found in Webmin - <AUTHOR> https://decipher.sc/backdoor-found-in-webmin-utility <comment><USER2> To my surprise, not only are people using webmin, they still leave it open to the internet. [1]

[1] - [https://www.shodan.io/search?query=webmin](https://www.shodan.io/search?query=webmin)

<comment><USER3> Webmin probably has a higher than average number of users with limited or no technical skills, so not that surprising really.

This is why blaming the user isn't very effective, and safe defaults are so important.

<comment><USER4> Interesting that a search for Kubernetes on Shodan returns even more results than Webmin.

[https://www.shodan.io/search?query=kubernetes](https://www.shodan.io/search?query=kubernetes)

</comment></comment></comment><comment><USER5> Webmin has had many remote vulnerabilities for many years, yet people still use it/leave it open to the internet.

[https://www.cvedetails.com/vulnerability- list/vendor_id-358/...](https://www.cvedetails.com/vulnerability- list/vendor_id-358/Webmin.html)

</comment><comment><USER6> > _"It appears that a build /test system was compromised some time last year > and the exploited added to code in the directory from which packages are > built (and file timestamps modified to make this change not show up in a git > diff)," Cameron said in an email._

How, exactly, does that happen?

Does git look at timestamps first and, assuming they aren't different, not hash the file contents to compare the SHA1? This [0] git FAQ makes me think the answer is "no".

Another FAQ:

> _git diff and other Git operations is optimized so it does not even look at > files whose status (size, modification time etc) on disk and in Git 's index > are different. [...] If the file has been touched somehow, git diff has to > look at the content of and compare it which is a much slower operation even > when there is in fact no change._

[0]: [https://git.wiki.kernel.org/index.php/Git_FAQ#Why_isn.27t_Gi...](https://git.wiki.kernel.org/index.php/Git_FAQ#Why_isn.27t_Git_preserving_modification_time_on_files.3F)

<comment><USER7> I suspect that in addition to modifying the timestamp, the attacker also had to ensure the filesizes were the same by possibly removing whitespaces or refactoring other code.

<comment><USER8> Is there a 'git verify' or something that will report such tampering?

</comment></comment></comment><comment><USER9> Make sure to put any of your own personal web services behind some dumb authentication system to avoid most of these things biting you before you hear about them.

I use nginx + basic http auth, since I'm using it for https anyway.

</comment><comment><USER6> Here's the original post from the author of Webmin: [http://www.webmin.com/exploit.html](http://www.webmin.com/exploit.html)

</comment><comment><USER7> I hope they are able to find the source control logs and prosecute whoever embedded that code maliciously.

<comment><USER6> As mentioned (in large print!) in the article:

> _"How the exploit happened is impossible to determine at this point, as the > machine in question has been decommissioned. "_

<comment><USER7> I understand that, but they also seem to know a lot about what happened with respect to when things were checked in and with a little forensics perhaps they can figure out who it was. A deleted hard drive hasn't stopped people before and they shouldn't just give up that easily.

<comment><USER8> I feel like this is probably an inside job...

</comment></comment></comment></comment><comment> git-man-2000 "and file timestamps modified to make this change not show up in a git diff"

...ok</comment>


Spotify Is Bringing Music in to the Age of Context - <AUTHOR> http://arc.applause.com/2015/05/22/spotify-is-bringing-music-in-to-the-age-of-context/

<comment><AUTHOR> Think of what Google Now is trying to do ... and apply it to music.</comment>


I'm a serial over committer - <AUTHOR> http://swanson.github.com/blog/2011/11/02/engineering-over-under.html

<comment><USER2> I had this problem as well. A lot of people do. In a way, it's not a bad thing, if you're oversubscribed it makes prioritizing things a lot easier than if you feel like you have time to do everything but aren't sure what's the most important.

I am not completely cured of the habit, but what helped me with this -- and more importantly, what helped me actually begin finishing things -- is simply being very careful to only talk about what I've done, not what I'm working on or what I'm planning.

There's this thing called "substitute for completion" where if you talk about some project, even one with hundreds of hours of work remaining, your brain gets the same reward as actually completing it. A smaller dose, perhaps, but essentially the same thing. So your brain figures out that it can just keep coming up with new ideas and telling people about them and it will get an echo of the same feeling of accomplishment as actually doing it, without the hard work.

So what seems to work for me is only talking about my projects in the past tense. When I want to say "I started a new game last week and it's going to be the most awesome augmented reality zombie squirter ever", instead I say, "I wrote a new game event system last week and it turned out pretty good," because that's as far as I got. It's also motivating because I can't wait to tell people about all the cool stuff I have planned, but I have to wait until I actually do it.

I put out a second beta of my current project on TestFlight yesterday. It was a good feeling. It's been a ton of hard work so far. But it's not in the app store yet, so I'm not going to post about it until it is.

</comment><comment><USER3> I thought this was going to be about someone meticulously doing git commits after every tiny little change.

<comment><USER4> I'd like to read a post about the optimal granularity of git commits in different situations. I don't think I'm experienced enough particularly when it comes to intense collaboration to write it myself

<comment><USER5> My granularity is: Different things go on different commits. For example, you can include 30 files and hundreds of lines in one changeset if they are all related to the new feature X, but do not in the same changeset correct the indentation of a code block.

The commit message is like a title. All diff lines must be related to it or they should be in another changeset.

</comment></comment></comment><comment><USER6> I have the same problem: 'yes' is so much easier to say than 'no,' but the quantity of my projects is affecting the quality, and I don't like it.

Derek Sivers has a suggested approach for over-committers: "Hell yeah, or no." It's helped me cut down on my projects (and leaves me with more awesome things to work on, on average). Give it a read: <http://sivers.org/hellyeah>

<comment><AUTHOR> Wow, thanks for that link - that's a really good post.

</comment></comment><comment><USER7> "I want to be that go-to person, that expert, that guy who Gets Shit Done."

I have a few bad experiences with "the guy who gets things done".

There's an old saying that the last 10% of the work takes 90% of the time.

If you stop after the first 90% (or why not at 80%?) and jump to the next exciting project, you will be percieved as very productive. And because you don't put in the time to properly document things, you'll be the only one who knows it all and you'll be percieved to be a guru who knows everything.

Sure, it might not work perfectly, but it's only minor flaws that someone else can fix. Right? You're too busy being productive in your new project, leaving a mess for people to maintain in there.

And it works. Your managers see you as the go-to guy. You will get things done. And the fact that people then spend ages of time to patch your work just proves how much more efficient and better than them you are.

Yeah, you probably guessed it: I spent the day yesterday cleaning up someone elses unmaintainable, undocumented mess. Someone who is now working on a new project.

<comment><USER8> Thanks for the well written summary of this problem! I'm in a similar position as you are. We have a "hero who gets things done" - he is really good at writing quick prototypes that somehow work, but his code is unmaintainable and not even correct at the corner cases. I am not quite sure what we - the rest of the team - should do about. We managed to get him back into a project he started from his new project to help us clean it up, and we hope that this is a step in the right direction...

</comment></comment><comment><USER9> _Nothing undesirable happens immediately as a result - except that maybe your manager is a little bummed out. But maybe the next time one of these projects comes up, they'll ask Bob first. Maybe that speculative project turns into a full fledged project and you missed your chance to work on it._

And when the over-committer Bob ducks out of the project due to time constraints, the manager will come back to you, knowing you have a good track record of completing tasks.

</comment><comment><USER10> You'll find that there's never a shortage of cool work to do. What if you didn't wait for your boss to come to you, committed to (mostly only) your own stuff, knocked it out of the ballpark, and then only committed to boss-driven stuff that was at least as cool as what you'd otherwise be doing by yourself?

That's actually a really good way to 1) be known for hustle 2) be known as a finisher 3) work on mostly cool stuff.

There is no shortage of awesome possible work. Ever.

</comment><comment><USER11> IMO the most valuable is knowing when to walk away from a side project. Start a side project or hack on an idea you enjoy but when you start becoming stressed by it or realize it's not panning out as you expected, take a breath and kill the project. Harder to do with work projects but still possible. Scope the MVP to somthing that can be "done" and then allow management to iterate and see if this is the direction they want to go in.

</comment><comment><USER12> I can't agree more. I used to work for a company that develops smartphones that still holds top 3 market share in US. The day-to-day work is eating up all my time. When I'm developing my own project, I never seem to accomplish anything. I planned out some huge tasks for myself each night and I was so determined to finish them all, but it all ends up with losing the focus.

After all, I developed a small app for myself, I hope it would help you while you're doing your side project ( I try to not sound like I'm doing advertising for my project... since it's free of charge, feel free to use it and give me some feedback if you like ).

www.vodolist.com is what I come up while I was still employed at my old employer. What I could do with this app is that, I decided to do only "3 tasks" for my side project. ( and only 1 task for some other smaller project. you can customize it ). With only a few tasks involved each day, I can force myself only work on the important and only crucial components of my side project.

This post gets a little long with the help of scotch so I guess I'll just stop here for now.

<comment><USER13> I like the visualization of goals feature, it seems like a useful self- analysis and reward system. I might give it a go. Thank you.

</comment></comment><comment><USER14> Actually for your own stuff, not work, absolutely over commit. Eventually you will improve your performance to the point where you start finishing things, then you'll be finishing lots of things, and you might even end up with the kind of productivity that most teams wish for... also you will find where your limits lie for work through experience, instead of having to guess (which programmers famously get wrong) making it easier to not under commit yourself to tasks at work.

People say finishing is everything, and they are right, but like most skills finishing is not binary "yes" or "no", once you can finish things you can progress to being able to finish them better, faster and with less code. Ironically, owing to the nature of learning and the human brain in general you will have a hard time improving your finishing skills unless you regularly wind up in the situation where it is very difficult, or impossible to finish.

</comment><comment><USER15> At first when I saw this headline and that the source was github I thought it meant making too many commits in git. I couldn't figure out why that would be such a bad thing.

<comment><USER16> All I could think of was making it difficult to find exactly what commit fixed/introduced what bugs.

<comment><USER17> Luckily, there are things like git bisect to help you. On the flip side, finding the commit that caused the bug is much more valuable with smaller commit, particularly if you limit each commit to one logical change in the code.

</comment></comment></comment><comment><USER18> Well said. I completely empathized with your sentiment. So much so that I had to write more in response them what is probably appropriate in a comment section.

I commit to small one-off projects for friends, longer-term work with acquaintances, and whip up my own projects all the time. Sometimes the projects are freelance, and sometimes they are simply "free." All this serves to satiate the needling feeling in the back of my brain that I might just be missing out on something.

Here's the rest of my thoughts: <http://blog.glenelkins.com/the-over- committers-dilemma/>

</comment><comment><USER19> Fellow "serial over committer" here. I find it preferable to accept all new opportunities, but make sure stakeholders/I understand my availability. After prioritizing, nobody's surprised when some projects complete and others don't gain momentum. If you're letting others down, they probably overestimated your time/resources.

</comment><comment><USER20> There is a cost in overcommitting as there is the opportunity cost. But I believe there is a way to overcommit with the "under commit, over deliver" line of thought. That will allow you to still look at the new opportunities and present an option ("sure - let's talk first"..."could get done by xx".."too late? well next time perhaps").

One thing I've found - while handling many side-projects is to know each one has a priority based on how much I'm invested in one of them and the benefits that one will bring. If you have the priorities set upfront, it'll be easier to make decisions in case something gotta give. But if you "under commit" to a lot of different commitments, you'd still have some space :)

<comment><AUTHOR> I like the idea of prioritizing, but I find that even small projects that I abandon have a disproportionately large negative effect on my emotions/confidence/drive. It reminds me of what someone once told me about the stock market - getting $100 feels good, but losing $100 feels so much worse.

<comment><USER20> have you tried "selling the idea" to someone else? Perhaps someone that wants to learn to code, or work with design, or write - depending on the type of project, even small ones, its good to energize someone to try it than to drop it.

A shared success is better than no success.

<comment><AUTHOR> That is an awesome idea. And if no one wants to "buy" then probably no one cared about it in the first place so I shouldn't feel bad about letting it die. I'll have to try it out - I've got a good project in mind that this approach might work for.

</comment></comment></comment></comment><comment><USER21> In his book "Predictably irrational", Dan Arielly, talks about this exact behavior and explains it from a behavioral economics vantage point. In essence he is saying that the missed opportunity cost of not taking on "all projects" is far less than the risk you are taking by working on so many different things at once. In one of the chapters he tells the tale of a chinese general who burned his army's ships thus leaving them no choice but to win all battles ahead since they now had no other option.

On another note, you are not alone. It is an anxiety that, IMO, emanates from you not being able to read the pattern correctly. And that only comes with experience and exposure. Once you get to a point where you can "see" the general direction of things you will be able to accurately filter the probably-doomed-to-fail from the probably-a-bang-in-the-making projects.

Lastly, think of this; Who do you prefer to be?: \- being the guy that doesnt know how to say no and never finishes anything fully (like a drift wood that never reaches a shore)

\- being the guy that is selective but dedicated to the projects he chooses to work on. (like a power boat)

Anxiety is not something you can beat in 2 days but being aware of it is a major step. Work on it!

</comment><comment><USER22> Starting things is easy. Finishing is hard. Most people start various side projects. Very, very few have the resolve to finish them.

<comment><USER23> It's not just about resolve. Plenty of side projects turn out to be not worth finishing.

<comment><USER24> True. It's important to know when to stop something. Sometimes the project just isn't worth your time anymore

</comment></comment></comment><comment><USER25> I've been on HN too long. I read the title and assumed the article was about someone's revision control habits.

</comment><comment><USER26> FYI, your website sucks to read on an iPhone. The auto moving bits don't play nice with zooming

<comment><AUTHOR> Ah - that sucks, sorry about that. I pushed a small change, hopefully that makes it slightly better.

</comment></comment><comment><USER27> I think the key to recovering from over-commitment is to increase your rates. If you are over-committed, you are giving away your time for too little money.

<comment><USER28> The article is about someone who works a steady non-contract job who signs up for personal side projects and research stuff at work, I'm not sure how you think "increasing your rates" applies in the situation.

(FWIW, if you're a contractor who has more work than they can complete, I absolutely agree with your analysis)

</comment></comment><comment><USER29> This is me right now exactly. I am swamped because i have over committed to too many thing. It is stressing me out and I don't know how to escape.

<comment><AUTHOR> Are there any commitments that you can put on pause? Maybe you can't just drop the project, but if you aren't going to have time to work on it for a month, then officially delay it for a month so it's at least off your mind.

</comment></comment><comment><USER30> the most important thing is finishing. optimize for that. anyone can start, few can finish.

</comment><comment><USER31> It sounds like the problem is a boss who knowingly asks you to work on projects on your own time. The rest of the example story sounds like a poorly run, passive aggressive workplace.</comment>


Apple Planning MacBook Pro with 32GB of 'desktop-class' RAM: Report - <AUTHOR> http://www.zdnet.com/article/apple-planning-macbook-pro-with-32gb-of-desktop-class-ram-report/ <comment><USER2> And I'm sitting here with my brand new 15" MBP, still within the return period, not overly impressed with this machine relative to the price and relative to my 2012 machine it replaced.. Is he saying it "will be significantly redesigned in 2017" or "has been significantly redesigned" in 2016? Should I send it back and work on my oldie for another 6 months, letting Apple and other users sort through the variety of issues with the 2016 model? (dongle/port/hub situation, abysmal battery life situation, fledgling and relatively unsupported touchbar situation, touchpad palm rejection / unintentional touchpad situation to name a few).

<comment><USER3> 2015 was the absolute pinnacle for Apple devices. The 6S is amazing. Semi water-resistant, headphone jack, fast NVME storage, fast processor, 3D touch, good movement coprocessor..

Likewise the 13" (not sure about the 15") Pro is an absolutely joy. 10-14h battery life, good screen, good keyboard, normal size trackpad, no touchbar, magsafe..

<comment><USER2> I genuinely like the touchbar, and I can see it being something really useful, but its like any early adopter tech, serves little use outside of Apple's stock apps. The huge force touch trackpad is annoying, I have to move my whole arm to avoid touching my pinky to it when switching between typing and mousing. On the flip side, The new SSD is blazing fast. I can fly on the shallow keyboard. For me, it boils down to this: Is Apple going to solve my top 5 issues via software updates in the upcoming months (which I think they can), or are they going to reverse course in 2017 and make the machine they should have released at last year's reveal. Rumor of "significant redesign" is highly concerning.

I too loved the 6S, but the 7 is really really fast. I really griped about the headphone jack (still do), but I've heard AirPods are excellent (at least according to Marco and crew on ATP) and have a pair on backorder.

<comment><USER3> So far Apple has never produced any audio listening equipment that I (or any other discerning listener) would rate above 'mediocre' in the sound quality department, which is arguably the most important part.

</comment></comment></comment></comment><comment><USER4> At this point, it is probably worth it for Apple to skip Kaby Lake and go to Coffee Lake/Cannonlake if it supports LPDDR4.

</comment><comment><USER5> Why not 64GB? Why not 128GB of server class ram and 16TB SSD drives? Why not let us configure whatever insane arrangement we want at this point and make it whatever ungodly price Apple wants? You know we would pay for it...

<comment><USER6> For the same reason Apple always restricts choice. "There's 128 gigs of ram in this machine but the battery life is pretty bad." People have no idea what they actually want.

<comment><USER7> Top poster noted exactly what many of us want: modularity. Being able to put in your own drive and RAM to whatever capacity is technically feasible is a good start. An innovative battery design might be one where the thickness of the laptop increased when a larger capacity battery (attached to the bottom) is chosen. The forthcoming OWC machined aluminum battery/port case offers relevant insight here, and such a solution devised instead by Apple would be clearly superior.

Those who have been around long enough know no huge company, Apple included, is innocent of releasing sub-optimal products from time to time. I have personally bought and returned two 15" 2016 MBP's (one had an actual keyboard defect whereby one of the keys became temporarily stuck in the down position) and do plan on buying Apple products in the future on the expectation that any current shortcomings will be addressed in reasonable time.

Apple is a solid company and they are not going anywhere. The question is, where will the users head? As an established geezer, I'll probably be using what we know of as 'laptops' for the next 5 years, at least.

<comment><USER8> If modularity is the main thing your care about, Apple hasn't really catered to that for ages. Changing the SSD and RAM is useful, but most people wouldn't use that. I know I haven't in my last 2 models.

> no huge company, Apple included, is innocent of releasing sub-optimal > products

This is usually solved by having competition, but doesn't work if you care about the OS. Same for phones. It's a new-ish problem with no solution so far.

<comment><USER7> Sure, my response was a bit tongue-in-cheek. However, Apple could conceivably offer a model with a thick and beefy battery. Burly programmers with strong backs, for instance, would find this configuration to be appealing.</comment></comment></comment></comment></comment>


Swift – I think it's a bust - <AUTHOR> http://www.manton.org/2015/07/i-think-its-a-bust.html

<comment><USER2> truth</comment>


Google offers Yahoo help to deflect Microsoft's bid - <AUTHOR> http://www.iht.com/articles/2008/02/04/business/google.php

<comment><USER2> The saddest thing about this hostile takeover is that Microsoft doesn't seem to care that Yahoo employees generally don't like it.

With capitalism, it's all about doing what's best for the company. It's not about the individual at all.

Don't get me wrong: capitalism is great -- provided that you are the CEO.

<comment><USER3> Yahoo employees collectively forfeited that right when they "cashed out" of their holdings, and sold their stakes to outsiders in sufficient quantities to let those outsiders control their destiny.

As a normal non-employee shareholder of Yahoo, I am pissed off at the value destruction Yahoo has done, so it is well within my rights to demand that they accept this too-good-to-pass-up offer.

They cannot have their cake and eat it too - they wanted the liquidity and the exit, and now they cannot whine.

(Yes, most current employees never participated in the bonanza, but they did join a company where former employees had the bonanza and then jumped ship - who asked them to join such a diluted company, if they wanted to be in control of their own destiny?)

Same applies to start-ups here: if you sell yourself, don't later claim that the new owner did this or that. If you want to control your destiny, stay private or at least majority private. Of course that contradicts the quest for exit that motivates so many here, ...</comment></comment>


Ask HN: What timezone should I use? - <AUTHOR>

The application I am building projects the time on which data is submitted and I would prefer the time to be stored in a unified timezone, calculated for the user and sent based on their timezone. I have all of this worked out, but I would like to pick the best timezone to store the data in. I was thinking Greenwich, but is there a better option? I am in EST, right now. <comment><USER2> You want to use UTC and convert it to your local timezone using functionality provided in most of todays languages.

For example, in PHP, you could use gmdate('Y-m-d H:i:s') to get the current time/date in UTC.

In Python, you could use datetime.datetime.utcnow().</comment>


Screenshots Forever and Ever Until You Can't Stand it - <AUTHOR> http://ascii.textfiles.com/archives/4365 <comment><USER2> Jason Scott in general is one of my internet heroes. A lot of what he covers in his work is before my time, so it doesn't carry any nostalgia for me, but appeals on a different level altogether.

Books I've read, and classes I took in school, covered the history of the net and computers, but only the things that they feel is 'important', you get the overview of the evolution of programming languages, history of the computer, and timeline of the internet and world wide web. In each case, it feels like it's all about linking one big advancement to the next big advancement.

What you get from Jason's documentaries and presentations and sites however, is this really raw and honest look at what real people were actually doing at the time. It's hard to explain why that feels so important to me, but it does.

<comment><USER3> If you're interested in the history of the Web and its inception, I highly recommend you this (non-technical) reading [1] by Tim Berners Lee. Really inspiring.

[1] [http://www.amazon.com/Weaving-Web-Original-Ultimate- Destiny/...](http://www.amazon.com/Weaving-Web-Original-Ultimate- Destiny/dp/006251587X)

</comment></comment><comment><USER4> One of my first websites was an emulation site in 1999/2000\. SNES was by far the most popular category on the site so I had the bright idea to play 2-3 minutes of every single game in order to take a screenshot of the game-play. Three months later I was finally done. Then I lost everything in hard drive crash before I could push the new version of my site live. Dammit.

</comment><comment><USER5> Man, I've been looking for the name of a Sega Genesis game for a long time and couldn't remember it. I just saw it on your site. "Atomic Rob-Kid" was one of the best games I've ever played. Super hard and super frustrating, but it has a great feel!

[https://www.flickr.com/photos/textfiles/14811059366/in/set-7...](https://www.flickr.com/photos/textfiles/14811059366/in/set-72157646180733361)

[http://en.wikipedia.org/wiki/Atomic_Robo- Kid](http://en.wikipedia.org/wiki/Atomic_Robo-Kid)

</comment><comment><USER6> Ah ZX Spectrum that takes me back. I learned assembler on it, BASIC, had a Pascal and C compiler even (the last two had to load from tape). Made one mistake and had to reload the whole thing again and wait 5 minutes or so.

It was amazing how there was this closeness to the machine, you boot right into the programming environment and had to type a command to load a game or do anything.

Some of the games I remember were exceptional, Elite was one of them. Just thinking about the ability to pack everything in 48K of memory.

<comment><USER7> I got into programming after receiving a 48k spectrum for Chrismas as a child, which arrived with a broken tape deck.

No "Hungry Horace" for me, instead it was the (very readable) manual to work through. Happily z80 machine code prepared me well for Intel assembly.

Even now I play chaos every month or two: [http://torinak.com/qaop#!chaos](http://torinak.com/qaop#!chaos) along with a couple of other games.

</comment></comment><comment><USER8> Wow, this is pretty spectacular.

I wonder if the copyright office collected information about the platform a game would run on when it was copyrighted? Could probably figure some of it out by the publisher. I might have to go look for that data to mine.

</comment><comment><USER9> I've been thinking a lot the past few weeks about the preservation of art and goods in general. I think it comes from two main sources:

1\. Maciej Ceglowski (`idlewords) has been talking a lot recently about link rot. Recently, he found that 25% of items pinned a mere five years ago were dead links and 17% from only three years ago were dead [^1]. That's an incredibly high rate -- and, selfishly, one I'm noticing as my bookmark folders for recipes (RIP BroEats.com) and designs and other things is filled with more and more duds.

2\. I've been reading _Do Not Sell At Any Price_ [^2], a book about the subculture of 78rpms. These are records that are so rare and so -- for lack of a better term -- unwanted by the vast majority of the music-listening populace that the act of collecting them is less about hoarding and more about preservation. To quote one of the characters in the book (roughly from memory):

 _" It's a weird feeling, holding this thing in your hand and knowing that you could break the song," he said. "I snap this record in half and this song is lost forever. It's a lot of responsibility, and sometimes I think that's why I take it so seriously."_

I can honestly say that, prior to reading this article, I had no idea what a ZX Spectrum was. Now, after some digging, I do -- and I still have no desire to play one, obtain one, or hold onto it in any meaningful way. (And seeing as I'm usually on the weirdly attached end of the spectrum with these kinds of things, I doubt I'm the only one.) But I'm struck by how important it is to hold onto these things, even if its in a cardboard box in a forgotten closet somewhere or a link on the Internet Archive that gets clicked once every couple decades.

I'm not positing that there will ever be a point in time that someone has the hankering to play ZX Spectrum Xtreme Chess, but I think there's inherent value in preserving this ecosystem -- something of a testament to the people who made it, the people who played it, the novelty that at one point in time there were five million living rooms with this machine in it.

The Web turned 25 this year, and it's already coming down with acute cases of memory loss. I'm hoping that by the time it hits fifty, the problem won't have gotten worse -- it will have gotten much, much better, not just with URLs but with remembering the time when people played _3D StarFighter_ by the Oliver Twins. [^4]

(This is a very roundabout way of saying the following: Jason, you are completely awesome for doing this, and thanks for sharing it with us.)

[^1] [https://twitter.com/Pinboard/status/501406303747457024](https://twitter.com/Pinboard/status/501406303747457024)

[^2] [http://www.amazon.com/Not-Sell-Any-Price-Obsessive- ebook/dp/...](http://www.amazon.com/Not-Sell-Any-Price-Obsessive- ebook/dp/B00GEEB9XI/ref=sr_1_1?ie=UTF8&qid=undefined&sr=8-1&keywords=Do+Not+Sell+At+Any+Price)

[^3] The nice things about IA links is you can pretty reasonably assume that they won't suffer from link rot, right?

[^4] [https://www.flickr.com/photos/textfiles/14771850314/in/set-7...](https://www.flickr.com/photos/textfiles/14771850314/in/set-72157645599736559)

<comment><USER10> > _The nice things about IA links is you can pretty reasonably assume that > they won 't suffer from link rot, right?_

The catch there being, the Internet Archive retroactively respects robots.txt that forbid crawling, so if someone gets control of a domain they can block the archived pages. This is a big problem with lapsed domains that get swept under the umbrella of a holding company that has lots of domains pointing to the same content, with a blanket robots.txt.

<comment><USER11> A few years ago I talked to an IA engineer, who said they were planning on dealing with this by not crawling sites whose nameservers were known to point to a domain parking company. The idea was that if they never retrieved the robots.txt, they wouldn't retroactively apply it. I don't know if that filtering out of parking nameservers ever happened, and it wouldn't help for parked domains whose robots.txt they'd already retrieved, but but it would help with domains that lapse in the future.

<comment><USER12> But why retroactively remove the data? The original owner was fine with holding it, why should the snapshot be deleted because a completely different person wants his completely different website to not be crawled?

<comment><USER13> It's hard for a bot to understand concepts of 'owner' and 'completely different person' based on the data they have available. Companies can use this robots.txt feature to un-index old marketing content after a re-branding, for example. Or after an acquisition.

<comment><USER12> Sure, but, surely, the bot has timestamps saying "robots.txt allowed me to keep these documents last time I spidered them". Why do they have to be retroactively removed? robots.txt only disallows spidering, it doesn't mandate that you should delete all the data you've already spidered.

<comment><USER14> Because most of the problems come from people who want to hide old material that they didn't realize was being indexed. The automatic behavior is simple and easy to implement, and doesn't require any human intervention.</comment></comment></comment></comment></comment></comment></comment>


Containers, Security, and Echo Chambers - <AUTHOR> https://blog.jessfraz.com/post/containers-security-and-echo-chambers/ <comment><USER2> Dropping privileges from docker containers, and container isolation are both very interesting and important topics - ones I hear discussed constantly. This author would serve himself much better by dropping the self congratulations - no reason at all for comments like "tech bros crying" and "container isolation is a hard problem - unless you're me!". Sorry, you're not the only nerd smart enough to populate the capdrop table. Also, the default app armor profile for Docker leaves -a lot- to be desired. I hear the term "Echo Chamber" most often from people who deem themselves smarter than the rest, and always in an accusational way... fairly ironic if you ask me.

<comment><USER3> Walk a mile in her shoes before you cast stones.

[https://www.theregister.co.uk/2016/04/26/harassment_of_femal...](https://www.theregister.co.uk/2016/04/26/harassment_of_female_docker_staff/)

</comment></comment><comment><USER4> linux namespaces can be aggressively locked down. for example sandstorm by kenton varda has not been vulnerable to any of the recent linux kernel vulnerabilities except for badiret and a TLB bug ([https://github.com/sandstorm- io/sandstorm/blob/master/docs/u...](https://github.com/sandstorm- io/sandstorm/blob/master/docs/using/security-non-events.md)). it certainly wasn't vulnerable to dirty cow which is quite difficult to protect against.

however, i think docker may have been vulnerable against dirty cow. [[https://github.com/gebl/dirtycow-docker- vdso](https://github.com/gebl/dirtycow-docker-vdso)] i'm not sure if this was before or after jessie's work on securing docker.

also, i don't think gvisor would have been vulnerable to dirty cow. it looks like it 'gates' all the mmap/munmap/madvise syscalls through a sentry process which does some kind of emulation of virtual memory through some magic. [[https://github.com/google/gvisor/blob/797cda301677abc8523d5a...](https://github.com/google/gvisor/blob/797cda301677abc8523d5a2a8d731312cc43bce4/pkg/sentry/mm/README.md)]. like ultimately, i think mmap() system calls need to be executed in the monitored process but i think they are only done by the sentry using ptrace and if the sentry dies then i assume it is the root of the pid namespace so the process it is monitoring is killed as well.

<comment><USER5> It's been a while, but IIRC Docker wasn't affected by Dirty COW because they mount /proc read-only. (Sandstorm was unaffected because it doesn't mount /proc at all.)

FWIW I haven't kept the security non-events up to date over the past year or two. There was at least one Linux kernel bug I can remember last year (CVE-2017-5123) that allowed a breakout from _all_ container engines, because waitid() is too important a syscall to block. However, the vulnerability was newly-introduced and hadn't made its way into too many distros before it was fixed.

</comment></comment><comment><USER6> After reading this article I am more convinced about gvisor or something similar.

The security of your systems is best left to experts.

<comment><USER7> Speaking as someone who has been called a security "expert" by many for years: I actually have very little idea what I am doing and neither do most of the people I know that discover vulnerabilities. I find issues by just reading code that clearly got minimal if any review or catching common design flaws that would of never happened if someone took the time to think about their threat profile and attack surface before implementation.

The attitude of most engineers I encounter of "security is someone else's problem" is the problem.

If you are writing systems other people rely on to be secure, then security is your problem. You will do a much better job avoiding creating new security holes if you take the time to learn some basics yourself instead of expecting "experts" to do it for you.

Namespacing features and system call filtering tools like gvisor, seccomp, selinux, apparmor etc should be your -last- line of defense and they are only going to be useful tools for you if you invest the time to understand them and tune them to your specific needs.

<comment><USER8> there is an interesting thin line dividing a "hardening feature" (e.g. a system call filtering system) and something perceived as a genuine execution environment category (e.g. a virtual machine).

Most people like to be able to reason about general security implications in broad strokes and concepts as "virtual machine" have the ability to convey a given notion of isolation guarantees that make them stand out as a primitive you can build upon, rather than an "additional layer".

In order to achieve this standing, the "virtual machine" concept is rooted on the general idea that most of the traditional OS abstraction is moved inside the sandbox, leaving only a very small, easy to understand (and hence easy to secure) channel to the underlying shared resource. This is traditionally achieved by running a fully kernel in the sandbox (guest OS) and having it interact with the host through a hypervisor. The optional assistance provided by hardware virtualisation features is often necessary to achieve good performance, mostly because of the necessity to move a traditional OS in the guest, which was designed to work as a primary OS in the first place.

The niche gVisor is trying to fill is the ability to approximate that abstraction without requiring the traditional hypervisor mode, which has some practical drawbacks that make it hard to deploy in some scenario (think of hardware support for nested virtualization which would be required to run your own virtualization solutions inside of public cloud compute instances).

gVisor achieves this by fundamentally implementing a user-space kernel, leveraging some of the aforementioned system call filtering tools as one of the possible ways of implementing the sandbox mechanism and the guest/host communication channel. So, while using the very same features that are commonly thought of providing additional hardening features, gVisor fills a different niche, more akin to what people usually call virtualization.

It can be argued that the amount of host features exercised by gVisor is too high to be able to call it a virtualization feature proper (especially in its seccomp mode), but it shares with classic virtualization one very powerful property: when end-user workloads require a given OS feature (e.g. some new cgroups feature), only the guest "OS" needs to implement it.

On the other hand, traditional seccomp/selinux/apparmor style hardening requires the host OS to implement all the features needed by the guest workload. Furthermore, it also often requires that the rules (e.g. syscall filters) to be updated to let the sandboxed workload use said features, and the amended rule can often be applied incorrectly. Moreover, the filtering rules need to be expressive enough in order to implement some scenarios in the first place (e.g. seccomp-bpf cannot currently follow pointers).</comment></comment></comment>


Introducing the World's Most Advanced Chatbot Lawyer - <AUTHOR> https://www.lawbot.info/ <comment> xkcd-sucks LawBot: Hi, I'm LawBot, a robot lawyer designed to help you through this situation. Please tell me your name or say anonymous if you would rather not.

You: i was arrested for public urination

LawBot: Nice to meet you, i was arrested for public urination. I can help you understand if you have been the victim of a sex offence, a property offence, physical or psychological injury, or harassment. If you don't understand what I am saying, just say so and I will explain. If you don't understand a word, just ask me about it and I will give you a definition. Would you like to get started?

You: i was arrested for public urination

LawBot: Please describe briefly in one sentence what happened to you. Try to use words that people usually use when speaking about this issue to help me understand you.

You: i was arrested

LawBot: Sorry, could you try to explain that in a different way? Maybe be more specific about the incident?

<comment><USER2> Can you try being arrested for a different crime?

</comment></comment><comment><USER3> I barely understand the chat bots hype around these days. They all remind me of Clippy [1] and are especially ineffective when it comes to complicated interaction.

1 : [https://en.wikipedia.org/wiki/Office_Assistant](https://en.wikipedia.org/wiki/Office_Assistant)

<comment><USER4> It's not even a lawyer; it sounds more like a police prosecutor.

Saying that it's 'the World's Most Advanced Chatbot Lawyer' sounds like an outright lie in every way. It only helps plaintiffs, not defendants - It's a prosecutor.

</comment></comment><comment><USER5> > LawBot Too much recursion in AIML

I got this several times, once when asking about the definition of a term ("psychological injury") and again when trying to get information about harassment crimes. Seems more like an alpha so far...

The chatbot should probably make clear up-front that all information provided (1) does not constitute legal advice, and (2) is all based on the laws of a certain jurisdiction (presumably somewhere in the UK). Otherwise people might think that the information provided is relevant to them when it isn't actually. I don't know if it provides disclaimers later in the process because I kept getting errors before any advice was given.

Lastly, this looks to be run completely by law and other students. They should probably have some actual lawyers involved to make sure that (1) their analyses are correct, and (2) they aren't running afoul of laws regarding providing legal advice. It would probably also make people feel more comfortable using the tool.

<comment><USER6> Jesus crap, they're using AIML and claiming this is the world's most advanced anything?

AIML is an old framework for writing rule-based chatbots. It's a generalization of Eliza.

</comment></comment><comment><USER7> LawBot: Sorry, I don't understand. Say 'crime' to start over, 'glossary' for definitions, or 'instructions' if I'm being complicated.

You: crime

LawBot: A crime is anything that a person does that will lead to a criminal conviction.

The sass.

<comment><USER8> LawBot: Were you caused physical harm?

hmm, 2 comments in and I'm confused...

</comment></comment><comment><USER9> [https://popehat.com/2016/10/26/if-lawbot-wants-to-know- about...](https://popehat.com/2016/10/26/if-lawbot-wants-to-know-about-my- anus-im-sure-it-has-a-reason/)

</comment><comment><USER10> "The world's most advanced"? WTF Bullshit is that. It's just a fucking decision tree, and not a very good one on top of that!

<comment><USER11> Seriously, title is complete clickbait

<comment><USER12> Absolutely.

</comment></comment></comment><comment><USER13> Services like this are 100% useless because it is impossible for the user to verify that the software has (1) accurately interpreted the question and (2) accurately answered the question.

</comment><comment><USER14> When you try for some time, it eventually does what it should try to do since the start, given that NLP is not easy and _not_ needed in this case: it starts to ask you questions with a fixed set of possible replies in order to narrow the case to a set of pre-existing possibilities.

<comment><USER8> Agreed, the chatbot facade slows it down, it's a simple decision tree that could be handled with a few checkboxes and conditional display.

</comment></comment><comment><USER15> I tried "I got arrested for drunk driving" 3 or 4 times in a row and never got any reasonable response. If a lawbot can't help with "DUI" or a more common phrasing, it should at least recognize it.

</comment><comment><USER16> I'm surprised it's not illegal for them to claim this bot is a "lawyer". Usually it seems like people are very careful about that, and clearly the bot wouldn't pass any bar exam.

<comment><USER10> I think it is. Just wait for someone to sue their ass.

</comment></comment><comment> J-dawg I've seen several articles recently saying that chatbots are The Next Big Thing. I just don't get it. Every chatbot I've ever used reminds me of playing those text-based adventure games, where you need to rephrase your question several times to get the outcome you want.

I find it hard to imagine a situation where a chatbot would help me find the information I need faster than a nice structured menu layout or a good search engine.

Am I missing something?

</comment><comment><USER17> You

My car was stolen

LawBot

Sorry, could you try to explain that in a different way? Maybe be more specific about the incident?

\----

I may not be a native English speaker but come on, isn't that wording pretty clear?

</comment><comment><USER18> It seems better at generating unintentional dad jokes than giving legal advice:

[http://0bin.net/paste/rBkOCw5hi2sAdvPx#5e1Be08sJSV9sFCWTbS2D...](http://0bin.net/paste/rBkOCw5hi2sAdvPx#5e1Be08sJSV9sFCWTbS2DHQLcFEq5cpMuP+1uTt9vqR)

</comment><comment><USER19> It advised me to go a police station 8000 km away. That's the closest one it could find.

</comment><comment><USER20> Well, given that this is the World's Most Advanced, I would like to see some sample conversations with the less advanced ones.

</comment><comment><USER21> Oh, is this the Bob Loblaw Lawbot? Didn't read about it in Bob Loblaw's Lawblog.

</comment><comment><USER12> Me: She groped me. LawBot: Did she have a pen*s?

xD</comment>


CAPTCHA used only to fool bots - <AUTHOR> http://intosimple.blogspot.com/2011/03/interesting-captcha.html

<comment><USER2> I bet the failure rate for humans is higher than average too. People are used to typing the words in the box.</comment>


90% of WeWork Cleaners Jobless After Contract Termination - <AUTHOR> http://gothamist.com/2015/08/25/wework_janitors_union.php

<comment><USER2> Wow this makes me angry. I'm presently looking into co-working space and will not be including WeWork on my prospective list. $10Bn valuation and a lot of business and this is how they treat human beings. Pretty disgusting.

<comment><USER3> If you read the article closely, it's pretty clear that it's Commercial Building Maintenance Corp that are in the wrong here.

Why would WeWork be involved with the staff of the company they hired? If Commercial Building Maintenance Corp laid staff off having lost a contract, it isn't WeWork's responsibility to let their staff know. Would WeWork even know to tell them?

Update: If you read the comments section, there's a reply from a WeWork staff member: "WeWork's contract with Commercial Building Maintenance Corp expired, WeWork was no longer a customer of theirs, and instead of CBM giving their staff the bad news in professional manner, they let their newly-unemployed staff members waste time and subway fare to be informed of this via disabled keycard."

<comment><USER4> I agree that CBM laid off their workers in a nasty way, but that doesn't preclude WeWork from also being in the wrong.

The workers maintain that WeWork dumped CBM because CBM's employees joined a union. That might indicate that WeWork would rather not deal with employees who are in a position to collectively negotiate for better pay and benefits. Now that WeWork has hired replacement employees directly, we'll see whether these new employees try to unionize too.</comment></comment></comment>


The World's Most Expensive Drugs - <AUTHOR> http://www.forbes.com/2010/02/19/expensive-drugs-cost-business-healthcare-rare-diseases.html

<comment><USER2> This needs a follow-up: what makes monoclonal antibody drugs so expensive? Another offender of this type is infliximab.</comment>


Bufferbloat and other Internet challenges - <AUTHOR> http://ieeexplore.ieee.org/stamp/stamp.jsp?reload=true&tp=&arnumber=6886125 <comment><USER2> I guess no one reads Vint Cerf anymore. Sigh.</comment>


Software Amateurs versus Software Professionals -- A Classic 5yo article that still holds true - <AUTHOR> http://www.gamedev.net/reference/business/features/shareprof/ <comment><AUTHOR> Here is my most-favorite article. Please let me know if you think it still applies (I do.) By the way, the navigation kind of sucks, but it's actually 3 pages long.

</comment><comment><USER2> Oh my, is this where Steve Pavlina got started? Interesting.

<comment><AUTHOR> Yes; he has about 7 great development articles, if you can still find them.

(Not personal development, but development-development.)</comment></comment>