format

Format integer to string with 5 digits

I need to have a string, based on an integer, which should always have 5 digits. Example: myInteger = 999 formatedInteger = "00999" What is the best way of doing this in classic ASP? ...

c# Treeview Node with formatted text e.g. tabs & new lines

Is it possible (by using the stock c# TreeView) to have Multiline TreeNodes? Also, is it possible to add control characters to TreeNode's text e.g. '\t'? This same effect could also be achieved by adding columns to the TreeNode. is this possible? ...

C++ format macro / inline ostringstream

I'm trying to write a macro that would allow me to do something like: FORMAT(a << "b" << c << d), and the result would be a string -- the same as creating an ostringstream, inserting a...d, and returning .str(). Something like: string f(){ ostringstream o; o << a << "b" << c << d; return o.str() } Essentially, FORMAT(a << "b" ...

Warnings using format strings with sprintf() in C++

Compiling this lines long int sz; char tmpret[128]; //take substring of c, translate in c string, convert to int, //and multiply with 1024 sz=atoi(c.substr(0,pos).c_str())*1024; snprintf(tmpret,128,"%l",sz); I read two warning on snprintf line: warning: conversion lacks type at end of format warning: too ...

How do I render a partial of a different format in Rails?

I'm trying to generate a JSON response that includes some HTML. Thus, I have /app/views/foo/bar.json.erb: { someKey: 'some value', someHTML: "<%= h render(:partial => '/foo/baz') -%>" } I want it to render /app/views/foo/_baz.html.erb, but it will only render /app/views/foo/_baz.json.erb. Passing :format => 'html' doesn't help. ...

What do you use (free) to format C# code?

Are there any VS.NET plugins that will format a selection of code for printing or emailing and is also free? ...

Reporting Services Rendering format restriction

Hi, Is there any way i can restrict my rendering format to PDF for one of my report in Report Manager. Thanks, brijit ...

FIle format of eclipse workspace files

Is there a (good) documentation about the format of the eclipse workspace files (.location, x.tree, ...)? I need this to programatically create a workspace for automated builds. Unfortunately I have to do this job from a .NET program, so I can't use any Eclipse classes to do this! (We manage our Linux C++ projects using Eclipse + CDT). ...

String.Format or Not?

Duplicate from : http://stackoverflow.com/questions/16432/c-string-output-format-or-concat Especially in C# world using String.Format for everything is really common, normally as VB.NET developer unless I have to* I don't String.Format, I prefer normal string concatenation, such as: V1 = V2 & "test-x" & V3 & "-;" to me it's better ...

Is it possible to make Eclipse ignore syntax checking/formatting for one specific file?

I'm using Eclipse as an IDE for Ruby/Rails development (using Aptana plugin). I have one very, very large file that encompasses an initial data load of several thousand rows of data. When this file is open, everything grinds to a halt (on both Windows and Linux), presumably because Eclipse is tied up trying to parse and format/syntax-che...

Boost.format and wide characters

Is there a way to get boost.format to use and return wide (Unicode) character strings? I'd like to be able to do things like: wcout << boost::format(L"...") % ... and wstring s = boost::str(boost::format(L"...") % ...) Is this possible? ...

How to customize date format when creating excel cells through javascript (activexobject)?

Hi all, I'm trying to convert an HTML table to Excel in Javascript using new ActiveXObject("Excel.application"). Bascially I loop through table cells and insert the value to the corresponding cell in excel: //for each table cell oSheet.Cells(x,y).value = cell.innerText; The problem is that when the cell is in date format of 'dd-mm-yy...

PHP date calculation

What is the best (date format independent way) in PHP to calculate difference in days between two dates in specified format. I tried the following function: function get_date_offset($start_date, $end_date) { $start_time = strtotime($start_date); $end_time = strtotime($end_date); return round(($end_time-$start_time)/(3600*24)); } ...

Protection from Format String Vulnerability

What exactly is a "Format String Vulnerability" in a Windows System, how does it work, and how can I protect against it? ...

Change date format that MySQL reads

I have a batch file that was created for an Oracle database that I'm now trying to import to a MySQL database. I've had to deal with all sorts of inconsistencies between the two. The file has all the dates as '17-NOV-1981' rather than '1981-11-17' as MySQL expects. The batch file had the command *ALTER SESSION set nls_date_format='DD-M...

Alternative to CString::Format?

Is there any better alternative for doing string formatting in VC6, with syntax checking before substitution? ...

Informix JDBC timestamp string format

I have Informix database with timestamp field defined as YEAR TO SECOND. When I show this field using JDBC rs.getString(column) it uses format with miliseconds so this field looks like: 2008-12-18 13:58:14.0 I would like it to use only YEAR TO SECOND fields. I set environment variable: GL_DATETIME=%Y-%m-%D %H:%M:%S but even then I go...

create sql query in c++/java?

which method do you prefer for creating dynamic sql queries? formating or streaming? Is it just preference or there any reason one is better than other?Or any special library you use to it. EDIT: Please answer in case of c++. ...

Software to mark bad blocks on SD card?

Do any one know a software to check AND mark bad blocks on SD card? To clarify - bad block is a block of card which can't store data. The problem is - no error reported on read or write operation. The only way to check it is to write data and then read it. There is tool to check and find those blocks, but it will not mark them as bad. ...

Document,text format

Hi, to my project i need document editor for many types of documents(tabular data, invoices, letters, some formulars,...) and i am looking for text format and editor to acompish my task is there some MS Word like format? I know for example rtf, I need formating, invissible comment will be veeery good open format same 3th p. editor wi...