alignment

How to fully justify texts programmatically (Delphi)?

How can I fully justify a block of text (like MS Word does, not only on the right and not only on the left but on both sides)? I want to justify some texts (mainly arabic text) adjusted to certain screen size (some handheld device screen actually, and its text viewer doesn't have this function) and save this text as justified. So I can...

How do I ensure buffer memory is aligned?

I am using a hardware interface to send data that requires me to set up a DMA buffer, which needs to be aligned on 64 bits boundaries. The DMA engine expects buffers to be aligned on at least 32 bits boundaries (4 bytes). For optimal performance the buffer should be aligned on 64 bits boundaries (8 bytes). The transfer size must be a m...

Strange performance problem.

I have a container similar to this one. template <typename Nat, typename Elt> class NatMap { public: Elt& operator[] (Nat nat) { return tab [nat.GetRaw()]; } private: Elt tab [Nat::kBound]; }; I wanted to drop the requirement for Elt to have a default constructor: template <typename Nat, typename Elt> class NatMap { pub...

ASP.Net vertical alignment of controls in a panel

I have a Panel with the following: <asp:Panel ID="Panel1" runat="server" Height="101px"> Day <asp:DropDownList ID="DropDownList1" runat="server" Height="24px" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"> </asp:DropDownList> &nbsp;Hour <asp:DropDownList ID="DropDownList2" runat="server"> </asp:Drop...

Aligning a class to a class it inherits from? Force all stack alignment? Change sizeof?

I want to have a base class which dictates the alignment of the objects which inherit from it. This works fine for the heap because I can control how that gets allocated, and how arrays of it get allocated in a custom array template. However, the actual size of the class as far as C++ is concerned doesn't change at all. Which is to say i...

How to align text in a table cell?

<table><tr><td><input type="checkbox" id="41" value="1"> Don't overwhelm yourself <span style="color:black;float:right">111111</span></td></tr> </table> The text "111111" doesn't go to the right. When I use "align:right", it is the same. <table><tr><td><input type="checkbox" id="41" value="1"> Don't overwhelm yourself <span st...

MSVC: what compiler switches affect the size of structs?

I have two DLLs compiled separately, one is compiled from Visual Studio 2008 and one is a mex file compiled from matlab. Both DLLs have a header file which they include. when I take the sizeof() the struct in one DLL it returns 48, and in the other it returns 64. I've checked the /Zp switch and in both compilations it is set to /Zp8. Wha...

Loop versioning with GCC

I am working on auto vectorization with GCC. I am not in a position to use intrinsics or attributes due to customer requirement. (I cannot get user input to support vectorization) If the alignment information of the array that can be vectorized is unknown, GCC invokes a pass for 'loop versioning'. Loop versioning will be performed when ...

Aligning Shapes on a plan, Algoryhtm

Hello Coders ! I am developing a simple diagram tool with shapes on a plan using flex. First i was using a simple 20*20 grid. But the real cool stuff out their is auto axe magnet effect, that's how i call it at least to see why i mean by that i made a small video of balsamiq. http://screenr.com/clB http://www.balsamiq.com/ As you ca...

WPF Listboxitem not aligning items properly

Ok I got the following DataTemplate: Style="{StaticResource LBStyle}" HorizontalContentAlignment="Stretch"> <ListBox.ItemTemplate> <DataTemplate> <Grid > <Grid.ColumnDefinitions> <ColumnDefinition Width="1*"/> ...

How to align the jquery maphilight to center?

Hi guys, yes i know how silly and dumb this question is, but i have been looking around and i can't find how to align the image so that i can position it in the middle for the excellent jquery maphilight, what i found is after the class="map" is applied to the image, it will automatically shift to the left. i can find any options to se...

CSS Vertical Alignment in HTML emails

As we all know, most email clients don't support all CSS attributes. If I want to vertically align images and text, what's the most compatible means of doing so? Right now, I'm doing: <img style="position:relative;top:3px;" src="http://url.com/img.jpg" /> <span>Words and stuff</span> This works in some clients, but not all (particula...

gwt panel horizontal alignment not working

I have a GWT dialog box that looks like the following: public class FooDialog extends DialogBox { public FooDialog() { setText("Foo Dialog"); VerticalPanel outer = new VerticalPanel(); outer.setBorderWidth(3); outer.setSize("400px", "200px"); outer.setHorizontalAlignment(HasAlignment.ALIGN_CENTER); outer.s...

Problem with line-height and align

I have a element and it is possible that it is longer than one line, so i have to set a line-height>1 otherwise it looks crappy. But if i do that, the lines are higher than the text, and the text is centered. So it does not match the top. How can i change the position of the text to the top of the line, or is there another way to get so...

Text alignment in SVG

How to make text with proportional font but an equal number of characters per line fully justified in SVG text box? Preferably with an svg-code example if it's possible. ...

Latex Letter: From Address Left aligned

This is my first time using Latex to write a letter. I am using the letter class. When I use: \address{100 From Address \\ City, State \\ Pin} The from address becomes right aligned. Is there someway I can make this left aligned. The format of the letter I am looking for is: the from address left aligned, followed by the date left al...

image vertical alignment issue

I have an image that I want vertically aligned with some text. The image has no border, no spacing, and has been properly cropped. However, it aligns differently in IE and Firefox, and I cannot figure out why. Alignment in IE: Alignment in FF: Notice how in FF, the X box is flush with the bottom of the text. The HTML I am using is...

LaTeX math symbol macro

Hi there, I've long had a dream of creating a "consistent comparison" operator to use in my homework (in LaTeX). That is, in some long derivation, we might want to know how $a$ compares to $b$, and although this is totally contrived, an example might read \begin{align*} a &? b \\ f(a) &? f(b) \\ f(a) &= f(b) \text{by assump...

Memory alignment on modern processors?

I often see code such as the following when, e.g., representing a large bitmap in memory: size_t width = 1280; size_t height = 800; size_t bytesPerPixel = 3; size_t bytewidth = ((width * bytesPerPixel) + 3) & ~3; /* Aligned to 4 bytes */ uint8_t *pixelData = malloc(bytewidth * height); (that is, a bitmap allocated as a contiguous bloc...

iPhone table cell label misaligned

Similar to this previous question, I am having a problem with text alignment in my table cells. All the text is shifted up by a few pixels. I am not using custom cells; I am using regular UITableViewCells with the UITableViewCellStyleValue1 style, targeting iPhone OS 3.1. I would prefer a much simpler solution than the previous question'...