CSS opacity gradient?

You can do it in CSS, but there isn’t much support in browsers other than modern versions of Chrome, Safari and Opera at the moment. Firefox currently only supports SVG masks. See the Caniuse results for more information. EDIT: all browsers except IE now support all mask- properties mentioned here. CSS: p { color: red; … Read more

Is there a NumPy-like package for Node.js and if not why not? [closed]

No, there are no technical reasons why a numpy-like package does not exist for Node.js and, more generally, JavaScript. There are two main obstacles preventing Node.js and JavaScript from achieving more mind share in the data science and numeric computing communities. The first obstacle is community. While the JavaScript community is huge, the subset of … Read more

Is it possible to write a common function that handles both the copy constructor and copy assignment operator?

Yes. There are two common options. One – which is generally discouraged – is to call the operator= from the copy constructor explicitly: MyClass(const MyClass& other) { operator=(other); } However, providing a good operator= is a challenge when it comes to dealing with the old state and issues arising from self assignment. Also, all members … Read more

How to close a MessageBox after several seconds

Try the following approach: AutoClosingMessageBox.Show(“Text”, “Caption”, 1000); Where the AutoClosingMessageBox class implemented as following: public class AutoClosingMessageBox { System.Threading.Timer _timeoutTimer; string _caption; AutoClosingMessageBox(string text, string caption, int timeout) { _caption = caption; _timeoutTimer = new System.Threading.Timer(OnTimerElapsed, null, timeout, System.Threading.Timeout.Infinite); using(_timeoutTimer) MessageBox.Show(text, caption); } public static void Show(string text, string caption, int timeout) { new AutoClosingMessageBox(text, … Read more

Using or tag twice?

Yes, but with a catch. The W3 documents state that the tags represent the header and footer areas of their nearest ancestor section. I would recommend having as many as your want, but only 1 of each for each “section” of your page, i.e. body, section etc. From W3 A header element is intended to … Read more