trivial

How do I stop a program when an exception is raised in Python ?

I need to stop my program when an exception is raised in Python. How do I implement this? ...

destructors: triviality vs implicit definition

As I understand the standard, a trivial destructor is one which is implicitly declared and whose class has only base and non-static members with trivial destructors. Given the recursivity of this definition, it seems to me that the only "recursion-stopping" condition is to find a base or non-static member with a non-implicitly declared d...

"public static" or "static public"?

A minor point about function declaration keywords in PHP: If you've got a class method that's static, should the static keyword come before or after the visibility keyword (public, protected, private)? Assuming all your methods, static or otherwise, have a visibility keyword, then you'd want the visibility keyword to remain in the same ...

Tweening a value in Lua

How'd I go about this one? I want to tween a value from one to another in x time. While also taking into account that it'd be nice to have an 'ease' at the start and end. I know, I shouldn't ask really, but I've tried myself, and I'm stuck. Please assume that to cause a delay, you need to call function wait(time). ...

Page.UICulture -- How do I retrieve the Two Letter UICulture Code?

In ASP.NET webforms, when setting UICulture="en" in the @Page directive, a Response.Write(Page.UICulture) returns the string "English" instead of the two letter language code "en". Is the the only way to return the two letter language name by using this? CultureInfo.CurrentUICulture.TwoLetterISOLanguageName Or is there a better / mor...

Is the time complexity of the empty algorithm O(0)?

So given the following program: Is the time complexity of this program O(0)? In other words, is 0 O(0)? I thought answering this in a separate question would shed some light on this question. EDIT: Lots of good answers here! We all agree that 0 is O(1). The question is, is 0 O(0) as well? ...

How do I create a component that auto-sizes in the Borderlayout North Position

I want to create a JLabel (containing an image) in the north position of a border layout that auto-sizes to a length matching the preferred width of a component in the center position of a border layout. The only way I can do this at present is to create another panel in the north position and add the label in the center position of thi...

Git merge - trivial merge?

If the base and the source have the same file content, and the destination branch/repo has some other file changes, which content does it keep, the source or the destination file? To explain in detail A | B / \ C D Suppose that a file was added on the A->B edge, and then removed again in B->C, w...

Advantages of an empty class in C++

What could be the possible advantages/uses of having an empty class? P.S: This question might sound trivial to some of you but it is just for learning purpose and has no practical significance. FYI googling didn't help. ...