What I want is: obj = Foo.new(0) # => nil or false This doesn't work: class Foo def initialize(val) return nil if val == 0 end end I know in C/C++/Java/C#, we cant return a value in a constructor. But I'm wondering whether it is possible in Ruby.In R
Array doesn't have sort_by; Enumerable has it. How does this work? %w[aa aaaa aaa].sort_by{|item| item.length} #=> ['aa','aaa','aaaa'] Doesn't this have to throw an error like undefined method sort_by? What is the relationship between Array and Enume
What is the relationship between OpenLdap and Novel eDirectory?Novell implemented an X.500'ish complaint directory, called NDS (Novell Directory Services) years ago in Netware 4.0 (early 1990's). They have upgraded it over time, and added an LDAP lay
I am getting confused as asynchronous programming is a way to execute a block of code asynchronously, that calls a method and doesn't wait for the result. In the same way, parallel programming is a way to execute more than one task simultaneously, bu
I can access my company Stash project repositories. I cloned the project into my local Git repository through Eclipse IDE. For that, I installed required Git plugins into Eclipse. My questions are: Git is just a facilitator to communicate with Stash?
My background is C++ and I'm currently about to start developing in C# so am doing some research. However, in the process I came across something that raised a question about C++. This C# for C++ developers guide says that In C++ an array is merely a
I'm writing an implementation for OpenVG and OpenGL|ES in Go, both of which depend on the Khronos EGL API, supposedly to ease portability I guess. I'm writing an implementation of OpenVG on top of OpenGL ES for fun and educational reasons - I haven't
If I just want to calculate a standard normal variable is there any difference between using: samples=norminv(rand(N),0,1); and samples=normrnd(0,1,N,1); Either in terms of processing time or convergence when used in a Monte Carlo simulation? The rea
What is the relation between these two? Is there a way to deduce one from another? The context: Why it's possible to search only for "Tweet"s and listen only to a stream of "Status"es?The are notionally the same thing. I am not sure wh
I'm a C# developer, and I'm trying to grasp what's the role of WinAPI on Windows development. My perception is that it is the sole exposition of the kernel itself, and that, before .NET, it was also the "Windows development" itself (not counting
I looked at some other questions on SO and its not clear if c is built on top of, under, or alongside the WINAPI. Like for example could someone write something in pure c that was able to open a window, or would they need to use the windows api? I no
I see that there are many systems out there for requirements to test cases traceability and I started to ask myself what the relationship is between these two artefacts. For example, why have the notion of test cases as opposed to just calling them d
My scroll has some views that is cornerRadius = 10.0 and masksToBounds = YES. This causes a performance issue for scrolling my scroll view. Though I tried each view's shouldRasterize is set YES, the issue is not solved. However, I know the solution f
I'm starting Calculus this semester. I've used programming (or scripting) languages before, mostly PHP and C#. I haven't done much low-level work. The only relationships I've made between the syntaxes are Anonymous functions with Y-Combinators and Ar