How to adding a flags config just for specific files in Premake? - premake

I want to add flags "XXX" just only for some specific files
I could end up using the filter but I must creat each filter for each file, it is not comfortable. The reason I must separate each filter for each file is that I can't find the way to define all files into just one filter (can't use *)
filter { "files:../src/A.cpp"}
flags "XXX"
filter { "files:../utils/B.cpp"}
flags "XXX"
Do you know how to list all files into one filter, or another way to adding flags XXX into each specific file?
Thank in advice!

That is the right way to do it, put per-file settings are sort of hit or miss right now. You'll have the best luck with Visual Studio, not sure if Gmake supports them at all (yet).

Related

How to pass a database prefix to DDEV?

One of the DDEV sites I manage uses a database that includes a prefix. The default behavior for DDEV is to recreate the settings.ddev.php on every start. But that obviously overwrites anything added, purging any manual addition of the prefix.
Is the assumed solution to stop DDEV from overwriting the file? Or to create another settings file (like settings.local.php) to override what's been overridden? Or am I missing something?
This just seems like something that would exist as a simple variable in the config to generate a more accurate settings.ddev.php file. Thanks!
There are a few straightforward answers:
Don't let ddev fiddle with settings at all. Change the project type to 'php' and ddev won't mess with it.
Make the changes you want to db settings in settings.php after the inclusion of settings.ddev.php. That should work no matter what. And it should work on your prod site as well.
Do the work in settings.local.php, but include it after settings.ddev.php in your settings.php file
Take over settings.ddev.php and do whatever you want with it. This just means deleting the line that contains #ddev-generated in settings.ddev.php. After that, ddev won't muck with it at all.
I decided to use a version of the second suggestion:
// Automatically generated include for settings managed by ddev.
$ddev_settings = dirname(__FILE__) . '/settings.ddev.php';
if (getenv('IS_DDEV_PROJECT') == 'true' && is_readable($ddev_settings)) {
require $ddev_settings;
$databases['default']['default']['prefix'] = "drupal_";
}
I just added the $databases line. The rest was already there.

Is there any way to add multiple "Auto Number Prefix" in oracle ucm?

See, I have a requirement in which I am supposed to change the "Auto Number Prefix" for only one profile, I am wondering if there is any way to achieve that?
You should be able to set AutoNumberPrefix in a rule side effect and have it apply only to that rule/profile.
<$AutoNumberPrefix="profile1_"$>
For those who wants the answer for this, I found the method to provide the different prefix for different profile type. Go in Admin Server-> Configuration -> Paste this code;
AutoNumberPrefix=<$if dDocType like 'Profile_name'$>Prefix Name<$else$>another prefix name<$endif$>
Adding the code shown as "correct" is actually the more inflexible way to do this. Any changes require a restart of the Content Server.
Jonathan's answer was really close, but the syntax used ensures that the variable "AutoNumberPrefix" remains in the profile context. It needs to be placed into local data to be used. This is accomplished using the function "dpPromote".
<$dpPromote("AutoNumberPrefix","profile1_")$>

Atom Interfering Keymap Config?

I have this in Atom my kepmap file:
'.editor':
'ctrl-i': 'window:toggle-invisibles'
'.editor':
'ctrl-t': 'editor:toggle-indent-guide'
ctrl-t works but ctrl-i doesn't.
Just deleting the
'.editor':
'ctrl-t': 'editor:toggle-indent-guide'
makes ctrl-i work again.
Why would that be? How to I clear the interference?
You'll notice both bindings share the same class even if they don't share the same keystroke, try putting them together like so:
'.editor':
'ctrl-i': 'window:toggle-invisibles'
'ctrl-t': 'editor:toggle-indent-guide'
And you could even be more specific to avoid having them overwritten whenever you install new packages, like so:
'.workspace .editor:not(.mini)':
'ctrl-i': 'window:toggle-invisibles'
'ctrl-t': 'editor:toggle-indent-guide'
That's just an example, you can be even more specific adding .pane, but the previous one does the job.
You can also use the Key Binding Resolver by ctrl+.(that's the "dot" or "period"), or querying the command palette by ctrl+shift+P and searching for resolver, bam you are there (that one you knew for sure, I just mention it for other people who may be reading this and may not be familiar with basic functionality).
The key binding resolver will help you monitor how other bindings may be interfering.
Look:
Let me know if it worked.

I'm having problems with configuring a filter that replicates specific tables only

I am trying to use filters to select specific tables to replicate.
I tried running this with the installer
./tools/tungsten-installer --master-slave -a \
...
--svc-extractor-filters=replicate \
--property=replicator.filter.replicate.do=test,*.foo"
and got this exception in trepctl status after the master had not installed properly:
Plugin class name property is missing or null: key=replicator.filter.replicate
which file is this properties file? How do I find it? Moreover, in specifying the settings for the filter, how do I know what exactly to put?
I discovered that I am supposed to Modify the configuration template file prior to configuration according to Issue 219 but what changes am I supposed to make in tungsten-replicator-2.0.5-diff that will later on be patched to the extraction?
Issue 254 suggests that If you want to apply a filter out of the box, you can use these options with tungsten-installer:
-a --property=replicator.filter.Replicate.ignoreFilter=schema_x.tablex,schema_x,tabley,schema_y,tablez
--svc-thl-filter=Replicate
However when I try using this for --property=replicator.filter.replicate.do,
but the problem is still the same:
pendingExceptionMessage: Plugin class name property is missing or null: key=replicator.filter.replicate
Your assistance will be greatly appreciated.
Rumbi
Update:
Hi
I had a look at this file: /root/tungsten/tungsten-replicator/samples/
conf/filters/default/tableignore.tpl .Acoording to this sample, a
static-SERVICE_NAME.properties file is supposed to have something like
this configured, please confirm if this is the correct syntax:
replicator.filter.tabledo=com.continuent.tungsten.replicator.filter.JavaScr iptFilter
replicator.filter.tabledo.script=${replicator.home.dir}/samples/
scripts/javascript-advanced/tabledo.js
replicator.filter.tabledo.tables=foo(database).bar(table)
replicator.stage.thl-to-dbms.filters=tabledo
However, I did not find tabledo.js (or something similar) in the
directory where tableignore.js exists. Could I please have the
location of this file. If there is an alternative way of specifiying
--property=replicator.filter.replicate.do=test without the use of
this .js file, your suggestions are most welcome.
Download the latest version of tungsten replicator. The missing tpl file was added about a month ago. After installation, the filtered tables should be added to static-service.properties under the section FILTERS.
Locate your replicator configuration file in static-YOUR_SERVICE_NAME.properties, e.g.
/opt/continuent/tungsten/tungsten-replicator/conf/static-mysql2vertica.properties
Make sure the individual dbms properties are set, in particular the setting replicator.applier.dbms:
# Batch applier basic configuration information.
replicator.applier.dbms=com.continuent.tungsten.replicator.applier.batch.SimpleBatchApplier
replicator.applier.dbms.url=jdbc:mysql:thin://${replicator.global.db.host}:${replicator.global.db.port}/tungsten_${service.name}?createDB=true
replicator.applier.dbms.driver=org.drizzle.jdbc.DrizzleDriver
replicator.applier.dbms.user=${replicator.global.db.user}
replicator.applier.dbms.password=${replicator.global.db.password}
replicator.applier.dbms.startupScript=${replicator.home.dir}/samples/scripts/batch/mysql-connect.sql
# Timezone and character set.
replicator.applier.dbms.timezone=GMT+0:00
replicator.applier.dbms.charset=UTF-8
# Parameters for loading and merging via stage tables.
replicator.applier.dbms.stageTablePrefix=stage_xxx_
replicator.applier.dbms.stageDirectory=/tmp/staging
replicator.applier.dbms.stageLoadScript=${replicator.home.dir}/samples/scripts/batch/mysql-load.sql
replicator.applier.dbms.stageMergeScript=${replicator.home.dir}/samples/scripts/batch/mysql-merge.sql
replicator.applier.dbms.cleanUpFiles=false
Depending on the database you are replicating to you may have to omit/modify some of the lines.
For more information see:
https://code.google.com/p/tungsten-replicator/wiki/Replicator_Batch_Loading
I don't know if this problem is still open or not.
I am using this version 2.0.6-xxx and installing the service using the parameters works for me.
I would like to point it out, that as the parameter says "--svc-extractor-filters" defines an extractor filter. Meaning that the parameters will guide the extraction of data in the master server.
If you intend to use it on the slave service, you should use the "--svc-applier-filters".
The parameters
--svc-extractor-filters=replicate \
--property=replicator.filter.replicate.do=test,*.foo"
supposed to create the following in the properties file:
This is the filter set up.
replicator.filter.replicate=com.continuent.tungsten.replicator.filter.ReplicateFilter
replicator.filter.replicate.ignore=
replicator.filter.replicate.do=test,*.foo
And you should also be able to find the
replicator.stage.binlog-to-q.filters=replicate
parameter set.
If you intend to use this filter in the slave, please find the line with:
replicator.stage.q-to-dbms.filters=mysqlsessions,pkey,bidiSlave
and change it as
replicator.stage.q-to-dbms.filters=mysqlsessions,pkey,bidiSlave,replicate
Hope this brief description did help to you!

Where in code do I add taxonomy_save_vocabulary for drupal module

I know that in order to programmatically add my own taxonomy to a node I need to use the taxonomy_save_vocabulary function and pass it an array defining my vocabulary. But I need to know where does this code usually go in the module. I'm assuming the install file?
Thanks!
D
The install file is for initial set up of your module - setting up database tables and clearing up for uninstall, basically. So yes, if you're adding a taxonomy just once, and especially if it's indispensible to your module, this would be a good place to do it.
More ideas about this here:
http://sachachua.com/wp/2009/04/drupal-staging-and-deployment-tips-its-all-code/

Resources