formatting

c# string format issue

Hi guys I need to convert a string to a monetary format of {###}.###.###,## that is a value of 5461497702600 would become 54.614.977.026,00 The numbers become excessively large. I am using return string.Format("{0:#" + (val < 1000 ? "" : "\\.") + "##0.00}", val); which returns for the example 54614977.026,00 (only one dot) ...

LaTeX indentation (formatting) in Emacs

Hi, what is the correct way to do indentation of a LaTeX document in Emacs (AucTex)? For example when I have a list: \begin{itemize} \item orem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam enim urna, mattis eu aliquet eget, condimentum id nibh. In hac habitasse platea dictumst. \item orem ipsum dolor sit amet, consectetu...

What's the best way to format long strings of HTML in PHP?

I know it's really a subjective question, but for best-practices (and readability), I can't seem to get a fix on the best way to format long strings of HTML. I typically do it like this: echo ' <div> <p>Content Inside</p> <div class="subbox"> <ul> <li>etc.</li> <li>etc.</li> <li>etc.</...

Mass update of data in sql from int to varchar

We have a large table (5608782 rows and growing) that has 3 columns Zip1,Zip2, distance All columns are currently int, we would like to convert this table to use varchars for international usage but need to do a mass import into the new table convert zip < 5 digits to 0 padded varchars 123 becomes 00123 etc. is there a way to do this sh...

flex builder datagrids formatting

is there a way to control the text positioning in the datagrid cells in Flex so that all text in subsequent columns align on the same rows? ...

How can I get approximate time passed since some timestamp?

Is there any useful module on CPAN that returns number of biggest fractions of date interval, i.e. return integer number of years/months/days/hours/minutes/seconds between two dates, to use in sentence like "N days ago" or "M months ago" ...

Extra leading zeros when printing float using printf?

I'd like to be able to write a time string that looks like this: 1:04:02.1 hours using printf. When I try to write something like this: printf("%d:%02d:%02.1f hours\n", 1, 4, 2.123456); I get: 1:04:2.1 hours Is it possible to add leading zeros to a float formatting? ...

PHP: convert date format yyyy-mm-dd => dd-mm-yyyy [NOT IN SQL]

hey guys, i am trying to convert a date from yyyy-mm-dd to dd-mm-yyyy however i dont know how the date function requires a timestamp and i cant get a timestamp form this string... anyone an idea? thanks Matthy ...

Square Bullet in XSL-FO

I am attempting to create a list in XSL-FO using a square bracket. I have been able to get it working using the standard unicode bullet character (&#8226;) but I just can't seem to get it working for square brackets. I have tried using &#9632;, but that does not seem to work. It is important that i can get the square bullets working bec...

Image File In Text Editor - What Are The Characters? What's the Process?

i'm currently in the process of conceptualizing an art piece for a gallery show next year, so this bizarre question of mine is more than just simple curiosity. if i open up an image file (a .PNG) with Text Edit or Note Pad, the file is presented in textual characters. here's an excerpt: ˇflG¿§vÑ$BaçC$ èœ≥à-ƒ…åGj!mëA»T‰dÚ%ryǬF1¢ƒQ∑P®...

Write formatted text(printf style) to a MFC CEdit control, which would display the formatted text in a EditControl?

I need to display text along with values of variables in a CEdit controlled Edit Control Box. How do I do it ? Currently I'm using SetWindowText(), but that only takes a string...how do I get a formatted string to display in the edit control? Example: printf("The answer is %d\n",ans) -> how do i print the same message in a Edit Control...

NSDate expressed in different time zones, i.e. local time zone (GMT-400) to PST

I know how to use NSTimeZone to derive the offset for the current time in another time zone. NSDate always returns relative to GMT, so how do I derive a string with the proper time zone information? i.e. I take the current time where I am (in EST) and using NSTimeZone end up subtracting the 3 hours necessary to represent the time in PST....

formatting the output of a sql query.

Hi! I am using solaris os. from solaris im logging into sql plus. my database is oracle 9i. i am spooling the output of my query into a file. i want in .csv format so that i can copy it into excel. can any1 help me out. my query is like. select name,id,location from employee; ...

C++ printf: newline (\n) from commandline argument

How print format string passed as argument ? example.cpp: #include <iostream> int main(int ac, char* av[]) { printf(av[1],"anything"); return 0; } try: example.exe "print this\non newline" output is: print this\non newline instead I want: print this on newline ...

Java Date exception handling try catch

Is there some sort of exception in Java to catch an invalid Date object? I'm trying to use it in the following method, but I don't know what type of exception to look for. Is it a ParseException. public boolean setDate(Date date) { this.date = date; return true; } ...

LaTeX lstlisting not highlighting keywords when basic style is ttfamily

Hello, I'm working on a LaTeX document and using lstlisting to display my Java source code. My setup looks like this: \lstset{ basicstyle=\ttfamily, keywordstyle=\bfseries, language=Java, frame=single, aboveskip=11pt, belowskip=11pt, breaklines=true, breakatwhitespace=false, showspaces=false, showstringspaces=false } The k...

How to output formatted HTML from PHP?

I like to format all my HTML with tabs for neatness and readability. Recently I started using PHP and now I have a lot of HTML output that comes from in between PHP tags. Those output lines all line up one the left side of the screen. I have to use /n to make a line go to the next. Is there anything like that for forcing tabs, or any way...

Suggestions for displaying code on webpages, MUST use <br> for newline

Hi, I want to post code snippets online (wordpress.com blog) - and have its whitespace formatted nicely. See the answers suggested by this other SO question: Those would be OK, except that I like to copy code to clip board or clip entire pages using Evernote - and they use either the <pre> tag or <table> (or both) to format the code. ...

formatting and converting in java

I have few small basic problems : How to format : int i = 456; to give output : ""00000456" ? I've tried %08d but it's not working. Next thing is a problem with conversion and then formatting. I have side and height of triangle, let's say int's 4,7, and 7 is the height. From formula for field we know that F=1/2(a*h). So how to get...

Textarea to paragraphs

When I have to render textarea content to the front end I usually pass it thru a function that converts newlines to <br/> tags and double newlines signal paragraph tags so blocks of text get surrounded by <p> and </p> tags. To save time I usually use a ready made PHP function from the wordpress codebase. You can get the link from the ma...