|
When we think of the comma character we often think of it as a separator. It separates values in an CSV file, it separates items in lists, it may separate index values in multidimensional arrays (in other languages) and more. But in C++ an obscure way of using them was as an operator. The reason it never made it big as an operator and into the typical programming psyche is that largely it is seen as useless or some kind of "syntactic sugar". So in this article we try to show how it works, why it has a stigma and some possible uses for it that may prove useful at some point in your career going forward. Eats(), Shoots() and Leaves();
|
|
|
|
|
Why does he keep saying C++, it's a C thing. And C# doesn't have it.
I think the only times I've use the comma operator is in for loops:
for ( i = 3 , j = 5 ; ... ; ... ) ...
for ( ... ; i = GetSomething() , j < k ; ... ) ...
for ( ... ; ... ; i++ , j++ ) ...
|
|
|
|
|
That's not what they are getting at. In C++ it's an operator proper and can be overloaded.
Steve
modified 14-Feb-13 7:34am.
|
|
|
|
|
In C++, ypu* can overload it, allowing e.g.
EnableDlgItems(hwnd, false), IDC_FOO, IDC_BAR, IDC_BAZ;
*) also, you.
|
|
|
|
|
Kind of misses the best bits sadly. The comma operator can be used to explicitly control order of operation, i.e. prevent the compiler from reordering things that aren't directly related but have a hidden ordering dependency. Using the comma operator this way is the solution to Alexander Andrescu's pure C++ portable mutex implementation problem. I must write this up with a test case at some point, busy, busy, busy
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
In today’s web applications, dialog boxes are about as common place as they are in desktop applications. It’s pretty easy to show or hide an element that is overlayed on the page using a little JavaScript and CSS but few take into account how this affects accessibility. In most cases, it’s an accessibility disaster. The input focus isn’t handled correctly and screen readers aren’t able to tell that something is changed. In reality, it’s not all that difficult to make a dialog that’s fully accessible, you just need to understand the importance of a few lines of code. An ARIA in the key of accessibility.
|
|
|
|
|
The concept of a ‘web page’ is quickly becoming meaningless. I believe there’s a new way to look at the Web and the browser, and synthesizing it with old technologies could result in a novel technique for Web development and content editing. The browser as a VM + live-editing and persistence.
|
|
|
|
|
The Data Science Toolkit is a collection of the best open data sets and open-source tools for data science, wrapped in an easy-to-use REST/JSON API with command line, Python and Javascript interfaces. Available as a self-contained Vagrant VM or EC2 AMI that you can deploy yourself. The Data Science Toolkit is essentially a specialized Linux distribution, with a lot of useful data software pre-installed and exposing a simple interface. Big data? There's an app (bundle) for that.
|
|
|
|
|
Video games appeal to our desire to explore and interact with our environment, and adding real-world phenomena-such as fluid motion-allows game developers to create immersive and fun virtual worlds. Recently, physical simulations have become more realistic, but the simulations have largely been limited to rigid bodies. Pervasive simulations of continuous media like cloth and fluids remain uncommon, largely because fluid dynamics entail conceptual and computational challenges that make simulating fluids difficult. This article begins a series that explains fluid dynamics and its simulation techniques. The series culminates in an example of a fluid simulation algorithm suitable for use in a video game. Grab a drink and start reading this 15-part series on simulated fluid dynamics.
|
|
|
|
|
I expect by now you’ve heard that Opera (my employer for the last four and half years) has announced that its browsers will, in future, use the WebKit rendering engine. I wrote the announcement, and what follows here is my personal take on it. It’s on my personal blog precisely because it does not reflect the opinion of my employer, wife, kids or hamster. Opera’s Presto engine was a means to an end; a means for a small, European browser company to challenge the dominance of companies who, at that time, hoped to “win” the web through embracing, extending and extinguishing web standards. Presto showed that it was possible to make a better browser while supporting standards. Other vendors have followed this path; the world has changed... Opera drops Presto and embraces WebKit. Bruce explains why.
|
|
|
|
|
xBox’s primary critical problem is the lack of a functional and growing platform ecosystem for small developers to sell digitally-/network-distributed (non-disc) content through to the installed base of xBox customers, period. Why can’t I write a game for xBox tomorrow using $100 worth of tools and my existing Windows laptop and test it on my home xBox or at my friends’ houses? Why can’t I then distribute it digitally in a decent online store, give up a 30% cut and strike it rich if it’s a great game, like I can for Android, for iPhone, or for iPad? Oh, wait, I can… sort of. Must-read insights from a founder of the original xBox project.
|
|
|
|
|
That rant is so full of win! Please find one for the PS3; it is an order of magnitude more crappy than the XBox 360. Like the time I bought a few games, then started downloading one, then clicked "download all", which repeated the download of the game I had previously already started downloading. I had to fiddle with it for like half an hour before I got the game working.
|
|
|
|
|
In a breakthrough experiment, the Interactive Robotics Group at MIT discovered that cross-training, which is swapping jobs with someone else on your team to help everyone understand the work better, works even when your coworker doesn't have a mind. In short, when humans and robots model doing each others' job they end up working together more smoothly. It's in your nature to train the machines that will replace yourselves.
|
|
|
|
|
Smartphones are still (relatively) expensive and primarily interesting to the developed world. But over the next 10 years, this too will change. As Moore’s Law rolls on, the cost of a low-end smartphone will decline. At some point, the incremental cost will be quite minimal and many feature phones of today will be supplanted by smartphones.... In this grand progression, 2013 will certainly be a significant milestone for mobile devices, smartphones and beyond. It's likely to be the first year in which tablets out-ship notebooks in the US. And in the coming years, this will lead to a confluence of high-end tablets and ultra-mobile notebooks as the world figures out how these devices co-exist, blend, hybridize, and/or merge. Tablets versus Smartphones, Intel versus ARM.
|
|
|
|
|
It's a laptop! It's a tablet! It's a lablet! It's…it's…Microsoft's Surface Windows 8 Pro, and it's about to go down on the teardown table. Intel inside... but what else?
|
|
|
|
|
Microsoft SharePoint 2013 builds upon previous releases in 2007 and 2010 to better support big data, mobile users and public-facing websites. However, choosing between server- or cloud-based versions of SharePoint 2013 may frustrate IT executives. Here are five highlights and two concerns of the Microsoft's latest SharePoint iteration.
7 Things About SharePoint 2013 All IT Pros Should Know[^]
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.
|
|
|
|
|
Whether you're starting out and want to get a first taste of programming, looking to connect with other women in science and technology, or want to be inspired by the amazing work being done by women, check out these resources. Know of something we've overlooked? Post a message in the comments and let us know.
|
|
|
|
|
If you like choices, you've come at the right time. You might think the decision making process starts by choosing between ASP.NET Web Forms and ASP.NET MVC, but if you widen your perspective a bit you'll find there are even more options outside the confines of the File –> New Project dialog in Visual Studio. And, these choices have steadily increased and matured over the last few years. Here are just a few of the other options for writing a web app today... What's your favorite web app framework today?
|
|
|
|
|
Terrence Dorsey wrote: What's your favorite web app framework today?
HTML.
=====
\ | /
\|/
|
|-----|
| |
|_ |
_) | /
_) __/_
_) ____
| /|
| / |
| |
|-----|
|
=====
===
=
|
|
|
|
|
Spider-Man. A web slinger who can see sharp.
|
|
|
|
|
Beyond a doubt, ServiceStack
|
|
|
|
|
Xcode 4.6 was released on January 28th, the same day that iOS 6.1 was released. It adds support for iOS 6.1 and Mac OS X 10.8, and two new devices, the iPad mini and the 4th-gen iPad with Retina display. There are also a number of improvements to the LLVM compiler and Objective-C language, including some new warnings to help find subtle bugs when using ARC and weak references. An NSString by any other name would... well, just not work.
|
|
|
|
|
The big news for MySQL 5.6 was the inclusion of “NoSQL” features in the form of a memcached api for get and put operations. In cases like this, it’s tough to tell whether Oracle got this so wrong deliberately to sow confusion in the market, or because they really think that’s what NoSQL is about. The query language is thus the least important aspect of NoSQL, but that’s what Oracle focuses on.
|
|
|
|
|
These kinds of situations result from stupidity instead of malice in nearly every case.
Now that everyone is laughing at the new MySQL features, whoever made that decision knows they did the wrong thing.
|
|
|
|
|
The Python community in my mind has the dangerous opinion that classes are unnecessary fluff that should be replaced with functions wherever possible. The fact that there is a talk of the title “Stop Writing Classes” with 50.000 views on YouTube is not helping. I want to give a counter argument to this idea that classes are evil by sharing some examples of why I think we can't have enough classes. "C is good for you" and other pithy aphorisms most Python coders would rather not hear.
|
|
|
|