formatting

Formatting C++ Console Output.

I've been trying to format the output to the console for the longest time and nothing is really happening. I've been trying to use as much of iomanip as I can and the ofstream& out functions. void list::displayByName(ostream& out) const { node *current_node = headByName; // I have these outside the loop so I dont write it everytime....

Formatting to the Console, C++

Hi, I'm trying to format my output in the console window in four separate fields, all evenly spaced. out << left << setw(24) << "Name" << "Location" << right << setw(20) << "Acres " << "Rating" << endl; out << left << setw(24) << "----" << "--------" << right << setw(20) << "----- " << "------" << endl; while ( current_node ) {...

Vim: make gq treat '.' as the end of a sentence.

Related to vim-how-to-reformat-a-set-of-lines-into-a-single-lines-if-the-line-is-a-single I'd like gq to treat a '.' as the end of a sentence in latex. Combined with a high value of tw, the intention is automatically reformat a paragraph into a list of lines. (FYI, this is a much nicer way to edit latex, if you are wondering) ...

Why does converting a datasource to a datatable prevent formating

I have come accross a strange problem that can be illustrated using the 2 seperate code blocks below. If i use the first block, you can clearly see that column 5 has a currency format applied to it. Using the second block where the only difference is that the string array is added to a datatable and then used as the datasource -> no ...

Whats wrong with this [reading input from a text file in Matlab]?

I have a text file (c:\input.txt) which has: 2.0 4.0 8.0 16.0 32.0 64.0 128.0 256.0 512.0 1024.0 2048.0 4096.0 8192.0 In Matlab, I want to read it as: data = [2.0 4.0 8.0 16.0 32.0 64.0 128.0 256.0 512.0 1024.0 2048.0 4096.0 8192.0] I tried this code: fid=fopen('c:\\input.txt','rb'); data = fread(fid, inf, 'float'); data but I a...

Reporting services 2005 export to excel without formatting

If you have a reporting services report with all the formatting you want for presentation, is there any way to export just the data excel without the formatting? Kinda like a data dump in a way; take the data set on the report and dump it into excel so that users can play with the data easier. Right now we accomplish this by loading th...

JExcelApi currency format on formula cell - file error

Hi guys, I'm writing a spreadsheet with JExcelApi. I have two cells that I want to apply currency formatting to. From reading the API I discovered jxl.write.NumberFormat, which seems to do what I want. In my application I've written: NumberFormat currency = new NumberFormat(NumberFormat.CURRENCY_DOLLAR); WritableCellFormat currencyF...

Why is PHP printing my number in scientific notation, when I specified it as .000021?

In PHP I have the following code: <?PHP $var = .000021; echo $var; ?> the output is 2.1E-5 ! Why? it should print .000021 ...

Adding commas to a decimal number which is in a string of text with .NET 2.0.

Greetings. Imagine you've been given a string (from somewhere you can't control). In that string is a decimal number. You want to add commas (ie: turn 1234567.89 into 1,234,567.89) to that number while keeping the entire string intact. The currency symbol before the number will vary, but the comma-formatting doesn't have to vary by c...

How can I get the date but not time from NSDate

Hi. I need the date as a string but not the time and it has to be localized. So for example USA should be Sep 25 2009 but for New Zealand it would be 25 Sep 2009. I can get the date into a string by specifying the format "MMM dd YYYY" but It's not localized. Any ideas? ...

Utility to auto insert semicolons in javascript source code?

The question is pretty self explanatory. I'm working with code from multiple developers. Some of whom are inconsistent in their use of semicolons, and I just want them after every line for consistency (and to prevent any masking of errors). I use Aptana to format my source code, but it won't add semicolons for you AFAIK. Thanks. ...

PHP mail line break problem

I want to format content of the mail to show the content in different line. here is my message contetn. bu the \n and \r is not working in this case. it just shows all the content in one line. $message = 'Thank you for using . We really appreciate your business.'."\r\n".'If you are making your payment by mail, please make the check ...

XML node format (add new line/tab)?

How to format XML node to match the following format? How to add new line / tab? <Note description = "Dear Sir /Madam, **(insert new line)** **(insert tab)** This is to inform you ..." /> Output: Dear Sir /Madam, This is to inform your that the below mentioned vehicle[s] have attracted ... ...

VS2008: Is it possible to have custom formatting for @ directives?

In VS2008 (Tools -> Options, Text Editor, HTML, Format, Tag Specific Options) you can control the automatic formatting of most tags. However, I'd like to have VS automatically format my @p Page directive so that instead of: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Foo.aspx.vb" Inherits="WebRoot.Foo" MasterPageFile=...

BBCode for Ruby on Rails

So I'm putting together a simple forum. I'd like to allow my users limited formatting options and BBCode would be plenty for my users. Knowing that I'm assuredly not the first one to want to use BBCode with RoR I googled but couldn't find a straight forward tutorial on how to create a editor which accepts BBCode nor a way to parse and di...

Putting citation text on same slide with LaTeX Beamer

By default, using \cite in the Beamer class of LaTeX places the actual citation information at the end of the presentation on a separate slide containing the bibliography. How does one get the citation information, instead, on the same slide as the citation (the expected, courteous practice for most presentations)? ...

How can I format time intervals in Cocoa?

I'm looking for a class that formats time intervals like this: 1 hour 3 minutes 2 hours 5 minutes 12 seconds 5 days 2 hours Is there anything built-in or a library that supports this kind of time interval formatting? I thought about doing it myself, but there are all sorts of problems: Localization Non-gregorian calendars. ...

How to have autotest and RSpec nicely formatted when comparing long texts (with \t and \n)?

I have a test in RSpec which compares to long text strings. When the test fails, I get a message like this: 'jobs partial should render the correct format for jobs' FAILED expected: "Job {\n\tName = \"name1-etc\"\n\tType = Backup\n\tMessages = Daemon\n\tPool = Default \n\tSchedule = \"schedule1\"\n\tStorage = storage1\n\tClient = \"name...

Converting camel case to underscore case in ruby

Is there any ready function which converts camel case Strings into underscore separated string? I want something like this "CamelCaseString".to_undescore to return "camel_case_string" ...

How can I use RegEx to make sure a valid email is written in my TextBox>?

I'm a complete newbie to RegEx and I'm sure it'll be brilliant to use once I know how to use it. :P I have a couple of textBoxes and I was wondering if anyone could me acomplish what I need. In the EMail textbox, I'd like to make sure the user writes in a valid email. [email protected] Is there a way for RegEx to help me out? I'd also reall...