formatting

"user-select: none" and strange behaviour in Firefox

I am trying to prevent text highlighting in Firefox for some, but not all elements on the page. Consider the following: <div style="-moz-user-select: none;"> I cannot be highlighted <div style="-moz-user-select: text;"> I should be highlightable, but am not. </div> </div> As I understand it, using the above css rules, th...

How to round number to 2 decimals

on my way to help a fellow I wrote a simple F-Script without even knowing the existing of such language http://forums.marketcircle.com/eve/forums/a/tpc/f/2931083693/m/883106236 but I tried to find a way to round the number to 2 decimal places and I found nothing. Can someone help me out that to finalize my help? Thank you. The s...

Format Exception- DateTime and hours

Hi I want to get the hours from the datetime. So if it is 1pm it will just be 1 if it is 10pm it will be 10. So no leading zero to be place on hours 1-9 So I tried to do this DateTime test= DateTime.Now; Console.WriteLine(test.ToString("h")); I get this System.FormatException was unhandled Message=Input string was not in a c...

Python: Not all of arguments converted during string formatting

Im wrtiting a script which saves the current date and time as a filename but I get an error stating "TypeError: not all arguments converted during string formatting" I am new to Python andmay of missed something obvious. Code below: from subprocess import Popen import datetime today = datetime.date.today() today = str(today) print to...

New lines in tab delimited or comma delimtted output

I am looking for some best practices as far as handling csv and tab delimited files. For CSV files I am already doing some formatting if a value contains a comma or double quote but what if the value contains a new line character? Should I leave the new line intact and encase the value in double quotes + escape any double quotes within ...

Python string formatter for paragraphs

I'm trying to format some strings for output on the command-line, report style, and am looking for the easiest method to format a string such that I can get automatic paragraph formatting. In perlform formatting is done through the "format" function format Something = Test: @<<<<<<<< @||||| @>>>>> $str, $%, '$' ....

Render a newline in my data inside a jqGrid cell

First off, I'm using version 3.7.1 with a jQuery UI framework theme. I'm trying to figure out how to have a newline or even a <br /> render inside of a jqGrid cell. An example of what I'm looking to have happen: ________________________________________________________ Item 1 | some data | Applies to OS 1 ...

What is the easiest way to format json data in a text box on a web page?

I am currently using edit_area_full.js on a few web pages to format python code examples. I have a few cases where I want to pretty format json data, but edit_area does not support json. What is the best drop in replacement for edit_area that can format json data in a text box in a webpage? Here is how I am formatting python code. <p>...

Code formatting in Aptana 3

I'd like to know how can I find HTML code formatting in Aptana Studio 3.0 which had shortcut Ctrl+Shift+F in Aptana 2.x? ...

Excel : Conditional formatting

I have two columns, **COL-A** **COL-B** 1 419 393 2 2199 1513 3 3 3 4 23 20 5 3 3 4 2964 2181 I want to have conditional formatting using color scales between each A1 B1, A2 B2, ... Currently when compared, 419 is g...

Tomcat Servlet Default Datetime Format

I'm trying out Endeavour Software Project Management.It's running as a servlet in Tomcat (Catalina). The package came with tomcat and jre configure, got it running quite easily. Everything was fine, except that the Datetime format wasn't as per my machine's configuration. I couldn't find a place to configure the Datetime format. Not in t...

Right align a string formula in Crystal Reports

I've got a crystal reports formula that displays a string based on an input Simplified: if (a=1) then "Abc" else "Abcdefghijkl" The problem is that I want this field right aligned. In the "Format Editor" I have set the "Horizontal Alignment" to be "Right", but it hasn't changed the formatting when I run the report. Any idea'...

Best way to display decimal without trailing zeros in c#

Is there a display formatter that will output decimals as these string representations in c# without doing any rounding? decimal -> string 20 -> 20 20.00 -> 20 20.5 -> 20.5 20.5000 -> 20.5 20.125 -> 20.125 20.12500 -> 20.125 0.000 -> 0 {0.#} will round, and using some Trim type function will not work with a bound numeric column ...

forcing 4 digits year in java's simpledateformat

I want to validate and parse dates using a simpleDateFormat with the format "yyyymmdd" This also allows 100624, which is parsed to the year 10 (54 years after Julius Ceasar died). The dates will also be something like 1970, so I don't want to settle with SimpleDateFornat("yymmdd"). I'm wondering is there a way to force a four digit year...

Make 2 doLogs display on the same line.

- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark { [self doLog:[placemark.thoroughfare description]]; [self doLog:[placemark.locality description]]; if ([geocoder retainCount]) [geocoder release]; } Displays as: How can I make this work so that I can display these (thoroughfare & locali...

ReportViewer format text with HTML Tags

Is there a way to simply format text within the ReportViewer Control so it is formatted correctly and the tags do not display. I have text within a database field stored similar to the following: this is some text.<p/><p>more textaslkdflsdlfkdslskfasldf<p/><p>&nbsp;</p><p>asdkfksadjf &ndash; aslkfdskfd</p> I'd like it to display norma...

TSQL format the date difference to be "YY years MM months and DD days"

Ok this is a little bit of a strange request. We are trying to get a formatted "age" statement to come out in a report in PeopleSoft, it provides a "TSQL" based builder which is fairly unhelpful. We cannot use stored functions and we cannot edit the entire SQL statement as one thing. All we can do is say field by field what the formula i...

How to do text formating in C# for adjusting text in some control.

I have created a user control on winform where i want to display some text on Label Control at runtime. Here I used textFormatFlag as WordBreak and then displays it in the next line. Size of label is fixed in width while variable in height. Now the problem here is how to break a string if there is no space between i.e. no WordBreak Prese...

[bibtex] How to change citation format?

Hi all, I'm using Harvard citations in a paper. I use the following options: \usepackage{natbib} \bibpunct{(}{)}{,}{a}{}{;} ... \bibliographystyle{plainnat} \bibliography{Comparison} When I use \cite and \citep I get the following at the end of the pdf: S.Shekhar and S.Chawla. Spatial databases: a tour. PrenticeHall, 2003. Actua...

Convert Unix Timestamp to human format in Django with Python

Hi, I'd like to a convert unix timestamp I have in a string (ex. 1277722499.82) into a more humanized format (hh:mm:ss or similar). Is there an easy way to do this in python for a django app? This is outside of a template, in the model that I would like to do this. Thanks. edit I'm using the python function time.time() to generate the...