Questions tagged [regions]

172 questions
10
votes
10 answers

Any .NET '#region directive' convention ideas?

I really appreciate the possibility to define regions in your code, as it improves the readability insanely. Anyways, I'd like to have everyone using the same convention in all classes (with the predefined order of all regions) like: Private…
theSpyCry
  • 12,073
  • 28
  • 96
  • 152
9
votes
4 answers

How to add a class to a Drupal 7 region?

I am trying to add a .clearfix class to my footer region in a Drupal 7. Is there a way to do this? I am currently using the following to print my footer region: Which outputs:
Heinen Creative
  • 93
  • 1
  • 1
  • 3
9
votes
2 answers

Dynamically add regions to Marionette layout

I have a layout, but cannot define all of its regions in advance because they are not known. So later on an ItemView is created and I'd like to create a new region in the layout using the view's ID as the region's name so I can then…
Thalis K.
  • 7,363
  • 6
  • 39
  • 54
9
votes
6 answers

how to organize the code similar to #region/#endregion in .NET?

While the code is growing big it is getting harder and harder to keep everything well organized. One thing I liked very much the time I developed in .NET was #region/#endregion which enabled to organize the code in logical groups and made further…
Niko Gamulin
  • 66,025
  • 95
  • 221
  • 286
8
votes
2 answers

How do I obtain PCI Region size in Windows?

I needed to scan my PCI bus and obtain information for specific devices from specific vendors. My goal is to find the PCI Region size for the AMD Graphics card, in order to map the PCI memory of that card to userspace in order to do i2c transfers…
farmdve
  • 786
  • 3
  • 13
  • 26
7
votes
2 answers

How to write an add-in to change text color in Visual Studio editor?

After searching for a long time for a simple way of changing the text color of a #region directive in Visual Studio, I've concluded there is no easy way of doing so. I know how to change the #region statement color, and how to change the collapsed…
g t
  • 7,287
  • 7
  • 50
  • 85
7
votes
5 answers

Automatically open regions in Visual Studio 2010

I'd like the regions that show up in my Visual Studio window to be expanded by default when I open a code file. Is this possible in VS2010, or is there an extension that will do that for me? Barring that, is my request a thing that can be written…
thepaulpage
  • 4,614
  • 2
  • 25
  • 39
7
votes
4 answers

Detecting clusters of white pixels in an image using openCV

Input Image: Expected Output: I intend to fit three (or some number of) polygons (for this case, rectangles) to signify the "big" white blobs in this image. The rectangles drawn in the output image are as per my perception of the white regions. I…
The mach
  • 101
  • 1
  • 1
  • 3
6
votes
2 answers

Deploying AWS Lambda to multiple regions?

Quick one. What does it look like when you’ve got one lambda deployed in multiple regions? Is it just 2 separate copies of the same code with a different name, different ARN etc? does AWS view them as unrelated lambdas? Or does it know they’re the…
user1974753
  • 1,359
  • 1
  • 18
  • 32
6
votes
4 answers

What is the difference between register a region to adding a region in prism?

I want to create a region with dynamic views(multiple views in one region). The region content need to be changed by ComboBox selection event(the comobox items are view instances). I want that a change in the ComboBox will change the view in the…
user436862
  • 867
  • 2
  • 15
  • 32
6
votes
2 answers

How to get regionservers' startcode in a HBase cluster?

my HBase cluster's load unbalanced, so i want to move some regions of table from one regionsserver to other, but it seems that a startcode of a regionserver is needed to do this,how can i get this startcode? i noticed that someone's master-status…
imsrch
  • 1,152
  • 2
  • 11
  • 24
6
votes
6 answers

Would you use regions within long switch/enum declarations?

I've recently found myself needing (yes, needing) to define absurdly long switch statements and enum declarations in C# code, but I'm wondering what people feel is the best way to split them into logical subsections. In my situation, both the enum…
Noldorin
  • 144,213
  • 56
  • 264
  • 302
5
votes
4 answers

PRISM 4 - RegisterViewWithRegion & Custom Export Attributes

I am using Prism 4 with MEF Extensions and the MVVM pattern. During initialization in a module I call RegisterViewWithRegion(RegionNames.MyRegion, typeof(MyView)) which works perfectly when the view is constructed like…
okieh
  • 617
  • 6
  • 17
5
votes
1 answer

SQL: list of points to rectangle

I have two tables: regions points Assuming there are exactly 4 points per region, and these points describe a rectangle -- is there an SQL query that will bring me this view: rectangular_regions ?
noamtm
  • 12,435
  • 15
  • 71
  • 107
5
votes
5 answers

is it OK to use begin/end in Ruby the way I would use #region in C#?

I've recently moved from C# to Ruby, and I find myself missing the ability to make collapsible, labelled regions of code. It just occurred to me that it ought to be OK to do this sort of thing: class Example begin # a group of methods def…
Simon
  • 25,468
  • 44
  • 152
  • 266
1
2
3
11 12