Hacker News new | past | comments | ask | show | jobs | submit | more badhairday's comments login

As one of the Amazon reviewers states, "sockets receive a scant five pages." Does anyone know of an education resource like this that does cover some real world socket programming examples in C (or C++)? This would help me immensely in an upcoming project.


Stevens's Unix Network Programming is the classic. Any edition will do -- quite frankly the first is clearest. He gets coverage-happy (STREAMS, seriously?) in the 2nd and the 3rd (completed by another author after Stevens's death) is just plain too big.


No, really. Whatever else you refer to, make sure you include Stevens' UNP. (edit: agree also, 1st edition is the best by far)


Beej's networking guide is pretty good

http://beej.us/guide/bgnet/


After reading the Beej's guide to networking programming [1], I wondered what could be the simplest approach to making a multiclient socket server using unix pthreads/mutexes. I ended up writing [2] (C++), mostly as an exercise. Although I have never tested it properly nor I consider myself to be a great programmer, it seems to work. Not something to learn from, though. Anyway, any feedback is really appreciated.

[1] http://beej.us/guide/bgnet/

[2] https://github.com/raaapha/multichat


I found that opening a socket and using select is pretty straightforward. When I write an app, the head-scratching is generally over how to build an event-loop to juggle all the stuff I have going on. Most of the time when I write a tool it will need to do this, but I haven't seen any good books that cover it.

Are there any book recommendations about taking the next step? i.e. Structuring your application so you do regular reads and writes, sleep at sensible times so you aren't sledging the host, useful message-passing patterns. That talk about the tradeoffs, and optimisations, whether you should be doing one select per loop, or trying to do a greedy read on each pass, possibly even running select a few times in order to get that data in.

Stevens volume I seems like it would have been a good place for this, maybe it's out of scope. It focuses on ways you can use the unix API, but avoids straying into application design issues.


The Linux Programming Interface by Kerrisk has pretty thorough coverage of sockets (and everything else).

http://www.amazon.com/The-Linux-Programming-Interface-Handbo...


I prefer to use libevent, it is more tested and proven than i could make.


...or if they were made in Jersey.


"Difficult documentation, impossible for me to figure out how to do anything gui-related."

Why is this? Do you have much experience programming in Java? The Android Developer [1] website is a fantastic resource for learning about both the design and development standards on the platform. The User Interface Guide [2] is particularly exceptional at explaining how to implement different UI components on a technical level.

[1] http://developer.android.com/ [2] http://developer.android.com/guide/topics/ui/overview.html


Haha, fair question.

I'm really really proficient in Java. I used to teach it in school, I've done it professionally, etc. So I had no trouble at all writing the actual "guts" of the app, or even the android-specific APIs. And while I'm not great at swing/awt, I can make it work if I need to.

But it really breaks down when I get to the Android gui+os-specific things. I find myself having to memorize (and reference, and re-reference) words like Activity, Intent, Bundle, View, etc. You have many kinds of menus and dialogs - options menus, preferences menus, etc.

Of course, all of the information is there, and perhaps it's worth reading all of it, one page at a time, in order become a proficient android programmer. But it's so specific to that one platform, and has has such a new set of vocabulary which isn't common anywhere else in computing, that I personally have found it really difficult.

It looks like the documentation has gotten much, much better over the past couple of years, so maybe you've inspired me to give it a fair shake. But I really wanted to "jump in and build" and that has a much larger learning curve than I would have liked.


The interactive review was fun and caught my attention. The book has been purchased.


Paywall. :(


Protip: many paywalls, including this one can be circumvented by using Google's URL redirection service: http://www.google.com/url?q=http://online.wsj.com/article/SB...

Simply use 'www.google.com/url?q=' and paste in the address of the article which has a paywall.


That's awesome, thanks .. how does it work? I mean why does it allow google to bypass their paywall.


Because google does not like to index pay-walled articles. They are either not indexed at all, or given a low score. This makes complete sense because Google wants their users to be happy and users are usually not very happy when they hit a pay-wall.

Online publications, on the other hand, really want their paywalled articles to be indexed by Google. You may remember Murdoch did a lot of complaining about this a couple of years ago. So now publications do a little trick where they make the whole article available to people coming from Google but offer a paywall to anyone else. This means that you can usually access the entire article if you are redirected from google.


Interesting, thanks. It seems counter-intuitive that they would allow all users from google to see the full article, since that's where you'd imagine a lot of traffic would come from.


So that google doesn't knock them down in ratings or outright delist them.


cool, just turned it into a bookmarklet http://paywall-killer.blogspot.com/


I posted the same article a few minutes earlier using the Google cache link: http://news.ycombinator.com/item?id=4159481


As much as I dislike being asked to pay up to access WSJ content, I am consistently surprised that the paper has managed to retain its readership even in these increasingly hard times for publishing in general. At one point you got access to Barron's free with a WSJ signup. I guess they figured they didn't need to sweeten the deal anymore. I still remember, several years ago, when NYT declared it had hit its target paywall numbers to sustain operations and announced it didn't see a need to continue with the paywall model only to later fumble (and decide on the 10 articles cap). Buffet has recently bought some 63 newspapers. He suggested that the dominant model of free access is unsustainable.


The article is actually this long --

BY DANA MATTIOLI

Orbitz Worldwide Inc. has found that people who use Apple Inc.'s Mac computers spend as much as 30% more a night on hotels, so the online travel agency is starting to show them different, and sometimes costlier, travel options than Windows visitors see.

The Orbitz effort, which is in its early stages, demonstrates how tracking people's online activities can use even seemingly innocuous information—in this case, the fact that customers are visiting Orbitz.com from a Mac—to start predicting their tastes and spending habits.

Orbitz executives confirmed that the company is experimenting with showing different hotel offers to Mac and PC ...


If you're running AdBlock you won't see the "click here to subscribe now!" pitch.

The ellipses isn't the end of the article!


Maybe paywall sites should be banned from HN.


Maybe best just to clearly disclose it somehow. I know it's not apples with apples, but should we ban patio11's potential $5 comprehensive ebook because it's not free or behind an email registration? Or (apples with a non-fruit) 'Show HN' efforts that are paid services?


Actual article text:

Orbitz found Mac users on average spend $20 to $30 more a night on hotels than their PC counterparts. The Orbitz effort, which is in its early stages, demonstrates how tracking people's online activities can use even seemingly innocuous information—in this case, the fact that customers are visiting Orbitz.com from a Mac—to start predicting their tastes and spending habits. Orbitz executives confirmed that the company is experimenting with showing different hotel offers to Mac and PC visitors, but said the company isn't showing the same room to different users at different prices. They also pointed out that users can opt to rank results by price. Journal Community

Orbitz found Mac users on average spend $20 to $30 more a night on hotels than their PC counterparts, a significant margin given the site's average nightly hotel booking is around $100, chief scientist Wai Gen Yee said. Mac users are 40% more likely to book a four- or five-star hotel than PC users, Mr. Yee said, and when Mac and PC users book the same hotel, Mac users tend to stay in more expensive rooms. "We had the intuition, and we were able to confirm it based on the data," Orbitz Chief Technology Officer Roger Liew said. The sort of targeting undertaken by Orbitz is likely to become more commonplace as online retailers scramble to identify new ways in which people's browsing data can be used to boost online sales. Orbitz lost $37 million in 2011 and its stock has fallen by more than 74% since its 2007 IPO. The effort underscores how retailers are becoming bigger users of so-called predictive analytics, crunching reams of data to guess the future shopping habits of customers. The goal is to tailor offerings to people believed to have the highest "lifetime value" to the retailer. Orbitz first confirmed Mac users' preferences in October and began working them into the complicated mix of factors that determine its search results. The effect isn't always obvious. In tests performed by The Wall Street Journal, search results for hotels in cities including Las Vegas, Orlando, Philadelphia and Boston were the same for both Macs and PCs. A New York search turned up more expensive hotels for Mac users, but only after the first 20 listed. Mac vs. PC

Top hotels measured by booked-room nights by Mac and non-Mac users in selected cities in May: Mac users Las Vegas -- Excalibur Hotel & Casino New York -- Park Central New York Los Angeles -- Hollywood Roosevelt Hotel Miami -- Hyatt Regency Miami Chicago -- Congress Plaza Hotel Non-Mac users Las Vegas -- Stratosphere New York -- Park Central New York Los Angeles -- The Wilshire Hotel Miami -- Miami Beach Resort Chicago -- The Whitehall Hotel Source: Orbitz Other searches showed more significant differences. A Mac search for a hotel in Miami Beach for two nights in July displayed costlier boutique hotels on the first page of results, such as Sagamore, the Art Hotel and the Boulan South Beach, that weren't displayed on the PC's first page. Among hotels appearing in both searches, some pricier options (such as the $212 Eden Roc Renaissance and the $397 Fontainebleau) were listed higher on the Mac. Overall, hotels on the first page of the Mac search were about 11% more expensive than they were on the PC. Similarly, hotels on the first page of results for Baton Rouge, La., appeared in different order for Mac and PC and were 13% more expensive in aggregate for the Mac search. Rival travel sites Expedia Inc., EXPE -3.71% Priceline.com Inc. PCLN -2.30% and Travelocity, which is a unit of Sabre Holdings Corp., don't use a person's computer operating system when suggesting hotels, spokesmen said. Apple declined to comment. Neil Sazant, president of Sagamore, reacted with a mix of admiration and concern to the algorithm. "That's incredible, but I wouldn't want to miss out on PC users," he said. Mr. Sazant says about 15% of rooms at the 93-room hotel are booked through a mix of online sites like Orbitz and that appearing on the first page of results is important in those searches. Orbitz's chief executive, Barney Harford, has made data mining a priority. Shortly after joining the company in 2009, the former Expedia executive opened a small office in Sunnyvale, Calif., and recruited statisticians with backgrounds from eBay Inc. EBAY -2.32% and Google Inc. GOOG -1.89% for a new analytics team. Digging into the data, the team found some hotels were far more likely to be booked by Mac users. Nearly half of bookings on Orbitz for the Public Chicago—a high-end Chicago hotel that boasts features such as "lobby socializing"—come from Mac visitors, said Mr. Liew of Orbitz.


I wish Philadelphia provided easy access to real-time transit information. I think the city is finally starting to release that information publicly via APIs. Hopefully we'll have something soon.


"Developers will need some theory, and I'm painfully aware, too, of the degree snobbery that most employers harbour. So I propose that the right course would be a 5+ year apprenticeship with part-time degree study - CS in the classroom 1 day a week, software development in the office the other 4."

I disagree with this statement. My program at school supplements 6 months of formal learning with 6 month long internships. I don't feel like 4 days a week is enough to get the benefits of working to supplements formal learning. I defiantly need 6 months in a job to learn something valuable, and towards the end of my internships is where I feel like I've learned enough to contribute just as much as any of my teammates and coworkers can.


As per footnote #2, the text on the Kindle application is not rendered by iOS and, as a result, the text is not rendered at a retina resolution for free.


damn I was actually thinking about how awesome the Kindle app would look on PDFs, do you know if Adobe Reader or any other PDF reader will use the new retina resolution right off the bat?


iBooks has already been updated and supports PDFs.


I love Com Truise. Ether Drift is definitely one of their best songs: http://open.spotify.com/track/2Z6CFvujnkDyPgsNn7zBAh


They still do and I actually prefer doing this instead of using a service like Skimling. I try to write for the professor that is grading my paper, some of them have different styles they prefer. Writing to their style usually ensures a good grade, especially if you ask them for feedback and adjust your work accordingly.


Consider applying for YC's Summer 2025 batch! Applications are open till May 13

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

Search: