formatting

Need RTF/doc to html converter, preferably free

I have a problem with low end users needed to convert word documents to html. Their formatting sucks and so does the standard word html conversion. I don't particularly feel like teaching marketing people html, so I was wondering what might be a good (cheap/free) solution. They are happy to copy paste text from word into RTF (as comple...

The origin of sprintf-style string formatting

The string formatting concept found in sprintf can be found in almost any language today (you know, smothering a string with %s %d %f etc. and providing a list of variables to fill their places). Which langugage was it originally that had a library function or language construct which offered this functionality? Please specify some ki...

Excel Conditional formatting with weighted total

I have sets of values in rows in Excel First row contains weights of how much each value in each column contributes to weighted total. Now, I want to mark in each following row the value that contributed to the weighted total the most, by changing its background. I played with conditional formatting, but my Excel skills are modest, to sa...

Formatting an if statement for readability

What's the best way to format this for readability? if (strpos($file, '.jpg',1) && file_exists("$thumbsdir/$file") == false || strpos($file, '.gif',1) && file_exists("$thumbsdir/$file") == false || strpos($file, '.png',1) && file_exists("$thumbsdir/$file") == false) { createThumb("$gallerydir/$file", "$thumbsdir/$file",$thumbsize); ...

Convert time fields to strings in Excel

I have an excel sheet full of times. They are formatted so that they look like: 1:00:15 However if I change the format on the cells to text, they change to the underlying numeric representation of the time: 0.041840278 How can I convert the cells to be text cells but still have the time in them ? ...

Can you propose a more elegant way to 'tokenize' c# code for html formatting?

(This question about refactoring F# code got me one down vote, but also some interesting and useful answers. And 62 F# questions out of the 32,000+ on SO seems pitiful, so I'm going to take the risk of more disapproval!) I was trying to post a bit of code on a blogger blog yesterday, and turned to this site, which I had found useful in ...

How to find out about the accepted coding styles

Where to read up on (the best-practice in) source code formatting, for individual languages i.e. what are the conventions for naming variables etc., for indentation and where to place braces, how and where to include comments, etc. For example for C Kernighan and Ritchie's book The C Programming Language and Linus Torvalds' Linux kerne...

What is the simplest way to format a timestamp from sql in php?

What is the simplest, fastest way to complete the PHP code below such that the output is in a user-friendly format (e.g."October 27, 2006")? $result = mysql_query("SELECT my_timestamp FROM some_table WHERE id=42", $DB_CONN); $row = mysql_fetch_array($result); $formatted_date = ???($row['my_timestamp']); echo $formatted_date; ...

Ms-Chart Label Format Question

I created a PieChart with the new Ms Chart Controls. How can I format the Labels (Point Values inside the Pie) like the folllowing: "LabelName AbsoluteValue (Percentage)"? For example: "Usa 856027 (56 %)". Is this possible with the right format information in LabelFormat alone (How?) or do I have to use a custom label format (How?) ? T...

Can I Format A String Like A Number in .NET?

If I had a phone number like this string phone = "6365555796"; Which I store with only numeric characters in my database (as a string), is it possible to output the number like this: "636-555-5796" Similar to how I could if I were using a number: long phone = 6365555796; string output = phone.ToString("000-000-0000"); I've...

What time format is this? (not UNIX, not UTC, nothing)

I'm importing data from another system to MySQL, its a CSV file. The "Date" field however contains cryptic of 3-digit time entries, here's a random sample set: > 540 > 780 > 620 > 965 What's this? obviously its not 5:40 and 6:20. But it's not UNIX either (I tried 1225295**XXX** before I realized the time range this represents is about...

Is it possible to format Tooltip-Text (bold, underline... etc) ?

I want to make some passages of a standard tooltip bold in a WinForms application. Is this possible? If not, is there a (free) tooltip component that allows me to style them (preferably also border and background)? Thanks! ...

Is there a C# auto formatter that I can use to define custom rules for formatting?

My group has a source analysis tool that enforces certain styles that we have to comply with. I can't change it, and some of the rules are just a pain. One example is that all properties have to come before methods, and all constructors must come before properties. It seems silly to me that I have to take time to do something to the p...

PHP strptime format bug?

I am wrestling with a php 5.2.6 problem. An api we use returns dates in this format DDMMYYYYHHMM. Exactly that format, fixed length, no delimiters. However, in my experimentation, this format seems to break strptime, which returns a false (fail) when I feed it a date in this format. It can reproduced, at least on my system, with this exa...

How do I keep Python print from adding spaces ?

In python, if I say print 'h' I get the letter h and a newline. If I say print 'h', I get the letter h and no newline. If I say print 'h', print 'm', I get the letter h, a space, and the letter m. How can I prevent Python from printing the space? The print statements are different iterations of the same loop so I can't just...

HTML Formatting in Visual Studio 2008

Is it possible to turn off all HTML formatting in Visual Studio 2008? It just totally messes everything up. For example, I'll add a grid with columns, styles, etc. with them all indented and on separate lines. I'll switch to design view or split view and all the work I just did is on one line! It is so frustrating. I've changed some thi...

When writing code do you wrap text or not?

I know a lot of people have their ide wrap lines in the code editor but i've always been of the thought that one statement = one line. Thoughts? ...

Multiple Cell Background Colors in Excel Spreadsheets

Excel has a Conditional Formatting... option under the Format menu that allows you to change the style/color/font/whatever of a cell depending upon its value. But it only allows three conditions. How do I get Excel to display say, six different background cell colors depending upon the value of the cell? (IE Make the cell red if the v...

What are the best software and templates for a programming blog?

I have a programming blog that was implemented using the default theme of Movable Type. To that, I have added myself a syntax highlighting plugin for adding code snippets. It's not the best thing in the world, but it served its purpose for a long time. Problem is my administrative interface's editor is no longer working so I think it's ...

Moving data from Word to Access seamlessly

I am trying to migrate structured documents (i.e. documents that are mostly some metadata and one big table) to a database. When I try to move tabular data from Word to Excel, my main point of pain is handling CRLFs within a cell in Word. Any solution for this? Now, since I will be transferring from Word to Access: What will be the de...