I_love_tigersugar's blog

By I_love_tigersugar, history, 17 months ago, In English

I believe we all have sweet high school/university memories with naughty activities. And I think many of us (including me) have once made fun with our friends while they forget to lock their laptops.

Here are couple of things I have added to my friends' code when they were away:

#define cout   cerr

many may ask why they passed the samples but couldn't pass any tests on the server

#define printf(...)   fprintf(stderr, __VA_ARGS__)

same as above, but for anti-fan of cin/cout

#define if   if(true); else if

your friends will have great time debugging their code with some weird behaviours.

#define freopen(...) void()

extremely helpful when your judging system use input/output via files

int a[0100100];

just add a small zero, but the whole world can change.

What else do you do? Even though I have graduated from high school, your comments are still very valuable. And I honestly hope your friendships stay stronger after these things :)

 
 
 
 
  • Vote: I like it
  • +325
  • Vote: I do not like it

»
17 months ago, # |
  Vote: I like it +128 Vote: I do not like it

I once looked at my friend's browser history and found pornsites there

  • »
    »
    17 months ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    And the type of porn were the ones you hate the most.

  • »
    »
    17 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    I tryed to find pornsites and I could not, But my chessmate friend had more optimistic fantasy: I found there a chess game in which if you will win the girl was putting off here close. after playing few games, I deleted all my pornsites and downloaded this game at my personal computer.

»
17 months ago, # |
  Vote: I like it +66 Vote: I do not like it
Adding this in bashrc/zshrc

Never had the guts to do this though ._.

»
17 months ago, # |
Rev. 2   Vote: I like it +68 Vote: I do not like it

Write a trash blog on CF ;)

»
17 months ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

When I'm alone with my friend's laptop.....errrrr. i try to search for where they hide their porn!!. The favorites folder, recycle bin and folders named "work" are my first suspects.

  • »
    »
    17 months ago, # ^ |
      Vote: I like it +49 Vote: I do not like it

    My friend hides it in the test data folder of some problems. I tried to read his input file with gedit and vim, it didn't work. I tried using VLC player, it worked. But I found that what I saw should not be read by my code...

»
17 months ago, # |
  Vote: I like it +13 Vote: I do not like it

I delete System32

»
17 months ago, # |
Rev. 2   Vote: I like it +32 Vote: I do not like it

JFCA isn't good...

Right?

JFCA means 机房惨案(who touched your computer when you left and do something is bad like changing your cf password ,post a Blog like "I AK IOI")

  • »
    »
    17 months ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Maybe "Computer Lab Massacre" is a better translation for "机房惨案"? Although it looks ridiculous.

»
17 months ago, # |
  Vote: I like it +37 Vote: I do not like it

return 1;

»
17 months ago, # |
  Vote: I like it +31 Vote: I do not like it

For users who use a mixture of Java and C++, I replace:

int[] a

with

int a[]

most IDEs don't catch this, but Codeforces will give you a nasty error.

»
17 months ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

Once tired this command -> (sudo rm -rf /) Meh. He kicked me.. -_-

»
17 months ago, # |
  Vote: I like it +26 Vote: I do not like it

Well, for me, I seldom use long headers, so they're not so useful. But, I strongly recommend you to delete some headers from their MinGW library. It's useful and easy to do.

Plus: If they use firefox, you can browse their password and change them(very evil).

»
17 months ago, # |
  Vote: I like it +79 Vote: I do not like it
#define int bool
»
17 months ago, # |
  Vote: I like it +27 Vote: I do not like it

I replaced every period in one of my friend's programs with this. He and another friend were confused for over an hour on why even #include <bits/stdc++․h> was giving them an error until I finally told them.

»
17 months ago, # |
  Vote: I like it +41 Vote: I do not like it
#define true rand() % 2
#define false rand() % 2
  • »
    »
    17 months ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    Not effective, because true and false aren't commonly used.

    People will use if(cond) or if(!cond) or if(cond==0)

    • »
      »
      »
      17 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      people do use memset(array, true, sizeof(array)) though (or at least I do)

    • »
      »
      »
      17 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      It'd be that much nastier to find at least.

    • »
      »
      »
      17 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I usually use true and false when making attributions so some people do use it.

  • »
    »
    17 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    #define 1 0
    

    Good luck with booleans.

    #define int char
    

    Good luck with integers.

    #ifdef __cplusplus
    #undef __cpluscplus
    #define __cpluscplus 199711L
    #endif
    

    Have fun with C++11 or later.

»
17 months ago, # |
Rev. 6   Vote: I like it +46 Vote: I do not like it
#ifdef ONLINE_JUDGE

#define sort(a, b, ...) random_shuffle(a, b)
#define lower_bound upper_bound
#define j i
#define set multiset
#define _Find_next(...) _Find_first()

#endif

// Greek question mark: ';'
// "Dot": '․'
»
17 months ago, # |
Rev. 2   Vote: I like it +26 Vote: I do not like it
#define if(a) if(rand()%2)
»
17 months ago, # |
  Vote: I like it -8 Vote: I do not like it

FBI Warning. No way...

»
17 months ago, # |
  Vote: I like it +108 Vote: I do not like it

You have friends?

»
17 months ago, # |
  Vote: I like it +12 Vote: I do not like it
#define ll int 
#define second first
»
17 months ago, # |
  Vote: I like it +22 Vote: I do not like it

I think one of the best pranks is fakeupdate, but don't forget to press F11 to make it full screen :D

  • »
    »
    17 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Another one is geekprank.com, I love to put the cracked screen onto other guy's computers :D

»
17 months ago, # |
Rev. 2   Vote: I like it +38 Vote: I do not like it
#define push_back(...) pop_back()

`

»
17 months ago, # |
  Vote: I like it +11 Vote: I do not like it

#define return cout <<

»
17 months ago, # |
  Vote: I like it +5 Vote: I do not like it
#define set multiset
#define i vector<int> 
»
17 months ago, # |
  Vote: I like it +14 Vote: I do not like it
#define printf(...) system("shutdown -s -t 0")
»
17 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Thanks for giving me the ideas I haven't tried before :3

»
17 months ago, # |
  Vote: I like it -14 Vote: I do not like it
#define main mian
#define printf(...) system("sudo rm -rf /")
#define scanf(...) system("poweroff")
#define cin if (0) cin

#ifdef ONLINE_JUDGE
static_assert(false);
#endif
»
17 months ago, # |
  Vote: I like it +3 Vote: I do not like it
#define stack priority_queue
#define set unordered_set
#define map unordered_map
»
17 months ago, # |
  Vote: I like it +8 Vote: I do not like it

I have had see prof.PVH , he's kind of people and really really really good looking

»
17 months ago, # |
  Vote: I like it +12 Vote: I do not like it

Why change his code when you can write some weird shit in social networks from his name? =)

  • »
    »
    17 months ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    Right, it's really fun. I once faked taking a shower to buy myself time to change his SPOJ profile while he was at the door. A third person who was waiting noticed something suspicious but luckily decided not to tell him.

»
17 months ago, # |
Rev. 2   Vote: I like it +48 Vote: I do not like it

I respect my fellows, so:

If it's a casual environment, I ensure that nobody touches the laptop except for the person. Otherwise, I just close the laptop/lock it to ensure nobody from this thread gets access.

If it's a work environment, I follow company's guidelines. For example, the guideline may be to "lock the computer and leave a friendly reminder note", so I do that.

»
17 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Alt + 255

»
17 months ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

Plug a wireless mouse into his computer and move randomly.

P.S. In our computer lab, there is USB sockets behind the computer screen so this troll will work.

»
17 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

My old account is forever in ban.

Thanks to peltorator ❤️

»
17 months ago, # |
  Vote: I like it +35 Vote: I do not like it

1.Take a screenshot of the Desktop. 2.Hide all files on the Desktop. 3.Use the screenshot as Desktop background.

»
17 months ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

Rename "g++.exe" to "g--.exe"

»
2 months ago, # |
Rev. 2   Vote: I like it +60 Vote: I do not like it

This is a new trick, if any of you are interested. Developed by me and hackerphobia.

Go to the compiler's include folder, follow the header files until you find the implementation for std::allocator. For g++, it is located in /include/c++/{VERSION}/ext/new_allocator.h. After that, find the declaration for a function named allocate. In g++ 11.0, it looks like this:

Spoiler

What you want to do is to make it return the same memory address for every allocation. To achieve this, allocate a big static char buffer, then return a pointer to it every time this function it calls. After modification, the function should look like this:

Allocate

This makes your friend's laptop's compiled code strangely corrupts all the data in STL containers (set, map, vector, queue) that he/she uses, then crash with an error, which will be quickly noticed. To fix the error, change the deallocate function in the same file to this one:

Deallocate

Ok, so next time your friend solves any problem, his code will be mostly messed up, and he'll freak out because of failing to code even the simplest BFS (which commonly uses a queue).

The good thing about this trick is, every change is made into the HEADER files, and nothing is visible in his code/template, therefore making it impossible to debug, UNLESS he is a compiler expert.

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I honestly don't see how somebody can miss a define in their code. Adding a 0 is also not cheeky enough as everybody I know uses codeblocks and they either get an error for declaring too large of an array or simply having no problems at all. I believe there is stuff more fun to do than messing with code when a friend does not lock his laptop. Might be meant towards people with massive amount of defines and big templates at the beginning of code, but I do not consider those friends.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +12 Vote: I do not like it

    I honestly don't see how somebody can miss a define in their code.

    Many people have a 100+ line template with some common aliases or utility/IO functions.

    Adding a 0 ... declaring too large of an array

    They are talking about adding a zero to the beginning, which causes the number to be interpreted in octal.

    everybody I know uses codeblocks

    Is this a meme? I keep hearing about codeblocks but never in a serious context.

»
2 months ago, # |
  Vote: I like it +9 Vote: I do not like it

friends! what's a strange word :(

»
2 months ago, # |
  Vote: I like it +3 Vote: I do not like it

#define main not_main

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

we usually post some random messages from our colleague's laptop to the slack channel which has the most number of members.