when i use OpenHFT/Chronicle-Queue, it creates data files in queue with name format as today's date.
for example : 20180113.cq4
can we change this file naming convention ?
No, you can not change the name of the queue files. If you do, chronicle-queue won’t see them. The file naming convention is not configurable. If you changed chronicle queue code to make it configurable and issue a pull request we could merge in this change.
Related
Trying to save an h2o model with some specific name that differs from the model's model_id field, but trying something like...
h2o.save_model(model=model,
path='/some/path/then/filename',
force=False)
just creates a dir/file structure like
some
|__path
|__then
|__filename
|__<model_id>
as opposed to
some
|__path
|__then
|__filename
Is this possible to do from the save_model method?
I can't / hesitate to simply change the model_id before calling the save method because the model names have timestamps appended to them to avoid name collisions with other models that may be on the h2o cluster (am trying to remove these timestamps when saving on disk and simplifying the name on the cluster before saving creates a time where naming collision can occur if other processes are also attempting to save such a model (of, say, a different timestamp)).
Any way to get this behavior or other common alternatives / workarounds?
This is currently not possible, however I created a feature request here. There is a related question here which shows a solution for R (could be adapted to Python). The work-around is just to rename the file manually using a few lines of R/Python code.
I'd like to archive files that come in on a directory based on \name\date structure - so even every day the directory will change. Any suggestions appreciate.
I'm was on track to create a file outbound-gateway where the directory is dynamic, where the header is enriched with a method that generates the path of the directory.
I was thinking of something like this
<file:outbound-gateway id="archive" request-channel="input"
reply-channel="channel" directory="#Header[archiveLocation]}"
mode="REPLACE" delete-source-files="true">
</file:outbound-gateway>
But it doesn't seem to be the way to do it.
Based on previous related answers, I'm familiar with the samples at
https://github.com/spring-projects/spring-integration-samples/blob/master/advanced/dynamic-ftp/src/main/resources/META-INF/spring/integration/dynamic-ftp-outbound-adapter-context.xml
My concern of doing it this way is, would there be any resource issues if I need to create tens, or hundreds of different outbound-gateway?
Since I can put the data in the header, is there an easier way to do it. Or is the directory field set at context initialization, and cannot be dynamic?
Thanks
After finally creating an account on Stack Overflow all these years to post a question, found the answer later. I can use directory-expression.
<file:outbound-gateway id="archive" request-channel="input"
reply-channel="channel" directory-expression="headers.archiveLocation"
mode="REPLACE" delete-source-files="true">
</file:outbound-gateway>
I'd like to create a new stub file "test.mp3" for instance, and add a Window Property to it ( System.Author for instance).
the solution must be usable for several file extension as text, picture, videos, etc...
If I just create a file and use IShellItem2::GetPropertyStore I get a HRESULT fail for invalid Arguments.
Use IShellItem2::GetPropertyStore on a real music file I can read and write Its properties just fine.
Please test your suggestions first.
Property Stores typically access and store data within the file itself. In your case of a mp3 file, it would be attempting to read and write the ID3 tags. Also, Property Stores are not stored in a database and cannot be arbitrarily added to files that don't support it.
You'll most likely need to implement your own property handlers to do what it appears you're trying to accomplish. For types that already have handlers, you'll have to replace the system handlers with your own.
The most likely reason your mp3 test is failing is that you have an empty file with no data and no valid ID3 tags.
I try to add AutoSave support to the Core Data File Wrapper example
Now if i have a new/untitled document writeSafelyToURL is called with the NSAutosaveElsewhereOperation type.
The bad thing is, I get this type in both typical use cases
- new file: which store a complete new document by creating the file wrapper and the persistent store file
- save diff: where the file wrapper already exists and only an update is required.
Does somebody else already handled this topic or did somebody already migrated this?
The original sample use the originalStoreURL to distinguish those two use cases, which solution worked best for you?
Thanks
I'm using Message library (http://codeigniter.com/wiki/Message/) to display error messages on my site. This is the code that I'm using to display a message:
$this->message->set('error',$this->config->item('error.login'));
Right now I'm storing common messages in my config file (config/config.php) instead of writing the message every time. Is there a better way to do it? The config file is getting very long.
What I'm looking for is a better way to store re-usable text strings.
CodeIgniter's language class is what you're looking for:
CI Language Class
$this->message->set('error',$this->lang->line('error.login'));
A config file is more or less how you'd want to do it. It is simple, clear and light. But just because you are keeping it in a config file, that does not mean you need to keep it in config.php. The Config class allows you to have multiple config files, so have a special one for messages. Heck, you could even have several special ones for languages, and leave the one you are looking for in the config.php file!
$this->config->load( $this->config->get( "language_file_name" ) );