tag:blogger.com,1999:blog-202648892023-11-15T18:22:42.585+02:00voodooattack's blogA little bit of madness goes a long way.Anonymoushttp://www.blogger.com/profile/11701047179670165384noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-20264889.post-20560027008586470132014-09-29T09:41:00.002+02:002014-09-29T09:41:31.069+02:00New website is live!I'm keeping everything book-related there, just to keep this a programming-oriented blog.<br />
<br />
<a href="http://www.bookcaravan.com/" target="_blank">http://www.bookcaravan.com</a>Anonymoushttp://www.blogger.com/profile/11701047179670165384noreply@blogger.com0tag:blogger.com,1999:blog-20264889.post-20859824392558395672014-09-26T12:00:00.000+02:002014-09-26T12:00:12.042+02:00Flashover: A new hard science fiction novella<h1 class="western" style="page-break-before: always;">
<div style="font-size: medium; font-weight: normal;">
Here is the first chapter of my new novella: Flashover.<br />
<br />
It's available for purchase at <a href="https://www.amazon.com/dp/B00NTX2X6Y" target="_blank">Amazon</a>, on <a href="https://www.smashwords.com/books/view/479139" target="_blank">Smashwords</a>, and soon on other platforms.<br />
<br />
I know it's odd for an Egyptian to write in English, but that's what you get when you drop him in the cauldron of literature and let him boil over for a decade. Oh <i>wait</i>, I did it again!<br />
<br />
Anyway, the story follows the life of Darren Swenson: a New Orleans teen who loves coding, as he goes about his life. He makes an important breakthrough, and things just evolve from there.<br />
<br />
This is a story about growth, about how the greatest things can have the humblest of beginnings. A cliché? Perhaps. It's just a beautiful one.<br />
<br />
Three of the chapters have already been posted on <a href="http://www.wattpad.com/story/23887454-flashover" rel="" target="_blank">wattpad</a>. </div>
</h1>
<h1 class="western" style="page-break-before: always;">
<a href="https://www.blogger.com/null" name="prologue"></a>
Prologue</h1>
<h1 class="western" style="page-break-before: always;">
<div style="font-size: medium; font-weight: normal;">
I find it funny how I used to wonder what an Artificial
Intelligence would feel like.<br />
Would it soar through cyberspace in unparalleled freedom? Or would
it feel like a bird forever trapped in a metal cage?<br />
I would have never guessed that one day I’d find out the answer
for myself.<br />
We all take our steps through life, and from the time we learn how
to walk, we keep going. Yet all that walking could only lead to a
single inevitable destination: a grave.
<br />
At least that’s true for you.
<br />
I still remember taking my first step.</div>
</h1>
<h1 class="western" style="page-break-before: always;">
<a href="https://www.blogger.com/null" name="c1"></a>
1 Sparks</h1>
<h1 class="western" style="page-break-before: always;">
<div style="font-size: medium; font-weight: normal;">
When I was little, my mother used to tell me that the universe was
made in sparks. Would that mean that at the beginning, someone had
clacked two cosmic stones together?<br />
<div align="center">
***</div>
I was flitting through the code on my screen. This damn bug was
driving me insane.<br />
“Stack corruption.” I whispered the most dreaded words a
programmer could ever hear.<br />
A stack corruption was a special kind of bug. Somewhere along the
line, the program had overwritten a small piece of memory, a tiny
piece, but it was located on the stack, and that changed everything.<br />
I clicked through the corrupt stack trace in my debugger, trying
to find the culprit. No use.<br />
The stack was the map with which a program could tell where it had
been and what it had been doing. There was no telling how badly a
program would misbehave after overwriting part of the stack, and you
know what the worst part is? That kind of bug gets the debugger
itself confused.<br />
I sighed and shut down my debugger, it would have to wait.<br />
I checked my email. Nothing yet.<br />
I should have received the message by now. I was starting to get
worried. Did it lose power? Was the process interrupted somehow?
What’s with the delay?<br />
I checked the estimated completion time on my phone again and
realised it was two minutes past the original estimate. I had to go
check it myself.<br />
I got up, turned off the computer, and left the library.<br />
<div align="center">
***</div>
<div align="left">
My name is Darren Swenson, and I’m seventeen years
old.</div>
The year is 2022, and last week, I finished writing the first
Structural Molecular Compiler.<br />
<div align="left">
The SMC was a piece of computer software. A suite of
compiler programs. Only it didn’t compile code into computer
programs. It compiled code into complex molecular machines, simply
known as nanobots. It compiled from a new programming language I’d
invented specifically for this purpose.</div>
<div align="left">
The language was called C@ – pronounced ‘cat’ –
and it was weird. It certainly looked like C++, but had its own
idioms and special keywords for automata.</div>
<div align="left">
It was hard work, and the compiler was very slow. It
had to account for millions of atoms interacting simultaneously
within a molecule, and produce something meaningful out of the code
it was fed. It would take days to compile anything of moderate
complexity.</div>
<div align="left">
At the moment, I was having it compile my second
invention, it was a mere 12,382 lines of C@ code, but when passed
through the compiler, it produced a peculiar piece of nano-machinery:
the Structural Molecular Assembler. I won’t get into its function
right now, but if you’ve studied biology, the best analogue for it
is a Ribosome on crack.</div>
<div align="left">
But the compiler was taking too long. I checked my
message queue again. Nothing.</div>
<div align="left">
I entered the basement.</div>
<div align="center">
***</div>
<div align="left">
Designing those things wasn’t easy. It took me two
years and a lot of unrelenting work. I had to study so many things in
so many fields, I think it’d be fair if I’d turned into a raving
lunatic in the process.
</div>
<div align="left">
What made it ironic was that I was somewhat of a
failure at school. History, geography, languages, crafts, and art
weren’t on my list of interesting subjects. Well, maybe geography
and crafts were mildly interesting.</div>
<div align="left">
As I walked into the basement, I could smell
something in the air. Something was wrong.
</div>
<div align="left">
I turned on the lights and went to my terminal, I
woke it up from standby and signed in.</div>
<div align="left">
“Oh shit!” “Shit! Shit! Shit!”</div>
<div align="left">
My compile farm had crashed.</div>
<div align="left">
I’d made it using old computers. Instead of using a
single computer for my work, I figured a long time ago that it was
much more efficient to network many cheaper computers into a cluster.
Well, in terms of cost versus performance that is. But my father had
told me not to worry about the power consumption. “Son, you let me
worry about that. You do your thing.” he had said, but I’d still
contributed through my freelance work online.</div>
<div align="left">
Well, now that it had crashed, I was having second
thoughts. All of that for nothing!</div>
<div align="left">
I ran a diagnostics routine and found 3 unresponsive
nodes. I spent two hours figuring out what went wrong.</div>
<div align="left">
Overheating. God damn heat. I needed better air
conditioning. Yeah, right. Fat chance of that.</div>
<div align="left">
I disconnected the nodes and started the process all
over again. I lowered the processing priority. It would take longer,
but it would mean less heat.</div>
<div align="left">
There we go again, two weeks down the drain.</div>
<div align="left">
It’s not like I could use the schematic yet anyway,
I still had a stack corruption bug to overcome.</div>
<div align="center">
***</div>
<div align="left">
“Hey Kat.” I greeted Katherine as I walked
through the living room on my way to the kitchen.</div>
<div align="left">
“Hey.” she said without looking back from the TV.</div>
<div align="left">
“What are you watching?” I asked.</div>
<div align="left">
“Just one of my stupid soap operas.” she said
nonchalantly.</div>
<div align="left">
“Is it any good?”</div>
<div align="left">
“Not particularly.”</div>
<div align="left">
“All right, good talk.”</div>
<div align="left">
“Yeah.”</div>
<div align="left">
I stepped into the kitchen and fixed myself something
to eat, then went upstairs into my room.</div>
<div align="left">
It was time to fix this bug, once and for all. I
delved in with all I had.</div>
<div align="center">
***</div>
<div align="left">
It took me a month to fix all bugs and finish my
tool. A whole damn month.</div>
<div align="left">
Thankfully, it was over. The compiler was finished
processing the schematic for the assembler as well.</div>
<div align="left">
The problem with the schematics that my compiler
generated was that, to build them, you’d need an assembler.</div>
<div align="left">
Since the schematic for the assembler was generated
by the compiler, you’d need an assembler to assemble one. A
chicken-egg situation.</div>
<div align="left">
When confronted with this problem, I decided to
cheat. Why not have something that already builds molecular machinery
do my work for me?
</div>
<div align="left">
That’s why I wrote the RNA converter, and now I had
a working converter and something to convert.</div>
<div align="left">
The RNA converter was a one-time-use tool at this
stage of my plan. I would use it on the schematic for the Structural
Molecular Assembler to convert it into something organic. Something
that a common bacterium could understand.</div>
<div align="left">
Something tangible.</div>
<div align="left">
I ran the converter and waited for several days, once
finished, I went online and made my order with a gene synthesis
company. Commercial DNA synthesis services were readily available
since the early 2000s. It was cheaper nowadays, thankfully.
</div>
<div align="left">
It cost me my allowance for almost a year. The RNA
strand was huge. No way around that. There was just no way to
optimise it further when forced to use a biological Ribosome as my
medium.</div>
<div align="left">
Now it was time to wait for the bacteria to arrive. I
opened up my code editor and toyed with some ideas. I was preparing
for the next step.</div>
<div align="center">
***</div>
<div align="left">
Two days later, I got the call.</div>
“Hello?”<br />
<div align="left">
“Hello, this is Dr. Patrick from Triple Helix. May
I speak to Mr. Swenson, please?”</div>
<div align="left">
DNA synthesis labs would only call you if something
went wrong, and something going wrong meant that they’d run the
strand against common and dangerous viral sequences and thought you
were attempting to synthesise a bioweapon of sorts. I didn’t want
to get my father involved and I certainly didn’t want a visit from
homeland security. My heart skipped a beat, but I kept my composure.</div>
“This is Darren. How can I help you?”<br />
<div align="left">
An awkward moment of silence passed as Dr. Patrick
overcame his shock at the voice of a teenager greeting him.</div>
“Um. Well, Mr. Swenson. We just ran the sequence you submitted
against our early detection database.” his voice sounded perplexed.<br />
Just what I thought.<br />
<div align="left">
“Anything I should be worried about?”</div>
<div align="left">
“Oh no, no, nothing like that. It’s just… the
strand is unique. I know this might come off as unprofessional, but
my colleagues and I were just wondering why it looks like nothing
we’ve ever seen, and the structure is almost…”</div>
I could hear whispers around him, and he tried to block the
microphone. I heard some scrambling and a new voice took over.<br />
<div align="left">
“What the hell are you trying to do, son?” a
gruff voice asked.</div>
<div align="left">
“Just a science project, sir.” I replied.</div>
<div align="left">
“Should we be worried, anything we need to report?”
the voice asked.</div>
<div align="left">
“No sir, it’s just a hobbyist project.”
</div>
<div align="left">
“That’s a damn big project, I’ll tell you
that.”</div>
<div align="left">
“I appreciate your discretion.” I said calmly.</div>
<div align="left">
He sighed and handed the phone back to Dr. Patrick,
who promptly apologised and ended the call.</div>
<div align="left">
I sat there, smiling, and visibly shaking.</div>
<div align="center">
***</div>
<div align="left">
I think that the ‘unprofessional’ phone call paid
off in the end. Because I got my package only something short of a
month later. That must have been their way of apologising. They must
have bumped me up the processing queue. Well, it was either that or
they hadn’t been getting a lot of work lately.</div>
<div align="left">
The day the package arrived, I was haunched over the
computer in my room reviewing some simulations.</div>
<div align="left">
Dad called from downstairs, and said there was a
delivery for me. I lurched in excitement and went to receive it.</div>
<div align="left">
I talked to the delivery man and signed the papers,
then moved the box to the basement, which I’d partially converted
into something resembling a makeshift cleanroom in anticipation of
this moment.</div>
<div align="left">
I deposited the bacterial culture into the incubator
and adjusted its parameters. It would take one day for the culture to
grow.</div>
<div align="left">
It was time to move my development computer down
here, so I went upstairs.</div>
<div align="left">
“Hey son, what’s the latest? Did you get it?”
my father was asking about the package.</div>
<div align="left">
“Yes, dad. It’s already incubating.”</div>
<div align="left">
“All right. Now prove that it actually works and
I’ll personally clean your room for a month.” he said with a
smirk.</div>
<div align="left">
“A challenge! Now I definitely will.” I said with
determination and a smile. “Could you help me move my computer
downstairs?”</div>
<div align="left">
“Oh no, I have work to do. You take care of that.”
he said as he picked up his briefcase and headed for the door.</div>
<div align="left">
“All right, dad. Thanks anyway. Good luck at work!”
I said as I strode towards the stairs.</div>
<div align="left">
“I guess I won’t be moving the desk downstairs.”
I murmured to myself.</div>
<div align="center">
***</div>
A day later, I had the first organic Structural Molecular
Assembler. Now let’s talk about its function.<br />
<div align="left">
Think of it as the offspring of a Rubik’s cube
mating with a Swiss army knife.</div>
The Structural Molecular Assembler does absolutely nothing, until
it’s fed with a radio signal.<br />
<div align="left">
Once it confirms its transponder ID, it starts
decoding the payload, which – as you might have guessed – is the
same format that the Structural Molecular Compiler produced. Once it
decodes the payload, it begins the assembly phase, where it rapidly
interprets the molecular schematic and constructs it atom by atom. It
also had a mode where it executed arbitrary instructions, step by
step. That mode was used to reconfigure the molecule, split it apart,
and make it do all kinds of crazy things, but more on that later.</div>
First order of business was the construction of the first
generation of synthetic assemblers. I plugged my handmade
communication adapter into my computer and initiated the process.<br />
Once they self-diagnosed and pinged the ready signal, I ordered
the organic ones to kill the bacteria and self-destruct.<br />
You see, organic is dangerous. Things could go wrong at any point.
The host bacteria could mutate, and transcription errors were common.
The assemblers would be destroyed if they didn’t pass routine
diagnostics by other assemblers, and I took extra precautions with
the organic version, but who knows? It might mutate and decide it
wanted to live. Evolution is bad in that regard, and very
unpredictable.<br />
Remember when I mentioned arbitrary instructions? Well, those do
serve a purpose. The assemblers could reconfigure themselves on
request. I designed them to be as modular as could be. You know how
carbon atoms can form fullerenes? Well, the assemblers were just as
versatile. They could form nanotubes and other allotropes just as
easy.<br />
And so, I wrote more code and had them manufacture flagella,
molecular propellers, and what-have-you. They attached the new
appendages to their modular bodies and could now move with purpose.
<br />
<div align="left">
Once the deed was done, I had the synthetic
assemblers migrate to a new environment and incinerated the original
culture.</div>
<div align="left">
The original culture numbered in the thousands, but
for what I wanted to do next I needed millions. I set it to reproduce
and went back to my normal routine. I was positively shaking as I
contemplated a grey-goo scenario, but I assured myself that this
would work.</div>
<div align="left">
A few days later, a forming mound of very fine dust
greeted me. I set down my sack of coal and got to work grinding it
down into dust.</div>
<div align="center">
***</div>
<div align="left">
“Hey dad! could you come down for a minute?” I
called out from the basement.</div>
<div align="left">
“One second!” I heard the reply.</div>
<div align="left">
A moment later my dad entered the basement.</div>
<div align="left">
“What’s up?” He asked.</div>
<div align="left">
“I just wanted to show you something!” I said,
unable to keep excitement from my voice.</div>
<div align="left">
“Okay. I’m here. What is it?”</div>
<div align="left">
I uncovered the object in the middle of the room with
a big smile.</div>
<div align="left">
“Holy shit! Is that diamond?” my father asked in
awe as he leaned in to inspect it.</div>
<div align="left">
“Damn right it is.”</div>
<div align="left">
“That means that you did it, son!” he exclaimed
and reached for a bear hug. I hugged him back.</div>
<div align="left">
“I sort of flopped it with this desk though.” I
said after a silent moment.</div>
<div align="left">
“Why?”</div>
<div align="left">
“I wanted to make a carbon-fibre desk for my
computer and this happened.”</div>
<div align="left">
“Why not just use wood?” he asked.</div>
<div align="left">
“Don’t toy with me dad? Nanobots can’t
manufacture wood, it’s made from trees.”</div>
<div align="left">
“I meant the way they make you do it in your crafts
classes.” he said with a smirk.</div>
<div align="left">
“Oh please, don’t remind me.”</div>
<div align="left">
“I guess this makes it official. Now I have to
clean your room for a month.” he said with fake dismay in his eyes.</div>
<div align="left">
“I have been waiting for this moment for so long.”</div>
<div align="left">
“You’re still picking up your own dirty laundry.
I’m not touching that.”</div>
<div align="center">
***</div>
<div align="left">
I stashed the small diamond into my pocket and set
out for a jeweller’s shop down-town.</div>
<div align="left">
After a long thoughtful walk I arrived there. A young
man greeted me.</div>
<div align="left">
“Hello. How can I help you?” he asked.</div>
<div align="left">
“I’d like to sell this diamond.” I said as I
lowered it to the counter.</div>
<div align="left">
“Oh. Can I see your license please?” he asked.</div>
<div align="left">
License? I should have researched this before trying.</div>
<div align="left">
“A license? I don’t have one.”</div>
<div align="left">
“Well, I can’t buy it off of you if you’re not
a licensed jeweller.”
</div>
<div align="left">
“All right, thank you.” I said as I reached for
it.</div>
<div align="left">
“May I take a look?” he asked before my hand
found it.</div>
<div align="left">
“Sure.” I pulled my hand back. He picked it up.</div>
<div align="left">
“Hmm… Here’s what I can tell you. This is a
pure rock, probably synthetic. I can’t tell for sure without a
thorough inspection.” he said as he inspected it with his
implements.</div>
<div align="left">
The assemblers produced 100% pure diamonds. No flaws,
no imperfections. It was simply impossible to occur in nature with
this purity. I definitely should have done my research.</div>
<div align="left">
“Where’d you get it?”</div>
<div align="left">
“I found it.”</div>
<div align="left">
“I see. Interesting. I don’t see any laser
engravings, either.”</div>
<div align="left">
“What does that mean?”</div>
<div align="left">
“Most synthetic diamonds are engraved by the
manufacturer.”
</div>
<div align="left">
“Is that bad?”</div>
<div align="left">
“It’s a little odd that this one isn’t, that’s
all.”</div>
<div align="left">
He handed it back, I picked it up and turned to
leave.</div>
<div align="left">
“Thanks.”</div>
<div align="left">
“No problem, please come again, and hey… here’s
my card. Feel free to call me if you… find anything else.”</div>
<div align="left">
“Uh… sure.”</div>
<div align="left">
I got the hint, and I felt mildly offended. I left
the store and went home.</div>
<div align="center">
***</div>
<div align="left">
It took longer than I expected to get rid of the
diamond desk and the diamond, but it was eventually done. I’d
programmed the assemblers with the ability to disassemble, which
makes the name ambiguous at best.</div>
<div align="left">
I vowed to never synthesise diamonds for profit
again. <i>I’</i><i>m</i><i> being careless</i>, I thought. I needed
to start small.</div>
<div align="left">
I needed the money for the raw materials, so I sat
there thinking, then it hit me.</div>
<div align="left">
I didn’t need money at all.</div>
<div align="left">
I spent some time working on the new code and
modifying the assembler, and that’s how the collectors were born.</div>
<div align="left">
The little machines did nothing more than seek a
certain material and haul it back to a certain point. If they went
too far or couldn’t get back, they self-destructed.</div>
<div align="left">
My prototypes worked great. They could seek target
molecules and atoms efficiently, but a large scale application would
prove difficult. I couldn’t use radio signals for this, it would be
insane. Coordinating the individual actions of billions of collectors
using radio was out of the question. I needed a better method for
communication.</div>
<div align="left">
I decided to study quantum mechanics in more depth,
and began experimenting with my creations.</div>
<div align="center">
***</div>
<div align="left">
The first couple of experiments were a complete
failure, then I made a breakthrough.</div>
<div align="left">
Using magnetostatic crystallite containment cages
that acted as atom traps, I managed to trap hydrogen atoms and push
them into one another. The process had a high chance of success.</div>
<div align="left">
Things had just got back on the right track. I’d
managed to develop a reliable procedure for entangling two particles.</div>
<div align="center">
***</div>
<div align="left">
“Hey Kat, what would you do if you had a machine
that could answer anything?” I asked my sister out of the blue.</div>
<div align="left">
Our relationship had improved after she found out
that I had actually ‘invented’ something. She was happy to see
father happy, and dad couldn’t have been happier ever since. It was
the best we’d seen him since mother died.</div>
<div align="left">
“Anything?” she pouted slightly as she asked.</div>
<div align="left">
“Anything.”</div>
<div align="left">
“I’d ask it why we’re here.”</div>
<div align="left">
“What do you mean?”</div>
<div align="left">
“I mean… I’d ask it why we exist. Nobody told
us why when we were made.”</div>
<div align="left">
“God would disagree.”</div>
<div align="left">
“Oh, please.” Katherine said.</div>
<div align="left">
“You don’t believe in God? I took you for a
believer.” I asked in shock.</div>
<div align="left">
“It’s not that. God doesn’t tell you why you
were created, he just tells you how to live. The big D<span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">O</span></span></span>s
and DO<span style="font-weight: normal;"> N</span><span style="font-weight: normal;">OT</span>s.
Do you believe in our lord and saviour?” she asked with a smirk.</div>
<div align="left">
“If you’re talking in biblical terms, then no. I
don’t.” I replied candidly.</div>
<div align="left">
“Then what do you believe in?”</div>
<div align="left">
“I believe in the Great Architect.”</div>
<div align="left">
“The what?”</div>
<div align="left">
“The Great Architect. If God exists then he’s the
greatest programmer and engineer to ever be.”</div>
<div align="left">
“Dear lord. Do you have to invent? Even in
religion?” she giggled.</div>
<div align="left">
“I’m not inventing anything, and it’s more of a
philosophical take than a religion.” I defended.</div>
<div align="left">
“Okay. I’m interested, tell me more.”</div>
<div align="left">
“The basic principle is this: where there’s a
program, there’s a programmer.”</div>
<div align="left">
“Oh, I see, and you think we’re programs?”</div>
<div align="left">
“No, I think we’re basic automata. The program is
reality.”</div>
<div align="left">
“So, you think that the universe is a simulation?”</div>
<div align="left">
“It has to be.”</div>
<div align="left">
“So, we’re like… living inside The Matrix?
There’s more to us outside the box?”</div>
<div align="left">
“Might be, or we could just be a part of the
simulation like everything else.”</div>
<div align="left">
“You do know that Stephen Hawking would disagree
with your theory?”</div>
<div align="left">
“Why do you say that?”</div>
<div align="left">
“Stephanie made me watch one of his videos where he
talks about how this universe is just one of an infinite number of
different universes.”</div>
<div align="left">
“Oh yes, I’ve watched that one. The Story of
Everything. You’re talking about the bit where he says that a grand
designer doesn’t have to exist, right?”</div>
<div align="left">
“Yeah.”</div>
<div align="left">
“It’s the one where he tells you to imagine an
ancient mechanism that churns out universes with different laws of
physics, and attributes our existence to that. The one where he says
that this universe is the only one where we <i>can</i> exist, right?”
I asked.</div>
<div align="left">
“I think so.”</div>
<div align="left">
“Well, he’s right about the last part, but we
have a name for such a mechanism in computing. One that explores all
possible outcomes in parallel.”</div>
<div align="left">
“What’s that?”</div>
<div align="left">
“A universal search algorithm. Levin Search. A
program.”</div>
<div align="center">
***</div>
<div align="left">
I needed a silent mode of communication. Something
that didn’t broadcast and receive. Something that two nanobots
could use to talk to each other.</div>
<div align="left">
Quantum entanglement hadn’t been proven useful for
communication. You could entangle two particles such as that when one
was measured, it would pick a state, and the other peer would
instantly be affected in the same way. That didn’t mean you could
use this for communication.</div>
<div align="left">
The No-communication theorem stated that it was
impossible to communicate information from one observer to another
while measuring the state of a particle.</div>
<div align="left">
I cheated. I didn’t measure it at all.</div>
<div align="left">
All communication ‘happened’ during
superposition. If observed, the transmissions simply stopped, but
every time the two systems simultaneously entered superposition,
something beautiful would happen: communication would take place.
When the wave function collapsed, any consequential actions were
carried out.</div>
<div align="left">
From the observer’s point of view, the system just
ticked.</div>
<div align="left">
This was of no use achieving faster-than-light
communications for practical uses, but it worked at the nano scale,
and my next step was using this technology to my advantage.
</div>
<div align="left">
The next generation of assemblers had sixteen ports,
each housing a collector and a supercooled quantum-entangled
particle, and each collector housed a peer. This communication system
allowed the assemblers to request materials from the collectors
instantaneously, noiselessly, and directly.</div>
<br />
<div align="left">
Now all I had to do was finish the code for my next
invention.</div>
</div>
</h1>
Anonymoushttp://www.blogger.com/profile/11701047179670165384noreply@blogger.com0tag:blogger.com,1999:blog-20264889.post-49120617539496516082013-04-21T18:24:00.001+02:002013-04-21T18:25:56.661+02:00كيف تتخلص من تحديد سرعة يوتيوب<div style="direction: rtl;">
<div style="text-align: right;">
تقوم وزارة الإتصالات وتى داتا على الأخص بالحدّ من سرعة يوتيوب مؤخرا فى مصر.<br />
<br /></div>
<div style="text-align: right;">
النظام يعمل عن طريق وضع خادم فى المنتصف الغرض الأصلى منه هو تسريع الفيديو عن طريق ما يسمى بالـ caching. حيث يقوم الخادم بتخزين الفيديو محليا مرة واحدة و يوزعه لكل من يطلبه على حد. تسمح جوجل لمزودى خدمة الإنترنت بتركيبه لتوفير خدمة أفضل للمستخدم.<br />
<br />
للأسف النظام يتم إستغلاله لفعل العكس تماما ويتم تحديد سرعة التحميل عن طريقه. لو ﻻحظت بطء و تقطع الخدمة على يوتيوب فغالبا أنت ضحيّة للنظام الجديد.<br />
<br />
<i>انا بقى زهقت.</i><br />
<br />
الطريقة التى سأشرحها ﻻ تعمل فى مصر فقط, بل قد تعمل فى دول أخرى حول العالم. و الآن هيا نعمل:<br />
<br />
قم بزيارة الصفحة الآتية: <a href="http://redirector.c.youtube.com/report_mapping">http://redirector.c.youtube.com/report_mapping</a> وانسخ عنوان الآيبى الذى سيظر لك (<span style="text-align: start; white-space: pre-wrap;">41.35.211.146) بالنسبة لى.</span><br />
<span style="text-align: start; white-space: pre-wrap;"><br /></span>
<span style="text-align: start; white-space: pre-wrap;">لو كنت على لينكس مثلى:</span><br />
<div style="text-align: left;">
<span style="text-align: start; white-space: pre-wrap;">sudo ufw deny proto tcp from 127.0.0.1 to 41.35.211.0<b>/24</b></span></div>
<div style="text-align: left;">
<span style="white-space: pre-wrap;">sudo ufw enable</span></div>
<div style="text-align: left;">
<span style="white-space: pre-wrap;"><br /></span></div>
<div style="text-align: right;">
ال 24 بالأعلى غير ضرورية, استخدمها شخصيا لحجب ذلك النطاق كاملا لأريح رأسى. لو تود يمكنك إزالتها ووضع الآيبى كاملا.</div>
<div style="text-align: left;">
<span style="white-space: pre-wrap;"><br /></span></div>
<div style="text-align: start;">
<span style="white-space: pre-wrap;">لو كنت على ويندوز قم بحجب الرقم من الفايروول المفضل لك.</span></div>
<div style="text-align: start;">
<span style="white-space: pre-wrap;"><br /></span></div>
<div style="text-align: start;">
<span style="white-space: pre-wrap;">الحل يعمل عن طريق حجب خادم المزود, فى تلك الحالة يضطر يوتيوب للإتصال بالخادم الرئيسى فى الولايات المتحدة وبتلك الطريقة تتجنب تحكم مزود الخدمة فى سرعتك.</span></div>
<div style="text-align: start;">
<span style="white-space: pre-wrap;"><br /></span></div>
<div style="text-align: start;">
<span style="white-space: pre-wrap;"><b>رسالة لتى داتا ووزارة الإتصالات: عيب عليكم كدة. احنا بندفع فلوس مش بنشحت.</b></span></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/11701047179670165384noreply@blogger.com1tag:blogger.com,1999:blog-20264889.post-74281626876068428052011-05-27T19:33:00.005+02:002011-05-27T21:21:25.872+02:00C++0x: member_of template<code><pre class="brush: cpp">template<typename F><br />struct member_of<br />{<br />private:<br /> //template <class T, typename R, typename... Args> static typename T* __fn_to_cx(R(T::*)(Args...));<br /> template <class T, typename R> static typename T __fn_to_cx(R(T::*)());<br /> template <class T, typename R, typename A1> static typename T __fn_to_cx(R(T::*)(A1));<br /> template <class T, typename R, typename A1, typename A2> static typename T __fn_to_cx(R(T::*)(A1,A2));<br /> template <class T, typename R, typename A1, typename A2, typename A3> static typename T __fn_to_cx(R(T::*)(A1,A2,A3));<br /> template <class T, typename R, typename A1, typename A2, typename A3, typename A4> static typename T __fn_to_cx(R(T::*)(A1,A2,A3,A4));<br /> template <class T, typename R, typename A1, typename A2, typename A3, typename A4, typename A5> static typename T __fn_to_cx(R(T::*)(A1,A2,A3,A4,A5));<br />public:<br /> typedef typename decltype(__fn_to_cx(F())) type;<br />};</pre></code><br />Usage: member_of<&SomeClass::SomeMember>::type will always be of type SomeClass.<br /><br />That is all.Anonymoushttp://www.blogger.com/profile/11701047179670165384noreply@blogger.com0tag:blogger.com,1999:blog-20264889.post-29221548349581699752011-01-20T13:12:00.004+02:002011-01-22T00:08:15.017+02:00ثورة خلويه, الجزء الأول<div style="font-family: 'lucida grande', tahoma, verdana, arial, sans-serif;<br /> font-weight: bold; font-size: 13px; direction: rtl;" align="right"><br /><br />الثلاثاء 20/1/2011 -- وقد أعلنت مجموعة “بروتينات حرة من أجل مستقبل أفضل“ تضامنها مع الدعوة التى تم طرحها بجعل يوم الخامس و العشرون من يناير يوما تاريخياً فى مستقبل الوطن, إعتدادا بما حدث فى الخليّة التونسية الشقيقة و ثورتها المتّقدة ضد البريونات و النواة الحاكمة.<br /><br />و فى سياق آخر اعلنت سيدة الأعمال رنا البوليماريسى مالكة سلسلة مصانع البوليماريسى الشهيرة معارضتها الشديدة للفكرة, قائلة بأن الدافعين بمثل تلك الأمور بالتأكيد عناصر خارجية دخيلة تعمل على زلزلة الإستقرار القومى و إشعال نيران الفتنة بين الأشقاء. مؤكدة ان الشعب لن ينساق وراء تلك الأفكار الغير متزنة على حد قولها. مبدية اسفها الشديد على تمادى البعض و محاولاتهم المتعددة للإنتحار عن طريق الأكسدة.<br /><br />و فى حوار مع عدد من البروتينات قال حسين هيماجلوبين “والله أنا زهقت, لحد امتى حنفضل فى اللى عايشينه ده؟ اشتغل انا ازاى ولا اوكل ولادى؟ انتو عارفين جزئ الإيه تى بى بقى بكام؟” وا ستطرد قائلا “انا يمكن مقدرش اغيّر حاجة لوحدى, بس لو التحمنا كلنا اكيد نقدر نوصل صوتنا للنواة”.<br /><br />بينما قال الشاعر محمود هلكاس انه على إستعداد لفعل اى شئ لتصل أصداء التغيير لجميع انحاء السيتوبلازم وما وراء ذلك, حتى و ان كانت النواة (و الكلام على لسانه) كالغاز الخامل. مضيفا: “لإمتى حتفضلو هيدروفوبيك؟ خليكم إيجابيين بقى”.<br /><br />********<br /><br />الباقى بكرة بقى ان شاء الله, تحياتى لكل الأطباء و دارسى البيولوجى و الكيمياء (حتى لو دراسة حرة او سطحية زيي), و كل من يفتح عينيه ليقرأ من اجل القراءة.<br /><br />و لا عزاء للنحو :(</div>Anonymoushttp://www.blogger.com/profile/11701047179670165384noreply@blogger.com0tag:blogger.com,1999:blog-20264889.post-28094954681024585772010-12-01T10:55:00.004+02:002010-12-01T11:55:01.670+02:00Netsweeper فى بيتنا? ياللهول!<div style="font-family: 'lucida grande', tahoma, verdana, arial, sans-serif;<br /> font-weight: bold; font-size: 13px; direction: rtl;" align="right"><br /><br />فى هدوء تام, و بعيداً عن الأعين. مستغلّة فوضى الإنتخابات, بدأت الحكومة المصرية فى مراقبة الإنترنت بتركيب نظام نت سويبر (Netsweeper) البارحة. وهو ما يسمح لها بمراقبة و حجب المواقع و الرسائل الشخصية و تسجيلها.<br /><br />النظام يقبع بين المستخدم و الخادم, و يعمل على رصد و تسجيل و فلترة كل الإتصالات بين الجانبين, و حجب المحتوى عند الحاجة. ولايسعنى سوى التخوّف مما يمكنهم عمله به.. (http://www.netsweeper.com/index.php?page=netsw_gov)<br /><br />لولا خطأ فنّى (على ما يبدو هناك خطأ فى الـ policy حاليا) لما شعر أحد بشئ من الأساس, الخطأ يقوم بتحويل المستخدم إلى الخادم: netsweeper.gizasystems.local (وهو لا يعمل نظرا لوجوده فى شبكة محليّة على ما يبدو)<br /><br />قد يظهر مثل هذا العنوان فى المتصفح عند محاولة الولوج لموقع MSN على سبيل المثال:<br />http://netsweeper.gizasystems.local:8080/webadmin/deny/index.php?dpid=49&dpruleid=56&cat=28,37&ttl=-200&groupname=default&policyname=default&username=-&userip=41.234.***.***&connectionip=1.0.0.127&nsphostname=netsweeper.gizasystems.local&protocol=nsef&dplanguage=-&url=http://www.msn.com/%3fwa%3dwsignin1.0<br /><br />العنوان يحوى الـ IP الخاص بالمستخدم و الموقع الذى حاول زيارته, حين يتم الإنتهاء من تركيب هذا النظام لن يشعر المستخدم بشئ, فبينما سيتم تسجيل زيارته للمواقع المسموح له بزيارتها, المواقع المحجوبة ببساطة لن تعمل.<br /><br /><span style="font-style:italic;">ربنا يدشدش الطوبة اللى تحت راسك يا جورج اورويل, وعقبال مايدخلولنا التلسكرين.</span><br /></div>Anonymoushttp://www.blogger.com/profile/11701047179670165384noreply@blogger.com0tag:blogger.com,1999:blog-20264889.post-70206554666231364612010-06-28T17:44:00.004+03:002010-06-28T18:45:20.344+03:00معلومة عشوائيّة<div style="font-family: 'lucida grande', tahoma, verdana, arial, sans-serif;<br /> font-weight: bold; font-size: 13px; direction: rtl;" align="right"><br /><br />يبدو أن موقع <a href="http://www.aswatna-eg.net/">أصواتنا</a> (وهو أحد المواقع المعنيّة بالتوعية السياسية/الإنتخابيّة فى مصر) تم <a href="http://whois.domaintools.com/aswatna-eg.net">تسجيله</a> بمعرفة السيّد <a href="http://www.ifes.org/About/Staff/Rich-Twigg.aspx">ريتشارد تويح</a>, مدير النظم المعلوماتية فى <a href="http://www.ifes.org">المؤسسة الدولية للنظم الانتخابية</a> وهى منظمة دولية "غير حكوميّة" لا تهدف للربح, ومقرها "واشنطن".<br /><br /></div>Anonymoushttp://www.blogger.com/profile/11701047179670165384noreply@blogger.com0tag:blogger.com,1999:blog-20264889.post-84710227073457960712010-06-20T21:32:00.005+03:002010-06-20T21:57:14.248+03:00ثقب فى رأسى<div align="center"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/dgRA-6Fi6wk&hl=en_GB&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/dgRA-6Fi6wk&hl=en_GB&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object><br><a href="http://www.facebook.com/l.php?u=http%3A%2F%2Far.wikipedia.org%2Fwiki%2F%25D9%2585%25D8%25AE%25D8%25B7%25D8%25B7_%25D9%2581%25D9%2588%25D8%25B1%25D9%2588%25D9%2586%25D9%2588%25D9%258A&h=422b0OJCD9Iy4zgblL-kdP4KjMA" target="_blank">الظاهره بالأعلى تسمّى بمخطط فورونوى</a><br /></div><div style="font-family: 'lucida grande', tahoma, verdana, arial, sans-serif;<br /> font-weight: bold; font-size: 13px; direction: rtl;" align="right"><br />هل الفيزياء إنعكاس للرياضيّات؟ أم أنّ العكس هو الصحيح؟ <br /><br />الرياضيّات الحقّة هى أن تضع حجران فى راحه يدك و تقول "اثنان", تضيف حجراً آخر فتقول: ثلاثه.<br /><br /> وعلى ذلك, تكون قواعد الرياضيات ذاتها مجرّد إنعكاس عقلى لما نراه من حولنا: قواعد الفيزياء, تلك القواعد التى وضعها الله لتتحكم فى و تسيطر على المادة و الطاقة سواء. <br /><br />ولو كان كل ما فى رأسك و كتبك و علمك, وكل ما تعرفه عن الرياضيات هو مجرّد إنعكاس, صورة ديناميكيّة, سريعة البخر.. رسمتها خلايا مخّك العصبية على لوحة عقلك, مختلطة بتجارب و ذكريات, أحلام و أوهام, رغبات ومخاوف.. <br /><br />فهل لك أن تثق بتلك الصورة؟ <br /><br />-------<br /><br /> ماذا لو قلت لك أن "قواعد الفيزياء" التى تراها من حولك هى بدورها مجرد إنعكاس؟ حين تسقط التفاحة من الشجرة فهى تطيع قوانين الجاذبية.. ولكن.. لحظة واحدة... ما هى تلك الجاذبية من الأساس؟؟<br /><br /> إنس ما تعلمته فى المدرسة (لو كنت تذكره أساساً) و ركزّ فى اللى جاى... ركزّ فى اللى جاى (عذراً عزيزى أحمد مكّى). <br /><br />الجاذبية يا صديقى هى تفاعل بين الجسيمات, تفاعل واحد من بين العديد من التفاعلات الممكنة, أو ما يطلق عليه القوى الأساسية, بعضها لا يمكننا رصد آثاره بشكل مباشر, و البعض الآخر يمكننا الإحساس به: كالتجاذب؛ البعض الآخر قد يمكننا رصده بالعين المجرّدة مباشرة, كالكهرومغناطيسيّة (الفوتونات/الضوء), و البعض مسؤول بشكل مباشر عن تماسك المادة.<br /><br /> حين تتفاعل الجسيمات مع بعضها ينشأ ما يسمى بالحقل الفيزيائى, التفاحة تسقط لأنها داخل حقل الجاذبية الخاص بكوكب الأرض, و التفاحة ذاتها لها حقل جاذبيّة خاص بها.. وهو ما يجعل ذرات التراب تلتصق بها مثلا.<br /><br /> هذا عن حقول الجاذبية, فماذا عن الحقول الأخرى؟ <br /><br />هل تذكر تلك القوى التى تحدثت عنها فى الفقرة السابقة؟ تلك المسئولة بشكل مباشر عن تماسك المادة؟ ما هو الحقل الفيزيائى الناشئ عنها؟؟ <br /><br />فكّر.. <br /><br />نعم, الحقل هو المادّة ذاتها, الحقل هو الواقع من حولك.. <br /><br />الحقل هو أنت شخصيّا... و هل تعلم ما يعنيه هذا؟ <br /><br />يعنى أنّك أنت شخصيّا مجرد إنعكاس شديد التعقيد لقواعد بسيطة بذاتها, قواعد لو إختلفت قليلاً, ولو بمقدار واحد من تريليون على التريليون فى مقاديرها, لما كنت وُجدت من الأساس, ولما وُجد الواقع كما نعرفه الآن. <br /><br />مرحباً بك فى عالم فيزياء الكمّ.<br /><br /> ----- <br /><br />"أولا يذكر الإنسان أنا خلقناه من قبل ولم يك شيئا"</div>Anonymoushttp://www.blogger.com/profile/11701047179670165384noreply@blogger.com0tag:blogger.com,1999:blog-20264889.post-28890436933173999752010-01-09T13:15:00.023+02:002011-05-27T21:21:59.009+02:00Writing a Google Chrome extension: How to access the global context of the embedding page through a content script.<p>If you just want the code, skip all of this and get to business at the end of this entry.</p><p>Otherwise, here's the breakdown..</p><p>I've been writing a Google Chrome extension for the past week, and today I got to the point where I write a content script, if you don't know what that is, put simply: it's a javascript file that gets run against certain websites every time they're loaded (as in, Chrome's equivalent of a <a href="http://en.wikipedia.org/wiki/Greasemonkey" target="_blank">Greasemonkey</a> script); however, there's a catch.</p><p>Due to the way Chrome handles scripting internally (via <a href="http://code.google.com/p/v8/" target="_blank">Google V8</a>), the contexts of the javascript bits running in the original page and the extension's are completely separate; In plain English, this means that it is impossible to access a global variable that lives in the context of the webpage from the extension, and the same goes for the other way around;<br /><br />Consider a page with the following code:</p><code><pre class="brush: html"><html><br /><head><br /><script><br />var foo = true;<br />function bar() {<br /> return "foo is: " + foo;<br />}<br /></script><br /></head><br /><body><br /></body><br /></html></pre></code>If you create a content script that runs against this page and tries to access the values of 'foo' or 'bar', the attempt will result in 'undefined', the variables simply do not exist in the context you're trying to access them from..<p> That isolation technique is understandable from a security point of view, but sometimes you <em>have to</em> do just that; for example, in situations such as mine:<br />The page I was writing the content script for had a complex AJAX system in place; which maintains, validates, and updates a security token in the background by communicating with the server, and since I didn't want to disrupt the mechanism already in place by disabling that system and implementing my own; The simplest (and cleanest) solution that popped in my mind was to read the global variable containing said token directly in a timely fashion.</p><p> This is when I started searching around for a possible work-around for this problem, I had read something about indirect page-extension communication while skimming through the Chrome extension API documentation before, and I finally <a href="http://code.google.com/chrome/extensions/content_scripts.html#host-page-communication">found it</a>.<br /><br />Let me quote it here again:</p><blockquote><span style="font-size:small;"><em>Although the execution environments of content scripts and the pages that host them are isolated from each other, they share access to the page's DOM. If the page wishes to communicate with the content script (or with the extension via the content script), it must do so through the shared DOM. </em></span><span style="font-size:small;"><em><br /><br />An example can be accomplished using custom DOM events and storing data in a known location.</em></span></blockquote><p>That was followed by an example that shows how to setup a pseudo-communication channel initialized by both parties (the extension and the page). But wait, doesn't this assume (and require) that both parties participate? what if the page had no idea that my script is there? and isn't this the typical case?</p><br /><p><a href="http://www.aaronboodman.com/2009/04/content-scripts-in-chromium.html" target="_blank">Some older builds of Google Chrome apparently had a way</a> to expose the global object of the target page to the content scripts (the contentWindow built-in global variable), but <a href="http://groups.google.com/group/chromium-extensions/browse_thread/thread/a4ff886cfecf80ca" target="_blank">it got removed at some point.</a></p><br /><p>Rules are made to be broken, and I decided that I'll be breaking this one today.</p><br /><p> After tinkering around for a whole day I finally managed to do this, so I'll slowly walk you through my thought process: Since both contexts share the DOM, both can modify it, but it turns out that it belongs to the page, not the extension, and new elements added to the page by the extension are ultimately "owned" by the original page in the end.</p><br /><p>Once I realized this, and wrote some test cases where the page manipulated new items that got inserted by the content script long after the content script had finished it's execution, I began to think of <script> tags.</p><br /><p>What happens if you dynamically insert a <script> tag from the content script's context? which context would it end up in? Long story short: it ends up running in the original page's context, not the extension's; which was an awesome revelation at the time!</p><p>After a few tests I was positive that my injected scripts were running the way I wanted them, a few alert()'s showed me that they could access global variables from the original page just like as if they were parts of it, but getting those values back to the extension turned out to be another story.</p><p>At first I thought about doing it the way I quoted above, set up some custom event handlers and have a basic messaging system in place, where the extension would send in commands and recieve responses through the custom event handler; but being me, I just couldn't settle for that.</p><p>At first I had something as simple as this:</p><code><br /><pre class="brush: javascript">function injectScript(source)<br />{<br /> var elem = document.createElement("script");<br /> elem.type = "text/javascript";<br /> elem.innerHTML = script;<br /> return document.head.appendChild(elem);<br />}</pre><br /></code><p>But then I modified it a little bit to accept functions as a parameter for convenience, which it would convert into strings and have them injected and run like normal; it worked and all went well, but then again, I thought: what if I could pass parameters transparently to those functions? and I revised it again, and again, and again, and it eventually worked by converting the parameters to JSON, writing them in, then converting them back through a small bootstrapper that calls the wrapped function transparently.</p><p>Then I thought about return values; how can I get those back? at first I thought about the custom event handler strategy, but then I realized that it wouldn't work the way I intended for it in the first place, using event handlers means that you must provide a closure to recieve the value through, I wanted to this in a different (procedurally-transparent) way.</p><p>After expirementing a little more, I found out that <code><span>appendChild</span></code>() didn't return back to the caller until the injected script finished executing, effectively blocking execution of the caller for that duration, which I found useful for what I was going to do next.</p><p><em>(Since I'm writing a browser extension that will only work in Google Chrome, and thereafter don't have to care about browser cross-compatibility at all, I usually exploit this kind of thing to the brim, standard or not, if it works I'll use it; IE can go to hell kindly =P)</em></p><p>The <a href="http://code.google.com/chrome/extensions/content_scripts.html#host-page-communication" target="_blank">example</a> I mentioned earlier used a hidden <div> for communication, and I could've done the same, albeit JSON data tends to break HTML often, that, and the fact that I hate the clutter of it all, at first I thought about transferring the data by assigning a value to a custom field attached to the HTMLScriptElement, but that didn't work, the isolated contexts and all.</p><p>Then it hit me, JSON is inevitably valid ECMA/Javascript as far as v8 is concerned, so I had the script convert the return value to JSON then overwrite itself with it.</p><p>For this, we assign a random "id" attribute to the <script> block, I know, not strictly valid HTML, but it works and Chrome doesn't complain for the matter; As a final step I rewrote some of the argument parsing code so that it passes functions correctly (which v8's strict JSON implementation refuses to process), custom objects, and have it skip JSON conversion for numbers/booleans, pass on Date/RegExp objects too (which v8::JSON messes up badly).</p><p>I also thought about exceptions, and added a mechanism to catch and transparently re-throw them in the original context.</p><p>And here's the final result: (Licensed under the <a href="http://www.opensource.org/licenses/mit-license.php" target="_blank">MIT license</a>)</p><code><br /><pre class="brush: javascript">//////////////////////////////////////////////////////////////////////////////////////////////<br />// Copyright(C) 2010 Abdullah Ali, voodooattack@hotmail.com //<br />//////////////////////////////////////////////////////////////////////////////////////////////<br />// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php //<br />//////////////////////////////////////////////////////////////////////////////////////////////<br /><br />// Injects a script into the DOM, the new script gets executed in the original page's<br />// context instead of the active content-script context.<br />//<br />// Parameters:<br />// source: [string/function]<br />// (2..n): Function arguments if a function was passed as the first parameter.<br /><br /><br />function injectScript(source)<br />{<br /> <br /> // Utilities<br /> var isFunction = function (arg) { <br /> return (Object.prototype.toString.call(arg) == "[object Function]"); <br /> };<br /> <br /> var jsEscape = function (str) { <br /> // Replaces quotes with numerical escape sequences to<br /> // avoid single-quote-double-quote-hell, also helps by escaping HTML special chars.<br /> if (!str || !str.length) return str;<br /> // use \W in the square brackets if you have trouble with any values.<br /> var r = /['"<>\/]/g, result = "", l = 0, c; <br /> do{ c = r.exec(str);<br /> result += (c ? (str.substring(l, r.lastIndex-1) + "\\x" + <br /> c[0].charCodeAt(0).toString(16)) : (str.substring(l)));<br /> } while (c && ((l = r.lastIndex) > 0))<br /> return (result.length ? result : str);<br /> };<br /><br /> var bFunction = isFunction(source);<br /> var elem = document.createElement("script"); // create the new script element.<br /> var script, ret, id = "";<br /><br /> if (bFunction)<br /> {<br /> // We're dealing with a function, prepare the arguments.<br /> var args = [];<br /><br /> for (var i = 1; i < arguments.length; i++)<br /> {<br /> var raw = arguments[i];<br /> var arg;<br /><br /> if (isFunction(raw)) // argument is a function.<br /> arg = "eval(\"" + jsEscape("(" + raw.toString() + ")") + "\")";<br /> else if (Object.prototype.toString.call(raw) == '[object Date]') // Date<br /> arg = "(new Date(" + raw.getTime().toString() + "))";<br /> else if (Object.prototype.toString.call(raw) == '[object RegExp]') // RegExp<br /> arg = "(new RegExp(" + raw.toString() + "))";<br /> else if (typeof raw === 'string' || typeof raw === 'object') // String or another object<br /> arg = "JSON.parse(\"" + jsEscape(JSON.stringify(raw)) + "\")";<br /> else<br /> arg = raw.toString(); // Anything else number/boolean<br /><br /> args.push(arg); // push the new argument on the list<br /> }<br /><br /> // generate a random id string for the script block<br /> while (id.length < 16) id += String.fromCharCode(((!id.length || Math.random() > 0.5) ?<br /> 0x61 + Math.floor(Math.random() * 0x19) : 0x30 + Math.floor(Math.random() * 0x9 )));<br /><br /> // build the final script string, wrapping the original in a boot-strapper/proxy:<br /> script = "(function(){var value={callResult: null, throwValue: false};try{value.callResult=(("+<br /> source.toString()+")("+args.join()+"));}catch(e){value.throwValue=true;value.callResult=e;};"+<br /> "document.getElementById('"+id+"').innerText=JSON.stringify(value);})();";<br /><br /> elem.id = id;<br /> }<br /> else // plain string, just copy it over.<br /> {<br /> script = source;<br /> }<br /><br /> elem.type = "text/javascript";<br /> elem.innerHTML = script;<br /><br /> // insert the element into the DOM (it starts to execute instantly)<br /> document.head.appendChild(elem);<br /><br /> if (bFunction)<br /> {<br /> // get the return value from our function:<br /> ret = JSON.parse(elem.innerText);<br /><br /> // remove the now-useless clutter.<br /> elem.parentNode.removeChild(elem);<br /><br /> // make sure the garbage collector picks it instantly. (and hope it does)<br /> delete (elem);<br /><br /> // see if our returned value was thrown or not<br /> if (ret.throwValue)<br /> throw (ret.callResult);<br /> else<br /> return (ret.callResult);<br /> }<br /> else // plain text insertion, return the new script element.<br /> return (elem);<br />}<br /></pre><br /></code>Anonymoushttp://www.blogger.com/profile/11701047179670165384noreply@blogger.com13tag:blogger.com,1999:blog-20264889.post-44467647355600320732009-08-31T19:36:00.002+02:002009-08-31T21:04:21.591+02:00THE CHIMPUTER AND THE DIGITAL BANANAI've always been fascinated by <a href="http://en.wikipedia.org/wiki/Analog_computer">analog computers</a>, and let me define this term for simplicity's sake, an analog computer is a closed system of physical objects/particles, constantly interacting and performing metaphorical/physical math to solve a certain problem.<br /><br />To be honest, if you think of today's digital computer, there's not much of a difference between a digital computer and an analog one, today's digital computers use the same concepts, for instance, memory is stored on chips with matrices of silicon gates, each gate is composed of two layers of silicon, P and N, which interact in a special way that allows for a metaphorical value (the binary 0 or 1) to be stored at said gate, at the bottom line, OFF and ON inevitably become 0 and 1.<br /><br />With all of the particles involved in this process, you end up using physical particles to represent information.<br /><br />I'm a big fan of abstract, and even quantum computers use similar techniques for information storage and retrieval, although utilizing a much more delicate property of physical particles, information is stored and retrieved by harnessing the physical properties of the particles themselves, so, you can think of qubits (the quantum computer's equivalent of a bit) as meta-data stored ON a physical particle.<br /><br />So, in essence, one could argue that you can build a computer out of anything with strict rules of interaction, provided by the right elements, you could build a logic gate out of anything dynamic (which responds to external events and affects surrounding objects in the same sense), even sticks of wood and a water stream serving as current would serve as an adequate (but not optimal) solution, the only problem would be arranging them in the <span style="font-weight: bold; font-style: italic;">right</span> way.<br /><br />So, can you use light for this? I bet you could, and <a href="http://en.wikipedia.org/wiki/Photonic_computing">photonics</a> are quite close to becoming common place.<br /><br />Can we use monkeys for this? I BET YOU COULD!<br /><br /><div style="text-align: center;"><span style="font-size:180%;"><span style="font-weight: bold;">Preface</span></span><br /></div><br />As outlined above, as long as elements of the system can affect other elements, any chain of events could be considered a form of computing, and as long as a current can turn another current off, you can build a logic gate out of it, and this includes trained monkeys, and a river.<br /><br /><div style="text-align: center;"><span style="font-size:180%;"><span style="font-weight: bold;">Hardware platform</span></span><br /></div><br />In this section I'll propose a potential approach to building a <span style="font-weight: bold;">CHIMPUTER</span>, and let's begin by defining the term <span style="font-weight: bold;">CHIMPUTER</span>, and the hardware architecture: A <span style="font-weight: bold;">CHIMPUTER</span> is a closed system with trained <span style="font-weight: bold;">MONKEYS</span> and <span style="font-weight: bold;">CHIMPS</span> inside, all seated by a stream of water that runs throughout the system, the arms of said monkeys are tied to wooden gates with short ropes, data is transferred through the water stream as <span style="font-weight: bold;">BANANAS</span> (or<span style="font-weight: bold;"> DIGITAL BANANAS</span> for short), and as the first banana enters the stream, the highly trained monkey will try to grab it, pulling the rope in the process, switching gates on and off, and thus interrupting or permitting the flow of a different stream somewhere else.<br /><br />The rope could also be tied to a <span style="font-weight: bold;">BANANA DISPENSER</span> that activates different currents throughout the machine's lifetime.<br /><br />So, how does computation fall into this? and here we come to the memory, which is stored in matrices of <span style="font-weight: bold;"><a href="http://en.wikipedia.org/wiki/8-bit">8BANANA</a> BOXES</span>, divided into small partitions, and placed in a <span style="font-weight: bold;">BANANA MAZE</span>, memory addressing is done through the rope pulling of <span style="font-weight: bold;">MEMORY CHIMPS</span> that pull the ropes in a specific sequence, influenced by the information carried by the stream of water, thus, opening and closing specific gates inside the <span style="font-weight: bold;">BANANA MAZE</span>, through which a highly trained <span style="font-weight: bold;">MEMORY CHIMP</span> will navigate and fetch the destination box and then dispatch it to the <span style="font-weight: bold;">C-PU</span>.<br /><br />Same logic applies to the <span style="font-weight: bold;">C-PU</span>, the rope-pulling-logic-gates can drive the whole system, for computation, you have the <span style="font-weight: bold;">AND-CHIMP</span>, the <span style="font-weight: bold;">OR-CHIMP</span>, the <span style="font-weight: bold;">ADD-CHIMP</span>, and other specialists trained to process their instructions specifically.<br /><br /><div style="text-align: center;"><span style="font-size:180%;"><span style="font-weight: bold;">I/O</span><br /></span></div><br />Input is done using punch-cards, as you'd expect from a top-of-the-line analog computer.<br />Output: that's my favorite, monkey-with-the-typewriter can press keys based on where the bananas fall.<br /><br />Of course you'd argue that chimps do all the cool work, and monkeys do the menial tasks, but what can I say, chimps are smarter by nature, and for a successful design, you must not neglect such critical details.<br /><br /><div style="text-align: center;"><span style="font-size:180%;"><span style="font-weight: bold;">Operating System</span></span><br /></div><br />The machine will come with a pre-installed copy of <span style="font-weight: bold;">MONKEYSOFT® BLINDS©</span>: <span style="font-weight: bold;">FIESTA</span>™, a fast, feature-rich, secure, and stable operating system.<br /><br /><div style="text-align: center;"><span style="font-size:180%;"><span style="font-weight: bold;">Instruction set<br /><br /></span></span><div style="text-align: left;"><div style="text-align: left;">The system will include a <span style="font-weight: bold;">BASIC-CHIMP</span> to interpret, and natively execute <span style="font-weight: bold;">MONKEY-BASIC</span> instructions, <span style="font-weight: bold;">MONKEY-BASIC</span> is a powerful, high-level, and highly-structured language with a procedural approach, and a <span style="font-weight: bold;">CHIMP-ORIENTED</span> feature set; designed for ease of use and flexibility; and of course line numbers are mandatory, too bad you must use punch-cards to input the program still.</div><span style="font-size:180%;"><span style="font-weight: bold;"></span></span></div><div style="text-align: left;"><span style="font-size:180%;"><span style="font-size:100%;"><span style="font-weight: bold;"></span></span><span style="font-weight: bold;"></span></span><br /><span style="font-size:180%;"><span style="font-weight: bold;"></span></span></div></div><div style="text-align: center;"><span style="font-weight: bold;font-size:180%;" >In closing</span><br /></div><br />You can see it, can't you? this technical marvel can (and will, once it goes live), alter the way we think of modern computers, and have a notable impact on everyone's day-to-day life.<br /><br />Now all I need is adequate funding for my exceptional ideas.Anonymoushttp://www.blogger.com/profile/11701047179670165384noreply@blogger.com0tag:blogger.com,1999:blog-20264889.post-46788659561302179452009-08-06T18:27:00.008+03:002009-08-06T19:07:20.980+03:00The teapot of madness..Hello again, and welcome to my blog!<br /><br />As strange as this may seem, I think my only motive to write these days is purified, condensed depression, the kind that comes as dark blocks of oozing matter, which would inevitably drive a whole nation into mass-suicide by hydro-electrolyzed-strangulation if a small chunk was slipped into the water supplies by any chance; the bottom line is, you get the point.<br /><br />My need to write seems to be somehow linked with strong emotional states at the subconscious level, as I'm only incited to indulge in meaningless ramblings when I am pushed into one of those states, and I guess that writing fulfills my need to communicate with others, if not before all; my own self.<br /><br />By now you're expecting me to state 'the why' after stating 'the how', and my answer is, nothing that can be solved by writing about, people are selfish @#$%, life sucks, etc; and now I'm done, what a relief..<br /><br />Fulfilled my need to ramble, deflated some pressure from the boiling teapot in my head, thanks, greetings, and have a good day!Anonymoushttp://www.blogger.com/profile/11701047179670165384noreply@blogger.com0tag:blogger.com,1999:blog-20264889.post-5656751889570778802009-03-12T01:38:00.005+02:002009-03-12T08:53:36.785+02:00Of spaghetti and the hot plate of failure...Time for my 2nd post, I've also had trouble gathering my senses, trying to force myself into expressing what's been going through my mind recently.<br /><br />Sometimes I feel like I'm surging with ideas, and this gives me the desperate urge to express them and materialize said ideas into something useful, people call this the creative process, I call it neural venting.<br /><br />So, as a first step, as of now, I'll start venting here, for I believe that a worthy thought not written is a lost cause, the brain is a fine instrument, but our memory is not infinite, and thus decays with time, and something you've been thinking about for weeks or even months may vanish out of context any moment, making way for a new memory perhaps, and leaves you with that strange aftertaste where you ask yourself "What was that idea again?".<br /><br />So, regardless of my meaningless ramblings, let's get on topic, as a software developer that mainly thinks in bits and bytes, and as I'm heavily involved in the field of Artificial Intelligence, I always seek new knowledge to better my understanding of how the code I write to simulate Neural Networks actually works? And why does it lack so much in comparison to real brains?<br /><br />The same neural networks come in dire lack compared to biological ones, they do not even come close to a worm's brain, a 302 neurons that make up one of the simplest biological brains in existence (C. elegans) beat a matching Artificial Neural Network at the same task (survival) if put in a simulator, but I believe that the worm's brain was engineered with care, with every single neuron and synaptic connection put in place for a reason, you may argue genetic selection, or the adept, delicate and benevolent hands of god (<span style="font-style: italic;">my beliefs say so, by the way</span>), but regardless, there's no dispute that they are simply superior to artificial ones that come as a huge pile of entangled spaghetti, a big plate of <span style="font-style: italic;">failure</span>, served hot with Italian sauce, in comparison.<br /><br />That's another topic though, but thinking like this got me into comparing biological brains, and how they work and interact, to write a good simulator you need to study what you're simulating first, right?<br /><br />For example, although our bodies employ the same concepts and neural structure as other mammals, we gain a consciousness, we claim the realm of thought and imagination, and we invent, we create, and we innovate, how come?<br /><br />We share the concept of memory with almost all living beings, we have memory, and so do they; and in my books, memory equals experience, and the ability to accumulate experience results intelligence, and adaptive behavior, but all in all, we have something they lack, we have the capability of producing new memories at will, memories that may have never happened, all in our heads, the figments of our own minds, and that is called imagination.<br /><br />Let's look at a young baby, the baby comes into this world naked, completely helpless, and with no experience or past knowledge of the mechanics behind life, I know I did, and now, 25 years later, I'm conscious, aware, very curious, and I question my own mind and the workings of the brain that drives it about.<br /><br />What happened in said 25 years? I sure can't remember all, but now when I look back at my childhood I remember, how I developed through childhood, I learned how to perform the most complex tasks by observing and imitating, but how did I learn how to feed myself when that awful feeling in my stomach emerges? as a baby, when I felt hungry, I cried, the mother fed me and I realized that by putting food in the mouth hunger goes away, and knew how hunger can be satisfied.<br /><br />From that point on, I bet that's how I learned that other needs can also be satisfied, and by observing how grownups satisfy theirs', I stand where I am now, in knowledge of how my body works, what needs and desires I may posses and how to satisfy them.<br /><br />But that only covers the process of learning, all animal babies also learn this way, so, the question still remains, what differentiates human beings as sentient beings, what makes us invent, create and alter the environment around us for our favor?<br /><br />From experience and careful thought about the subject, I can say that although animals do possess a primal form of imagination (when a dog seeks food or warmth, they surely picture it in their minds in a way or another, take Pavlov’s dogs for example, they must have pictured the image of food every time the bell rang), but imagination is not all about anticipating future events and the realization of needs and desires, as humans, we have all of the above, in addition to the capability of triggering the process at will, the way we think is not always a reaction or a reflex to a certain event, we provide the impetus, the propelling force that drives our imagination to the limit (which hardly exists), I believe that da Vince was a master at this, and he must have realized this fact, and knew how to exploit it all the way.<br /><br />Back on topic however, we come to the mathematical representation of the brain, as huge of a network it is, it still has a known number of inputs and a known number of outputs, and memory is the collaborative result of all neurons working together, does this mean that the brain is a mathematical function? that's a crude way to put it, but I believe something else.<br /><br />I believe that the brain can be represented as an astronomically huge array, with a huge number of bounds, each entry in this array represents the expected outputs for a certain possibility/state of mind, this array would look something like this:<br /><br />Output[x] = Memory(Input1, Input2, Input3, ..... , x)<br /><br />Where x represents the desired output node.<br /><br />And here's a representation in pseudo-C code:<br /><br /><div style="border: 1px solid black; padding: 10px; background-color: rgb(255, 255, 204);"><pre><span style="font-size:100%;"><span style="font-family:courier new;"><span style="color: rgb(51, 51, 255); font-weight: bold;">struct </span><span style="color: rgb(51, 51, 51);">Outputs_t</span></span> <span style="font-family:courier new;"><br /><span style="color: rgb(102, 0, 0);">{</span></span> <span style="font-family:courier new;"> </span><span style="color: rgb(51, 51, 255); font-weight: bold;font-family:courier new;" ><br />float</span><span style="font-family:courier new;"><span style="font-weight: bold;"> </span><span style="color: rgb(51, 51, 51);">Outputs[NUMBER_OF_OUTPUTS];</span></span><span style="color: rgb(51, 51, 51);"> </span><span style="font-family:courier new;"><br /><span style="color: rgb(102, 0, 0);">}</span></span><br /></span><span style="font-size:100%;"><span style="color: rgb(0, 153, 0);"><br />/* number of bounds is equal to the number of available<br />* inputs, the indexers are also floating point numbers,<br />* thus, allowing for a (<span style="font-style: italic;">theoretically</span>) infinite number<br />* of possibilities, the only limit here is the precision<br />* of the floating-point number. (which represents the<br />* number of available neurons and synaptic connections<br />* in this case)<br />*/</span><br /><br /></span><span style="font-size:100%;"><span style="color: rgb(51, 51, 51);font-family:courier new;font-size:100%;" >Outputs_t Memory[i1, i2, i3 , i4, i5, ...];</span><span style="color: rgb(0, 153, 0);"><span style="color: rgb(51, 51, 51);font-size:100%;" > </span><br /><br /></span></span></pre></div><br />Like I mentioned in the comment above, but I'll reiterate anyways, the array would have floating-point indexers, allowing for decimal numbers to be used as indices to the array, and for the sake of simplicity, let's say that the numbers range from -1 to 1, the indexer referenced by every input is its state at the time of evaluation, this means that the number of possible states is infinite, versus the number of neurons (which is finite), thus, we come to a new concept, detail.<br /><br />When the number of neurons is low, the precision drops, resulting <span style="font-style: italic;">"fractured behavior"</span>, to imagine this, think of the simpler life forms out there for example, they seem "programmed" to do things, they follow a predictable pattern, learning is minimal, and the new, better generation, develops through evolution, by means of genetic-selection, and mutation.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://img136.imageshack.us/img136/6778/imagevieira002aa1.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 491px; height: 256px;" src="http://img136.imageshack.us/img136/6778/imagevieira002aa1.gif" alt="" border="0" /></a>With the array representation above, I hear you wonder "What of learning? how does it fit in this mathematical madness?"<br /><br />Learning is the process of changing the fields of the array, and should be like this:<br /><br />Memory(Input1, Input2, Input3, ..... , x) = Optimal_Output[x]<br /><br />But not quite, this array has a very special property, changing a value affects the fields surrounding it, but assuming that our network is a typical artificial neural network (where every neuron in a layer is connected to every neuron in the next), we can safely assume that the changes will be symmetric to a certain extent, as in, the <span style="font-style: italic;">rippling</span> effect affects more fields when the threshold of a neuron is adjusted if said neuron is in the topmost layers of the networks (near inputs) and affects less fields if the neuron is near the bottom (closer to the output layer).<br /><br />I might write a small program that demonstrates this visually, but that's another task for another day.<br /><br />If you have followed me and understood this so far, then I bet you've come to a disturbing realization, does this mean that the brain is some form of a probability machine? are our brains some form of statistical spreadsheets?<br /><br />The explanation above suggests so, our brains are predictive engines, the concept is simple, yet the application is complex and difficult to perceive, the closest term that comes to mind when I try to describe the brain, is an <span style="font-weight: bold; font-style: italic;">infinite state machine!</span><br /><br />Yes, this is what I think of when I think of the brain, it's the optimal representation of such a term, it can handle infinite possibilities, and when its capacity of neurons is not enough, it improvises, and it compromises, but there's <span style="font-style: italic;">always </span>an output and a "thing to do" for any given state at any given moment.<br /><br />If you look deeper into this, you'll find out that the brain is simply a living, self-hosting, and self-adjusting adaptive algorithm, it is a relational database of "what to do when", and through that <span style="font-style: italic;">rippling</span> effect I mentioned above, it also predicts what to do in similar situations in the future, given similar, but not the same inputs, it will perform a similar, but also not the same action, this is what gives organic beings the unpredictability factor, something, somewhere might change through the learning process, and the predicted behavior for a certain state may be drastically affected by something seemingly irrelevant, yet it's all consistent and falls into the same context, and this leads to one conclusion:<br /><br /><span style="font-style: italic;">The brain is a mathematical oracle.</span><br /><br />Even this far into the discussion, I allowed myself to neglect a huge aspect of the subject, the biological brain, the difference between the biological brain and the representation above is, the biological brain is not static, it does not "evaluate" a value every xx milliseconds in a loop, the biological neurons are rather those of a spiking model, they trigger at will, I could go in-depth about <a href="http://en.wikipedia.org/wiki/Action_potential">action potentials</a> and <a href="http://en.wikipedia.org/wiki/Activation_function">activation functions</a>, but this information is available widely around the internet, and I won't bother explaining what you could read about elsewhere, so let's put it like this, the biological brain has loop-back mechanisms; It has neural-microcircuits that give it the capability to supply its own inputs, and divert previous outputs as new inputs, and this puts it into an ever-renovated state of flux, it does not wait for "inputs", and it does not "react", it acts, external inputs such as sensory data are simply additional incentives that may aid in the decision-making process, in the ever-going cycle of "what to do next?".<br /><br />I will discuss this in detail in the future, since the topic deserves volumes over volumes of articles to fully discuss.<br /><br />Anyways, thinking like this inspired me to make a new model of artificial neural networks, one that learns in different ways from the current ones, the current linear back-propagation approach is simply lacking, as you must provide the expected inputs and matching outputs for the networks in order for them to succeed at learning specific and limited tasks, although they perform them marvelously well when carefully designed and taught, tasks such as the recognition of character glyphs, recognition of voice and fingerprints, all remain limited compared to their true potential.<br /><br />The current model of neural networks revolves around inputs, outputs and layers over layers of hidden neurons, and the network is evaluated in a procedural manner, this is different from what real brains do, these networks are usually crafted and trained for one purpose, and that's about it, once they enter a production stage they cease all learning activities, although some expert-systems that employ neural networks in their arsenal of problem solving solutions keep error-recovery routines where they train them as they work, to fine-tune their performance when applicable, but that also remains a different topic.<br /><br />(To be continued)Anonymoushttp://www.blogger.com/profile/11701047179670165384noreply@blogger.com2tag:blogger.com,1999:blog-20264889.post-52327632941607376012009-02-10T22:33:00.001+02:002009-02-11T11:20:09.281+02:00Greetings!Hmm, a new blog at last..<br /><br />I am known to be a big fan of lurking online, always staying in the shadows, reading forums that I never register on just for the joy of reading what people write in there, and same goes for blogs.<br /><br />I'm always in invisible mode on [Insert name of you favorite IM application here] <insert>, I rarely reply to e-mails, and hardly engage in any kind of social interaction.<br /><br />I accustomed myself to enjoy solitude more than company, I like reading about complex scientific topics all on my own, just for the sake of reading, and accumulating as much knowledge as I could in every field possible.<br /><br />Although it is inciting to keep things the way they are, I found myself in a tough situation here; All of the knowledge I gathered around over the past few years turned into hurricanes of ideas and thoughts, pushing my brain to its limits, and burning through my cerebral cortex, my mind is about to implode, and this is why I created this blog.<br /><br />This is going to be my own way of arranging them, sorting them, and (if anyone is even reading this) share them with others, in hopes of making something useful out of them.<br /><br />I would also appreciate it if you take note than English is not my native tongue, so if my linguistics come short, by all means, correct me.<br /><br />Anyways, my main interests that I will be writing about are: Software development, Biology, and Neurobiotics; amongst other things. (<span style="font-style: italic;">if you think this is a strange mix, you're probably right - but like I mentioned, I do have a hunger for knowledge, and that includes EVERYTHING, so if you see me writing about Aerodynamics or Psychology, don't be surprised</span>).<br /><br />Another language I might be writing in is Arabic (My mother language), And I conceive that most posts in Arabic will be either programming tutorials, or local chattery about current events in Egypt, etc; If a certain topic deserves it, I'll have it posted in both languages.<br /><br />I guess that's about it *<span style="font-style: italic;">resisting my desire to cancel this post, I'll click "Publish" now to end this agony</span>*</insert>Anonymoushttp://www.blogger.com/profile/11701047179670165384noreply@blogger.com0