Skip to main content
Filter by
Sorted by
Tagged with
5 votes
3 answers
768 views

Suppose a class exists as follows: class Foo { void do_after_something() { //some code here return; } void do_something() { //some code here return ...
Anirban Sarkar's user avatar
-2 votes
4 answers
196 views

Sometime when we declare and initialize a variable, say we have an int i =10; then after some code this variable would be modified like this code bellow public class reset { public static void ...
Curcuma_'s user avatar
  • 901
2 votes
4 answers
2k views

I am very new to using cucumber (started today). It seems simple enough but I am having issues running a basic feature. Feature: Proof of concept that my framework works Scenario: My first test ...
dhali's user avatar
  • 386
26 votes
3 answers
27k views

The Null propagating operator / Conditional access expression coming in c#-6.0 looks like quite a handy feature. But I'm curious if it will help solve the problem of checking if a child member is not ...
Philip Pittle's user avatar
3 votes
1 answer
2k views

I was trying to figure out how to implement a Visitor pattern in Hack. It obviously requires function-overloading polymorhism, but as I have tested, this examle: <?hh // strict class Visitor { ...
Maciej Sz's user avatar
  • 12.1k
0 votes
2 answers
151 views

Yep. This happend. When I absent mindedly put an index on a in variable. Explain (it?) away. What is happening in the general case and what are it's use cases? >>> [q for q[0] in [range(10),...
freegnu's user avatar
  • 813
0 votes
2 answers
261 views

This is actually a semi-question, semi-discussion thread. I think a feature is needed in Java that a method(lets say "calcTotalX") can be defined via annotation in a class(i.e. ParallelExecuter) ...
bahadir_g's user avatar
  • 343
2 votes
1 answer
847 views

In PHP 5.4, I believe something like this is valid: echo ( new DateTime( '2014-04-05 10:36am' ))->format( 'Y-m-d g:ia' ); On PHP 5.3, I currently do something like this: $date = new DateTime( '...
Nick Coons's user avatar
  • 3,692
1 vote
2 answers
71 views

I'm looking for more information about the PHP feature that looks like: $obj->{$prop}; $obj->{$method}(); What is it called? Is it documented? Where? Edit: To clarify - I'm asking about the ...
Stephen Searles's user avatar
0 votes
1 answer
77 views

So, I am writing a Befunge Interpreter in Java. I have almost all of it down, except I can't figure out a good solution to the problem of Funge Space. Currently I'm using the style stated in the ...
Kyranstar's user avatar
  • 1,720
0 votes
1 answer
356 views

Why can constexpr not apply to constructors? The following code cannot be compiled with VC++ 2013 CTP. struct A { constexpr A() : _n(5) {} int _n; }; constexpr A f() { ...
xmllmx's user avatar
  • 44.6k
11 votes
3 answers
958 views

Move semantics replace copy semantics in situations where copying is inefficient. Copy semantics deals fully with copyable objects, including const objects. Already, there exists a myriad of non-...
user3125280's user avatar
  • 2,849
3 votes
4 answers
684 views

If I understand correctly, the motivation of references was to make it easier and cleaner to work "by reference" without having to bother with pointer dereferencing. But they are constant in nature, ...
user avatar
0 votes
1 answer
662 views

i want to make an application that contains collection of text but in URDU language, i'm confused how to implement it . I've read many posts regarding this but couldn't come to a relevant answer. ...
nickAtStack's user avatar
0 votes
1 answer
883 views

Are async/await keywords only usable with VS 2012+ and not usable with the C# compiler, which I could use from command line? I've read some questions at SO, like: Will VS 2010 allow me to use the ...
user avatar
7 votes
2 answers
2k views

While playing around with the Java font class and Swing, I set the font size to a negative value. I discovered that this makes the text be drawn upside down. Is this a bug or a feature? Can anyone ...
James Williams's user avatar
6 votes
1 answer
726 views

As far as i know and understand, Reflection is the ability to create/modify source code at run time. From Wikipedia: Discover and modify source code constructions (such as code blocks, classes, ...
gran33's user avatar
  • 13k
2 votes
3 answers
267 views

There's a certain over-verbosity that I have to engage in when writing certain Boolean expressions, at least with all the languages I've used, and I was wondering if there were any languages that let ...
j.i.h.'s user avatar
  • 827
0 votes
3 answers
1k views

As the problem stated, this is doable: #include <iostream> int main(int argc, char *argv[]) { unsigned short int i; std::cin >> i; unsigned long long int k[i][i]; } Here I ...
Shane Hsu's user avatar
  • 8,417
3 votes
3 answers
846 views

It is possible to return from/exit the caller function i JavaScript? We are adding testing methods to our framework and we want to exit if we have an error on an Assertion. Given the following ...
Jonas Söderström's user avatar
5 votes
2 answers
368 views

In matlab, if you have a matrix A you can find the matrix B containing all of the unique rows of A as follows: B = unique(A,'rows'); What I have is a 3d matrix, with rows and columns as the first two ...
Cam's user avatar
  • 15.3k
1 vote
2 answers
164 views

I'm not sure if the output of this code is correct or a bug: class F: """An abstract class""" list_of_secrets = [] def __init__(self): pass def getSecret(self): return self....
user1234299's user avatar
  • 1,187
4 votes
3 answers
74 views

In Ruby, a set can be initialized by Set[1,2,3] So can an array: Array[1,2,3] Is it possible to write some code to do the same thing to my own classes? Or it's just a language feature for only a few ...
Chris Xue's user avatar
  • 2,567
4 votes
3 answers
379 views

In Nullable micro-optimizations, part one, Eric mentions that Nullable<T> has a strange boxing behaviour that could not be achieved by a similar user-defined type. What are the special features ...
Eldritch Conundrum's user avatar
2 votes
5 answers
164 views

Does C# have a similar operation to JavaScript's || setter? For example, in JavaScript, if I want to check if a value is null and set a default, I can do something like this: function foo(val){ ...
elucid8's user avatar
  • 1,432

1 2
3
4 5
13