Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

## Lalit Kapoor

Writing Code
```fib: num
(num=1)
ifTrue: [^ 1].
(num=0)
ifTrue: [^ 1].
(num<0)
ifTrue: [self error: 'Fibonnaci Sequence Does Not Go Below 0'].

^ (self fib: (num-1)) + (self fib: (num-2)).
```

Tracing Code
```| data onlyPositiveNumbers |
data := OrderedCollection withAll: #(1 2 3 -4 -5 'error' 6 -7 999 2).
onlyPositiveNumbers := [:i | (i isKindOf: Number) and: [i positive]].
data := data select: onlyPositiveNumbers.
data := data copyUpTo: 999. "not including"
Transcript show: data average
```

These are our instance variables that we are going to use.
```| data onlyPositiveNumbers |
```

the data variable is given the values: 1 2 3 -4 -5 'error' 6 -7 999 2 and is initalized to a new OrderedCollection.
```data := OrderedCollection withAll: #(1 2 3 -4 -5 'error' 6 -7 999 2).
```

onlyPositiveNumbers is a codeblock set to equal all the positive numbers in an object, it will return the type Number with only the positive numbers.
```onlyPositiveNumbers := [:i | (i isKindOf: Number) and: [i positive]].
```

the variable data is set to equal only the positive numbers from it's original OrderedCollection.
```data := data select: onlyPositiveNumbers.
```

data is set to equal all the values up to 999, which in this case means (1 2 3 6)
```data := data copyUpTo: 999. "not including"
```

This line prints the average of data to the console (the average in this case is: 3.
```Transcript show: data average
```

Finding tools: How do you use implementors of..., senders of..., and the method finder to find where code can be found in the system?

Method Finder

The Method Finder is a tool built into the squeak VM, it helps a developer to find existing methods in their image of squeak.
There are two ways to use the method finder: keywords and by example.

keyword: The keyword search technique is used to look up methods that match a certain keyword.
by example: The by example technique is used to look up methods based on what will be inputed and what the expected output is.

How to use the Method Finder for a keyword search:
• enter the name of the method, or a keyword (partial word in the method), to find the method.
• The method finder will return a list of methods that matched you search criteria.
• Click on the method that best matches what you were looking for.
• On the right hand side, after you have clicked the method, the classes in which the method, you were looking for, resides will be visible to select.
• Select the class to open up to the method in that class and you can view the code for that method.

How to use the Method Finder for an example search:
• enter the input values seperated by periods in the top left textbox.
• finally enter the expected result (return value) in the textbox after the last period
• The method finder will return a list of methods that matched you search criteria.
• Click on the method that best matches what you were looking for.
• On the right hand side, after you have clicked the method, the classes in which the method, you were looking for, resides will be visible to select.
• Select the class to open up to the method in that class and you can view the code for that method.

Implementors of..
Implementors of will show you which methods respond to a message sent by the current method. It can also show you different uses of the current method.

How to use Implementors of
• Selected a method from the system browser and click command+m (alt+m in windows)

Senders of..
Senders of will show the developer which methods can call the method that you are currently on.

How to use Senders of
• Selected a method from the system browser and click command+n (alt+n in windows)

Method finder

Implementors of.. Senders of..

lalit kapoor
http://www.lalitkapoor.com
http://lalitkapoor.com
http://www.idefine.net
http://www.schizzlenet
http://idefine.net

check out this cool site:
http://www.sqlconverter.com

lalitkapoor
lalit kapoor
idefine

excel to mysql