Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Homework

Name: Anonymous 2009-07-13 13:47

Write a routine which makes string uppercase or lowercase in language of your choice in least possible execution time.

Name: Anonymous 2009-07-13 14:01

"Go away.".upper()

Name: Anonymous 2009-07-13 14:03

#include <ctype.h>
void uppercase (char *s) {
    while (*s) *s = toupper (*s++);
}

Name: Anonymous 2009-07-13 14:08

Define uppercase and lowercase. Are we talking ASCII or unicode?

Another thing to consider is that in the Turkish alphabet, for example, the uppercase version of i is İ, not I. Likewise, ı is the lowercase version of I. So uppercase and lowercase functions may be locale-dependent if you're doing ``linguistic casing''.

Anyway,
import qualified Data.ByteString.Char8 as B
import Data.Char
f = B.map toUpper

Name: FrozenVoid 2009-07-13 14:25

#include <stdio.h>
#include <stdlib.h>
inline void lcase(char *str){while(*str){*str++|=32;}}
inline void ucase(char *str){while(*str){*str++&=223;}}
void main(int argc,char **argv){
if(argc<2){printf("No arguments");exit(1);}
char* argstr=argv[1];
ucase(argstr);printf("Uppercase:%s\n",argstr);
lcase(argstr);printf("Lowercase:%s\n",argstr);}




____________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Men who long for freedom begin the attempt to obtain it by entreating their masters to be kind enough to protect them by modifying the laws which these masters themselves have created!

Name: " 2009-07-13 14:34

void mkUpper (char* s)
{
    while (*s)
    {
        if ((*s >= 97) && (*s <= 122))
            *s &= ~(32);
    }
}



void mkLower (char* s)
{
    while (*s)
    {
        if ((*s >= 65) && (*s <= 90))
            *s |= 32;
    }
}

Name: Anonymous 2009-07-13 14:34

>>3
void upper(char *str) {
    int l = strlen(str), *s = (int*)str, i;
    for (i = 0; i < l << 2; ++i)
        s[i] &= 3755991007;
    for (i = 0; i < l ^ 4294967292; ++i)
        str[i] &= 223;
}

Name: MILKRIBS4k 2009-07-13 14:43

>>6
Why use pointers!

Name: Anonymous 2009-07-13 14:47

<>; chomp; print uc;

Name: Anonymous 2009-07-13 14:55

The Sussman way of doing it:

void make_upper_sussman(char *s) {
    while(*s) { *s >= 97 ? *s <= 122 ? (*s -= 32) : 1 : (char)"Sussman"; s++; }
}

Name: Anonymous 2009-07-13 14:57

readln >upper print

Name: Anonymous 2009-07-13 15:04

print y/[a-z]//>=y/[A-Z]//?uc:lc while<>

Name: Anonymous 2009-07-13 15:06

>>12
Oops, I forgot tr/// works with ranges even without grouping with []:

print y/a-z//>=y/A-Z//?uc:lc while<>

Name: Anonymous 2009-07-13 15:29

>>3,5,6,7,10,12,13
forgot about unicode.

Name: Anonymous 2009-07-13 15:38

>>14
No! All text is ASCII!

Name: Anonymous 2009-07-13 16:06

>>15
Your post isn't even ASSKEY. Check the Content-type header if you don't believe me.

Name: FrozenVoid 2009-07-13 16:26

I don't forget about unicode. I ignore it.



____________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Laws: We know what they are, and what they are worth! They are spider webs for the rich and mighty, steel chains for the poor and weak, fishing nets in the hands of government.

Name: Anonymous 2009-07-13 16:29

>>17
enjoy your remote code injection vulnerabilities.

Name: Anonymous 2009-07-13 16:41

How could this be homework if the Sussman is not involved in any way?

Name: Anonymous 2009-07-13 17:23

>>16
FUCK
>>17
FUCK off

Name: Anonymous 2009-07-13 17:41

Easy. I myself can do it in O(1) using assembly.

Name: Anonymous 2009-07-13 17:51

"nigga".upcase

Name: Anonymous 2009-07-13 17:57

echo "foo" | tr a-z A-Z

Name: Anonymous 2009-07-13 20:03

>>14
Sorry. How about this one?
#!/usr/bin/perl -C
print+(grep/\p{Lu}/,/./g)>=(grep/\p{Ll}/,/./g)?lc:uc while<>

Name: Anonymous 2009-07-14 0:09

>>24
perl
grep
grep
[minimum] execution time

2/10

Name: FrozenVoid 2009-07-14 0:54

There are ``enterprise-class' solutions which work only on letters, and only with selected ranges of unicode which contain said letters and correctly transforming each language file into appropriate letters, but
They all Fail on least possible execution time.  
__________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Remember happiness doesn't depend upon who you are or what you have; it depends solely on what you think.

Name: Sagey McSagerson 2009-07-14 1:04

Sage for ignorant ass FV

Name: noko 2009-07-14 1:49

if string[0] => 97 then
 string.upcase!
else
 string.downcase!
end
#I WIN!

Name: Anonymous 2009-07-14 1:52

>least possible execution time
How am I supposed to measure that?

Name: Anonymous 2009-07-14 2:06

>>29
It's quite simple. The least possible execution time for any program is no time at all.

Name: Anonymous 2009-07-14 3:41

>>30
I've become enlightened
Do I need to study Quantum Computing or Chaotic Computing?

Name: Anonymous 2009-07-14 4:08


:toupper
  push esi
  push edi
  mov esi, [esp+8]
  mov edi, esi
  mov ecx, ebx
  mov ebx, .uptab
.uploop
  lodsb
  or al, al
  jz .upexit
  xlat
  stosb
  jmps .uploop
.upexit
  mov ebx, ecx
  pop edi
  pop esi
  ret
.uptab
; the content of the table is left as an exercise for the programmer.

Name: Anonymous 2009-07-14 4:16

/*
 * WRITTEN BY A.O.
 * DO NOT STEAL MY ART.
 */

#define CASE_SINGLE(value,offset) if(code==value) return code+offset;

#define CASE_RANGE(left,right,offset) if(code>=left && code<=right) return code+offset;

#define CASE_RANGE_EVEN(left,right,offset) if(code%2==0 && code>=left && code<=right) return code+offset;

#define CASE_RANGE_ODD(left,right,offset) if(code%2==1 && code>=left && code<=right) return code+offset;


unsigned int ucs_toupper(unsigned int code){

    switch(code>>8){

    case 0x00:

        CASE_RANGE     (0x0061,0x007a,-32)

        CASE_SINGLE    (0x00b5,743)

        CASE_RANGE     (0x00e0,0x00f6,-32)

        CASE_RANGE     (0x00f8,0x00fe,-32)

        CASE_SINGLE    (0x00ff,121)

        break;

    case 0x01:

        CASE_RANGE_ODD (0x0101,0x012f,-1)

        CASE_SINGLE    (0x0131,-232)

        CASE_RANGE_ODD (0x0133,0x0137,-1)

        CASE_RANGE_EVEN(0x013a,0x0148,-1)

        CASE_RANGE_ODD (0x014b,0x0177,-1)

        CASE_RANGE_EVEN(0x017a,0x017e,-1)

        CASE_SINGLE    (0x017f,-300)

        CASE_SINGLE    (0x0180,195)

        CASE_RANGE_ODD (0x0183,0x0185,-1)

        CASE_SINGLE    (0x0188,-1)

        CASE_SINGLE    (0x018c,-1)

        CASE_SINGLE    (0x0192,-1)

        CASE_SINGLE    (0x0195,97)

        CASE_SINGLE    (0x0199,-1)

        CASE_SINGLE    (0x019a,163)

        CASE_SINGLE    (0x019e,130)

        CASE_RANGE_ODD (0x01a1,0x01a5,-1)

        CASE_SINGLE    (0x01a8,-1)

        CASE_SINGLE    (0x01ad,-1)

        CASE_SINGLE    (0x01b0,-1)

        CASE_RANGE_EVEN(0x01b4,0x01b6,-1)

        CASE_SINGLE    (0x01b9,-1)

        CASE_SINGLE    (0x01bd,-1)

        CASE_SINGLE    (0x01bf,56)

        CASE_SINGLE    (0x01c5,-1)

        CASE_SINGLE    (0x01c6,-2)

        CASE_SINGLE    (0x01c8,-1)

        CASE_SINGLE    (0x01c9,-2)

        CASE_SINGLE    (0x01cb,-1)

        CASE_SINGLE    (0x01cc,-2)

        CASE_RANGE_EVEN(0x01ce,0x01dc,-1)

        CASE_SINGLE    (0x01dd,-79)

        CASE_RANGE_ODD (0x01df,0x01ef,-1)

        CASE_SINGLE    (0x01f2,-1)

        CASE_SINGLE    (0x01f3,-2)

        CASE_SINGLE    (0x01f5,-1)

        CASE_RANGE_ODD (0x01f9,0x021f,-1)

        break;

    case 0x02:

        CASE_RANGE_ODD (0x01f9,0x021f,-1)

        CASE_RANGE_ODD (0x0223,0x0233,-1)

        CASE_SINGLE    (0x023c,-1)

        CASE_SINGLE    (0x0242,-1)

        CASE_RANGE_ODD (0x0247,0x024f,-1)

        CASE_SINGLE    (0x0250,10783)

        CASE_SINGLE    (0x0251,10780)

        CASE_SINGLE    (0x0253,-210)

        CASE_SINGLE    (0x0254,-206)

        CASE_RANGE     (0x0256,0x0257,-205)

        CASE_SINGLE    (0x0259,-202)

        CASE_SINGLE    (0x025b,-203)

        CASE_SINGLE    (0x0260,-205)

        CASE_SINGLE    (0x0263,-207)

        CASE_SINGLE    (0x0268,-209)

        CASE_SINGLE    (0x0269,-211)

        CASE_SINGLE    (0x026b,10743)

        CASE_SINGLE    (0x026f,-211)

        CASE_SINGLE    (0x0271,10749)

        CASE_SINGLE    (0x0272,-213)

        CASE_SINGLE    (0x0275,-214)

        CASE_SINGLE    (0x027d,10727)

        CASE_SINGLE    (0x0280,-218)

        CASE_SINGLE    (0x0283,-218)

        CASE_SINGLE    (0x0288,-218)

        CASE_SINGLE    (0x0289,-69)

        CASE_RANGE     (0x028a,0x028b,-217)

        CASE_SINGLE    (0x028c,-71)

        CASE_SINGLE    (0x0292,-219)

        break;

    case 0x03:

        CASE_SINGLE    (0x0345,84)

        CASE_RANGE_ODD (0x0371,0x0373,-1)

        CASE_SINGLE    (0x0377,-1)

        CASE_RANGE     (0x037b,0x037d,130)

        CASE_SINGLE    (0x03ac,-38)

        CASE_RANGE     (0x03ad,0x03af,-37)

        CASE_RANGE     (0x03b1,0x03c1,-32)

        CASE_SINGLE    (0x03c2,-31)

        CASE_RANGE     (0x03c3,0x03cb,-32)

        CASE_SINGLE    (0x03cc,-64)

        CASE_RANGE     (0x03cd,0x03ce,-63)

        CASE_SINGLE    (0x03d0,-62)

        CASE_SINGLE    (0x03d1,-57)

        CASE_SINGLE    (0x03d5,-47)

        CASE_SINGLE    (0x03d6,-54)

        CASE_SINGLE    (0x03d7,-8)

        CASE_RANGE_ODD (0x03d9,0x03ef,-1)

        CASE_SINGLE    (0x03f0,-86)

        CASE_SINGLE    (0x03f1,-80)

        CASE_SINGLE    (0x03f2,7)

        CASE_SINGLE    (0x03f5,-96)

        CASE_SINGLE    (0x03f8,-1)

        CASE_SINGLE    (0x03fb,-1)

        break;

    case 0x04:

        CASE_RANGE     (0x0430,0x044f,-32)

        CASE_RANGE     (0x0450,0x045f,-80)

        CASE_RANGE_ODD (0x0461,0x0481,-1)

        CASE_RANGE_ODD (0x048b,0x04bf,-1)

        CASE_RANGE_EVEN(0x04c2,0x04ce,-1)

        CASE_SINGLE    (0x04cf,-15)

        CASE_RANGE_ODD (0x04d1,0x0523,-1)

        break;

    case 0x05:

        CASE_RANGE_ODD (0x04d1,0x0523,-1)

        CASE_RANGE     (0x0561,0x0586,-48)

        break;

    case 0x1d:

        CASE_SINGLE    (0x1d79,35332)

        CASE_SINGLE    (0x1d7d,3814)

        break;

    case 0x1e:

        CASE_RANGE_ODD (0x1e01,0x1e95,-1)

        CASE_SINGLE    (0x1e9b,-59)

        CASE_RANGE_ODD (0x1ea1,0x1eff,-1)

        break;

    case 0x1f:

        CASE_RANGE     (0x1f00,0x1f07,8)

        CASE_RANGE     (0x1f10,0x1f15,8)

        CASE_RANGE     (0x1f20,0x1f27,8)

        CASE_RANGE     (0x1f30,0x1f37,8)

        CASE_RANGE     (0x1f40,0x1f45,8)

        CASE_RANGE_ODD (0x1f51,0x1f57,8)

        CASE_RANGE     (0x1f60,0x1f67,8)

        CASE_RANGE     (0x1f70,0x1f71,74)

        CASE_RANGE     (0x1f72,0x1f75,86)

        CASE_RANGE     (0x1f76,0x1f77,100)

        CASE_RANGE     (0x1f78,0x1f79,128)

        CASE_RANGE     (0x1f7a,0x1f7b,112)

        CASE_RANGE     (0x1f7c,0x1f7d,126)

        CASE_RANGE     (0x1f80,0x1f87,8)

        CASE_RANGE     (0x1f90,0x1f97,8)

        CASE_RANGE     (0x1fa0,0x1fa7,8)

        CASE_RANGE     (0x1fb0,0x1fb1,8)

        CASE_SINGLE    (0x1fb3,9)

        CASE_SINGLE    (0x1fbe,-7205)

        CASE_SINGLE    (0x1fc3,9)

        CASE_RANGE     (0x1fd0,0x1fd1,8)

        CASE_RANGE     (0x1fe0,0x1fe1,8)

        CASE_SINGLE    (0x1fe5,7)

        CASE_SINGLE    (0x1ff3,9)

        break;

    case 0x21:

        CASE_SINGLE    (0x214e,-28)

        CASE_RANGE     (0x2170,0x217f,-16)

        CASE_SINGLE    (0x2184,-1)

        break;

    case 0x24:

        CASE_RANGE     (0x24d0,0x24e9,-26)

        break;

    case 0x2c:

        CASE_RANGE     (0x2c30,0x2c5e,-48)

        CASE_SINGLE    (0x2c61,-1)

        CASE_SINGLE    (0x2c65,-10795)

        CASE_SINGLE    (0x2c66,-10792)

        CASE_RANGE_EVEN(0x2c68,0x2c6c,-1)

        CASE_SINGLE    (0x2c73,-1)

        CASE_SINGLE    (0x2c76,-1)

        CASE_RANGE_ODD (0x2c81,0x2ce3,-1)

        break;

    case 0x2d:

        CASE_RANGE     (0x2d00,0x2d25,-7264)

        break;

    case 0xa6:

        CASE_RANGE_ODD (0xa641,0xa65f,-1)

        CASE_RANGE_ODD (0xa663,0xa66d,-1)

        CASE_RANGE_ODD (0xa681,0xa697,-1)

        break;

    case 0xa7:

        CASE_RANGE_ODD (0xa723,0xa72f,-1)

        CASE_RANGE_ODD (0xa733,0xa76f,-1)

        CASE_RANGE_EVEN(0xa77a,0xa77c,-1)

        CASE_RANGE_ODD (0xa77f,0xa787,-1)

        CASE_SINGLE    (0xa78c,-1)

        break;

    case 0xff:

        CASE_RANGE     (0xff41,0xff5a,-32)

        break;

    case 0x104:

        CASE_RANGE     (0x10428,0x1044f,-40)

        break;

    }

   

    return code;

}

Name: Anonymous 2009-07-14 4:17

Uwaaah, I'm sorry!

/*
 * WRITTEN BY A.O.
 * DO NOT STEAL MY ART.
 */

#define CASE_SINGLE(value,offset) if(code==value) return code+offset;

#define CASE_RANGE(left,right,offset) if(code>=left && code<=right) return code+offset;

#define CASE_RANGE_EVEN(left,right,offset) if(code%2==0 && code>=left && code<=right) return code+offset;

#define CASE_RANGE_ODD(left,right,offset) if(code%2==1 && code>=left && code<=right) return code+offset;


unsigned int ucs_toupper(unsigned int code){

    switch(code>>8){

    case 0x00:

        CASE_RANGE     (0x0061,0x007a,-32)

        CASE_SINGLE    (0x00b5,743)

        CASE_RANGE     (0x00e0,0x00f6,-32)

        CASE_RANGE     (0x00f8,0x00fe,-32)

        CASE_SINGLE    (0x00ff,121)

        break;

    case 0x01:

        CASE_RANGE_ODD (0x0101,0x012f,-1)

        CASE_SINGLE    (0x0131,-232)

        CASE_RANGE_ODD (0x0133,0x0137,-1)

        CASE_RANGE_EVEN(0x013a,0x0148,-1)

        CASE_RANGE_ODD (0x014b,0x0177,-1)

        CASE_RANGE_EVEN(0x017a,0x017e,-1)

        CASE_SINGLE    (0x017f,-300)

        CASE_SINGLE    (0x0180,195)

        CASE_RANGE_ODD (0x0183,0x0185,-1)

        CASE_SINGLE    (0x0188,-1)

        CASE_SINGLE    (0x018c,-1)

        CASE_SINGLE    (0x0192,-1)

        CASE_SINGLE    (0x0195,97)

        CASE_SINGLE    (0x0199,-1)

        CASE_SINGLE    (0x019a,163)

        CASE_SINGLE    (0x019e,130)

        CASE_RANGE_ODD (0x01a1,0x01a5,-1)

        CASE_SINGLE    (0x01a8,-1)

        CASE_SINGLE    (0x01ad,-1)

        CASE_SINGLE    (0x01b0,-1)

        CASE_RANGE_EVEN(0x01b4,0x01b6,-1)

        CASE_SINGLE    (0x01b9,-1)

        CASE_SINGLE    (0x01bd,-1)

        CASE_SINGLE    (0x01bf,56)

        CASE_SINGLE    (0x01c5,-1)

        CASE_SINGLE    (0x01c6,-2)

        CASE_SINGLE    (0x01c8,-1)

        CASE_SINGLE    (0x01c9,-2)

        CASE_SINGLE    (0x01cb,-1)

        CASE_SINGLE    (0x01cc,-2)

        CASE_RANGE_EVEN(0x01ce,0x01dc,-1)

        CASE_SINGLE    (0x01dd,-79)

        CASE_RANGE_ODD (0x01df,0x01ef,-1)

        CASE_SINGLE    (0x01f2,-1)

        CASE_SINGLE    (0x01f3,-2)

        CASE_SINGLE    (0x01f5,-1)

        CASE_RANGE_ODD (0x01f9,0x021f,-1)

        break;

    case 0x02:

        CASE_RANGE_ODD (0x01f9,0x021f,-1)

        CASE_RANGE_ODD (0x0223,0x0233,-1)

        CASE_SINGLE    (0x023c,-1)

        CASE_SINGLE    (0x0242,-1)

        CASE_RANGE_ODD (0x0247,0x024f,-1)

        CASE_SINGLE    (0x0250,10783)

        CASE_SINGLE    (0x0251,10780)

        CASE_SINGLE    (0x0253,-210)

        CASE_SINGLE    (0x0254,-206)

        CASE_RANGE     (0x0256,0x0257,-205)

        CASE_SINGLE    (0x0259,-202)

        CASE_SINGLE    (0x025b,-203)

        CASE_SINGLE    (0x0260,-205)

        CASE_SINGLE    (0x0263,-207)

        CASE_SINGLE    (0x0268,-209)

        CASE_SINGLE    (0x0269,-211)

        CASE_SINGLE    (0x026b,10743)

        CASE_SINGLE    (0x026f,-211)

        CASE_SINGLE    (0x0271,10749)

        CASE_SINGLE    (0x0272,-213)

        CASE_SINGLE    (0x0275,-214)

        CASE_SINGLE    (0x027d,10727)

        CASE_SINGLE    (0x0280,-218)

        CASE_SINGLE    (0x0283,-218)

        CASE_SINGLE    (0x0288,-218)

        CASE_SINGLE    (0x0289,-69)

        CASE_RANGE     (0x028a,0x028b,-217)

        CASE_SINGLE    (0x028c,-71)

        CASE_SINGLE    (0x0292,-219)

        break;

    case 0x03:

        CASE_SINGLE    (0x0345,84)

        CASE_RANGE_ODD (0x0371,0x0373,-1)

        CASE_SINGLE    (0x0377,-1)

        CASE_RANGE     (0x037b,0x037d,130)

        CASE_SINGLE    (0x03ac,-38)

        CASE_RANGE     (0x03ad,0x03af,-37)

        CASE_RANGE     (0x03b1,0x03c1,-32)

        CASE_SINGLE    (0x03c2,-31)

        CASE_RANGE     (0x03c3,0x03cb,-32)

        CASE_SINGLE    (0x03cc,-64)

        CASE_RANGE     (0x03cd,0x03ce,-63)

        CASE_SINGLE    (0x03d0,-62)

        CASE_SINGLE    (0x03d1,-57)

        CASE_SINGLE    (0x03d5,-47)

        CASE_SINGLE    (0x03d6,-54)

        CASE_SINGLE    (0x03d7,-8)

        CASE_RANGE_ODD (0x03d9,0x03ef,-1)

        CASE_SINGLE    (0x03f0,-86)

        CASE_SINGLE    (0x03f1,-80)

        CASE_SINGLE    (0x03f2,7)

        CASE_SINGLE    (0x03f5,-96)

        CASE_SINGLE    (0x03f8,-1)

        CASE_SINGLE    (0x03fb,-1)

        break;

    case 0x04:

        CASE_RANGE     (0x0430,0x044f,-32)

        CASE_RANGE     (0x0450,0x045f,-80)

        CASE_RANGE_ODD (0x0461,0x0481,-1)

        CASE_RANGE_ODD (0x048b,0x04bf,-1)

        CASE_RANGE_EVEN(0x04c2,0x04ce,-1)

        CASE_SINGLE    (0x04cf,-15)

        CASE_RANGE_ODD (0x04d1,0x0523,-1)

        break;

    case 0x05:

        CASE_RANGE_ODD (0x04d1,0x0523,-1)

        CASE_RANGE     (0x0561,0x0586,-48)

        break;

    case 0x1d:

        CASE_SINGLE    (0x1d79,35332)

        CASE_SINGLE    (0x1d7d,3814)

        break;

    case 0x1e:

        CASE_RANGE_ODD (0x1e01,0x1e95,-1)

        CASE_SINGLE    (0x1e9b,-59)

        CASE_RANGE_ODD (0x1ea1,0x1eff,-1)

        break;

    case 0x1f:

        CASE_RANGE     (0x1f00,0x1f07,8)

        CASE_RANGE     (0x1f10,0x1f15,8)

        CASE_RANGE     (0x1f20,0x1f27,8)

        CASE_RANGE     (0x1f30,0x1f37,8)

        CASE_RANGE     (0x1f40,0x1f45,8)

        CASE_RANGE_ODD (0x1f51,0x1f57,8)

        CASE_RANGE     (0x1f60,0x1f67,8)

        CASE_RANGE     (0x1f70,0x1f71,74)

        CASE_RANGE     (0x1f72,0x1f75,86)

        CASE_RANGE     (0x1f76,0x1f77,100)

        CASE_RANGE     (0x1f78,0x1f79,128)

        CASE_RANGE     (0x1f7a,0x1f7b,112)

        CASE_RANGE     (0x1f7c,0x1f7d,126)

        CASE_RANGE     (0x1f80,0x1f87,8)

        CASE_RANGE     (0x1f90,0x1f97,8)

        CASE_RANGE     (0x1fa0,0x1fa7,8)

        CASE_RANGE     (0x1fb0,0x1fb1,8)

        CASE_SINGLE    (0x1fb3,9)

        CASE_SINGLE    (0x1fbe,-7205)

        CASE_SINGLE    (0x1fc3,9)

        CASE_RANGE     (0x1fd0,0x1fd1,8)

        CASE_RANGE     (0x1fe0,0x1fe1,8)

        CASE_SINGLE    (0x1fe5,7)

        CASE_SINGLE    (0x1ff3,9)

        break;

    case 0x21:

        CASE_SINGLE    (0x214e,-28)

        CASE_RANGE     (0x2170,0x217f,-16)

        CASE_SINGLE    (0x2184,-1)

        break;

    case 0x24:

        CASE_RANGE     (0x24d0,0x24e9,-26)

        break;

    case 0x2c:

        CASE_RANGE     (0x2c30,0x2c5e,-48)

        CASE_SINGLE    (0x2c61,-1)

        CASE_SINGLE    (0x2c65,-10795)

        CASE_SINGLE    (0x2c66,-10792)

        CASE_RANGE_EVEN(0x2c68,0x2c6c,-1)

        CASE_SINGLE    (0x2c73,-1)

        CASE_SINGLE    (0x2c76,-1)

        CASE_RANGE_ODD (0x2c81,0x2ce3,-1)

        break;

    case 0x2d:

        CASE_RANGE     (0x2d00,0x2d25,-7264)

        break;

    case 0xa6:

        CASE_RANGE_ODD (0xa641,0xa65f,-1)

        CASE_RANGE_ODD (0xa663,0xa66d,-1)

        CASE_RANGE_ODD (0xa681,0xa697,-1)

        break;

    case 0xa7:

        CASE_RANGE_ODD (0xa723,0xa72f,-1)

        CASE_RANGE_ODD (0xa733,0xa76f,-1)

        CASE_RANGE_EVEN(0xa77a,0xa77c,-1)

        CASE_RANGE_ODD (0xa77f,0xa787,-1)

        CASE_SINGLE    (0xa78c,-1)

        break;

    case 0xff:

        CASE_RANGE     (0xff41,0xff5a,-32)

        break;

    case 0x104:

        CASE_RANGE     (0x10428,0x1044f,-40)

        break;

    }

   

    return code;

}

Name: Anonymous 2009-07-14 8:00

>>33
Too late, its reposted all over DA.

Name: Anonymous 2009-07-14 9:09

>>32
Assembly-level trolling.(troll rating left as exercise for the reader)

Name: Anonymous 2009-07-14 9:44


; 0B43D1ED:       8B15B0D1430B     MOV EDX, [#xB43D1B0]       ; #<FUNCTION (LAMBDA                                                                                                   
                                                              ;                #) {B43D24D}>                                                                                         
                                                              ; no-arg-parsing entry point                                                                                           
;      1F3:       800DB403100104   OR BYTE PTR [#x11003B4], 4                                                                                                                        
;      1FA:       B910000000       MOV ECX, 16                                                                                                                                       
;      1FF:       030D84BB0708     ADD ECX, [#x807BB84]       ; boxed_region                                                                                                         
;      205:       3B0D88BB0708     CMP ECX, [#x807BB88]                                                                                                                              
;      20B:       7607             JBE L0                                                                                                                                            
;      20D:       E82E51C2FC       CALL #x8062340             ; alloc_overflow_ecx                                                                                                   
;      212:       EB09             JMP L1                                                                                                                                            
;      214: L0:   890D84BB0708     MOV [#x807BB84], ECX       ; boxed_region                                                                                                         
;      21A:       83E910           SUB ECX, 16                                                                                                                                       
;      21D: L1:   8D4905           LEA ECX, [ECX+5]                                                                                                                                  
;      220:       C741FB2E020000   MOV DWORD PTR [ECX-5], 558                                                                                                                        
;      227:       8B42FF           MOV EAX, [EDX-1]                                                                                                                                  
;      22A:       8941FF           MOV [ECX-1], EAX                                                                                                                                  
;      22D:       8035B403100104   XOR BYTE PTR [#x11003B4], 4                                                                                                                       
;      234:       7402             JEQ L2                                                                                                                                            
;      236:       CC09             BREAK 9                    ; pending interrupt trap                                                                                               
;      238: L2:   895903           MOV [ECX+3], EBX                                                                                                                                  
;      23B:       8BD1             MOV EDX, ECX                                                                                                                                      
;      23D:       8D65F8           LEA ESP, [EBP-8]                                                                                                                                  
;      240:       F8               CLC                                                                                                                                               
;      241:       8B6DFC           MOV EBP, [EBP-4]                                                                                                                                  
;      244:       C20400           RET 4

Name: Anonymous 2009-07-14 18:03

>>37
That's cheating.
Posting the dissasembly generated by SBCL of a Common Lisp compiled function is not a very acceptable answer as it depends on external functions, and the code is not relocatable, also the code for the lambda in your own code is not included, so the reader can't even tell what it does.

Name: Anonymous 2010-11-28 7:38

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List