formatting

Query number of decimal places in a sql server resultset

I have a table which contains a field of type numeric(28,10). I would like to display the records with a monospaced font, and a matching number of decimal places so that they line up when right aligned. Is there any way to figure out the maximum number of decimal places that can be found in a given result set so that I can format accor...

Formatting very large numbers in C

I have to output a large number, a double precision number using the following code: fprintf(outFile," %11.0f %d O(g(n))",factorialNotRecursive(index,factCount),factValue); now the number gets so big that it jumps out of alignment further down the list of output. Once it gets past 11 digits, the max specified it continues ...

XSL - rounding/format-number problem

Hi guys, I'm trying to get the value of a number to 2 dec places from my xml. XML:<Quantity>0.0050</Quantity> XSL:<xsl:value-of select="format-number($quantity, '####0.00')" /> However XSL seems to have a problem with this value and outputs 0.00 in one area of the page and 0.01 in the other. Of course in this situation it is favourab...

Visual studio 2010 formatting showing and I can't remove it

It seems that stackoverflows image upload is broken in IE. http://imgur.com/HLbLe.png Basically I have a bunch of text-formatting showing like - instead of spaces. I was pressing a keycombo and accidentally typed one and I don't know what it was. How can I disable this? I've looked through all the options for Text Editor and couldn't f...

Recording Mono on iPhone in IMA4 format

Hi, I'm using the SpeakHear sample app on Apple's developer site to create an audio recording app. I'm attempting to record directly to IMA4 format using the kAudioFormatAppleIMA4 system constant. This is listed as one of the usable formats, but every time I set up my audio format variable and pass and set it, I get a 'fmt?' error. Here ...

How to merge two dates into a normal human readable date range

Say you have the following date range: 2010-04-10 - 2010-04-15 As a human, I might write this as April 10 - 15, 2010, or something like that. Not sure if there is a defined correct way of writing ranges like that, but anyways, if you were to do something like that, how would you do that? I'm not even sure where to begin... I'd like t...

Silverlight formatting text from XML source

I have a large chunk of customer relevant information that I am storing in an XML file. Each XML element requires some sort of rich text formatting (bold, italics, new line, paragraphs, etc...). I have complete control over the XML file (i.e. I can wrap the text in other XML elements if required), and it is static (which makes life a bi...

Are there any keyboard shortcuts for formatting in Python?

After we write a code in Matlab we can use ctrl+A+ctrl+I and ctrl+A+ctrl+J to format our code (comments, loops alignment etc). Is there something similar or any helpful keyboard shortcuts in Python? Also, just like we can use upward arrow to copy our previous command window history in Matlab, is it possible or some keyboard shortcut to ...

Datagridview to Clipboard with formatting

For a VB.Net application needing to output the data to clipboard, with formatting, I am in need of some help. For now, I am exporting data from the clipboard using MainView.ClipboardCopyMode = Windows.Forms.DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText System.Windows.Forms.Clipboard.SetDataObject(MainView.GetClipboardConte...

Try string.Format(...) formatting options online?

I was wondering if anyone knows an online service where I could quickly try out .Net's string.Format() various formatting options? I'm imagining something similar to the multitude of online Regex builders. I guess Snippet Compiler is the next best thing, but an online version would be easier to use. ...

Which html code beautifier would work form CMS?

Is there any open source HTML/XHTML source code beautifiers written in PHP? By beautifier I mean library that correct white space indents and improve code readability and can be integrated with CMS. ...

Format Text Going Into A Textbox for a Phone Number, etc.

Hi There, Couldn't find this anywhere, maybe I'm looking for the wrong verbs. I'm trying to get a textbox to require a certain format as you type in a number. For simplicity, lets use a phone number example. As I type into the box I want some guidelines to help the user enter the correct format of the phone number: (4__) ___-____ ...

MATLAB m-file help formatting

I could not find what formatting available to write help for your own MATLAB function. Very little information is available in official documentation. Do you know about any other formatting that can be visible with Help Browser (not with help function)? As it is for built-in functions. How to format headings (like Syntax, Description, ...

What tools are available to auto-format Ruby/Rails Code

I'm currently using GEdit with several plugins to do Ruby on Rails development. One thing I would like to have is a way to automatically format my source files (.rb, .*.erb, etc.) Ideally it would be something that I could call from the command line and/or GEdit. Command line tool would be nice, because I can set up a Git hook to auto-...

Formatting of single precission IEEE 754 floating point numbers

I need to represent single precision numbers as text in a way that won't lose any information (so I can get the same number back, possibly disregarding NaNs etc.), but without too many spurious digits - so single precision 0.1 comes out as "0.1" not "0.100000001490116". I'm not trying to save bytes, these extra digits are just confusing...

Print variable in python without space or newline

print a variable without newline or space python3 does it by print (x,end='') how to do it in python 2.5 ...

Access 2007 Textbox Date Formatting

I converted an older Access app to 2007, and now the date formatting in editable textboxes is not working. The format I'm using is mm/dd/yy, but the date is displaying with a 4-digit year. I've tried other formats just for testing, eg mmm/d/yy - they display correctly except for the year which insists on being 4 digits. This appears to...

blackberry paragraph formatting labelfield

im having a label field that contains text value exceeds the screen width, i want to format the labelfield as paragraph to display inside specified width and height.. how to format the text in blackberry?? ...

Rowspan or nested? Create a table itextsharp

I've been searching about how to merge two cells and I've found two answers Rowspan and Nested. I can't make my table with those two functions because I don't know how to merge cells at the begining and at the end. I've been trying many ways but this is driving me crazy. The table I want to make has 9 columns and 3 rows. So, I want the ...

How to strip variable spaces in each line of a text file based on special condition - one-liner in Python?

I have some data (text files) that is formatted in the most uneven manner one could think of. I am trying to minimize the amount of manual work on parsing this data. Sample Data : Name Degree CLASS CODE EDU Scores -------------------------------------------------------------------------------------- John M...