I am stuck at this point where I see yslow is no more going for PhantomJS 2.0 as phantom.args property in API is deprecated. But in earlier version it works.
Please let me know which version of PhantomJS works with yslow?
phantom.args is deprecated from PhantomJS 2.0 onwards. Either use an older version (not recommended) or edit your yslow script to use system.args instead. Note that the system module must be required.
system.args[0] is always the script name and system.args[1] is the first, but before phantom.args[0] was the first argument. So you will also need to change all the indexes by one.
PhantomJS had a major overhault with version 2 which also included a much newer version of WebKit.
One has to change yslow.js at line 22.
I made changes like this
//args = phantom.args,
args = require('system'),
And it worked perfectly... This should be patched to yslow then!!!
It will get you off from the error but the arguments are not falling on right place yet.
I then changed to
//args = phantom.args,
system = require('system'),
args = system.args,
len = args.length,
But still no good sign!!!
Okay this is working quite fine but yet not confirmed it is stable and working great. I changed the index now to the below
line 69: for (i = 1; i < len; i += 1) {
and also changed phantom.args to args[0] just to have proper --help output description. But still i am in doubt whether it is correctly indexing now or not.
Apparently there is a fix for this problem but it has not been merged yet in the main branch.
Related
I'd like to take an action the first time a user loads a new version of my VS Code extension. This is different from merely detecting first run as described by the How to run vscode extension command just right after installation? because I don't want to detect "just right after installation" I want to detect first run of each new version which is a totally different problem.
Mike Lischke's answer to that question doesn't actually answer that question, it answers this question, but that doesn't mean this is a duplicate question, it means the response to the other question doesn't actually answer the asked question, and since unlike many people I actually read the question, I didn't bother to read the answers, because answers to that question are not what I seek. Frankly I'm tempted to delete the question myself just to spite Stack Overflow because I'm fed up with this crap. Do whatever you like.
Searching the net turned up sample code
export function activate(context: vscode.ExtensionContext) {
if (context.firstTimeUse) {
//do the one-time-per-version-update thing
}
}
but ExtensionContext doesn't seem to have this property, at least not any more.
So how do you do it now?
I could record the version in a file and compare to the file before updating it, but if there's baked in support I'd rather do it the supported way.
There is no supported mechanism.
Since each update gets a new folder, you don't need to log a timestamp, just probe for the file. If it exists, not first run. If it doesn't exist, first run so create the file and do other first run things.
This is so simple and straightforward there probably won't ever be a supported mechanism. Thanks to Lex Li in the comments for confirming that this is the standard solution.
If you need to differentiate major, minor and maintenance releases, the simplest solution is to store the version string in context.globalState. You begin by trying to fetch from context.globalState. Absence means first run ever. If it's present, an exact match for current version means no change. For a non-match you can parse out major and minor version numbers context.globalState.
const currentVersion = context.extension.packageJSON.version as string;
const lastVersion = context.globalState.get("version") as string ?? "0.0.0"
if (lastVersion !== currentVersion) {
logger.warn(`Updated to ${currentVersion}`);
const lastVersionPart = lastVersion.split(".");
const currVersionPart = currentVersion.split(".");
if (lastVersionPart[0] !== currVersionPart[0]) {
// major version change
advertiseWalkthrough();
if (lastVersionPart[1] !== currVersionPart[1]) {
// minor version change
launchWhatsNew();
} else {
// it's a maintenance version change so don't pester the user
}
}
context.globalState.update("version", currentVersion);
}
We've seen a resurrection of this issue in a recent update of Elasticsearch (https://github.com/elastic/elasticsearch-net/issues/1937).
We set the SourceSerializer when creating the Client connection but that doesn't seem to help.
Debugging in, I see that RequestResponseSerializer defaults to Nest.InternalSerializer. This JSON serializer has the DateParseHandling field set to DateTime when we want DateTimeOffset. I suspect that this may be the cause of my problem.
Is there a way to set RequestResponseSerializer to verify my theory?
ADDITION: I was able to verify my theory above by altering the NEST code directly. I edited the InternalSerializer::CreateSettings() method to include DateParseHandling = DateParseHandling.DateTimeOffset and that solved the issue.
Now how to set/modify this value for RequestResponseSerializer without modifying NEST code directly...
Turns out my issue was the same as https://github.com/elastic/elasticsearch-net/issues/3164 and seemed to be fixed in v6.2.0 (https://github.com/elastic/elasticsearch-net/pull/3278).
I was running v6.1.0
Upgraded my version to v6.3.1 and all looks well.
We have just changed our domain after protracted name change (the name actually happened two years ago!) and our DokuWiki installation has stopped being able to see any groups and memberships.
The config has been updated to reflect the new server and DCs and login is working correctly, it is only the groups that aren't working.
$conf['auth']['ldap']['server'] = 'ldap://MYDC.mydomain.co.uk:389';
$conf['auth']['ldap']['binddn'] = '%{user}#mydomain.co.uk';
$conf['auth']['ldap']['usertree'] = 'dc=mydomain,dc=co,dc=uk';
$conf['auth']['ldap']['userfilter'] = '(userPrincipalName=%{user}#mydomain.co.uk)';
$conf['auth']['ldap']['mapping']['name'] = 'displayname';
$conf['auth']['ldap']['mapping']['grps'] = 'array(\'memberof\' => \'/CN=(.+?),/i\')';
$conf['auth']['ldap']['grouptree'] = 'dc=mydomain,dc=co,dc=uk';
$conf['auth']['ldap']['groupfilter'] = '(&(cn=*)(Member=%{dn})(objectClass=group))';
$conf['auth']['ldap']['referrals'] = '0';
$conf['auth']['ldap']['version'] = '3';
$conf['auth']['ldap']['debug'] = 1;
Obviously I have edited the doain name there, but for the life of me I can't see what's wrong here, It all worked fine yesterday on the old domain.
I should also state that this is an old version of DokuWiki that for various reasons I can't actually update.
The debug line gives me a "ldap search: success" line, but if I add "?do=check" onto any url within the system I get "You are part of the groups"...... and nothing, it can't see any groups.
It's a massive pain as we have a pretty intricate ACL setup for the site, so it's not like I can just throw it open to all.
If anyone has any suggestions, no matter how obvious, please pass them on.
Solved it by changing the dokuwiki authentication plugin that was used, the 'authad' is more simple to use and just works with what I'm doing.
As a side bonus it also means that I have finally been able to get the install upgraded to the current version.
i have a wired problem with TYPO3. We update a TYPO3 instance from TYPO3 4.7 to TYPO3 6.2.4. If we go to the Extension-Manager in the Backend its workling well. If i go to
Get Extensions on top the system loads a new list of Extensions.
Its running some minutes. After that in the box below i get the output No packages found.
If i click again on the Extension-Manager again. Its running 1 - 2 Minutes and i get the error:
Uncaught TYPO3 Exception
#1342432101: static_info_tables was requested to be downloaded in different versions. (More information)
TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException thrown in file
D:\www\xxxx\typo3\sysext\extensionmanager\Classes\Domain\Model\DownloadQueue.php in line 69.
I have checked that line.
if (array_key_exists($extension->getExtensionKey(), $this->extensionStorage[$stack])) {
if ($this->extensionStorage[$stack][$extension->getExtensionKey()] !== $extension) {
throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(
$extension->getExtensionKey() . ' was requested to be downloaded in different versions.',
1342432101
);
}
}
If i comment the line the Extension-Manager load after a few minutes. Its very slow. Under Windows its not the fastest but normally its running.
If you output the Versions in the if statement then you get different versions static_info_tables 6.0.10 and static_info_tables 6.1.0 which is the correct one.
Does anybody know how to fix this problem? I can't use the Extension-Manager because its not loading and very very slow.
Ok after a few days we have found a solution. The extension table is corrupt after getting all new versions we have removed all old entries in the extension manager table and it was working well.
To solve the problem Find all entries in the tx_extensionmanager_domain_model_extension table for the extension key static_info_tables. After that you get some entries with different versions. We have removed all old entries that have made some trouble.
To find entries that make trouble you go to this line:
D:\www\xxxx\typo3\sysext\extensionmanager\Classes\Domain\Model\DownloadQueue.php in line 69.
And debug the if statement above. There you get the ids to remove.
I am trying to run tests by adding a version of tornado downloaded from github.com in the sys.path.
[tests]
recipe = zc.recipe.testrunner
extra-paths = ${buildout:directory}/parts/tornado/
defaults = ['--auto-color', '--auto-progress', '-v']
But when I run bin/tests I get the following error :
ImportError: No module named tornado
Am I not understanding how to use extra-paths ?
Martin
Have you tried looking into generated bin/tests script if it contains your path? It will tell definitely if your buildout.cfg is correct or not. Maybe problem is elsewhere. Because it seem that your code is ok.
If you happen to regularly include various branches from git/mercurial or elsewhere to buildout, you might be interested in mr.developer. mr.developer can download and add package to develop =. You wont need to set extra-path in every section.