Zaki Mirza’s Blog

Icon

… About software and beyond!

Late Night Bloggin’: Bentley and the ‘double’ trouble quiz

Working at Bentley has been a great experience for me. Partly because of the great enviornment but mostly because of the problems I faced during coding one of the new features in the Microstation PlantSpace Designer Series. The problems ranged from  creating quick documentation solution to document lots of vb6 codebase in python to dealing with a massive Microstation API to solving a series of problems that required inventing new data-structures, dealing with graphs and adjacency lists and developing algorithms to traverse the graph in a specific manner which wernt supported in the API. (i shall be writing about them soon).

Since i was dealing with 3d elements, handling points in 3d space was unavoidable. Engineering applications (such as the CAD/CAM category, in which PSDS lies as well) are designed to cater a divesture of standards in terms of metrics used. In the core of the software though a uniform format is used to represent values. For example a point in 3d space can be represented in many differnet formats (inches, feet, fractions etc). The format used to represent the same point in the underlying software architecture in PSDS is usually a ‘double’ (since we’re working in C – or a subset of C called MDL: microstation developer language, and yes i was creating my own adjacency lists in C and traversing them recursively). So basically the x,y and z coordinates of the point are representated as a structure of 3 doubles.

One way to compare two points (and well the most obvious way) is to calculate the distance between the two points using the distance formula. Thats all well and solved and thats not the quiz. The quiz is, given two double values, how do you compare the two to N decimal places? In other words how would you compare two points to see if they are “close enough”. (and that can be anything from being equal to 5 decimal places or being absolutely equal).

Advertisements

Filed under: Late Night Blog, quiz, , ,

quiz #4: My Contextual Switch!

Here’s really deep down dirty one. Even i havnt been able to answer this one as such, but nonetheless here it goes. (I’m taking up the responsibility of being the Teacher Assistant for the operating systems course for a telecommunications batch, i shall try to answer this completely in a short while. Have your shot! )

How do you go about calculating the time it takes to context switch in a unix enviornment?

I read this question somewhere as a question asked in a google interview. Its really intresting and requires a deep knowledge and concept of the core system. (or so i guess?)

Filed under: linux, programming, quiz, , ,

Blog Stats

  • 104,467 landed here so far...
November 2017
M T W T F S S
« Jan    
 12345
6789101112
13141516171819
20212223242526
27282930  

tweet

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

RSS Google Shared Items

  • An error has occurred; the feed is probably down. Try again later.

RSS Google Reader Starred Items

  • An error has occurred; the feed is probably down. Try again later.

Top Clicks

  • None