How does a computer processes each and every command given to it? [closed] - process

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
If I type in some command let be as simple as possible like print numbers from one to ten in BlueJ. Now since I have given a main command the computer processes the command and gives the output, but my question is how each and every number is printed by the computer is there any particular code integrated within the software of the computer which processes and prints each and every number each and every time the above code is ran?

This depends upon the operating system. Here are two approaches:
I. In eunuchs variants the command interpreter is just a program. There is nothing special about it except that it processes commands. For the most part, commands simply map to programs. If you type "xyx" the command interpreter searches for an executable (or script) named xyz to execute. An environmental variable "PATH" defines the directories to search for the file.
II. In the VMS system, the command interpreter resides in a protected area of the process address space. For an interactive process, the command interpreter sits in the background while a program is running. Commands are defined by a table. If you type XYZ, the command interpreter looks for the XYZ command, figures out what the options to that command are, and runs the appropriate program. The actual program could be ABC and it is even possible that the same command could invoke different programs, depending upon the options supplied.

Related

Automating SAS Processes through putty and VBA [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am trying to automate a few SAS processes through shell scripting having a VBA based excel UI.
Is there a way to connect to putty through vba to connect to a remote server, run a few bash command lines to copy/move files, then execute the SAS code and get the outputs to my local?
Any help is appreciated.
This is quite a broad question, and the answer depends on many things! But most importantly:
Are you talking about a server or local instance of SAS?
What outputs - generic outputs, or outputs you are writing specifically?
In any case.. It's worth noting you can use SAS to perform your bash commands, so long as x-command is enabled, eg as follows:
data _null_;
infile "cp source dest" pipe;
input;
list;
run;
As for running SAS from VBA, you have multiple options (running sas.exe direct, using the IOM, using the STP server).
If you have control of the SAS code, I'd suggest using SAS to run your bash commands (via example above) and streaming your outputs to the _webout fileref using the STP server. This way all your VBA needs to do is call a URL within an Excel web query, and all permissions / code security etc is handled within SAS. This approach is described here.

Interact with my running application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Given:
A list-based application with an advanced user-system based on two applications:
Main-Tool
Displays all Entrys with possible filters
Create entrys
Delete entrys
Edit entrys
Filter entrys to only see specific ones
...you get the point
Creation-Tool
Reads specific informations out of a file and opens the same mask as the Main-Tools creation function as a separated application.
The Problem:
So I have my Creation-Tool and the Main-Tools function to create entrys as well. So each time i am changing a thing on the creation mask, i have to do it in two applications.
The Solution:
There has to be a way to call functions of my application from the outside.
The Question:
How can i get rid of the second application? The Main-Application has more informations (Logged in user for example) than the Creation-Tool, so i want to get rid of the Creation-Tool. Having a second application that calls my main application is okay.
What you want to do is to move all of your functionality into a separate library. Using inter-process communication would require both programs to be running. Whereas if you had two programs that shared the same dll, that would solve your duplicate code issue and each program can be run independently. Once you have all your functionality separated from the user interface and moved into it's own dll, then consolidating the UI of both applications into one will be much easier.

Running awk deterministic [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I'm looking for a way to run awk in a verifiably deterministic way, that is to say: result should be determined by input only. In other words, given that a program has output, I want to know that it is repeatable.
This would mean removing access to non-deterministic sources of input, such as the system time or files with changing content such as /dev/random.
I have looked at the sandbox flag in gawk, which I don't think will help, and ZeroVM.
I don't think it is possible in general. For example, this script will print different values when run even though it doesn't depend on any input file
awk 'BEGIN{print systime()}'
However, you can write your scripts in a functional, repeatable way to only depend on the input file and have a predefined output order (the array order iteration is not predictable), don't make system calls or use random.
ZeroVM would indeed be a way to do what you want: it sandboxes applications and removes all non-deterministic system calls. As an example, there are no threds (since their scheduling ineviatable leads to non-determinism) and the time starts at Jan 1 1970 on every execution (the time is then advanced by certain system calls).
I don't have a system with ZeroVM installed any longer, but it shouldn't be difficult to compile awk for it. Infact, I remember that busybox was running in ZeroVM, and busybox has some form of awk.

How to create a new file by Mikrotik routers' scripting [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
How to create a new file by script on Mikrotik Routerboard (Router OS 6.30)?
UPDATE:
This solutions also does not work well. It seems to be impossible to create a file and edit (/file set) it during one script call. I have no idea why, but only working solution is to run special create script two times (first creates a file and second edits it).
This easy task took me long time to solve. There is no official way, only some ugly workarounds. The main idea is create a file using some export operation (or fetch from network operation) and then flush created file.
Another problem is that multiple commands in one script file somehow cannot use created file's identifier. So instead of:
/file print file=newFile; /file set newFile contents=""
you must use:
/file print file=newFile; /file set [find name="newFile"] contents=""
Notice that first command just exports list of all files and second one flushes its content.

API for Doxygen Execution [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I wanted to automate the execution of Doxygen whenever I insert my source code to my code repository. Is there any api/interface for doxygen that I can use in my java code to start its execution?
Doxygen itself is started by executing a command-line command, so you only need a way of executing a command when a check in occurs. You don't say anything about the SCC tool, Dev Environment or OS you are working with, so it's hard to give a specific answer.
The usual way to do this would be using a build server running Continuous Integration. That is, when you check in code, the build server will notice the check in, get the new code, and then execute a build (in this case of Doxygen documentation). There are many tools available that will automate a PC to make a build server. Which one to use would depend on things like the OS and Source Control package you're using. (If you don't have/want a dedicated build server you could also run a tool like this on your own PC in the background).
If you just want the build to occur on your own PC when you check in, then you could investigate your source control software to see if you can be notified of the check-in. Some SCCs may offer an ability to execute a script or command for certain events, so it may be possible to get it to execute the command for you.
Lastly, many people just set up a tool/macro within their development environment that executes Doxygen, and then they run it manually. In visual Studio (for example) you could even write a macro that would do both the Check in and execute Doxygen from a single keypress.
If you want more control with doxygen, you have to generate also xml files and create a program that analyze the xml output files to check all your constraints, and stop the build if a constaint is violated.
this technique needs some developement effort but it's the only way that i know to do what you want with doxygen.