{"id":295,"date":"2007-07-06T08:53:40","date_gmt":"2007-07-06T07:53:40","guid":{"rendered":"http:\/\/soci.hu\/blog\/index.php\/2007\/07\/06\/bitkezelesi-trukkok\/"},"modified":"2007-07-06T08:53:40","modified_gmt":"2007-07-06T07:53:40","slug":"bitkezelesi-trukkok","status":"publish","type":"post","link":"https:\/\/soci.hu\/blog\/index.php\/2007\/07\/06\/bitkezelesi-trukkok\/","title":{"rendered":"Bitkezel\u00e9si tr\u00fckk\u00f6k"},"content":{"rendered":"<p>Tal\u00e1n kiss\u00e9 elavultnak t\u0171nik m\u00e1r a mai vil\u00e1gban ilyenr\u0151l besz\u00e9lni, de \u00e9n m\u00e9g \u00fagy n\u0151ttem fel, hogy az assembly a kir\u00e1ly, \u00e9s ez\u00e9rt szeretem az alacsonyszint\u0171 tr\u00fckk\u00f6ket.<br \/>\nEzen a lapon <a href=\"http:\/\/graphics.stanford.edu\/~seander\/bithacks.html\">\u00f6sszeszedett<\/a> a szerz\u0151 rengeteg nagyon szellemes tr\u00fckk\u00f6t eg\u00e9szek manipul\u00e1l\u00e1s\u00e1ra, a legt\u00f6bb az el\u00e1gaz\u00e1sokat pr\u00f3b\u00e1lja kiv\u00e1ltani valamilyen eg\u00e9sz tr\u00fckkel.<\/p>\n<p>Pl. abszol\u00fat \u00e9rt\u00e9k sz\u00e1m\u00edt\u00e1s, r = (v < 0) ? -v : v helyett\n\nint v;      \/\/ we want to find the absolute value of v\nint r;      \/\/ the result goes here \nint const mask = v >> sizeof(int) * CHAR_BIT &#8211; 1;<\/p>\n<p>r = (v + mask) ^ mask;<\/p>\n<p>Patented variation:<\/p>\n<p>r = (v ^ mask) &#8211; mask;<\/p>\n<p>Persze, a mai procikn\u00e1l lehet, hogy sok tr\u00fckk m\u00e1r nem \u00e9r semmit, de \u00e9rdekes fejt\u00f6r\u0151k ett\u0151l f\u00fcggetlen\u00fcl. Ezeket h\u00edvj\u00e1k a <a href=\"http:\/\/worsethanfailure.com\/\">WTF<\/a>-en clever hack-nek.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tal\u00e1n kiss\u00e9 elavultnak t\u0171nik m\u00e1r a mai vil\u00e1gban ilyenr\u0151l besz\u00e9lni, de \u00e9n m\u00e9g \u00fagy n\u0151ttem fel, hogy az assembly a kir\u00e1ly, \u00e9s&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-295","post","type-post","status-publish","format-standard","hentry","category-szakmai-elet"],"_links":{"self":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=295"}],"version-history":[{"count":0,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/295\/revisions"}],"wp:attachment":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}