Lately I've been dealing mainly with code instead of administration, so the dramas I face with coding are much more than server ones., so I decided to write a few lines about the nonsense I manage to create. We are preparing hard to present our project, which forces the opening of the dramatic parts to some extent

  • The first thing that would certainly cause problems is the exclusion of javascript from browser support. Like any modern application, our tool uses a lot of JS for AJAX and other dynamic processes that transmit interactivity and modernly improve vision and functionality. We thought of a lot of solutions and the most acceptable was with an information cookie and then php to check if the information is valid and if everything is OK. Quite a competent solution, but in the end it appeared in a decent way. HTML to run if it gets into noscript. In my opinion, it is the most elegant solution.
<meta http-equiv="refresh" content="0;URL=./nojs.html" />

In general, the situation is trivial if we stop JS support we will be redirected to nojs.html. A simple and quite effective solution

  • Php multhithreading – very filament is something that is quite useful with more core processors (not that single-core is not OK but with many nuclear systems things are different beer). Our software has a section that deals with gathering information from others API – that and me import you into our database. Generally no challenge except that we implemented it again in php with multhithreading in cli mode because this process is large enough and needs to be automated to force someone to do it by hand. There was a drama here related to the formation of processes and not the very creation of child process-and that the script was waiting to finish to create a new one. Stupidly this killed the idea of ​​multiprocessing what is actually behavior and not multhithreading but these are details. First we put & after the process, which means that the script continues to work, but still there was no change in the behavior, it was required that the standard output of the script be redirected. – in my case best to /dev/null 🙂 In the end, the structure of this piece of code looked like this
$pid = pcntl_fork();
if ($pid == -1) {
die('could not fork');
}else if ($pid) {
// we are the parent
echo "I'm parent  \n";
pcntl_wait($status); //Protect against Zombie children
} else {
// we are the child
echo "I'm a child $timer  \n";
exec("$command > /dev/null &");
exit (0);

The example is again trivial. In terms of performance, I was very impressed with the interruptions between lifting processes and so on 50 child process who made their side 7800+ mysql inserts for about 30-40 sec. And the machine is extremely weak because it is a test verer before we pick up the application of the real.

  • Mysql querys – I was shocked by a great stupidity. There was a code he was making 4-5 redundant database queries, instead of using a bolder sql query and then the main job is to take it to php. The drama was like that, the most- first a request was made which took information then the output of the request was used to make other requests as it served as arguments. Quite an ugly and fat situation. Subquery and it's unfamiliar territory obviously as well as left join or things just weren't well thought out. I caught rewriting the request everything went pretty well and overall the load dropped by about 200% for the same part of the code.

In general, these are the last things we deal with and I can't say that it's boring, but sometimes I am amazed by various ill-considered pieces of code that I have to fix and the most confusing thing is that they are often mine 😆

Enhanced by Zemanta

I have not written again since … an awful lot of time – caused pain and reluctance to think somewhere. I tried 3-4 times to post some things but I was not very happy with the result and so I gave up every time 🙂 I decided to look at my blog so just for sports 🙂 I see interesting things. The real reason that made me write this post is not most of the time I have because it is the same as yesterday, last day and so on and a compilation of feelings that overwhelmed me 🙂 I also came across this computer, I hope the author doesn't get mad at me for releasing it 🙄


I am an attractive man.
And I know him.
I know women quite well
and secrets
of their bodies and souls.
I can
to easily obsess the weak.
The strong
are more difficult, but not for long.
A lot
they are looking for me themselves, not for love, and for
I understand them and give them what they want.
I say the words, who want and
I kiss
skillfully where no one dares.
My hands
magically make their bodies sing,
and after
when they merge with my weeping…
I was not proud of myself, but
I do not stop.
I've tried, not that I'm not,
I want you to know it, and it always was
That's why I'm left without a soul.
I banished
so as not to interfere with my decisions.
In fact
she left me disgusted by me.
I feel something new and painful.
My conscience
it eats at me and I wonder how she stayed
in me
like grass sprouting in a stone
I'm suffering now, deservedly, and I think I am
on the road
to finally do a heroic deed
and say:
– Stay away from me. Beware!
I love you!
You don't deserve a replacement!