Spyder 5 No QCoreApplication instance found. Application patches not applied - spyder

I get the following error after having upgraded to Spyder 5
No QCoreApplication instance found. Application patches not applied. You have to call load_stylesheet function after instantiation of QApplication to take effect.
The interface also looks 'not nice' (I am guessing without the stylesheet).
Downgrading to Spyder 4 causes everything to appear in a single column (Code area, console, variable explorer etc, all one below other with ugly overlap to make it unusable).
How do I go about fixing this?

(Spyder maintainer here) That's a warning and it doesn't affect loading our new stylesheet. Please simply ignore it.
Note: It's unfortunate that you don't like our style because it's the one Spyder will use from now on.

You can restore your Spyder 4 layout using View --> Window Layout --> Spyder default layout.

Related

Cucumber test fails on unscrollable page

Here is a test (I've opened the inspector during the test and that's definitely the element hierarchy):
within('table.foo') do
find("tr#foo_#{ #foo.id }").click
end
Calling find() on the element returns:
could not be scrolled into view (Selenium::WebDriver::Error::WebDriverError)
I have a pretty good idea why--the page renders a single db entry created for the purpose of the test, and so the document doesn't extend past the window, making it unscrollable, which I think is what's throwing this error.
I have tried updating geckodriver to no avail.
Is there a method in cucumber that doesn't prompt scrolling? Would be better than a) testing in a really tiny window or b) creating more test data just to stretch the document.
This sounds like a bug that exists in an older version of chromedriver that is caused with newer/later versions of Chrome. The bug is the driver would lose the ability to scroll the tab in focus.
I would recommend downloading the latest driver and replacing the one you are using.
https://sites.google.com/a/chromium.org/chromedriver/downloads
Cheers.

Migrating to Vim from RubyMine - Interpreted Auto completion

Up until last week, I had been using RubyMine for my Rails development. I know it has a vim plugin but I have been working on migrating my development to vim and tmux. I don't want to keep using the mouse and VIM gives me a lot more flexibility. I have found plugins and workarounds for almost all the features I care about except the "interpreted auto complete" functionality in my first screenshot below. RubyMine interprets the whole rails application and offers sorted-by-relevance suggestions (as you can see, it's showing me instance variables and methods for the class in question and the modules it includes) THEN it shows (less relevant) methods available on the Object class. It also shows the method signature when there's one.
Also, in my second screenshot, you can see how RubyMine offers autocompletion for core Ruby classes.
Compare this to the bottommost screenshot. I do have completion but there's no way to find what I'm looking for. I'm using ctags , YouCompleteMe, vim-rails, vim-ruby and I also tried installing eclim to see if it makes a difference.
Is there a plugin I've missed that can enhance my auto completion? It doesn't look like RubyMine is doing something super crazy. pry can give me the same 'power' if it were running in the same 'context'.
First Screenshot (RubyMine interpreted auto complete):
Second Screenshot (RubyMine core Ruby classes auto complete):
Third Screenshot (vim omnifunc + ctags):
Important Note
This solution only works for Ruby 1.9+
I forked 'vim-ruby' at https://github.com/zxiest/vim-ruby and modified it as such:
Method signatures now appear in completion.
I disabled sorting by name for methods.
Plugins and Settings
vim-rails
I'm using vim-rails https://github.com/tpope/vim-rails
supertab
I'm using supertab https://github.com/ervandew/supertab instead of YouCompleteMe (mentioned in my question) although YouCompleteMe is super fast and automatic but there are currently some compatibility issues between my it and my vim-ruby fork.
vim-easytags
I'm using vim-easytags https://github.com/xolox/vim-easytags
Add this to your ~/.vimrc
:set tags=./tags;
:let g:easytags_dynamic_files = 1
Make sure to touch ./tags in your project directory.
Issue :UpdateTags -R **/*.* from vim in order for easytags to generate your tags file.
Remap omnicomplete
In order for omnicomplete to pop up, by default, we have to hit <C-X><C-O>. I remapped this to <C-Space> by inserting the following in my ~/.vimrc:
inoremap <C-#> <C-x><C-o>
I now press tab when I want supertab to complete my code and Ctrl+Space when I want omnicomplete to trigger and show method signatures for me. There's definitely a better way to integrate this (i.e. getting supertab to call omnicomplete after a dot)
And here goes the screenshot! Notice that method sorting being off allowed my custom resize method to appear on top and the signatures now appear in the completion (as well as in the editor when enter is pressed!)

Selenium Web Driver Error

I'm getting a weird error while trying to click on a Capybara Element
I'm using find(:xpath,"//a[contains(text(),'Connect')]").click
(find(:xpath,"//a[contains(text(),'Connect')]").present? return true)
the error I get is:
Selenium::WebDriver::Error::MoveTargetOutOfBoundsError Exception: Element cannot be scrolled into view:javascript:void(0);
i did some research and the only solution i found is that setting the selenium version to 2.16 may fix this issue (i'm using 2.25).
anybody got an idea?
It may happen when the page being tested is not fit into the current window size. If you know such pages where usually these error happening, you may explicitly scroll down before doing the operation on such hidden elements(like click, clear etc). Here the code to explicitly scroll down the page.
In java,
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("javascript:window.scrollBy(250,350)");
From the times I used selenium webdriver to test .NET apps, I would get that error when the issue was exactly what it sounds like: It's looking for an object on the page that it cant scroll to for some reason. In my case it was because some dialogue boxes would appear without scrollbars and the driver had no way to "scroll the object into view"
Can you watch the execution of your test and see if that's the case? I had some luck rolling back to a previous version of firefox because 15+ was (as of about 2 months ago when I had the issue) unsupported by web driver and had this problem periodically. Rolling back selenium versions may help too.
First step though is definitely to watch the execution of the test and see whats happening though. And a good debugging idea may be to try to work through your steps manually yourself to make sure the test works by hand.
Its also worth noting that for the webdriver to be able to execute click the object actually has to be visible. IsPresent doesnt require that, it just searches the page files. Also an issue I ran into. IsPresent will still return true for objects that are not and cannot be made visible on the page (i.e. something at the bottom of the page that you cant see at the time)
Couple of tips here:
Webdriver should ideally be on the most recent update, it's what most use (Unless you're doing Ruby Automation)
Use css selectors, xpath (Whilst rendered), is almost always heavier on both resources and code.
Try defensive coding, first of all ascertain it exists. There are many ways to do that dependent on what package you are using. In ruby you would do page.has_css?('css_string')

FireFox 6: implementing nsIProtocolHandler

Has something changed in Firefox 6 so I can no longer add my nsIProtocolHandler (and nsIChannel) implementation from an add-on just by registering it under a contract like #mozilla.org/network/protocol;1?name=myscheme?
I've checked all the interfaces I use if any changed (judging by a new
UUID), but I don't get a call to my getFactoryProc I list in NSModule,
like I did before.
Do I need to add a category (like http-startup or something?) or is
something else wrong?
(the code that worked in firefox 3.6 is still here I haven't committed
the new code yet...)
Update: I've logged this as a bug.
Update: Okay, I figured this out. See https://bugzilla.mozilla.org/show_bug.cgi?id=656331. Basically you need to export the right kVersion value in your module or the library will be unloaded immediately after it is loaded (i.e. the behavior you are observing). This behavior is new as of Firefox 5.
If you haven't updated to Firefox 4 yet then you need to change the way that you register your XPCOM component. See https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_2.0. The sections on JS components or binary components are relevant depending on whether your component is implemented in JS or C++.

Why would an swf break when changing its export version from Flash 6 to 7?

I need to make a small modification to an existing Flash library (Fusion Charts Free) written in AS1 with Flash 6 as its publish version. My change uses ExternalInterface, which requires Flash 8, so I opened Publish Settings and changed the version to 8. No other changes were made.
Now the swf loads, but encounters some error part-way through its operation. If I change the publish version back to 6, it works again. Changing it to 7 breaks it. My questions:
Is there a complete list of changes between Flash 6 and 7 that affect existing AS1 code?
Is there any way to get real debugging output from an swf, to determine what has happened? It's frustrating that there doesn't seem to be any sort of log or console whatsoever. I've seen a few solutions that involve using ExternalInterface to log to Firebug or such, but obviously that isn't useful to me, given that my whole problem centers around exporting to Flash 8.
the externalInterface is probably not the reason for errors.. i tested myself to ensure.. (with flash8 + AS1).
1) maybe you accidentally selected AS2 instead..
2) the error is while compiling? or during it's running?
3) the error happens when you run it from the application? or as standalone? (when it's standalone the ExternalInterface might raise an exception because there's no "external interface".
4) what's the error?
5) try to put "try" block on the ExternalInterface part if the error is not while compiling..
6) if the error is while its running, then you have a debugger.. just press Ctrl+Shift+Enter
Having completed this project, I'll share my experience. Virtually all incompatibilities fell into three categories, described in this very useful article:
Flash 7 variables names are case-sensitive, so xPos and xpos are now separate variables and can't be used interchangeably. You would never do this anyway, if you were writing good code, but if you're trying to port some third-party code, as I was, this is the #1 problem to look out for.
Undefined variable values have changed. In Flash 6, numbers were initialized to zero and strings were empty. In Flash 7, a number is NaN and a string is undefined.
String boolean equivalents are different. In Flash 6, empty strings, or strings other than "1" evaluate to false. In Flash 7, a string with any contents evaluates to true; only empty strings evaluate to false.

Resources