Change the name of TaggerProvider and the code fails to work - visual-studio-extensions

I cloned https://github.com/microsoft/VSSDK-Extensibility-Samples, the project Intra-text_Adornment/C# works perfectly.
Then I changed the name of ColorAdornmentTaggerProvider to CCAdornmentTaggerProvider, then run the project. The extension doesn't work any more.
My change is https://github.com/gqqnbig/VSSDK-Extensibility-Samples/commit/575d74300fc22b61d694f0c7f6a05e71c7fd79fe
How do I fix it?

How do I fix it?
When you changed the name of ColorAdornmentTaggerProvider to CCAdornmentTaggerProvider, you need to change all Color-related class to CC-related ones to make the extension work.
Trying renaming the Class name in solution explorer and choose OK when you get this messagebox to rename all Colorxxx code elements to CCxxx.
After renaming the class name, the structure should be similar to this:
Then you can get the extension work after fixing the compile errors if exist.

I find another way to fix it. I have to uninstall my extension from the experimental instance, or delete folder %LOCALAPPDATA%\Microsoft\VisualStudio\15.0_5c91ae55Exp\Extensions.
My guess is that since ColorAdornmentTaggerProvider has the Export attribute, when VS is installing the extension, VS remembers the class name, ContentType, TagType, and sort of things. When I rename the class to CCAdornmentTaggerProvider, the extension didn't get reinstalled, the experimental instance is still looking for ColorAdornmentTaggerProvider, but cannot find it.

Related

Pyvmomi - Assign VM to specific folder with non-unique name

I'm trying to figure out how to assign a VM to a folder that does not contain a unique name. I'm currently testing with the clone_vm.py template. With the sample, I have the ability to set the folder, but it does not work correctly if there's nested folders with the same name (example below). I would like to make sure the folder assigned is the "Linux/Dev" folder, but I can only pass "Dev" and hope that it picks the right one. The line of code below is how the folder is being set.
destfolder = get_obj(content, [vim.Folder], vm_folder)
Linux
|------Dev
|------Prod
Windows
|------Dev
|------Prod
Thanks!
The best way to do that is to use a search_index.FindByInventoryPath and get the folder by the path. It can be a little confusing because of hidden folders but the MOB can help you. I answered a question where I covered how to use that search method see this answer.

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!

How can I programmatically add build files to Xcode4?

I've been trying to figure out how to programmatically add files to an Xcode4 project and it seemed like AppleScript would be the way to go, however I'm running into "missing value" errors.
Here's the code I've got:
tell application "Xcode"
set theProject to first project
set theTarget to first target of theProject
set theBuildPhase to compile sources phase of theTarget
tell first group of theProject
set theFileRef to make new file reference with properties {full path:"/Users/jeff/Projects/XcodeTest/XcodeTest/MyViewController.h", name:"MyViewController.h", path:"XcodeTest/MyViewController.h", path type:group relative}
add theFileRef to theProject
end tell
--tell theBuildPhase to make new build file with properties {build phase:theBuildPhase, name:"MyViewController.h", file reference:theFileRef, target:theTarget, project:theProject}
end tell
I've tried the commented-out line instead of the add-command as well, but that doesn't work either (I get "missing value").
The 'add' error is:
error "Xcode got an error: file reference id \"251AD3431432472E006E300F\" of Xcode 3 group id \"251AD32C14324645006E300F\" of project \"XcodeTest\" of workspace document \"XcodeTest.xcodeproj/project.xcworkspace\" doesn’t understand the add message." number -1708 from file reference id "251AD3431432472E006E300F" of Xcode 3 group id "251AD32C14324645006E300F" of project "XcodeTest" of workspace document "XcodeTest.xcodeproj/project.xcworkspace"
The "make new reference" does add the file to the list of files in Xcode, but I also need it to be added to the project target so that I can add actions and outlets to the file from Xcode w/o having to first check the checkbox to add it to the "target membership".
I ended up sending this question to the devs on the xcode developer list and the response I got was effectively "you can't".
This appears to be completely broken in Xcode4, but I've seen a project that does it. I think what they are doing is parsing and modifying the "project.pbxproj" file directly. (this file is hidden inside the xcodeproj bundle)
The file is a GUID soup, but once you look at it for a while it seems possible to safely modify it, especially if you are only adding stuff.
Edit:
Found this stackoverflow answer that might help.
Tutorial or Guide for Scripting XCode Build Phases
There is a poorly documented user defined build setting that can be added. Files can be both excluded and included from compilation
Go to your target's Build Settings > Tap the + button > Add User-Defined Setting
The key is either INCLUDED_SOURCE_FILE_NAMES or EXCLUDED_SOURCE_FILE_NAMES
The value is a space separated list of file paths
See reference:
http://lists.apple.com/archives/xcode-users/2009/Jun/msg00153.html

requires named attributes

After I migrated my project from Windows to Mac, every time I try to embed an asset in Flash builder like this:
[Bindable] [Embed("assets/assets.swf#mySymbol")]
public var myClass:Class;
I get this error:
[Embed] requires named attributes
if I close the files containing the embedding, it compiles fine and doesn't give any problem.
I googled the error, and haven't found anything similar.
If I remember correctly:
[Embed(source="assets/assets.swf", symbol="mySymbol")]
These are named attributes FB is telling you about - source and symbol.
Update: as Jason Towne mentioned, the only required attribute is source. Symbol allows to bind specific symbol from swf to variable.

Resources