Find an Element’s Position Using Javascript

I went through quite a few Google searches trying to figure this out. My problem was that I needed to get the coordinate of a touch event relative to the top left corner of an element. However, the TouchEvent object doesn’t have the offsetX or offsetY, which, in contrast, the MouseEvent …

Show Oracle Locks

If you’re having issues with locks in Oracle, here’s a way to show what sessions have locks on which objects. select s.osuser “O/S-User”,   s.username “Ora-User”,   s.sid “Session-ID”,   s.serial# “Serial”,   s.process “Process-ID”,   s.status “Status”,   l.name “Obj Locked”,   l.mode_held “Lock Mode”,   count(*) from v$session s, dba_dml_locks l, v$process p where l.session_id = …

Show Hidden Files in Mountain Lion

This should be an option that’s available through the Finder preferences, but it’s not. Odd. Anyway, here’s how to do it. Open up a shell and run the following command: defaults write com.apple.Finder AppleShowAllFiles YES To undo: defaults write com.apple.Finder AppleShowAllFiles NO To check to see if the option is …

Cross Domain Request Workarounds (Updated)

When trying to access your data tier, you [may] encounter the browser’s built in security feature that does not allow you to make XMLHttpRequest object requests to a different domain (see Same Origin Policy). UPDATE 10-24-2012: To get CORS working in IE8 and IE9, use XDomainRequest using the object’s onload …