formatting

easy hex/float conversion

I am doing some input/output between a c++ and a python program (only floating point values) python has a nice feature of converting floating point values to hex-numbers and back as you can see in this link: http://docs.python.org/library/stdtypes.html#additional-methods-on-float Is there an easy way in C++ to to something similar? and...

Linq 2 Sql DateTime format to string yyyy-MM-dd

Basically, i need the equivalent of T-SQL CONVERT(NVARCHAR(10), datevalue, 126) I've tried: from t in ctx.table select t.Date.ToString("yyyy-MM-dd") but it throws not supported exception from t in ctx.table select "" + t.Date.Year + "-" + t.Date.Month + "-" + t.Date.Day but i don't think it's an usable solution, because i might need t...

XSL transformation generating output from other nodes

I have the following XSL template (I omitted the template for Organization, let me know if it's necessary): <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt; <xsl:output method="html" indent="yes" omit-xml-declaration="yes"/> <xsl:tem...

code formatting at build time

can anyone suggest me a plugin/tool that can perform a code formatting at build time. ...

Can code formatting lead to change in object file content?

I have run though a code formatting tool to my c++ files. It is supposed to make only formatting changes. Now when I built my code, I see that size of object file for some source files have changed. Since my files are very big and tool has changed almost every line, I dont know whether it has done something disastrous. Now i am worried ...

Text Formatting in Ruby (For Packing Slips)

I need to generate formatted text packing slips for a Ruby on Rails project I'm working on. I'm considering using Ruport or just formatting it myself in a string and outputting it to text. The only challenge is justifying all of the output appropriately. It needs to look something like this, always aligned properly. Any recommendations? ...

Normalize whitespace and other plain-text formatting routines

Background: The language is JavaScript. The goal is to find a library or pre-existing code to do low-level plain-text formatting. I can write it myself, but why re-invent the wheel. The issue is: it is tough to determine if a "wheel" is out there, since any search for JavaScript libraries pulls up an ocean of HTML-centric stuff. I am ...

PHP: Format a numeric string by inserting comma

I need a way to convert a number into formatted way by inserting comma at suitable places. Can it be done using regex? Example: 12345 => 12,345 1234567 =>1,234,567 ...

Custom formats in Ruby on Rails

I'm creating a website in Ruby on Rails, where users can login using RESTful Authentication. Someone can get a specific user using html, xml and json, just like scaffolding. But I want to add one more format: vCard (e.g. /users/1.vcard). This has a specific format, but how do I define my own formats? Using views, or must I use another wa...

Formatting floats in Python without superfluous zeros

How to format a float so it does not containt the remaing zeros? In other words, I want the resulting string to be as short as possible..? Like: 3 -> "3" 3. -> "3" 3.1 -> "3.1" 3.14 -> "3.14" 3.140 -> "3.14" ...

excel turning my numbers to floats

Hello, i have a bit of asp.net code that exports data in a datagrid into excel but i noticed that it messes up a particular field when exporting. eg .. i have the value of something like 89234010000725515875 in a column in the datagrid but when exported, it turns it into 89234+19. Is there any excel formatting that will bring back m...

Different CSS Styles

/* Style 1 */ .myclass { background:#ff0; border:1px solid #ff0 } #myid { width:80px; height:80px; } /* Style 2 */ .myclass { background:#ff0; border:1px solid #ff0 } #myid { width:80px; height:80px; } I'm sure there must be more styles for writing CSS, I'd like to know what are they. Is there an article already written...

Formatting numbers by tokens with php

I'm looking for a way to format numbers using "tokens". This needs to be conditional (for the first few leading characters). Example: <?php $styles=array('04## ### ###','0# #### ####','13# ###','1800 ### ###'); format_number(0412345678); /*should return '0412 345 678'*/ format_number(0812345678); /*should return '08 1234 5678'*/ fo...

How do I write a analyzable thread dump format

I'm creating a global exception handling which collects some information before shutting down in some cases. One of this information is the current thread dump. i do this with following code: ManagementFactory.getThreadMXBean().dumpAllThreads(true, true); The problem is to write the information into a analyzable format for TDA. Is the...

Best way XML File handling bullet point •

For an XML file I am creating I have data that contains a bullet • what is the best method for handling this in xml data? It opens in an XML editor and reads fine, but I cannot import the file via SSIS, I get an error regarding this point. <xmldata>• Bullet</xmldata> Renders fine, but cannot import with SSIS. ...

Relative references in Excel VBA Formatconditions.Formula1

Hi All, I am having some trouble with the relative referencing, when trying to cycle through conditional formats in an Excel sheet. What I am trying to do is loop through the conditions, evaluate them to see if they are true, and if they are, applying the background color of that condition to another cell. I know that .formula1 has so...

what's the best way to format an xml string in ruby?

given an xml string like this: <some><nested><xml>value</xml></nested></some> what's the best option (using ruby) to format it into something readable like: <some> <nested> <xml>value</xml> </nested> </some> ...

Text formatting within textarea

Variations on my problem have been discussed elsewhere, so I hope I'm not duplicating! I'm implementing a simple Private Messaging System as part of a web app. I've got an annoying problem though when dynamically inserting text into a textarea box in order to make a reply. Getting the content and displaying it is fine, but I can't work o...

How to achieve the following C++ output formatting?

I wish to print out double as the following rules : 1) No scietific notation 2) Maximum decimal point is 3 3) No trailing 0. For example : 0.01 formated to "0.01" 2.123411 formatted to "2.123" 2.11 formatted to "2.11" 2.1 formatted to "2.1" 0 formatted to "0" By using .precision(3) and std::fixed...

Formating tooltips (help text) in BIRT 2.5 ?

Is it possible to format the built in tooltips (Help text propperty) of BIRT 2.5 ? Ex: make some words bold , even insert some html content. Thank you ...