formatting

iPhone Formatted Strings

I would like to be able to format a string in a label or textfield so that i can change the font color and size of certain keywords. does anyone know how to do this? is it possible to find the actual physical dimensions of a CharcterSet as well? ...

How to convert time() to the format of 09/02/2010 in PHP?

$ts = time(); How to convert $ts to the format 09/02/2010 ? ...

Advance tab position in C++?

I'm currently writing a program that has debug output strewn throughout it. This is all well and good, but I'd like to be able to advance the tab position for things in different scopes, for instance, this is what I have right now: #ifndef NDEBUG printf("Updating player\n"); #endif player.Update(); #ifndef NDEBUG printf("Done updating p...

.NET Phone Number Parsing Library

Does anyone know of a generic phone number parsing library for .NET? Ideally I'm looking for something similiar to the Ruby Phone library. ...

Alternatives to NTidy and other ports, need to format html with custom tokens

Looking to format (automated, in application) some html / nvelocity templates. Tidy seems to be the answer for this, however all the .Net ports seem to be problematic and not very well maintained. Most rely on unmanaged code under the covers and that starts imposing other restrictions on the project. For example, to use the code asso...

Rails (or Ruby): Yes/No instead of True/False

I know I could easily write a function and put it in the application controller, but I'd rather not if there is something else that does this already. Basically I want to have something like: >> boolean_variable? => true >> boolean_variable?.yesno => yes >> boolean_variable?.yesno.capitalize => Yes is there something like this already...

How to print hex value of 255 in Unix ?

Hi, can you please tell me How to use printf to find out the hex and octal values of 255? Thanks a lot. ...

Excel formatting...

I have a spreadsheet with text in column A. For example A1=MY TEXT1 A2=MY TEXT2 A3=MY TEXT3 A4=MY TEXT4 A5=MY TEXT5 I want to add an apostrophe to the front and back of the text Result to be: B1='MY TEXT1' B2='MY TEXT2' B3='MY TEXT3' B4='MY TEXT4' B5='MY TEXT5' It seems like a straight forward thing to do. Any one know how? ...

How to nest rules in HP Exstream?

I am using HP Exstream (formerly Dialogue from Exstream Software) version 5.0.x. It has a feature to define and save boolean expressions as "Rules". It has been about 6 years since I used this, but does anybody know if you can define a rule in terms of another rule? There is a "VB-like" language in a popup window, so you are not force...

Converting a serial number into date

Hallo friends, In an Excel sheet I will receive the data, which in turn I need to upload it to sql server and then implement the logic. I have received a date field --[Due Date] as number ex:-.40317. In Excel if you right click it and then format it to a date. It will show the correct date as 19.05.2010. So after uploading the file a...

Can the formatter class be used without relying on an intermediate stream/file?

import formatter # a long string I want to format s="""When running behind a load balancer like nginx, it is recommended to pass xheaders=True to the HTTPServer constructor. This will tell Tornado to use headers like X-Real-IP to get the user's IP address instead of attributing all traffic to the balancer's IP address. """ fh=open("tmp....

double to string formatting

Hi, I have a Double value xx.yyy and I want to convert to string "xxyyy" or "-xxyy", if the value is negative. How could I do it? Regards. ...

Force text onto page

Hi , I've an image in my latex file which is large. As it is so large it pushes text onto the next page as it passes some image size, page size ratio. Can anyone tell me how I go about forcing the text into whatever available space is on the page? Thanks ...

StringFormat Axis Label

Where would I put my StringFormat={}{0:C} to make the axis label have currency formatting? <DVC:LinearAxis Orientation="X" Interval="500000" ShowGridLines="True" Minimum="0" > <DVC:LinearAxis.AxisLabelStyle> <Style TargetType="DVC:AxisLabel"> ...

How to take away fraction part from decimal?

How to take away fraction part while formatting decimal type in .NET? I need common syntax for both variants. Is there any gentle solution? decimal a = 1.22M; decimal b = 1.00M; String.Format("${0}", a); // result is $1.22 String.Format("${0}", b); // result is $1.00, should be $1, HOW? ...

Extra params in Rails 3 routes and resources

The new rails routes are great in many aspects, but I am looking for the best way to achieve page caching with pages and formats like I had in rails 2.x and am coming up short I have many possible desired routes of the basic formulas: /(bazes/<baz id>/)(foos/<foo id>/)bars/page/<page num>/<format> Example routes: /bars/page/1/xml /f...

Failure email becomes unformatted

I am sending email using asp.net and it is working fine. But when an email gets failure to deliver then the failure email which i get becomes unformatted. the email contents are in html format and attached .doc files. i am smtp for sending emails. i think that, this is not because of code i am using to send email so i am not putting se...

Formatting/indentation for using statements (C#)

When it comes to using statements in C# (not to be confused with using directives that import namespaces), Visual Studio doesn't indent single-line code that follows if no braces are employed. This is typical of "nesting" using statements as shown in this SO question. I find it confusing that subsequent statements after using are not in...

SSIS - How to easily parse yyyy-mm-dd hh:mm:ss a.m. format

I need to parse a date like "22/06/2010 3:21:31 p.m." in SSIS in a data flow. Cast(DT_DBTIMESTAMP ) does not work at this is does not handle this format. What is the easiest way that I can do this? ...

How can I format the numbers in viewrecord on jqgrid pager?

When a large number of pages are present, the format of the numbers in the pager is "11 223" but I would like it to be "11,223" View 11 026 - 11 031 of 11 031 should be View 11,026 - 11,031 of 11,031 I searched the documentation for JQGrid but couldn't find a way to do this. ...