formatting

Free SQL formatting tool?

Hey, is there a good free tool out there that can also format complex queries? Thanks :-) ...

codeigniter html output (for forms in this case)

Hey, I was wondering, is there any easy way to have the html generated by codeigniter be more structured and more readable? For example, if I do this: echo form_open('do/send',array("id" => "contact_form")); echo form_label("Name:", "name"); echo form_input(array("name" => "name")); echo form_submit("submit", "Submit"); echo form...

Free text editor to fix indentation of messy JSPs?

Hi, all. I'm developing a VXML IVR application in Eclipse, and it's chock full of messy JSPs. Some of my (inherited!) source looks like this: <%if (useLegacy) {%> <form id="getLegacy"> <block> <if cond="gblFirstRunThroughFlag=='true'"> <%--Use special "extra info" menu to retrieve the legacy ID--%> <goto next="getLegacyInfoFirst.jsp"/...

Serialize Datetime without GMT in C#

Hello, I have generated classes from xsd and want to serialize the DateTime. My class looks like private System.DateTime timeGMT; [System.Xml.Serialization.XmlElementAttribute(DataType="time")] public System.DateTime TimeGMT { get { return this.timeGMT; } set { this.timeGMT= value; } }...

c# the best way to format your code

Hi All, What is the best way to format your c# code. I'm looking to improve the way my code is formated. I curentlly put all my code into regions (i.e methods functions ect) Is this the best way or are there other ways that work better? Sp ...

How to extend pretty print module to tables?

I have the pretty print module, which I prepared because I was not happy the pprint module produced zillion lines for list of numbers which had one list of list. Here is example use of my module. >>> a=range(10) >>> a.insert(5,[range(i) for i in range(10)]) >>> a [0, 1, 2, 3, 4, [[], [0], [0, 1], [0, 1, 2], [0, 1, 2, 3],...

How to check the data format in PHP

Hi guys. I am trying to check a date format to see if I can check the data variable has certain format like MM-DD-YYYY. if not, then exit(). I am not sure how to check the format and would appreciate if any one can help me about it. Thanks... $date=05/25/2010; if(XXXXX){ // do something.... } ...

Best way to have a formatted output with perl

I want to output strings into 8 columns, but I want to keep the spacing the same. I dont want to do it in HTML, but I am not sure how to do it normally. Example: Something Something Something Something Something Else Else Else Else Else Another Another Another Another ...

Javascript: How to turn the time (stored as a fraction) into a readable string?

I have the time stored as a fraction (done so it can be displayed on a graph), e.g. 15.5 is 3.30pm and 23.25 is 11.15pm. I need to turn those numbers into strings in the format HH:MM:SS. Is there a simple way of doing this? ...

Is there a free SQL formatting library for .NET?

Hey, All: I've been looking for a free library/source code to format SQL queries, preferably in .NET, for quite a while. Even after searching some of the responses here on SO, I'm almost at the point where I'm willing to believe that nothing like this exists. The closest thing I've found, a project called sqlformat, does not seem to b...

LaTeX - left align a table (ie not centred) from the preamble?

I'm making a document in LaTeX, but I can only change the preamble of the document. Inside this document I have tables, made with the longtable environment. By default LaTeX centres each table in the middle of the page. Is there anyway to make the tables be left aligned, given that I can only change the preamble? ...

Are currency formatting functions actually useful?

Many languages, such as .NET languages and Java come with a currency formatting facility built-in. What they do is format a number using a culture-specific number format and add the culture's currency symbol. The problem here is that the number format is strongly coupled to the currency symbol. In practice the number format should be th...

vertical alignment for FORM INPUT FIELDS in safari and chrome

i have a select box with height: 60px. when i user clicks an option, i would want that option text to appear on the lower bottom of the select box...however safari and chrome automatically vertically aligns the text in the middle. I have tried increasing line-height, padding-top, margin-top...but these do NOT work for safari/chrome. ...

PHP sendmail() formatting not preserved

Hello, I am creating a web application for a client that has the ability to send out emails. I am using TinyMCE for my text editor, which works quite nicely. I am using sendmail() with PHP Swiftmailer to handle the actual sending of the email. Swiftmailer works nicely, as well. The only problem that I am running into is that when I rec...

(iPhone)URL formatting question

Hi, I am trying to format a URL but am getting a bug out of it. My code is below. NSString *twitterURL = [NSString stringWithFormat:@"http://twitter.com/?status=My%20score%20is:%i%20and%20CharsPerMin%20is:%@", currentScore, charPerMin.text]; When calling the method it doesn't do a thing. I think the issue is with %20. %20 is being u...

How to set thousend separator for PostgreSQL?

I want to format long numbers using thousend separator. It can be done using to_char function just like: SELECT TO_CHAR(76543210.98, '999G999G990D00') But when my PostgreSQL server with UTF-8 encoding is on Polish version of Windows such SELECT ends with: ERROR: invalid byte sequence for encoding "UTF8": 0xa0 HINT: This error can a...

formatting code snippets on a web page

How do I add code snippets to a web page? I've built a jquery plugin for my front-end team and I want to build a quick page illustrating its use. I want to include some code and i've seen a few sites using stylized code snippets (colour coding, indentation etc). How is this achieved? ...

SimpleDateParser produces incorrect date?

Good morning! I've been working with the following bit of code for the last two hours, scouring forums, Google and the JDK 1.6 docs for any idea what is going on but can't seem to make this work. I would expect the code to output 07/25/2010 11:59:33 PM but what I get instead is 01/25/2010 11:59:33 PM . String dateString = "07/25/2010 ...

XSLT 2.0 How to change default formatting for numbers?

In XSLT 1.0 (using Xalan), outputting the result of: <xsl:variable name="source0" select="number(num3)"/> <xsl:value-of select="$source0"/> was the number spelled out as 2011234. But in XSLT 2.0 (using Saxon), it shows up as 2.011234E6. I want it to always display as 2011234 in the Saxon/2.0 case. Is there a way to set the default pi...

ASP .Net MVC Custom Templating without DisplayFor

I currently have a display template for DateTime? objects that corrects the date depending on the user's time zone. This part of the program is working fine, and when I call DisplayForModel() or DisplayFor(m => m.Date), they both use the template and display the date and time with proper formatting. The problem I am having is I have a p...