The "tag=" nbt tag in minecraft selector - storage

Very simple short and straightforward. I found that if I give myself firework_rockets with a custom tag called 'test', the item has an nbt={Tags:['test']}. The command I use is /give #s firework_rocket{Tags:['test']} 64
However once the firework is shot via a crossbow, I tried to retrieve its data and to my surprise, found out that the Tags:['test'] is not stored directly in the entity, but more discretely in an nbt called tag=. For example: entity firework_rocket has the following data ---
{OnGround:0b,Air:300s,blah blah blah, tag: {Tags:["test"]},Count:64b}
As seen from above, this Tags:["test"] tag in being stored in an nbt tag called tag.
If I want to detect a specific nbt tag such as the Air tag, I could do so simply with execute at #e[nbt={Air:300s}] run summon tnt
But what I want to do here is to detect the Tags:["test"] tag. /execute at #e[nbt={tag:{Tags:["test"]}}] simply wont work.

I don't know if you want a command to run when you select the firework or when it turns into an entity, but here are both commands. For both instances:
Entity : /execute as #e[nbt={tag:{Tags:["test"]}}] at #s run <command>
Item : /execute as #e[nbt={SelectedItem:{tag:{Tags:["test"]}}}] at #s run <command>

Related

How to get only the Full name of previous Jenkins build

I would like to send the full name of the previous build that was received by using the following:
Run previousBuild = steps.currentBuild.rawBuild.getPreviousBuildInProgress()
in order to send to getItemByFullName as you can see below,
Jenkins.instance.getItemByFullName(previousBuildPath)
I tried to find it in the Run class hudson Documentation with no success.
while printing previousBuild I got the name with the build number like:
previousBuild- > project_neme/build_name #100
But I want to get only the name with no String substring cutting.
You are looking for display name property. Display name is the name given to each build (if you update it during execution) followed by a build number. The display name will only return the build name.
Jenkins.instance.getItemByFullName('JobName').getLastBuild().displayName
Read here
https://javadoc.jenkins.io/hudson/model/Job.html

Moho, run script and get ScriptInterface instance

I need to run Moho lua script which created new document, import some files etc., by command line.
The problem is: to call this function requered ScriptInterface instance. It may called by mouse clicking, by menu selection in Moho ui (hand made calling) and sending ScriptingInterface instance as function parameter, like script:Run(moho). If I trying to call this function from commandline this instance not set as parameter.
So the question is - can I take ScriptInterface instance from some global vars or from somewhere else ??
You can prepare a special .moho file, which includes a layer with embed lua script. If you run command line opening Moho with this special file in it, it will execute the layer script (because it is executed on every new frame enter) and script will receive ScriptInterface instance as moho argument given to its LayerScript function.

Tcl Tk to show images in Scilab

I want to show images and videos in Scilab using a GUI made in Tcl/Tk.
Scilab has support for Tcl/Tk :- https://help.scilab.org/docs/6.0.0/en_US/section_a10b99d9dda4c3d65d29c2a48e58fd88.html.
I have made a tcl script which displays an image when run from the terminal.
image create photo img -file <filepath>
pack [label .mylabel]
.mylabel configure -image img
However when I write the following .sci file in scilab, it executes successfully but no image window is shown.
function sampletry()
TCL_EvalFile(<path_to_tcl_file>);
endfunction
I do know that the code executed successfully because when I execute the same function again in scilab, I get an error saying that the label .mylabel already exists in the parent window.
Is there any way that I can show images/videos in Scilab using this method or any other method in Scilab? I'm using OpenCV to read the image and return it back to Scilab through the Scilab Api in a list.
The problem is that you're not servicing the event loop from your Scilab code, without which the flurry of messages from the OS to do with actually putting the window on the screen never get through and handled. Assuming you want your code to stop and wait for the viewing to be done, you can just change the Tcl/Tk code to be:
image create photo img -file <filepath>
if {![winfo exists .mylabel]} {
pack [label .mylabel]
}
.mylabel configure -image img
wm deiconify .
# Wait for the user to ask for the window to be closed
wm protocol . WM_DELETE_WINDOW {set done 1}
vwait done
# Process the close immediately
wm withdraw .
update
There's nothing very special about the done variable. We're just waiting for it to be set in the callback. I've added a bit of extra code to allow you to call this twice (i.e., conditionally creating the widget, ensuring that . is displayed and then hiding it at the end).
The simplest technique if you don't want to keep everything in the same process is to run your original script as a separate program, effectively doing:
wish <path_to_tcl_file>
I don't know what the easiest way to do that from Scilab is.

Does the Zebra QLn220 printer have a "Flush" Command?

The ZebraQLn220 has many settings that can be programmatically updated via commands sent it, such as:
! U1 setvar "media.sense_mode" "bar"
However, sometimes it takes several attempts before that change is "seen"/accepted/applied by the printer. For instance, I have sent the
! U1 setvar "power.dtr_power_off" "on"
command several times before this one:
! U1 getvar "power.dtr_power_off"
...will finally respond back with "on" (giving me "off" instead the first several times).
So: Is there a command that can be sent to the QLn220 that tells it to "flush" or "write all changes" or "save changes" or "I really mean it this time" or some such?
UPDATE
I don't know what firmware is new enough, but this is what the printer tells me about itself as far as "appl" settings go:
appl.date : 2/19/2014
appl.name : V68.19.7Z
appl.version : 6819
appl.bootblock : 2.5.9
appl.link_os_version : 2.0
If you are using later firmware you can use JSON to format the commands. In this method the commands will respond immediately with the configured values.
{}{"media.sense_mode":"bar"}
would respond with:
{"media.sense_mode":"bar"}
You can also put multiple requests in one:
{}{"media.sense_mode":"bar",
"power.dtr_power_off":"on"
}
The following knowlege base article has more info - https://km.zebra.com/kb/index?page=content&id=SO8638&actp=RSS

Using pfccomp or pint to run Pascal-FC programs

I'm using the Pascal FC implementation for Windows Vista found on http://www-users.cs.york.ac.uk/burns/pf.html
I'm trying to run the dining philophers problem found on the link but I don't get how to make the compiler work.
Screenshot
In the screen shot, the program appears to be waiting for you to enter the name of the file to use for the compiler output. Enter a file name.
Better yet, use the pfc.bat command and let it choose the output names for you. The batch file will also run the program automatically after it has been compiled. At the command prompt, run the command like this:
C:\pascalfc-vista> pfc philchan.pas

Resources