alignment

Algorithm for data alignment of float arrays in Java

I have two float arrays representing y values in a line chart. Now I want to align these two charts. Are there any existing algorithms for alignment of the two arrays? A very simple example a: 2.5 1.3 1.6 4.2 3.6 b: 3.3 1.4 2.5 1.3 1.6 Now after alignment it should be: 2.5 1.3 1.6 4.2 3.6 3.3 1.4 2.5 1.3 1.6 In reality it...

How can I center a Silverlight DataGridTemplateColumn header?

I want to center the header on a Silverlight DataGridTemplateColumn. The following code gets me most of the way there: DataGridTemplateColumn column = new DataGridTemplateColumn(); column.CellTemplate = Resources[templateName] as DataTemplate; column.Header = headerName; column.HeaderStyle = new Style { TargetType = typeof(DataGridColum...

Aligning divs with different dimensions horizontally.

I have a tag cloud with different font sizes. <div> <a style="font-size:15px;">tag1</a> <a style="font-size:10px;">tag1</a> </div> And it looks like this: Now I need to wrap each tag into its own div: <style> .cloud {float:left} .tag {float:left} </style> <div class="cloud"> <div class="...

How do I activate #pragma pack on ubuntu 10.4 gcc 4.4.3

I am trying to activate #pragma pack(push, 8) on ubuntu 10.4 (8.10 would also be nice), which uses gcc 4.4.3, but I can't get it to work. Is there something more that need to be done? There is not even a warning if I compile with -Wunknown-pragmas so gcc seems at least to acknowledge it as a known pragma. It would be nice to use the pa...

WPF: Can I use VisualStateManager to change alignment?

Hi, I've got this "object-stack" - Window --- Grid (VerticalAlignment = Stretch) ----- Border (VerticalAlignment = Stretch OR Top) The Border a primitive UserControl right now to keep things simple for me. I'd like to be able to use the VisualStateManager to toggle the VerticalAlignment-property of the Border, so that the "Normal-stat...

Cross browser div center alignment using CSS

What is the easiest way to align a div whose position is relative horizontally and vertically using CSS ? The width and the height of the div is unknown, i.e. it should work for every div dimension and in all major browsers. I mean center alignment. I thought to make the horizontal alignment using: margin-left: auto; margin-right: auto...

WPF CheckBox style with the TextWrapping

I need you a TextWrapping in the WPF CheckBox. Please look at this two samples: <CheckBox> <TextBlock TextWrapping="Wrap" Text="_This is a long piece of text attached to a checkbox."/> </CheckBox> <CheckBox> <AccessText TextWrapping="Wrap" Text="_This is a long piece of text attached to a chec...

Can you explicitly set a structure layout/alignment in C++ as you can in C#?

In C# you have nice alignment attributes such as this: [StructLayout(LayoutKind.Explicit)] public struct Message { [FieldOffset(0)] public int a; [FieldOffset(4)] public short b; [FieldOffset(6)] public int c; [FieldOffset(22)] //Leave some empty space just for the heck of it. public DateTime dt; } Whi...

Gnome Desktop Icons Alignment

Hi all. It has been a long time since I started to compare the gnome desktop to the windows desktop. But since I began to use linux, I realized that the "gnome way" to align the icons on Desktop is not that nice for me. And comparing to Windows's way, windows is better for me. (remember, for me). I'd like to know if anyone has some tip ...

How to anchor a DIV to the bottom of a page?

I have a fixed-width DIV that I want to remain at the bottom of the browser's viewport. Unfortunately, I haven't a clue where I would even begin to try to implement this. Obviously the first thing to do is set position to fixed. But beyond that... no clue. ...

Why does my data not seem to be aligned?

I'm trying to figure out how to best pre-calculate some sin and cosine values, store them in aligned blocks, and then use them later for SSE calculations: At the beginning of my program, I create an object with member: static __m128 *m_sincos; then I initilize that member in the constructor: m_sincos = (__m128*) _aligned_malloc(Bins...

jquery find image based on "align"

Hi all, I'm trying to find all the images on a page based on their alignment (no class or id attached to these images), although I'm not sure how to do it. Basically I want to add CSS to images which are aligned to the right, yet leave the other images as they are. If anyone could help out, that'd be great :) ...

CPU and Data alignment

Dear All, Pardon me if you feel this has been answered numerous times, but I need answers to the following queries! Why data has to be aligned (on 4 byte/ 8 byte/ 2 byte boundaries)? Here my doubt is when the CPU has address lines Ax Ax-1 Ax-2 ... A2 A1 A0 then it is quite possible to address the memory locations sequentially. So why ...

WPF: Aligning the base line of a Label and its TextBox

Let's say I have a simple TextBox next to a Label: <StackPanel> <StackPanel Orientation="Horizontal"> <Label Margin="3">MyLabel</Label> <TextBox Margin="3" Width="100">MyText</TextBox> </StackPanel> ... </StackPanel> This yields the following result: As you can see, the base lines of MyLabel and MyText a...

CreateThread() fails on 64 bit Windows, works on 32 bit Windows. Why?

Operating System: Windows XP 64 bit, SP2. I have an unusual problem. I am porting some code from 32 bit to 64 bit. The 32 bit code works just fine. But when I call CreateThread() for the 64 bit version the call fails. I have three places where this fails. 2 call CreateThread(). 1 calls beginthreadex() which calls CreateThread(). All th...

How to Vertically Center Images on a Line?

What's the best way to center icons on a line when the images are smaller than the line height? For example (styles inline for easier reading): <div style="line-height: 20px"> <img style="width: 12px; height: 12px;"/> Blah blah blah </div> Here's a jsFiddle example. This example also shows why vertical-align: middle does not work...

CSS: allow image to overflow from a div?

I want to create the following situation: +--------------------------------------+-----------------------+ | 1| | | IMAGE IMAGE IMAGE IMAGE IMAGE IMAGE | TEXT TEXT TEXT | |2 | | +-----------------------------------...

CSS not working correctly on IE 7

Hi people, I am working on a website curently. Here is the link for it. Good News : The site is fine on FireFox, Chrome and IE 8. Bad News: It is not fine on IE 7. Alignment problems, hyperlink colour problems, etc. What should i do to make things normal on IE7 too. Any amount of help would be appreciated. Thanks ...

Dynamically setting alignment of cells of gridview

Hi, In my gridview i have 3 6 columns. by default i am setting dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; this.dgv_folderContents.RowsDefaultCellStyle = dataGridViewCellStyle3; So all cell values are displayed with left align. But there are two column checkbox and image I wan...

Text Alignment in Rad Controls (telerik).

Please tell me how to make text alignment centerlized in RadButton, RadListbox, RadCombobox in winform. (i am using vb.net - vs2005) ...