Google remembers Arecibo message on its anniversary

Arecibo message anniversary


This morning, while opening Google, found out that today is the 44th anniversary of the Arecibo message sent out to Aliens who may or may not be out there.

What do we infer from this Arecibo message?

We believe that those out there look like us, behave like us, think like us and so on...

When the fact of the matter is that they could be in a different dimension, another set of beings may be living among us, and we are not able to see them because of our sensory limitations.

This is the difference between an Indian/Asian mind and the western mind. The Indian thought is that all beings in the Universe are linked together and that when we master the micro, we know the macro and vice versa.

We can get to know everything without getting out of the comfort of our living room. The secret is to look within and master our self.

Till we understand this, we will keep looking out on the lookout for what... we don't know.

Pictorial representation of the Arecibo message


Convert a number in a string variable into a number in Javascript, jQuery

It is possible to get frustrated when you are coding in JavaScript and are trying to do some arithmetic calculations in the course of your JavaScript programming.

Here, it is possible to find out that 1000 + 1 is equal to 10001 and 10001 + 10 equals 1000110.

This is where you find out that all that you learnt in the school is wrong. It is also when you feel just a wee bit superior to the computer, because you know that sometimes, it has to be specifically instructed on what to do, how to interpret and calculate.

In JavaScript, there is one function that we can use to tell the computer that we are dealing with numbers and not strings. We use the function Number("numberInStringForm") to convert a number inside a string into a number.

This happens most of the time when numbers are part of a web form/report where all content is text. Based on the position of the text, based on the id or class name that we identify them with, we have to extract the content, which will be by default in "string form".

This is where we use the Number() function to convert them into number form again. After this Number() function is used, the number in the string variable is converted into a number, upon which we can then use the arithmetical operators (+-*/^ etc) to get the numerical answers.

Usage: stringToNumber =Number("12345")

Enforcing Helmet Rule in Chennai!!! Misplaced Priorities?!

News: Helmets are mandatory in Chennai, for even the pillion rider, rules the  High Court, apparently to save the precious lives of its citizens.

Is it a case of Misplaced Priorities?! Let us have a look.

Take a look at some statistics here.

3000 children die EVERY DAY in India from poor diet related illness, that is over one million lives every year.
  • 24% under 5 deaths
  • 30% neo natal deaths
  • 1 in 4 children are malnourished, which means that 25% of the population will not be able to fend for themselves, depending on others for life
  • the first 1000 days are critical, from birth to the age of 2
On the other hand, only 207551 people died of road related incidents in India in 2015

Causes mentioned are
  • overspeeding
  • driving under influence
  • not using seat belts and helmets
  • failure to maintain lane
  • not yielding to oncoming traffic
Strangely, there is no mention of bad roads in these data.

People allegedly claim that they can identify many unmarked speed breakers and bad roads in their respective areas.

In India, we should know and be convinced that laws make no sense. People will do or not do a certain thing, only when they are convinced about it.

And in a population of 1+ billion, let us accept it; there is a sense of peace and tranquility because of the inherent peace loving nature of the citizens; not because of the police or the military.

It is easy to enforce a rule, because of the fact that one is in power. We were wondering if the judge did seek information from the government on the steps taken to educate the children at school on road safety practices. After all, they are the future of the country.

A helmet may save the head, but what about the other parts?

Just step out on the roads and it is very easy to find out school children driving on the wrong side of the road, parents on motorcycles with children driving on the wrong side of the road, speed breakers with no markings, vehicles of all kinds paying scant respect for the traffic signals, foot deep potholes on main roads and highways and so on.



Seeking a Permanent Solution to traffic woes

Instead of increasing penalties, which will only lead to misuse of authority, attention should be given to mould the children early, in order to make them responsible future citizens.
 
That is the way to go for arriving at a permanent solution!


The problem is in the mindset. And, the focus should be long term; short term solutions do not work long-term, as we have learnt from past experiences. Till the long-term solutions bear fruit, short term solutions may be implemented.

To begin with, by regulating the process of providing licenses with a fully automated driving license test, which will test the applicant on the road rules, in addition to the mandatory driving test, the government can ensure that whoever gets the driving license are fully qualified deserving drivers.

References:
https://www.youthkiawaaz.com/2015/10/ten-facts-about-hunger/
https://www.indiafoodbanking.org/hunger
https://www.actionagainsthunger.org/hunger-facts
https://en.wikipedia.org/wiki/Traffic_collisions_in_India
https://sites.ndtv.com/roadsafety/important-feature-to-you-in-your-car-5/
https://www.ndtv.com/india-news/every-day-400-people-die-in-road-accidents-in-india-shows-government-data-1403899

Programmatically checking and unchecking a checkbox using jQuery

 
The following statements check the checkbox and uncheck the checkbox respectively.
 
$('#isContractWorker').prop('checked', true); // Checks the checkbox
$('#isContractWorker').prop('checked', false); // Unchecks the checkbox
 
In the above statements the # stands for id. 
 
An id may generally appear only once in a page, while on the other hand a class 
(represented by a . prefix), may appear more than once. 
 
When a class appears more than once, it is necessary to qualify the exact class, 
which needs to be affected, by the command.
 
In the example below, you will find out that the checkbox represented by 
class "isContractWorker" which is part of the id "viewModal" is specifically
addressed.
 
$('#viewModal .isContractWorker').prop('checked', true); 
 
Hope this solved your problem! 
 
Please note that this example works on jQuery versions above 1.6.

Error 21 (net::ERR_NETWORK_CHANGED): Unknown error


Error 21 (net::ERR_NETWORK_CHANGED): Unknown error


We recently had this issue cropping up when browsing in Google Chrome.

Initially, we were wondering what could be causing this problem, since the network (Internet) seems to be working fine.

After some time, we noticed that the issue is not permanent and is happening on and off. We finally found out that the ACT Broadband that we were using was dropping the line for a few minutes and then recovering.

The Error 21 (net::ERR_NETWORK_CHANGED): Unknown error was shown during the intermittent time, when the Internet was briefly down.

Once the Internet was back up and serving, the error Error 21 (net::ERR_NETWORK_CHANGED) went away.

Problem Solved?! till the next time!!! 

Unravelling the mystery of AWS Cost reduction

What is AWS?


AWS, as most of us know, is a way of running a server without the hassle of maintenance costs, better up time and having the flexibility of owning the latest infrastructure, not to mention the possibility of ramping up or down on our resources flexibly.

Most of us have been using AWS as a matter of fact, without knowing much about the details.

If you have been using AWS for a long time, you would have noticed that the cost of running the server has been increasing over a period of time.

This is especially true, if you have been making changes to your server, creating new snapshots, stopping old instances, creating new instances and so on, on a regular basis.


Did you wonder why AWS costs are increasing gradually?

Are you wondering why you are running up an inflated AWS bill, even though you are running only fewer instances. Well, you should know that even though instances that are not running are not charged for, the resources that they run on, they add up to your bill.

The reason is that resources, once created/initiated, will cost us by the hour, however minuscule it may be.

The resources would be the volumes that you created that are lying idle, mainly the hard disks that contain your operating system, the software or web application etc., You may also want to delete your snapshots and AMIs, even though they may cost only a fraction of what the volumes do.
So, the stopped instance, though it may not incur charges, as Amazon claims, the related resources, such as the volumes attached, the snapshots, the AMIs that you use, all add up to the cost that we would be paying for using the Amazon server at the end of the month.

Now, let us see what we can do to reduce our monthly AWS bill.


How do we Reduce AWS Billing costs?

In the first place, we need to identify the resources that are costing us, what are the resources that are costing us, how much each of these resources are costing us, we need to find the split up of the costs.

So, how do we do it? Once you login, go to the "Billing" page when you click under your name (top right)

This AWS Billing dashboard gives you details about services/resources used and the cost till date.



Click on "Bills". Then, you can select the month for which you want the bill to be shown.


For the present month, we can take a screenshot of the page today. Then come back tomorrow and take another screen shot. A three day screenshot would give us an idea about the cost incurred on every resource type per day; by calculating the difference from the first day to the second day to the third day.

If you notice, there is a category called "EC2-Other" . This is the area we need to focus on. This denotes the Volumes or disk usage for the running and the stopped instances. If we have many stopped instances, it also means that there are many volumes attached to them.

Essentially, these unused volumes or AWS resources are costing you by the hour.

Find out if these volumes are required now. If not, detach them; then delete them. It could cost you around $0.10 per GB per month. So, if you have unused volumes to the tune of 600GB, you could be paying an extra $60 per month on a regular basis, which adds up to quite a sum.

Take snapshots of instances that you do not need now and then terminate them. Detach and delete the volumes that they are attached to. If required, you can revive them from the snapshot information. Snapshots generally do not save the unused space. So, if you have a snapshot of a 50GB instance, it will save only the data that is contained in the 50GB instance. If your 50GB instance has 45GB of free space, you will be paying for only 5GB of snapshot storage.

Since, snapshots are stored in S3 by default, though you may not be able to see them in your S3 page, they cost much less than retaining them in the EBS.


Migrate your AWS server from old to new (m1 to t2)

Apart from saving on your costs by eliminating unnecessary AWS Volumes, another option you should consider is to move your server to the latest on offer from AWS, like from m1 to t2.

The general idea is that these new servers provide better performance while costing up to 50% lesser.

The steps to follow would be to create launch a t2 server. Setup all the software necessary to create a copy of the existing m1 or m3 server.

Take a backup of all the source code, database, configuration files and scheduled job scripts/application.

Set up the new t2 server, with your paraphernalia.

Test the application in the t2 server. Time the migration wisely, in order to minimize or avoid downtime in the old server. Ideally, it should be at a time when traffic on the server is lean.

One thing to consider is the change in IP address as it may be different as the servers may be in two different blocks of hardware.

Test and then shutdown the old m1 or m3 server.

This exercise may help reduce the running cost of the instance by up to 50%.

In our case, we could shaved off about 40% from our monthly AWS bill, without even doing the migration part.

That should give you an idea.

The curious case of the htaccess file and the 500 Internal server error

.htaccess file and 500 Internal server error


Did you know that just a harmless change in the .htaccess file can result in your page not being opened at all?

Yes. It is possible.

I will explain it in a short while. [If you do not want to read this through, please go to the last paragraph, where the solution that we found is given]

The .htaccess file, for the uninitiated, is a linux file, resident on your web server. What it does is to act on a page or the files in a folder, based upon certain rules.

Mostly developers use it for renaming a common file to something meaningful for the search engines, so that they may find it, index it and show it in search results when people look for the topic discussed on that web page.

For example, one may have a common file called products.php, which is used to show various products that the vendor sells.

Invariably, products of a certain category are grouped together. And the group code may be sent as a parameter to the file, to change the view for the visitor.

So, products.php?i=19 may show inkjet printers, products.php?i=20 may show washing machines and so on.

The name products.php?i=19 does not make much sense. It makes better sense if it were to read like "inkjet printers with less expensive toner", because we all know how the printer companies rip customers off by offering cheap printers and expensive ink cartridges.

What we use the .htaccess file is to rewrite the url to something more meaningful for the viewer as well as to the search engine, like Google search.

The whole process runs like this. The prospective visitor posts a search for "500 internal server error" in the search.

In our case, it was problems.php?i=19 and it was indexed in the search engine as "htaccess-and-500-internal-server-error", because our .htaccess file renames and rewrites all requests for the specific page problems.php?i=19 to "htaccess-and-500-internal-server-error".

Now, coming to the point. We did something like this with our page. Only a single line was changed in the .htaccess file. And from the next moment onward, the entire site starts throwing this "Error 500 Internal server error".

When we removed the line, the pages started showing properly. So, we knew that the problem 500 Internal server error is related to the one line in the .htaccess file.

A close look at the code reveals that a space has been inadvertently placed in the url rewrite line.

Instead of "htaccess-and-500-internal-server-error", it was "htaccess-and-500-internal-server- error".

Solution to htaccess induced 500 Internal server error


A space had creeped in between server and error, thus invalidating the line.

The space was removed and the problem was solved.

Imagen 3: A New Era of AI Image Creation?

  Google has just unveiled Imagen 3, the latest iteration of their Gemini AI. They're making bold claims about enhanced image quality, ...

Most Popular

Copyrighted.com Registered & Protected DWYE-NHTO-NBNH-7FFM