format

How to format URL for better indexing from search engines

Let say I want to refer to a restaurant page, I could use one of those 2 URLs for example: 1- /restaurants/123 2- /restaurants/Pizzeria-Mamma URL 1 has the advantage to be a quick match because of the ID but it is not as descriptive as URL 2. Does URL matter to search engines? I read somewhere that it is good to put the keywords in t...

string format in C#

I have value ranging from 1 to 10000000. After value 10000 i need to show values as 1E6,1E7,1E8,.... How to set this in string.Format ? Thanks to all for replying. Now i am able to display 1E5,1E6,1E7,....by using format "0.E0" but i dont want to set "E" from 1 to 10000. How to go about this ? ...

need info on open source tools/libs

for (i) generating control flow graphs(CFGs) for Java & C based applications (ii) pref these graphs in GXL format (I came to know that lots of graph visualization tools accept gxl format files (iii) performing graph traversal algos by reading the graph from gxl format. Also what is the best representation of CFGs ...

Database-safe Date/Time String?

Which format of a date/time string would be considered cross-platform, cross-database, universal safe? Would this YYYY-MMM-DD HH:MM:SS be considered safe to use in MySQL, SQLite 2 & 3, MsSQL and other common databases? How about something like 2010-Jul-12 12:00:00pm? ...

Common Log format bytes - access log : Clarification

I thought I knew this, but am confused :( Need some clarification on it - In the CLF format (access log for httpd, tomcat, jboss, weblogic etc etc), what does the "bytes" field indicate ? Is it the bytes transferred from the server to the client or client to the server ? I believe its the former ; but in that case what happens when the ...

FCKeditor: displays the formating characters along with text.

have a form that uses FCKeditor. I can input with formatting, but when I bring back what I put in FCKeditor it also displays the raw html format syntax. I.E. <p>&lt;p&gt;&amp; Question: is there a setting I'm missing that uses the formatting to format the text instead of displaying the formatting syntax along with the text? thanks Ra...

Which formats are available for Keys Enum?

Hi all. I have a next problem. I need to represent a pressed keys combination in a text form. I got pressed keys from KeyEventArgs e... And when I try to use following code e.KeyData.ToString(); I got something like this: N, Control .... But I want to get Ctrl+N string. I think that must be present specific format for String.Format becau...

python string format suppress/silent keyerror/indexerror

Hi, Is there a way to use python string.format such that no exception is thrown when an index is missing, instead an empty string is inserted. result = "i am an {error} example string {error2}".format(hello=2,error2="success") here,result should be : "i am an example string success" Right now, python throws a keyerror and stops ...

Objective-C how to print out leading 0 for a float?

How do you print out leading zeros for a float using NSString type? Input: 3.14 Desired Output: 03.1 Using Format: @"%02.1f" Output is 3.1 ...

R: Date format when writing a zoo object to a file?

Hello I've been playing for a while with zoo package. I can read files using the format="%Y-%m-%d %H:%M" option But how can I use this option when writing the results back to the disk? I mean, the default format seems to be "%m/%d/%Y %H:%M" and I need to be "%Y-%m-%d %H:%M" Where can I change it? cheers ...

ASP.NET MVC string formatting c# - by 100 characters make 4 rows each 25 characters

I have a string with 100 characters and it is for me too long in one line. I want to make NewLine after each 25 characters. For example: Instead: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." Just a: "Lorem ipsum dolor sit ...

How to convert price by format

Hey I have encountered with a problem with pricing. I need to format price input to be of the type XXXX.YY the problem is, the input price can be of shape XXX,YY in europe or XX,XXX.YY if talking about big numbers. Is there a JS or C# lib that helps there? thanks ...

How to get the right timezone(server timezone) from the UTC date format

As follow up of the below link. http://stackoverflow.com/questions/3215508/how-to-format-this-date-type-2010-06-24t000000z-to-sun-24-06-10-7-15-p-m-cdt I'm converting the utc date format to simple date format. 2010-06-24T00:00:00Z to sun,24/06/10 7.15 p.m (CDT) (converted time) But is there a way to identify the valid timezone, as t...

PHP MySQL input HTML tags

I have a PHP MySQL database which I will be storing all my information in. I have a text field on a HTML page that the user can add data to and then on submit a MySQL query inserts this information into a database. Pretty standard stuff. However, I am now in a position where I can attach a TinyMCE or FCKEditor onto my text field (now a ...

How do I choose a good magic number for my file format?

Hi, I am designing a binary file format from scratch, and I would like to include some magic bytes at the beginning so that it can be identified easily. How do I go about choosing which bytes? I am not aware of any central registry of magic numbers, so is it just a matter of picking something fairly random that isn't already identified ...

iPhone Dev: How to get string format attributes like NSLog

Hi all, I'm trying to wrap NSLog function just to add some info every time I log something, but I have a problem. The NSLog declaration is void NSLog(NSString *format, ...) __attribute__((format(__NSString__,1,2))) this allow to have multiple parameters in call as NSLog(@"first %@ second %@ third %d,string,string,number); My decl...

How to determine real format of an XLSX Excel file?

Hi! I have a well known problem that is described in Extension Warning On Opening Excel Workbook from a Web Site microsoft blog entry. I've added URL rewrite to have URL nicely formatted and my mime type matches exactly XLSX recommended file type. However I still get a warning. I suspect that service that provides me those xlsx files m...

How to read data from a repeated format of a large text file in MATLAB?

I want to read data of average saturation (%) for water as shown below. This data is a partial form of a large file, however the average water saturation (%) REPEATS itself in the given format only. Average Pressure Total Pore Volume psia 3884.9 ...

Print a leading '+' for positive numbers in printf

I've a temperature conversion program as an assignment, which I've completed. The program has many printf statements in it which print the temperature. Now the negative temperatures are printed the way I want them but the positive temperatures are printed without a leading + sign. Now what is the best way to get printf print a leading ...

Formatting usb flash drive on Mac OS X

Good Day, How can I format an USB flash drive using cocoa frameworks or carbon? Is there any functions to make it? Thanks, Vlad ...