Friday, June 18, 2010

IE Stack Exchange Site

I recently advocated anyone reading this blog check out OR-Exchange. Basically, the case is/was that if OR-Exchange didn't get to a certain amount of web traffic it would be shut down, as the people behind it (Stack Exchange) have a new model where they want to create nice, high volume question and answer sites on any topic people are willing to discuss.

I've been thinking about it, and it's my opinion that OR-Exchange may be a bit too niche to be able to attract enough users to keep alive.

So I am proposing we create a Stack Exchange site on Industrial Engineering/Continuous Improvement/Systems Analysis, whatever you want to call it.

If you're interested in seeing this site come to fruition, visit:


and follow the site, and if we can get enough followers and example questions, we can move on and get a centralized, modern community started for discussing anything IE/OR/CI.

Tuesday, June 1, 2010

Number Rounding in SCL

I recently found the need to do some simple number rounding in SCL, and was able to dig these two routines out using my SCL Subroutine Indexer though the index was from a previous computer I used, and hadn't copied over to my current machine. Thankfully, Google Desktop was able to find a backup copy I had made who knows when. So, to prevent me from losing these simple functions forever, here they are.

Nothing fancy; I round a number down by converting it to an integer string, then reading it back to a number using VAL. I guess SCL will truncate a number at the decimal point when converting to an integer string (%g), rather than do any real rounding. So to round up I just round down and add one. Like I said, nothing fancy, and apparently nothing worth searching for 20 minutes over. Anyways, these would be good to keep compiled all the time.

routine round_down_to_int( num_value : Real ) : Integer
Var

int_string : String
result : Integer

Begin

result = 1
int_string = str( '%g' , num_value )
result = VAL( int_string )
return result

End
routine round_up_to_int( num_value : Real ) : Integer
Var

result : Integer
rounded_down : Integer

Begin

return round_down_to_int( num_value ) + 1

End