Google colab form has a powerful feature called Forms, https://colab.research.google.com/notebooks/forms.ipynb.
In that there is a dropdown option too, I want to modify the options of the drop-down list via code.
Is it possible to do so colab?
Example it should work in this manner:
n = input('Give a number : ')
arr = list(range(n))
dropdown = arr[0] ##param arr
I have tried the above code but it won't work simply because the param list is after #, hence it commented as python cant reach till there.
If not should I use Jupyter Widgets? Would they be efficient, fast, and most importantly re-run cells on change?
Related
I've got local tasks displayed as tabs on my users' profile page.
Those local tasks are added by various modules.
I need to change the order of those tabs, and change some of their labels.
I can't figure out how to do that.
I tried using the menu_tokens module to replace those tabs by a real, customizable menu, but unfortunately it's not working correctly in Drupal 9 yet and breaks the whole website. Maybe there's another way which I'm not aware of?
Use hook_local_tasks_alter hook inside your custom module. I've checked and it's still valid in d9.
Inside your module_name.module file place a function named according to the convention function module_name_local_tasks_alter(&$local_tasks) {
Place there a breakpoint or simply var dump the local tasks, you will see, how many local tasks tab goes through this function.
In the end you will find entity.user.canonical, just overwrite the item weight in similar manner:
$local_tasks['entity.user.canonical']['weight'] = -3;
$local_tasks['entity.user.edit_form']['weight'] = -2;
Source: https://codimth.com/blog/web/drupal/how-override-local-task-drupal-8
I'm trying to use Atom 1.8.0 for grokking code, at most a few thousand Java and XML files. When I perform a global search with Ctrl+Shift+F , the results appear in a tab named "Project Find Results". However, if I do another global search the new results appear in the same tab, replacing older results. I'd like Atom to open show results in a new tab every time. Is it possible?
Note: There seems to be a similar feature request here but I cannot access GitHub at work.
I have been trying to find if there is any way to find out the iframe name from Firebug, without having to use its built-in console.
I am aware that window.frames[x] will switch the window handle to "x"frame, but is there any way to just find out the name of the frame without having to use console, so that I can use the frame name in my Automation script?
I am now using Firepath to get the name of the frame, however, I was wondering if the same can be done using Firebug.
Thanks!
A simple way to find frames within the DOM structure is to use the HTML panel´s search (which allows to search for XPaths). So, just type in //frame (or //iframe for iframes) and you´ll be able to navigate through the different / elements.
The frames are also listed within the DOM panel.
Firebug also offers you a way to switch between different frame contexts via the cd() command, but it does not have a visual option for that.
Though the Firefox DevTools implement a button, which lists the different frames in a popup menu.
If you mean the name attribute when you speak about 'name', you can also get them easily using the following code:
var frames = document.querySelectorAll("frame, iframe");
var frameNames = [];
for (var i = 0; i < frames.length; i++) {
frameNames.push(frames[0].getAttribute("name"));
}
I am trying to find a strategy in the Vimperator-logic for opening a link to a new tab and switch to it immediately.
I guess this might be a TMTOWTDI.
My first approach would be to start off with a :command sequence. Unfortunately F - Follow hint in background tab - has no equivalent in the command mode. The best solution for me would be without any change in default behaviour whatsoever.
Another approach might be to combine the default F with switching to next tag gt. This would have to include to pass the parameter for F, say 10 for the tenth link of the document. Unfortunately F10gt does open the tenth link but without switching to the newly opened tab.
A third approach does come to mind when using focus elements: ;y10 yank the destination link, :tabopen + paste clipboard content.
Any ideas of what is doable and the easiest?
This functionality exists as a mode of the hint function. Pressing ;t
will produce the desired result. If you want to map it you can also access the javascript directly.
:js hints.show("t")
I have made a script that takes files from directory, and sends them to backburner for network rendering. When I run the script it renders fine but without the render elements they dont show in the backburner monitor nor do they save.
If I open some of the files manualy and send them to render with backburner it works fine, but not with the script?
The render element is VrayAlpha, but I dont think it matters.
This is the code Im using
on btnRender pressed do
(
outputFilesDir = textModelsOut.text + "*.max"
toRender = getFiles outputFilesDir
man = NetRender.GetManager()
man.connect #automatic "255.255.255.0"
man.GetControl()
for s in toRender do
(
renderModelPath = getFilenamePath s + filenameFromPath s
job = man.newJob file:renderModelPath
job.Submit()
)
man.Disconnect()
)
And this is quote from maxscript documentation, it says that render element data will not be available but it will be processed.
Jobs can not have maps included, and render element data will not be
available for submitted job but render elements will process
correctly. These problems are resent when submitting a job from a
file, but not when submitting the current scene.
Anyways my solution was to use job.newJob() to open each scene and submit the current scene.
You should always include your code (or at least some of it) so that we can check it for issues and test it our selves.
However, I usually use a struct called NetRenderAutomation, developed by Gravey.
You can find it here:
http://forums.cgsociety.org/showthread.php?f=98&t=1059510&page=1&pp=15
I haven't had any problems with it, and it is fairly easy to use, and you are even allowed to modify it, if you need some special features for your self.
Hope you can use the answer.
Else feel free to post some code, and I'll look into it.