format

binary16 in Python

The struct module is useful when you're trying to convert data to and from binary formats. However, recently I came across a file format specification that uses the binary16 floating point format. I looked through the Python documentation, but can't find anything that can convert to and from it. What would be the best way to convert this...

JTable double formatting

I have a JTable with a doubles column. Most of them are of the form x.xxx. Some of them end with a 0 and that is omitted, so I have a right-aligned table that looks like 1.339 1.34 1.353 ... Any way to pad 0s to the end of it, or make it align by decimal place, or anything along those sorts? I would just assign them to strings and pa...

MicroSoft Reporting Services: hide footer depending on export format?

I'm using MicroSoft Reporting Services (MSRS) 2008. Currently I'm designing reports that can be rendered both as PDF and Exel, which works fine in general. If I define a footer in the designer, I'll see it in PDF and do not see it on the Excel sheet. Although when I print out the Excel file, the footer is there again (in the page preview...

fast auto-guessing of date strings

For a huge number of huge csv files (100M lines+) from different sources I need a fast snippet or library to auto-guess the date format and convert it to broken-down time or unix time-stamp. Once successfully guessed the snippet must be able to check subsequent occurrences of the date field for validity because it is likely that the dat...

string Format - how to change negative sign position

how my dear friends: I have a string.Format like this : string Test = string.Format("{0:#,0}", NegativeNumber); how can I change the negative sign position (Direction -> left or right)? thanks in future advance. ...

How do I parsing a complex file format in Delphi? (Not CSV, XML, etc)

It's been a few years since I've had to parse any files which were harder than CSV or XML so I am out of practice. I've been given the task of parsing a file format called NeXus in a Delphi application. The problem is I just don't know where to start, do I use a tokenizer, regex, etc? Maybe even a tutorial might be what I need at this...

Having a Pretty-Printed XML file from the WriteXml of a Dataset in VB.NET

Hello all, I'm trying to use Dataset.WriteXml() function in VB.Net to generate an XML file with Pretty-Print Layout (I think this is how it's named) like the example below (Listing 1): <MainRoot> <Table1> <Col1>Value1</Col1> <Col2>Value2</Col2> <Col3></Col3> <Col4>Value4</Col4> </Table1> <Table2> ...

iPhone 4.0 NSDateFormatter crashes..

Hi all! I need to convert a NSDate to a string using my personal data format... The problem is that this code on the simulator (4.01) crashes... sometimes the code is "freezed", sometimes give the BAD_ACCESS... here is the code: NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; ...

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 ...

PHP Date format question....

Hi guys. Some folks helped me on http://stackoverflow.com/questions/3326316/how-to-check-the-data-format-in-php post but I need to check two date formats MM-DD-YYYY and DD-MM-YY instead of one. Do I need to setup two regular expression???? Thanks for the help!!! $date1=05/25/2010; $date2=25/05/10; //I wish both of them would...

Date regular expression question...

Hi guys.. I have been working on my date regular expression all day... I want a date format to be YYYY-MM-DD. $date_regex ='^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$'; if (preg_match($date_regex, $dateString)) { echo "good format"; } keeps giving me error preg_match() [function.preg-match]: No e...

Aligning text. Using tables or css or &nbsp; ?

Frequently I am aligning text such as: To: 07/02/2010 From: 07/02/2010 Id like it to be displayed like this: To: 07/02/2010 From: 07/02/2010 So what is the quickest/easiest/best way to do this? CSS? using a few nbsp (would work if its mono spacing) or using tables. Normally if I am not in a anti-hating table mood, ill use tables....

Date format in RangeValidator

I am using RangeValidator to validate date enter in textbox and its working fine with default date format but now i want the date format in "dd/MM/yyy" but its generating excption with this date format. please provide me solution my code: in aspx page: <asp:TextBox ID="txtrequiredby" runat="server" ></asp:TextBox > <cc1:CalendarExtende...

BitmapFactory.decodeByteArray() is returning NULL

I am using the previewCallback from the camera to try and grab images. Here is the code I am using private Camera.PreviewCallback mPrevCallback = new Camera.PreviewCallback() { public void onPreviewFrame( byte[] data, Camera Cam ) { Log.d("CombineTestActivity", "Preview started"); Log.d("CombineT...

$.post in json format using a variable to store the json string?

I need to post 60 inputs. I have built up the json string and stored it in a variable. But unfortunately the following code doesnt work: $.post("process_form.php", my_var); my_var contains a json string in the format: { starta:'1', currenta:'5', finisha:'2', startb:'1', currentb:'5', finishb:'2', startc:'1', currentc:'5', finishc:'2...

bash: output \n \t characters from mysql query

Hi there, I currently have $ echo "`echo "use joomla; describe jos_content" | mysql --batch -u root -ppassword`" and I would expect output that starts like this Field\tType\tNull\tKey\tDefault\tExtra\n but instead I get Field Type Null Key Default Extra I have tried all sorts of items at the moment. I could use mysql --h...

how to work with container components using FFmpeg?

So are there any examples\materials on how to work with containers elements using ffmpeg? GFLV "tags" for example or Mpeg atoms? ...

printf not printing to xcode debugger when format string is involved (in a plugin environment)

Hi, I have a pretty obscure problem here. I'm writing a photoshop plugin (for mac) using Xcode. I use printf statements for simple debugging. A printf without a format string works fine, however, if I use a format string to try and print out a value it does not show up in xcode's debugger console. #include <stdio.h> DLLExport ...

How would I go about converting a hexadecimal representation of a private key to a OpenSSL supported format(PEM/DER/?)

The title basically says it all. I have a hexadecimal string representing a private key, and for me to be able to use it with OpenSSL, I need to be able to convert it to some format supported by OpenSSL, be it PEM or whatever. I know that one can read a PEM formatted key and print it out in a format like this: Private-Key: (102...

DATE_FORMAT() in MySQL query

I'm trying to change this timestamp 2010-08-02 00:28:20 to month/day/year - 08/02/10 ..in the query (I know that doing it in the query is faster). $sql = "SELECT * FROM posts ORDER BY post_date DESC"; I tried using the DATE_FORMAT() in the query many ways but I can't seem to get it right.. Can someone please share how to ...