To detect even number using LabVIEW - labview

I was trying to make the even calculator without using code in LabVIEW but the problem was when i ran the code i get 0 between all the even numbers between 1-100.
I just want the even no in array not 0s.
What modification should i make for it.

Vivien's answer will not going to help you.
You are in right way. Just right click on the output terminal and select Conditional terminal. Remove case structure and connect your boolean line directly to the conditional terminal.
Please read here: https://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/condacc_valuesnloops/
PS. to get evens between 1-100 you should add 1 to iteration terminal (or you will have event between 0-99).

You can do something like this :

Related

Maya crashes when duplicate special

I try to make instance copies of my character using Duplicate Special. But unfortunately it crashes every time I try.
For this I select my character's group "rig_group", then go to Edit → Duplicate Special ⊡
And I want to use these settings:
And it crashes Maya when I hit "Apply" or "Duplicate Special".
Note that it works on this character on a fresh file.
Test file - M01_WalkNeutral.0080.mb
Remember that duplicate special doesn't work properly on rig's. You can use duplicate special for polygons, curves or etc.
Ps. If you wanted to duplicate special a high-poly mesh I would say that to reduce the vertex then run that but about rig_group I'm not sure.
I hope to help that to you.

VIM equivalent of IntelliJ's expand/shrink selection?

How would one achieve the same result. I believe the keybinding for macOS Intellij is op+up/down and on windows it is alt+w/d.
Essentially the function highlights the current word, then, with successive presses, expands out to the full string/line/area in-between parenthesis/further out to the next set of parenthesis. Very useful for developing in LISP.
The closest I've gotten is this: https://vi.stackexchange.com/a/19028
Try this plug in: https://github.com/terryma/vim-expand-region
It expands selections based on Vim’s text objects.
Well this may seem comfortable but does not correspondent with the internal logic of vim itself.
See, in vim everything you enter is like a sentence. va{ for example: there is a verb v -> visually select and an object (or movement) { -> paragraph. In this case there is also a modifier a around. You can exchange stuff in this sentence and it will still work vaw, dil, cB and so on. The power of vim is greatly based on that concept.
Of course you can write a function that does vaw first, then S-v and lastly va{ but that will only work with visual selection. It will not work with c or d or anything. So I will recommend to get used to use different keys for different actions.
The visual selection is mostly not needed anyway. Change a paragraph? directly use ca} and so on.
I have found that VI/VA + WOBO (as many times as you need to expand) works similarly. Not as fast but its the same concept and you can even expand/shrink asymmetrically based on your WO's and BO's (Or OW's and OB's depending on how you look at it)

How to validate operators in a simple calculator vb program?

So I've been trying to do a calculator program in Visual Basic (shouldn't be too bad, I think). So far I got everything down and tested the operators individually. What I'm trying to do is to have the equals sign be able to determine which operator to use and go with it according to the button pressed for operator. I thought maybe if/else or switch/case could work, but I'm either getting addition first (it's the first in the choices) or nothing at all
Maybe I'm validating the wrong variable perhaps. I thought maybe that as an example:
if btnEquals.Text = "(insert operator sign here)" Then
{insert operator statement here}
on an if/else or case would do it, but it's simply not. I have checked in SO for any similar issue in VB, but most are for another language. I know I have to do something to ensure that the buttons coincide with the logical statements
Basically: How do I make the "=" button in the calculator program do the right arithmetic operation when the "+", "-", "/", "*" buttons are pressed? I tried if/else and case/switch and it's not logically giving the right answers.
Edited to clarify for other users.
Thanks in advance!
Already found an easy way to do it and it worked, it was simpler than I thought and was pulling my hair for no reason. Just for future reference. I just added a type char variable and with each arithmetic button (+,-,*,/) assign the arithmetic symbols to the variable and then use if/else or case switch in the "=" button to validate that variable.
Anyone with higher rank, you can go ahead and close this one. Thank you!

Extracting information from a file variable in d3 pick basic

I have a file variable in d3 pick basic and I am trying to figure out what file it corresponds to.
I tried the obvious thing which was to say:
print f *suppose the file variable's name is f in this case
but that didn't work, because:
SELECTION: 58[B34] in program "FILEPRINTER", Line 7: File variable used
where string expression expected.
I also tried things like:
list f *didn't compile
execute list dict f *same error
execute list f *same error
but those also did not work.
In case any one is wondering, the reason I am trying to do this in the first place is that there is a global variable that is passed up and down in the code base I am working with, but I can't find where the global variable gets its value from.
That file pointer variable is called a "file descriptor". You can't get any information from it.
You can use the file-of-files to log Write events, and after a Write is performed by the code, check to see what file was updated. The details for doing this would be a bit cumbersome. You really should rely on the Value-Add Reseller or contract with competent assistance for this.
If this is not a live end-user system, you can also modify an item getting written with some very unique text like "WHAT!FILE!IS!THIS?". Then you can do a Search-System command to search the entire account (or system) to find that text. See docs for proper use of that command.
This is probably the best option... Inject the following:
IF #USER = "CRISZ" THEN ; * substitute your user ID
READU FOO FROM F,"BLAH" ELSE
DEBUG
RELEASE F,"BLAH"
END
END
That code will stop only for one person - for everyone else it will flow as normal. When it does stop, use the LIST-LOCKS command to see which file has a read lock for item "BLAH". That's your file! Don't forget to remove and recompile the code. Note that recompiling code while users are actively using it results in aborts. It's best to do this kind of thing after hours or on a test system.
If you can't modify the code like that, diagnostics like this can be difficult. If the above suggestions don't help, I think this challenge might be beyond your personal level of experience yet and recommend you get some help.
If suggestion here Does help, please flag this as the answer. :)

Linux Kernel Process Management

First, i admit all the things i will ask are about our homework but i assure you i am not asking without struggling at least two hours.
Description: We are supposed to add a field called max_cpu_percent to task_struct data type and manipulate process scheduling algorithm so that processes can not use an higher percentage of the cpu.
for example if i set max_cpu_percent field as 20 for the process firefox, firefox will not be able to use more than 20% of the cpu.
We wrote a system call to set max_cpu_percent field. Now we need to see if the system call works or not but we could not get the value of the max_cpu_percent field from a user-spaced program.
Can we do this? and how?
We tried proc/pid/ etc can we get the value using this util?
By the way, We may add additional questions here if we could not get rid of something else
Thanks All
Solution:
The reason was we did not modify the code block writing the output to the proc queries.
There are some methods in array.c file (fs/proc/array.c) we modified the function so that also print the newly added fields value. kernel is now compiling we'll see the result after about an hour =)
It Worked...
(If you simply extended getrlimit/setrlimit, then you'd be done by now…)
There's already a mechanism where similar parts of task_struct are exposed: /proc/$PID/stat (and /proc/$PID/$TID/stat). Look for functions proc_tgid_stat and proc_tid_stat. You can add new fields to the ends of these files.