Do solana programs created using Anchor only have IDL? - anchor

I am learning about IDL. By following this answers .
I want to know wheather programs deployed using anchor framework only have IDL ? If not how can I fetch the IDL from a cluster not created using anchor.
For eg:
I have deploy a simple helloworld program here on testnet . ( Program ID : 7SKPHGcFDHqK3wbLxiGudZWwajs8ApyHiPiEgD2TYXTq ) . I deploy it following this tutorial
Can someone please show me how can I fetch its IDL ?

Related

Openstack SDK to resize the instance

I have a requirement to read the input YAML file and resize the servers with the specified configuration like(VCPU, Disk,memory..). Note that the server name is already exist in the environment. I have automated this using python code using the cli command. Reference link for command
https://docs.openstack.org/nova/latest/user/resize.html
But the requirement is to implement this via SDK. Please let me know how to implement this logic via python code by invoking openstack SDK?
Operating System: Ubuntu 16.04
Input Yaml:
Servername1: test1
VCPU: 2
Disk: 4000
Memory: 200
Servername2: test2
VCPU: 1
Disk: 1000
Memory: 100
According to the SDK API documentation, the Compute class (doc) has methods called resize_server, confirm_resize_server and revert_resize_server.
Please let me know how to implement this logic via python code by invoking openstack SDK?
The sequence would be:
Read your yaml file.
Find the existing server that you want to resize.
Lookup flavor1 with the specs that you need (VCPUs, disk, memory, etc).
Check that the server doesn't have that flavor already.
Resize the server
Check server is working correctly. How you do that will depend on the context. But if you skip this step and "confirm" anyway there is a risk that you will lose the existing server.
Either confirm resize or revert resize
For more information how to obtain and make calls on the Compute object, please see "Using OpenStack Compute".
1 - You could also synthesize flavors on the fly, but that is liable to give you a flavor management issue in the long term.

How to modify path where Torch Hub models are downloaded

When I download models through Torch Hub, models are automatically downloaded in /home/me/.cache/torch.
How can I modify this behavior ?
From official documentation, there is several ways to modify this path.
In priority order :
Calling hub.set_dir()
$TORCH_HOME/hub, if environment variable TORCH_HOME is set.
$XDG_CACHE_HOME/torch/hub, if environment variable XDG_CACHE_HOME is set.
~/.cache/torch/hub
So I just had to do :
export TORCH_HUB=/my/path/
Edit
TORCH_HUB appear to be deprecated, use TORCH_HOME instead
I'm sorry but I'm trying to find out how to free up space, and these answers don't make sense to me.
Where do you type "TORCH_HOME"?
python TORCH_HOME in cmd brings up an error in windows 10.
and Torch and TORCH_HOME is not recognized as an internal or external command,
operable program or batch file.
Are you answering this for linux? because cmd uses a > and not $

XPSDrv Sample Entry Point / Filters Squence

Finally, I managed to build XPSDrv Sample project successfully . But still there is a problem .
I need to execute a function ( to start an exe file ) after the xps file has been sent to the printer (in my case to local port). So , where and how can I add the function ?
And regarding the filters , how would I know the sequence in which the filters executed .
I really need a help in this matter because I am a beginner in Windows Driver Development , specially in Printer Drivers ...
Any Idea is highly appreciated.
Thanks in Advance
Which filters are included, and the order in which they execute, is controlled by the PipelineConfig.xml.
I'm not sure that launching an external executable after the document has cleared the pipeline is a particularly good idea, but if you must do so, you will need to add that functionality to the last filter in the pipeline.

How to run di basic example of WSO2 EI Business Process?

I am absolutly new in WSO2 EI and I have the following doubt.
I am following this official tutorial to study the creation of a business process BPMN process):
https://docs.wso2.com/display/EI600/Quick+Start+Guide
If you go in this tutorial the second tab is refered to the Business Process Management tutorial, then I continue following the business process BPMN process street.
I followed all the tutorial and I think that I have understand the key concept of this example but I have some doubts about how to run this example.
At the end of the tutorial it does:
To create the Business Archive File (.bar), do the following.
On the Explorer, found in the upper left of your screen, navigate to Package Explorer.
Right click on the package and select “Create deployment artifacts”.
Navigate to the location of the source. You will find the .bar file inside the deployment folder.
So now I have my /HelloWorld/deployment/OrderApproval.bar file created.
But now what have I to do with this file?
I also have download the EI Server from here: /HelloWorld/deployment/OrderApproval.bar
Then I have configured it in my Eclipse Developer Studio EI setting it as a WSO2 server.
So my doubts are:
What exactly represent this OrderApproval.bar file? Is it a file representing a WSO2 EI executable project or what?
From what I have understand the previous example represents a work flow representing a BPMN process that implements a flow with some rules without that I need to write Java code (correct me if I am doing wrong assertion). But is it something executable or something that have to be integrated into some other application?
If it is an executable project what have I to do to run it and interact with it?
BPMN is process definition that can be run on BPS server. BPS server is part of WSO2 EI solution. You have to run it from [EI_HOME]/wso2/business-process/bin
On Linux/Mac OS: sh wso2server.sh
On Windows: wso2server.bat --run
Then, when it works correctly, open https : // [serverIP]:[port]/carbon/ and log into the EI-Business Process management console.
Next navigate to Home -> Manage -> Processes ->Add -> BPMN and upload your OrderApproval.bar file.
After uploading file, log into the BPMN-explorer at https : // [serverIP]:[port]/bpmn-explorer. On the "proecesses" tab you should see your process which can be run by action->start.
Try studie this example: https://docs.wso2.com/display/EI600/Creating+a+BPMN+Process

Using Cloud Code with the Parse Server and Heroku

I am trying to understand the new Parse Server and have deployed on Heroku. This went smoothly but what I am struggling with is figuring out how to write server side code (Cloud Code). I've read over the parse server example many times so I must be missing something but I'm very unclear if I should be using Express for something, or how I even begin to include my Cloud Code files. Any help is very much appreciated.
UPDATE:
I found the cloud folder I was just looking in the wrong place. I moved it and index.js to my apps folder on the desktop. I have changed the default code in main.js to my custom code. I have set up index.js with my apps information. The problem now is when I run the app and try to call the cloud code functions I get error invalid function.
If you have the parse server example running on heroku you are 90 percent there. Just open the cloud/main.js file and start adding your cloud code. There should be a hello cloud function there as an example.
To use your already created cloud code modules/files you can require them as you have done before on parse.com. The only difference is that the path should now be relative instead of absolute. For example require('cloud/cloudFunctions'); should be require('./cloudFunctions'); if you had a module called cloudFunctions.js in the cloud directory.
Cloud Code works similar to how it did on parse.com and you shouldn't have to think too much about expressjs for simple applications. That said, parse server is using expressjs so yes you are using it.
Parse server is simply a another node module similar to the other thousands available. If you do not have previous experience with nodejs, running parse server can seem complicated. Therefore I would recommend reading about the basics of nodejs before a full migration.
I'm using the Bitnami stack on a Google Compute Engine instance and I had a similar problem to yours. To solve it, just navigate to the folder where your server.js file is and create a folder called "cloud". Then create the main.js file inside the cloud folder with the following content:
Parse.Cloud.define('hello', function(req, res) {
res.success('Hi');
});
Now open the server.js file and find the line containing the path to the cloud code file. Change it to point to you main.js file like this:
This could be any arbitrary folder of your choosing.
Now just restart your parse server and call the cloud function:
String result = ParseCloud.callFunction("hello", new HashMap<>());
This is with the Java SDK but should not be much different. The variable result will equal "Hi" if you've used the function from above.

Resources