Make it look like I'm working

278

208

Often, I find myself running a script or query that will take a significant amount of time to run. I can leave that script open and enjoy some guilt-free procrastination.

Now, what if I could write a script that seems to be one of the above scripts to any onlookers, but in looks only? I could put it up on a screen and enjoy days of kitten livestreams before anyone realised that all the complicated rigmarole on the screen didn't have anything to do with my actual job.

Your challenge is to write this script for me (yes, I'm that lazy).

A good answer will:

  • Make something appear on the screen that looks like a script is doing work. "Screen" can be terminal, browser, etc.
  • Be fairly original (yes, we've all seen the neverending progress bar programs)
  • Survive cursory examination by a technical person

A bad answer will:

  • Get me fired
  • Rehash something we all were forwarded in the 90's

A stellar answer might:

  • Transcend one of the bad bullet points above (for instance)
  • Survive critical examination
  • *gasp* actually do something that's useful or aids in my work shirking

Acceptance will be based on votes, with bonus from real-life results. I will actually run these scripts (Linux Mint 16) at work when my screen is visible (meetings and the like) to determine detection. If anyone notices that it's faking, you're out of the running. If someone comments on how hard I'm working, +5 bonus upvotes for you.

"Useful" in this case can apply to any coder, but if you're looking for that extra shine on your teacher-bound apple, I'm a full-stack webdev who works in code roughly according to my tags.

Question partially inspired by this.

Results

Disappointingly, I didn't get any comments either way on these entries. They're all awesome, so you're all winners in my heart. However, Loktar has the most votes by a long shot, so he gets the +15 from the accept. Congrats!

SomeKittens

Posted 2014-06-07T00:47:00.650

Reputation: 2 633

There will be an app for this in Ubuntu 15.04: Hollywood Technodrama, powered by byobu. (Link includes video & screenshots.)

– ojdo – 2015-01-05T13:24:38.567

First you don't want to do the job you are supposed to do, but you also don't want to do the job of hiding that you are not doing it. The next step is to ask someone to post this on stackexchange and try out the solutions, so that you don't have to do it yourself. – Florian F – 2016-02-05T12:32:45.860

6What's the winning criteria, [tag:popularity-contest]? – Kyle Kanos – 2014-06-07T01:37:27.593

I think it's technically code-challenge. – undergroundmonorail – 2014-06-07T01:50:20.913

Just so you know, Linux Mint 17 (LTS) is out! – wchargin – 2014-06-07T03:10:57.353

5

still waiting for someone to reimplement http://visikord.com/ghostzilla/

– Christian Chapman – 2014-06-07T06:02:54.413

@KyleKanos Clarified winning condition. – SomeKittens – 2014-06-07T06:09:20.790

@WChargin I've been meaning to upgrade. I need it! – SomeKittens – 2014-06-07T06:10:37.063

36So... what happens if you test an answer and it actually does get you fired? – Bob – 2014-06-07T11:28:00.527

54This gives me an idea for another code golf question. "Make it look like my question shouldn't be put on hold" – twiz – 2014-06-07T13:26:13.733

6

What about the good old http://hackertyper.net/ ?

– german_guy – 2014-06-08T17:45:35.263

9

Just write one of these programs, and compile!

– ugoren – 2014-06-08T19:15:23.753

1@german_guy the only problem with hackertyper is it requires user intervention – Loktar – 2014-06-08T20:55:13.200

13

I saw a really good remake of the Tron Legacy boardroom on Github the other day: https://github.com/arscan/encom-boardroom

– Paul Prestidge – 2014-06-09T04:40:54.417

1@Chron wow thats really good actually! – Loktar – 2014-06-09T14:34:25.067

2"Your challenge is to write this script for me." I think I fractured a funny bone LoL! – Klik – 2014-06-10T19:04:49.633

1@Chron, i'm impressed. Gonna bookmark that page and use it a lot ^_^ – Mathlight – 2014-06-11T12:42:15.500

15 bonus upvotes? Do you have sock puppets? ;-) – Canadian Luke – 2014-06-11T16:43:12.910

@CanadianLuke When it comes to the scoring. – SomeKittens – 2014-06-11T17:05:19.150

I feel like I shouldn't upvote that really great question - future employees now reading StackExchange network messages. – Szymon Toda – 2014-06-11T19:51:01.173

reminds me this video: https://www.youtube.com/watch?v=JqUmXDU6cJE

– Tomas – 2014-06-11T22:12:43.630

1It may be relevant for people to know what your job actually is. Then again, it may not. – Thorbjørn Ravn Andersen – 2014-06-12T13:37:32.443

1Is there a way to do this so I can watch the world cup and make it look like I am working? – ford prefect – 2014-06-13T16:40:59.530

2I love the thought that dozens of people are not doing productive work to help you (and the rest of the technical workers in the world) avoid doing productive work. – Art Taylor – 2014-06-13T19:50:39.607

Why don't you do other work if you don't like it... – stommestack – 2014-06-13T21:35:46.860

3I hope your boss doesn't see this thread... – Kaz Wolfe – 2014-06-14T04:16:52.633

Back in the early 90s, "Chessmaster" had a button labeled "The Boss" which brought up a screenshot of some spreadsheet program. Took me a while to figure out what the heck it was for.

– Johnny Mopp – 2014-06-15T12:49:35.740

@SomeKittens How is the testing going? – PyRulez – 2014-06-16T14:22:52.310

@PyRulez boring. No comments either way. – SomeKittens – 2014-06-16T17:06:25.893

Answers

290

JavaScript

So I went a little crazy with this. I did it between breaks from working on my GUI to track IP's using Visual Basic.

You can access it by going to the super serious domain I made for it tonight as well so you can look busy anywhere Gui Hacker and fork and create your own from the following sources

Basically, if you have this running no one will bother you because they know you are doing some serious stuff.

var canvas = document.querySelector(".hacker-3d-shiz"),
  ctx = canvas.getContext("2d"),
  canvasBars = document.querySelector(".bars-and-stuff"),
  ctxBars = canvasBars.getContext("2d"),
  outputConsole = document.querySelector(".output-console");

canvas.width = (window.innerWidth / 3) * 2;
canvas.height = window.innerHeight / 3;

canvasBars.width = window.innerWidth / 3;
canvasBars.height = canvas.height;

outputConsole.style.height = (window.innerHeight / 3) * 2 + 'px';
outputConsole.style.top = window.innerHeight / 3 + 'px'


/* Graphics stuff */
function Square(z) {
  this.width = canvas.width / 2;
  this.height = canvas.height;
  z = z || 0;

  this.points = [
    new Point({
      x: (canvas.width / 2) - this.width,
      y: (canvas.height / 2) - this.height,
      z: z
    }),
    new Point({
      x: (canvas.width / 2) + this.width,
      y: (canvas.height / 2) - this.height,
      z: z
    }),
    new Point({
      x: (canvas.width / 2) + this.width,
      y: (canvas.height / 2) + this.height,
      z: z
    }),
    new Point({
      x: (canvas.width / 2) - this.width,
      y: (canvas.height / 2) + this.height,
      z: z
    })
  ];
  this.dist = 0;
}

Square.prototype.update = function() {
  for (var p = 0; p < this.points.length; p++) {
    this.points[p].rotateZ(0.001);
    this.points[p].z -= 3;
    if (this.points[p].z < -300) {
      this.points[p].z = 2700;
    }
    this.points[p].map2D();
  }
}

Square.prototype.render = function() {
  ctx.beginPath();
  ctx.moveTo(this.points[0].xPos, this.points[0].yPos);
  for (var p = 1; p < this.points.length; p++) {
    if (this.points[p].z > -(focal - 50)) {
      ctx.lineTo(this.points[p].xPos, this.points[p].yPos);
    }
  }

  ctx.closePath();
  ctx.stroke();

  this.dist = this.points[this.points.length - 1].z;

};

function Point(pos) {
  this.x = pos.x - canvas.width / 2 || 0;
  this.y = pos.y - canvas.height / 2 || 0;
  this.z = pos.z || 0;

  this.cX = 0;
  this.cY = 0;
  this.cZ = 0;

  this.xPos = 0;
  this.yPos = 0;
  this.map2D();
}

Point.prototype.rotateZ = function(angleZ) {
  var cosZ = Math.cos(angleZ),
    sinZ = Math.sin(angleZ),
    x1 = this.x * cosZ - this.y * sinZ,
    y1 = this.y * cosZ + this.x * sinZ;

  this.x = x1;
  this.y = y1;
}

Point.prototype.map2D = function() {
  var scaleX = focal / (focal + this.z + this.cZ),
    scaleY = focal / (focal + this.z + this.cZ);

  this.xPos = vpx + (this.cX + this.x) * scaleX;
  this.yPos = vpy + (this.cY + this.y) * scaleY;
};

// Init graphics stuff
var squares = [],
  focal = canvas.width / 2,
  vpx = canvas.width / 2,
  vpy = canvas.height / 2,
  barVals = [],
  sineVal = 0;

for (var i = 0; i < 15; i++) {
  squares.push(new Square(-300 + (i * 200)));
}

//ctx.lineWidth = 2;
ctx.strokeStyle = ctxBars.strokeStyle = ctxBars.fillStyle = '#00FF00';

/* fake console stuff */
var commandStart = ['Performing DNS Lookups for',
    'Searching ',
    'Analyzing ',
    'Estimating Approximate Location of ',
    'Compressing ',
    'Requesting Authorization From : ',
    'wget -a -t ',
    'tar -xzf ',
    'Entering Location ',
    'Compilation Started of ',
    'Downloading '
  ],
  commandParts = ['Data Structure',
    'http://wwjd.com?au&2',
    'Texture',
    'TPS Reports',
    ' .... Searching ... ',
    'http://zanb.se/?23&88&far=2',
    'http://ab.ret45-33/?timing=1ww'
  ],
  commandResponses = ['Authorizing ',
    'Authorized...',
    'Access Granted..',
    'Going Deeper....',
    'Compression Complete.',
    'Compilation of Data Structures Complete..',
    'Entering Security Console...',
    'Encryption Unsuccesful Attempting Retry...',
    'Waiting for response...',
    '....Searching...',
    'Calculating Space Requirements '
  ],
  isProcessing = false,
  processTime = 0,
  lastProcess = 0;


function render() {
  ctx.clearRect(0, 0, canvas.width, canvas.height);

  squares.sort(function(a, b) {
    return b.dist - a.dist;
  });
  for (var i = 0, len = squares.length; i < len; i++) {
    squares[i].update();
    squares[i].render();
  }

  ctxBars.clearRect(0, 0, canvasBars.width, canvasBars.height);

  ctxBars.beginPath();
  var y = canvasBars.height / 6;
  ctxBars.moveTo(0, y);

  for (i = 0; i < canvasBars.width; i++) {
    var ran = (Math.random() * 20) - 10;
    if (Math.random() > 0.98) {
      ran = (Math.random() * 50) - 25
    }
    ctxBars.lineTo(i, y + ran);
  }

  ctxBars.stroke();

  for (i = 0; i < canvasBars.width; i += 20) {
    if (!barVals[i]) {
      barVals[i] = {
        val: Math.random() * (canvasBars.height / 2),
        freq: 0.1,
        sineVal: Math.random() * 100
      };
    }

    barVals[i].sineVal += barVals[i].freq;
    barVals[i].val += Math.sin(barVals[i].sineVal * Math.PI / 2) * 5;
    ctxBars.fillRect(i + 5, canvasBars.height, 15, -barVals[i].val);
  }

  requestAnimationFrame(render);
}

function consoleOutput() {
  var textEl = document.createElement('p');

  if (isProcessing) {
    textEl = document.createElement('span');
    textEl.textContent += Math.random() + " ";
    if (Date.now() > lastProcess + processTime) {
      isProcessing = false;
    }
  } else {
    var commandType = ~~(Math.random() * 4);
    switch (commandType) {
      case 0:
        textEl.textContent = commandStart[~~(Math.random() * commandStart.length)] + commandParts[~~(Math.random() * commandParts.length)];
        break;
      case 3:
        isProcessing = true;
        processTime = ~~(Math.random() * 5000);
        lastProcess = Date.now();
      default:
        textEl.textContent = commandResponses[~~(Math.random() * commandResponses.length)];
        break;
    }
  }

  outputConsole.scrollTop = outputConsole.scrollHeight;
  outputConsole.appendChild(textEl);

  if (outputConsole.scrollHeight > window.innerHeight) {
    var removeNodes = outputConsole.querySelectorAll('*');
    for (var n = 0; n < ~~(removeNodes.length / 3); n++) {
      outputConsole.removeChild(removeNodes[n]);
    }
  }

  setTimeout(consoleOutput, ~~(Math.random() * 200));
}

render();
consoleOutput();

window.addEventListener('resize', function() {
  canvas.width = (window.innerWidth / 3) * 2;
  canvas.height = window.innerHeight / 3;

  canvasBars.width = window.innerWidth / 3;
  canvasBars.height = canvas.height;

  outputConsole.style.height = (window.innerHeight / 3) * 2 + 'px';
  outputConsole.style.top = window.innerHeight / 3 + 'px';

  focal = canvas.width / 2;
  vpx = canvas.width / 2;
  vpy = canvas.height / 2;
  ctx.strokeStyle = ctxBars.strokeStyle = ctxBars.fillStyle = '#00FF00';
});
@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 400;
  src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(http://themes.googleusercontent.com/static/fonts/sourcecodepro/v4/mrl8jkM18OlOQN8JLgasDxM0YzuT7MdOe03otPbuUS0.woff) format('woff');
}
body {
  font-family: 'Source Code Pro';
  background: #000;
  color: #00FF00;
  margin: 0;
  font-size: 13px;
}
canvas {
  position: absolute;
  top: 0;
  left: 0;
}
.bars-and-stuff {
  left: 66.6%;
}
.output-console {
  position: fixed;
  overflow: hidden;
}
p {
  margin: 0
}
<canvas class='hacker-3d-shiz'></canvas>
<canvas class='bars-and-stuff'></canvas>
<div class="output-console"></div>

Loktar

Posted 2014-06-07T00:47:00.650

Reputation: 2 614

2"I wonder if this would survive some examination by a tech guy" .hacker-3d-shiz ... .bars-and-stuff lol – BadHorsie – 2015-03-30T17:21:42.583

1I get ERR_CONNECTION_REFUSED for guihacker.com – Adam Jensen – 2015-04-11T12:33:39.027

1@AdamJensen bleh yeah the site was on my colo server which sort of died Ill try getting it back up in the next day or so. – Loktar – 2015-04-11T20:06:53.867

1I read through all the comments and then checked out the link and it was better than I had expected. +1 for exceeding my expectations – SirParselot – 2015-07-30T12:43:59.833

47The painting/maintenance guys realized that i'm a programmer and not just some guy listening to music!! I wonder if this would survive some examination by a tech guy :P – sabithpocker – 2014-06-07T06:34:01.900

17I want it as my new screensaver!! In fact, how would you do that in ubuntu? – None – 2014-06-07T19:36:01.527

5Not quite sure actually, lol i've had it running on my third monitor in fullscreen mode all day. – Loktar – 2014-06-07T20:45:25.270

5The best part is the bars bouncing up and down; it's clear they don't represent any real data! – qwr – 2014-06-08T19:06:51.643

4Why the graphics too? Wouldn't having the console alone make it look more believable?? – None – 2014-06-09T04:33:37.740

4Hollywood-style might fool the average person, but not the average techie (even cursory): green text (unless that's what you have your terminal/command line set to) is not normal, and the visualizations don't make much sense. – Tim S. – 2014-06-09T15:08:26.817

@TimS. lol I agree, maybe Ill add some customization options to it (color, removing or adding the graphic outputs ect.) regardless it would be hard to fool a tech person with it, I could definitely fool my mother in law though. – Loktar – 2014-06-09T15:21:36.480

33I sat in the Toronto Public Library with this open and I noticed people behind me looking at my screen. This looks pretty 'scary' to a nontech guy. Can you can make guihacker.com allow us 2 change the title of the page to whatever we'd like, and if we can add in our own lines which will appear in the green text? I was thinking about making the title of the page 'Toronto Public Library Internet Access' and making the green lines say 'Accessing Toronto Public Library Security Database..' 'Accessing usernames and passwords...' 'Access Granted..' This may get me in some trouble but it will be fun. – user2719875 – 2014-06-09T20:39:20.077

1@user2719875 haha yeah for sure, Im going to put it on github tonight as well. Thats hilarious. Something else to do is put it in fullscreen mode (F11) then you wont see the page title anymore – Loktar – 2014-06-09T21:39:27.317

2

I just created a jsfiddle for this. Pretty neat stuff! http://jsfiddle.net/XR393/

– harsimranb – 2014-06-10T04:23:21.110

@Pathachiever11 I have it on codepen as well http://codepen.io/loktar00/details/jbCzt/

– Loktar – 2014-06-10T04:25:57.047

2'Performing DNS Lookups for' needs a space at the end of the string. I like it a lot :) – Timtech – 2014-06-10T13:23:45.003

@Lembik If you can port it to an SWF file I think you can do it – Cruncher – 2014-06-10T15:00:09.830

@Cruncher you could probably use node-webkit as well actually... might give that a shot today. – Loktar – 2014-06-10T15:41:02.960

@Loktar please let me know if you get success! – Cruncher – 2014-06-10T15:42:11.867

3It needs some bleeping sounds when you hit keys. – marczellm – 2014-06-10T16:34:17.877

2@marczellm no, it needs those completely meaningless bleeping noises whenever it prints a line, like it would have if it were in any TV show (e.g. CSI or 24). – Jwosty – 2014-06-10T18:18:44.703

37Had this running for all of 30 seconds before my fellow developers came over to ask what I was hacking into. I think that counts as a success, so +1 – MrTheWalrus – 2014-06-10T20:43:36.977

1You should add fake wget and nmap output! People might actually recognize them from movies, and the commands can be 'confirmed' with real output... – millinon – 2014-06-10T23:28:51.000

10"TPS Reports"...brilliant. – Dennis – 2014-06-11T00:11:07.640

1

If you want something that looks a little like this, but actually does stuff, try cracking a WPA2 WiFi password with aircrack-ng. Here is a picture (OK. It doesn't look much like it at all... =P)

– daviewales – 2014-06-11T07:56:05.553

2@daviewales: prolly not a good thing to be doing at the office... – Jake Sellers – 2014-06-11T15:38:16.980

1What if you work as a security tester? – daviewales – 2014-06-11T16:11:43.383

1then you're not faking it! :) – Jake Sellers – 2014-06-11T16:22:26.520

please, post a jsfiddle! – Tomas – 2014-06-11T21:48:22.073

@Tomas lol this comment thread is so long but there is a fiddle a pen and a github repo also edited the question and added links.

– Loktar – 2014-06-11T22:12:50.397

1great, very beautiful and hilarious! :-) +1 – Tomas – 2014-06-11T22:34:00.610

1it would be awesome to ask for permission/password every x minutes so even though you don't work and want to make it look like you do, though, you even enter something very strange once in a while! – rwenz3l – 2014-06-12T11:43:42.883

Holy Bullshit Bytes, Batman! Yes, I think this is how Joe Public imagines hacking. – Mark Micallef – 2014-06-13T05:19:27.300

I just signed up to let you know that this is awesome. I tried a version without the graphics and it looked even more intriguing. I agree with @YoshiBotX on some input once in a while to make it appear even more real :) – asprin – 2014-06-13T07:16:12.717

6

Done some modifications, had this running all day at work! http://danj.eu/hack

– Daniel Johnson – 2014-06-13T10:12:49.493

7Nice one! :) - But what's with all those floating point numbers?! Serious hackers always have their screen full of hexadecimal numbers, if not binary! ;-) I'm expecting to see this thing in a Hollywood movie, where it seems they're always in need for "seriously technical" looking hacker screens! – JimmyB – 2014-06-16T09:23:50.443

haha good point I should have had it spit out hex. – Loktar – 2014-06-16T13:37:44.560

For me it just throws an error: ReferenceError: requestAnimationFrame is not defined -> requestAnimationFrame(render); – Vince – 2014-06-24T12:41:28.170

1@Vince must not be using a modern browser? – Loktar – 2014-06-24T14:13:03.773

@Loktar I'm using Firefox 17.0.7 Nightly (unfortunately our sysadmins wont allow updates on that...) – Vince – 2014-06-25T06:00:22.073

5

I made another variation of this fiddle, with HEX and randomly generating IPs and MAC addresses. If you want to take a look at it, http://jsfiddle.net/KazWolfe/ugNeh/

– Kaz Wolfe – 2014-07-08T17:33:15.450

2This made my day, it is so funny! – abnry – 2014-07-14T02:20:01.397

111

Bash / coreutils

Introducing the first ever... compilation emulator. With this program, you can have epic office chair sword battles any time you like, without even writing any code!

#!/bin/bash
collect()
{
    while read line;do
        if [ -d "$line" ];then
            (for i in "$line"/*;do echo $i;done)|sort -R|collect
            echo $line
        elif [[ "$line" == *".h" ]];then
            echo $line
        fi
    done
}

sse="$(awk '/flags/{print;exit}' </proc/cpuinfo|grep -o 'sse\S*'|sed 's/^/-m/'|xargs)"

flags=""
pd="\\"

while true;do
    collect <<< /usr/include|cut -d/ -f4-|
    (
        while read line;do
            if [ "$(dirname "$line")" != "$pd" ];then
                x=$((RANDOM%8-3))
                if [[ "$x" != "-"* ]];then
                    ssef="$(sed 's/\( *\S\S*\)\{'"$x,$x"'\}$//' <<< "$sse")"
                fi
                pd="$(dirname "$line")"
                opt="-O$((RANDOM%4))"
                if [[ "$((RANDOM%2))" == 0 ]];then
                    pipe=-pipe
                fi
                case $((RANDOM%4)) in
                    0) arch=-m32;;
                    1) arch="";;
                    *) arch=-m64;;
                esac
                if [[ "$((RANDOM%3))" == 0 ]];then
                    gnu="-D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L "
                fi
                flags="gcc -w $(xargs -n1 <<< "opt pipe gnu ssef arch"|sort -R|(while read line;do eval echo \$$line;done))"
            fi
            if [ -d "/usr/include/$line" ];then
                echo $flags -shared $(for i in /usr/include/$line/*.h;do cut -d/ -f4- <<< "$i"|sed 's/h$/o/';done) -o "$line"".so"
                sleep $((RANDOM%2+1))
            else
                line=$(sed 's/h$//' <<< "$line")
                echo $flags -c $line"c" -o $line"o"
                sleep 0.$((RANDOM%4))
            fi
        done
    )
done

It uses data from /usr/include to create a realistic-looking compilation log. I was too lazy to throw random warnings in, so there's just a -w flag.

Random sample:

gcc -w -m64 -pipe -msse -msse2 -msse3 -O1 -c libiptc/xtcshared.c -o libiptc/xtcshared.o
gcc -w -m64 -pipe -msse -msse2 -msse3 -O1 -c libiptc/libip6tc.c -o libiptc/libip6tc.o
gcc -w -m64 -pipe -msse -msse2 -msse3 -O1 -c libiptc/libxtc.c -o libiptc/libxtc.o
gcc -w -m64 -pipe -msse -msse2 -msse3 -O1 -c libiptc/ipt_kernel_headers.c -o libiptc/ipt_kernel_headers.o
gcc -w -m64 -pipe -msse -msse2 -msse3 -O1 -c libiptc/libiptc.c -o libiptc/libiptc.o
gcc -w -O2 -m64 -pipe -msse -msse2 -msse3 -msse4_1 -msse4_2 -shared libiptc/ipt_kernel_headers.o libiptc/libip6tc.o libiptc/libiptc.o libiptc/libxtc.o libiptc/xtcshared.o -o libiptc.so
gcc -w -m64 -pipe -O0 -msse -msse2 -msse3 -msse4_1 -c e2p/e2p.c -o e2p/e2p.o
gcc -w -msse -msse2 -msse3 -msse4_1 -m64 -pipe -O1 -shared e2p/e2p.o -o e2p.so
gcc -w -pipe -O0 -msse -msse2 -m64 -c spice-client-gtk-2.0/spice-widget-enums.c -o spice-client-gtk-2.0/spice-widget-enums.o
gcc -w -pipe -O0 -msse -msse2 -m64 -c spice-client-gtk-2.0/spice-grabsequence.c -o spice-client-gtk-2.0/spice-grabsequence.o
gcc -w -pipe -O0 -msse -msse2 -m64 -c spice-client-gtk-2.0/spice-gtk-session.c -o spice-client-gtk-2.0/spice-gtk-session.o
gcc -w -pipe -O0 -msse -msse2 -m64 -c spice-client-gtk-2.0/spice-widget.c -o spice-client-gtk-2.0/spice-widget.o
gcc -w -pipe -O0 -msse -msse2 -m64 -c spice-client-gtk-2.0/usb-device-widget.c -o spice-client-gtk-2.0/usb-device-widget.o
gcc -w -pipe -m64 -msse -msse2 -O1 -shared spice-client-gtk-2.0/spice-grabsequence.o spice-client-gtk-2.0/spice-gtk-session.o spice-client-gtk-2.0/spice-widget-enums.o spice-client-gtk-2.0/spice-widget.o spice-client-gtk-2.0/usb-device-widget.o -o spice-client-gtk-2.0.so
gcc -w -pipe -m64 -msse -msse2 -O1 -c search.c -o search.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/path.c -o cairomm-1.0/cairomm/path.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/scaledfont.c -o cairomm-1.0/cairomm/scaledfont.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/fontface.c -o cairomm-1.0/cairomm/fontface.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/quartz_font.c -o cairomm-1.0/cairomm/quartz_font.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/win32_font.c -o cairomm-1.0/cairomm/win32_font.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/refptr.c -o cairomm-1.0/cairomm/refptr.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/cairomm.c -o cairomm-1.0/cairomm/cairomm.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/context.c -o cairomm-1.0/cairomm/context.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/enums.c -o cairomm-1.0/cairomm/enums.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/win32_surface.c -o cairomm-1.0/cairomm/win32_surface.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/pattern.c -o cairomm-1.0/cairomm/pattern.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/types.c -o cairomm-1.0/cairomm/types.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/matrix.c -o cairomm-1.0/cairomm/matrix.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/quartz_surface.c -o cairomm-1.0/cairomm/quartz_surface.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/exception.c -o cairomm-1.0/cairomm/exception.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/device.c -o cairomm-1.0/cairomm/device.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/surface.c -o cairomm-1.0/cairomm/surface.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/xlib_surface.c -o cairomm-1.0/cairomm/xlib_surface.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/fontoptions.c -o cairomm-1.0/cairomm/fontoptions.o
gcc -w -O0 -pipe -m64 -msse -msse2 -msse3 -msse4_1 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -c cairomm-1.0/cairomm/region.c -o cairomm-1.0/cairomm/region.o
gcc -w -O0 -pipe -m64 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -msse -msse2 -msse3 -msse4_1 -shared cairomm-1.0/cairomm/cairomm.o cairomm-1.0/cairomm/context.o cairomm-1.0/cairomm/device.o cairomm-1.0/cairomm/enums.o cairomm-1.0/cairomm/exception.o cairomm-1.0/cairomm/fontface.o cairomm-1.0/cairomm/fontoptions.o cairomm-1.0/cairomm/matrix.o cairomm-1.0/cairomm/path.o cairomm-1.0/cairomm/pattern.o cairomm-1.0/cairomm/quartz_font.o cairomm-1.0/cairomm/quartz_surface.o cairomm-1.0/cairomm/refptr.o cairomm-1.0/cairomm/region.o cairomm-1.0/cairomm/scaledfont.o cairomm-1.0/cairomm/surface.o cairomm-1.0/cairomm/types.o cairomm-1.0/cairomm/win32_font.o cairomm-1.0/cairomm/win32_surface.o cairomm-1.0/cairomm/xlib_surface.o -o cairomm-1.0/cairomm.so
gcc -w -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -m64 -msse -O1 -pipe -shared cairomm-1.0/*.o -o cairomm-1.0.so
gcc -w -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -m64 -msse -O1 -pipe -c ulockmgr.c -o ulockmgr.o
gcc -w -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -m64 -msse -O1 -pipe -c gshadow.c -o gshadow.o
gcc -w -O2 -msse -msse2 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -m64 -pipe -c dpkg/string.c -o dpkg/string.o
gcc -w -O2 -msse -msse2 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -m64 -pipe -c dpkg/fdio.c -o dpkg/fdio.o
gcc -w -O2 -msse -msse2 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -m64 -pipe -c dpkg/namevalue.c -o dpkg/namevalue.o
gcc -w -O2 -msse -msse2 -D_GNU_SOURCE=1 -D_REENTRANT -D_POSIX_C_SOURCE=200112L -m64 -pipe -c dpkg/macros.c -o dpkg/macros.o

mniip

Posted 2014-06-07T00:47:00.650

Reputation: 9 446

Upvote exclusively for the "epic office chair sword battles" – SuperJedi224 – 2015-07-28T22:10:19.270

you could read from /dev/random for hard drive spinning i suppose – Vartan – 2015-07-30T21:31:42.603

1@Vartan That how would that do anything with the harddrive? – mniip – 2015-07-30T23:05:23.180

1D'oh, wow there's a brainfart. Thanks for putting me in my place! system logs then. but no big deal, this is a cool program without the harddrive spinning – Vartan – 2015-07-31T14:11:49.677

4Not bad at all! Something doesn't feel quite right about this (is it that the HD keeps completely quiet?) but to the unknowing viewer it's very unlikely to raise suspicions. Although... what, it's compiling libdrm? And sys/wait.o?? What the... – ceased to turn counterclockwis – 2014-06-08T21:37:30.440

27@leftaroundabout Say that you have an SSD. – mniip – 2014-06-08T22:11:49.790

36To make it more authentic you should output fake compiler warnings several times per gcc line. :) – monocell – 2014-06-10T09:07:17.930

3You could probably use pkg-config to come up with more realistic fake gcc flags. – Brendan Long – 2014-06-10T19:10:41.907

1@leftaroundabout For the quiet HD, you could use yes > /dev/null & ./foo.sh to churn some cycles! – wchargin – 2014-06-11T03:08:48.193

3@WChargin that would not activate the HD. – Thorbjørn Ravn Andersen – 2014-06-12T13:41:38.363

1The only problem with this is that it doesn't throw the occasional warning. – Michael Hampton – 2014-06-12T22:12:36.587

@Thorbjørn true, but it would spin up the CPU at least. – wchargin – 2014-06-13T06:16:27.470

1When I read HD, I always think of High Definition. ಠ_ಠ – nyuszika7h – 2014-06-13T21:37:02.337

2@leftaroundabout: You're compiling remotely logged into another computer, of course. – celtschk – 2014-06-15T14:19:26.027

106

Bash

Infinitely displays random hexadecimal values, with some of them highlighted to make it feel like you are performing a complicated search in raw data.

while true; do head -c200 /dev/urandom | od -An -w50 -x | grep -E --color "([[:alpha:]][[:digit:]]){2}"; sleep 0.5; done

enter image description here

barjak

Posted 2014-06-07T00:47:00.650

Reputation: 1 311

This should be turned into a cloud-jumper clone, but with colored hexadecimal values instead of clouds... – mbomb007 – 2015-07-28T20:11:29.460

1Echoing @undergroundmonorail in that random is better. It can be simplified a bit too, perhaps to while sleep 0.$((RANDOM%7+3)); do head -c200 /dev/urandom | od -An -w50 -x | grep -E --color "([a-f][0-9]){2}"; done (This sleeps 0.3-0.9 seconds each time.) – Adam Katz – 2015-08-15T07:25:28.790

6Oooh, I like this one! – SomeKittens – 2014-06-09T21:41:26.873

4(Bear with me, new to bash) but when running this line, (mac osx, terminal) I get this output on a loop: od: illegal option -- w usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...] – Sterling Archer – 2014-06-09T21:55:00.000

2It seems that your version of od does not support the -w option. You can drop this option, it's here just to show more columns of data, to fill the screen a bit more. – barjak – 2014-06-09T23:45:47.953

I used up all my votes for today, but here's a beer :D – MadTux – 2014-06-10T15:56:50.900

8Personally, I prefer this with sleep 0.5 changed to sleep.$[$RANDOM % 10]. It makes it a bit jerkier, and more like a real search. I do like it, though! – undergroundmonorail – 2014-06-10T17:38:53.153

4Reminds me of the never ending search for "ca fe": cat /dev/random | hexdump | grep "ca fe" – daviewales – 2014-06-11T08:00:22.453

very nice and relaxing! – ojblass – 2014-06-11T20:43:24.353

2The deep secrets of the universe are being revealed with this simple program... – qwr – 2014-06-14T00:33:31.963

2In OS X, I used od -An -N 191 -x – Ming-Tang – 2014-06-14T23:05:21.747

102

A very long build:

emerge openoffice

John

Posted 2014-06-07T00:47:00.650

Reputation: 1 121

@John Nicely Golfed – PyRulez – 2015-04-11T17:44:55.927

3On .deb systems like Ubuntu and Mint, you want sudo apt-get build-dep libreoffice; apt-get source libreoffice; cd libreoffice*; while :; do nice dpkg-buildpackage -rfakeroot; done (You will have to babysit it on its first run, at least until the real compilation starts. Subsequent runs only need the while loop.) – Adam Katz – 2015-08-15T07:39:36.987

@AkiraYamamoto if an error occurs during compilation, file a bug report against the compile process and/or fix it. – Sparr – 2016-04-12T17:48:18.027

48;_;​​​​​​​​​​​​ – mniip – 2014-06-07T08:26:05.320

3Longer than Chromium? – nyuszika7h – 2014-06-07T09:05:05.657

2http://www.boost.org/doc/libs/1_55_0/more/getting_started/unix-variants.html will take a while – Vortico – 2014-06-09T20:53:25.690

6The problem with compiling a real project it that it will stop if an error occurs. Probably we should put this in an infinite loop. – Akira Yamamoto – 2014-06-11T15:03:11.263

3Do we have emerge in Linux Mint? – Akira Yamamoto – 2014-06-11T15:04:37.543

55

Ruby

This one will:

  1. Get a random code from this site. code review (for more readable, well written code)
  2. Make it look like you are typing this code.
require 'open-uri'
require 'nokogiri'
site = "http://codereview.stackexchange.com/"
system 'cls'
system("color 0a")
5.times do
    begin
        id = rand(1..6000)
        url = "#{site}/a/#{id}"
        page = Nokogiri::HTML(open(url))
        code = page.css('code')[0].text
    end until code
    
    code.each_char  do |char|
        print char
        sleep rand(10) / 30.0
    end
end

Here is this script based on a code taken from here:

require 'open-uri'
code = open("http://hackertyper.com/code.txt")
system 'cls'
system("color 0a")

code.each_char  do |char|
    print char
    sleep rand(10) / 30.0
 end

Here is how it looks: Code

Mohammad

Posted 2014-06-07T00:47:00.650

Reputation: 2 010

11What if the code that it gets is in Brainf**k , Golfscript or J. That will raise some suspicion. – user80551 – 2014-06-09T19:28:53.007

@user true, thats why I made the second program. – Mohammad – 2014-06-10T09:08:53.300

39Finally my carefully placed answers that add backdoors all around pay out – PlasmaHH – 2014-06-10T10:04:51.803

1Maybe stackoverflow would be better? – PyRulez – 2014-06-11T15:41:03.773

1@pyrulez stackoverflow contains lots of deleted posts so it might take a long time to fetch a code. Even though I could use codereview, people here don't like it and might even kill me. :) – Mohammad – 2014-06-11T17:42:51.797

3The typing speed of each one looks more realistic if I randomize the speed (and make it faster) by changing the sleep line to sleep rand(10).to_f / 30. – Rory O'Kane – 2014-06-12T06:24:53.087

@RoryO'Kane thanks I'll add that. – Mohammad – 2014-06-12T18:57:19.073

1But I still need to move my fingers when pretending to type! – Bergi – 2014-06-15T15:03:02.183

3I think using Code Review code on Code Golf is perfect. I've always thought of Code Golf as the evil twin of Code Review, and I love both... – trichoplax – 2014-07-25T11:52:28.860

52

Lets go with a simple bash script that makes you look hackerish by printing the contents of every file identified as text in /var/log/ line by line, with random delays to make it look like intensive things are happening. Depending on the files it hits, it can give some rather interesting output.

#/bin/bash
# this script helps you do hackerish stuff

if [ "$EUID" -ne 0 ]
then
  echo "Please run as root to be hackerish."
  exit
fi

# turn off globbing
set -f
# split on newlines only for for loops
IFS='
'
for log in $(find /var/log -type f); do
  # only use the log if it's a text file; we _will_ encounter some archived logs
  if [ `file $log | grep -e text | wc -l` -ne 0 ]
  then
    echo $log
    for line in $(cat $log); do
      echo $line
      # sleep for a random duration between 0 and 1/4 seconds to indicate hard hackerish work
      bc -l <<< $(bc <<< "$RANDOM % 10")" / 40" | xargs sleep
    done
  fi
done

Be sure your terminal theme looks hackerish. Here are some badass examples (no idea what any of this means, but it looks hackerish):

image image

Jwosty

Posted 2014-06-07T00:47:00.650

Reputation: 3 540

3Nicely done. Example screenshot is great – SomeKittens – 2014-06-09T23:52:30.120

37Are you aware that your private keys are on these screenshots? – Hubert OG – 2014-06-14T18:33:54.320

2@HubertOG No, I didn't see that. I'll just change my keys. – Jwosty – 2014-06-14T20:47:35.280

27Haha, gotcha! ;-) – Hubert OG – 2014-06-14T22:00:25.440

4(But seriously, I didn't read those screenshots so I don't know what's actually there.) – Hubert OG – 2014-06-14T22:00:54.907

3@HubertOG Wow, you almost gave me a heart attack... ;P I didn't see that anywhere so I thought i was going insane :O – Jwosty – 2014-06-14T22:09:11.520

49

Bash : The endless git commit

A problem with computers today is that they are quite fast, so even compilation tasks eventually finish. Also, given a script that runs for a long time you might argue that it's actually possible to continue to work on something else while the script runs.

To solve this we have the following program. Just learn to type 'y' or 'n' randomly every now and then.

Of course you need a git repo with some new content but assuming you occasionally do actual work that should not be a problem.

#!/bin/bash

while [ 1 ]; do
  git add -p
  git reset
done

monocell

Posted 2014-06-07T00:47:00.650

Reputation: 2 551

12I feel most severely disturbed by this CG entry... It's either +1 or -1, but I still don't know which one! – None – 2014-06-08T16:43:42.583

37

Bash

#!/bin/bash
function lazy {
    sudo apt-get update
    lazy
    }
lazy

This will just keep updating your repos. If some one notices, just say that you added a new repo for a new program, and you are testing different ones. It isn't really like faking a script, but a command.

NOTE: I do not condone being unproductive at work, but I do like experiments. Therefore I recommend this app to be used to be secretly productive.

PyRulez

Posted 2014-06-07T00:47:00.650

Reputation: 6 779

1Some shells (not bash?) may not be so tail-recursion-friendly. This should be equivalent: while :; do sudo apt-get update; done. Also, @Caleb has a point (unless you have a local caching proxy). – Adam Katz – 2015-08-15T07:28:27.703

5Good, but watch out for that recursive function. – Digital Trauma – 2014-06-07T04:34:00.323

1looks like fork bomb!! – Avinash R – 2014-06-08T20:14:25.117

2@AvinashR Not quite, no fork. – PyRulez – 2014-06-08T21:13:42.097

@PyRulez ok, not forked into background. got it. – Avinash R – 2014-06-08T21:17:05.770

43Mirror hosts hate you now. – Caleb – 2014-06-12T05:38:55.410

9"Not quite, no fork." So you say, only bomb? :-) – celtschk – 2014-06-15T14:25:07.903

28

C++ Neural Network

EDIT

Sadly I optimized this code:( made it 2000x faster... The legacy code is still perfect for wasting time though!

Original

I actually started a project in convolutional neural networks perfect for this! The source code and documentation is on github. The first step is to create a new network.

std::vector<int> numNeurons = { 500, 500, 2000, 10 };
std::vector<int> numMaps = { 1, 1, 1, 1 };

ConvolutionalNeuralNetwork neuralNetwork(numNeurons, numMaps, numNeurons, 
    std::vector<std::vector<int>>(), std::vector<std::vector<int>>());

Now that we have a network with 300 neurons and 1,250,000 synapses, lets save it to a file to make sure we don't lose any progress we make with the network.

neuralNetwork.SaveToFile("test2.cnn");

That generated a 68MB text file and more than a few hours of relaxed work. Now, let's have some fun doing things with it! I'll create a random input and start to discriminate it.

std::vector<std::vector<float>> input;
for (int i = 0; i < 2; ++i)
    input.push_back(std::vector<float>{});

for (int i = 0; i < 2; ++i)
    for (int j = 0; j < 3; ++j)
        input[i].push_back(rand() % 100);
neuralNetwork.SetInput(input);

That was a pretty small input for an image, but we're only proving the network can do something. Next step is to discriminate with it!

Layer output = neuralNetwork.Discriminate();

This hasn't even finished yet for me, and it's been running for over 2 days! Then once we get that output, let's run it through again in reverse just for fun.

Layer generatedOutput = neuralNetwork.Generate(output);

This is all just to prove that the API works, no plans for it yet. This step hasn't been run for me yet, and I've been waiting a while. Good 2+ days burned, and that is a rough estimate off my current testing. This is pretty complicated, and you'll work hard for a day or two making it, but after that you may never have to work again!

Note: If you never, ever wanna work again, try to train the network

neuralNetwork.LearnCurrentInput();

I don't even have the time to waste for this one!

If you want to show off all the data that's happening, add some calls in the functions just to display what's happening

New constructor

ConvolutionalNeuralNetwork::ConvolutionalNeuralNetwork(std::vector<int> neuronCountPerLayer, std::vector<int> featureMapsPerLayer, std::vector<int> featureMapDimensions, std::vector<std::vector<int>> featureMapConnections, std::vector<std::vector<int>> featureMapStartIndex)
{
std::map<SimpleNeuron, std::vector<Synapse>> childrenOf;
for (unsigned int i = 0; i < neuronCountPerLayer.size() - 1; ++i)
{
    Layer currentLayer;

    for (int j = 0; j < neuronCountPerLayer[i]; ++j)
    {
        std::vector<Synapse> parentOf;

        if (featureMapsPerLayer[i] == 1)
        {
            for (int n = 0; n < neuronCountPerLayer[i + 1]; ++n)
            {
                std::cout << "Adding new synapse, data: " << std::endl;

                SimpleNeuron current = SimpleNeuron(i + 1, j + 1);
                SimpleNeuron destination = SimpleNeuron(i + 2, n + 1);

                std::cout << "Origin: " << i + 1 << ", " << j + 1 << "; Destination: " << i + 2 << ", " << n + 1 << std::endl;

                Synapse currentParentSynapse = Synapse(current, current);
                Synapse currentChildSynapse = Synapse(destination, destination);

                currentChildSynapse.SetWeightDiscriminate(currentParentSynapse.GetWeightDiscriminate());
                currentChildSynapse.SetWeightGenerative(currentParentSynapse.GetWeightGenerative());

                std::cout << "Weights: Discriminative: " << currentChildSynapse.GetWeightDiscriminate() << "; Generative: " << currentChildSynapse.GetWeightGenerative() << std::endl;

                parentOf.push_back(currentParentSynapse);

                if (childrenOf.find(destination) != childrenOf.end())
                    childrenOf.at(destination).push_back(currentChildSynapse);
                else
                    childrenOf.insert(std::pair<SimpleNeuron, std::vector<Synapse>>(destination,
                    std::vector<Synapse>{ currentChildSynapse }));
            }
        }

        else
        {
            int featureMapsUp = featureMapsPerLayer[i + 1];
            int inFeatureMap = featureMapsPerLayer[i] / j;
            int connections = featureMapConnections[i][inFeatureMap];
            int startIndex = (neuronCountPerLayer[i + 1] / featureMapsUp) * featureMapStartIndex[i][inFeatureMap];
            int destinationIndex = startIndex + (neuronCountPerLayer[i + 1] / featureMapsUp) * connections;

            for (int n = startIndex; n < destinationIndex; ++n)
            {
                SimpleNeuron current = SimpleNeuron(i + 1, j + 1);
                SimpleNeuron destination = SimpleNeuron(i + 2, n + 1);

                std::cout << "Origin: " << i + 1 << ", " << j + 1 << "; Destination: " << i + 2 << ", " << n + 1 << std::endl;

                Synapse currentParentSynapse = Synapse(current, current);
                Synapse currentChildSynapse = Synapse(destination, destination);

                currentChildSynapse.SetWeightDiscriminate(currentParentSynapse.GetWeightDiscriminate());
                currentChildSynapse.SetWeightGenerative(currentParentSynapse.GetWeightGenerative());

                std::cout << "Weights: Discriminative: " << currentChildSynapse.GetWeightDiscriminate() << "; Generative: " << currentChildSynapse.GetWeightGenerative() << std::endl;

                parentOf.push_back(currentParentSynapse);

                if (childrenOf.find(destination) != childrenOf.end())
                    childrenOf.at(destination).push_back(currentChildSynapse);
                else
                    childrenOf.insert(std::pair<SimpleNeuron, std::vector<Synapse>>(destination,
                    std::vector<Synapse>{ currentChildSynapse }));
            }
        }

        std::cout << "Adding neuron" << std::endl << std::endl;

        if (childrenOf.find(SimpleNeuron(i + 1, j + 1)) != childrenOf.end())
            currentLayer.AddNeuron(Neuron(parentOf, childrenOf.at(SimpleNeuron(i + 1, j + 1))));
        else
            currentLayer.AddNeuron(Neuron(parentOf, std::vector<Synapse>{}));
    }

    std::cout << "Adding layer" << std::endl << std::endl << std::endl;

    AddLayer(currentLayer);
}

Layer output;

std::cout << "Adding final layer" << std::endl;

for (int i = 0; i < neuronCountPerLayer[neuronCountPerLayer.size() - 1]; ++i)
    output.AddNeuron(Neuron(std::vector<Synapse>(), childrenOf.at(SimpleNeuron(neuronCountPerLayer.size(), i + 1))));
AddLayer(output);
}

New FireSynapse

float Neuron::FireSynapse()
{
float sum = 0.0f;

std::cout << "Firing Synapse!" << std::endl;

for (std::vector<Synapse>::iterator it = m_ChildOfSynapses.begin(); it != m_ChildOfSynapses.end(); ++it)
    sum += ((*it).GetWeightDiscriminate() * (*it).GetParent().GetValue());

std::cout << "Total sum: " << sum << std::endl;

float probability = (1 / (1 + pow(e, -sum)));

std::cout << "Probably of firing: " << probability << std::endl;

if (probability > 0.9f)
    return 1.0f;

else if (probability < 0.1f)
    return 0.0f;

else
{
    std::cout << "Using stochastic processing to determine firing" << std::endl;
    float random = ((rand() % 100) / 100);
    if (random <= probability)
        return 1.0f;
    else
        return 0.0f;
}
}

You will get plenty of output on your console now.

Liam McInroy

Posted 2014-06-07T00:47:00.650

Reputation: 381

1Hahahaha the initials spell "CNN" – Fund Monica's Lawsuit – 2016-04-12T18:48:20.087

4+1 for the real life context as well. Interesting :) – George – 2014-06-11T20:08:50.643

26

Python 3

#!/usr/bin/python3

import random
import time

first_level_dirs = ['main', 'home', 'usr', 'root', 'html', 'assets', 'files']
title_descs = ['page', 'script', 'interface', 'popup']
id_names = ['container', 'main', 'textbox', 'popup']
tag_names = ['div', 'textarea', 'span', 'strong', 'article', 'summary', 'blockquote', 'b']
autoclosing_tags = ['br', 'input']

def random_js_line():
    return random.choice([
        '      $("#%s").html("<b>" + $("#%s").text() + "</b>");' % (random.choice(id_names), random.choice(id_names)),
        '      $.get("t_%i.txt", function(resp) {\n        callback(resp);\n      });' % (int(random.random() * 50)),
        '      $("%s>%s").css({width: %i + "px", height: %i + "px"});' % (random.choice(tag_names), random.choice(tag_names), int(random.random() * 75), int(random.random() * 75)),
        '      for (var i = 0; i < count; i++) {\n        $("<div>").appendTo("#%s");\n      }' % (random.choice(id_names))
    ])

def random_js_lines():
    lines = [random_js_line() for _ in range(int(random.random() * 14) + 1)]
    return '\n'.join(lines)

def random_html_line():
    tag_name = random.choice(tag_names)
    return random.choice([
        '    <%s>id: %i</%s>' % (tag_name, int(random.random() * 1000), tag_name),
        '    <%s class="%s">\n      <%s/>\n    </%s>' % (tag_name, random.choice(first_level_dirs), random.choice(autoclosing_tags), tag_name),
        '    <div id="%s"></div>' % (random.choice(first_level_dirs))
    ])

def random_html_lines():
    lines = [random_html_line() for _ in range(int(random.random() * 9) + 1)]
    return '\n'.join(lines)

while True:
    print('creating /%s/%i.html' % (random.choice(first_level_dirs), int(random.random() * 1000)))
    time.sleep(random.random())
    lines = [
        '<!DOCTYPE html>',
        '<html lang="en">',
        '  <head>',
        '    <title>%s #%i</title>' % (random.choice(title_descs), int(random.random() * 100)),
        '    <script type="text/javascript" src="/js/assets/jquery.min.js"></script>',
        '    <script type="text/javascript">',
        random_js_lines(),
        '    </script>',
        '  </head>',
        '  <body>',
        random_html_lines(),
        '  </body>',
        '</html>'
    ]
    lines = [single_line for linegroup in lines for single_line in linegroup.split('\n')]
    for line in lines:
        print(line)
        time.sleep(random.random() / 10)
    print()
    time.sleep(random.random() / 2)

It outputs a bunch of lines of fake JS and HTML, with fake "loading" times (delays) to make it seem more realistic.

This can and will be expanded upon greatly! (the basic program is there; I just have to add more content now)


Here's a sample "page" it generates (this is actually from an old version of the code; I'll update it with the new code when I'm finished):

creating /assets/809.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>script #32</title>
    <script type="text/javascript" src="/js/assets/jquery.min.js"></script>
    <script type="text/javascript">
      $("#main").html("<b>" + $("#main").text() + "</b>");
      $("#textbox").html("<b>" + $("#container").text() + "</b>");
      $("#popup").html("<b>" + $("#textbox").text() + "</b>");
      $("#container").html("<b>" + $("#textbox").text() + "</b>");
      $.get("t_11.txt", function(resp) {
        callback(resp);
      });
      $("#main").html("<b>" + $("#textbox").text() + "</b>");
      $.get("t_14.txt", function(resp) {
        callback(resp);
      });
      $.get("t_1.txt", function(resp) {
        callback(resp);
      });
      $.get("t_34.txt", function(resp) {
        callback(resp);
      });
    </script>
  </head>
  <body>
    <span>id: 462</span>
    <textarea>id: 117</textarea>
  </body>
</html>

Doorknob

Posted 2014-06-07T00:47:00.650

Reputation: 69 200

3Awesome, can't wait to see what you add to it! – SomeKittens – 2014-06-07T06:11:09.593

heh yeah this one is pretty kick ass. My mind runs wild with cool things you could do with the generations – Loktar – 2014-06-07T06:36:31.013

Not just python3, 2.7 is ok too – Hannes Karppila – 2014-06-07T09:16:34.500

1Great job. Looks pretty realistic. – qwr – 2014-06-08T19:08:30.333

24

Node.js + BDD

Looks like an endless stream of BDD-style tests running. Nobody can blame you for running tests!

    "use strict"
var colors = require("colors"),
    features = ["User", "Request", "Response", "Cache", "Preference", "Token", "Profile", "Application", "Security"],
    patterns = ["Factory", "Observer", "Manager", "Repository", "Impl", "Dao", "Service", "Delegate", "Activity"],
    requirements = ["return HTTP 403 to unauthorized users",
                    "accept UTF-8 input",
                    "return HTTP 400 for invalid input",
                    "correctly escape SQL",
                    "validate redirects",
                    "provide online documentation",
                    "select internationalized strings, based on locale",
                    "support localized date formats",
                    "work in IE6",
                    "pass W3C validation",
                    "produce valid JSON",
                    "work with screen readers",
                    "use HTML5 canvas where available",
                    "blink"],
    minTimeout = 100,
    maxTimeout = 1000,
    minRequirements = 2,
    maxRequirements = 6,
    skipThreshold = 0.1,
    failThreshold = 0.2


function randBetween(l, u) {
  return Math.floor(Math.random() * (u - l) + l) 
}

function choose(l) {
  return l[randBetween(0, l.length)]
}

function timeout() {
  return randBetween(minTimeout, maxTimeout)
}

function printFeature() {
  console.log("")
  var feature = choose(features) + choose(patterns)
  var article = /^[AEIOU]/.test(feature) ? "An " : "A "
  console.log(article + feature + " should")
  setTimeout(function() {
    var reqs = randBetween(minRequirements, maxRequirements)
    printRequirements(reqs)
  }, timeout())
}

function printRequirements(i) {
  if (i > 0) {
    var skipFailOrPass = Math.random()
    if (skipFailOrPass < skipThreshold) {
      console.log(("- " + choose(requirements) + " (SKIPPED)").cyan)
    } else if (skipFailOrPass < failThreshold) {
      console.log(("x " + choose(requirements) + " (FAILED)").red)
      console.log(("  - Given I am on the " + choose(features) + " page").green)
      console.log(("  - When I click on the " + choose(features) + " link").green)
      console.log(("  x Then the Log Out link should be visible in the top right hand corner").red)
    } else {
      console.log(("+ " + choose(requirements)).green)
    }
    setTimeout(function() {printRequirements(i - 1)}, timeout())
  } else {
    printFeature()
  }
}

printFeature()

Update

It occurred to me that it would look suspicious if all your tests passed, so I've updated it to include some failing tests - complete with Given-When-Thens.

And yes, I know that all the failures have the same message. You really need to fix that logout link!

enter image description here

James_pic

Posted 2014-06-07T00:47:00.650

Reputation: 3 998

2Very clever, I get bonus points for ensuring that my code is tested! Cant be too careful – SomeKittens – 2014-06-10T16:53:43.937

23

C# (Windows)

I present to you, the brand new Memtest86 Simulator 2014! (Because running Memtest86 under Windows makes total sense)

Complete with working progress bars and pattern indicator!

This code extensively uses the Console class, which as far as I know, it's only available on Windows. Also, I couldn't find a way to show the real processor name/frequency and available memory, so those are hardcoded.

Screenshot: enter image description here

EDIT

To retrieve the processor information, you can use the Microsoft.Win32 namespace and RegistryKey class.

 // Processor information, add 'using Microsoft.Win32';
string processor = "";
RegistryKey processor_name = Registry.LocalMachine.OpenSubKey(@"Hardware\Description\System\CentralProcessor\0", RegistryKeyPermissionCheck.ReadSubTree);
        if (processor_name != null)
        {
            if (processor_name.GetValue("ProcessorNameString") != null)
            {
                processor = (string)processor_name.GetValue("ProcessorNameString");
            }
        }

Code (ugly, I know):

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

class MemTestSim
{
    static void Main(string[] args)
    {
        Random r = new Random();
        int seconds = 0;
        int pass = 0;
        int test = 0;
        int testNumber = 0;

        string[] testNames = { "Address test, own Adress", "Moving inversions, ones & zeros", "Moving inversions, 8 bit pattern" };
        string[] pattern = { "80808080", "7f7f7f7f", "40404040", "bfbfbfbf", "20202020", "dfdfdfdf", "10101010", "efefefef", "08080808", "f7f7f7f7", "8f8f8f8f" };

        // Trick to stop the console from scrolling
        Console.SetWindowSize(80, 40);

        Console.Title = "Memtest86+ v2.11";
        Console.CursorVisible = false;

        // Dark Blue Background Color
        Console.BackgroundColor = ConsoleColor.DarkBlue;
        Console.Clear();

        // Green Title Text
        Console.BackgroundColor = ConsoleColor.DarkGreen;
        Console.ForegroundColor = ConsoleColor.Black;
        Console.Write("      Memtest86+ v2.11     ");

        // Gray on Blue Text and main window structure
        Console.BackgroundColor = ConsoleColor.DarkBlue;
        Console.ForegroundColor = ConsoleColor.Gray;
        Console.Write("| Pass " + pass + "%\n");
        Console.WriteLine("Intel Core i5 2290 MHz     | Test ");
        Console.WriteLine("L1 Cache:  128K   1058MB/s | Test #" + testNumber + "  [" + testNames[0] + "]");
        Console.WriteLine("L2 Cache:  512K   1112MB/s | Testing:  132K - 8192M  8192M");
        Console.WriteLine("L3 Cache: 3072K   1034MB/s | Pattern: ");
        Console.WriteLine("Memory  : 8192M            |---------------------------------------------------");
        Console.WriteLine("Chipset :  Intel i440FX");
        Console.WriteLine();
        Console.WriteLine();
        Console.WriteLine(" WallTime   Cached  RsvdMem   MemMap   Cache  ECC  Test  Pass  Errors  ECC Errs");
        Console.WriteLine(" ---------  ------  -------  --------  -----  ---  ----  ----  ------  --------");
        Console.WriteLine("   0:00:26   8192M      64K  e820-Std    on   off   Std     0       0");

        // Bottom Bar
        Console.SetCursorPosition(0, 24);
        Console.BackgroundColor = ConsoleColor.Gray;
        Console.ForegroundColor = ConsoleColor.DarkBlue;
        Console.WriteLine("(ESC)Reboot  (c)configuration  (SP)scroll_lock  (CR)scroll_unlock               ");


        Console.SetWindowSize(80, 25);

        // Reset text color
        Console.BackgroundColor = ConsoleColor.DarkBlue;
        Console.ForegroundColor = ConsoleColor.Gray;

        // FOREVER
        while (true)
        {
            TimeSpan time = TimeSpan.FromSeconds(seconds);

            // Running Time (WallTime)
            Console.SetCursorPosition(3, 11);
            string min = (time.Minutes < 10 ? "0" + time.Minutes : "" + time.Minutes);
            string sec = (time.Seconds < 10 ? "0" + time.Seconds : "" + time.Seconds);
            Console.Write(time.Hours + ":" + min + ":" + sec);

            // Test percentage
            Console.SetCursorPosition(34, 1);
            Console.Write((int)test + "%");

            // Test Progress Bar
            Console.SetCursorPosition(38, 1);
            for (int i = 0; i < test / 3; i++)
                Console.Write("#");

            Console.SetCursorPosition(38, 0);
            for (int i = 0; i < pass / 3; i++)
                Console.Write("#");

            // Test Number
            Console.SetCursorPosition(35, 2);
            Console.Write(testNumber + "  [" + testNames[testNumber] + "]        ");

            if (testNumber != 0)
            {
                Console.SetCursorPosition(38, 4);
                Console.Write(pattern[test / 10]);
            }
            else
            {
                Console.SetCursorPosition(38, 4);
                Console.Write("         ");
            }

            if (test >= 100)
            {
                test = 0;

                Console.SetCursorPosition(34, 0);
                Console.Write(pass + "%");

                Console.SetCursorPosition(34, 1);
                Console.Write("                                      ");
                testNumber++;
                pass += 2;

                if (testNumber == 2)
                    testNumber = 0;
            }

            Thread.Sleep(1000);
            test += r.Next(0, 3);
            seconds++;
        }
    }
}

segfaultd

Posted 2014-06-07T00:47:00.650

Reputation: 1 219

7Why not just run Memtest86?

"I think I have some hardware problems here, I guess I'll just have to goof off until it's done" – MadTux – 2014-06-10T16:00:44.343

20@MadTux 'Cos you've gotta boot into Memtest, which means no cat pictures. – Schilcote – 2014-06-10T21:45:19.540

1System.Console Works on Mono, I think you just have to tune the code for arbitrary console window size – NothingsImpossible – 2014-06-10T23:33:15.827

@Schilcote I thought one could boot Memtest on the workstation, while fencing on chairs or looking at cat pictures on a laptop. – MadTux – 2014-06-11T07:21:52.180

8Couldn't you run Memtest86 in a VM? – Cole Johnson – 2014-06-12T00:21:17.477

3I LOVE the Memtest in a VM idea. – John – 2014-06-13T23:25:12.320

22

Python, 36 characters

print("Opening Internet Explorer...")

Python, 21 characters

print("Opening IE...")

Trying to be funny. :P

Mohammad Areeb Siddiqui

Posted 2014-06-07T00:47:00.650

Reputation: 509

8

You mean like http://cdn7.dottech.org/wp-content/uploads/2013/06/slow_internet_explorer_comic.jpg?c59e8d ?

– aditsu quit because SE is EVIL – 2014-06-12T21:37:03.833

^Exactly. :DDDD – Mohammad Areeb Siddiqui – 2014-06-12T22:10:35.430

14

AHK

You pretend to type while the script generates a bunch of accessors and mutators in JavaScript. Make sure an IDE (I tested this on Notepad++) is the active window.

Specify the list of variables and class name if you want. I just used what was already in window.location.

Press esc to exit.

Press 0 on your numberpad to pause when someone tries to talk to you.

Press ctrl+w (w stands for work) to start

^w::
    loop{
        variable_names  :=  "hash|host|hostname|href|origin|pathname|port|protocol|search"
        class_name  :=  "location"

        StringSplit, variable_names_array, variable_names, "|"

        loop, %variable_names_array0%{
            Random, delay, 80, 120
            SetKeyDelay, %delay%
            current :=  variable_names_array%a_index%
            Send, %class_name%.prototype.
            Random, r, 800, 1300
            Sleep, %r%
            Send, get_
            Random, r, 800, 1300
            Sleep, %r%
            Send, %current%
            Random, r, 800, 1300
            Sleep, %r%
            Send, {space}={space}
            Random, r, 800, 1300
            Sleep, %r%
            Send, function(){{}{enter}
            Random, r, 800, 1300
            Sleep, %r%
            Send, {tab}
            Random, r, 800, 1300
            Sleep, %r%
            Send, return this.
            Random, r, 800, 1300
            Sleep, %r%
            Send, %current%;{enter}
            Random, r, 800, 1300
            Sleep, %r%
            Send, {BackSpace}{}}
            Random, r, 800, 1300
            Sleep, %r%
            Send, {enter}{enter}
            Random, r, 800, 1300
            Sleep, %r%

            Send, %class_name%.prototype.
            Random, r, 800, 1300
            Sleep, %r%
            Send, set_
            Random, r, 800, 1300
            Sleep, %r%
            Send, %current%
            Random, r, 800, 1300
            Sleep, %r%
            Send, {space}={space}
            Random, r, 800, 1300
            Sleep, %r%
            Send, function(%current%){{}{enter}
            Random, r, 800, 1300
            Sleep, %r%
            Send, {tab}
            Random, r, 800, 1300
            Sleep, %r%
            Send, this.
            Random, r, 800, 1300
            Sleep, %r%
            Send, %current% ={space}
            Random, r, 800, 1300
            Sleep, %r%
            Send, %current%;{enter}
            Random, r, 800, 1300
            Sleep, %r%
            Send, return this;{enter}
            Random, r, 800, 1300
            Sleep, %r%
            Send, {BackSpace}{}}
            Random, r, 800, 1300
            Sleep, %r%
            Send, {enter}{enter}
            Random, r, 800, 1300
            Sleep, %r%
        }
    }
return

esc::
    ExitApp
    return

numpad0::
    Pause, toggle
    return

Meredith

Posted 2014-06-07T00:47:00.650

Reputation: 241

14

Bash

Dumps a random block of physical memory and looks at the contents. Going to need to be root for this. Only the first 1MB of memory is available by default. dd default block size is 512 bytes, that can be changed with option ibs=bytes but keep in mind the other option skip=$offset which picks a block at random. Output from dd is sent through tr to remove non ASCII characters; only unique results 2 characters or longer are evaluated.

Each string found is compared to a dictionary. If no matches are found, it attempts to decode as base64. Finally, all the strings evaluated are returned.

There are several other platform dependent options to be aware of, such as location of dictionary file (/usr/share/dict/words), whether sleep accepts floating point inputs, and if base64 is available.

Also, be aware that dd outputs stats on the operation performed to stderr, which is piped to /dev/null. If something were to go horribly wrong (you are accessing /dev/mem ...) the stderr output won't be visible.

Overall, not very useful, but I learned a bit about linux memory and writing this script turned out to be fun.

#!/bin/bash

offset=`expr $RANDOM % 512`
mem=`dd if=/dev/mem skip=$offset count=1 2>/dev/null| tr '[\000-\040]' '\n' | tr '[\177-\377'] '\n' | sort -u | grep '.\{2,\}'`

results=""

for line in $mem
do
    echo "Evaluating $line"
    greps=`grep "^$line" /usr/share/dict/words | head`

    if [ -n "$greps" ]
    then
        echo "Found matches."
        echo $greps
    else
        #echo "No matches in dictionary. Attempting to decode."
        decode=`echo "$line" | base64 -d 2>/dev/null`
        if [ $? -ne 1 ]
        then
            echo "Decode is good: $decode"
        #else
            #echo "Not a valid base64 encoded string."
        fi
    fi

    results+=" $line"

    # make it look like this takes a while to process
    sleep 0.5

done 

if (( ${#results} > 1 ))
then
    echo "Done processing input at block $offset: $results"
fi

Sometimes there's no interesting output (all zeroes). Sometimes there are only a few strings:

codegolf/work# ./s 
Evaluating @~
Evaluating 0~
Evaluating ne
Found matches.
ne nea neal neallotype neanic neanthropic neap neaped nearable nearabout
Done processing input at block 319:  @~ 0~ ne

Sometimes there is actually something human readable in memory (before I was logging block offset):

codegolf/work# ./s 
Evaluating grub_memset
Evaluating grub_millisleep
Evaluating grub_mm_base
Evaluating grub_modbase
Evaluating grub_named_list_find
Evaluating grub_net_open
Evaluating grub_net_poll_cards_idle
Evaluating grub_parser_cmdline_state
Evaluating grub_parser_split_cmdline
Evaluating grub_partition_get_name
Evaluating grub_partition_iterate
Evaluating grub_partition_map_list
Evaluating grub_partition_probe
Evaluating grub_pc_net_config
Evaluating grub_pit_wait
Evaluating grub_print_error
Evaluating grub_printf
Evaluating grub_printf_
Evaluating grub_puts_
Evaluating grub_pxe_call
Evaluating grub_real_dprintf
Evaluating grub_realidt
Evaluating grub_realloc
Evaluating grub_refresh
Evaluating grub_register_command_prio
Evaluating grub_register_variable_hook
Evaluating grub_snprintf
Evaluating grub_st
Evaluating grub_strchr
Evaluating _memmove
Done processing input:  grub_memset grub_millisleep grub_mm_base 
    grub_modbase grub_named_list_find grub_net_open grub_net_poll_cards_idle
    grub_parser_cmdline_state grub_parser_split_cmdline 
    grub_partition_get_name grub_partition_iterate grub_partition_map_list 
    grub_partition_probe grub_pc_net_config grub_pit_wait grub_print_error 
    grub_printf grub_printf_ grub_puts_ grub_pxe_call grub_real_dprintf 
    grub_realidt grub_realloc grub_refresh grub_register_command_prio 
    grub_register_variable_hook grub_snprintf grub_st grub_strchr _memmove

And one last sample run showing malformed grep input, dictionary hits, and a successful base64 decode (before logging block offset again):

codegolf/work# ./s 
Evaluating <!
Evaluating !(
Evaluating @)
Evaluating @@
Evaluating $;
Evaluating '0@
Evaluating `1
Evaluating 1P$#4
Evaluating )$2
Evaluating -3
Evaluating 3HA
Evaluating 3N
Evaluating @@9
Evaluating 9@
Evaluating 9Jh
Evaluating \9UK
grep: Invalid back reference
Evaluating a#
Evaluating CX
Evaluating ?F
Evaluating !H(
Evaluating +%I
Evaluating Io
Found matches.
Io Iodamoeba Ione Ioni Ionian Ionic Ionicism Ionicization Ionicize Ionidium
Evaluating Kj
Found matches.
Kjeldahl
Evaluating l#
Evaluating L6qh
Decode is good: /��
Evaluating O%
Evaluating OX
Evaluating PR
Evaluating .Q
Evaluating Q4!
Evaluating qQ
Evaluating )u
Evaluating Ua
Found matches.
Uaraycu Uarekena Uaupe
Evaluating $v
Evaluating )V
Evaluating V8
Evaluating V,B~
Evaluating wIH
Evaluating xU
Evaluating y@
Evaluating @z
Evaluating Z0
Evaluating zI
Evaluating Z@!QK
Done processing input:  <! !( @) @@ $; '0@ `1 1P$#4 )$2 -3 3HA 3N
    @@9 9@ 9Jh \9UK a# CX ?F !H( +%I Io Kj l# L6qh O% OX PR .Q Q4!
    qQ )u Ua $v )V V8 V,B~ wIH xU y@ @z Z0 zI Z@!QK

user21677

Posted 2014-06-07T00:47:00.650

Reputation:

This only ran for like 5 seconds the first time and printed like 12 lines, then like 0.1 seconds every subsequent time with no output. – Mike – 2015-08-13T23:54:57.043

How do you run this? I dumped it into script.sh, did a chmod +x on it, but it just exits. sudo doesn't help, either. – Octavia Togami – 2014-06-08T16:03:34.007

Sounds like the mem= line isn't returning anything. You'll have to check and make sure that each part of the command between pipes is actually returning something. – None – 2014-06-08T17:14:35.703

Okay, I'll do that. – Octavia Togami – 2014-06-09T01:49:18.883

13

Windows Batch

@echo off

set /p hax="How much haxx0rz: " %=%
set /p haxx="How quick haxx0rz (seconds): " %=%

FOR /L %%I IN (1, 1, %hax%) DO (
START cmd /k "COLOR A&&tree C:\"
timeout %haxx%
)

This is a joke script that I've kept with me for years to make it look like something out of a 90's hacker movie. I usually use it while remotely connected to a computer to freak people out.

Thebluefish

Posted 2014-06-07T00:47:00.650

Reputation: 230

2He's downloading a virus onto the whole system! – qwr – 2014-06-14T01:16:40.783

12

Bash

The never ending search for cafes.

I found this on the web a long time ago:

cat /dev/urandom | hexdump | grep "ca fe"

daviewales

Posted 2014-06-07T00:47:00.650

Reputation: 271

Try using urandom instead. – Alice Ryhl – 2014-06-11T09:48:53.463

Ah... I tested it on a Mac, and Macs have both random and urandom. – daviewales – 2014-06-11T13:52:22.437

5/dev/random exists, but it's intended to be more secure than /dev/urandom by only generating numbers if there's available entropy. Once you run out, it stops. /dev/urandom doesn't do that, and won't ever just stop outputting. – undergroundmonorail – 2014-06-12T04:20:16.917

Why is it never ending? I feel stupid, the second time today. – Daniel W. – 2014-06-17T13:57:46.713

1/dev/urandom is a 'file' which continuously feeds random numbers to cat. cat then pipes these to hexdump, etc. – daviewales – 2014-06-17T16:57:02.153

11

Python 2.7

The Endless Test Suite

"Runs" a set of "Unit Tests" on all the files in your directory tree. Traverses all subdirectories. Starts over when it gets to the end.

Prints a running status:

============================= entering . =============================
------------------------ test_line_numbers.py ------------------------
Ran 18 tests in 3.23707662572 seconds, 0 errors
---------------------------- test_main.c ----------------------------
Ran 26 tests in 1.3365194929 seconds, 0 errors
--------------------------- test_parser.c ---------------------------
Ran 8 tests in 1.61633904378 seconds, 0 errors
--------------------------- test_README.c ---------------------------
Ran 12 tests in 2.27466813182 seconds, 0 errors
4 modules OK (0 failed)
=========================== entering ./lib ===========================

...

Features that make it more complex than needed, and hopefully more realistic:

  • The number of tests and test time is proportional to the file size.
  • Turns non source code file extensions into known ones. Modify CodeExtensions to add more known types.
    • Selects new extension based on frequency of actual language files seen, so you won't be seen testing Python code if your hard drive is full of Ruby.
  • Skips files with leading . No giveaways like "test_.bashrc.js"
import os,random,time,collections

CodeExtensions = ('.py', '.c','.cpp','.rb','.js','.pl','.cs','.el')
last_exts = collections.deque(CodeExtensions[:1],100)
maxlen=0

def maketestname(filename):
    root,ext = os.path.splitext(filename)
    if ext in CodeExtensions:
        last_exts.append(ext)
    else:
        ext = random.choice(last_exts)
    return 'test_'+root+ext

def banner(char,text,width=70):
    bar = char*((width-len(text)-2)/2)
    return "{} {} {}".format(bar,text,bar)

def scaledrand(scale,offset):
    return random.random()*scale+random.randrange(offset)

while True:
    for dirname, subdirs, files in os.walk('.'):
        print banner('=',"entering {}".format(dirname))
        skipped = 0
        for filename in files:
            if filename[0] is not '.':
                testfilename = maketestname(filename)
                print banner('-',testfilename)
                filelen = os.path.getsize(os.path.join(dirname,filename))
                maxlen = max(maxlen,filelen)
                ntests = int(scaledrand(20*filelen/maxlen,10))
            testtime = scaledrand(ntests/5.0,2)
            time.sleep(testtime)                
            else:
                skipped+=1
                continue

            print "Ran {} tests in {} seconds, {} errors".format(ntests,testtime,0)
        print "{} modules OK ({} failed)\n".format(len(files)-skipped,0)

AShelly

Posted 2014-06-07T00:47:00.650

Reputation: 4 321

1You could also just run the Python regression tests, which are bundled with most Python installs. – nneonneo – 2014-06-11T19:42:01.613

But those finish eventually. – AShelly – 2014-06-11T20:10:14.587

2then you could run them...in a loop! – nneonneo – 2014-06-12T00:17:04.447

1I'm also thinking it's less suspicious to test files with names related to your projects than to test the Python source. I'm guessing most of us don't professionally maintain Python... – AShelly – 2014-06-12T14:22:13.420

11

Java + Guava 16 (Guava isn't super necessary, but it made some things a little less annoying to write).

Alright, you're supposed to be working? How about a program that actually writes real Java code, that actually compiles (though it doesn't do much).

It's difficult to demonstrate the animation, but this program writes a Java program using either the default dictionary (250 common English words) or a newline delimited file (taken as a command line argument), and types it to the console one character at a time at human seeming speeds. Make sure to run it yourself because this post doesn't do it justice. When it finishes, it waits 1 minute, then prints a lot of blank lines to the console, and starts over again. I tried to write it to make various parameters reasonably tweakable.

Also, normally I would put this into more than one file, but to make it easier to run I smushed all the classes together.

package org.stackoverflow.ppcg;

import java.io.*;
import java.util.*;

import com.google.common.base.CaseFormat;
import com.google.common.base.Converter;
import com.google.common.collect.Lists;

public class CodeGenerator {
    public static final Converter<String, String> TOUPPER =
            CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.UPPER_CAMEL);
    public static final Converter<String, String> TOLOWER =
            CaseFormat.UPPER_CAMEL.converterTo(CaseFormat.LOWER_CAMEL);
    
    public static final String[] TYPES = new String[]{
        "int", "long", "double", "String"
    };
    
    public static final List<String> DEFAULT_LIST = Arrays.asList(new String[]{
            "the", "and", "for", "you", "say", "but", "his", "not", "she", "can",
            "who", "get", "her", "all", "one", "out", "see", "him", "now", "how",
            "its", "our", "two", "way", "new", "day", "use", "man", "one", "her",
            "any", "may", "try", "ask", "too", "own", "out", "put", "old", "why",
            "let", "big", "few", "run", "off", "all", "lot", "eye", "job", "far",
            "have", "that", "with", "this", "they", "from", "that", "what", "make", "know",
            "will", "time", "year", "when", "them", "some", "take", "into", "just", "your",
            "come", "than", "like", "then", "more", "want", "look", "also", "more", "find",
            "here", "give", "many", "well", "only", "tell", "very", "even", "back", "good",
            "life", "work", "down", "call", "over", "last", "need", "feel", "when", "high",
            "their", "would", "about", "there", "think", "which", "could", "other", "these", "first",
            "thing", "those", "woman", "child", "there", "after", "world", "still", "three", "state",
            "never", "leave", "while", "great", "group", "begin", "where", "every", "start", "might",
            "about", "place", "again", "where", "right", "small", "night", "point", "today", "bring",
            "large", "under", "water", "write", "money", "story", "young", "month", "right", "study",
            "people", "should", "school", "become", "really", "family", "system", "during", "number", "always",
            "happen", "before", "mother", "though", "little", "around", "friend", "father", "member", "almost",
            "change", "minute", "social", "follow", "around", "parent", "create", "others", "office", "health",
            "person", "within", "result", "change", "reason", "before", "moment", "enough", "across", "second",
            "toward", "policy", "appear", "market", "expect", "nation", "course", "behind", "remain", "effect",
            "because", "through", "between", "another", "student", "country", "problem", "against", "company", "program",
            "believe", "without", "million", "provide", "service", "however", "include", "several", "nothing", "whether",
            "already", "history", "morning", "himself", "teacher", "process", "college", "someone", "suggest", "control",
            "perhaps", "require", "finally", "explain", "develop", "federal", "receive", "society", "because", "special",
            "support", "project", "produce", "picture", "product", "patient", "certain", "support", "century", "culture"
    });
    
    private static final int CLASS_NAME_LENGTH = 2;
    
    private final WordList wordList;
    private final Appendable out;
    private final Random r = new Random();
    
    private CodeGenerator(WordList wordList, Appendable out) {
        this.wordList = wordList;
        this.out = out;
    }

    public static void main(String... args) throws Exception {
        List<?> wordSource = getWords(args);
        WordList list = new WordList(wordSource);
        SleepingAppendable out = new SleepingAppendable(System.out);
        CodeGenerator generator = new CodeGenerator(list, out);
        while(!Thread.interrupted()) {
            generator.generate();
            try {
                Thread.sleep(60000);
            } catch (InterruptedException e) {
                break;
            }
            out.setSleeping(false);
            for(int i = 0; i < 100; i++) {
                out.append(System.lineSeparator());
            }
            out.setSleeping(true);
        }
    }

    private static List<?> getWords(String[] args) {
        if(args.length > 0) {
            try {
                return getListFromFile(args[0]);
            } catch(IOException e) { }
        }
        return DEFAULT_LIST;
    }

    private static List<Object> getListFromFile(String string) throws IOException {
        List<Object> newList = Lists.newArrayList();
        
        File f = new File(string);
        Scanner s = new Scanner(f);
        
        while(s.hasNext()) {
            newList.add(s.nextLine());
        }
        
        return newList;
    }

    private void generate() throws IOException {
        String className = beginClass();
        List<Field> finalFields = generateFields(true);
        printFields(finalFields);
        out.append(System.lineSeparator());
        List<Field> mutableFields = generateFields(false);
        printFields(mutableFields);
        out.append(System.lineSeparator());
        printConstructor(className, finalFields);
        printGetters(finalFields);
        printGetters(mutableFields);
        printSetters(mutableFields);
        endClass();
    }

    private void printGetters(List<Field> fields) throws IOException {
        for(Field f : fields) {
            out.append(System.lineSeparator());
            f.printGetter(out);
        }
    }
    
    private void printSetters(List<Field> fields) throws IOException {
        for(Field f : fields) {
            out.append(System.lineSeparator());
            f.printSetter(out);
        }
    }

    private void printConstructor(String className, List<Field> finalFields) throws IOException {
        out.append("\tpublic ").append(className).append('(');
        printArgs(finalFields);
        out.append(") {").append(System.lineSeparator());
        for(Field f : finalFields) {
            f.printAssignment(out);
        }
        out.append("\t}").append(System.lineSeparator());
    }

    private void printArgs(List<Field> finalFields) throws IOException {
        if(finalFields.size() == 0) return;
        
        Iterator<Field> iter = finalFields.iterator();
        
        while(true) {
            Field next = iter.next();
            next.printTypeAndName(out);
            if(!iter.hasNext()) break;
            out.append(", ");
        }
    }

    private List<Field> generateFields(boolean isfinal) {
        int numFields = r.nextInt(3) + 2;
        List<Field> newFields = Lists.newArrayListWithCapacity(numFields);
        for(int i = 0; i < numFields; i++) {
            String type = TYPES[r.nextInt(4)];
            newFields.add(new Field(type, wordList.makeLower(r.nextInt(2) + 1), isfinal));
        }
        return newFields;
    }
    
    private void printFields(List<Field> finalFields) throws IOException {
        for(Field f : finalFields) {
            f.printFieldDeclaration(out);
        }
    }

    private String beginClass() throws IOException {
        out.append("public class ");
        String className = wordList.nextClassName(CLASS_NAME_LENGTH);
        out.append(className).append(" {").append(System.lineSeparator());
        
        return className;
    }
    
    private void endClass() throws IOException {
        out.append("}");
    }
    
    private static class WordList {
        private final Random r = new Random();

        private final List<?> source;
        
        private WordList(List<?> source) {
            this.source = source;
        }
        
        private String makeUpper(int length) {
            StringBuilder sb = new StringBuilder();
            for(int i = 0; i < length; i++) {
                sb.append(randomWord());
            }
            return sb.toString();
        }
        
        private String makeLower(int length) {
            return TOLOWER.convert(makeUpper(length));
        }
        
        private String randomWord() {
            int sourceIndex = r.nextInt(source.size());
            return TOUPPER.convert(source.get(sourceIndex).toString().toLowerCase());
        }
        
        public String nextClassName(int length) {
            return makeUpper(length);
        }
    }
    
    private static class Field {
        private final String type;
        private final String fieldName;
        private final boolean isfinal;
        
        Field(String type, String fieldName, boolean isfinal) {
            this.type = type;
            this.fieldName = fieldName;
            this.isfinal = isfinal;
        }
        
        void printFieldDeclaration(Appendable appendable) throws IOException {
            appendable.append("\tprivate ");
            if(isfinal) appendable.append("final ");
            printTypeAndName(appendable);
            appendable.append(';').append(System.lineSeparator());
        }

        void printTypeAndName(Appendable appendable) throws IOException {
            appendable.append(type).append(' ').append(fieldName);
        }
        
        void printGetter(Appendable appendable) throws IOException {
            appendable.append("\tpublic ");
            appendable.append(type).append(" get").append(TOUPPER.convert(fieldName));
            appendable.append("() {").append(System.lineSeparator());
            appendable.append("\t\treturn ").append(fieldName).append(';');
            appendable.append(System.lineSeparator()).append("\t}").append(System.lineSeparator());
        }
        
        void printSetter(Appendable appendable) throws IOException {
            appendable.append("\tpublic void set");
            appendable.append(TOUPPER.convert(fieldName));
            appendable.append("(").append(type).append(' ').append(fieldName);
            appendable.append(") {").append(System.lineSeparator());
            printAssignment(appendable);
            appendable.append("\t}").append(System.lineSeparator());            
        }
        
        void printAssignment(Appendable appendable) throws IOException {
            appendable.append("\t\tthis.").append(fieldName).append(" = ").append(fieldName);
            appendable.append(';').append(System.lineSeparator());
        }
    }
    
    private static class SleepingAppendable implements Appendable {
        private Random r = new Random();
        private Appendable backing;
        
        private boolean sleeping = true;
        
        public SleepingAppendable(Appendable backing) {
            this.backing = backing;
        }
        
        @Override
        public Appendable append(CharSequence csq) throws IOException {
            return append(csq, 0, csq.length());
        }

        @Override
        public Appendable append(CharSequence csq, int start, int end)
                throws IOException {
            for(int i = start; i < end; i++) {
                append(csq.charAt(i));
            }
            
            sleep(100, 300);
            
            return this;
        }

        @Override
        public Appendable append(char c) throws IOException {
            sleep(170, 80);
            
            backing.append(c);
            
            return this;
        }

        
        private void sleep(int base, int variation) {
            if(!sleeping) return;
            try {
                Thread.sleep((long) (r.nextInt(80) + 70));
            } catch (InterruptedException e) {
            }
        }

        public boolean isSleeping() {
            return sleeping;
        }

        public void setSleeping(boolean sleeping) {
            this.sleeping = sleeping;
        }
    }
}

Sample program output (just one program)

public class GetGroup {
    private final double thoughRight;
    private final double socialYear;
    private final double manOne;
    private final int appear;

    private double man;
    private double comeHis;
    private double certain;

    public GetGroup(double thoughRight, double socialYear, double manOne, int appear) {
        this.thoughRight = thoughRight;
        this.socialYear = socialYear;
        this.manOne = manOne;
        this.appear = appear;
    }

    public double getThoughRight() {
        return thoughRight;
    }

    public double getSocialYear() {
        return socialYear;
    }

    public double getManOne() {
        return manOne;
    }

    public int getAppear() {
        return appear;
    }

    public double getMan() {
        return man;
    }

    public double getComeHis() {
        return comeHis;
    }

    public double getCertain() {
        return certain;
    }

    public void setMan(double man) {
        this.man = man;
    }

    public void setComeHis(double comeHis) {
        this.comeHis = comeHis;
    }

    public void setCertain(double certain) {
        this.certain = certain;
    }
}

Another sample output:

public class TryControl {
    private final int over;
    private final double thatState;
    private final long jobInto;
    private final long canPut;

    private int policy;
    private int neverWhile;

    public TryControl(int over, double thatState, long jobInto, long canPut) {
        this.over = over;
        this.thatState = thatState;
        this.jobInto = jobInto;
        this.canPut = canPut;
    }

    public int getOver() {
        return over;
    }

    public double getThatState() {
        return thatState;
    }

    public long getJobInto() {
        return jobInto;
    }

    public long getCanPut() {
        return canPut;
    }

    public int getPolicy() {
        return policy;
    }

    public int getNeverWhile() {
        return neverWhile;
    }

    public void setPolicy(int policy) {
        this.policy = policy;
    }

    public void setNeverWhile(int neverWhile) {
        this.neverWhile = neverWhile;
    }
}

durron597

Posted 2014-06-07T00:47:00.650

Reputation: 4 762

9You've made a fully-automatic money printing machine for anyone still paid by lines-of-code - great job! – Philipp – 2014-06-14T21:03:37.863

9

bash

Output some comments from random source files at random intervals, followed by a randomly generated do-nothing progress bar.

#!/bin/bash

# The directory to extract source comments from
srcdir=~/src/php-src/

# Generate a status bar that lasts a random amount of time.
# The actual amount of time is somewhere between 1.5 and 30
# seconds... I think. I fudged this around so much it's hard to tell.
function randstatus() {
    bsize=4096
    r_rate=$(echo "$RANDOM/32767 * $bsize * 1.5 + $bsize / 4" | bc -l | sed 's/\..*$//')
    r_min=3
    r_max=15
    r_val=$(($r_min + $RANDOM % $(($r_max - $r_min)) ))
    i=0
    dd if=/dev/urandom bs=$bsize count=$r_val 2> /dev/null | pv -L $bsize -s $(($r_val * bsize)) > /dev/null
}

# Picks a random .c file from the given directory, parses
# out one-line comments, and outputs them one by one with a
# random delay between each line.
function randout() {
    r_file=$(find $1 -name '*.c' | sort -R | head -n 1)
    echo "# $r_file"
    grep '^\s*/\*.*\*/\s*$' $r_file | sed 's:[/\*]::g' | sed -e 's:^\s\+::' -e 's:\s\+$::' | sed -e 's:^\W\+::' | grep -v '^$' | while read line; do
        echo $line
        sleep $(printf "%0.2f" $(echo "$((($RANDOM%4)+1))/4" | bc -l))
    done
}

while true; do
    randout $srcdir
    randstatus
    # sleep here to make it easier to break out of the 'while read' loop
    sleep 2
done

Output:

# /home/jerkface/src/php-src/sapi/fpm/fpm/fpm_shm.c
Id: fpm_shm.c,v 1.3 20080524 17:38:47 anight Exp $
c) 2007,2008 Andrei Nigmatulin, Jerome Loyet
MAP_ANON is deprecated, but not in macosx
  32kB 0:00:08 [3.97kB/s] [====================================================================>] 100%
# /home/jerkface/src/php-src/ext/mbstring/mb_gpc.c
Id$
includes
mbfl_no_encoding _php_mb_encoding_handler_ex()
split and decode the query
initialize converter
auto detect
convert encoding
we need val to be emalloc()ed
add variable to symbol table
SAPI_POST_HANDLER_FUNC(php_mb_post_handler)
  12kB 0:00:03 [4.02kB/s] [===============>                                                      ] 24% ETA 0:00:09

Sammitch

Posted 2014-06-07T00:47:00.650

Reputation: 509

1Clever! It's a little late to receive more attention, but take a high five from me. – SomeKittens – 2014-06-20T23:05:42.720

@SomeKittens The real genius of this script is that working on it looks even more like real work. ;D – Sammitch – 2014-06-20T23:20:29.207

7

Rsync form BASH

 rsync -n -avrIc --verbose  ~ ~ | sed s/"(DRY RUN)"/""/g    
# Note the space at the beginning of the above line,

rsync - a fast, versatile, remote (and local) file-copying tool... that with -n performs a dry run, only try to do, do not really do, and shows what happens.
In this case try to check if to update all file of your home directory (and sub-folders).
If you have the root access of course you can run it on a bigger part of your filesystem.

Notes:

  1. If HISTCONTROL=ignoreboth or at least HISTCONTROL=ignorespace in your bash session your bash history will not remember that command if you write it with a space before. (You cannot push up and see it on the screen, neither in the history log).
  2. | sed s/"(DRY RUN)"/""/g will pipe the output through sed that will erase the (DRY RUN) text at the end of the rsync output. If an expert check you can say you really doing that, not only testing.
  3. -avrIc you can change those options, check on man rsync, but never remove the -n, else you should have serious problem, even more if you run as root... 8-O!

Hastur

Posted 2014-06-07T00:47:00.650

Reputation: 277

6

Cobra

This opens a console window that loops through various fake objects and assorted things, incrementing in passes and progress for each pass. It waits for a small random time each increment, to simulate actual computation delays.

class Does_Nothing_Useful
    var _rng as Random = Random()
    var _hash
    var _pass
    var _names as String[] = @['Vector', 'Object', 'File', 'Index', 'Report', 'Library', 'Entry', 'Log', 'Resource', 'Directory']
    def main
        while true
            .refresh
            name as String = _names[_rng.next(_names.length)] + ' ' + _hash.toString
            for i in _pass
                progress as decimal = 0
                while progress < 100000
                    progress += _rng.next(1000)
                    print name + '; pass', i, ' : ', progress/1000
                    wait as int = 0
                    for n in _rng.next(50), wait += _rng.next(1,100)
                    System.Threading.Thread.sleep(wait)
                print name + '; pass', i, '--FINISHED--'
                print ''
                System.Threading.Thread.sleep(_rng.next(1000,17500))
            print name, '--EVAL COMPLETE--'
            print ''
            System.Threading.Thread.sleep(_rng.next(12500,30000))
    def refresh
        _hash = _rng.next.getHashCode
        _pass = _rng.next(256)
        print '--LOADING NEXT TARGET--'
        print ''
        System.Threading.Thread.sleep(_rng.next(12500,30000))

Οurous

Posted 2014-06-07T00:47:00.650

Reputation: 7 896

So did you ever end up completing this code? – rayryeng – 2015-09-26T16:46:25.700

1You've got the whole weekend to work on this, so take your time. – SomeKittens – 2014-06-07T06:14:09.897

1What is this Cobra language, it looks like the bastard child of Python and C#, haha (looking it up it does seem to have some interesting features though), +1 – Thomas – 2014-06-07T12:37:26.550

1@Thomas For the most part, it's C# (currently without LINQ) using Python-esque syntax. And one of the most helpful default compilers I've ever had the pleasure of working with. – Οurous – 2014-06-08T00:51:22.000

6

Maven under bash

Maven is just perfect for this kind of task ;-)

while true;
do mvn -X archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false;
done

jeroen_de_schutter

Posted 2014-06-07T00:47:00.650

Reputation: 161

4

I wrote a stupid python script to do this once. Called "ProgramAboutNothing"... I'm not sure it's that convincing but it only took me about 10 minutes. It just outputs random sentences describing what it is supposedly doing... I could probably have chosen better words for it that might look more convincing but I never actually used it properly. I guess if someone wants to use it they can edit it and add their own words in the lists... Fans of Sim City might notice something familiar, though. :P

from random import randrange
from time import sleep

nouns = ["bridge", "interface", "artifact", "spline"]
verbs = ["building", "articulating", "reticulating", "compiling", "analyzing"]
adjectives = ["mix", "abstract", "essential"]

while True:
    one = randrange(0,5)
    two = randrange(0,4)
    print "%s %s" % (verbs[one], nouns[two]),
    sleep(randrange(0,500)/100)
    print ".",
    sleep(randrange(0,500)/100)
    print ".",
    sleep(randrange(0,500)/100)
    print ".\n",
    loop = randrange(0,50)
    one = randrange(0,5)
    for i in range(loop):
        two = randrange(0,4)
        three = randrange(0,3)
        print "%s %s %s" % (verbs[one], nouns[two], adjectives[three]),
        sleep(randrange(0,250)/100)
        print ".",
        sleep(randrange(0,250)/100)
        print ".",
        sleep(randrange(0,250)/100)
        print ".\n",

Luke

Posted 2014-06-07T00:47:00.650

Reputation: 141

I get an invalid syntax at the second double quote of this line: print "%s %s" % (verbs[one], nouns[two]),. I've never programmed in Python before, so maybe it's my fault, but i can't think of what the problem could be... – Mathlight – 2014-06-11T12:22:54.513

What version of Python are you using? This works in Python 2.7 but there are differences in, say, 3.3 which might mean it doesn't compile. – Luke – 2014-06-11T13:53:26.853

1Maybe you're using Python 3? Try adding parentheses around the print statements like this: print( ... ). – daviewales – 2014-06-11T13:55:38.183

@Mathlight try using parentheses on the print statements. IIRC those are mandatory in Python 3.3. – Luke – 2014-06-11T13:55:40.523

1@daviewales ninja'd :P – Luke – 2014-06-11T13:56:11.193

1@Luke I've just installed Python 3.4.1 for Windows. I can't program in Python, but i'm interested in your little program... – Mathlight – 2014-06-11T13:56:12.777

1@Mathlight prepare to be underwhelmed. :P – Luke – 2014-06-11T13:57:00.420

1@luke, It's working now. And i'm impressed ^_^ – Mathlight – 2014-06-11T13:58:12.883

1@daviewales, that was indeed the problem. Now the program is running fine... – Mathlight – 2014-06-11T13:58:31.670

1You're doing a lot of odd things there @Luke. I assume you are trying to print '. . .' with a delay between each dot. However, due to the way print buffers, they all print at once. Instead, try sys.stdout.write('.') followed by sys.stdout.flush(). – daviewales – 2014-06-11T14:09:22.683

1Thanks, @daviewales. Python isn't usually my language of choice. – Luke – 2014-06-11T14:13:05.173

1Also, you can replace your randrange stuff with random.choice(). (e.g. print "%s %s %s" % (random.choice(verbs), random.choice(nouns), random.choice(adjectives)). – daviewales – 2014-06-11T14:14:10.970

4

How about this one? It will download the codegolf HTML data every 1 second. So, the data will keep on changing as long as the newer questions come in. At the same time, it will also appear as if you are downloading some critical data from a website.

while true; do     
sleep 1;     
curl "codegolf.stackexchange.com" -s |  w3m -dump -T text/html; 
done

Ramesh

Posted 2014-06-07T00:47:00.650

Reputation: 187

3

Bash

The recursive directory list:

ll -R /

ian.pvd

Posted 2014-06-07T00:47:00.650

Reputation: 141

2

This is a C++ Compiler Simulation (written in C#):

using System;
using System.Collections.Generic;
using System.Management;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using System.Reflection;

class FakeCompiler {
    static void DoPrint(string txt) {
        Console.WriteLine("Compiling " + txt);
        Thread.Sleep(1000);
    }
    static string Extract(string TypeName) {
        string rt = TypeName.Split(new Char[] {'.'})[ TypeName.Split(new Char[] {'.'}).Length - 1 ];
        if (rt.Contains("+")) {
            rt = rt.Split(new char[] { '+' })[1];
        }
        if (rt.Contains("[")) {
            rt = rt.Split(new char[] { '[' })[0];
        }
        return rt;
    }
    static void DoCompileSingleFile(string _Type_Name) {
        string print = Extract(_Type_Name);
        DoPrint(print + ".h");
        DoPrint(print + ".cpp");
    }
    static Type[] DoFakeCompile_Assembly(string _AssemblyFileName) {
        System.Reflection.Assembly _asm = System.Reflection.Assembly.Load(_AssemblyFileName);
        Type[] _ts = _asm.GetTypes();
        for (int h = 0; h < 15; ++h) {
            DoCompileSingleFile(_ts[h].ToString());
        }
        return _ts;
    }
    static void DoFakeLinkErrors(Type[] t) {
        Console.WriteLine("linking..");
        Thread.Sleep(2000);
        MethodInfo[] mi;
        for (int i = 0; i < t.Length; ++i) {
            mi = t[i].GetMethods();
            for (int j = 0; j < mi.Length; ++j) {
                Console.WriteLine("Link Error: The object {@!" + mi[j].ToString().Split(new char[] {' '})[0] + "#$? is already defined in " + Extract(t[i].ToString()) + ".obj");
                Thread.Sleep(200);
            }
        }
    }
    static void Main(string[] args) {
        Console.WriteLine("Fictional C/C++ Optimizing Command-line Compiler Version 103.33.0");
        DoFakeLinkErrors(DoFakeCompile_Assembly("mscorlib.dll"));
    }
}

wadf

Posted 2014-06-07T00:47:00.650

Reputation: 161

2

xdotool and an IDE (for example eclipse)

For X11 users.

Use this script and make sure you just Alt+tab'ed from Eclipse. You need a java file. For example here: https://raw.githubusercontent.com/Valay/Longest-Word-Made-of-other-Words/master/LongestWord.java

#!/bin/sh

xdotool key alt+Tab
xdotool sleep 0.2
xdotool type --delay 300 "$(cat LongestWord.java)"
xdotool key alt+Tab

RobAu

Posted 2014-06-07T00:47:00.650

Reputation: 641

2

Batch

Place in a folder with a lot of files. If it scrolls by fast enough, no one will suspect anything.

:l
dir/s
echo %RANDOM%
echo %RANDOM%
echo %RANDOM% 
goto l

qwr

Posted 2014-06-07T00:47:00.650

Reputation: 9 752

2

emerge @world

full recompile on gentoo

myururdurmaz

Posted 2014-06-07T00:47:00.650

Reputation: 141

I'm pretty sure the availability of this primo excuse is the leading reason to run Gentoo at all. – Caleb – 2015-08-15T10:02:44.640

2

C#

Slowly type up the full HTML of this webpage in the console. Added random time between "keystrokes" for realistic effect.

class HTMLConsole
{
    static void Main(string[] args)
    {
        System.Net.WebClient wc = new System.Net.WebClient();
        string webData = wc.DownloadString("http://codegolf.stackexchange.com/questions/30322/make-it-look-like-im-working");
        for(int i = 0; i < webData.Length; i++)
        {
            Console.Write(webData[i]);
            System.Threading.Thread.Sleep(new Random().Next(20, 300));
        }
    }
}

Alternatively, here is a program that will download, extract, unzip randomly-named packages, programs, bundles etc. forever.

class C
{
    static Random rnd = new Random();

    static void Main(string[] args)
    {
        for(;;)
        {
            string dType = GetDType();
            string extension = GetExt(dType);
            Console.Write(GetAction() + ' ' + dType + ' ' + GetName() + extension + "   .");
            for(int i = 0; i < rnd.Next(5, 40);i++)
            {
                Console.Write("\b..");
                Loading();
            }
            Console.Write("\bDone");
            Console.WriteLine();
        }
    }

    static string GetExt(string dType)
    {
        if (dType == "Package")
        {
            int r = rnd.Next(1, 5);
            if (r == 1) return ".crx";
            if (r == 2) return ".zip";
            if (r == 3) return ".rar";
            if (r == 4) return ".tar.gz";
            if (r == 5) return ".ymp";
            if (r == 6) return ".umx";
            if (r == 7) return ".gpk";
        }

        if (dType == "Bundle")
        {
            int r = rnd.Next(1, 3);
            if (r == 1) return ".app";
            if (r == 2) return ".bun";
        }

        if (dType == "Program")
        {
            int r = rnd.Next(1, 14);
            if (r == 1) return ".acc";
            if (r == 2) return ".akp";
            if (r == 3) return ".awk";
            if (r == 4) return ".fas";
            if (r == 5) return ".frx";
            if (r == 6) return ".int";
            if (r == 7) return ".mar";
            if (r == 8) return ".pdm";
            if (r == 9) return ".pgm";
            if (r == 10) return ".rn";
            if (r == 11) return ".sbp";
            if (r == 12) return ".t64";
            if (r == 13) return ".wxh";
        }

        if (dType == "Document")
        {
            int r = rnd.Next(1, 12);
            if (r == 1) return ".abc";
            if (r == 2) return ".rpl";
            if (r == 3) return ".doc";
            if (r == 4) return ".dat";
            if (r == 5) return ".hcg";
            if (r == 6) return ".indd";
            if (r == 7) return ".jw";
            if (r == 8) return ".mnt";
            if (r == 9) return ".neis";
            if (r == 10) return ".odm";
            if (r == 11) return ".pdf";
        }

        if (dType == "Update")
        {
            int r = rnd.Next(1, 5);
            if (r == 1) return ".rtp";
            if (r == 2) return ".mum";
            if (r == 3) return ".upd";
            if (r == 4) return ".bdf";
        }

        return "";

    }

    static string GetAction()
    {
        int r = rnd.Next(1, 6);

        if (r==1) return "Downloading";
        if (r==2) return "Unzipping";
        if (r==3) return "Installing";
        if (r==4) return "Extracting";
        if (r==5) return "Encrypting";

        return "";

    }

    static string GetName()
    {
        int length = rnd.Next(5, 12);
        string output = "";
        for(int i = 0; i < length; i++)
        {
            char c = (char)rnd.Next(97, 122);
            if (i == 0) c = char.ToUpper(c);
            else
            {
                bool same = (("aeiouAEIOU".IndexOf(c) >= 0) && ("aeiouAEIOU".IndexOf(output[i - 1]) >= 0))
                    || (!("aeiouAEIOU".IndexOf(c) >= 0) && !("aeiouAEIOU".IndexOf(output[i - 1]) >= 0));
                if (same)
                {
                    i--;
                    continue;
                }
            }
            output += c;
        }

        string version = "-";
        for(int i = 0; i < rnd.Next(1, 4); i++)
        {
            if (i != 0) version += ".";
            version += rnd.Next(0, 10);
        }

        int r = rnd.Next(1, 5);
        if (r == 1) version += "-BETA";
        if (r == 2) version += "-ALPHA";
        if (r == 3) version += "-" + ((char)rnd.Next(97,122)) + (rnd.Next(1000, 10000));

        output += version;

        return output;
    }

    static string GetDType()
    {

        int r = rnd.Next(1, 6);

        if (r==1) return "Package";
        if (r==2) return "Bundle";
        if (r==3) return "Program";
        if (r==4) return "Document";
        if (r==5) return "Update";   

        return "";
    }

    static void Loading()
    {
        char s = '|';
        for(int i = 0; i < rnd.Next(10, 100); i++)
        {
            if (s == '\\') s = '|';
            if (s == '-') s = '\\';
            if (s == '/') s = '-';
            if (s == '|') s = '/';
            Console.Write('\b');
            Console.Write(s);
            System.Threading.Thread.Sleep(50);               

        }
    }
}

SkyPharaoh

Posted 2014-06-07T00:47:00.650

Reputation: 111

1

Rebol 2.7

This is very simple but nice example, noone can blame you if you have to download a lot of logs from a website.

    repeat count 100000 [print rejoin  ["Downloading log number " to-string count ": "  to-string to-hex to-integer random 56754674373263244673426342732]]

Caridorc

Posted 2014-06-07T00:47:00.650

Reputation: 2 304

-2

<?php
   echo "Script is running, please wait...";
?>

Kiss Koppány

Posted 2014-06-07T00:47:00.650

Reputation: 111

12Welcome to Programming Puzzles and Code Golf. Please don't take the downvotes personally. Your answer was elegant, simple and achieved the purpose, but where you went wrong is in that it is too easy. Add some preload animation, a fake scrolling status, anything that will actually look like something is doing something and I promise you will get some upvotes. – David Wilkins – 2014-06-13T17:24:17.257