TFI – Run for Leprosy 2015

2307
Back in March 15, my friends and I went on a run in an event called Run for Leprosy, held by Teach For Indonesia. Run for Leprosy is a social fundraiser to help people suffering from leprosy. By taking part of the run, we helped contribute for the fundraising. Now, what is this leprosy as a goal of this event?


Leprosy is an infectious disease that causes severe, disfiguring skin sores and nerve damage in the arms and legs. The disease has been around since ancient times, often surrounded by terrifying, negative stigmas and tales of leprosy patients being shunned as outcasts. Outbreaks of leprosy have affected, and panicked, people on every continent. The oldest civilizations of China, Egypt, and India feared leprosy was an incurable, mutilating, and contagious disease.

However, leprosy is actually not that contagious. You can catch it only if you come into close and repeated contact with nose and mouth droplets from someone with untreated leprosy. Children are more likely to get leprosy than adults.

Today, about 180,000 people worldwide are infected with leprosy, according to the World Health Organization, most of them in Africa and Asia. About 200 people are diagnosed with leprosy in the U.S. every year, mostly in the South, California, Hawaii, and some U.S. territories.

Leprosy is caused by a slow-growing type of bacteria called Mycobacterium leprae (M. leprae). Leprosy is also known as Hansen’s disease, after the scientist who discovered M. leprae in 1873.

Leprosy primarily affects the skin and the nerves outside the brain and spinal cord, called the peripheral nerves. It may also strike the eyes and the thin tissue lining the inside of the nose.

The main symptom of leprosy is disfiguring skin sores, lumps, or bumps that do not go away after several weeks or months. The skin sores are pale-colored.

Nerve damage can lead to:

  1. Loss of feeling in the arms and legs
  2. Muscle weakness

It usually takes about 3 to 5 years for symptoms to appear after coming into contact with the leprosy-causing bacteria. Some people do not develop symptoms until 20 years later. The time between contact with the bacteria and the appearance of symptoms is called the incubation period. Leprosy’s long incubation period makes it very difficult for doctors to determine when and where a person with leprosy got infected.

References: Leprosy Overview on WebMD.


As terrifying as it may sound, it is still not okay to shun and reject those who suffer from this disease. Many still treat these people in disgust. We as a social creature should understand more about leprosy. We can hold up a seminar or something that can share our knowledge about leprosy, such as this event! This way, we can share the knowledge about how well we understand about leprosy, how to avoid it, how to treat it, and how to help the people suffered from it. But most importantly, how not to ignore and create stigmas that make distance between us and those who need help.

By reading this, or by knowing slightly more about leprosy, you might not realistically want to perform action to help people right away. If you actually do, then it’s excellent! Otherwise, we can always start helping these people just from the smallest bit of contribution like knowing this disease. Knowing is the best way for a start. We can spread the awareness to many more people about the issues, and start to think the many ways we can hopefully contribute for these people that need help!


Run for Leprosy has been a fun event for me to attend. Frankly, a 5 km run at dawn is very exhausting and tiring for me, and all I got in the very next morning was sore muscles all over my body. Luckily I’m used to walking a long distance, so I might not as hurt as my friends. In the end, it was all worth it. Spending the moment with my friends, as well as receiving some awareness about issues that have been troubling the people, always feels good!

Advertisements

CPL: Chapter 16 – Logic Programming Languages

Review Questions

1. What are the three primary uses of symbolic logic in formal logic?
Answer: To express propositions, to express the relationships between propositions, and to describe how new propositions can be inferred from other propositions that are assumed to be true.

2. What are the two parts of a compound term?
Answer: Functor and ordered list of parameters.

3. What are the two modes in which a proposition can be stated?
Answer: One in which the proposition is defined to be true, and one in which the truth of the proposition is something that is to be determined. In other words, propositions can be stated to be facts or queries.

5. What are antecedents? Consequents?
Answer: Antecedents are right side of a clausal form proposition. Consequent is left side of a clausal form propositions

6. Give general (not rigorous) definitions of resolution and unification.
Answer: Resolution is the inference rule that allows inferred propositions to be computed from given propositions, thus providing a method with potential application to automatic theorem proving. Unification is the process of determining useful values for variables.

9. What does it mean for a language to be nonprocedural?
Answer: Language in which the programs do not exactly state how a result is to be computed but rather describe the form of the result.

11. What is an uninstantiated variable?
Answer: A variable that has not been assigned a value.

13. What is a conjunction?
Answer: Conjunctions contain multiple terms that are separated by logical AND operations.

Problem Set

1. “All predicate calculus propositions can be algorithmically converted to clausal form”. Is this statement true or false? Explain.
Answer: This statement is true. Nilsson (1971) gives proof that this can be done, as well as a simple conversion algorithm for doing it.

2. Describe how a logic programming language is different from a general programming language.
Answer: Programming that uses a form of symbolic logic as a programming language, unlike other general programming language, is often called logic programming; languages based on symbolic logic are called logic programming languages, or declarative languages.

8. Critically comment on the following statement: “Logic programs are nonprocedural”.
Answer: It is true, because logical programs use lots of different processes based on its conditions. If a certain logical requirement is true, then a program will execute the corresponding process, instead of procedurally executing the statements.

CPL: Chapter 15 – Functional Programming Language

Review Questions

2. What does a lambda expression specify?
Answer: A lambda expression specifies the parameters and the mapping of a function.

3. What data types were parts of the original LISP?
Answer: Atoms and lists.

5. Explain why QUOTE is needed for a parameter that is a data list.
Answer: To avoid evaluating a parameter, it is first given as a parameter to the primitive function QUOTE, which simply returns it without change.

6. What is a simple list?
Answer: A simple list is a list which membership of a given atom in a given list that does not include sublists.

7. What does the abbreviation REPL stand for?
Answer: Read-Evaluate-Print Loop.

8. What are the three parameters to IF?
Answer: Predicate, Then, and Else.

18. What is tail recursion? Why is it important to define functions that use recursion to specify repetition to tail recursive?
Answer: A function is tail recursive if its recursive call is the last operation in the function. This means that the return value of the recursive call is the return value of the nonrecursive call to the function. It is important to specify repetition to be tail recursive because it is more efficient(increase the efficiency).

19. Why were imperative features added to most dialects of LISP?
Answer: LISP began as a pure functional language but soon acquired some important imperative features to increased its execution efficiency.

24. What is stored in an ML evaluation environment?
Answer: A table called the evaluation environment stores the names of all implicitly and explicitly declared identifiers in a program, along with their types. This is like a run-time symbol table.

26. What is type referencing, as used in ML?
Answer: Type inference refers to the automatic deduction of the type of an expression in a programming language. If some, but not all, type annotations are already present it is referred to as type reconstruction.

Problem Set
2. Give general form of function declarations in ML.
Answer: Function declarations in ML appear in the general form

fun function_name( formal parameters ) = expression;

8. How is functional operator pipeline (|>) used in F#?
Answer: The pipeline operator is a binary operator that sends the value of its left operand, which is an expression, to the last parameter of the function call, which is the right operand. It is used to chain together function calls while flowing the data being processed to each call.

10. What does the following Scheme function do?

(define (x lis)
  (cond
    ((null? lis) 0)
    ((not (list? (car lis)))
      (cond
        ((eq? (car lis) #f) (x (cdr lis)))
        (else (+ 1 (x (cdr lis))))))
      (else (+ (x (car lis)) (x (cdr (lis))))

Answer: x returns the number of non-#f atoms in the given list
|> List.map (fun n −> 5 * n)

CPL: Chapter 14 – Exception Handling and Event Handling

Review Questions

2. When is an exception thrown or raised?
Answer: An exception is raised when its associated event occurs.

6. What is exception propagation in Ada?
Answer: Exception propagation allows an exception raised in one program unit to be handled in some other unit in its dynamic or static ancestry. This allows a single exception handler to be used for any number of different program units. This reuse can result in significant savings in development cost, program size, and program complexity.

9. What is the scope of exception handlers in Ada?
Answer: An exception handler in Ada can occur in either a subprogram body, a package body, a task, or a block.

10. What are the four exceptions defined in the Standard package of Ada?
Answer:

Constraint_aError
Program_Error
Storage_Error
Tasking_Error

11. Are there any predefined exceptions in Ada?
Answer: Yes

12. What is the use of Suppress pragma in Ada?
Answer: It is used to disable certain run-time checks that are parts of the built-in exceptions in Ada.

14. What is the name of all C++ exception handlers?
Answer: Try clause

15. Which standard libraries define and throw the exception out_of_range in C++?
Answer: Library container classes

16. Which standard libraries define and throw the exception overflow_error in C++?
Answer: Math library functions

30. In which version were assertions added to Java?
Answer: Version 1.4

Problem Set

1. What mechanism did early programming languages provide to detect or attempt to deal with errors?
Answer: Early programming languages were designed and implemented in such a way that the user program could neither detect nor attempt to deal with such errors. In these languages, the occurrence of such an error simply causes the program to be terminated and control to be transferred to the operating system.

2. Describe the approach for the detection of subscript range errors used in C and Java.
Answer: In C, subscript ranges are not checked. Java compilers usually generate code to check the correctness of every subscript expression. If any exception generates, then an unchecked exception is thrown.

4. What are the different approaches to handle checked exception in Java?
Answer: Java uses checked exceptions and unchecked exceptions.

Checked exceptions must be explicitly caught or propagated as described in Basic try-catch-finally Exception Handling. Unchecked exceptions do not have this requirement. They don’t have to be caught or declared thrown.
Checked exceptions in Java extend the java.lang.Exception class. Unchecked exceptions extend the java.lang.RuntimeException.

6. In languages without exception-handling facilities, it is common to have most subprograms include an “error” parameter, which can be set to some value representing “OK” or some other value representing “error in procedure.” What advantage does a linguistic exception-handling facility like that of Ada have over this method?
Answer: There are several advantages of a linguistic mechanism for handling exceptions, such as that found in Ada, over simply using a flag error parameter in all subprograms. One advantage is that the code to test the flag after every call is eliminated. Such testing makes programs longer and harder to read. Another advantage is that exceptions can be propagated farther than one level of control in a uniform and implicit way. Finally, there is the advantage that all programs use a uniform method for dealing with unusual circumstances, leading to enhanced readability.

CPL: Chapter 13 – Concurrency

Review Questions

1. What are the three possible levels of concurrency in programs?
Answer:

  • Instruction level (executing two or more machine instructions simultaneously)
  • Statement level (executing two or more high-level language statements simultaneously)
  • Unit level (executing two or more subprogram units simultaneously)

2. Describe the logical architecture of an SIMD computer.
Answer: In an SIMD computer, each processor has its own local memory. One processor controls the operation of the other processors. Because all of the processors, except the controller, execute the same instruction at the same time, no synchronization is required in the software.

5. What level of program concurrency is best supported by MIMD computers?
Answer: Unit-level concurrency

6. Describe the logical architecture of a vector processor.
Answer: Vector processor have groups of registers that store the operands of a vector operation in which
the same instruction is executed on the whole group of operands simultaneously.

7. What is the difference between physical and logical concurrency?
Answer: Physical concurrency is several program units from the same program that literally execute simultaneously. Logical concurrency is multiple processors providing actual concurrency, when in fact the actual execution of programs is taking place in interleaved fashion on a single processor.

8. What is the work of a scheduler?
Answer: A scheduler manages the sharing of processors among the tasks. If there were never any interruptions and tasks all had the same priority, the scheduler could simply give each task a time slice, such as 0.1 second, and when a task’s turn came, the scheduler could let it execute on a processor for that amount of time.

12. What is heavyweight task? What is a lightweight task?
Answer: Heavyweight task executes in its own address space. Lightweight task all run in the same address space.

16. What is a task descriptor?
Answer: A task descriptor is a data structure that stores all of the relevant information about the execution state of a task.

18. What is the purpose of a task-ready queue?
Answer: The purpose of a task-ready queue is to be storage of tasks that are ready to run.

3. What is the purpose of an Ada terminate clause?
Answer: Ada terminate clause, when selected, means that the task is finished with its job but is not yet terminated. Task termination is discussed later in this section.

Problem Set

1. Explain clearly why a race condition can create problems for a system.
Answer: Race condition can create problems for a system, because two or more tasks are racing to use the shared resource and the behavior of the program depends on which task arrives first (and wins the race).

2. What are the different ways to handle deadlock?
Answer: Ignoring deadlock, detection, prevention, and avoidance.

3. Busy waiting is a method whereby a task waits for a given event by continuously checking for that event to occur. What is the main problem with this approach?
Answer: Busy-waiting or spinning is a technique in which a process repeatedly checks to see if a condition is true, such as whether keyboard input or a lock is available. Spinning can also be used to generate an arbitrary time delay, a technique that was necessary on systems that lacked a method of waiting a specific length of time. Processor speeds vary greatly from computer to computer, especially as some processors are designed to dynamically adjust speed based on external factors, such as the load on the operating system. Busy waiting may loop forever and it may cause a computer freezing.

CPL: Chapter 11 – Abstract Data Types and Encapsulation Constructs

Review Questions

1. What are the two kinds of abstractions in programming languages?
Answer: Process Abstraction and Data Abstraction.

2. Define abstract data type.
Answer: A data structure in the form of a record, but which includes subprograms that manipulate its data.

5. What are the language design issues for abstract data types?
Answer: The first design issue for abstract data types is the form of the container for the interface to the type. The second design issue is whether abstract data types can be parameterized. The third design issue is what access controls are provided and how such controls are specified.

6. Explain how information hiding is provided in an Ada package.
Answer: There are two approaches to hiding the representation from clients in the package specification. One is to include two sections in the package specification—one in which entities are visible to clients and one that hides its contents.

10. What is the use of Ada with clause?
Answer: with clause makes the names defined in external packages visible.

11. What is the use of Ada use clause?
Answer: use clause eliminates the need for explicit qualification of the references to entities from the named package.

12. What is the fundamental difference between a C++ class and an Ada package?
Answer: Class must be accessed from an instance of itself while package can be accessed directly.

16. What are the legal return types of a destructor?
Answer: A destructor has no return types.

20. What is the use of limited private types?
Answer: Limited private types are useful when the usual predefined operations of assignment and comparison are not meaningful or useful.

27. Where are all Java methods defined?
Answer: All Java methods are defined in a class.

Problem Set
4. What are the advantages of the nonpointer concept in Java?
Answer:

  • Any task that would require arrays, structures, and pointers in C can be more easily and reliably performed by declaring objects and arrays of objects.
  • By the complex pointer manipulation on array pointers, you can access arrays by their arithmetic indices.
  • Can checks all array indexing to ensure indices within the bounds of the array.
  • You no longer have dangling pointers and trashing of memory.

8. What are the drawbacks of user-defined generic classes in Java 5.0?
Answer: They cannot store primitives. Also, the elements cannot be indexed. Elements must be added to user-defined generic collections with the add method.

9. What happens if the constructor is absent in Java and C++?
Answer: It will be made automatically by the built-up in.

11. Why is the destructor of C# rarely used?
Answer: Because C# has its own garbage collection method, just like Java.

CPL: Chapter 10 – Implementing Subprograms

Review Questions

1. What is the definition used in this chapter for “simple” subprograms?
Answer: It means that subprograms cannot be nested and all local variables are static.

3. What must be stored for the linkage to a subprogram?
Answer: Execution status information

4. What is the task of a linker?
Answer: Its first task is to find the files that contain the translated subprograms referenced in that program and load them into memory. Then, the linker must set the target addresses of all calls to those subprograms in the main program to the entry addresses of those subprograms.

7. What kind of machines of ten use registers to pass parameters?
Answer: RISC Machines

11. What is an EP, and what is its purpose?
Answer: EP is a point or first address of the activation record instance of the main program. It is required to control the execution of a subprogram.

12. How are references to variables represented in the static-chain method?
Answer: It is represented by static_depth.

14. What are the two potential problems with the static-chain method?
Answer:

  1. It is difficult for a programmer working on a time-critical program to estimate the costs of nonlocal references, because the cost of each reference depends on the depth of nesting between the reference and the scope of declaration.
  2. Subsequent code modifications may change nesting depths, thereby changing the timing of some references, both in the changed code and possibly in code far from the changes.

Problem Set

6. Although local variables in Java methods are dynamically allocated at the beginning of each activation, under what circumstances could the value of a local variable in a particular activation retain the value of the previous activation?
Answer: If the variable is declared as static. Static modifier is a modifier that makes a variable history – sensitive.

7. It is stated in this chapter that when nonlocal variables are accessed in a dynamic-scoped language using the dynamic chain, variables names must be stored in the activation records with the values. If this were actually done, every nonlocal access would require a sequence of costly string comparisons on names. Design an alternative to these string comparisons that would be faster.
Answer: Using approach that uses an auxiliary data structure called a display. Or, to write variable names as integers. These integers act like an array. So when the activation happens, the comparisons will be faster.

9. The static-chain method could be expanded slightly by using two static links in each activation record instance where the second points to the static grandparent activation record instance. How would this approach affect the time required for subprogram linkage and nonlocal references?
Answer: Including two static links would reduce the access time to nonlocals that are defined in scopes two steps away to be equal to that for nonlocals that are one step away. Overall, because most nonlocal references are relatively close, this could significantly increase the execution efficiency of many programs.

CPL: Chapter 9 – Subprograms

Review Questions

3. What programming language has dominated scientific computing over the past 50 years?
Answer: FORTRAN

4. What programming language has dominated business application over the past 50 years?
Answer: COBOL

5. What programming language has dominated artificial intelligence over the past 50 years?
Answer: LISP

6. In what language is UNIX written?
Answer: C

12. What construct of programming language that provides process abstraction?
Answer: Fortran 77, C++ and Java

13. What does it mean for a program to be reliable?
Answer: If it performs to its specifications under all conditions.

15. What is aliasing?
Answer: 2 or more distinct names that can be used to access the same memory cell.

16. What is exception handling?
Answer: The ability of a program to intercept run-time errors (as well as other unusual conditions detectable by the program), take corrective measures, and then continue is an obvious aid to reliability.

20. What is the name of the category of programming languages whose structure is dictated by the von Neumann computer architecture?
Answer: Imperative

28. What is the utility of byte code?
Answer: Code that is used to command directly to computer

Problem Set

CPL: Chapter 8 – Statement-Level Control Structures

Review Questions

3. What programming language has dominated scientific computing over the past 50 years?
Answer: FORTRAN

4. What programming language has dominated business application over the past 50 years?
Answer: COBOL

5. What programming language has dominated artificial intelligence over the past 50 years?
Answer: LISP

6. In what language is UNIX written?
Answer: C

12. What construct of programming language that provides process abstraction?
Answer: Fortran 77, C++ and Java

13. What does it mean for a program to be reliable?
Answer: If it performs to its specifications under all conditions.

15. What is aliasing?
Answer: 2 or more distinct names that can be used to access the same memory cell.

16. What is exception handling?
Answer: The ability of a program to intercept run-time errors (as well as other unusual conditions detectable by the program), take corrective measures, and then continue is an obvious aid to reliability.

20. What is the name of the category of programming languages whose structure is dictated by the von Neumann computer architecture?
Answer: Imperative

28. What is the utility of byte code?
Answer: Code that is used to command directly to computer

Problem Set