file-format

Design pattern for multiple output formats

最后都变了- 提交于 2019-11-30 05:00:26
问题 I have a class structure which represents (internally) the data I wish to output to a file. Some of the member variables are private to the data class so that it can manage itself and stop things going awry. I then want this data to be output into a number of file formats. I could do something like savefile_formatA(DataClass* pDataClass, ofstream& fout); savefile_formatB(DataClass* pDataClass, ofstream& fout); except that the functions need to then see the private member variables of

Need to export fields containing linebreaks as a CSV from SQL Server

你离开我真会死。 提交于 2019-11-30 02:54:34
I'm running a query from SQL Server Management Studio 2005 that has an HTML file stored as a a string, e.g.: SELECT html FROM table This query displays in the "Results" window nicely, i.e., each row contains a string of the whole HTML file, with one record per row. However, when I use the "Results to file" option, it exports it as an unusable CSV with line breaks in the CSV occurring wherever line breaks occurred in the field (i.e., in the HTML), rather than one per row as needed. I tried experimenting with the Query>Query Options for both the "Grid" and "Text" results, to no avail. The fields

What are important points when designing a (binary) file format? [closed]

懵懂的女人 提交于 2019-11-29 19:32:20
When designing a file format for recording binary data, what attributes would you think the format should have? So far, I've come up with the following important points: have some "magic bytes" at the beginning, to be able to recognize the files (in my specific case, this should also help to distinguish the files from "legacy" files) have a file version number at the beginning, so that the file format can be changed later without breaking compatibility specify the endianness and size of all data items; or: include some space to describe endianness/size of data (I would tend towards the former)

Convert a shapefile (.shp) to xml/json

蹲街弑〆低调 提交于 2019-11-29 18:42:57
I'm working with a shapefile (.shp, .dbf, etc) and would like to convert it to xml. I'm on a mac, and I'm having trouble finding an application that will help me with the conversion. Does anyone know of a method for converting this file format into an xml file? sgillies What dassouki said. Get GDAL from http://www.kyngchaos.com/software:frameworks . Use it to convert a shapefile to GeoJSON like this: $ ogr2ogr -f "GeoJSON" output.json input.shp eg $ ogr2ogr -f "GeoJSON" /tmp/world.json world_borders.shp world_borders $ cat /tmp/world.json { "type": "FeatureCollection", "features": [ { "type":

Specification of JKS key store format

二次信任 提交于 2019-11-29 18:37:25
问题 I was wondering if there exists an official specification of the JKS key store format used in Java? I'd like to write a converter from/to PKCS#12, but not in Java, so keytool or Java code is not an option unfortunately. Looking at one in a hex editor tells me that it's probably not ASN.1. Before I start digging into OpenJDK, trying to reverse-engineer the format, does anyone know if there exists a spec maybe? I couldn't find anything so far, any help would be much appreciated! 回答1: I think

What is the (file) format of iOS/iPhone apps?

和自甴很熟 提交于 2019-11-29 16:56:46
问题 I know that Android apps are packaged as *.apk files, but I have no idea in which way an iOS/iPhone app is stored? Assuming that iOS apps need to be developed and up- and downloaded to the apple App store I assume that the app is stored as a file. Which format does this file have? 回答1: An .ipa file is an iOS application archive file which stores an iOS app. Each .ipa file includes a binary for the ARM architecture and can only be installed on an iOS-device. .ipa (file extension) 回答2: .ipa

Convert text to image file on Android

纵饮孤独 提交于 2019-11-29 10:16:43
问题 I have a text document (.txt). I want to convert it to an image (.png or .jpg). For example, black text on white background. How can I do that programmatically? 回答1: this (untested) code should get you on the right track. void foo(final String text) throws IOException{ final Paint textPaint = new Paint() { { setColor(Color.WHITE); setTextAlign(Paint.Align.LEFT); setTextSize(20f); setAntiAlias(true); } }; final Rect bounds = new Rect(); textPaint.getTextBounds(text, 0, text.length(), bounds);

Read .img medical image without header in python

一个人想着一个人 提交于 2019-11-29 07:50:21
I have a radiograph .img file without the header file. However, the researchers who have published the file have given this information about it High resolution (2048 × 2048 matrix size, 0.175mm pixel size) Wide density range (12-bit, 4096 gray scale) Universal image format (no header, big-endian raw data) I am trying to open the file using Python but unable to do so. Could someone suggest any method to read this image file? I found some radiograph images, like yours, by downloading the JSRT database . I have tested the following code on the first image of this database: JPCLN001.IMG. import

Standard UML file format

谁说胖子不能爱 提交于 2019-11-29 06:15:48
问题 I have designed UML diagrams in different tools (StarUML, BoUML, Papyrus, Omondo, Rational Rose, etc.) depending on the project and the date (rose was first, after Omondo, then starUMl, ..., now papyrus). However, I see that I cannot open my old UML diagrams because the tool is obsolete. I would like to know if there is a standard format for UML diagrams. Probably not in production, but at least to know if there is proposal of standard format. Probably, Eclipse is doing something like that

Recommended 3D model type for in-game character model, loaded manually?

隐身守侯 提交于 2019-11-29 04:31:53
I'm writing a game in JOGL and need to represent the in-game character. I plan to use skeletal animation for the character movements, and of course the character will be skinned. I can't seem to find any good model loaders for JOGL so I plan to load the filetype myself, based on specs or something. I also plan to use Blender as my 3D modeler, so some type that exists in there would be best. What filetype do you recommend I use? .blend? .x, .3ds, .md2/3/5, ...?? Remember I'd like something with a clear defined format so that I can write the loader without having to deobfuscate some random file