In qlikview , Is it possible to keep the script window always open? - qlikview

During the code development it would be better if I could reload my code and keep the script window open. At the same time it would have to allow me to change or creat objects on my dashboard. Is this possible ?

The short answer is No
But you can achieve this if you split your script from your app. Have one app that contains the script (and nothing else) and one app that loads Binary from the first app. This app will contain all objects.
The binary load grabs the whole data from one app and "paste" it in the current app.
So you can reload the app with the script (and continue working on the app with the objects) and when the script app is ready (and saved) just reload the app with the objects. The app with the objects will reload quite quickly because the binary load will grab the reloaded data

Related

Uploading files to server via JSF 2.2 and h:inputFile

UPDATE:
It turns out that there was an ajax call inside the inputFile that would cause the upload to start prematurely. That ajax was supposed to handle the selected file before the actual submit button was clicked, but neither I nor the person who coded it before me knew it would behave that way. And, as we only tested it either locally or with small files, we never noticed the problem.
I'm a newbie when it comes to file upload and I need some guidance on that subject.
I have a code that gets a file through h:inputFile then, when the submit button is pressed, sends it to the server using InputStream and OutputStream in a pretty standard way. It works well, but I'm facing a problem:
When I select the file, it takes its time to upload to the page(?). Then, when I click the submit button, it takes its time again to send that file to the server.
To make myself clear, here's a real case: I clicked the inputFile button and selected a 50mb file. It took 10min to conclude that. Then, I clicked the submit button and it took another 10min to send it to the server. That's a total 20min to upload that file, when it should have been only 10min.
Saving that time is crucial for my users, since their internet is very slow (< 1mbps) and they will be uploading videos around 40-90mb, which will take hours.
So, how do I optimize that? And, as I'm already asking, how exactly does h:inputFile work - I mean, it sets the Part in the bean, which can then be handled, but does it actually upload the file right away?
I'm using JSF 2.2.7 and GlassFish 4.
(Sorry that I didn't post the code, but I don't really think it's necessary. If that's not the case, just let me know.)

SendKeys VB.net

Hi ive developed a application that works with my site by using
SendKeys.send("{ENTER}") to submit info on one of my forms.
Is there a way to stop it from running outside the application?
For example im trying to run the program in the background and when im browsing my facebook or on google it randomly keeps hitting enter.
Any help is greatly appreciated thanks for your time.
The short answer is to look at the windows available for a process and check the titles to see if it's the page you want.
If System.Diagnostics.Process.GetProcessesByName("firefox").MainWindowTitle = 'My Page Title'
...
End If
That said, there are much better ways to do this - If you're using firefox, look into GreaseMonkey, if in Chrome, look at TamperMonkey.
Both allow you to inject custom javascript into any page whose url matches a pattern you choose. In effect, you could write some Javascript to submit a form (say) 30 seconds after page load.
This would have the benefit of working if a different tab is selected as well as not requiring a whole application.
The SendKeys.Send method will indiscriminately send the key stroke to the active application. There is no way to use this API to target a specific application.
You could change your app to try and verify the active application is the one you want to send keys too. This is destined to be a flaky process though. No matter how good your verification is it's always possible that the active app is switched to another app after your verification completes.
If VerifyActiveAppIsTarget() Then
SendKeys.Send("{Enter}") ' Active app could change before this runs
I would persue a different solution for sending data between my apps

Forms open and load very slow. Sometimes they won't open

I have a relatively small VB winforms project.
It is currently used to launch numbers hyperlinks and some apps on a server.
There are a couple functions that do all the work, but the it really boils down to:
System.Diagnostics.Process.Start("iexplore.exe", urlVar)
or if it is an app sitting on the server, the variable passed into the function appLinkVar will contain the need file path to launch the application.
System.Diagnostics.Process.Start(appLinkVar)
The "items" are stored on a SQL Local Database (.mdf)
Id, appName, appLink, appClickCount, appFavList,anddecision, which tells the function if it is calling a website or opening an executable.
Currently, there are forty rows in the database and I project 150+ in the end that need to be updated centrally and often (weekly). But that's a different question for later. The reason I added in it in this question was for insight as to why I am using a database instead of a Setting or XML file for some links. (better suggestions welcome)
My admin main form loads Visible = False and loads the icon in the system try. So you can't actually see the first form that opens. It is a hidden admin window and it's main purpose is to put the icon in the system tray. The green RJ icon - http://snag.gy/VBa6c.jpg
Then all of the app interaction is around the notify icon. Example: the app loads on hover. right-click for settings and options etc.
Once the primary form loads, on mouse over the "Primary Label" for example and the white form to the left appears and so on. Not much to it. http://snag.gy/excKr.jpg
The Frequently Accessed items is currently stored on the database called appClickCount, this will be coming off of the database and to another recommended way of storing the data. But when I initially added the database, I noticed some lag in the main form loading. It would take it 5-7 seconds to populate the Frequently Accessed Items List and so on. So I changed the code from mainWindow.show() to mainWindow.visible(). Worked great for me. opened and closed very quickly. But after some use today by a tester, the application became almost unresponsive. He clicked on the notification icon numerous times and the app failed to load. Then threw a SQL time out error. It was the end of the day and I couldn't grab a screenshot.
I need to make this more reliable.
After some discussion the other day on SO, I was talking to someone that recommended I re-write the app in C# WPF, and that is definitely the plan. But I need this thing to past testing as is in VB this week. Where can I start troubleshooting the delay in opening? What other suggestions do you have to improve the application? Do I need to have an invisible form load first so I have access to a system tray icon or is there a better way?
I have talked to quite a few people on here lately and got some really good advice, I figured I would lay it all out here and see what input you guys can give a new guy... I'm also gonna go hang in the C# room for a little bit if you have any further questions.

Mac Sandboxed App Loses File Permissions to Other Apps

I'm developing an app that is currently sandboxed. It acts as a basic text editor. Recently, I wanted to test what happens when I open a file in my app and another app at the same time, make an update in one app, then then see the updated in the other. I'm using Coda or BBEdit as my alternative editors. If I turn off sandboxing -- then this issue does not exist. However, since apps are required to be sandboxed as of March 1, I would rather implement a solution rather than wait and see.
When I open both files and make an edit in my app and then switch to the other app, the changes are reflected so that those editors have the version just saved from my app. However, if I perform the converse of saving from their app and then moving to mine -- no joy. Without performing any action, the console reports two specific errors: deny file-issue-extension and deny file-write-data. The app appears to be losing privileges to edit the document since it was changed by an external editor after the document was opened in my app. If I try to save the file in my app, it asks to duplicate the document because it has lost access to the original document. This doesn't happen the other way around because those apps have not been sandboxed and therefor have permissions that my app does not. It also doesn't appear that you can prevent the other app from making the changes if you don't want this behavior.
The documentation on developer.apple.com mentions nothing of this type of situation. I am not sure if this is intended behavior. If it is, then I can just tell my user that the document permissions have been lost and they should either save a new version or re-open the file. If it is NOT intended behavior, then what method in the NSDocument API would grant permission to the file once it has been lost? I'm assuming the answer is the former, that this is intended, but can anyone confirm and is there documentation?
Without performing any action, the console reports two specific errors: deny file-issue-extension and deny file-write-data. The app appears to be losing privileges to edit the document since it was changed by an external editor after the document was opened in my app. If I try to save the file in my app, it asks to duplicate the document because it has lost access to the original document
The correct behavior in a situation like this is to not overwrite the file, but to prompt the user if they want to reload the document, if so reload it and then write it.
The OS is doing the right thing by not allowing a blind write over a file that has changed.
See NSFilePresenter - (void)presentedItemDidChange to see if it changed. Reread the file and then see if you can save it. You dont say you have been denied a read on the file.
Also, since you havent posted any code it might be helpful to show what code you are using to access the file and to save it. NSDocument has built in handling for some types of file changes in the sandbox.
Lets call your App ScottEdit and your competitor as StackEdit
There could be several things going on. NSDocument has a lockDocument method. StackEdit may have locked the document and did NOT unlock it after save. If you quit the app, the file should be unlocked and available for your app. If this is the case, you will need to create a notification for when the file attributes change using kqueue or another.
If the other app is "blocking" access to your app. You can send an email to that developer and ask him to update his app so it unlocks the document after save. This last step is in addition to setting up notifications because another developer may come along and do the same thing (breaking your app).

Getting process list and hiding a specific app

How do I get a process list (in a popup button), and then when the user selects the application, can I hide/kill/minimize/quit the application?
-[NSWorkspace runningApplications] will give you an NSArray of NSRunningApplication instances representing currently-running processes. I'm not exactly sure what causes a program to be excluded from that list, but it does include any application that the user has launched from the Finder. It also includes a couple of things (the Finder itself, and the loginwindow process) that you don't want to mess with, as well as faceless applications.
You can filter those out using filteredArrayWithPredicate:; the objects you want to keep have an activationPolicy of NSApplicationActivationPolicyRegular.
Once the array is filtered, you can search it, using bundleIdentifier, bundleURL, or localizedName to find the app you want. Then send hide or terminate as you like to that NSRunningApplication instance.
Apple has a sample project that demos all this, called AppList.