Outside the array

image

Fatigue


I look at the code and completely donā€™t understand what it does. Thoughts are confused, I see the familiar syntax and set of designs, but the information on the monitor screen absolutely does not carry any semantic load for me. I read the code line by line, I even make notes in the draft, trying to understand the algorithm, but soon everything falls into a meaningless mess. Too little coffee or too much? Recently, I have developed immunity to it. I drink it like water and it seems that the effect is zero, but without it in any way. Deadline steps on heels. Management makes itself felt more and more often. Another broken deadline and, perhaps, they will offer me to look for a new job. From psychological pressure and limited time to fix bugs it becomes only harder. How many bugs and legacy code, I try to sort through the shelves and unwind this tangle, but all in vain.

I'm too stupid for this job. Maybe the lack of a mathematical base affects? Or maybe there is simply no talent. I guess I have a different mindset. I look around and see the carefree laugh of my colleagues, it seems that everything is much easier for them. Code at your fingertips. Everything is wrong with me. Although it will pass, I know that for sure. As soon as I close this project, there will be a slight sense of euphoria, it always happens. And then, once again plunging into another swamp of program code, you lose faith in yourself. This is the ā€œwheel of samsaraā€ and I will never get out of it.

I'm leaving work on time today. When such a moment of psychological exhaustion comes, the best thing to do is to go home, take a shower and have a good night's sleep. The main thing is not to open a laptop. No YouTube and TV shows. This is not a vacation. Or even worse, you can find yourself at dawn, frantically combing ā€œstackoverflowā€ in search of a workaround for another bug in the library. Then you suddenly remember that you were really going to sleep.

The working day is over, perhaps, walk to the house on foot. It's cool outside, autumn makes itself felt. All the better. It will refresh my brains. Today there are no trips to the store, a pack of dumplings remained in the refrigerator, they will go.

Probably the biggest curse of a programmer is that he can work without a computer. Mentally programming and solving another problem. Sometimes distracted, and you simply canā€™t switch. Frozen dumplings stuck together in a single lump, I look at this picture and for some reason think about ā€œlinked listsā€. I watch how dumplings are boiled on boiling water. Some bubbles replace others very quickly. Thought of ā€œsorting by bubbleā€. Not the most efficient sorting method, I thought to myself. All. Enough! I'm already riding a roof. Urgent need to stop thinking about work, otherwise I just go crazy. Have a quick dinner in the shower, urgently in the shower. Everything will be tomorrow, and today I am immensely tired.

My fatigue is so strong that I donā€™t remember going to bed. It seems to me that I did not fall asleep, I just fell into unconsciousness. Though I did not forget to set the alarm. Still tomorrow back to work. But it will be tomorrow. Usually such a dream goes according to one scenario: you just close your eyes and, it seems, after a moment you open them, but in the morning.

Altered state of consciousness


This time I woke up in the middle of the night. The first thought that crossed my mind was: what time is it now? Feels like it's a deep night. The brain refuses to process information and strives to fall into sleep again. Trying to reach for the phone. What kind of nonsense? I can not do it. My body does not obey, it seems I can not move. I'm trying to come to my senses. This simply cannot be. What happened with me? Again, I am making significant efforts. And nothing. I just canā€™t bring into action more than one muscle on the body. At the same time I feel my breath. Yes, I definitely breathe. The heartbeat is quickening. I seem to be in a panic. I donā€™t know exactly, but it feels like a sweat appears on my forehead and I get wet. The heart almost jumps out of the chest. The body is completely immobilized, but the consciousness is clear.I'm dying? What should I do? I'm trying to scream, and I understand that now I canā€™t do it either. Apparently for this, some muscles should also be involved. So, so, probably, you need to calm down. Mentally trying to normalize the heart rate. Trying to slow my breathing. ā€œCalm, calm,ā€ I repeat myself to myself. The heartbeat seems to be returning to normal. But what's next? I can't even call anywhere. How long will they find me? In a week? Month? I'm just going to starve to death. No, not from hunger, from thirst. It seems that breathing gradually calms down, and the heart is no longer trying to jump out of the chest. I just lie and look in the dark, unable to lift my eyelids. They are infinitely heavy.need to calm down. Mentally trying to normalize the heart rate. Trying to slow my breathing. ā€œCalm, calm,ā€ I repeat myself to myself. The heartbeat seems to be returning to normal. But what's next? I can't even call anywhere. How long will they find me? In a week? Month? I'm just going to starve to death. No, not from hunger, from thirst. It seems that breathing gradually calms down, and the heart is no longer trying to jump out of the chest. I just lie and look in the dark, unable to lift my eyelids. They are infinitely heavy.need to calm down. Mentally trying to normalize the heart rate. Trying to slow my breathing. ā€œCalm, calm,ā€ I repeat myself to myself. The heartbeat seems to be returning to normal. But what's next? I can't even call anywhere. How long will they find me? In a week? Month? I'm just going to starve to death. No, not from hunger, from thirst. It seems that breathing gradually calms down, and the heart is no longer trying to jump out of the chest. I just lie and look in the dark, unable to lift my eyelids. They are infinitely heavy.How long will they find me? In a week? Month? I'm just going to starve to death. No, not from hunger, from thirst. It seems that breathing gradually calms down, and the heart is no longer trying to jump out of the chest. I just lie and look in the dark, unable to lift my eyelids. They are infinitely heavy.How long will they find me? In a week? Month? I'm just going to starve to death. No, not from hunger, from thirst. It seems that breathing gradually calms down, and the heart is no longer trying to jump out of the chest. I just lie and look in the dark, unable to lift my eyelids. They are infinitely heavy.

I donā€™t know how much time has passed. Maybe an hour, maybe more. It seems I'm starting to hear some sounds. Can I come to my senses? This sound is amplified, no, rather, it is approaching. It resembles the sound of the surf. It is interesting that outside the window of my one-room apartment it can happen that it makes such sounds, and even in the middle of the night? The sound is getting closer. It seems he is moving at an incredible speed and will soon overtake me. At some point, he becomes very close. No, it definitely doesn't sound like the sound of the sea. The roar is incredibly loud, it scares me. Now something will happen. I wonder what is the likelihood that a plane crashes directly onto an apartment building? Nothing else comes to mind. What else could such an all-consuming roar emit? Cotton. My body was shocked. Unpleasant sensation throughout the body. There is no pain, but it is so unpleasant that, probably,the pain would be easier to bear. The current pulsates throughout the body, its frequency increases every second. Cotton. I threw somewhere.


I am standing in the middle of a room. This is definitely not my apartment. Itā€™s too dark, and I always get light from streetlights and advertising signs. This is a dream? Or am I dead? If it is a dream, then consciousness is too clear. Itā€™s more correct to say that it is crystal clear as never before. Now I completely feel my body. I'm wearing my clothes and sneakers. I rubbed my palms against each other, I feel their warmth. I raise my eyes and see in the distance, something like a luminous monitor. What is this, a joke? Iā€™m getting closer, but itā€™s definitely a monitor, on the 29-inch diagonal. Nowhere I can not make out the manufacturer's company. I've never seen one like this before. It is absolutely without any framework. Only a solid display. I do not see any wires, not the system unit. Only the table on which he stands and the chair. It looks comfortable. Around pitch darkness. Only in a radius of ten,eight meters light lighting. It may be from the monitor screen, but it is quite voluminous, it is unlikely that all the light comes from it. I looked around, I do not see other light sources. I look around to look around, maybe there is something else in this conditional room? Yes, for sure, some small cabinet, it is located to the right of the table on which the monitor stands. I come closer and understand that this is not a cabinet - it is a transparent refrigerator. Inside, the backlight is yellow. I try to make out the contents and see that it is a refrigerator with drinks. Unlike monitors, these drinks are very recognizable. How thirsty, this is what I need now. The refrigerator is packed with cans of Coca-Cola and Pepsi. I open the refrigerator door very slowly and carefully. I reach out and take a can of Pepsi. The hand immediately feels a change in temperature.It feels like four degrees in the refrigerator. The cans are covered with condensation and water droplets. I take one of the cans and feel a pleasant chill of thin aluminum. Touch is so real that itā€™s hard to put into words. I open the can with a characteristic hiss and take a sip. I immediately feel the familiar sweet taste. Soda nicely burns the throat. This taste is very bright, probably the same feeling I experienced in early childhood when I first tried this drink. If I'm in the next world, then so far I'm not bad here. Although I must admit, if I, when I had thoughts about its existence, I imagined it to myself somewhat differently. I hope there are games on the computer, not code here to write forever.which is difficult to convey in words. I open the can with a characteristic hiss and take a sip. I immediately feel the familiar sweet taste. Soda nicely burns the throat. This taste is very bright, probably the same feeling I experienced in early childhood when I first tried this drink. If I'm in the next world, then so far I'm not bad here. Although I must admit, if I, when I had thoughts about its existence, I imagined it to myself somewhat differently. I hope there are games on the computer, not code here to write forever.which is difficult to convey in words. I open the can with a characteristic hiss and take a sip. I immediately feel the familiar sweet taste. Soda nicely burns the throat. This taste is very bright, probably the same feeling I experienced in early childhood when I first tried this drink. If I'm in the next world, then so far I'm not bad here. Although I must admit, if I, when I had thoughts about its existence, I imagined it to myself somewhat differently. I hope there are games on the computer, not code here to write forever.when there were thoughts of its existence, I imagined it to myself somewhat differently. I hope there are games on the computer, not code here to write forever.when there were thoughts of its existence, I imagined it to myself somewhat differently. I hope there are games on the computer, not code here to write forever.

He closed the refrigerator and found another cabinet to the left of the table. Yes, this time it was really a closet. Three times larger and slightly higher than the refrigerator. And there seems to be nothing more here. Walked around with a can in his hand in a limited space. Yes, definitely that's all there is. He went to the closet. This is a bookcase, it is packed from top to bottom with books. And this is not fantasy or poetry. The books are very recognizable: Donald Knuth ā€œThe Art of Programmingā€ - four volumes, Bjƶrn Stroustrup ā€œC ++ Programming Languageā€, Thomas Cormen ā€œAlgorithms. Construction and Analysis ā€, McConnellā€œ Perfect Code ā€. It looks like all the basic literature on Computer Science. That which always did not reach hands. Who am I kidding, I was just too lazy. He turned and to the right, my gaze again riveted the screen.For some reason, up to this point, it never occurred to me to look at the image of the monitor. And it became clear why. There was a dark screen. More truly, there was a console where the invitation to enter login flaunted. There was also a keyboard on the table. There was no mouse. Yes, Doom doesn't seem to play. Of course, I was not thinking seriously about this. Actually, something else bothered me. Where I am? If this is a strange dream in which I am as if in reality, then how can I wake up? If Iā€™m no longer alive, then what am I to do with this at all, and not sit here for eternity?in which I am as if in reality, how can I wake up? If Iā€™m no longer alive, then what am I to do with this at all, and not sit here for eternity?in which I am as if in reality, how can I wake up? If Iā€™m no longer alive, then what am I to do with this at all, and not sit here for eternity?

Having a little dipped in the monitor, I took another sip of a cooling drink and put the jar on the table. ā€œLogin ... login ..,ā€ I said aloud. What happens if I enter the correct credentials? What will happen next? You can, of course, get up and walk away from this place. But where? Into pitch darkness? Somehow I do not want to. And if I was thrown right here, it means that some actions are needed from my side. Do not drink soda ... However, I have already taken this opportunity. Nothing changed. On the other hand, it could have been much worse.

Well, suppose the login can be root. Why not. What can it be even in these circumstances. But what to do with the password? How do I know him? No riddles or clues, nothing. On the offer to enter the password, I just clicked ā€œEnterā€.

Access denied.

A grin appeared on my face, yes, that would be too easy. I decided to walk around and think. He went again to the refrigerator and, not particularly cautious, took a new can of the drink. This time it was Coca-Cola. And why are these drinks so delicious here? It's like I'm trying them for the first time. He thoughtfully went to the bookcase. Going through the options in my head. Although there may be options. Maybe there is an answer among the books? Put the jar on the table. By the way, where is the trash can? He took the first book that came to Knut. A book is like a book, brand new pages. And it also smells new, and even the spine at the opening pleasantly crunches. I took a few more from the shelves, nothing unusual. He sat down at the table and randomly entered a few more password options.


Access denied. 
Access denied. 
Access denied.
Apparently I'm missing something. I sat back and closed my eyes. And a moment later a smile appeared on my face. Why didnā€™t this idea come to me earlier? If we assume that this is a dream, albeit very strange, and frighteningly realistic, then everything that is here is a figment of my imagination. Why not be my own password from my home laptop there? It's even easier than not having a password! I quickly enter the login: root, password: ********* and my hand freezes over the ā€œEnterā€ key. What if I just wake up? What if I was given some chance, but I did not use it? Books ... I didnā€™t even try to read them. The index finger instantly pressed the "Backspace" key several times. I quickly got up and went to the bookcase. He took Cormenā€™s heavy book, Algorithms. Construction and analysis ā€, slowly walked to the table where the monitors are,sat down and opened the first page. How much I tried to read, and most importantly to understand this book. He undertook to read it, then threw it, made new attempts to read it, but it was too tough for me. But here everything is different. I swallowed page after page with incredible speed and complete immersion. I do not know how to explain this, but I did not read the text. When we learn to read in childhood, we first learn letters, then learn to read words, and put words into sentences. But it was some other level of perception of information. It was enough for me to look at the page, how everything fit on the shelves in my head. It was knowledge and experience at the same time. It seemed to me that an old friend whom I have known all my life is talking to me. No, it wasnā€™t even a friend, but I myself, from the future,who understood this topic a long time ago and decided to explain to me as clearly as no one else would have explained. As if this book was written specifically for me, it knows me. She is my best friend. In less than half an hour the book was read, leaving a sweet aftertaste. When you read the best book in your life and after nothing else you do not want to read. You think that you are unlikely to be able to find something better, something more worthwhile. The following were the classic of Donald Knuth. I was able to absorb information faster. After some time, I caught myself thinking that I was turning several pages at a time, without nearly losing the thread of the story. It took me 20 minutes to complete four volumes, no more.In less than half an hour the book was read, leaving a sweet aftertaste. When you read the best book in your life and after nothing else you do not want to read. You think that you are unlikely to be able to find something better, something more worthwhile. The following were the classic of Donald Knuth. I was able to absorb information faster. After some time, I caught myself thinking that I was turning several pages at a time, without nearly losing the thread of the story. It took me 20 minutes to complete four volumes, no more.In less than half an hour the book was read, leaving a sweet aftertaste. When you read the best book in your life and after nothing else you do not want to read. You think that you are unlikely to be able to find something better, something more worthwhile. The following were the classic of Donald Knuth. I was able to absorb information faster. After some time, I caught myself thinking that I was turning several pages at a time, without nearly losing the thread of the story. It took me 20 minutes to complete four volumes, no more.After some time, I caught myself thinking that I was turning several pages at a time, without nearly losing the thread of the story. It took me 20 minutes to complete four volumes, no more.After some time, I caught myself thinking that I was turning several pages at a time, without nearly losing the thread of the story. It took me 20 minutes to complete four volumes, no more.

Why are there so few books here? I donā€™t want them to end, as an abnormal one I swallowed one after another. I was overwhelmed with emotions, these books were the best and most exciting works that I have ever read. I was obsessed, nothing in my life was so exciting. I just bathed in a stream of information, I reveled in it, it filled me with meaning and vitality. Four hours later, there were no books unread by me in the closet.

System Testing


It's time to enter your password. And how was my confidence that my guess with the password was correct? But for some reason I didnā€™t doubt it. Whatever it is, I'm ready for it. A little worried, I finally entered the username and password, then immediately pressed ā€œEnterā€.

I was inside the system. The source code of some program appeared on the monitor. It was code in the programming language ā€œC ++ā€. The amount of code was small. And one of the functions that immediately accepted a two-dimensional array immediately entered my eyes. Above this array has been defined. And from his name a chill ran down my spine, and then it threw into a fever.

The variable was called deathArray. Quickly getting up from the table, I moved back. Looking around, it seemed to me that the room was getting brighter. Yes, it really was getting brighter here. Three minutes later, the room became as bright as day. Looking ahead, I could not believe my eyes. A huge red-green field stretched before my gaze. With a strange bright lawn, which consisted of cells, about a meter per meter. Some of the cells were green, and some of them were bright red. The sight of red grass looked ominous and frightening. Cells were arranged in a chaotic manner. Although stop, no.

They looked exactly like an array on a monitor screen that was filled with zeros and ones. Now I realized: green cells on the field corresponded to one, and red corresponded to zeros. Apparently, I had to add a function that will help to successfully pass this field. But I still had questions that required immediate answers.

What will happen if you step on the red cage? Do I need to think about the algorithm inside the function or can I just go through the field without stepping on the red cell? Or maybe you really canā€™t step on the green? And most importantly, what a frightening name for the deathArray array?

We will act in order. First, let's deal with the first question. I slowly walked around the table and took a few steps toward the field. The grass on the cells was juicy and bright green, but I did not want to touch it, as well as stand on the cells themselves. It is necessary to somehow check which of the cells on the field are dangerous. I took off my sneakers, took one and threw it on a green cage. Nothing happened. Good. Suppose a green cell is really safe. What about red? Taking the second shoe in my hand, I threw it on the red cage and immediately flinched from the sharp cotton. It just exploded into dust. So my theory with color turned out to be true. This, of course, was logical, but I did not want to check on myself, even if I had a very obvious theory with colors.

Farther. What is stopping me from going through the entire field without just stepping on the red cells? But something told me that you need to go through it as quickly as possible and you need to write a search algorithm for exactly the shortest path. The main arguments in his favor were the name of the array and the size of the field. The size of the array itself was 3000x3000 elements. That is, if we assume that the cell size is 1 square meter, then the minimum distance that I will have to cover is 3 kilometers, but in reality the distance I needed to go could increase several times. Anyway, I have no desire to linger on this field for a long time.

I took a new Pepsi can from the refrigerator and sat down to write the code. By the way, the bookcase has already disappeared somewhere. What would happen to me if I just recklessly entered my login and password? After all, I did not understand up to this point how the path search algorithms work. I've never written code so diligently. Perhaps the task is not the most difficult and programmers in a company like Blizzard are faced with such tasks every day and click them like nuts. But, firstly, I'm not from the gaming industry, and, secondly, my life depended on it.

It took me about 30 minutes to write the algorithm inside the function. And another hour I devoted verification. Everything seems to be right. Although the word ā€œlikeā€ is inappropriate when it comes to life and death. All right. Now is the start time. I crushed the empty can with my hands and threw it onto the red cage, it immediately disappeared with a characteristic sound, turning into dust. Need to act. After reading the comments at the beginning of the program, which contained instructions for starting, I launched it for execution.

Outside the array


The result was not long in coming. The launch of the program set in motion the cells on the field. Their height relative to each other began to change. So it became clear that these are not really cells, but cubes. Some began to rise by half a meter relative to others, thereby building the trajectory of the path, which was calculated by my algorithm. One by one, the cubes changed their height, all this was accompanied by a loud hum, which only gave them massiveness. After a while, they completely rebuilt. The result was a trajectory of cubes that towered above the others and along which I had to go. And I ran.

I donā€™t know what exactly made me go running. It was some kind of inner impulse, but as it turned out my feelings did not change me. Looking back slightly, I noticed that the part of the field that I had run, cube by cube, was falling rapidly down. I could not understand in any way whether they fell only after they were behind me, or if the speed with which they fall was higher than mine, and then I would simply fall down. And unfortunately it was the second option. I ran as fast as I could, trying not to lose my balance. I was swayed several times in the bends, and I almost hit the red square. Forces ran out, and the abyss meter by meter was approaching me. It seemed that now I would step on the next square and fall down with it. If at least somewhere I made a mistake in the calculations, and my path is not the most optimal, Iā€™m done.In the chest, it began to unbearably prick, breathing finally lost. I continued to run at all costs. So just I wonā€™t give up. How much did I run? It seemed to me that the finish should already be very close, but I did not see it. My eyes began to get dark, I coughed. ā€œJust a little bit, still a little bit,ā€ I mentally encouraged myself. It seemed that the cube I was stepping on failed right away. It was a difference of a second, if I at least slowed down a little, and inevitable death would await me.on which I step, immediately failed. It was a difference of a second, if I at least slowed down a little, and inevitable death would await me.on which I step, immediately failed. It was a difference of a second, if I at least slowed down a little, and inevitable death would await me.

When the forces were almost at zero, and the light of hope was almost gone, I saw the end of the field. The trajectory was completely straightened, I needed to run only in a straight line. I got a second wind. I ran as hard as I could. The cubes continued to fall almost under my feet. But another thing disturbed me. The border, which I was so eager for, ended with a cliff. I finally ran to the finish line and abruptly stopped. The abyss from which I was running so violently was now on both sides. At the very finish, I managed to turn 180 degrees, the cubes below me failed, and I felt a feeling of falling back down.

I flinched like a madman, gasping for air. The heart was beating. He opened his eyes and could not believe it. I'm at home. I lie in my bed. In my head there is still a scene from my dream, which does not want to let me go. But everything is behind.

PS I arrived at work on time. It took me just an hour to finish my difficult project. As a result, they passed it to the customer a week earlier. The customer was very pleased with the result. A few months later, I quit the company in which I worked because I received an offer on Google. As I later found out, I was interviewed with the highest score in the history of the company. But this is a completely different story ...

All Articles