formatting

HSSFCell created with Numeric format changes to Date format on editing in Excel

Hi, I am using HSSF-POI(3.2) for writing an Excel file(2003). The structure of a row is: DATE_COL1, NUM_COL1, DATE_COL2, DATE_COL3, DATE_COL4, NUM_COL2; DATE_COLs and NUM_COLs are formatted as dates and numerics respectively. While creating the sheet I dynamically set the formats and the data too, which gets set correctly. On editing th...

Java formatting style

Is the formatting below some kind of convention in Java? I personally found it more difficult to read, than the second example. Am i alone here? And is there a way to make such a custom formatting in NetBeans when choosing Source -> Format? public boolean handleEvent(Event e) { if (e.target == quit) System.exit(0); else if (e.ta...

Format TimeSpan greater than 24 hour

Hi, Say I convert some second into the TimeSpan object like this. Dim sec= 1254234568 Dim t As TimeSpan = TimeSpan.FromSeconds(sec) How to format TimeSpan object into a format like the following: >105hr 56mn 47sec Is there any built-in function? or I need to write a custom function. Thanks. ...

dijit.form.Number doesn't show numbers in exponential form corretly

I have a number Dojo control that shows numbers with 30 digits after point. It formats numbers correctly, but when the number is small enough e.g. 8e-13, control shows something like 8e-13,000000000000000000000000000000 rather than 0,000000000000800000000000000000. Apparently it fails and becomes marked as invalid. I tried to pass "round...

Javascript: How to generate formatted easy-to-read JSON straight from an object?

Hi all. I know how to generate JSON from an object using JSON.stringify, or in my case the handy jquery-json from google code (http://code.google.com/p/jquery-json/). Now this works fine, but the output is hard to read for humans. Is there an easy way / function / whatever to output a neatly formatted json file? This is what I mean...

How to format unsigned int into 8 digit hexadecimal number?

I want to format an unsigned int to an 8 digit long string with leading zeroes. This is what I have so far: unsigned int number = 260291273; char output[9]; sprintf(output, "%x", number); printf("%s\n", output); // or write it into a file with fputs Prints "f83bac9", but I want "0f83bac9". How can I achieve the formatting? ...

EditingCommands of the WPF RichTextBox loose its binding when they are not put within a ToolBar

Using the below code in a DataGridTemplateColumn of the DataGrid, my formatting buttons are disabled(grayed out). The formatting buttons are only enabled when they are put in a ToolBar. When the buttons are put in a ToolBar I do not need the CommandTarget. So when I put them outside a ToolBar some could think it must work with CommandTa...

What is a meaningful format to save formatted text in the database?

I have an existing application that has some parts of formatted text-blocks (standard formats such as bold, italic, unordered list, …) saved in the database. Currently these text-blocks are saved in a custom xml format. The editor is created with a WPF-RichtTextBox. Since I have to make the editor more user-friendly and extend the appli...

Format hard drive with javascript

A while ago a colleague of mine said something astonishing to me: he said that one can format a hard drive using javascript! I just replied 'no, this is impossible'. He seemed to be very confident however, although he also mentioned that this is possible for windows only... Since then I can't give up thinking on it, but I haven't found a...

Calculating bytes to MB

The mysqladmin command returns the values in bytes. I will like to see the value in MB if it is greater than 1 MB (1048576 bytes). $ mysqladmin variables +---------------------------------+----------------------------------+ | Variable_name | Value | +---------------------------------+-------...

Change timezone in C#

I have a date format, something similar to: Mon, Sun, 22 Aug 2010 12:38:33 GMT How do I convert this to EST format? Note: I know it can be achieved using TimeZoneinfo, but that is introduced in 3.5, i want to do it 2.0 or any old version. ...

How to make RSS feed as auto discoverable in asp.Net

In my asp.net 3.5 C# application I had RSS feed in some of my web pages.I am using SyndicationItem object to prepare RSS feed and using using System.ServiceModel.Syndication dll to prepare RSS page. I want them to be auto discoverable i.e The RSS feed button in IE at the browser level should get highlighted when we go to the page with R...

Excel: Adding a Connector Line In a Chart (Have to Use a Macro)?

So I'm working on this chart in Excel, and the chart looks like two sides of a triange, like the picture at the link below: http://a.imageshack.us/img832/6207/triangle.png. I'd like to make a line (like, with an autoshape for example) that connects the 2 endpoints to form a triange; ie a line going from coordinates (4,1) to (4,5). I t...

HTML Forms Problem - Adds a line after it ends

<td> <form name="search_form" action="" method="POST"> <input type="text" name="search_text"> <input type="submit" name="search_bt" value="Go"> </form> </td> now when ever we use this code it adds an extra line after it ends.... see the image below see the red boxed area... there is nothing there... nothing b...

PHP/MySQL: store formatting of text properly?

I'm writing note software in PHP (to store notes) and most often I include code within, when I fetch the note from the database it collapses all whitespace I assume, so any code blocks look ugly. (I nl2br() it, I mean horizontal space) What would be the most efficient way to deal with this? I think the database entry keeps the spaces, s...

PHP remove first zeros

Want to remove all 0 placed at the beginning of some variable. Some options: if $var = 0002, we should strip first 000 ($var = 2) if var = 0203410 we should remove first 0 ($var = 203410) if var = 20000 - do nothing ($var = 20000) What is the solution? ...

Django: using intcomma with floatformat

Found out about using intcomma with floatformat here, but have not been able to get it working. Here's what I've done: 1) Add django.contrib.humanize to installed apps 2) Add {% load humanize %} to top of template 3) Using {{ feeditem.distance|floatformat(0)|intcomma }} in the code Interestingly, floatformat:0 and floatformat:"0" did...

Is there any short hand on formatting the String?

I am using objective c, and I got some variables like this: 1100 920 845 1439 But I want to change it to : 11:00 09:20 08:45 14:39 The problem is how can I fill the zero when I got three number only? I know the logic can be simple to do it I detect the string length, but is there any way to do it more effectually? Thank you. ...

[GRAILS] using different formats for BigDecimal in bindData

Hi, i have a class class Foo { BigInteger phase BigDecimal amount BigDecimal percent } and want to use bindData to map some user input. The user enters data in different formats for amount and percent i.e. : amount : 100.000,00 percent : 75,50% bindData parses this to amount = 100000 (in GERMAN...

Is there a tool for formatting Delphi code?

Possible Duplicate: Online Code Beautifier And Formatter for Delphi or Pascal I've got unreadable Delphi source code. Is there an online service I could use to reformat the code? ...