how to get 100% score on the Fish exercise on Codility

In this post I am going to talk about a 100% score javascript solution to the second exercise of the Stacks & Queues lesson named Fish

Now here’s the exercise’s description on Codility:

You are given two non-empty arrays A and B consisting of N integers. Arrays A and B represent N voracious fish in a river, ordered downstream along the flow of the river.

The fish are numbered from 0 to N − 1. If P and Q are two fish and P < Q, then fish P is initially upstream of fish Q. Initially, each fish has a unique position.

Fish number P is represented by A[P] and B[P]. Array A contains the sizes of the fish. All its elements are unique. Array B contains the directions of the fish. It contains only 0s and/or 1s, where:

  • 0 represents a fish flowing upstream,
  • 1 represents a fish flowing downstream.

If two fish move in opposite directions and there are no other (living) fish between them, they will eventually meet each other. Then only one fish can stay alive − the larger fish eats the smaller one. More precisely, we say that two fish P and Q meet each other when P < Q, B[P] = 1 and B[Q] = 0, and there are no living fish between them. After they meet:

  • If A[P] > A[Q] then P eats Q, and P will still be flowing downstream,
  • If A[Q] > A[P] then Q eats P, and Q will still be flowing upstream.

We assume that all the fish are flowing at the same speed. That is, fish moving in the same direction never meet. The goal is to calculate the number of fish that will stay alive.

For example, consider arrays A and B such that: A[0] = 4 B[0] = 0 A[1] = 3 B[1] = 1 A[2] = 2 B[2] = 0 A[3] = 1 B[3] = 0 A[4] = 5 B[4] = 0

Initially all the fish are alive and all except fish number 1 are moving upstream. Fish number 1 meets fish number 2 and eats it, then it meets fish number 3 and eats it too. Finally, it meets fish number 4 and is eaten by it. The remaining two fish, number 0 and 4, never meet and therefore stay alive.

Write a function:

function solution(A, B);

that, given two non-empty arrays A and B consisting of N integers, returns the number of fish that will stay alive.

For example, given the arrays shown above, the function should return 2, as explained above.

Write an efficient algorithm for the following assumptions:

  • N is an integer within the range [1..100,000];
  • each element of array A is an integer within the range [0..1,000,000,000];
  • each element of array B is an integer that can have one of the following values: 0, 1;
  • the elements of A are all distinct.

Before we elaborate, here’s the full javascript solution in case you’re just coming for the code:

function solution(A, B) {
    function processFish(fish){
        for(var i=survivors.length-1;i>=0;i--){
         var lastFish=survivors[i]
             if(lastFish>0 && fish<0) {//last fish is going down
                if(Math.abs(lastFish)<Math.abs(fish)) {// fish is bigger
                    survivors.pop()
                    if(i<=0){
                        survivors.push(fish)
                        break;
                    }
                }
                else
                    break; //do nothing
            }
            else{
                survivors.push(fish)
                break
            }
        }
    }
    function addFish(i){
        if(B[i]>0)
            var fish=A[i]
        else
            var fish=-A[i]
        if(survivors.length==0)
            survivors.push(fish)
        else
            processFish(fish)
    }
    var survivors=[]
    addFish(0)
    for(var i=1;i<A.length;i++){
       addFish(i)
    }
   return survivors.length
}

this solution gives a score of 100% in matter of correctness and performance and has a time complexity of O(N)

Using a stack to determine the number of surviving fish

In order to calculate how much fish are left in the end, we need to create a stack and fill it with all the surviving fish, one at a time

survivors.push(fish)

each time a fish is added to the stack it may devour one or more of the survivors in case the conditions are met, so in case the upcoming fish is meant to eat the last fish of the stack, we’re simply going to remove the prey (the last fish of the stack):

survivors.pop()

in the opposite case (the last fish of the stack is eating the upcoming fish) we’re simply going to do nothing.
Once we’re done with collecting the surviving fish in a stack, we just need to return its length which will gives us the exact number of fish that will stay alive

return survivors.length

Now we need to build the logic around this base, that is to say making sure to properly interact with the survivors array according to the description of the exercise

Combining arrays A & B (sizes and directions of the fish) into one

Since we need two criterias to determine which one of a two given crossing fish is going to survive we are given two arrays, one contains the size of each fish while the other is containing the direction but we don’t really need to rely on two arrays !
In fact, a single array would be easier to manage then two so that why combining the two arrays is a good idea.
We can keep note of the direction plus the size of a fish using a simple method:
we make sure to use the size of the fish as the value and we make it a negative number if the fish in question is going upstream, on the other hand, if the fish is floating downstream we just keep the number positive. Example: -5 would represent a fish floating upstream that has a size of 5
so first step is to loop on the fish list:

for(var i=1;i<A.length;i++){
   addFish(i)
}

Second, we combine each fish’s size and direction into one value:

if(B[i]>0) // if current fish is floating downstream
  var fish=A[i]
else //upstream
  var fish=-A[i]

Combining happens at the same time as filling the survivors array so that performances are kept minimal.
By combining the size and the direction the one dimension survivors array becomes enough to keep note of each fish in case we have to return to it later.

Filling the stack

Now we just need to write the logic that will determine how to deal with each fish passed by the previous loop.
Testing the outcome of two fish crossing each other becomes simple now that we have the direction and size into a single variable so to test if a fish is going upstream or downstream we just compare it to zero:

if(fish<0)
//fish is floating upstream
else
//downstream

and to test which fish is bigger we just need to compare their absolute values

Math.abs(fish1)<Math.abs(fish2)

To start, we need to loop on the stack. Remember: once we introduce a new fish to the stack we need to make sure to check if it’s going to eat one or more of the survivors we collected before !
of course the first fish that’s going to be attacked if the conditions are met is the last element of the stack, once eaten we keep moving to the previous one until we find another fish that floats in the opposite direction and then either:
-our fish is bigger: in this case we remove the last fish from the stack or..
-the last fish is bigger: we stop the loop and bring up a new fish from the remaining ones.
if when looping on the stack we reach one of these cases:
-the beginning of the stack
-a fish going in the same direction (upstream)
We insert the new fish in the stack and it becomes the last fish

for(var i=survivors.length-1;i>=0;i--){
         var lastFish=survivors[i]
             if(lastFish>0 && fish<0) {//last fish is going down
                if(Math.abs(lastFish)<Math.abs(fish)) {// fish is bigger
                    survivors.pop()
                    if(i<=0){
                        survivors.push(fish)
                        break;
                    }
                }
                else
                    break;
            }
            else{
                survivors.push(fish)
                break
            }
        }

Once the loop on the fish is done, we gets an array containing all the fish that survived, again all you have to do here is to return its length

This solution may bring a 100% score but I am sure there’s an alternative with less lines of code, if you think you have this alternative and it has 100% score then don’t hesitate to share it with me as I am curious to see which approach you have followed.

jQuery event to detect any new element in the DOM

have you ever been in a situation where you need to get all the elements that gets inserted into a web page after it has been loaded? like when a new html content has been loaded using ajax then appended to a web page’s body.
In this tutorial we’re going to write a custom jQuery event that will trigger anytime an html element is added to our webpage, the event will return a list of all the new elements in a variable that we can use on the callback function like we used to do on any regular jquery event method.
So our event method will look like:

$("body").domInsert(function(element){
      console.log(element)
})

and here’s the declaration code of the new jQuery event:

$.fn.domInsert = function (callback=0) {
	console.log(this)
	var listen = (function(){
		var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
		return function( obj, callback ){
			if( !obj || !obj.nodeType === 1 ) return;  
			if( MutationObserver ){
				var obs = new MutationObserver(function(mutations, observer){
					callback(mutations);
				})
				obs.observe( obj, { childList:true, subtree:true });
			}
			else if( window.addEventListener ){
				obj.addEventListener('DOMNodeInserted', callback, false);
			}
		}
	})();
	listElm = $(this)[0];
	listen( listElm, function(m){ 
		var addedNodes = []
		m.forEach(record => record.addedNodes.length & addedNodes.push(...record.addedNodes))
		if(callback!=0)
			callback(addedNodes)
	});
};

So you just need to copy this code and past it at the beginning of your javascript, of course it goes without saying that you need to call the jQuery library before doing all of this.

Increment a serial number on microsoft word after each print

One of my colleagues asked me if it was possible to create a dynamic counter that automatically prints a different number each time the document is printed on Microsoft word, the point was to have a unique serial number on each print, of course one can manually create multiple numeric copies of the same document and change the serial number on each copy then print all those documents, but in my case my colleague was planing to print out 36000 copy of the same document, the content should remain the same on all the 36000 copies, the only thing that changes is the serial number which he would insert somewhere in the document so he would see something like 00001, 00002, 00003… on each printed document so now imagine the time it would take to create and change that number manually on 36000 files ! that’s enormous and inevitably requires automating.
My colleague thought I could use my programming skills to create a sort of macro that would do the trick but I honestly have no past experience with VBA and god thanks I didn’t start looking to write a vba script because there was a quite easier solution I am going to share with you in this article.

Generate a serial number using Word Mail merge and Excel

the solution to insert and increment automatically a counter on word is to use a feature that’s initially made for a different purpose so this solution is actually a turnaround but still it’s way easier than writing a vba macro.

the final result will be a doc file containing as many pages as you want, each page will contain a unique number right in the location you would previously specify before you generate the final result.

As an example let’s suppose I want to print 10 pages where each page contains a number that will increment on each print, so my pages will have 01, 02, 03, …10. Here’s the steps :

1. Create an Excel file containing the serial numbers

With Excel you can easily create a formula that will generate all the possible serial numbers that we’ll need for the following steps, here’s how to do it:
-create a new Excel file
-pick the first cell (top left A1) and type the initial number, 1 in my case

-chose the column below (A2) and insert this formula in it: =SUM(A1;1)

-Now you just need to reproduce the same thing on the whole column until you reach the maximum number of serials you want to general (10 in my case), this can be done by dragging the small black tile on the bottom right of the selected cell (A2) and moving the mouse down until reaching the desired cell.

this will automatically apply the increment formula on all the selected cells:

-save the document somewhere on your desktop and keep excel aside for now.

2. Import the Excel file on word using the mail merge feature

-open the document you want to print using Microsoft word, at this stage the document is still not containing the serial number.
-look for the mail merge button, you should find it in Mailings > Start Mail Merge > Step by step mail wizard…

-On Select Document Type chose Letters

-click on Next (bottom right) until you reach step 3

-On step 3 click on Select a different list and chose the Excel file we created previously

-Multiple windows are going to show up, just click on ok then move to step 4 by clicking Next
-On step 4 click on More items

-A window is going to appear containing the only column available on your Excel file. by clicking insert this will place the counter variable name right where your cursor is positioned in your document. You can insert the variable name then simply cut/paste it where you want, or you can simply position your cursor on the desired location before opening that window, both ways are fine.

-close that window and keep clicking Next until you reach the 6th step

3. Print !

Now that you’ve gone through the steps, your pages are ready for printing, you can verify your documents are fine before you proceed to printing by clicking on Edit individual letters then you can simply Print

OpenCart: one store for multiple different domains

As a store owner you may start thinking of creating an additional domain name for your store in order to attract more visitors, if you came to think about this idea then you’d probably want to keep the same store along with the same products, categories & extensions… for both your domains which makes total sens but this isn’t as simple as creating and pointing your new domain to the same directory as your old domain, in fact your homepage may show up at first on the new domain but you will notice that the store is incomplete or wrong, if you see missing icons, corrupted images or links that still points to the old domain then be sure that you haven’t configured your OpenCart to handle the new domain correctly.
This tutorial will help you get your store showing up the same way for your secondary domain or any additional domain name that you might want to add later.

I am assuming that you’ve already gone through the new domain creation process and that you have pointed it to the same server directory as your old domain. so if your new domain is mysecondsite.com then you’re supposed to see your old homepage when you go to that url before starting on this tutorial.

Create a new store on your OpenCart admin panel

Login to your admin panel and go to System > Settings there you can find your stores list:

Now you need to create a new store by clicking the top right blue plus button, just fill the new store’s information and make sure that the store name ends up by a slash ( / ), so if your site is mysecondsite.com you should input: http://mysecondsite.com/
Once this step is done, you should at least see a change on your new domain, one of these is changes is that all your products or categories are gone, this isn’t bad because it means the new domain is finally pointing to the right store. we’ll see how to restore all of those in the following steps.

Assign your products and categories to the new store

now the new store created we need to make sure it has the same content as the old store, so to understand how OpenCart manages each store’s content, it simply consider a two different stores like if their stocks are separate from each other but still allow you to assign it to more than one store at a time and you can do that by going to the data tab of your product or category, in other words go to catalog > categories chose a category then access the data tab then under stores just check the store you want to assign the category to but you need to manually do this for each product and category and of course, if you’re here then you must be looking for an automatic solution in order to assign all your products and categories to the new store once and for all so that’s what we’re going to take care of in the following steps.
if you don’t see any section named Stores then don’t worry about this so just ignore this part.

Now in order to show all your previous categories and products on the new domain you need to execute some MySql queries on your database, so access your database manager (ex: phpmyadmin) through your host panel then go to the table oc_store and note the store_id of the new domain

in my example the store_id is 2, you’re going to need this number in the following steps

after that simply execute the following queries on your database manager and don’t forget to change the store_id value which is ‘2’ in my queries, if your store id is 3 then simply replace ‘2’ by ‘3’

INSERT INTO `oc_category_to_store`(`category_id`,`store_id`) SELECT `category_id`,'2' FROM  `oc_category_to_store` WHERE `store_id` = "0"
INSERT INTO `oc_product_to_store`  ( `product_id`, `store_id`)
     SELECT `product_id`, '2' FROM `oc_product_to_store` WHERE `store_id` = '0';

these queries will automatically assign all your products and categories to your new store and you should be able to see them now.

Uncommon OpenCart issues

My whole life I’ve been spending a considerable percentage of my web development projects time dealing with errors rather than enjoying the coding part, rare are the projects I had to accomplish without being forced to come across an unexpected error or bug, sometimes easy to fix and sometimes a hopeless cause especially when you’re working with a framework like OpenCart.

It’s not uncommon to me to face a familiar issue I managed to correct in the past but find myself unable to remember how I fixed it in order to deal with it now and this has made me mad more than once so this page is, before all, a way for me to keep note of the issues I face the most on OpenCart and how I fixed them, in the second plan, I hope it will save the time of some of you so you can spend it on a more productive work.

This page will get updated each time a new OpenCart issue occures to me.

OpenCart Installation & Update Issues:

1.Install infinite loop

if you searched this on Google then you’ve come to the right place:

install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/index.php

this is how your url looks like if your OpenCart store is stuck in infinite loop during install:

These issues happens mostly when you open your OpenCart store url for the first time like when you try to install OpenCart or upgrade to a newer version, the store enters in infinite redirect loop and ends up by displaying a “ERR_TOO_MANY_REDIRECTS” error page, but in some rare cases this can suddenly happen to your store even if it has been running before, in this case you should preferably try to restore your website to a previous backup or find out what has changed since the last working version because this issue is supposed to happen only when one is trying to install or upgrade opencart which means that you may have lost some important files on your OpenCart directory, or what’s left from your store is maybe pointing to the wrong location.
if you get this issue upon install or update then this is how to deal with it:

Browser re-directions cache:

Make sure your browser’s cache isn’t interfering, so clear it up, or try on a different browser, different computer just start by testing your page as far as possible from your usual browser, if you obtain a different result then focus on clearing your browser’s cache before you proceed further, browser’s cache can still interfere when you try the following steps too so keep in mind that you need to clear your cache each time you try a new solution, you don’t want to pass by the solution because of this ridiculous exception.

Try adding “upload” to the url

if you’re trying to install OpenCart using this url: yoursite.com then try accessing it from here instead: yoursite.com/upload, if this works then you’ve done something wrong when you extracted the installation compressed file so stop just there because that installation isn’t what we’re looking for, you probably placed the folder upload inside your store’s root directory so what you have to do is simple: move all the upload folder’s content to the parent directory, in other words move all the upload folder’s files to your store’s root directory

disable the .htaccess file temporarily

This file may contain some redirection rules that causes a conflict that prevents the installation process from starting correctly, look for the file and disable it by renaming it temporarily, some ftp clients hides it so need to perform an extra step in order to find it, it should be in the directory of your store.

2.Uncaught TypeError: Argument 2 passed to Event::trigger() must be of the type array, string given..

this is the full error message:

Fatal error: Uncaught TypeError: Argument 2 passed to Event::trigger() must be of the type array, string given, called in xxx/system/storage/modification/system/engine/loader.php on line 140 and defined in xxx/system/engine/event.php:59 Stack trace: #0 xxx/system/storage/modification/system/engine/loader.php(140): Event->trigger('language/en-gb/...', 'en-gb') #1 xxx/system/framework.php(136): Loader->language('en-gb') #2 xxx/system/startup.php(104): require_once('xxx/...') #3 xxx/install/index.php(37): start('install') #4 {main} thrown in xxx/system/engine/event.php on line 59

I got this issue when I tried to upgrade from OpenCart 2 to 3, in my case it was related to extensions so I had to disable those before proceeding to update but now I started the installation process It was too late because I had no more access to the admin panel, if you’re in the same position than try this:

Disable OCMod extensions using FTP:

you can also use the file manager of your host account to perform this, simply rename the folder system/storage/modification to a different name like system/storage/modification_temp, this will temporarily disable all your old OCMod extensions, but don’t forget to create a new empty folder with the same name modification because OpenCart will need that in order to proceed with the installation. Once the installation is done you can enable your extensions again but preferably one by one that way you’ll make sure if one of your extensions is responsible of a potential error.

Disable OCMod extensions from database:

if the previous solution didn’t work then you may perform this as an extra step, you need to access your database from your host panel, Iook for phpmyadmin or a similar tool, then access the oc_modification table on your OpenCart’s database, there you should find all your extension, you can disable them by changing each row’s status col value to 0
Or you can simply execute this mySql query which will do the work for you automatically:

update `oc_modification` set status=0

Make sure to replace oc_modification by the correct name of your current table, the table may have a different prefix like mysite_ instead of oc_, in this case the query should be:

update `mysite_modification` set status=0

3.Warning: fopen(/storage/cache/cache.catalog.language.): failed to open stream: No such file or directory in xxx/system/library/cache/file.php on line 49

I faced this issue after installing OpenCart 3 and trying to move the “storage” folder outside its initial directory as per Opencart’s suggestion. After you install OpenCart 3 and you access your admin panel, a popup (Importan Security Notification) will appear with the following message: ” It is very imporant that you move the storage directory outside of the web directory (e.g. public_html, www or htdocs).”

Now the problem may occur either if you clicked on “move” but the process didn’t go well, or if you tried to move the directory manually in an incorrect way, in both cases here’s what you need to make sure of:

Make sure the folder “storage” is in the right location

in the very beginning, the directory storage is supposed to be in the system directory right within your root directory but its location should change according to the OpenCart system notification, therefore it should move to the root directory. In other words move the system/storage folder to the parent folder, your root directory should now look like:

Make sure the config.php files are pointing to the right location

Opencart has two config.php files, one is location within the root directory and the other inside the admin directory, so both files has paths that points to the storage directory and you need to make sure that the paths are corrects, in order to do this, edit both files and change this line:

define('DIR_STORAGE',....

to this;

define('DIR_STORAGE', '/storage/');

but this might not work sometimes, because the paths are relative so the root folder may sometime be longer than a simple slash ( / ), the trick here is to find the absolute path to your root directory, it can be something like /usr/www/users/xxxx/ or /home/xxxx/public_html … depending on your host provider so in order to be sure just copy the path from the config.php file itself, see the picture below:

4.Warning: fopen(xxxxx/storage/logs/openbay.log): failed to open stream: No such file or directory in xxxxx/system/library/log.php on line 22

this issue may happen if you have got the popup Importan Security Notification on your admin panel (see issue 3) and you clicked on the red move button but it didn’t go well, if this is the case then using your ftp client or your host file manager go and take a look at the storage folder within your root directory and make sure its content looks like this:

if you have a different content, like missing folders than it means that the storage directory hasn’t been moved correctly by OpenCart that’s why you need to do it manually so just delete the incomplete storage folder from your root directory then move the original one that you should find within the folder system then place it where the previous storage folder (the one you deleted previously) was located (the root directory), read the issue 3 for more information about this process.

5.Warning: fopen(xxxx/catalog/view/theme//stylesheet/bootstrap.css): failed to open stream: No such file or directory in xxxxx/catalog/controller/startup/sass.php on line 14

this rare issue happens when OpenCart tries to load your theme name from the database without results, that’s why the link is inccorect : xxxx/catalog/view/theme//stylesheet/bootstrap.css
so in order for the file to load correctly, the path should look like:
xxxx/catalog/view/theme/default/stylesheet/bootstrap.css for example
so this is how to force OpenCart to display the correct theme name:

Save your theme from the admin panel

open the admin panel and go to extensions>extensions then chose theme in the drop-down , a list of your installed themes should appear:

click on the blue edit button located in the same row as your active theme (the one with “enabled”) then without even making any specific modification just save and go test if that has resolved the issue.

make sure your oc_settings table is correct

this solution is tricky because I don’t have a code you can just copy past somewhere into your code or phpmyadmin, you need to open your phpmyadmin and compare your oc_settings table to a correct one, I fixed mine by importing a freshly created OpenCart 3 oc_settings table into my store’s database, by replacing my incorrect table with the correct one, the issue was gone but be careful because this means you’ll have to lose your old settings, I didn’t mind setting everything like it was manually as this would take less time than looking for a solution that would save my previous settings.

Opencart Admin Panel Issues

1. Warning: You do not have permission to access the API!

Have you tried to edit or delete an order on your opencart system without any success? if you’re getting a message like:

chances are you don’t have permissions to access opencart’s api but don’t panic this should be a simple fix.

Make sure your ip address is authorized in the API section

login to your panel and go to System>Users>API

click on edit and go to IP Addresses and add your ip address there then save.
this should be the most common reason why you can’t delete or edit your orders but if it doesn’t work try the next suggestion.

Make sure your user group has all the permissions

The administrator group is supposed to have all the permissions by default but give it a look in case it has changed somehow.
go to System>User>User Groups

make sure all Access Permissions and Modify Permissions are checked, check them if not then save.

Disable API IP checks once and for all

if you have a dynamic IP the previous solutions might not suit you as you have to reproduce them each time your ip changes, so instead of adding your ip manually each time you can just apply this solution which will relief you once and for all from this annoying task;
simply install this extension and it will do the work for you automatically, don’t forget to clear your store’s cache after install.

Custom form for uploading a video to Vimeo using their PHP API

I’ve been working on a wordpress project in which I had to use vimeo’s api in order to upload a video from the client’s server to his vimeo’s account. The website is a directory of mental therapists and doesn’t only offer a large database of professionals but also allow any unsubscribed therapist to join the site and have his own personal page listed in my clien’ts database through a form of course, so among all the details that a therapist can add to his profile there was this field named “business video link” which allows the user to place a link to a preventative video of him or his business but my client wanted more than that, he asked for the option to upload and host a video in a video streaming website from his site then to automatically show it within the therapist’s profile once the upload is done.

My client had a preference for Vimeo so I started reading their API documentation before engaging in the project. I must admit that it was documented in a clear and friendly way, at the beginning, I believed I could finish the project in no more than two hours because all I thought I will have to do is to add a simple file input in the front-end and just copy some ready php code from Vimeo’s website and past it in the client’s back-end but it turned out that I was wrong. In fact, I lost 3 days on this project, 90% of the time I was debugging and looking why the code isn’t working as supposed. This tutorial will show you how to create a simple working form that uploads a video to Vimeo using PHP. The initial code is provided by Vimeo itself but if you have to come across the same path as me then this tutorial is just going to save you 3 days of unnecessary struggle by giving you the version of code I have come to at the end.

What you need:

before creating your own form, make sure you have the following:

  • An access token provided by Vimeo
  • Client id and client secret provided by Vimeo
  • Upload permission enabled on your Vimeo’s app page

How to get it

first step is to create your app page on Vimeo, just go to the developer section of their site: https://developer.vimeo.com/ then click on “new app”.
After creating your app, go here https://developer.vimeo.com/apps and chose the app you just created

make sure you request an upload access, without this the form won’t work as you’re only going to get an error, the request may take time before it gets processed, it took 3 days in my case.

-Generate an access token, chose the same options as the image:

– Now just take the client id, access token and client secret from there

Now just use those information to generate your form

Problems you may encounter:

the code may not work directly from the first shot, if this is the case make sure you do the following:
-try the code on your localhost before you test it on your server
-first try with small size video file (maybe a 1mo video file)
-raise the upload max limit and max execution time on your server/localhost php configuration, you can just add the following code to your .htaccess file:

php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300

Internet has become evil

It is hard to browse the internet through the eyes of a web developer because you don’t see the web like the others do, if you too are a web developer you might know what I am talking about, I am unable to visit a website without starting to look for design flaws rather than focusing on the content but this is really negligible because it can be worse, I am talking about SEO, the day I put my foot in this domain my life on the internet has changed, in fact I started seeing things from a very different perspective which led me to a total loss of taste for reading web content, it has become impossible to read a web article without this feeling of bitterness, you can’t help but notice that something crucial is missing yet the sentences seems well formatted, they still don’t sound natural which makes sens because a tremendous number of web articles are being written according to SEO rules rather than human ituition, if you go for your intuition you probably will achieve a more authentic article than what’s being read now, however that won’t help you reach anyone as far as google is still the primary canal to bring visitors to your article, like almost all websites and blogs 80% of your website visitors would come from google, of course only if you obey to it’s rules, but those rules are so demanding that you’ll find yourself unable to satisfy them without letting go of your authenticity so most of the good writers are turning into WordPress zombies breathing heavily and typing really fast on their keyboards, good writers who refused to surrender are being repressed and left in the last pages of the searches results, and bad writers does have now a strategy to bypass good writers and they’re actually too good at that but for them writing is secondary, this ecosystem seem to maintain itself perfectly well because internet is being populated faster and faster over the years but at which price? quality has deceased immensely since the time, I remember how Internet was like a decade ago, content was more natural, interesting and entertaining, now it looks more like a labyrinth full of disguised bad content traps, I can’t remember how it feels like to read a unique blog article anymore.
I’d like you to consider StraightDeveloper as a safe blog, no article has been written under the rules of the SEO, look by yourself, there’s no more than a title and a paragraph in this article, I might not even be sure that I am respecting the english language rules correctly. What you read is my real thoughts without any filters.

Here’s a description of me no one asked for

I won’t start talking about myself and what I achieved so far, everyone does that, I mean every blog owner is either a special guy with a tremendous experience or some kind of illuminated person who decided to take his egocentricity to a wider scale