Chromecast update breaks AllCast - <AUTHOR> https://plus.google.com/app/basic/stream/z13be5ajwpmvux5a304ccxsypuevhtcwgao <comment><USER2> [https://developers.google.com/cast/release- notes](https://developers.google.com/cast/release-notes)

> Warning: The current Google Cast SDK is a preview SDK intended for > development and testing purposes only, not for production apps. Google may > change this SDK significantly prior to the official release of the Google > Cast SDK. We strongly recommend that you do not publicly distribute any > application using this preview SDK, as this preview SDK will no longer be > supported after the official SDK is released (which will cause applications > based only on the preview SDK to break).

<comment><USER3> In the future, when video playback _isn 't_ restored and Google makes a public admission that they _don 't_ intend on restoring it, would you mind if I remind you of how you were naive and foolish?

When Google's next hardware product comes out, can we stop thanking them and instead point out how they have a history of releasing products that give users no control over what runs on them?

Google has far more technical expertise than any ISP, so it stands to reason that they'll be using that to push down on users more than any other ISP has in the past. We may yet regret clamoring for Google Fiber to be everywhere.

<comment><USER4> Entitled much? What obligations does Google have here, exactly?

<comment><USER5> Huh? The GP comment never mentioned or implied the word "obligation".

<comment><USER4> The ultimatum is for Google to restore undocumented functionality or publicly state they don't support openness. And we're all fools to think Google will go to the ends of the earth to support everything imaginable! Replace Google with Apple in the GP to understand the entitlement and just how foolish we aren't.

<comment><USER5> Sorry, but I just don't see it. All I see is a complaint and a demand for a feature. IMO, that's not entitlement. Entitlement would use words like "owe" and "responsibility".

</comment></comment></comment></comment></comment></comment><comment><USER6> The developer of AllCast, Koushik Dutta, gave his side in this reddit comment: [http://www.reddit.com/r/Android/comments/1l2hez/google_block...](http://www.reddit.com/r/Android/comments/1l2hez/google_blocks_chromecast_app_that_let_you_stream/cbv8u0s)

<comment><USER7> His response is a little bit trite when you read his previous post where he more or less taunts Google about how he reverse engineered the protocol to avoid the whitelist. In some way it almost feels like a setup - perhaps this is all a strategy by Koush to flush Google out on this issue, and I suspect they've been forced to confront it now before they were really ready.

<comment><USER8> ;)

</comment></comment></comment><comment><USER9> Google has responded to a request for comment from The Verge.

We're excited to bring more content to Chromecast and would like to support all types of apps, including those for local content. It's still early days for the Google Cast SDK, which we just released in developer preview for early development and testing only. We expect that the SDK will continue to change before we launch out of developer preview, and want to provide a great experience for users and developers before making the SDK and additional apps more broadly available.

<comment><USER10> > We expect that the SDK will continue to change before we launch out of > developer preview, and want to provide a great experience for users and > developers before making the SDK and additional apps more broadly available.

Then why are they offering it in retail stores like best buy? Sucks that you buy something for feature X and few days later an update comes through getting rid of it. Does anyone know how hard is it to reverse this update?

<comment><USER11> > Sucks that you buy something for feature X and few days later an update > comes through getting rid of it.

You really shouldn't buy products because of an un-official feature hidden in a preview of a developer SDK.

<comment><USER12> would you have the same reaction if Microsoft/Apple _actively_ blocks a user functionality that the device and software is capable of... official or unofficial the developer demonstrated that a scenario can work..why go out of way to block it.. looks like this is a new trend for Google - maps on Windows Phone, youtube app on Windows Phone....

<comment><USER13> Would you have the same reaction if you were using undocumented APIs in Windows or iPhone private APIs and then they changed them?

There is an unofficial way and that is putting your device in developer mode.

<comment><USER14> _Would you have the same reaction if you were using undocumented APIs in Windows..._

Microsoft is bad at many things, but until recently, they were very good at backward compatibility. They knew people were using undocumented APIs, so they went out of their way to preserve bug-for-bug compatibility in a lot of cases.

On the other hand, they also went out of their way to use undocumented APIs and API changes to give Word an advantage over Word Perfect....

<comment><USER11> MS has only been good at backwards compatibility when it is in their best interest. Usually because a major partner was the one using an undocumented API with millions of users. In this case it was a person hacking some code together on a product less than a month old with probably only a few thousand people using the app that broke.

</comment></comment></comment></comment></comment></comment></comment><comment><USER15> I've been using my Chromecast to play local content since day one. Then again, I have a whitelisted application that I'm using and I'm not distributing it. There is nothing really stopping developers from developing such services... local content plays fine. Google just doesn't want you distributing them until the dust settles and they lock down their API. If it takes them more than a month or so to do so, or if they then prohibit such uses of the Chromecast, then maybe you have a story, but until then -- geez.

<comment><USER16> Any chance you'd be willing to put the code up on GitHub so other Chromecast users can just add it locally and whitelist it?

<comment><USER15> Sure... I'll throw up a gist... not the correct way to do it, crappy sender UI, based on early code examples from Google, but it works:

[https://gist.github.com/jonathansadowski/6345103](https://gist.github.com/jonathansadowski/6345103)

Feel free to use / copy / fork, whatever. Basically, you can send any URL to the receiver, and the receiver then loads that URL in its video element.... that URL can be local, remote, whatever... requires that you have a webserver to serve your local content.

</comment></comment></comment><comment><USER17> If I were somebody with a Chromebook that still had ChromeOS installed, I would be very very concerned right now.

If you don't control your device's software updates, then the device is not yours. It is as simple as that.

<comment><USER18> We've had a long time to prove the disaster that is users controlling updates. The majority of people are far and away better off having automatic updates. It's also one of the big selling points of the devices though so I don't think it should catch anyone by surprise. You're free to install another OS on your device though (which is a good sign the device _is_ yours).

<comment><USER17> We've had a long time to prove that using automatic updates to remove features is a recipe for disaster. In fact, I seem to remember a certain company using forced updates _specifically_ to remove users' ability to install other OSes on their devices...

Just because you can install another OS on your chromebook today doesn't mean you will be able to in the future. Get out now, or you are making a gamble.

<comment><USER18> > We've had a long time to prove that using automatic updates to remove > features is a recipe for disaster. In fact, I seem to remember a certain > company using forced updates specifically to remove users' ability to > install other OSes on their devices...

They didn't remove a feature... They removed an undocumented setting for an SDK that has warnings all over the place that the API is not final and to not release an app until it is.

<comment><USER17> From my response to somebody else in this discussion: _" Hiding behind terms of use on SDKs isn't something that mellows the sting of this to users who probably don't even know what "SDK" means."_

<comment><USER19> Then shame on the developer for releasing an app for mass consumption based on private and non finalized APIs, and then blaming Google when things break. I understand that ragging on corporations is fun, but c'mon. Perspective , please.

<comment><USER17> "Shame on the developer" does not make this any better for the consumers either.

<comment><USER19> The problem the consumers are having was generated completely and totally by the developer of the app, not Google. If you as a developer write an app using non finalized APIs, and release it, and the app breaks because that API changed, it is completely and utterly _your fault_.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER20> Just got my Chromecast that I ordered in July and am profoundly disappointed. For a device with such high potential, it really did not deliver on the promise.

Here's what I expected: 1) AirPlay alternative via Google Chrome/Chromecast. 2) Reasonable picture quality and fit. 3) Possibly an office alternative to Apple TV for presentations.

While yes, this thing can project your browser tab on to the TV, there is severe lag, washed-out colors, and most importantly I have not been able to play HTML5 videos in full-screen mode. Could be user error...

Amazon Prime Instant Videos do not play in full-screen mode either. But then again, I didn't really expect SilverLight to work with Google's products all that well.

Picture quality is terrible. I only tried it on a 720p TV, as tab mirroring reportedly only supports 720p. Colors are washed out and lighting is off. Not a big deal, but I also did not get 720p all the time, connection seemed to fade in and out. This is on a completely not busy N router and nothing else streaming.

What really got me though was spotty support in YouTube and Drive Presentations going off-screen. YouTube has a nice library of international films. I really like watching old Soviet movies from my childhood. They are free to watch and I was stunned when Chromecast reported that the videos I was trying to watch are not supported, even though there is a chromecast icon in the player itself.

Lastly, Google Presentations ended up being cut off when projected in fullscreen (yes here it's fully supported, but not on all videos... go figure.). This last bit basically killed my hypothesis that we could get these for ever conference room and project from both Macs and PCs. I was really hoping this would work...

<comment><USER20> Update:

Using YouTube with Nexus7 and Chromecast actually works a lot better than using a Mac. That said, I have not been able to play a movie I had bought on the Play store and downloaded to the device using the store app... again, maybe user error.

</comment></comment><comment><USER21> I posted the register link on this story, seeing Koushik's comments it looks very much like there is an intent at work here. That intent being that the 'crown jewels' of this device is sitting between what you see and the source of that stream. I would guess that Google would consider doing what Hulu did and inject 30 second commercials into that stream. Perhaps that doesn't work if you call the streaming API directly?

A number of folks seem to make these 'linux/android to HDMI dongle' type systems, I guess we're stuck making our own version of one.

</comment><comment><USER22> Well, I don't agree with what Google is doing assuming it's intentional.

But,

1)It's $35. I spend more than that on a week's worth of lunch.

2)I bet cyanogenmod will make an appearance. I'm just buying Chromecast for the hardware.

<comment><USER17> There is always going to be a cost comparison that can be used to belittle something. The classic is _" less than x days of coffee."_ Next step up is apparently _" less than x days of lunch."_ What is the next one, _" less than your car insurance"_ perhaps? $50,000? That is less than some _cars_ cost! $100,000,000? That is somewhere around _ten shuttle launches_! A several billion dollar shuttle program? _Please_ , just check out these national debt numbers?

These types of price comparisons between unrelated things are almost always worthless. You could make me feel ripped off over two dollars; I sure as hell can feel ripped off over $35.

<comment><USER23> This is your friendly reminder that slippery slope is a logical fallacy.

<comment><USER24> This is your friendly reminder that jlgreco's is not a deductive argument and that most of the logic we base our everyday decisions on would be called logical fallacies. It's time for a Fallacy Fallacy, I think.

This is also your friendly reminder that jlgreco wasn't even employing "slippery slope" logic. He wasn't arguing that employing a cost comparison will lead inevitably to employing further cost comparisons. He simply pointed out that one cherry-picks the level that best makes one's argument.

This is your friendly reminder that your post makes no sense.

<comment><USER23> This is my friendly reminder to finish my coffee before commenting on the internet.

</comment></comment></comment></comment></comment><comment><USER25> Seems like 35$ for this device was too good to be true. Hopefully there will be some custom ROM sometime, anyway i wanted to get one soon, but now i will hold out as streaming anything to my TV would have been the killer feature for me.

</comment><comment><USER26> Well this device has gone from a "must have" to a "no thanks".

</comment><comment><USER27> Everyone wants to blame google, but because Chromecast requires a functional HDCP link... its probably more due to content providers.

</comment><comment><USER28> Google basically just made Chromecast less useful than an Apple TV,

</comment><comment><USER29> I got news for Google. What stopped me from rooting my iPhone was a pretty vibrant app store... that I would lose access to. Given that I already have multiple ways to do Netflix and Youtube on my TV, I'll root my chromecast and run something open that lets me do what I want AS SOON AS I POSSIBLY CAN.

</comment><comment><USER30> Open always wins!

<comment><USER31> I'd love to hear about an open alternative for $35. Maybe something RPi-based?

<comment><USER32> Leapcast([https://github.com/dz0ny/leapcast](https://github.com/dz0ny/leapcast)), nodecast are both on the way becoming the replacement for CC. All we need is someone to port video acceleration to chromium browser. :)

</comment></comment></comment><comment><USER33> My Chromecast arrived today. I set it up on my living room TV, and to my surprise, my Nexus pad is also presenting the wireless TV in the kitchen as a playback option. Is this a documented feature?

<comment><USER34> Your wireless TV must support the DIAL protocol around which which Google Cast is built: [http://www.dial-multiscreen.org/](http://www.dial-multiscreen.org/)

</comment></comment><comment><USER35> Can I ask for more context?

<comment><USER36> The OP developed an app that allowed you to stream raw media files directly to the chromecast. This is not possible by default, instead you're limited to youtube, netflix and mirroring a tab in your browser.

OP's application doesn't use SDK but instead works at a lower level. This new update broke his application and he is making the argument that it was a directed update. They specifically removed a part of their code that allowed for this functionality.

<comment><USER37> It can mirror a tab in your browser? Doesn't that mean you could just open a video file in your browser and watch it that way?

Edit: looks like it's limited to 5 Mbps at 720p. [http://www.anandtech.com/show/7186/google-chromecast- review-...](http://www.anandtech.com/show/7186/google-chromecast-review-an- awesome-35-hdmi-dongle/4)

<comment><USER38> Yes, but only for codecs supported by Chrome (basically mp4 and the occasional avi). Anything that needs transcoding (or any file with high bitrate/multichan audio) will cause extreme stuttering unless you have a machine with a fairly beefy processor and GPU.

Casting a tab is like using logmein to watch a movie on another computer. Casting either the RAW or the local file directly is like playing something off a NAS

</comment></comment></comment></comment><comment><USER39> So there was a way for any random app to play whatever video it wanted on my tv? And Google disabled it? Well gee, shame on them.

</comment><comment><AUTHOR> Is the new motto being _Do Evil_?

<comment><USER40> No, but Newspeak is the official new language at Google.

<comment><USER41> Well newspeak[1] was created by Gilad Bracha. He now works for Google, he was one of the creators of Dart. So, almost.

[1] [http://newspeaklanguage.org/](http://newspeaklanguage.org/)

<comment><USER40> [https://en.wikipedia.org/wiki/Newspeak](https://en.wikipedia.org/wiki/Newspeak)

</comment></comment></comment></comment><comment><USER42> It's not so much that I mind Google doing this, as I wish people would stop pretending that Google is somehow more "open" or different from other companies that restrict the functionality of their devices in similar ways.

<comment><USER43> > I wish people would stop pretending that Google is somehow more "open" or > different from other companies that restrict the functionality of their > devices in similar ways.

This is the first device Google has done this with though, isn't it?

</comment></comment><comment><USER44> Still getting one.

</comment><comment><USER45> I guess google wants to control the platform. What is the surprise here.</comment>


The Web Browser Address Bar is the New Command Line - <AUTHOR> http://www.codinghorror.com/blog/archives/001265.html

<comment><USER2> "X is the new Y" is the new "X complements Y"

Feel free to reuse ad nauseam with Twitter, email, Google, Wolfram Alpha, command lines, cloud computing, crowdsourcing...

</comment><comment><USER3> While I've certainly made use of typing random stuff into my web browser, the browser can't compete with a shell until it learns to display results as concisely.

Unix has get-results-and-get-out behavior. There's no "fluff"; some commands won't even display an error string, they just return error status. (This is pretty ideal, to me.)

If I must use a GUI, I find Apple's Spotlight closer to what I want, than a browser's location bar. For example: while I _could_ ask Google to solve 2+2, I still have a web page wrapped around the result (that probably replaces whatever web page I was using); with Spotlight, the answer to 2+2 appears before I even hit Return, and when I hit Esc the entire query box disappears and I can resume what I was doing before. _That_ is how a "super location bar" needs to work.

</comment><comment><USER4> try this in your chrome url bar: rm -rf *

I just tried it and google still seems to have quiet a bit of data.

<comment><USER5> $ sudo !!

</comment></comment><comment><USER6> Actually, it's not the address bar per se, but the search box that's the default home page on so many browsers. For many people "Google" is the "Internet" and they type into the Google box shown by default things like "cnn.com" and the like.

I guess Jeff's point may have been aimed at the techie crowd (a Chrome screenshot with a JS example), and for this smaller demographic of web users, I can't agree more.

</comment><comment><USER7> I read it just now. Jeff Attwood is great as usual.</comment>


Show HN: GeekJobs.io – a daily listing of all geek jobs on a map - <AUTHOR> https://geekjobs.io/ <comment><AUTHOR> Hello HN users,

GeekJobs.io is an aggregator of all geek jobs (software/programming/development etc jobs). It also displays jobs on a map for easy navigation.

I am working on this site from last many months. It is still in very early stage. Few of the functionality still need some work. I am posting now to get some feedback.

Note: Map currently does not display properly on a mobile browser.

</comment><comment><USER2> Search doesn't work - for instance enter "Utah" or New Mexico and it either cannot find anything or return jobs in Switzerland.

A smarter search for catching states, zip codes, or cities would be greatly beneficial

<comment><USER3> Same here - I entered "Munich" and nothing came up. In the list below there were only US jobs listed so I was wondering if this is portal is focused on the US market only. However looking into the map I saw there were supposed to be 41 jobs listed in Munich.

BTW, if you'd like to get more UX feedback, please feel free to visit our free UX community platform at [https://usability.testing.exchange](https://usability.testing.exchange)

</comment></comment><comment><USER4> This looks awesome! I would love to see the country the jobs are from, on the remote jobs tho. Taxes, pension and stuff make this more relevant than it seems :)

</comment><comment><USER5> See [http://whoishiring.io](http://whoishiring.io)

or 'whorishironing' as it is known in these parts.

</comment><comment><USER6> FYI map view on iOS just plain doesn't work.

It shows the same list again but with bits of random text over the list.</comment>


The End of a 36 Country Journey - <AUTHOR> https://calvinrosser.com/long-term-travel/ <comment><AUTHOR> For years, I traveled the world while working remotely. The freedom was great, but after a while, it all seemed to blur together. My life felt kind of pointless and transient.

Earlier this year, I decided to stop traveling to build more depth. Curious if others have had similar experiences?

<comment><USER2> I had a similar experience. Started nomading in 2016. The idea of being able to hop from one place to the next sounded amazing. In many ways it was, but it got old quickly. I think the hedonic treadmill accounts for a lot of this. I became completely numb to the experience.

I thought it would improve with "slowmad"-ing...instead of spending weeks places, I'd stay for months. But even then, everything still felt super transient. It's hard to develop relationships when you know that you or your friends will be leaving soon.

With COVID I was forced to settle down and even though the circumstances are horrible, there's solitude in not having to "know" where I'm going next.</comment></comment>


Squarespace: They Asked for My Password. - <AUTHOR> http://www.keepitlit.co/blog/2014/2/14/im-leaving-squarespace-they-asked-for-my-password.html

<comment><USER2> This is probably just some customer service mistake, not a systematic failure.

Why do people take isolated examples of uneducated, misinformed customer service reps, and blow them into raging complaints damning the entire company? I'm starting to see this regularly. Take a deep breath before you spew out some diatribe on your blog.

<comment><USER3> I think one of the comments someone left on the blog itself rings true:

"Wow, you are a hell customer."

I'm willing to bet Squarespace is happy the OP is leaving their service, I know I would be if I were in their shoes.

Granted, it is a case of bad support, but as Colin mentions, it is likely an issue with an under trained new hire, not a systematic failure.

<comment><USER4> Hmmm smells like the HN misogynists are out again. Someone should really do a sentiment analysis on HN comments based on author gender.

<comment><USER5> If it helps anything, I came to the same conclusion and didn't realize the author was a female until your post brought it to focus.

<comment><USER6> Well, it helps that you didn't call her an "egotistical bitch" :-)

You can agree that she might be wrong but I think the sentiment is that some of the people that are disagreeing with her are being specifically sexist in their method of disagreement.

</comment></comment></comment></comment></comment><comment><USER7> Hey folks, Christa from Squarespace here. I'm the VP of Customer Care, and would appreciate a moment to respond to some of the comments and concerns expressed here.

To be clear, it is our stated policy to not ask for security credentials over email. All of our 150+ customer care team members receive proper training, both during on-boarding and on an ongoing basis.

This incident was quite simply an example of human error. The support request was troubleshooting a mobile app interaction with our legacy Squarespace 5 product. This is a rare example of our team not being able to login as the user. One of my team members made a mistake, and for that our entire team apologizes. The proper action would have been to escalate to engineering or ask the customer to create a temporary password.

We will of course use this as a teaching moment and continue to strive each and every day to improve in our efforts to deliver world class support to all of our customers.

Sincerely,

Christa

</comment><comment><USER8> I actually encountered this with my registrar Enom. I reached out to them on Twitter with no response, but, in their FAQ section, sure enough the instructions were to email your domain name and password.

Needless to say, I changed that password and jumped ship. If any service requires your password as verification, it's definitely a good idea to look into other services.

</comment><comment><USER9> I was somewhat dumbfounded when I was asked for my apple id and password when I went to get my screen replaced at the apple store.

After some debate with more senior team members, I reset my password to something generic and gave it to them, but it sets a bad precedent for customers who should be educated into never giving their password, under any circumstances.

</comment><comment><USER10> You should write Squarespace and ask if this is their standard process. I suspect that it could be a new support employee who is still learning how to handle this kind of stuff.

<comment><USER11> I can see a few possibilities here:

1\. Squarespace don't have the engineering to support their support team's work, therefore they need passwords. This is unlikely, but if it's the case, people should avoid Squarespace, or at least using their support system.

2\. They do have the engineering support, but their support team don't know how to use it and just ask for passwords. Given how much they emphasize support, I find this unlikely, but again, if the case you should avoid using them.

3\. A new starter on the support team hasn't been run through all of the details about how to use the support system yet. This strikes me as the most likely, and not grounds for avoiding Squarespace. It should be pointed out to them, privately, so that they can emphasize customer password security in their training process for support staff.

<comment><USER12> I worked at Squarespace for two years as a developer. Neither support nor engineering needs a password to diagnose and fix problems. I can't actually think of anything on the system that would require this so my first thought is that the support rep's machine or account has been compromised. Could also be an extremely poor decision on the rep's part but I never ran across another case in a couple hundred escalated issues.

<comment><USER11> Exactly, every web platform that gets anywhere near the size of Squarespace would have systems in place to support this.

</comment></comment></comment></comment><comment><USER13> Another way to look at this is to be happy that they had to ask for the password...

<comment><USER14> While it means that customer repcan not see the password or that the password is hased, they should have a system to let them acces your account without asking for your password.

</comment></comment><comment><USER4> Yikes! So glad to know that these type of things are being broadcast to the wider Internet community. I know quite a few people that use squarespace; I'll make sure to let them know.

</comment><comment><USER6> Years ago I tried out SquareSpace and was having problems copy and pasting content into their editor. Basically they told me to first paste into TextEdit, convert to plain text and copy and then paste from there. When I explained that was a non-starter they pointed out I could switch to Windows and use IE or Firefox.

Yes, SquareSpace customer support actually recommended I switch from Mac to Windows to use their service.

</comment><comment><USER15> If they're trying to recreate the issue, and are unable to do so, doesn't it speak well of SS that they DO NOT have a way to access a users account? Granted, asking for a password is poor form, but if that's the ONLY way to recreate an issue given that SS can't just access a users account, I don't think its worth blasting them for it.

</comment><comment><USER16> I didn't know you could host a static website on DropBox.

Anyone knows how much traffic can handle such a site?

<comment><USER17> Yeah, that's not going to work very well.

<comment><USER18> It will work fine for low traffic sites if hosted out of the now deprecated Public folder.

Sites like pancake.io, scriptogr.am or site44.com use the API, which don't have bandwidth caps on the Dropbox side

<comment><USER16> What do you mean out of the public folder?

<comment><USER18> [https://www.dropbox.com/help/16](https://www.dropbox.com/help/16)

Easy way to host files, including html files

</comment></comment></comment></comment></comment><comment><USER19> No big deal. But requesting top posting _in red_ is outraging :-)

</comment><comment><USER20> It is obviously a case of untrained, newbie customer rep who would've thought 'Getting access" meant requesting Username and Password.

</comment><comment><USER21> Glad they didn't ask mail password :-P

<comment><USER11> Given that most people re-use a very small set of passwords across many services, they essentially did.

</comment></comment><comment><USER22> The comments in that article are too damn retrograde</comment>


API faces - <AUTHOR> http://apifaces.com/

<comment><USER2> I'm confused yet amused nonetheless. Can anyone explain?</comment>


Swift: Simple, Safe, Inflexible - <AUTHOR> https://medium.com/@getaaron/swift-simple-safe-inflexible-68ff6fa927dc

<comment><USER2> _" Allow required initializers in extensions, and require subclasses to implement these initializers (even if they just call super)"_

Is that possible? The subclass could live in your application, and the extension method in a plug-in that isn't known to the application (needn't even be on the system or _exist_ when you launch the application)

That may work, but I would have to think hard about all kinds of weird scenarios before being sure of it.

<comment><USER3> At some point you'll end up with breakage unless doing this _causes_ the subclasses to implement the initializer with super (if not already present), not just require it. I don't really like that, but it might actually work.

You shouldn't really get to mess with someone else's implementation... that's partly what subclassing is for and that's where it should get fixed. I'm not really familiar with the barrier here since Swift isn't available on my platform, but I can't think of a reason for it to be such a problem, unlike the the other road.</comment></comment>


Python's Mutable Default Problem - <AUTHOR> http://blog.objectmentor.com/articles/2008/05/22/pythons-mutable-default-problem <comment><USER2> I'm not sure this constitutes any problem other than a lack of understanding of the python runtime. What the author describes as:

 _"the mutable default parameter quirk is an ugly corner worth avoiding"_

could also be described as:

 _"a natural outcropping of python's late binding, "names are references" variable model, and closure mechanisms, which provide a consistency to the language that is often crufted up in others"_

I do somewhat agree with the author that this particular functionality should be a "use only when needed" feature. I don't think it should be avoided at all costs tho, because there are times where the mutable default allows for a lot of saved code. In fact in a few cases the code to work around using mutable defaults can get into some serious voodoo because frequently the writer is actually trying to work around the bigger mutable/immutable objects and names are references "issues" in python.

This also reminds me of something I was reading on the front page today about the old 'use the whole language' vs 'simplicity is king' holy war.

<comment><USER3> Precisely because Python has late binding you would expect the parameters to be evaluated on each call to the function.

One thing Python lacks is the ability to use preceding arguments in defaults, e.g. you cannot do this:

        def f(a=3, b=a+1):
            return (a + b) / 2

        NameError: name 'a' is not defined

Oops.

<comment><USER4> That hides default logic in the signature. Why would you favor that over

      def f(a=3, b=None):
        b = b or a+1 # or use a more explicit version
        return (a + b) / 2

<comment><USER3> Because that can be said more succinctly. It is even easier to read as there is less to read, which I realize is mostly subjective.

<comment><USER4> I'm pretty sure this is the same argument used to make Perl a bad guy.

<comment><USER3> I disagree, but we've gotten a bit off topic.

I think Python's behaviour is confusing and basically never what anyone actually wants. Regardless of whether or not you can use other params in defaults, the defaults should be evaluated on each call.

</comment></comment></comment></comment></comment></comment><comment><USER5> As noted in the comments, DON'T use

      stuff = stuff or []

because if you pass an empty list, you'll get a new one rather than mutating the one you passed.

      stuff = stuff if stuff is not None else []

is wordy, but at least it's correct.

<comment><USER6> It's sad that such a common and concise idiom as "x or y" is so perniciously, subtly broken in Python, and that there is no satisfyingly concise equivalent.

If I were being cavalier and had an extra wish to burn, I'd request

      x else y

to mean x unless x is None.

<comment><USER7> Make yourself a function.

<comment><USER6> Not so helpful in a strict language (since you want y to be evaluated only when x is None)

<comment><USER7> Yes, that's true. You would need to wrap it in a lambda, but then that's looks horrible and you might as well use an if.

</comment></comment></comment></comment></comment><comment><USER8> FWIW, Perl 6 implicitly treats default values as closures, and calls them when no argument is passed that could bind to the optional argument.

That way you get a fresh array each time, and you can even use defaults that depend on previous arguments:

        sub integrate(&integrand, $from, $to, $step = ($to - $from) / 100) { ... }

</comment><comment><USER9> Pylint (or maybe it was pep8) has told me not to make dicts default arguments when running it against my code, but didn't explain why. Thanks for the post.

</comment><comment><USER10> You just need to fully understand when Python does evaluation.

        import types
        def function(item, stuff = lambda: []):
            if type(stuff) == types.FunctionType:
                stuff = stuff()
            stuff.append(item)
            print stuff

        function(1)
        # prints '[1]'

        function(2)
        # prints '[2]'

In Scala it has a better syntax because of typed function object:

        trait Map[A, B] {
            …
            def getOrElse (key: A, default: ⇒ B): B
            …
        }

the `default` parameter is a function, so when you do

        getOrElse(someKey, defaultValue)

The `defaultValue` becomes a function that generates the value you put there when called.

</comment><comment><USER11> Yes, it's a wart. You learn the patterns he mentions pretty quickly.

<comment><USER12> I knew the pattern well from other languages, but would have assumed that it wasn't necessary in Python. So, this is good to note.

</comment></comment><comment><USER13> "stuff = stuff or []"

This idiom is baked into the perl community. It's kind of funny to see a Pythonista deciding it's a good idea. (You can tell it hurts him too).

<comment><USER14> It's not a good idea in Python. There are legitimate reasons to pass falsy objects as function arguments.

<comment><USER15> Funnily enough, Perl (since version 5.10) actually has a solution to this. The expression

      $foo // "default"

evaluates to "default" if $foo is undefined, and to $foo otherwise (even if it is defined but false).

</comment></comment></comment><comment> mark-r I keep seeing this "problem" come up, but I don't understand how it's realistic. If you have a function that modifies a parameter as a side effect, why would you have a default value for the parameter?

And since the site's comments seem to be taken over by link spam, is this mention on Hacker News just a clever way to juice the Google rank of said spam?

<comment><USER16> I saw it bite some people where I work. It's now used for discussion with potential hires.

</comment></comment><comment><USER17> This 'problem' can actually come in handy when used with a regex callback function.

See if you can determine what this does:

        def cbk(match, nb = [0] ):
            if len(match.group())==len(nb):
                nb[-1] += 1
            elif  len(match.group())>len(nb):
                nb.append(1)
            else:
                nb[:] = nb[0:len(match.group())]
                nb[-1] += 1
            return match.group()+' '+('.'.join(map(str,nb)))

        str = re.compile('^(#+)',re.MULTILINE).sub(cbk,str)

<comment><USER18> The code converts:

      ##
      #

To:

      ## 0.1
      # 1

_str_ is builtin, don't use it as a variable name especially if you use it in its original role.

<comment><USER17> Correct, & thanks for the tip! But don't worry, I changed the variable name from my copy & paste and just didn't give it a second thought.

</comment></comment></comment><comment><USER19> The problem is not so much about mutable, it's that default parameters escape the scope of their method.

Which is very, very messed up (but not the first thing Python messed up).

</comment><comment><USER20> It's on SO's Python FAQ too. This is the only thing in Python that's really bitten me. I remember it took me like a week to figure this out when I was tearing down my algorithm bit by bit to find out whether my prove was wrong or the code.

[http://stackoverflow.com/questions/1132941/least- astonishmen...](http://stackoverflow.com/questions/1132941/least-astonishment- in-python-the-mutable-default-argument)

</comment><comment><USER21> You can use this trick for memoization. Example: <http://paste.pocoo.org/show/341849/>

<comment><USER12> The article is right, though, in stating that later viewers of your code may not be expecting this behavior, and it culd lead to problems.

</comment></comment><comment><USER22> "stuff = stuff or []"

This would fail to have expected behaviour here:

fill_list = []

stuff = function(info, full_list)

print fill_list

use the if list is None: paradigm

</comment><comment><USER23> Not sure if that's a "problem" if the only other way to implement function- static variables would be to add a variable visible for the whole module, or tricks with decorators...

        @statics(blah=[])
        def foo(normal_args, **kwargs):
        # or
        def foo(normal_args, blah):

It messes up the idea of looking at the definition to find the function signature.

</comment><comment><USER24> it's a gotcha but it makes perfect sense once you understand why it works that way - i.e. the difference between evaluating a function definition and calling it.

</comment><comment><USER25> The Pythonist doth protest too much, methinks.

</comment><comment><USER26> i think its clearer and more pythonic in this case to do

def function(item, stuff): .... blah blah def function(item): function(item, [])</comment>


Free HN: Entire First Section of "Linux for Hobbyists" - <AUTHOR> http://linuxforhobbyists.com

<comment><AUTHOR> Hi HN! I just finished the first 5 chapters of my new book, "Linux for Hobbyists"!

I'd love your feedback on the book. For the small price of your e-mail address that I promise not to spam, you can read these chapters:

[http://linuxforhobbyists.com](http://linuxforhobbyists.com)

I very much look forward to your feedback! Thank you for your time everyone.

-@zachfeldman

<comment><USER2> Very neat :) I've built some small projects using a Raspberry Pi, so always looking forward to learning more. PS, I just put in my email.

<comment><AUTHOR> Thank you! I hope you enjoy, really appreciate any comments on making the book better.

</comment></comment></comment><comment><USER3> "a Raspberry Pi web scraper to control my apartment with my voice" \- Huh..?

<comment><AUTHOR> This is just one of the projects I've built with the help of Linux. See [http://alexaho.me](http://alexaho.me) for more info!

<comment><USER3> Is it supposed to say "web server" instead of "web scraper"?

<comment><AUTHOR> Well, the project is kind of a combination of both. There's a server that receives commands from the scraper. So it's kind of like a "web screavper?" Ha.

</comment></comment></comment></comment><comment><USER4> pretty cool, but i really don't think these chapters are elaborate enough for true beginners.

slightly offtopic: what is the recommended book for a more indepth look of how linux/unix works?

<comment><AUTHOR> Thank you for the honest feedback! Wondering if you could provide more information on why you think that? Should I go into a lot more depth on a specific topic? Do I need to break down the shell commands with more detail?

Regarding your second question - I'm not too sure of a good book and my book isn't really meant for that as I'm sure you've guessed.</comment></comment>


Destroying Your Enemies Through the Magic of Design - <AUTHOR> http://www.jacksonfish.com/blog/2012/09/19/destroying-your-enemies-through-the-magic-of-design/ <comment><USER2> Somehow I get the feeling that "High Fidelity Visualization" is a marketroid's euphemism for "pre-rendered movie that we pretend is our game in progress on the tradeshow floor".

</comment><comment><AUTHOR> "High Fidelity Visualization" is an interesting term they've tried to coin, but I've had enough experience to know that just because you come into a meeting with a mock or prototype, doesn't necessarily make it a "nuclear" weapon that lets you build automatic consensus. When I'm presenting to a room filled with talented people, I would hope they would be smart enough to see through such a gimmick.

</comment><comment><USER3> Look at the new Myspace product demo or the reason why Kickstarter stopped allowing these types of conceptuals on certain product types. How do we know that's really the experience we can expect? You can fake anything in design, and that might win you the bid, but what are you going to do when you can't build it and your shareholders are breathing down your throat? You also can't expect people to understand good design when they see it. Some of the most well-produced project prototypes I've seen have been trashed because someone above the designer decided an alternative direction was better based on subjectivity alone. It isn't guaranteed and it often isn't worth the heartbreak.</comment>


WhatsApp rolls out end-to-end encryption using TextSecure code - <AUTHOR> http://www.theverge.com/2014/11/18/7239221/whatsapp-rolls-out-end-to-end-encryption-with-textsecure

<comment><USER2> Honestly this is the most important addition to any messaging app, and totally justifies being purchased by facebook.

<comment><USER3> Agreed, and if Moxie wrote/reviewed the code, it's probably safe. (That said, having more eyes look at it is still a good thing!)

</comment></comment><comment><USER4> Looks like the URL changed slightly. This works: [http://www.theverge.com/2014/11/18/7241011/whatsapp-rolls- ou...](http://www.theverge.com/2014/11/18/7241011/whatsapp-rolls-out-end-to- end-encryption-using-textsecure-code)

</comment><comment><USER5> This is great news and great progress!

One remaining issue: Since the whatsapp binary is closed source, it cannot be verified that it does what it says.

</comment><comment><USER6> Working link: [https://whispersystems.org/blog/whatsapp/](https://whispersystems.org/blog/whatsapp/)

</comment><comment><USER7> This is a 404 too, like the whispersystems blog post.

<comment><USER8> It's really strange -- I was literally just reading this and saw the paragraph at the end of the Verge article implying Moxie's support. Confirmed that it's 404 here too.

>>Still, it took a lot of work to get TextSecure's protocols ready for WhatsApps hundreds of millions of users. Open Whisper CTO Moxie Marlinspike says it took six months to get the code ready for such a large deployment, beginning shortly after WhatsApp was acquired by Facebook. "Most of our efforts have been focused on making our code easier to consume," Marlinspike told The Verge. "I've been really impressed with the dedication and commitment WhatsApp has to the project."</comment></comment>


'Russian Elon Musk' raped and tortured to death in custody, say experts - <AUTHOR> https://www.independent.co.uk/news/world/europe/valery-pshenichny-russian-elon-musk-raped-tortured-death-custody-a8309111.html <comment><USER2> I wonder why smart and competent-seeming people who can get out of Russia stay in Russia. For most of the last 200 years, if not longer, the smartest thing anyone in Russia could do was (and today is) get out of Russia. Staying seems to have limited upside compared to these very significant downsides.

<comment><USER3> Have you ever faced the decision to leave your "home"? There are many variables to consider that question the very existential beliefs of a person. "Smart" means different things. Furthermore, the outside environment as well as the inside world of a person is always plastic so the threshold between staying and leaving is very murky. By the time, it is "obvious" to leave, it is often too late.</comment></comment>


Ask HN: Where do you host your db's for your side projects? - <AUTHOR> I'm looking to create a project that would use MongoDB, and I've never created my own back-end before, so I'm exploring options. I'm not sure what people's go-to solutions are for this.
The only option I see is hosting via DBaaS with Compose or mLab or similar, and these cost $31 and $15 per month respectively for one gigabyte of data.
This seems insane to me. How can anyone afford this profitably with anything less than a total success of a side project? Surely a successful project might use hundreds or even thousands of GB of db space when people start to really use it, no? My project would involve storing thousands of PDFs, among other files.
Do people use DBaaS for such cases, or manage their own on Digital Ocean, AWS, etc? I have no knowledge of how to do that (yet). <comment><USER2> Amazon S3 is a cheap option for file storage. I don't exactly understand why you would store files in a database.

<comment><USER3> Agreed. Store as much as possible in S3. Store only what's necessary in a DB.

</comment></comment><comment><USER4> Agree. DBaaS are all quite expensive. I would suggest going for your own machine. You should probably checkout Scaleway/AWS RDS etc.

Also, storing files in S3 would workout better.

</comment><comment><USER5> I use mlab for my side project , though my requirements are well under 1 GB. But as others have pointed out, having a dedicated server/VPS will be the best way for your needs

Note: [https://www.clusterpoint.com/pricing](https://www.clusterpoint.com/pricing) is slightly priced less , if cost is your major factor .

</comment><comment><USER6> Best option would be to rent a dedicated server and put all your side projects there until one of them catches on and you need to scale.

You can get a small dedicated server for $30-40 per month. If you rent it yearly you will often get a discount.

<comment><USER6> Store your PDFs on the dedicated server. If it's not sufficient, use S3. But a dedicated server should be able to handle couple thousand PDFs if your traffic is low.

</comment></comment><comment><USER7> Use DBaaS only if you need it. For a side project they give very little advantage since you don't care about the region as well as replicating and scaling that much.

</comment><comment><USER8> I usually run mongodb directly on a tiny $5 server from Digital Ocean or AWS and it works fine for a low (to no) traffic side project.

</comment><comment><USER9> You plan to store PDFs in your database? Why?

<comment><AUTHOR> I misspoke in the post. I didn't mean to say that. DB for user accounts and various site data; file storage for PDFs.</comment></comment>


Ask HN: Is Tik-Tok Malware? - <AUTHOR> Over the weekend, a tweet has "blown up" (linked below), screen grabs of someone speaking with authority about how they reverse engineered TikTok and found it is capturing all sorts of unexpected data (beyond the clipboard capturing, reported last week).
People are asking about this.  But this whole story is triggering my BS detector.  The tweet is screen grabs quoting "someone on Reddit".  The reddit post goes into extensive justification for why they can't provide any proof ("The laptop this work was on has a dead motherboard, it's a MacBook with soldered on SSD so I can't just remove the SSD"...  Feels kind of like the dog ate my homework).
I took a look at the permissions the TikTok app is requesting, and they don't seem unusual: Camera/mic and media.  The post is alledging: Downloading and executing .zip files, scanning your network, sending geolocation every 30 seconds, sending device and AP MAC addresses, setting up a local proxy server...
Anyone have any further thoughts on this or seen any additional details?
Tweet: https://twitter.com/d1rtydan/status/1277081198624337920
Reddit: https://www.reddit.com/r/videos/comments/fxgi06/not_new_news_but_tbh_if_you_have_tiktiok_just_get/ <comment><USER2> If it was malware, I would be looking for a malware analysis on one of the malware detection / threat sites. At very least I would expect such a write-up on a security analysts blog, that is referenced by a security company. If the code itself is not malware and is being used as command and control, then I would expect someone has captured it being used in this manor and could show the questionable system calls being made.

</comment><comment><USER3> With any bold claims like this, look for a consensus approach. Are the claims repeatable? I have seen these kinds of reports about TikTok from multiple independent sources, so I'm inclined to believe them.

</comment><comment><USER4> Yes.</comment>


Advice to Someone Just Entering Our Industry - <AUTHOR> http://perspectives.mvdirona.com/2016/11/advice-to-someone-just-entering-our-industry/ <comment><USER2> I'm nowhere as accomplished as the original author but let me try adding a few other tips.

Plan on spending a lot of hours learning/practicing/tinkering to explore and pickup new tech skills, OUTSIDE of your normal work hours. If you think you want 9-5, Mon-Fri job, don't get into this. You won't last. Whatever task you do will be automated or given to younger (aka cheaper) worker eventually. Or the technology you use will become obsolete. Maybe you can last more than a decade, but your compensation will not seem like a tech worker.

Basically, plan on being in a self-paced vocational school every few years.

A HN poster mentioned few months ago he was able get to the position of a CTO by virtually having 2 full time jobs through out his career. One was his normal 40hr/week job. The other job was also 40hr/week, but unpaid as he just about spent that much time learning new tech skills.</comment>


A Practical Guide to Watchdogs for Embedded Systems - <AUTHOR> https://interrupt.memfault.com/blog/firmware-watchdog-best-practices <comment><USER2> One neat thing I've seen that doesn't get called out enough, is a high priority timer that has a slightly smaller period than your watchdog. When you let the watchdog, you pet this timer too. Then in the timer ISR, write out the trap frame to brain dead non volatile memory (we had battery backed SRAM, and then MRAM on newer boards). Then when the board reboots, and checks in, you can pull down what it was doing when the watchdog triggered.

<comment><USER3> Yes!

I implemented something similar on a particularly annoying 8/16-bit controller just a few weeks ago. Extra fun since it had no instruction to read the program counter (and no general purpose register wide enough to hold it).

I hope ARM adds that (or IC vendors like ST if possible) to the core itself, just mirror the PC to a register on reset. Should be trivial in hardware.

<comment><USER4> Hmm, maybe you could possibly instrument the functions[1] to write the function address to a register, presuming you have enough program space. Presuming you're in C and your compiler supports that.

1: [https://mcuoneclipse.com/2015/04/04/poor-mans-trace-free- of-...](https://mcuoneclipse.com/2015/04/04/poor-mans-trace-free-of-charge- function-entryexit-trace-with-gnu-tools/)

</comment></comment></comment><comment><USER5> I was surprised at the poor state of watchdogs in PC-class Linux systems. I needed one recently and was bummed at the state of the old watchdog daemon / softdog kernel module. It works, but it is not nearly as easy to get going (on Ubuntu) as I expected. systemd also has its own watchdog and I can't figure it out.

Anyway turns out I really needed a full PC hardware watchdog. I ended up buying some $8 anonymous piece of Chinese hardware that's USB powered. It hits the motherboard reset switch if the motherboard hard drive activity light hasn't flashed in awhile. Dumb thing, but it seems to work.

<comment><USER6> Almost all consumer motherboards have a chipset with embedded hardware watchdog that's well supported by respective drivers in FreeBSD / Linux / etc. Some vendors like Intel may lock down that functionality, but most (Asus, Gigabyte, etc) don't.

<comment><USER5> Do you have any more info on that chipset watchdog and how I'd use it in Linux? Is it this, the TCO Watchdog? [http://www.madore.org/~david/linux/iTCO- wdt-test.html](http://www.madore.org/~david/linux/iTCO-wdt-test.html)

<comment><USER6> Yes, iTCO_wdt is for Intel chipsets; sp5100_tco is for AMD chipsets (including FCH).

The names are a bit weird to my taste. FreeBSD ones sound a little bit better (but maybe I am just more used to them): ichwd (ICH WD) and amdsbwd (AMD SouthBridge WD).

<comment><USER5> Thanks! I somehow spent several hours researching how to run watchdogs on Linux without finding this. Seems like exactly what I need. While I'm here, systemd's watchdog docs are also pretty good: [http://0pointer.de/blog/projects/watchdog.html](http://0pointer.de/blog/projects/watchdog.html)

</comment></comment></comment></comment></comment><comment><USER7> One scenario missed in the list of causes is a corrupted runtime image.

An advanced topic is enabling support for the watchdog in your bootloader and having a defined recovery path when the system fails to load or, worse, the application falls into a boot loop.

If you have the space, you can fall back to a recovery image or duplicate of the application. If you don't have the space, falling into a DFU mode is a good plan.

</comment><comment><AUTHOR> Watchdogs are one of the more frustrating types of issues to debug. Chris's overview of how to implement them properly, and investigate resets is an amazing resource I wish I had earlier in my career.

<comment><USER8> Heh, I work in embedded and, IMO, they were one of the most fun issues to debug in the begging of my career. Mostly, if I had such an issue, I enabled the ISR triggering and just before the context got trashed, I looked where the program was. Things got pretty obvious then.

Once you get the hang of it, it becomes pretty straightforward. And it's great training on how the HW looks like and functions!

Granted, on more lower powered systems, with fewer, more primitive debugging options (looking at you, PIC) things miiight look a bit more painful. Thankfully, such systems are (much) smaller.

IMO, the _most_ painful issues to debug are memory corruption issues happening on large systems without MPU enabled.

<comment><AUTHOR> You're right, if it reproduces at your desk you've got some good tools at your disposal.

Collecting enough state to fix them from a customer report is tricky, I would say.

</comment></comment></comment><comment><USER9> The watchdog is a nice feature to have a borked system reboot, lifesaver in the field if feces hits the fan.

What's less fun is if there is too little protection against electrostatic fields/EMI on the JTAG clock pin. On the small cortex m-class devices we work with, some of them can't shut off the JTAG part of the chip, meaning that when operating, if there are enough (I think 8) logic flips on the TCK pin in _any_ amount of time, the JTAG part wakes up, sets the HALT ON BOOT flag. Next time the device reboots (due to firmware update, or watchdog, ...), it will stop and stay in JTAG debug mode. Not nice. You need to manually power cycle the thing.

We detect this by periodically checking the JTAG power domain, and if it is on, tell the server this so that we avoid rebooting it (eg automatically after firmware update). This way we've found poor hw implementations and tough EMI environments by proxy of JTAG power domain :D.

<comment><USER10> I work with Cortex-M since they launched and I've never seen on heard about this problem. Of course, I don't know the kind of environment your devices work, but many of my projects run in automotive.

TCK has usually a pull-up/termination (but I've also seen pull-downs with/without caps). You see this issue even with the pull-up/down?

<comment><USER9> This was primarily in a lighting solution, and it wasn't the only problem with that early hw. We noticed lights not coming back online after a firmware update without a power cycle. Since it was very early hw, IIRC it didn't have any shielding, and also IIRC no pull on TCK.

We now see this primarily on 1st/early iteration hw and on prototypes, but checking this proactively have saved us from a lot of headaches of the type "why doesn't it come back online - hw, or something in the update, or what...".

</comment></comment></comment><comment><USER11> A neat enough article, but surprised it didn't talk about an electronic watchdog: basically pulsing a gpio pin to trigger a recharge of a cap which holds a transistor active for a second or so, and that transistor drives eg a relay. An alternate method uses a gpio to reset a 555 timer. This will allow machinery to cut off when the embedded circuit stops looping. That is, any attached machinery would have a guaranteed NO (normally open) circuit and can only be engaged when all the watchdogs are working properly.

Some mcu pins also go into an unknown state (neither guaranteed high nor low), so resetting a cpu can have bad consequences if it's driving big machinery, if not designed correctly.

One project I had a pc sending software watchdog pings to several independent devices and each of those had an _actual_ hardware watchdog (as opposed to the cpu resetting one in the article). I used the watchdog to physically control the power to contactors: no watchdog = no power = nothing activates.

The system controlled firing of gas burners and fans etc, but the design was very safe, heaps of redundancy and was guaranteed to fail into a safe mode at any instant.

</comment><comment><USER12> I would like to find a reliable software watchdog that kills a process when a timer expires (for preventing zombie processes from violating lease timeouts).

<comment><USER13> I mean, you probably shouldn't rely on the local system time for determining lease timeouts for correctness, if it matters.

<comment><USER12> I mean something like CLOCK_MONOTONIC.

<comment><USER13> Don't you still need to worry about the clock not going up in pace with others? Like if a system has a lease until "100" but the clock doesn't tick (or more realistically ticks slowly), then another system could think it had the lease if it observed a local system time of 101? Maybe I'm misunderstanding how you're using the leases though.

<comment><USER12> Yes you do, and normally an upper bound epsilon for clock rate skew is explicitly assumed. That's obviously fragile but there are many highly available systems that have managed to get away with it, partly by keeping leases short.

</comment></comment></comment></comment></comment><comment><USER14> Never in my career have I ever heard of any other term used than "kicking" the watchdog. Are the other terms popular in America?

<comment><USER15> Why would you kick the poor thing? :(

Not in America but terms I've heard include feeding the watchdog, keeping it alive, petting, greeting, barking at it, calling it and, my favourite, shushing it.

</comment></comment><comment><USER16> This was an awesome read. Thanks for writing this.</comment>


Ask HN: Best ways to recruit on HN? - <AUTHOR> What are the best ways to get software engineering positions through HN? Do recruiters frequently reach out to people with cool projects that reach the front page? <comment><USER2> Recruiters do reach out to people but HN front page is a bad way to get attention.

First, you have no control over that. Second, it only lasts for a day.

The right way to do it is to build long-term credibility by:

\- having a personal website ([https://blog.kowalczyk.info/](https://blog.kowalczyk.info/)) with basic information about you , your up-to-date resume (e.g. [https://blog.kowalczyk.info/static/resume.html](https://blog.kowalczyk.info/static/resume.html)) and a way to contact you (e.g. [https://blog.kowalczyk.info/contactme.html](https://blog.kowalczyk.info/contactme.html))

\- blogging on deeply technical topics. Avoid rants and anything that is not about technology. The "deeper" the topic, the better. (note that my older posts can be ranty; newer are not).

\- do interesting, open-source projects. Have them on GitHub. On your website, create a "portfolio" section that summarizes the projects ([https://blog.kowalczyk.info/software/](https://blog.kowalczyk.info/software/) but it's far from the best portfolio design)

\- for inbound recruiter requests have linkedin profile. The quality will be lower than those who contact you via website, but it's easy to ignore bad recruitment pitches

I do get contacted by recruiters. It resulted in one job and I do believe that portfolio of projects helps me when interviewing.

This is a very long-term strategy. My website is 10+ years of accumulated work.

In the short term, on 1st of every month HN has "Who's hiring thread". Apply for jobs listed there or in other high-quality places like [https://stackoverflow.com/jobs](https://stackoverflow.com/jobs)</comment>


Show HN: A London Underground Tube Status Board Written in React - <AUTHOR> https://reactube.com/ <comment><AUTHOR> This is the output of part 1 in a tutorial series, which is here: [https://unop.uk/building-a-web-app-in-react-and-asp-net- core...](https://unop.uk/building-a-web-app-in-react-and-asp-net-core-part-1/)

</comment><comment><USER2> There are so many basic React tutorials out there. Is all this really needed? I always thought the official tutorial was enough for any normal JS developer to get going with React.

</comment><comment><USER2> The colors hurt me, but it is a tutorial thing, so that's ok.

<comment><AUTHOR> Unfortunately, those are the official colours: [https://tfl.gov.uk/tube-dlr- overground/status/](https://tfl.gov.uk/tube-dlr-overground/status/)</comment></comment>


Show HN: Python decorator for function level Redis caching - <AUTHOR> https://github.com/alexk307/redis_cache <comment><USER2> This is pretty neat!

One place I see this being useful is quickly adding cache'ing to web apps. A minor issue is with permissions.

<comment><AUTHOR> Thanks! That's what I had in mind when I made it. Good for data that almost never changes as I'm still working on a way of cache busting.

<comment><USER2> Maybe put in a keyword arg to cache bust?</comment></comment></comment>


Letter of Advice to Queen Victoria (1839) - <AUTHOR> https://cyber.harvard.edu/ChinaDragon/lin_xexu.html <comment><AUTHOR> This letter shows a frank and direct understanding of the opium epidemic in China prior to the wars that essentially wiped out millennia of national prosperity and relative economic superiority. Advanced Persistent Threats in cyber security sponsored by nation governments are considered one form of multi-generational retribution. Would we write a similar letter today regarding fentanyl?</comment>


6Wunderkinder announcing Wunderlist 3 - <AUTHOR> http://wunderlist.com/comingsoon

<comment><USER2> Very curious about this new version.

The current Wunderlist is a cool demo if you stay on the rails, but I quickly ran into UX hurdles when I tried to go off road. My Wunderlist is a cluttered mess.

</comment><comment><USER3> Hopefully 3 will do a better job of syncing, I had so many sync issues with 2 that I switched to Todoist.</comment>


Berkeley Grad Seeking Stanford Cofounder - <AUTHOR>

 "Get a cofounder" is perhaps the most ubiquitous and undisputed piece of advice we aspiring entrepreneurs receive when reading startup self-help books, talking to investors, or trolling blogs.
It was advice I should have taken.   I outsourced our company's beta development to India, and I quickly learned the hard way that contractors are very different than partners.   I didn't know how hellish outsourcing could get.
I need someone to work with me to pull the all nighters, write code (which I can't do), and be there for some moral support.

 It's not that I didn't want a cofounder; it was just that this mysterious person was hard to find.  I'm sure part of the reason it was tough to find a cofounder is that our product isn't very glamorous (we use emerging web technology to help schools and families prepare for and stay connected during disasters), but it was also hard because I went to Berkeley.

 The top grads from Cal don't want to start companies, they want prestigious jobs.  Business majors like me go become investment bankers or consultants at Goldman Sachs or Bain.  The CS guys all work for Microsoft or Google.  Why don't Cal grads take risks?  Why can't we learn from the success of our rivals across the bay?
Anyway, I want to jump ship.  Is there a hacker from Stanford who wants to be my cofounder?  I'll even wear red at the big game.
Yes, this post was obviously somewhat sarcastic, but I really do need help.  I have a cofounder already, but he brought money to the table, not coding skills, and a hacker is what we need.  My company, LReady , is about a year old, revenue generating (through non-web operations) and is completing its beta software.
If you are a Flash/Flex/ActionScript god (or just a fast learner), we want you to build the messaging backend to do this:  www.lready.com/schools using tools like this: developer.ribbitphone.com.  We have some money, so we can give you a small salary, and if things work out, you can stick around as part of the founding team.  We are located just north of San Francisco, but will be moving closer to the valley shortly.
Email me at firstname.lastname@example.com if this is interesting.   I actually don't care so much where you went to school Xeven Berkeley, my alma mater, is fine.

<comment><USER2> Stanford degree does not necessarily a good hacker make.

Re-word your request as you will turn off good hackers if you restrict based on the place they went to school. Most elite hacking skills are acquired outside of a classroom anyway.

Interesting about your experiences outsourcing to India. I've met a few startup founders locally who have done that. I'd never thought about it before, but I guess it could be beneficial to those who need certain tasks completed and are strapped for resources/time. We have too much pride in writing our code but I'm sure for some it works.

You should try posting on craigslist too. You might find a software developer that way.

</comment><comment><AUTHOR> I realize that - I was being sarcastic. If someone is a great coder but didn't finish the sixth grade, I'd love to talk with them. But in all honesty, there is definitely an entrepreneurial mindset present at Stanford that is lacking at many other top schools. I wish more of my friends at Berkeley wanted to take the plunge to go at it on their own. Big names and comfortable salaries entice too many recent grads -it almost happened to me.

Craigslist also hasn't been the best for me. It's not that there aren't good people, its just that you get inundated with literally hundreds of replies. It's tough to sort through the riff raff.

I've had better luck getting help through entrepeneurship groups like SVASE, because at least the people there truly want to be a part of something rather than earn a few bucks as contract labor. Again, I realize there are good people on Craigslist, but I've learned the hardway that one bad hiring decision while your product is in development can grind you to a halt. It's all about boosting the mean and decreasing the standard deviation of your applicants; picking out a diamond in the rough is hard.</comment>


Best Low end router for small office with cable – 100mb throughput - <AUTHOR>

I am setting up a small 12 person office with Cable internet, capable of 100mbs download speeds. I am having trouble picking the right router that will allow such speeds; a low end router not enterprise style. <comment><USER2> Check out the Mikrotik's. The RB450g costs 100$ and maxed out at about 100mb. The Cloud Core's start at $400 and will do gigs of throughput.

[http://routerboard.com/RB450G](http://routerboard.com/RB450G) [http://cloudcorerouter.com/routers.php](http://cloudcorerouter.com/routers.php)

<comment><USER3> or not, they're terrible.</comment></comment>


Swombat's Founder's Library - Excellent Resource for Entrepreneurs - <AUTHOR> http://swombat.com/founders_library

<comment><USER2> <http://news.ycombinator.com/item?id=2473832>

</comment><comment><USER3> I really appreciate when people take the time to put together archives of excellent reading like this. I know the quality of swombat from HN, so I know this reading list will be awesome.

Thank you.

</comment><comment><USER4> Note: if you just want to read a random 10 articles from the Library, just load up the front page:

<http://swombat.com/></comment>


Why Google is Not Like Microsoft and Facebook - <AUTHOR> http://michaelgr.com/2010/02/15/why-google-is-not-like-microsoft-or-facebook/

<comment><USER2> Interesting point made by the author.

Its something I've wondered about. What would stop Google from degenerating? Its an interesting question because the reason we use Google (good search) is not how they make money (ads). They are related, but not the same. If you have a product that people _buy_ , you have to keep making it better.

So what stops google from splashing their entire page with ads (to earn more), or not being the best in search (as long the ad revenue is flowing)? I think the author gives a good reason why google wouldn't do that -> because users will easily change their default search engine

</comment><comment><USER3> To me this is not about Google's pledge to do no evil, but more like a call to action against Facebook, Microsoft, and yes, even Apple.

Unfortunately in the tech industry shareholders love to see large market share followed by strong lock in potential.

As technologists it can be very frustrating to see, what is often inferior technology, win the market.

But, even more importantly, consumers suffer when interoperability diminishes. The mainstream top end of the adoption curve can't be blamed for gravitating towards ubiquity, but as technologists we should always be putting a full court press on walled gardens.

</comment><comment><USER4> I think the real lesson is "avoid lockin whenever possible." Yes, it's easy to switch from Google search to something else. But is it easier to leave Google Buzz or Google Docs than to leave Facebook or Microsoft Office? (Yes.)

As long as you can leave easily, they have to keep trying hard to please you. If you're locked in, look forward to high prices - in the form of money, sucky product, loss of privacy, or whatever.

</comment><comment><USER5> This dovetails with something that is obvious within Google. It is part of the corporate DNA to believe that everything should be open, and to believe that in a competition when things are open, that Google do well.

The results is that Google doesn't try to lock people in. Which means that, unlike Microsoft, Facebook, Apple, etc, Google doesn't wind up having the safety net of lock-in allowing Google to ignore customers in pursuit of some other goal.

</comment><comment><USER6> The shorter version of why Google is not Microsoft or Facebook is that there is no lock-in, you can export your data and point your browser somewhere else if you want.

<comment><USER7> Yes. And what I consider even more interesting, IMHO, is that Google really became a company which is not indispensable (like for example 5 years ago when Google Search was de facto indispensable).

Currently, if I must I can survive with Bing for general search and for real- time search (increasingly important), twitter is even better than Google.

I am still a Google user since I like some of their products more than the competing ones (Chrome, Gmail, GReader, Adsense), but I will not hesitate to switch away from any of those if better alternative will emerge.</comment></comment>


The challenges of Creating a Civilization Web Game - <AUTHOR> http://code.google.com/p/freeciv-forever/wiki/FreecivWebClientStatusAndChallenges

<comment><USER2> My solution: drop support for IE. No, seriously. I understand that it has a very large "marketshare" (installation base) but I think that very often IE is used on office desktops, that is places people wouldn't use for playing games anyway.

While there were times when IE was a decent browser it is clearly standing in the way of innovation at the moment. It is very easy to download a modern alternate browser and a large number of websites using the canvas element would force Microsoft to build a fairly good implementation of it into IE 9 (as it was I believe hinted by the IE project team leader anyway).

<comment><USER3> > _...IE is used on office desktops, that is places people wouldn't use for > playing games anyway._

Pull the other one!

<comment><USER4> OK some games, but I am yet to see anyone playing Civ 2 during work hours, or Alpha Centauri. That would sure make me laugh.

<comment><USER5> And then cry, if they are on your team. 5-10 mins of a flash game during a break ? No problem, it will help them relax. Several hours of FreeCiv (and Civ is a huge time-sink) ? Not during the workday, God no.

<comment><USER2> But I promise I'll stop once I discover Gunpowder!

</comment></comment></comment></comment></comment><comment><USER6> I suggest dropping the project, since civ has cost humanity enough already - browser civ could cripple my productivity... just a few keystrokes away when already procrastinating. I both love and fear this project.

<comment><USER7> I had to write a freeciv patch for my girlfriend which adds a daily move and/or time limit to the game.

It was much appreciated, still have a couple of odd behaviours that I'd have to iron out before letting it out into the wild.

</comment></comment><comment><USER8> Well, the first thing I would suggest is putting all of the images into one file then using CSS to control what portion appears.

That should cut down on both latency and issues with IE only downloading one image at a time.

<comment><AUTHOR> So you are suggesting to stop using the HTML canvas element, and instead use Javascript to render tiles which are clipped using CSS from one large image?

<comment><USER9> I think you could do both. Position 96x48px divs with css sprites over the canvas element to draw the images. I think this would be a performance win too, because browsers are already very good at drawing things like css sprites (although I don't know how well it combines with the canvas element).

<comment><USER10> What would you end up drawing on the canvas, if the images are drawn with sprites? I can't think of anything else in Civilization that gets drawn, other than text for city names (which should probably be done as absolutely- positioned spans).

<comment><USER11> I think you can do sprites _within_ canvas.

<comment><USER10> You can, but it's quite a bit slower. IIRC I benchmarked drawing a 32x32 image on canvas at about 15ms, while setting the top and left properties of an img tag or div with a background image was under 1 ms. The absolute numbers mean nothing (it was on an old laptop under Linux), but the ratios indicate at least an order of magnitude different in performance.

</comment></comment></comment></comment></comment></comment><comment><USER12> This is a cool project idea. My first impression is that this feels like a natural fit for GWT. The ImageBundle mechanism would allow you to automatically build css sprites at compile-time -- and the logic for accessing the individual tiles from the sprites: (The gwt-canvas project is a small wrapper that would allow you to draw instances of the Image class to the canvas. <http://code.google.com/p/gwt-canvas/> )

It would also make it easier to move larger chunks of the FreeCiv client into the browser in a manner that would be easier to refactor and maintain than Javascript - and while being compiled to be as small as possible.

Java, for all its faults, is strong in refactorability, which would be essential for keeping the code in sync with a moving target like the current C implementation.

<comment><USER13> My first thought too - this also might be a perfect fit for something like vaadin where you do everything on the server side and push it to the client gwt for rendering.

</comment></comment><comment><USER14> I think the real question is, where will you possibly get sufficient cleavage to advertise it? <http://www.codinghorror.com/blog/archives/001286.html>

<comment><USER11> God I hate those ads. They pop up everywhere. I hope that game dies.

</comment></comment><comment><USER15> Can you do some kind of differential download and local move? Eg. when the user moves his mouse to the left 20 pixels and the world scrolls, then you only have to discard 20xheight pixels on the left and fetch 20xheight pixels from the server to bring in on the right and move over the entire canvas (or whatever) by 20 pixels, without calling setpixel() for each moved but unchanged pixel. Then add any other fluff such as a building exploding or whatever.

<comment><USER10> I think that'd actually be slower if it means you have to do the drawing on JavaScript (vs. the browser's native rendering engine). As a rule of thumb, anything on an interpreted JS engine (not Chrome or FF3.5) runs about 1000 times slower than the equivalent C.

The way I'd do it is create a bunch of large tiles (like the size of Google Maps) and pre-draw all the sprites onto a single tile. Put those tiles into a single container div that is bigger than _its_ container, positioned absolutely, and clipped with overflow:hidden. When the world scrolls, simply change the positioning of the container. If it scrolls far enough that you need to render another tile, drop the one off-screen and pre-render its replacement on the other side, so if the user scrolls even more, the images are waiting for them. Much like how G!Maps does it.

This offloads the graphics work onto the C++ rendering engine, which has been tuned for this sort of stuff. Doing it in JS is just asking for trouble.

<comment><USER16> That might only work for the map though. I wouldn't want to have to download a pre-rendered tile every time that I moved a unit. It would make more sense to just pre-render the map tiles, and possibly the city tiles. Then the units would still have to be downloaded to the client and drawn on top of the map.

The same goes for changes that occur to the map (at least changes within the current view). Map tile improvements would be a pain if you had to download a section of the map just to update a single tile. It would probably make sense to have the sprites on-hand to update the currently viewed map section, and have it automatically added to future pre-rendered tile updates. This way you wouldn't have to download the map you already have to see the improvement, but when you downloaded future sections (or even come back to the current section) it will be part of the pre-rendered section.

All of this is disregarding whether or not there is a mode to show the map without improvements on it (IIRC, there was an option like this in Civ2). Then you might have to change these design decisions to accommodate that unless you're ok with the user needed to re-download all map sections whenever that options is flipped on/off.

<comment><USER10> Oh, by pre-rendering, I meant using DHTML, not images. Each tile is a div. On the div, you draw a bunch of absolutely-positioned divs (sprites) with transparent PNGs for backgrounds. The sprites themselves are layered, i.e. you'd draw a bunch of divs with background images for terrain, then you'd draw resources at a higher z-index, then you'd draw cities, then you'd draw units, etc.

The reason for pre-rendering DHTML-based tiles is because a.) you have to worry about download times for the sprite images, though hopefully you can pay this once and have them cached forever and b.) it takes a fair bit of CPU to create lots of DOM elements and move them to the correct positions. Less than blitting an image to canvas, but more than just changing the top and left of a container div.

</comment></comment></comment></comment><comment><USER10> I've put most of my comments as inline responses to other people, but here's one more:

If AJAX is too slow, _do not_ think Comet will solve your problems. It's very hard to get Comet to work reliably on all browsers across all types of firewalls and proxy servers.

I did a prototype of something using the library that powers GTalk, Google Docs, and now Wave. Even with the library all pre-built for me, it was pretty hard to keep it from occasionally dropping connections and associated messages, and once in a while it'd lock up my browser (much like GMail and Docs do, occasionally. ;-)). I also peeked under the covers, and there's a lot of subtlety in what's going on.

Comet is best for when you have stuff that _really_ needs to be real-time. Things like stock quotes, or chat. IIRC, everything in Civilization is done in response to user input. AJAX is fine for that.

</comment><comment> cool-RR What's the reason for not doing it in Flash?

<comment><AUTHOR> I might have to investigate Flash further now. Firstly, at the time I started the project, there was no Flash plug-in available for my OS (64-bit Linux). Secondly, I would have preferred using only open standards for this open source project. Finally, and most imporantly, I didn't know Flash or Actionscript.

<comment> a-priori I recently looked into using Flex to develop a Flash interface, and found it quite simple to get started... just beware of problems with asynchrony (that's what tripped me up the most).

<comment><USER17> > just beware of problems with asynchrony

Please elaborate. (I have also been experimenting with Flex.)

<comment> a-priori Many operations in Flex occur asynchronously, such as when accessing remote services. That is, they spark a remote query, and you must explicitly wait for the response (such as by binding a function to the appropriate change event) before you can continue a computation. Sometimes this occurs when you may not expect it, in which case you'll see problems such as UI controls not being updated, or exceptions from using nil values (because they are used before the response comes back).

When you do expect it, you have three options: 1) you always wait for a response before returning, making your function sychronous (thus maybe killing performance), 2) you pass the responsibility to handle this behaviour to the caller (thus creating an abstraction leak), 3) or you define a custom event that you trigger when the response occurs (best behaviour, but needs extra code).

Certainly not a huge issue once you get the hang of it, but something that can definitely trip you up when you're just learning it.

<comment><USER18> It is very similar to ajax. The problem I have is when a game gets into the 2KLOC territory and above; when you have multiple files loading at different times in the game engine in order to offer the player a better experience. This leads to many, many handlers and a lot of chaining, and your pretty UML will quickly become incredibly hard to see in the program flow.

For instance to save the user you can't just call User.Save and then go about dependent routines, because there is a possibility that call fails or takes a long time and then the player is out of sync. This is especially important if you want to try to minimize cheating, as the longer the client goes without syncing, the higher the probability for tampering, replays, etc.

<comment><USER17> It seems that Flash doesn't even have a "yield" operator. And if you try to busy-wait, the machine grinds to a halt, because Flash events do not preempt code execution.

</comment></comment></comment></comment></comment></comment></comment><comment><USER19> If redraw speed is a problem, perhaps in-browser vector graphics (SVG, VML) would be a better solution than raster (Canvas).

There are probably a few libraries around for this sort of thing, but the one I've had experience with is Raphael: <http://raphaeljs.com/>

It should mean less time redrawing the map because you can just reposition the elements on the screen dynamically.

<comment><USER18> I'm going to go with no. Vector graphics are only feasible as long as the shape bytes it would take to represent an image with nodes is less than using pixels. Because many of the items in his games have gradients, and depth, I think vector art would take a lot more space than simply using pngs. Of course this is only dealing with latency; I'm not quite sure of the vector vs. raster calculation tradeoffs but i can't imagine it being very much in vector's favor with relatively few calculations per frame.

<comment><USER19> Fortunately, SVG and VML don't limit you to just vector graphics. You can render, transform and scale raster graphics within the vector graphics space. The graphic is just like a textured polygon that you can move around.

Consider how 3D engines work, where they compute all the visible surfaces using vectors, and then transform and scale raster "textures" to apply on these surfaces.

The XML issue isn't actually relevant either because normally the SVG/VML DOM objects will be generated at runtime by JavaScript, rather than serialized in the page and served up statically.

<comment><USER18> How do you describe the SVGs (i.e., the sprites) that get sent to the browser?

<comment><USER19> Here's an example of what I mean. It only works in Firefox, unfortunately, but shows the concept of using raster sprites within SVG:

<http://www.mattryall.net/demo/civ-svg/>

SVG is by no means a solid game development platform, but it is some interesting browser-based technology which might be useful for game developers to investigate.

<comment><USER18> Pretty smooth demo :). I see what you mean now, but i was going on the assumption that in a turn based game he wouldn't need to do much transformation, hence, my suggestion to just use pngs and allow the browser to redraw them.

</comment></comment></comment></comment></comment></comment><comment><USER20> You may want to look into how Quake Live is delivered over the web..

<comment><USER21> Quake Live uses a plugin. It doesn't "run in the browser" like one might expect something to "run in a browser."

<comment><USER20> That was part of my point. Instead of trying to do in something that was not meant for it, consider an alternative way.

<comment><USER21> This defeats the purpose of trying to create a web game.

</comment></comment></comment></comment><comment><USER22> I don't understand why he is trying to use canvas, rather than positioning images with HTML and CSS.

I haven't coded something like that myself, but I have been wondering if CSS layers would work nicely for isometric graphics.

I am surprised how many people suggest Flash. Flash needs to die, so it is a worthy goal to try to implement games in Javascript instead. Flash simply is not available anywhere and causes a lot of suffering.

</comment><comment><USER23> Well, with this architecture it'd be a real surprise if it worked. It's a brave attempt, but it was a long shot from the beginning.

I wonder how it would work as a java applet. Might require a jre download, but it should be many orders of magnitude faster then javascript.

<comment><USER18> Well if we're going to bring out the big guns, the plugins, this would be a different situation entirely. Besides, if a user can download a jre, why not just download the whole game in C?

<comment><USER23> I'm not sure you need a jre. If I were to guess I'd say no, but it's been awhile since I played with applets on computers who didn't have it installed.

But web games are better for a host of other reasons:

\- compatibility between os-es

\- compatibility between versions of the same OS (win 95 vs xp) - much greater lifetime

\- no hassle with installs, play instantly and from anywhere

\- easier to multiplay

\- switch from "savegames" to a "profile".

<comment><USER24> _I'm not sure you need a jre._

Eh? How do you run a Java applet on a system without Java (Java Runtime Environment)?

<comment><USER23> You have a default jre installed in the browser for 10 years already. The problem is it's not always the right version or flavor - Microsoft did a lot of nasty stuff in this direction. But this was a long time ago, that's why I said these days you probably don't need a separate download.

<comment><USER25> As an up to date example, I tried a yahoo card game this week-end (<http://games.yahoo.com/card-games>), and I couldn't launch the game in FF without installing the latest JRE plugin. The game in question if you wanna try is "pyramids".

</comment></comment></comment></comment></comment></comment><comment><USER26> Try these options:

1\. Go with SVG and WebSockets.

or

2\. Go with pure HTML,Javascript and CSS with transformations.

I am working right now on a game based on SVG and couldn't be happier. Works flawlessly on FX, WK & OP.

One last advice, drop support for IE and save headaches and wasted resources.</comment>