I am using ZnZincServerAdapter and have a web server. I now want to make sure that when I start this server there should be a piece of code that gets executed. how can this be done ?
basically i have a web app in smalltalk so I when I go to that URL , i want the previous heavy piece of code to be executed when I start my server and not when I load my page.
You can this from within the image or when you start it. For within the image have a look at
Smalltalk>>#addToStartUpList:
This registers a class that will be executed when the image starts. You need to implement the methods startUp: and shutDown: in your class. Those will be called on start/stop of the image.
Or you can do it when starting the image. If you provide an argument (needs to be the first argument) to the image that is a file (absolute path necessary) the image will read the file in and execute it
Related
Basically I want make sure I execute a custom written .applescript every time Safari is opened.
I tried adding the script to the "~/Library/Scripts/Applications/Safari" folder but that doesn't seem to automatically do it.
As a workaround I can probably just write an AppleScript that both starts Safari and runs my custom stuff. I just wanted to check whether there's a cleaner way of doing this.
Putting stuff in the ~/LibraryScripts/Applications folder just makes them available when the particular application is active.
In addition to your alias that runs the script and Safari, you could use some AppleScriptObj-C in a background application (maybe run via login items) that registers for NSWorkspaceDidLaunchApplicationNotification notifications to get the names of applications as they are launched. This would also have the advantage of seeing when Safari gets launched other than from your alias, such as via various document links (Mail, PDFs, etc):
use framework "Foundation"
my addObserver:me selector:"appLaunchNotification:" |name|:(current application's NSWorkspaceDidLaunchApplicationNotification) object:(missing value)
on appLaunchNotification:notification -- an application was launched
# notification's userInfo contains the application that was launched
set applicationInfo to NSWorkspaceApplicationKey of notification's userInfo -- NSRunningApplication
set appName to (localizedName of applicationInfo) as text
-- do your thing depending on appName
end appLaunchNotification:
I have created a unit test project with Selenium to perform some UI actions. In one of page i need to upload file from local machine, and for that i am using SendKey method available in c# but that is not consistent so i thought if we can add a small recorded coded UI method which would just do windows interaction like select file from window control. I browse through MSDN and tried all links but its not happening. Please help me in this regards
say I have created a Unit test Project "Test" and inside that created a Unit Test class added selenium web driver references and inside it a Test Method in which i launched the browser and reached till the point where i need to upload file.
Now I added a coded UI test file and recorded the uploading the file part in CodeUITestMethod1() in new class CodedUITest.
Now when i try to call codedUITestMethod1() from my first test class its giving errors like "PlayBack.dll "or "UITest.dll" or some other Dll could not be Found. But i have added all the coded UI and these dlls and i ensure that i call PlayBack.Initilize() before codedUITestMethod1() is called but everytime i get some errors at PlayBack.Initilize() method.
I have taken refrence from follwing links :
https://blogs.msdn.microsoft.com/gautamg/2010/03/30/how-to-get-uitesting-methods-working-outside-the-testmethod-of-coded-ui-test/
http://blogs.microsoft.co.il/shair/2010/07/15/running-codedui-test-from-another-application/
I have used visual studio 2013 for this work . Pleas Help
I implemented WL.OptionsMenu in android environment as specified in Worklight APIs(android/js/mainApp.js). If menu option is clicked, I've given a callback function . Its working fine if the callback resides in the same file. But the implementation of that callback is resided in android/native/common/js/mainApp.js file. Hence, its not showing the menuOptions in android mobile. How to solve this problem?
Edit your question with the contents of mainApp.js
There is no such path, in Worklight, as android/native/common/js/mainApp.js.
Perhaps you mean android/native/assets/www/default/common/js/mainApp.js, but then again, it is exactly the same as android/js/mainApp.js.
The only difference is that android/native/assets/www/default/common/js/mainApp.js is created after you build your application.
There is no reason why it should not work.
Again, edit your question with the contents of mainApp.js and the steps you have taken from creating the project, to running it in your device/emulator.
I am using Wix Burn to install per-requisites of our project, I have used ManagedBootstrapperApplicationHost to have custom UI, I have been following project available from Wix Source code to create my Managed WPF application..
Now the problem is the Progress (Message) it shows that doesn't match the progress message we have using inbuilt UI - WixStandardBootstrapperApplication.RtfLicense
Basically I am using following code from the Wix source
private void ExecuteMsiMessage(object sender, ExecuteMsiMessageEventArgs e)
{
lock (this)
{
this.Message = e.Message;
e.Result = this.root.Canceled ? Result.Cancel : Result.Ok;
}
}
How can I have the same display as the normal Progress dialog has.. Do I have to individually set Message from other methods like PlanPackage etc..
The wixstdba does not show the action data progress messages today. There was someone talking about adding the feature on the wix-devs mailing list but that has not happened yet. It's simply a matter of adding code like you have in the managed case to the wixstdba (that doesn't have it yet).
If you just want to display the name of the package being installed the way the wixstdba does it, then you'll want to handle the Engine.OnCachePackageBegin() and Engine.ExecutePackageBegin() callbacks. Those callbacks tell you when a package begins to be downloaded and then installed respectively. As part of the args to those callbacks you'll be provided the package id.
To get the friendly display name, you can read the BootstrapperApplicationData.xml that is automatically included next to your Bootstrapper Application .dll. In there are WixPackageProperties elements that provide lots of information about the packages in the bundle, including the DisplayName.
--- Sorry, the following is an answer to a question that wasn't asked. ---
The Engine.ExecuteMsiMessage() callback is called when the Windows Installer displays a message (like action data or a request to prompt the user for input). Progress is provided via a three different callbacks.
You can get the overall progress via the Engine.Progress callback. This is a very coarse grained progress that essentially moves as each package is cached and executed.
You can get the overall and individual package progress via the Engine.CacheAcquireProgress. This progress moves as each package is downloaded/copied and verified to be placed in the Package Cache.
You can get the overall and individual package progress via the Engine.ExecuteProgress callback. This progress moves as each package is installed/repaired/uninstalled.
So the Engine.Progress shows you the total overall progress and is very easy to use for a single progress bar but the progress bar will not move very smoothly. You can get a smoother overall progress by adding the Engine.CacheAcquireProgress to the Engine.ExecuteProgress. Note: that will give you a progress bar that goes to 200.
You can see how the WixBA handles all this in the src\Setup\WixBA\ProgressViewModel.cs file.
This is in AS2. I'm loading an external AS2 swf using the loadclip function.
But I don't know how to call its gotoAndPlay or stop functions. How do I reference to them?
When I trace the loaded file it says
_level0.mcContainer.instance42
The object path always varies every load like now it's instance42 sometimes it becomes instance7 or instance10.
Ok. I was wrong. instance42 refers to the anonymous instances inside the loaded swf. upon loading the loaded clip replaces the container movieclip, hence I can refer to the loaded swf using mcContainer.