How to use a code node to list all of the datasets in a .egp file using SAS EG? - sas

I want to get a list all of the datasets to enter them into an array.
I could then feed each item in the array into a macro to prevent me from having to do a repetitive task.

I don't recall EG having that level of introspection available to submitted code. However, an add-in tool can be programmed (as a Windows .dll) and the add-in will be able to examine the client (EG), project and other meta information not available to code submitted by the client (i.e. your SAS code that will run either locally or remotely depending on server settings of the active profile)
A link to reference documentation (SAS.EG.ADDins) and other add-in material can be found at http://support.sas.com/documentation/onlinedoc/guide/release30/addins/
The SAS.EG.Addins help states
Services Supplied by the Host Application (to the Add-in)
The following interfaces
surface information and services that are supplied by the host
application (for example, SAS Enterprise Guide and the SAS Add-in for
Microsoft Office). These are the interfaces that are supported by all
host applications:
ISASTaskConsumer Provides information about what the application
supports and access to other supported interfaces. Also provides
access to options specific to the particular instance of the add-in.
ISASTaskData, ISASTaskDataAccessor, ISASTaskDataColumn Provides access
to data services.
These are the interfaces that might be supported by a given host
application. If your add-in code takes advantage of any of these
interfaces/services, you should include checks to ensure that an
interface is supported before you attempt to use it.
ISASTaskSubmit Allows your add-in to submit a SAS program for
processing while the user interact with your user interface.
ISASTaskUtilities Supplies utility methods for use by your add-in.

Related

Geolocation, Geocoding in C++

I am working on a project or application built in Windows using C++. I would like to seek help on any idea or approach or existing libraries that implements geolocation/geocoding, since I want to limit may C++ Windows application to run on certain region or country only.
Any suggestions, comments will be a great help. Thanks.
It won't be possible to prevent an application from running locally in certain regions. A user can always disconnect from the internet and then you'll have no idea where they're located.
What you could do is to have some of your app logic run in a server, then make requests to your server from the local C++ app. Then you can geolocate based on the IP address of the request, often a standard feature in cloud platforms.
If you do want to explore getting someone's location, you can look at Apple's Core Location or Microsoft's Geolocation namespace.

How to add layer on top of file system? Like cache in OneDrive or Google Drive

I'm looking for a way (using C# .Net or C++ and WinApi or anything) to add a layer between filesystem and client application to add custom behaviour.
Like OneDrive and Google drive application on Windows. You can browse files normally but if given file is missing from a drive it will be downloaded. I need to do something similar. And I need this solution to be transparent to other software (explorer and any other software that accesses files on drive).
I really even know what to call it. So if you have a name for that type of functionality please let me know.
Here are some approaches to building a virtual file system on Windows:
Using Cloud Files API. OneDrive is built using this API. It is designed for slow-speed remote (cloud) storage, such as Document Management System. Here are some features that it provides:
On-demand loading. You can load the file content into the local drive only when an application is accessing it the first time. The folder listing can be done during the first access to the folder.
Offline files support. You can pin/unpin files to keep on the local drive when the server is unavailable.
Download/upload progress reporting.
Integration with Windows File Manager. Each item shows offline status, pinned/unpinned status, in-sync status, and download progress.
Messages and error notifications to the user, as well as file system status reporting.
The driver that this API is using is installed with Windows by default and does not require installation. Here are some tools to build an OneDrive-like application:
CloudMirror sample in C++ from Microsoft. Code on GitHub.
User File System from IT Hit provides example in .NET. Code on GitHub.
Using Projected File System (ProjFS). It allows you to represent (project) some hierarchical technical data as a file system. It is designed for high-speed back-end storage, such as for example registry. Here is its major feature:
Hides the fact that the data is remote. The user "thinks" that the files are in the local file system and does not have any status information. The user does not know if the file content is available/unavailable or online/offline.
ProjFS is not installed by default and requires Windows component installation (thank you IInspectable for this info). Here are some tools to build with it:
Programming guide. Sample: Virtual File System for Git.
Using Shell Namespace Extensions. Typically used to create a UI extension for Windows File Manager. For example, Windows Recycle Bin and Printers are namespace extensions. They are not available via standard Windows File API and applications can not read/write to it unless it redirects to a real file system behind it. Here some features that it provides:
You can customize the Windows File Manager toolbar, shortcut menus, folder view, tree view, and status bar.
You can extend the Windows File Manager hierarchy, adding new custom nodes that look and behave like files and folders (cut/copy/paste, drag-and-drop, etc), without building a functional file system behind it.
Shell Namespace Extensions are part of Windows and does not require additional components installation. In many cases, you will use Shell Extension to add shortcut menus and items on a toolbar in Windows File Manager while building the actual file system using Cloud Files API or ProjFS. Links to start working with Shell Namespace Extensions:
Understanding Shell Namespace Extensions
Extending Shortcut Menus
What you are looking for is commonly called a "Virtual File System". To applications it looks like a file system, but the implementation is at your discretion, allowing you to materialize objects in any way you see fit.
On Windows you have several options to implement a virtual file system. The most common and widely supported infrastructure is the Shell Namespace. It allows you to register extensions, that appear as items (e.g. files or folders) in the file system. It's not entirely trivial to write a Shell Namespace Extensions, but it's not rocket science either.
A more recent addition to Windows is the Projected File System, that provides everything you need to build a virtual file system in user code. It ships as an optional component in Windows, and needs to be explicitly installed first. For an implementation that uses the ProjFS, see the VFS for Git github repository.

Deploy a local webservice on many machines - is it the right strategy?

I was wondering about the best way to deliver private web service instances to lots of users, so the user would always be able to connect to their own offline version of a service, just like running a web service from visual studios while debugging. I was struggling with setting this up in VS2013 even with the many online tutorials, but I am not sure if its not working because it was never supposed to work this way.
I have provided this in-depth explanation of my issue as i am not sure i am going about this in the right way and would appreciate feedback:
Background:
I have a web service to interface with an engine. This deals with the front-end and builds a set of commands for how to make a CAD model. These commands are for controlling the 3rd party CAD software's API. Therefore the engine can be seen to have two main functions -
Build the CAD's API instructions, which can be saved for later
Execution, where it catches the instance of the CAD software
running on the same computer and it builds the model.
The second part is restricted for the general public. Only our in-house users should be able to use it. However, they want to have an otherwise identical front-end and user experience.
The problem is, if they connect to the same engine as the public, which exists on our main server, then the engine will be looking for an instance of the CAD package on the same machine as itself - i.e the server, as stressed in the emboldened point above. What should happen is the engine finds the CAD instance running on the machine that the controlling UI is based on and it uses that for its target. I have spoke to the CAD API support and they say they do not know how to do that.
And so we get to my solution of providing an offline stand alone of my web service on each of the employees computers. This means the front-end will check at the start of the session if a localhost connection is available. If not it will use the main address, which takes it to my server. Otherwise it uses the local engine which will look perform the default behavior of looking for a CAD package on the same machine as itself. Because its locally installed that is now the right machine and it will find the CAD instance of the user successfully.
Final points:
The engine cannot be accessed by the UI directly as i am using
Unity3D for the front-end and there is .Net compatibility issues.
I need a completely self contained version of the software in the
future anyway, so eventually i have to deal with having the engine
accessed locally
I ended up using IISExpress. I got the user to install this and then get them to call a batch file installer i made which sets up the config file and moves my web project to the correct directory.

How to run my own C++ source files in the installation wizard?

I have created a windows install deployment for my C++ application using VS2010. However my problem is that I don't know how can I squeeze in some of my own code to the installation wizard (and is it possible at all?). The problem is that during installation I want:
ask the user to provide his installation key,
grab the hardware fingerprint (I already have an algorithm for that with WMI),
sent both keys using my own c++ communication libraries (so NOT the browser),
continue the installation after receiving a confirmation from the server.
Moreover, this would require adding custom items to the installation wizard like the input field for installation key, or pop up boxes witch error warring like:
Couldn't connect to the server. Please check your internet connection before continuing with the installation.
So it's in fact a 2 level question:
How to run my C++ source files during the installation wizard?
How to add custom element to the installation wizard GUI?
So far it has been hard to find anything helpful in Google. :/
Check Windows Installer, more specifically Custom Actions:
The developer of an installer package may write code to serve their own purpose, delivered in a DLL. This can be executed during the installation sequences, including when the user clicks a button in the user interface, or during the InstallExecuteSequence. Custom Actions typically validate product license keys, or initialise more complex services. Developers should normally provide inverse custom actions for use during uninstallation.
Msiexec provides a way to break after loading a specified custom action DLL but before invoking the action.

Using MS Access to return on-demand reports in a web server?

I have built a MS Access 2007 application that can create reports files in various formats (PDF, XLS, CSV, XML).
I would like to allow the creation of these reports to be accessible from a web page where users would just click on a link and get a download of the report produced by my Access application.
I would like to keep it simple and I'm not interested at this stage in rewriting the data processing in .Net. I'd just like to find a way to automate the creation of the user report to return a file that can be downloaded.
In essence, my Access application would act as a web service of some kind.
The web server is IIS on Windows 2003.
Any pointers or ideas would be welcome. I'm not well versed in IIS administration or ASP pages.
The first quick and dirty method i could think of would be to call Access from a shell and pass it a few parameters to open as read only and run a macro.
That macro would have to pull it's report parameters from somewhere (possibly env variables), run the report and save it as Excel, PDF or whatever to a unique name. To du this you'll need to pass the report name, a unique request id, and a param array to handle multiple (or none) parameters.
Last but not least your Access macro / VBA Sub will need to shut access down.
This isnt a good solution as starting one copy of Access per request isn't really advisable though.
Another option is to have start Access on the server with a VBA sub that starts on opening. This sub could poll a directory for requests that are written by your web server. Then on receiving a request run a report and write it to somewhere. Again you'd have to base this around a unique request ID.
I'm not really sure which "solution" would be better.... Access as a command line report generator or Access as a batch reporting service. Both would be nasty, but would get you over the hump until you can migrate to a reporting service.
This is kind of a round about way to achieve what you're asking. You can utilize the free version of sql server express 2005 or 2008 advance edition which includes the reporting services component. Using the report generation tools you can convert your access 2007 reports to sql server reports and have those reports feed off of the access database. You can also go to the extent of migrating the database to sql server as well if you wanted to go that route. Reporting services will generate pdf, xls, csv and xml formats as output for your reports and you can generate those reports just by passing the parameters in the url to the server which will return your report in the format requested.
Link to sql server 2008 express advanced edition:
http://www.microsoft.com/express/sql/download/
If you do not wish to rewrite in .Net, how about Classic ASP and VBScript? VBScript has a lot in common with VBA, so it should not take long create something usable, and there is a great deal of help available for ASP and VBScript on the internet. For example, a simple search returned this method of creating a PDF with Adobe from ASP:
Creating a PDF with ASP