Hacker News .hnnew | past | comments | ask | show | jobs | submit | dkharrat's commentslogin

It would also be useful to provide a way to convert the other way around (from a date to epoch).

I actually built a similar tool a while ago: http://timeconv.io/ that's similar to yours :) The goal is to provide a set of useful time/date utilities.



Is there an advantage to overriding the man command over the approach of just directly exporting the env variables in bashrc? I currently do the latter and I don't override the man function. I suppose overriding the man function would allow for man-specific customizations, but perhaps there are other good reasons too?


You might not want to override termcap for less in other contexts. Or not in the same way.


Type erasure introduces limitations on what you can do at runtime that forces a developer to write code to workaround it. For example, in Java you can't write a generic method that instantiates an object based on the type of the generic. The workaround is typically to pass in the Class type as an additional parameter to the method, which in theory should not be necessary. A lot of JVM-based languages are required to introduce additional complexity in the language to simulate reified generics (e.g. Scala's Manifest/TypeTag classes).


> For example, in Java you can't write a generic method that instantiates an object based on the type of the generic. The workaround is typically to pass in the Class type as an additional parameter to the method, which in theory should not be necessary.

If a method needs to instantiate an object, the normal technique is to accept a factory function as a parameter. You can do the same thing with type-erased generics.

C# decided to create a shortcut for calling the constructor of a generic type parameter. But, for example, you can't call static methods of a generic type parameter (and a constructor is really just a slightly special static method).


> A lot of JVM-based languages are required to introduce additional complexity in the language to simulate reified generics (e.g. Scala's Manifest/TypeTag classes).

I'm not sure how this makes sense. These tags are just standard context bounds, which are extremely useful and quite awesome.

You make it sound as if these tags were some kind of special feature added to the language, or context bounds were solely invented to support these tags.


Passing in the class type for instantiating a new instance is not what you should do in your applications. You don't know at compile time if the class you pass in has a default constructor, so your program can fail at runtime. As others have stated, the right thing to do is pass in a factory object. C# solves this by adding even more cruft to the language in the form of a "new constraint" that tells the compiler to ensure that the type has a default constructor. https://msdn.microsoft.com/en-us/library/sd2w2ew5.aspx


Doesn't Airbnb fall in the same category? Renting out your property for a few days to complete strangers requires a lot of trust, and yet from what I can tell, Airbnb seems to have overcome this hurdle.

I do agree there was a trust issue with Homejoy (I've personally tried them once and had similar concerns). But, I don't believe the issue was that they were in an unviable business where trust can't be gained, but rather they didn't have the right mechanics in place that help develop the necessary trust between the consumer and the cleaners.


Most people who rent out their homes to AirBNB strip the home of small, valuable items who's theft would not be noticed. I've never been in an AirBNB that contained jewelry, bank statements, blank checks, or other personal items.

For large valuable items, they inventory them before the rental, and check the inventory when the rental ends. As such, a thief trying to steal from an AirBNB can only take large expensive items (like the TV), and will be immediately caught during the check-out check.

Cleaners can quietly lift the pearl necklace you only wear for the holidays and you might not notice for a few months, at which time you might have 6 homejoy cleaners as possible suspects. People don't want to theft-sanitize their homes every time a cleaner comes.


Not entirely sure, but according to its github page[1], you can have it use the OpenJDK classes for a "conventional JVM".

[1] https://github.com/ReadyTalk/avian#building-with-the-openjdk...


An example where kill -9 can screw things up is killing a database process (e.g. MySQL, mongo, etc). Killing it with -9 will most likely lead to data corruption/loss, as the process might be in the middle of flushing to disk for example.


Any database that can't recover from kill -9 is not worth trusting your data with.


> If I understand WebRTC correctly, once the link is established, all communication is peer to peer.

In general, it's peer-to-peer, but for clients that can't communicate peer-to-peer for whatever reason (usually due to certain NATs), a relay server is used as an intermediary. To the user it's transparent, so they can't easily tell if it's peer-to-peer or not.


It's based on the WebRTC standard, so in general, yes it's peer-to-peer. However, in cases where the peer-to-peer connection cannot be established (e.g. a user behind symmetric NAT), then a third-party relay server is used (called a TURN server) which acts as the intermediary between the peers (sort of like a proxy).


This is pretty cool.

On a similar note, anyone know of equivalent options for iOS? I see a few open source implementations, but none that are actively developed. There's SocketRocket, but that's just vanilla WebSockets.


There is a similar Socket.IO library for iOS hidden within the FAQ.

http://socket.io/docs/faq/


I disagree. Yes, MVC provides a pattern that allows views to be input to the user, but if it doesn't make sense for your app, it's perfectly fine to make the view "read-only" and still abide by the spirit of MVC.

If you're claiming that regular HTML views are compliant with MVC because they have HTML links, one can argue that some RSS readers convert the reference links from the RSS feed to actual HTML links that you can use to navigate to the individual RSS item. How is that different than a regular HTML view with links?


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

Search: