How to change the tutorial folder in Orange? - orange

The default orange tutorial folder is the following:
..\Canopy32\User\Lib\site-packages\Orange\OrangeCanvas\application\tutorials\
What if I want to change this location? Or add another folder?
Also would it be possible to achieve this by simply having a configuration file inside OrangeWidget folder?
Help please,
Many thanks.

You cannot change the default location of tutorials, but you can add additional tutorial folders using entry point in setup.py.
First, you need to create a python package containing schema (ows) files. Then you need to add an entry point in the setup.py pointing to the location of the package you have created.
If the package with custom tutorials can be imported using import my_tutorials, your entry_point will look like this:
ENTRY_POINTS = {
'orange.widgets.tutorials': (
'my_tutorials = my_tutorials',
),
}
I have created a sample add-on that registers additional tutorials. It is available on github:
https://github.com/astaric/orange-custom-tutorials-example
If you download the code and run python setup.py install, you will see a new entry in the tutorials.

Related

Yocto determine what recipe a file came from

I am trying to determine how I can find what recipe a source file from the build/tmp/work directory came from. Basically normally most of the recipes in the source folder are uri. Then get downloaded and installed to various temp folders. I want to create a patch for some of the files, but I can't seem to figure out which files belong to what recipes.
Thank you
Run oe-pkgdata-util find-path /path/on/target/to/file. This will give you the package installing the file. From there, run oe-pkgdata-util lookup-recipe <pkg-name>, this will give you which recipe is creating the package. That should be enough to find out which recipe you need to modify. You then need to check whether the file you want to modify is part of the recipe (Yocto artifact) or part of the software that the recipe builds. For the former, you can override the file, for the latter, you can create a patch (you can use devtool to help you create the patch).

How can I import custom modules from a Github repository in Google Colab?

I understand how to run a single notebook in Colab. However, I am not sure how to use all files from a repository, i.e to be able to import functions inside Colab notebook?
Thank you.
Let's say we want to run the ipynb file, named as "1-fully-connected-binarized-mnist" residing in the repo "qnn-inference-examples".
https://github.com/maltanar/qnn-inference-examples
The notebook of interest uses customly created QNN library and functions inside that repo. Yes we need to import that function. To do this, we should first upload the repo folder to Google Colab, then correct/modify library and file paths.
0) Open the ipynb file "1-fully-connected-binarized-mnist" on your Colab. You can rename it if you like.
Try to run it, but will probably get some errors (as I did). So let's fix these issues
1) Insert a new code cell at the top of the notebook. And clone the repo on your Colab:
!git clone https://github.com/maltanar/qnn-inference-examples.git
now the new folder "qnn-inference-examples" created under your "content" folder. you should see something like this on the left side. And remember the path "/content/qnn-inference-examples"
2) Now add the second new cell on top:
import sys
sys.path.insert(0,'/content/qnn-inference-examples')
This will fix the issue about not able to find the library location, when trying import the QNN libraries.
3) Manually fix the file links on the existing code, according to the new path. Because the library and files now exist under the folder "/content/qnn-inference-examples":
for example replace:
img = Image.open("7.png")
with
img = Image.open("/content/qnn-inference-examples/7.png")
These steps should do the work
Please note that: This is not my own solution, mix of 2 or 3 solutions. Credit goes to Hüseyin Elçi, KDnuggets and Alexandr Haymin
https://medium.com/analytics-vidhya/importing-your-own-python-module-or-python-file-into-colab-3e365f0a35ec
https://www.kdnuggets.com/2018/02/google-colab-free-gpu-tutorial-tensorflow-keras-pytorch.html/2
Please see the example below:
!git clone https://www.github.com/matterport/Mask_RCNN.git
from google.colab import files
files.os.chdir('Mask_RCNN')
# To find local version of the library
sys.path.append(os.path.join(ROOT_DIR, 'Mask_RCNN'))
# here is your import
from mrcnn.config import Config

Go, Golang : external package import with GOROOT

Go, Golang : does not make sense that I have to have files before import
I am trying to go to next step but keep getting errors
I have the package that I want to import ready.
All I need to do is to import the external package from github and be able to use it on any code.
So this is what I did.
mkdir $HOME/go
export GOPATH=$HOME/go
go get github.com/user/project
This runs successfully. I downloaded it onto here with source code files from github
/Users/user/go/src/github.com/user/project/project.go
So to use this package that I just import I do
go run /Users/user/Desktop/code.go
But I am getting the following errors
MacBook-Air:~ user$ go run /Users/user/Desktop/code.go
Desktop/code.go:32:8: cannot find package "project" in any of:
/usr/local/go/src/pkg/project (from $GOROOT)
/Users/user/go/src/project (from $GOPATH)
What should I do? AM I missing something? Thanks in advance and please help me. I wrote a lot of code but being very frustrated not being able to distribute it because of this.
The error message says at line 32 in your code.go it can't find package "goling".
Assuming that is a local package you want to use, you need to make sure it is in your GOPATH.
If you set GOPATH then you should develop your code within it, so moving the "goling" directory into /Users/user/go/src is the right thing to do.
Alternatively "goling" could be a typo, so check the imports in code.go. If you want to import an project from github the import should say
import "github.com/user/project"
And you then use the parts of project with a prefix of project.
If that doesn't help you get it working, then post the imports section of code.go.
It looks like you've got the external package in the same folder as your main package which uses it. In go, all packages must be in separate directories. It looks like the github project itself is actually doing that. If you separate the packages into different directories it should work properly.

How do you add an external package to a GoClipse project for Google App Engine?

I've compiled Goauth so that I can use OAuth in my Go Google App Engine project. Where do I put the goauth.a file so that I can both use it in the project, and have it available when deploying to the GAE servers? I can get it working locally if I put it in a subfolder of $GOROOT/pkg, but then it can't be found when compiling at deployment time.
GoClipse sets up a project with lots of folders, I'm not really sure what their purpose is, where should I put goauth.a and how do I import it?
To fix this I ended up including the source for the package in the directory tree for my app, as mentioned in this thread on the google-appengine-go group http://groups.google.com/group/google-appengine-go/browse_thread/thread/1fe745debc678afb
Here is the important part of the thread:
You may include as many packages as necessary. Packages are imported
by path relative to the base directory (the one that has your app.yaml
file), so if you have the following:
helloworld/app.yaml
helloworld/hello/hello.go // package hello
helloworld/world/world.go // package world
you can import "world" in hello and import "hello" in world.
If you are including a third-party library, it might look something like this:
helloworld/app.yaml
helloworld/hello/hello.go // package hello
helloworld/world/world.go // package world
helloworld/goprotobuf.googlecode.com/proto/*.go // package proto
Then you can, as normal, import "goprotobuf.googlecode.com/proto".

How do I create a new folder and deploy files to the 12 hive using VseWSS 1.3?

I have created a web part using VSeWSS 1.3. It creates a wsp file and my web part gets installed, everything works great.
I would like to also create a folder in the LAYOUTS directory of the 12 hive and place a couple files in there. How do I go about doing this? I know that I can manually place the files there, but I would prefer to have it all done in one fell swoop when I uses stsadm to install my solution.
Is there a best practices guide out there for using VSeWSS 1.3 to do this? They changed a bunch of stuff with this new version and I want to make sure I don't mess anything up.
You can create a new folder structure in your webpart project, like:
Templates/Layouts/CustomFolder and put your files in the CustomFolder directory and include them in your project.
When you go to the WSP View in Visual Studio, you can see in the manifest.xml that your files are being included in the deployment.
I have done this successfully on multiple projects now.
In case anyone is wondering, the VSeWSS 1.3 user guide is incredibly helpful. It is installed to the same directory as the tool itself, default in C:\Program Files\Microsoft SharePoint Developer Tools 9.0\VSeWSS13.CHM
You can see a working example with screenshots Here
A simple step-by-step tutorial for the above, along with deploy/retract scripts is here at Add New Files To 12-Hive Through A SharePoint Solution. Just follow the steps and in a few minutes you'll be able to add whatever you want to the 12-Hive!