Tuesday, July 8, 2008

(Old) How to shoot yourself in the foot

Попалась старая ссылка о том, как стрелять себе в ногу на разных языках. Много забавного и поучительного: How to shoot yourself in the foot in any language

 

Для себя сделал выборку из самых забавных вариантов:

SQL

You spend 10 minutes figuring out how to join your hand to the gun, and then accidentally fire all bullets at all feet in the room.

PHP

You Google for "shoot self in foot" and come up with 397 howto guides. After copying and pasting the source code from each of the articles you've managed to: make a gun, shoot a gun at random passers-by, jam a gun, throw a gun, distribute guns to the poor, shoot yourself in the face, and finally: shoot yourself in the foot.

Outsourced Programming Language

You've heard of guns and bullets, but you end up just posting "kind sir, please email me the guns and bullets" to every developer forum and mailing list on the planet.

Any .NET Language: You try to use the built in ShootSelfInFootWithGun() function which looks like it does exactly what you need from the documentation but when you try to run it it complains that your foot is the wrong sort of foot.

Win32
LRESULT CALLBACK stGunProc(HGUN hGun, HGUN hGunParent, UINT uId, TPARAM tParam, UPARAM uParam, DWORD uTarg, DWORD aAmmTyp, BOOL bSaf, UNIT nCal, LPCTSTR mMfg, HANDLE hHand, LPCTSTR sErt, UINT nDist, UINT nBear, UINT nEle, UINT nMuzVel, HTARG hTarg, LPVOID lpParam);

Regular Expressions: ^((?>[a-zA-Z\d!#$%&foot;'*+\-/=?^_`{|}~]+\x20*|•((?=[\x01-\x7f])[^&trigger;\\]|\\[\x01-\x7f])*&trigger;\x20*)*(?<angle><))?((?!\.)(?>\.?[a-zA-Z\d!#$%&hole;'*+\-/=?^_`{|}~]+)+|&trigger;((?=[\x01-\x7f])[^&trigger;\\]|\\[\x01-\x7f])*&trigger;)@(((?!-)[a-zA-Z\d\-]+(?<!-)\.)+[a-zA-Z]{2,}|\[(((?(?<!\[)\.)(25[0-5]|2[0-4]\d|[01]?\d?\d)){4}|[a-zA-Z\d\-]*[a-zA-Z\d]:((?=[\x01-\x7f])[^\\\[\]]|\\[\x01-\x7f])+)\])(?(angle)>)$