QPython 3 console - qpython

I've recently begun programming with QPython3 on my android phone, and I've found it slightly annoying that the console pops up whenever I run a script. I often have it sending the output through a Toast since I usually only need the information for a second.
Is there a way I can make it, either within my script or in the settings of QPython3, that the console is default to the background while running a script?
Thank you

Try to insert the "#qpy:console" into your script, does it work for you ?

Related

Transform Classes With Dex For Debug is making Windows crash

I'm building a React Native app. Everything was working fine but now when I try to run on Android it gets to the task :app:transformClassesWithDexForDebug, it hangs for 30-60 seconds and then Windows shuts down.
I tried to setup multidex as mentioned here: https://stackoverflow.com/a/56875424 but the result is the same.
I'm not getting any error message, the computer just shuts down abruptly and I have to turn it on again.
Any advice is much appreciated.
In the end, it was two problems mixed:
I was using the new Windows Terminal which is still in beta so I guess the shutdown problem was something to do with it, because I changed to normal good ol' cmd and the shutdown problem disappeared.
The actual error in the compilation process was actually the setup of multidex. I was not extending the MultiDexApplication class.
Thank you all.

Where does this dialogue come from & how to surpress it?

I am running a script that tries to launch a browser (firefox) and load a URL from my home intranet's NAS - in order to close it down. This should run unattended. My first problem was getting the "çertificate not recognised" message from the browser, when I want this to run unattended, so I added an exception. Re-tried and then I got the "User / Password" dialogue. So I found a way to insert the credentials into the URL. That seemed to silence that dialogue, but now I get the following pop up - seemingly from the browser, which remains blank unless I Ok it:
I'm not sure what's generating it. The browser I guess, but it never does this when I access the URL manually. I tried turning off my Avast security in case it came from there. I tried fiddling with Windows (10) security, but still it persists. Any idea how to do this? Here is the .bat line that initiaties it:
run, C:\Program Files\Mozilla Firefox\firefox.exe
https://admin:mypassword#192.168.1.10/get_handler?PAGE=System&OUTER_TAB=tab_shutdown&INNER_TAB=NONE&shutdown_option1=1&command=poweroff&OPERATION=set
It might help to know the NAS responds to http, switching it to https, with it's own local certificate. Anyone any ideas on how to circumvent this? Thank you.
I confirmed that the dialog is indeed coming from Firefox, using Window Spy to click on it when it appeared. No idea why it should happen in response to a script and not to a live operator though: it does rather present the script with the sort of issues documented here.
After trying all sorts of techniques to try to either surpress it or Ok it, I found that nothing native to Windows would do the job. I eventually solved the problem by writing a script for Autohotkey, making an executable out of it for convenience, and calling that from my close down .bat file.

"Operation in progress..." Never Ends When Previewing Rows in Kettle Spoon via Salesforce

I am trying to pull data from a Salesforce API account using Pentaho/Kettle Spoon. I am able to establish a connection on Pentaho with this account. I am also able to get fields from specific modules. However, when I try and "Preview rows" (even with a small number of rows), the "Operation in Progress" window comes up and never completes the task. When I try and cancel the job, Pentaho hangs and I have to force quit it.
I am running Fedora 21. Any input is greatly appreciated.
Thanks!
This works for me:
Since upgrading to Fedora 22 Spoon (the client tool of PDI) was not working properly anymore. Although I could start Spoon properly and create transformations etc, once I wanted to execute a transformation or sometimes even when trying to open settings, nothing was working and the terminal window showed several (SWT:20352): GLib-CRITICAL error messages. In a nutshell, Spoon was rendered useless.
Here is how to solve this:
Go to the Eclipse Download Page and download the latest 64bit verion of Eclipse IDE for Java EE Developers. Note: There is a separate download area for SWT; however, for Linux there is no 64 bit version available. The only way to get one is to build it yourself. So I just went the easier way and downloaded Eclipse instead.
Unzip the file and search for swt. A search result will show a few files, but the ones interesting for us are (your version number might be different): org.eclipse.swt_3.103.2.v20150203-1313.jar and org.eclipse.swt.gtk.linux.x86_64_3.103.2.v20150203-1351.jar.
Copy the first one of these files into <PDI_HOME>/libswt/linux/x86 and the second into <PDI_HOME>/libswt/linux/x86_64.
oth folders still have the original jar files in them. Rename them to swt-jar-old (Note: no extension, so that they are not picked up).
Start Spoon. There will be a few error messages shown, but so far Spoon is working way better for me than before.
FONT: http://diethardsteiner.github.io/pdi/2015/06/07/Fixing-PDI-GLib-CRITICAL.html
i'm running Ubuntu 14.04, i5,6gb RAM, got same trouble..
when i check, the load in proccessor is 100%, evertime i try showing the content or other thing in pentaho, the Operation in progress is show up, and never end..
How to solve, check your access to file/connection in your database,unrecognize file,field,etc. after this resolve, my proccessor run normal, and i could run / execute the transformation.

Opening Windows console programs in Full Screen Mode

I am developing a C program that prints out a message. The problem with it is that when I run its .exe file, it does not run in fullscreen (until I press alt+enter to force it to full screen). I want the program to run in fullscreen itself when I run it. Is there any way I can do it?
Thanks in advance.
You could call SetConsoleDisplayMode() to force CONSOLE_FULLSCREEN_MODE. Beware that support for this has been disappearing. The last machine I owned that could still do this has been gathering dust for quite a while already. Along with the memory of the loud relay clicking sound, mixed with the high-pitched wail of the flyback transformer in the CRT.

How do I launch a WPF app from command.com. I'm getting a FontCache error

I know this is not ideal, but my constraint is that I have a legacy application written in Clipper.
I want to launch a new, WinForms/WPF application from inside the application (to ease transition). This legacy application written in Clipper launches using:
SwpRunCmd("C:\MyApp\MyBat.bat",0)
The batch file contains something like this command:
C:\PROGRA~1\INTERN~1\iexplore "http://QASVR/MyApp/AppWin/MyCompany.MyApp.AppWin.application#MyCompany.MyApp.AppWin.application"
It is launching a WinForms/WPF app that is we deploy via ClickOnce. Everything has been going well until we introduced WPF into the application. We were able to easily launch from the legacy application.
Since we have introduced WPF, however, we have the following behavior. If we launch via the Clipper application first, we get an exception when launching the application. The error text is:
The type initializer for 'System.Windows.FrameworkElement' threw an exception.
at System.Windows.FrameworkElement..ctor()
at System.Windows.Controls.Panel..ctor()
at System.Windows.Controls.DockPanel..ctor()
at System.Windows.Forms.Integration.AvalonAdapter..ctor(ElementHost hostControl)
at System.Windows.Forms.Integration.ElementHost..ctor()
at MyCompany.MyApp.AppWin.Main.InitializeComponent()
at MyCompany.MyApp.AppWin.Main..ctor(String[] args)
at MyCompany.MyApp.AppWin.Program.Main(String[] args)
The type initializer for 'System.Windows.Documents.TextElement' threw an exception.
at System.Windows.FrameworkElement..cctor()
The type initializer for 'System.Windows.Media.FontFamily' threw an exception.
at System.Windows.Media.FontFamily..ctor(String familyName)
at System.Windows.SystemFonts.get_MessageFontFamily()
at System.Windows.Documents.TextElement..cctor()
The type initializer for 'MS.Internal.FontCache.Util' threw an exception.
at MS.Internal.FontCache.Util.get_WindowsFontsUriObject()
at System.Windows.Media.FontFamily.PreCreateDefaultFamilyCollection()
at System.Windows.Media.FontFamily..cctor()
Invalid URI: The format of the URI could not be determined.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString, UriKind uriKind)
at MS.Internal.FontCache.Util..cctor()
If we launch the application via the URL (in IE) or via the icon on the desktop first, we do not get the exception and application launches as expected.
The neat thing is that whatever we launch with first determines whether the app will launch at all. So, if we launch with legacy first, it breaks right away and we can't get the app to run even if we launch with the otherwise successful URL or icon. To get it to work, we have to logout and log back in and start it from the URL or icon.
If we first use the URL or the icon, we have no problem launching from the legacy application from that point forward (until we logout and come back in).
One other piece of information is that we are able to simulate the problem in the following fashion. If we enter a command prompt using "cmd.exe" and execute a statement to launch from a URL, we are successful. If, however, we enter a command prompt using "command.com" and we execute that same statement, we experience the breaking behavior.
We assume it is because the legacy application in Clipper uses the equivalent of command.com to create the shell to spawn the other app. We have tried a bunch of hacks like having command.com run cmd.exe or psexec and then executing, but nothing seems to work.
We have some ideas for workarounds (like making the app launch on startup so we force the successful launch from a URL, making all subsequent launches successful), but they all are sub-optimal even though we have a great deal of control over our workstations.
To reduce the chance that this is related to permissions, we have given the launching account administrative rights (as well as non-administrative rights in case that made a difference).
Any ideas would be greatly-appreciate. Like I said, we have some work arounds, but I would love to avoid them.
Thanks!
It sounds like the Presentation Font Cache service has trouble starting when the app is launched in this way.
If you have control over the client environment, you could try setting the Windows Presentation Font Cache startup to automatic instead of manual.
This is a shot in the dark made with incomplete information:
command.com and cmd.exe are quite different. AFAIK, command.com exists for legacy compatibility, so applications you run from it will run differently. I can't test anything to complete my post because I believe that command.com runs in 16-bit mode and 64bit versions of Windows (on which I'm running) don't support that mode anymore so no more command.com for me.
That being said, there should be no difference when trying to run 32-bit applications (including managed applications).
I'm not aware of what are the limitations of your environment, but some things you may try are:
Rename you .bat into .cmd to make sure it starts with cmd.exe rather than command.com
Make your .bat start the program using the start console command
Have a non-WPF program to invoke your WPF one with a more sane environment
The problem is that the windir environmental variable is not set when using command.com.
So, in your case, adding the line set windir=C:\Windows to the beginning of the bat file will solve the problem (assuming that you have your Windows instalation in C:\Windows.
An additional issue might be that the host application is running command.com in compatibility mode. The best is to list all the environmental variables after running cmd.exe (using the set command) and comparing it to the output of the set command that you set in your bat file

Resources