Top "Block" questions

DO NOT USE This tag is scheduled for removal because it can refer to many different things depending on the use of other tags with it.

How to detect users with Adblock and redirect javascript

I have been searching things about how to detect an ad-block and I found some things but none of them …

javascript redirect web block adblock
Ruby block taking array or multiple parameters

Today I was surprised to find ruby automatically find the values of an array given as a block parameter. For …

ruby block enumerable
How do I create an objective-c method that return a block

-(NSMutableArray *)sortArrayByProminent:(NSArray *)arrayObject { NSArray * array = [arrayObject sortedArrayUsingComparator:^(id obj1, id obj2) { Business * objj1=obj1; Business * objj2=obj2; NSUInteger …

objective-c block objective-c-blocks
Block scope in ruby

My understanding was that ruby blocks have block scope, and all variables created inside block will live only within the …

ruby scope variable-assignment block
Can someone explain Ruby's use of pipe characters in a block?

Can someone explain to me Ruby's use of pipe characters in a block? I understand that it contains a variable …

ruby pipe block
What do "chunk", "block", "offset", "buffer", and "sector" mean?

I have seen some of the scripts which are either dealing with archive or binary data or copy files (not …

python buffer block chunks sector
Create clusters using correlation matrix in Python

all, I have a correlation matrix of 21 industry sectors. Now I want to split these 21 sectors into 4 or 5 groups, with …

python matrix block correlation
Changing working directory in matlab to current script dir with running blocks

Is there a way to change the current working directory to current script directory with running code just inside one …

matlab block working-directory
How to store ruby code blocks

I want to store a "code block" in a variable to be reused, something like: block = do |test| puts test …

ruby block proc
Return statements inside procs, lambdas, and blocks

I am having a lot of trouble understanding how return works in blocks, procs, and lambdas. For instance, in the …

ruby lambda return block proc