alignment

Vertically align div (no tables)

I can horizontally align a div and all the content looks nice. Looking to vertical align a div that does not contain any tables. I tried setting margin positions to some negative values inside of the #container but that sort of worked. I know CSS isn't supporting this yet? Here is my markup: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0...

Centering Text within a Multirow Cell in LaTex

This is probably best explained with an example. I have the following table, where the "A" cell spans two rows, and the "B" cell spans two columns. \begin{table}[htdp] \begin{tabular}{l|r|r} \multirow{2}{*}{A} & \multicolumn{2}{c}{B} \\ & B1 & B2 \\ a & b1 & b2 \\ a & b1 & b2 \\ \end{tabular} \end{table} _ _ _ _ _ _ _ _ _ _ _ _ |A ...

C Function alignment in GCC

I am trying to byte-align a function to 16-byte boundary using the 'aligned(16)' attribute. I did the following: void __attribute__((aligned(16))) function() { } (Source: http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html) But when I compile (gcc foo.c ; no makefiles or linker scripts used), I get the following error: FOO...

How to allocate and free aligned memory in C

How do you allocate memory that's aligned to a specific boundary in C (e.g., cache line boundary)? I'm looking for malloc/free like implementation that ideally would be as portable as possible --- at least between 32 and 64 bit architectures. Edit to add: In other words, I'm looking for something that would behave like (the now obsolet...

What alignment guarantees can I expect for arrays in a struct?

Hi all, I've got a lightweight templated class that contains a couple of member objects that are very rarely used, and so I'd like to avoid calling their constructors and destructors except in the rare cases when I actually use them. To do that, I "declare" them in my class like this: template <class K, class V> class MyClass { publi...

Problem with TabControl alignment in VB.NET

Hi there, I'm having a weird behaviour with a left-aligned TabControl in VB.NET. Screenshot: What I wanted was to have the tabs literally the same way they would be if rotated 90 degrees to the left. Does it have something to do with the fact I'm not (god forbid) using the standard XP theme? Any solution to just make it work? (Even...

word alignment of 4 byte for XOR operations

Is there any advantage in doing bitwise operations on word boundaries? Any CPU or memory optimization in doing so? Actual problem: I am trying to create XOR of two structure. Lets say structure-1 and structure-2 both of same size 10000 bytes. I leave first few hundreds bytes as it is and then start XOR of 1 and 2. Lets say I start with...

iPhone: Some Views Landscape others Portrait

Hey there, I've got a tabbar setup with a few tabs. The first tabitem is viewcontroller that programmatically loads a xib that is laid out in portrait. When the user rotates the phone, it automatically presents a modal view that is laid out in landscape. This mechanism works fine. When the device is rotated to portrait mode, it dism...

c++ tool for visualising memory alignment?

Hi! Is there a tool, maybe a plugin for visual Studio or so, that visualizes for me the memoryalignment of my classes and structs? thx! ...

why is data structure alignment important for performance?

Can someone give me a short and plausible explanation for why the compiler adds padding to data structures in order to align it's members? I know that it's done so that the CPU can access the data more efficiently, but i don't understand why this is so. And if this is only CPU related, why is a double 4 byte aligned in Linux and 8 byte ...

c++ data alignment /member order & inheritance

hi! how do datamembers get aligned / ordered if inheritance / multiple inheritance is used? Is this compilerspecific? is there a way to specify in a derived class how the members (including the members from the baseclass) shall be ordered / aligned? Thanks! ...

centre thumbnail in scrollbar (jQuery)

Please check out this page: http://onomadesign.com/wordpress/identity-design/hans-appenzeller/ The thumbnails on the right, link to different portfolio items (Wordpress single posts). I want the thumbnail of the active project to be vertically centred in the scrollbar when the user enters the page. Right now, it resets the scrollbar, so...

how to align list text to center

i'm using an image for "li" element. the problem is the text displayed under the image.how to align text to center of the list image? looks as follows css: ul.mark{ list-style-image: url('bullet1.jpg'); } html: <ul class='mark'> ... </ul> ...

Can the struct padding be safely used by the user code?

Assuming I have a struct like the following: struct Struct { char Char; int Int; }; and sizeof( int ) is greater than one and the compiler adds padding for the Char member variable - is the compiler-generated code allowed to change the values of the padding bytes? I mean if I use pointer arithmetic and write some data into th...

C++ STL data structure alignment, algorithm vectorization.

Hello Is there a way to enforce STL container alignment to specific byte, using attribute((aligned))perhaps? the target compilers are not Microsoft Visual C++. What libraries, if any, provide specialized templates of STL algorithms which have specific explicit vectorization, e.g. SSE. My compilers of interest are g++, Intel, and IBM X...

Is the memory alignment different for different data types

Do different data types in C such as char, short, int, long, float, double have different memory alignment boundaries? In a 32 bit word aligned byte addressable operating system, how is accessing a char or short different from accessing an int or float? In both cases, does the CPU read a full 32-bit word? What happens when an int is not ...

Can you mix % and px to align a table?

I am trying to align different tables with different amount of columns so the first two columns are align and the rest are independently align but using % it is very difficult and when resizing window it losses alignment. That is why I was trying to align mixing with % and px on td, ex. <table> <tr> <td width="100px"></td> <...

Yet another IE image alignment issue: Float right inside right text-align wackiness

I have an <a> element set to display:block, inside of which is some text and a png image. The <a> is set to text-align:right and the image is set to float:right. It's fine in all browsers except IE (8, but haven't tried with earlier versions of IE), which displays the image below the text. If I do the old negative margin trick, it overl...

Make a td fixed size (width,height) while rest of td's can expand.

Hi all, Do you know, how to fix the size of a td Width and Height in a table allowing the rest of td on table to expand as needed? Thanks. The problem is that when there is data inside of td's it will not shrink more than the data, but if is empty it will shrink all the way, if you expand the window the td will expand. I would like t...

How to reduce space between tr?

Hi all, I am trying to replicate a page I have been given, and I have nearly finish, but I have a small problem with it. The space between tr are too big. I have done it reducing the margin top and bottom but there is a point where rows overlap. Does anybody have any suggestions? Thanks. e.g. <style type="text/css"> .divContainer {...