How to control the flow of tasks within SSIS - sql

I have a series of 5 tasks, and would like guidance on how to run them in a specified order:
The order that I need:
Run the entire series.
And then only run these:
I checked out this and this resource, but am not sure how to apply them.

I would put all those tasks inside a For Loop Container. The iterations would be controlled by a simple Counter variable and limited for values 1 to 2.
Then for the last two tasks, I would set the Disable property using an expression, e.g.
#[User::Counter] == 2

Related

How to safely increment database using django rest framework?

I'm facing some troubles by trying to make a like/unlike system for my app.
It's okay when i like/unlike in a normal timelapse, but when i click multiple times in a very short frequency (20 clicks in 10 seconds for example) then my counter is disturbed.
Normally while i'm testing my counter should always have a value of 1 or 0 since i am the only one to do the operation. However when i click quickly and multiple times, my rest api cannot follow the rythm and i'm getting a counter that have 7 or 8 likes.
I've tried multiple solutions. first by adding the model transaction included with django. As a decorator :
#transaction.atomic
Or manually :
with transaction.atomic():
#do stuff
I've also tried to increment directly from the database by using F() :
votes=F("votes") + 1
Nothing seems to work.
Any suggestion ?

Is there an effective way to find the cpu priority for a process?

I'm trying to make a simplified task manager to use in school that allows a student to manage and view the processes they're running.
I want the program to be able to show the user what priority a certain process is running with.
I currently have it set up so the user can change all the priorities but cant see the changes they have made.
Will I need to store all the changes they made in an array that follows alongside all the processes and set them all to normal then just shows what they have changed.
I don't really want to do this as it is inefficient and unnecessarily complicated.
You can use System.Diagnostics.Process Class which has a property named PriorityClass.
For example the following code gets the priority of the current process:
Dim proc As Process = Process.GetCurrentProcess()
Dim procPriority = proc.PriorityClass
Here you can find all the possible values: https://msdn.microsoft.com/en-us/library/system.diagnostics.processpriorityclass.aspx

Infinite Addition Loop

I basically have 4 tags that keep a count of product produced within the company. The problem is that the logic behind these tags is to reset the value when the machine stops. I am not too familiar with coding, but am trying to develop a calculation tag that will just keep a running count without reset. So basically, the number would always escalate.
Tag Names : Filler1Count , Filler2Count, Filler3Count, Filler4Count
This is all done in an application called Historian Administrator. VB code can be implemented behind tags. I will obviously be keeping the original tags, but have the option of making a calculation tag.
Watch for when the number is smaller than the previous poll and store your total in a different variable.
If Filler1Count < LastFiller1Count Then
Filler1Total = Filler1Total + LastFiller1Count
End If
LastFiller1Count = Filler1Count
Total = Filler1Total + Filler1Count

Pentaho Kettle: how to pass variable from transformation to another transformation inside job

I have two transformations in the job.
In the first trasnformation - I get details about the file.
Now I would like to pass this information to the second transformation, I have set variable in the settings parameters of the trasnformation #2 and use Get Variables inside - but the values are not passed.
See attached sample: https://www.hightail.com/download/bXBiV28wMVhLVlZWeHNUQw
LOG_1 - displays file time, however LOG_2 and LOG_3 are not producing any value.
How can I pass variable across transformations and to parent job.
Try checking the box in the second transformation as below image:
Remove all the logs from the Job file you shared.
You may try reading this blog.
Hope this will resolve your issue :)

Batch Script - Parameter Nested Inside Variable?

Here's the scenario:
I have a parent script that calls about a dozen child scripts, one of which is a somewhat complex folder/file syncing operation. Each of the child scripts writes a variable to a batch file (e.g. variable.bat), which is then loaded by the parent script at next execution.
The folder syncing script chooses from a large list of folders based upon a parameter passed to it via the parent script.
The child script's SET command looks something like this:
ECHO SET pair-folder-%1=yes>>c:\variable.bat
This produces a variable at next run that is loaded by the parent script. Herein lies the rub: How do I script an action (via IF trap) that calls that variable the next time the child script comes around? I imagine my IF trap would look something like this:
IF %pair-folder-%1%=yes GOTO nopair
The problem is I can't seem to get the batch to interpret that correctly - I have tried nesting the variable a few different ways, using Delayed Expansion, etc. Is it necessary to map the parameter to a local variable first?
Basically, once the parent scripts calls variable.bat at next execution, how do I then reference that newly set variable from within the child script?
Since you are appending set pair-folder-%1=yes lines to variable.bat then you'll get varable.bat to establish an increasing set of pair-folder-* variables.
Now if you want to check whether pair-folder-% is set, then
if defined pair-folder-%1 ...
will do that for you.
If you want to find the value of pair-folder-%1 (ie it's not just set or not set) then
set "valuefound="
for /f "tokens=1*delims==" %%i in ( 'set pair-folder-%1 2^>nul' ) do (
if /i "%%i"=="pair-folder-%1" set "valuefound=%%j"
)
should do that - valuefound would be "set" to no value (ie undefined) if the variable is undefined else its value.