formatting

Formatting time in milliseconds using boost::date_time library

I have a time duration in milliseconds which I ideally would like to format using the formatting functionality present in the boost::date_time library. However, after creating a boost::posix_time::time_duration I can't seem to find a way to actually apply the formatting string to it. ...

Asp menu control formatting sitemapnode

I'm trying to figured out how to separately format sitemapnodes which do not have a URL associated. Here's a code example: <siteMapNode title="TheThingIWantFormattedSeparately"> <siteMapNode url="~/pages/customer.aspx" title="Customer"/> <siteMapNode url="~/pages/contract.aspx" title="Contract"/> So I'm wanting the FIRST sit...

Adding format to properties

I have an object with a couple of DateTime properties: public DateTime Start_Date { get; set; } public DateTime? End_Date { get; set; } I would like to set a format for each of these, along the lines of Start_Date.ToString("M/d/yyyy hh:mm tt") Do I have to code the get, or is there an elegant way to do this? ...

tool for adding parentheses to equations?

Is there an online tool for adding parentheses to simple math equations? For example, a + b * c into a + (b * c) Those who paid more attention in math class might be able to tackle order of operations for huge equations in their head, but I could often use some help (and verification of my thinking). I often encounter other peo...

SSMS Results to Grid - CRLF not preserved in copy/paste - any better techniques?

When I have a result set in the grid like: SELECT 'line 1 line 2 line 3' or SELECT 'line 1' + CHAR(13) + CHAR(10) + 'line 2' + CHAR(13) + CHAR(10) + 'line 3' With embedded CRLF, the display in the grid appears to replace them with spaces (I guess so that they will display all the data). The problem is that if I am code-generating ...

Vim: wrap text ("gq") without modifying underlined headings

Is there a way of formatting text in Vim that respects underlined headings? In Markdown, there are two ways of representing headings: #Level 1 heading ##Level 2 heading ###Level 3 heading and for level 1 & 2 only: Level 1 heading =============== Level 2 heading --------------- I am fond of the underlining style, as I think it rea...

Resharper 5: How do I set the default formatting style for inline code blocks?

I've got a problem with the formatting of inline code blocks within the VS2010 text editor and wonder if anyone else has had similar problems and found the 'magic' setting I'm looking for. I'm working my way through tutorials in an MVC book. Whenever I add some inline code blocks to a view I want them formatted like so: <% foreach (va...

OpenSSL Bio chains: Clarrification on documentation

The documentation for Openssl memory BIO sinks is here. I am creating a BIO chain to turn binary strings into base64 strings. The source/sink is always a memory location, and this enables me to just keep the same chain arround. However the data (should) go into a memory buffer managed by OpenSSL when I write to it, and it should come fr...

How to represent formatted text for display on IPhone/Android/WP7/PC

I am working on a multi-platform app (Mono) that will store text in a centralized location on the web and synchronize this text across clients that could potentially be IPhone/Android/WP7/OSX/Windows(WPF)/Linux/Web. I need to support some degree of rich text (at minimum bold/italic/etc./basic lists/alignment), and I am trying to find a ...

In PHP how do you format a number as currency handling cases such as 10 cents equaling "$.1";

I currently do: $totalBill = number_format($totalBill, 2); $totalBill = '$'.$totalBill; This does not handle cases though where the total is say 10 cents. It returns "$0.1" which I do not want. Does anyone have a better way? ...

Return <bar>foo</bar> instead of <string>foo</string> in WCF rest method

I have a REST web method in .NET 3.5: [OperationContract] [WebInvoke(UriTemplate = "", Method = Verbs.Get)] public string GetBar() { return "foo"; } The response gets formatted as <string>foo</string> while I would prefer <bar>foo</bar> instead. Does anyone know how to do that? I feel I am missing something obvious. ...

An annoying printing issue with Crystal Reports 2008

A little background: I have an extremely annoying printing issue with crystal reports. My environment is crystal reports 2008 SP2 on Windows 7 (64bit), Visual studio 2008 and .net framework 3.5 with all the latest updates for everything. The report is designed basically to render a small shelf label of the size (40mm width and 20mm heig...

Android - phone number contact format

Hi In Android I can get phone numbers of all the contacts without any problem. Tha problem is that for most users some numbers are stored as 'local' numbers, meaning that they dont have the country code included. For example, if the user lives in US and he has 2 contacts: 1) John - 555-123-1234 (local) (starting 1 not showing) 2) ...

PHP beautifiers (libraries for formatting code)

Previously, my intention was to ask: Do you know any open source SQL formatter/beautifier library for PHP projects? But I think, I'd better ask: Which code formatting libraries written in PHP are the best? Let's list them all in one place. My types: for CSS syntax: Css Tidy for PHP: PEAR's PHP_Beautifier for HTML syntax: Tidy E...

Formatting data for printing automatically

I have a requirement to retrieve data, format it to mimic an old request format we've used for years and then send it via IP address to any of a number of printers. Gathering the data and selecting the printer is no problem. I need to format the output for the printer and I'm just not sure what's best. The requirement is that the en...

How to colorize section headings in LaTeX like this?

Hi, Accidently I created this nice colored effect on my LaTeX TOC: http://i43.tinypic.com/o5aptl.png Which I like and want to keep, I created this effect like this: \definecolor{Section1}{rgb}{0.09,0.21,0.36} \section{\color{Section1}Introdução} However, as you can see on the TOC sidebar, there was a nasty side effect. I tried to f...

Creating a custom format string in a dataGridView

I have a dataGridView whose dataSource is a dataTable. My problem is that I want certain columns to be displayed in Hex. I can get that far with using something like this: foreach (DataGridViewColumn c in grid.Columns) { if (DISPLAYED_IN_HEX.Contains(c.Name)) { c.DefaultCellStyle.Format...

How do I use multiple precisions in printf()?

Looking at the information under the heading "Precision can be omitted or be any of:". The example: printf("%.*s", 3, "abcdef"); works, outputting:abc (truncating the rest of the string.) Now, I would like to have a string with multiple parameters formatted (truncated): printf("%.*s, %.*s", 3, 3, "abcdef", "xyz123"); but the progra...

Visual Studio 2010 insists on inserting spaces in JavaScript

Visual Studio 2010 inserts a space between the keyword "function" and the following parenthesis. Is it possible to turn this off? i.e. Visual Studio formats my code like: var vsfn = function () { }; I would like this formatting: var myfn = function() {}; ...

VS 2010: Max line length guide does not render

In VS 2008, we were able to add a max line length guide ref: http://blog.feradz.com/2009/02/add-line-length-marker-in-visual-studio/ However when we attempt to do the same thing in VS 2010, it does not work. Does anyone know how to achieve this in VS 2010? ...