Bootstrap Grid System new line does not look nice

This is due to varying column height. You need a “clearfix” reset every 3 columns to force even wrapping. One way is to use the approach recommended by Bootstrap, or in this specific case you can use a simple CSS clearfix like this.. @media (min-width:992px) { .auto-clear .col-md-4:nth-child(3n+1){clear:left;} } Demo: http://codeply.com/go/mONLiFj30T For other “clearfix” scenarios … Read more

2D grid data visualization in Python

Matplotlib has the imshow method for plotting arrays: import matplotlib as mpl from matplotlib import pyplot import numpy as np # make values from -5 to 5, for this example zvals = np.random.rand(100,100)*10-5 # make a color map of fixed colors cmap = mpl.colors.ListedColormap([‘blue’,’black’,’red’]) bounds=[-6,-2,2,6] norm = mpl.colors.BoundaryNorm(bounds, cmap.N) # tell imshow about color map … Read more

Firemonkey Grid Control – Styling a Cell based on a value (via the OnGetValue function call)

Firstly, an apology. In my answer to your last question, CreateCellControl should have called inherited to create the cell. I’ve amended my answer. As for this question, I’ve uploaded my blog posting on FireMonkey Cells – http://monkeystyler.com/blog/entry/firemonkey-grid-basics-custom-cells-and-columns – it covers the stuff from the previous answer, and also covers creating custom cell controls. You’ll need … Read more

Creating a draw rectangle (filled with black color) function in Java for a grid

Don’t use paint, use paintComponent and don’t forget to call super.paintComponent JComponent may not be the best choice, JPanel is probably a better choice What’s wrong with Graphics#fillRect(int, int, int, int)? You might to take a look at Performing Custom Painting and 2D Graphics for more details. I’d advice against trying to have a second … Read more

Finding rectangles in a 2d block grid

Call the width and height of the input array W and H respectively. Run this clever O(WH) algorithm for determining the largest rectangle, but instead of tracking just the single largest rectangle, for each (x, y) location record in a W*H matrix the width and height of (one or all of) the largest rectangles whose … Read more

A grid layout of icon/text buttons

Your best bet in my opinion would be to use the gridView that way it supports scrolling and spacing and you can be very dynamic in what each items layout and events are. Another option is to just create a lay out the images with a combination of Relative/Linear Layouts. GridView layout: <GridView xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/myGrid” … Read more

Grid Layout support in android API 10

GridLayout has indeed been backported to be compatible with API level 7 and up. It’s (sort of) part of the support library. After you’ve downloaded the support library, you’ll find an Android library project in your local sdk folder located at: <sdk_folder>\extras\android\compatibility\v7\gridlayout Set it up as dependency of the project you’re working on. After that, … Read more