formatting

How do I unify logging formats from the java stack

Using a Jetty web server, started from maven, which includes iBatis, Spring, Jersey, a little of this and a little of that, I get logging output with a host of formats. Some are from maven: [INFO] [war:war] [INFO] Exploding webapp... Some are from Jetty: 2009-03-25 21:01:27.781::INFO: jetty-6.1.15 2009-03-25 21:01:28.218:/example:I...

Need a tool to automatically indent and format SQL Server stored procedures

In my current project I've been inherited with lots of long (1200+ lines) SQL Server stored procedures with some horrible indentation and formatting which makes them almost unreadable. Is there some tool that I can use to automatically format these and make them more readable? I don't want to go through it manually and indent it. ...

Formatting timestamps

How do you format Rails timestamps in a more human-readable format? If I simply print out created_at or updated_at in my view like this: <% @created = scenario.created_at %> Then I will get: 2009-03-27 23:53:38 UTC ...

Sharepoint: Calculated Column replace all spaces

Seems like it would be a simple thing really (and it may be), but I'm trying to take the string data of a column and then through a calculated column, replace all the spaces with %20's so that the HTML link in the workflow produced email will actually not break off at the first space. For example, we have this in our source column: fil...

SharePoint 2007: Formatting a FormField

Hello, I'm trying to display the page owner and last modified date on the footer of a SharePoint master page for a publishing site. On my master page I currently have: <SharePoint:FormattedString FormatText="Page owner: {0} Last updated: {1:dd/MM/yyyy}" runat="server"> <SharePoint:FormField ControlMode="Display" FieldName="PublishingC...

Ruby: libxml-ruby and adding nicely-formatted sibling nodes

Given my existing XML (test.xml): <root> <element> <child id="1" /> <child id="2" /> <child id="3" /> </element> </root> And my ruby code: require 'rubygems' require 'xml' parser = XML::Parser.file("test.xml") doc = parser.parse target = doc.find('/*/element') target << child = XML::Node.new('child') child['id'] = '...

Date Time Formating

Hi i need to wirte sql query in such a way that it will retrive the date in the following format dd MM yyyy HH mm ss AM(or PM) eg 31 12 2009 12 45 06 AN ...

Text Format Toolbar

I am looking for how to implement a toolbar similar to the one used here when you add a new question, this toolbar should format the text entered in my text box and allow me to make it Bold, Italic, choose size and fond and highlights, colors as well... One important thing, I want one that is both supported on firefox and IE, discountasp...

In Java, how can I get user input in a console in a curses-like manner?

I just started learning Java at school for cse142, but I've known a bit of programming so am considerably ahead of the class and have been trying my own little projects. Normally if I run into a problem I just work around it because I figure I just haven't learned that yet, but this one bugs me enough to make a whole thread about it. I ...

sprintf outcome problem

Here is my code: <?php $variable1 = 00001; $variable2 = (sprintf('%04d', $variable1 + 1)); echo $variable2; ?> How come the outcome of this code is "0002" and not "00002"? in other words it is missing a 0. ...

XML Parsing Error: no element found

I am using NiceEdit to format text in text areas, it displays a toolbar over the specified text area, I created a test page, its working, I Response.Write the content of the text area after being formatted, and its okay, I created a break point to see whats being read, it was all fine. Now I moved to the real page where I should impleme...

Self redirect an .Asp page and keep the same Request variables

Hello, Am trying to convert the content of a page to an Excel format, the problem is when I redirect the page I don't get my request variables so I found a solution that we should define a hiden variable for each request variable and then define the value after Get call. This is the code that am using now : <script language="Javascript...

Javascript: Easier way to format numbers?

I'm trying to format various numbers on my page. These numbers either represent a price, a change in price, or a percentage. I know Javascript has functions to limit the number of decimal places, but is there any support for other types of formatting, such as grouping numbers with commas, controlling whether or not the +/- is shown, et...

String.Format() split integer value

I'm wondering if it's possible for .Net's String.Format() to split an integer apart into two sub strings. For example I have a number 3234 and I want to format it as 32X34. My integer will always have 4 or 6 digits. Is this possible using String.Format()? If so what format string would work? P.S. I know there is other ways to do this, ...

How to display HTML in a text Area

Dear all, I save formatted text (bold, changed in font, style...etc) in an nvarchar(max) field, its for some Description field, on another stage, I want to be able to edit this description, so in the Editing Page, I read the original inoformation, fill it in the fields and wait for the user to change it and save, this is working for all ...

How to refer to a control that exists within an Ajax Tab?

I have a problem with using a script that adds a NiceEdit toolbar to a text area when that text area is within an Ajax tab. I want to know if I should refer to it in a different way than just the ID. I mean the ID of that text area, I tried to take the text area outside the Tab Container, it works, but when I return it, it simply doe...

Format data, before or after inserting into database?

I can never decide if it's better to format data before inserting it into the DB, or when pulling it out. I'm not talking about data sanitization; we all know to protect against SQL injection. I'm talking about if the user gives you a URL, and it doesn't have http:// in front of it, should you add that before inserting it into the DB or...

Turn off auto formatting in Visual Studio

I'm code purist, preferring own style of code formatting (opposite to suggested by VS 2008) I've turned off auto-formatting options in Tools/options. In most cases it works. But noticed that after refactoring VS demolishes my code... (Eg after using such option as encapsulate field, extract method, using surrounding snippets...) This ...

Changing Latex section numbering presentation

Hi all, I'm trying to change how section numbering is displayed in a Latex document I'm working on. What I want to do is this: Section Title     (i) Subsection title in normal weight         (a) Lorem ipsum (no subsubsection title being used)... I've come up with the following, but it's not right in terms of indenting etc. \renewcomm...

Formatting of XML created by DataContractSerializer

This isn't a big deal for me, but is there an easy way to get DataContractSerializer to spit out formatted XML rather then one long string? I don't want to change the tags or content in anyway just have it add line breaks and tabs to make the XML more readable? <tagA> <tagB>This is</tagB> <tagC>Much</tagC> <tagD> <tagE...