TriBITS Q & A in Class from Dr. Kochunas :
Regarding Question 1:What is TRIBITS? TriBITS is a build system. It implements a lot of concepts in modern software engineering. Thus as you create your own software projects in a TriBITS based build system it facilitates good software engineering practices and lowers the overhead of the developer to use these things. Specifically things like defining unit tests, regressions tests. Tests that should be run nightly. Tests that should be run when code is pushed etc. It also facilitates publishing these results to a dashboard. It also helps facilitate managing complex software ecosystems that might use code from multiple repositories from multiple institutions and authors. Since we haven't had you write your own software and tests for your own software (yet) there isn't a whole lot to have in your project. You effectively created an empty project in this exercise. Perhaps this is why you are puzzled. In terms of what is being tested. All that was tested was TriBITS itself. TriBITS comes with its own tests to ensure it works correctly. People who might develop TriBITS and make changes to TriBTIS would find these helpful. But you will not be developing TriBITS in this course. Therefore I can understand your confusion. If you examine the TriBITS source tree you will find the tests and associated documentation. The point of running the tests was to illustrate how ctest can be used to automatically run a suite tests for a particular piece of software. Regarding Question 2:Why do "make dashboard"? The "make dashboard" was to illustrate how good tools and a good infrastructure can provide you with information about the state of your software. In typical workflows you would not run make dashboard yourself. But you would have a script running on a computer do it for you. The dashboard is a web portal that you (or someone) else can setup specifically for your project as we have done for this course. Much of what is on the dashboard is links. You can search through a lot of it and see the output from configure, the output from make, and the output from running your individual tests. This is very useful when tests fail. (Like a software exam checklist, with log) Permissions
The Unix operating system (and likewise, Linux) differs from other computing environments in that it is not only a multitasking system but it is also a multi-user system as well. What exactly does this mean? It means that more than one user can be operating the computer at the same time. While your computer will only have one keyboard and monitor, it can still be used by more than one user. For example, if your computer is attached to a network, or the Internet, remote users can log in via telnet or ssh (secure shell) and operate the computer. In fact, remote users can execute X applications and have the graphical output displayed on a remote computer. The X Windows system supports this. The multi-user capability of Unix is not a recent "innovation," but rather a feature that is deeply ingrained into the design of the operating system. If you remember the environment in which Unix was created, this makes perfect sense. Years ago before computers were "personal," they were large, expensive, and centralized. A typical university computer system consisted of a large mainframe computer located in some building on campus and terminals were located throughout the campus, each connected to the large central computer. The computer would support many users at the same time. In order to make this practical, a method had to be devised to protect the users from each other. After all, you could not allow the actions of one user to crash the computer, nor could you allow one user to interfere with the files belonging to another user. This lesson will cover the following commands:
File permissions: run: ls -lh It shows: total 16 drwxr-xr-x 2 shaowu shaowu 4096 Sep 15 09:43 Ex1 drwxr-xr-x 2 shaowu shaowu 4096 Sep 15 14:52 Ex2 drwxr-xr-x 2 shaowu shaowu 4096 Sep 15 14:52 Ex3 -rw-rw-r-- 1 shaowu shaowu 12 Sep 17 18:35 lab2.sh let's look at the last row -rw-rw-r-- First rw is about the user:shaowu in group shaowu: r means it is you can read; w means you can write as well; Second xr means the group that owns this file is shaowu, its user can: -read and write Third r means: the people of anyone else can read only However, as you can see user shaowu don't have the right to execute the .sh file. so run the following command: chmod u+x lab2.sh it let the user(u) to be enable for the execution ability. So in general, you can use chmod ?+? the first ? is u: user g: group o: others a: all the second ? is r: read w: write x: execute C++
1. cout formatted output Purpose: to set precision of numerical number std::cout << std::fixed << std::setprecision(2) << d << std::endl; Step 1
From inside? Skip to Step 2 ssh [email protected] OR USE VPN Step 2 ssh -l uniqname flux-login.arc-ts.umich.edu Step 3 1. Quick dirty first glance
You just need a class template for example: -------------------------------- class MyStuff: x = 0 def add(self): self.x = self.x + 2 def pr(self): print self.x -------------------------------- Then you can call stuff1 = MyStuff() stuff1.pr() stuff1.add() stuff1.pr() 2. What is missing behind the scene? In Python, constructor and destructor is OPTIONAL. Full version: -------------------------------- class MyStuff: x = 0 def __init__(self): print "explicitly yelling you at your ear: instance is created" def add(self): self.x = self.x + 2 def pr(self): print self.x def __del__(self): print "yelling you that instance is deleted! (in python, only destructed at the end of the very end of program" -------------------------------- So the above explains the definition of object life-cycle 3. How to pass parameter to constructor? -------------------------------- class party: x = 0 def __init__(self,first_val,second_val): self.x = first_val*second_val print number,' = number' def add(self): self.x = self.x + 1 def pr(self): print self.x -------------------------------- j = party(1,2) 4. How to do inheritance? -------------------------------- class party: x = 0 def __init__(self,first_val,second_val): self.x = first_val*second_val print number,' = number' def add(self): self.x = self.x + 1 def pr(self): print self.x -------------------------------- class subparty(party): y = 0 jj = subparty(3,1) print jj.x print jj.y So subparty is the child class of party It simulates the memory and can detect memory leaks.
Valgrind was originally designed to be a free memory debugging tool for Linux on x86, but has since evolved to become a generic framework for creating dynamic analysis tools such as checkers and profilers. |
AuthorShaowu Pan Archives
December 2017
Categories
All
|