HDF5: What is the difference between "file buffer" and "file cache"? - hdf5

In HDF5 library "virtual file layer", we can choose between several options. The default one if SEC2, which is a POSIX driver "with no system buffering"- You can also choose DIRECT, which is a variant of POSIX "except that files are written without being cached by the system".
So, what is the difference between a file buffer and a file cache? For me it sounds pretty much like the same thing.

Judging from experience with other libraries having similar descriptions in their docs... these always meant:
"with no system buffering" = "direct read" (no buffering on reads)
"written without being cached by the system" = "direct write" (usually achieved by calling flush or similar after every write)
The second option bing slower on writing than the first one... read-speed is the same...

Related

What does "DSO" stand for as in, "kernel version 460.39.0 does not match DSO version 460.56.0"?

Searching for "DSO" in the context of "nvidia" yields "Days Sales Outstanding". Looking at a comprehensive acronym list for "DSO" yields a likely candidate: "Data Source Object" but it is for some sort of Microsoft standard that would seem to be inapplicable to Linux platforms.
From Webopedia:
A dynamic shared object (DSO) is an object file that is intended to be used simultaneously (or shared by) multiple applications while they’re executing. A DSO can be used in place of archive libraries and will minimize overall memory usage because code is shared. Two executables that use the same DSO and that run simultaneously have only one copy of the shared components loaded into memory.
[Source: Adapted from SGI]

How do compilers create the executable file at the end of the compilation process?

I've been reading on the compilation process, I understand some of the earlier concepts like parsing but I stop short of understanding how the executable file is created at the end.
In the examples I've seen around the "compiler" takes input in the form of a lang defined by BNF and then upon parsing it outputs assembly.
Is the executable file literally just that assembly in binary form? I feel like this can't be the case given that there are applications for making executables from assembly?
If this isn't answerable (ie it's too complex for the stack overflow format) I'd totally be happy with links/books so I can educate myself.
The compiler (or more specifically, the linker) creates the executable.
The format of the file generally vary depending on the operating system.
There are currently two main formats ELF and COFF
http://en.wikipedia.org/wiki/Executable_and_Linkable_Format
http://en.wikipedia.org/wiki/COFF
If you understand the concept of a structure, this is the same, only within a file. Each file has a first structure called a header, and from there you can access the other structures as required.
In most cases, only the resulting binary code is saved in these files, although you often find debug information. Some formats could save the source along the code, but now a day it only saves the necessary references to the source.
With dynamic linking, you also find symbol tables that include the actual symbol name. Otherwise, only relocation tables would be required.
Under the Amiga we also had the possibility to define code in a "segment". Only one segment could be loaded at a time. Once you were done with the segment, you could unload it and load another. Yet, in the end the concepts were similar. Structures in a file.
Microsoft offers a PDF about the COFF format. I could not find it on their website just now, but it looks like others have it. ELF has many links in the Wikipedia page so you should be able to find a PDF to get started.
Not all but some (gcc, etc) compilers go from the high level language to assembly language then spawn the assembler. The assembler reads the assembly language and generates machine code and generates an object file which as you have guessed contains more than just the machine code bits. If you think of it for second you may realize that a variable or function that is defined in another source file which means its code lives in another object file, until link time one object doesnt know how to get at that external function, so 1) the machine code is not finished, patching up external addresses is not done until link time 2) there needs to be some information in the object file that defines what public items are in this object file and what external items are missing, names of functions for example which are obviously not embedded in the machine code. So the objects have machine code in various states of completion as well as other data needed by the linker. the linker then...links...the objects together into one program with everything resolved, it basically completes all the machine code and puts the fragments of machine code (in separate objects) into one place. Then it has to save all that on the disk in some format and typically that format is not just raw machine code. It has extra stuff in the file, starting with a header and the a way to define each binary blob and where it needs to live in memory before executing. When you run a program on the command line of your operating system or double clicking or whatever in a file manager gui, the operating system knows how to read that file format, extract the blobs of binary, place those blobs of binary in ram defined by this file format and then start executing at the place defined by this file format.
aout, elf, coff, intel hex, motorola s-record are all popular formats as well as raw binary which some toolchains can produce. the gnu tools will default to one (coff or elf or exe or aout) and then objcopy is used to convert from one to another or at least the default one to the others and there is help to show what your possible choices are. then simply google those or wikipedia them and find the definitions of the file formats. Intel hex or motorola srecord are good ones to start with at wikipedia then elf perhaps.
if you want to produce native executable file you have 2 options. you can assembly the binary form yourself or you can transalte your program to another language and use its compiler to producte the executable

.rep Report File - Find Report Builder

I have an old software that I believe was done in Delphi and uses .rep files for reports.
Is there any way to figure out what report builder was used? Opening the file in HEX or Text only doesn't really tell a lot, it shows quite some text that is used within the report though.
Thanks
Patrick
Candidates:
A Visual dBase file, it that case it should be mainly ASCII text, but your question seems to rule that out.
A (SAP) Business Objects Report file
An Act! (CRM software) report file
A Grand Theft Auto San Andreas game replay file.
Since you say it is 'used for report', BO is your best bet. It was acquired by SAP in 2007, before that it was standalone software produced by Business Objects AG.
So you probably need a copy of that to open the file.
Maybe there are other ways to inspect/use the file, other people have faced the same problem
Quite simply without access to the source code, you have no way of knowing. None of the major third party Delphi reporting components (Quick Reports, Rave, Crystal, Report Builder, Fast Reports/Free Report) I'm aware of use *.rep as their default file extension. That isn't to say that the program authors didn't use one of these components, but opted to replace the tool's default extension with *.rep. There's also the possibility that the program's authors used their own custom and proprietary reporting system.
You could potentially take one of these .Rep files and try and load them into each Delphi reporting tool and see what the results are but I think your chances of success are exceedingly low.

Techniques for avoiding dataset path hardcoding

I have some shared projects that are under version control (concretely svn and bazaar, but I'm seeking for a general solution), but the datasets the projects use are not (too big and shared by different projects).
In the source code I need to "store" somewhere the path to the dataset. The path is possibly different for each user, so hardcoding is definitely a bad idea (as always, I guess).
My actual workaround is to hardcode a text file (say "dataPath.txt") where the actual path is stored, and this file is not under version control (each project contributor creates his own file with his customised info).
The solution is, however, quite fragile:
1) if some contributor add to versione control the file it is annoying
2) when I export the "executable", I need to move around the file that is supposed to be in the same dir (relative path).
In my concrete case I'm using Java, so I find this question relevant (even if I've never used properties), but I would like to know if there are more general techniques that can be reused with different programming languages.
Write your program so that it accepts the path to the dataset as a command-line argument. Make sure there are a) sensible defaults if the dataset file is not specified, or b) the program exits gracefully if no dataset file is provided. There is no need to hard-code dataset paths in the source. Then you'd invoke the program e.g. like this (of course you can take any other command-line option character you like :-) ):
prog -d dataPath.txt
In general, providing such settings in a config file is a good idea. With Java, properties help (as pointed out in the SO question you linked). In other languages I'd probably use a JSON-formatted settings file -- parsing libraries are available.

Is it possible to embed and run exe file in a Delphi executable app?

Resource files (.RES) accept any kind of binary files but if it is an exe file how can I run it?
You would have to extract it as a file to disk and execute it.
Although you don't have to extract it to disk, as Cosmin Prund says in a comment, if you don't it requires a lot of hard work.
http://sites.google.com/site/delphibasics/home/delphibasicssnippets/memoryexecutionunit-winxpwinvistawin7
Take a look at this memory execution unit.It allows you to execute an exe from memory without dumping it on disk.
Yes it is possible. There is a Delphi library to do this somewhere on the web, but I cannot for the life of me remember what it's called. It allows you to execute a normal exe file no-matter where it is in memory. So you can load it into a stream, or just embed it in a resource.
I realize that my reply is a bit depressing since i dont remember the name of the library, but at least you now know that it can be done. If you google around for "execute PE exe from memory" and "Delphi" then I'm sure you will find it.
You might want to take a look at Orean's XBundler: http://www.oreans.com/xbundler.php
I use their licensing product (WinLicense) and have been very happy with the product, their support, responsiveness and updates.
In fact, I'm about to buy XBundler so I can ship a dll securely embedded in my exe.
Tom

Resources