Chapter 111: Can't Sleep

My IQ Grows Every Year by Quiet Art (介安艺)

It was nearly midnight.

Room 215 was very quiet.

Chen Zhuo sat at his desk, his fountain pen tracing a smooth curve across the paper.

He stopped and picked up the cup beside him for a sip of water.

The noise from the other side of the wall was getting louder.

"Dayong."

Chen Zhuo set the cup down and glanced at Wang Dayong, who was still on the floor tinkering with his hardware.

"Does Chu Ge always pound his keyboard like this?"

Wang Dayong was wiping down his old motherboard with a rag and didn't look up.

"Normally that kid types like a typewriter, that's all. Tonight it sounds like a demolition crew. Bet his code's stuck and he's lost his temper."

Chen Zhuo shook his head helplessly.

He looked down at the formulas on his paper, but his mind was busy working out the laser printer he hadn't bought yet.

Room 216.

The main light was off.

The only light came from the monitor on Chu Ge's desk.

Its glow fell across Chu Ge's face, flickering bright and dark.

Several hefty computer books lay open in a mess on the desk, and an empty Red Bull can was pinned under the cover of 《C Primer Plus》.

Chu Ge had half a Hongtashan between his lips, his eyes fixed on the dense code on the screen.

Black background, white characters.

He pressed F9.

A small window popped up at the bottom of the screen, followed by a long row of glaring red error messages.

Time Limit Exceeded

Timeout.

Another timeout.

Chu Ge irritably spat the cigarette butt into the can beside him.

The job he'd taken was optimizing the back-end search for a newly launched commercial stock-image site.

The bounty on the forum was fifteen hundred yuan.

The requirement was simple: double the speed of the existing concurrent searches.

At first Chu Ge had thought it was easy money.

Code written by a bunch of start-up programmers was full of redundancy. He figured he'd just trim the logic tree a little and hand it in.

But once he started changing things, he found that the data's underlying architecture was a complete mess.

Touch one part and the whole thing moved.

To fix the data collisions he'd added a nested loop.

The result: as soon as the data started running, it knotted itself up in the third layer of logic.

Countless variables deadlocked one another in that narrow channel, and none of them could get out.

Chu Ge's hands flew over the keyboard.

He deleted the whole section he'd just written and nested it back in using a stack instead.

He finished typing, compiled again, ran it again.

The fan sped up.

The screen froze for three seconds.

Then the familiar red text popped up again.

Chu Ge swore.

He clawed a hand through his already messy hair and threw himself back in the chair, which gave a dull creak.

On the bed across the room, Lu Jia lay under a thin quilt.

Two foam earplugs were stuffed in his ears.

But he could still hear it.

The clatter of the mechanical keyboard was like a blunt saw dragging back and forth across his already taut nerves.

Lu Jia kept his eyes shut.

His stomach kept churning, and his temples throbbed with pain.

The moment in the advanced math class that day when he'd written the wrong sign kept spinning through his head like a revolving lantern[1].

His memory was blurring.

His reactions were slowing.

The feeling of losing control filled him with instinctive panic.

He needed sleep.

If he could just sleep and let his brain reboot, everything would go back to normal.

But the noise below wouldn't stop.

The keyboard picked up speed again.

Then came Chu Ge's angry muttering and the screech of chair legs scraping the floor.

Lu Jia's breathing grew heavier.

He rolled over to face the wall.

He tried pulling the quilt over his head to cover his ears.

It was useless.

The humming resonance of the computer case seemed to come right through the wall.

Five minutes.

Ten minutes.

The keyboard grew louder and louder, and every keystroke Chu Ge hit carried the force of someone losing his temper and taking it out on something.

Lu Jia's eyes snapped open.

In the dark, his eyes were frighteningly red.

He yanked the foam plugs out of his ears and tossed them beside his pillow.

He threw off the quilt.

He sat up.

Cold air cut straight through his thin cotton pajamas, but he didn't notice.

Lu Jia shifted to the edge of the bed and didn't bother looking for his slippers.

Barefoot, he climbed down the ladder of the iron bunk one rung at a time.

Chu Ge was scratching his head at the screen.

He had just tried his fourth algorithm, and it was still going around in an endless loop.

He picked up the cigarette pack from the desk and shook it. Empty.

Chu Ge crushed the pack in irritation and threw it on the floor.

He was about to delete the failing code and rewrite it again.

Suddenly there was a figure behind him.

Chu Ge saw Lu Jia standing behind him in the reflection on the monitor.

He jumped and turned around.

Lu Jia was standing barefoot on the floor, his face deathly pale, with dark bruise-colored circles under his eyes.

Chu Ge opened his mouth.

His irritation was pushed down by a twinge of guilt.

He knew he'd been far too loud tonight. He took his hands off the keyboard and spoke a little awkwardly.

"Did I wake you?"

Chu Ge pointed at the screen.

"I've hit a bug. It'll be done in a sec, just hang on a bit…"

Lu Jia didn't even look at him.

His eyes were locked on the hundreds of lines of code scrolling on the screen.

He couldn't follow the syntax strung together out of English words. He didn't know what a pointer was or what memory allocation meant.

But he could read the logical symbols and the change of variables mixed in with them.

He stared at it for a full minute.

His eyes darted along with the cursor on the screen.

Suddenly, Lu Jia moved.

He reached out and pulled Chu Ge's crumpled scratch pad across the desk.

He grabbed a ballpoint pen lying beside it.

Chu Ge froze, his hand hanging in midair, and made no move to stop him.

Lu Jia pressed the scratch pad against the corner of the desk. His wrist trembled slightly as the pen tip raced across the paper.

There was no pause and no hesitation.

Line after line of complex mathematical symbols appeared on the paper.

Not one line of it was code.

It was all pure algebra.

A dozen or so seconds later, Lu Jia stopped writing.

He tore off the sheet and laid it gently beside Chu Ge's keyboard.

"Your boundary conditions are wrong."

Lu Jia's voice was very small and thick with congestion, as if he were about to be driven to tears.

His shoulders were trembling slightly.

"You're making the variables converge at both ends at the same time, so the data in the middle keeps colliding. It's a deadlock."

Chu Ge was stunned and started to argue.

"I don't understand what you've written up there."

Lu Jia lowered his head and pointed at the sheet he'd just written, his voice full of deep exhaustion and pleading.

"But if you change it to this topological matrix, the data won't get jammed anymore."

Lu Jia took a step back, his eyes red.

"Change it and stop typing, okay… I want to sleep."

Chu Ge looked at Lu Jia, who seemed ready to fall over.

He forced back the words in his throat.

He lowered his head.

His eyes landed on the sheet of scratch paper.

He was a geek and could write code smoothly, but his math foundation was only passable.

He looked at the few clever topological transformation steps on the paper.

At first he didn't get it.

He worked through the formulas in his head.

Chu Ge's pupils contracted slightly.

It was an exquisitely clever mathematical substitution.

It skipped the trap of making the computer brute-force its way through and, at the source, turned that infinite loop into an equation with a definite solution.

Chu Ge swallowed.

Without a word, he took the sheet and set it beside his mouse pad.

He put both hands back on the keyboard.

Following the mathematical logic on the scratch paper, he started rewriting the code.

He broke apart the nesting and plugged in the parameters of the topological matrix.

Two minutes later, the changes were done.

Chu Ge took a deep breath.

His finger pressed F9.

No error window popped up.

The cursor blinked once in the black command prompt window.

Then line after line of data poured down smoothly, like a waterfall.

No freezing.

No timeout.

The data packet that should have taken ages to run and would crash the machine anyway was fully searched in five seconds, and the final results came back.

Process returned 0 (0x0)

It ran successfully.

Chu Ge sat frozen in his chair.

He stared at that "0" that meant success.

The irritation and frustration of being unable to crack it were replaced in that moment by a deep sense of powerlessness.

He had spent the whole night on a deadlock and tried four methods without fixing it.

And this guy had stood behind him watching for one minute, then scribbled down a formula on the verge of tears and broken it.

Chu Ge turned his head.

Lu Jia had already turned around and was climbing the ladder back to bed.

Just then, Vrrrr—!

The computer case at Chu Ge's feet suddenly gave a shrill shriek.

It was piercingly loud.

Then the indicator lights on the front panel started flashing wildly.

A burnt smell gushed out of the vents.

Chu Ge's face changed.

He looked down sharply.

The program had run, but the topological matrix Lu Jia gave him had instantly called up a huge amount of concurrent data.

In those few seconds, the CPU of his secondhand Pentium 3 had been pushed to full load.

The aging cooling fan couldn't hold back the sudden spike in temperature.

The motherboard sounded an alarm.

If he left it, either the chip would burn out or the power supply would catch fire.

Chu Ge didn't hesitate. He bent down and yanked the power cord out of the power strip.

The screen went black.

The fan's shriek cut off abruptly and became a slowly fading hum.

The room fell into darkness, with only a little moonlight coming through the window.

Quiet.

A sudden quiet.

Chu Ge crouched on the floor, still holding the power cord.

He could feel the scorching heat coming off the metal of the case.

He stood up.

Lu Jia had just climbed back into bed and was about to lie down.

Still a little dazed by what had just happened, he sat up on the bed and looked down.

Chu Ge stood beside the ladder.

He stood there in the dark for a while.

Looking at the thin figure on the bed, Chu Ge lowered his head slightly.

"Just now… sorry about that."

Chu Ge's voice was low and awkward, but he meant every word.

"What you wrote on that sheet was really impressive."

Lu Jia clutched his quilt and didn't say anything.

"This job takes way too much computing. My case can't handle it."

Chu Ge bent down, unplugged the mouse and keyboard, then pulled out the monitor's data cable.

He picked up the heavy metal case, still burning hot, in his arms.

"I'll go across and borrow Wang Dayong's fan to cool it down. I'll work over at his place tonight."

Chu Ge carried the case toward the door.

With his hand on the doorknob, he paused.

He looked back at Lu Jia.

"Go to sleep. I won't bother you again tonight."

The door opened.

A strip of light from the corridor spilled in.

Chu Ge carried the case out quietly and slowly pushed the door shut with his shoulder.

There was a soft click.

The door shut.

Room 216 was finally silent.

There was only the faint ticking of the old-fashioned alarm clock at the head of Lu Jia's bed.

Lu Jia slowly lay down.

He pulled the quilt up over himself.

No more keyboard, no more humming computer, and even the bed had stopped shaking.

He finally had the quiet he had craved all night.

By rights, he should be able to sleep well now.

But he couldn't.

Lu Jia lay with his eyes open, staring at the dark ceiling.

His mind was wide awake.

Frighteningly awake.

Solving Chu Ge's endless loop had restarted his brain in a matter of moments.

Now the wild machine in his head wouldn't stop.

In those few minutes scanning the screen, he hadn't only seen the local deadlock.

He had also seen the flaws in the overall architecture of Chu Ge's code.

The local part ran now, but with a larger volume of data, that underlying search method would inevitably cause the left-hand and right-hand extrema to collide.

Lu Jia's breathing became uneven.

He was like an extreme neat freak who had spotted a crooked picture on the wall.

The picture hadn't fallen down.

But he knew it was there, and it was crooked, and if he didn't straighten it, he wouldn't be able to stop thinking about it.

Lu Jia rolled over in bed.

He squeezed his eyes shut.

But his head was full of variables that didn't close the loop.

His mind even started filling in the other half of the equation by itself.

He couldn't stop.

Twenty minutes passed.

Lu Jia flung off the quilt.

In the total silence, he realized with despair

that he still couldn't sleep.

Across the hall, someone knocked on the door of Room 215.

Bang bang bang.

Wang Dayong had just put down the motherboard. He pulled the door open.

Chu Ge stood outside holding the steaming case, drenched in sweat.

"Dayong, help me out."

Chu Ge came in, panting.

"My computer's about to fry. Let me borrow your fan to cool it."

Chen Zhuo turned around in his chair.

He looked at the case on the floor, side panel off and giving off an acrid burnt smell, and then at Chu Ge, sweaty and gasping for breath.

"You got a CPU smoking in the middle of the night."

Chen Zhuo twirled the black pen in his hand, a teasing note in his voice.

"What are you computing on a secondhand Pentium 3? Simulating a nuclear explosion?"

Crouched on the floor, Wang Dayong burst out laughing and joined in.

"Yeah, the thermal paste is practically baked. What did you do, kid?"

Chu Ge slumped into the empty chair beside Wang Dayong, rubbed his face irritably, and let out a heavy sigh.

"Don't ask. I took a private job off a hacker forum, optimizing the back-end concurrent data search for an image site. Fifteen hundred yuan bounty."

Chu Ge pointed at the case still giving off leftover heat, looking thoroughly fed up.

"The data volume's huge. I was stuck in a nested endless loop and couldn't get out, and then I was pounding the keyboard so loud I drove my roommate Lu Jia crazy."

Chu Ge recalled the scene, still sounding as if he couldn't believe it.

"He climbs down barefoot, eyes all red, and throws me this amazing topological substitution matrix. I type the formula in and the deadlock's gone, just like that."

At that, Chu Ge raked his hair in frustration.

"But that's where it went wrong. The local deadlock's fixed, but the concurrent data maxed out instantly and the whole data stream came flooding in. My junk fan couldn't keep the temperature down, and the machine went straight down."

Chu Ge looked up at Chen Zhuo, utterly helpless.

"And that's not even the end of it. Once his matrix is plugged in, my flat, straight-line architecture can't contain that much data. Even if Dayong gets the temperature down for me, if I force it to run it'll just die again."

Chen Zhuo listened quietly to the whole story.

He didn't ask anything, and he didn't comment on the bounty.

He just reached out and took the crumpled scratch pad from Chu Ge's hand.

He glanced over the chaotic flow lines Chu Ge had drawn on it.

Then, on the back of the sheet, Chen Zhuo casually drew an extremely simple inverted tree diagram.

The lines were very clean.

"Cut from the bottom up. Reverse topology."

Chen Zhuo handed the pad back, his tone even.

"You don't need to call up all the bottom-level data. Just set boundary thresholds and run it on a tree architecture like this, and your machine can handle it."

Chu Ge looked at the diagram.

The look in his eyes changed at once.

He stared at the lines on the paper and quickly simulated the flow of the data in his head.

Peeling things away from the root upward completely avoided the flat search that ate up the most computing power.

Chu Ge looked up, and there was surprise in the way he looked at Chen Zhuo.

While Chu Ge was still sitting there stunned, the door of 215, which hadn't been shut properly, was pushed open by a hand from outside.

Lu Jia stood in the doorway in rumpled pajamas and slippers.

He clutched several sheets of scratch paper covered in derivations, and the red veins in his eyes were even worse than before.

All three people in the room looked at him at once.

Lu Jia gritted his teeth, walked past Wang Dayong, and went up to Chu Ge.

He slapped the scratch paper down on the desk.

"If I don't finish solving the other half of that equation…"

Lu Jia's voice carried a desperate stubbornness, his eyes rimmed with red.

"my head's going to be full of wrong variables fighting each other."

He stared at Chu Ge.

"I can't sleep at all."

[1] Revolving lantern (走马灯): a traditional Chinese lantern whose inner paper figures spin around in the heat of the candle. It is a stock image for scenes flashing past one after another in the mind.

This reader needs a modern browser to display fully. If you are using one, there may be network issues.