Tuesday, October 10, 2017

How to not print columns on display while printing on paper

Many of you may or may not be aware of a javascript code that is capable of printing page content.

We had created a report which looked something similar to the one shown below.
  

Notice that there are two columns that display "No" in orange colour. We want to print the report, but we do not want the "NO" columns to be printed on paper.


Hiding columns from a table using jQuery



jQuery has a simple command which can hide any number of cells based on their class names. That command to hide a class is given below.

$('.className').hide();


This command was given in the jQuery code, to be called when the print command was called.

Let us assume that we gave the classname "noprint" to all those cells in those two columns, which we do not want to print.

In the code loop, we added an additional classname called "noprint" to the content, like so.



 If you see, the  class "noprint" has been added. Now, when I give the command 

All cells that need to be hidden, have to be given the classname "noprint".

$('.noprint').hide();

All those cells that have noprint class in them are hidden from view.

We are using "class" and not "id" because of obvious reasons, the reasons being the "id" can appear only once in an entire page.


Printing using the system dialogue from web application


Now, the Print command may be used to call the system's print dialogue and get our page printed. See below for the code.




Solved.










Friday, October 06, 2017

mdbootstrap css and the invisible uncolored button

mdbootstrap css not working as expected

This document can otherwise be called btn-success vs btn_success Bootstrap css. This is because, a simple oversight resulted in a confusion that left our imagination flying at the speed of a mythical spaceship.

Recently, we were working on a page, where certain page elements were to be painted dynamically in the course of the program.

CSS not updating cell as expected

When the program was run, the color of the cell did not change. On analysis, we found the  css class to be present in the code.

After many rounds of analysis, we found out the problem to be an innocuous "_" symbol.

btn-success explained

To put it simply, the class that we called was btn_success,  whereas what we should have called or referred to would have been "btn-success".

Notice that the character "_" in place of "-". Though they seem similar, it is easy to overlook them when they are part of a larger group of words, in this case, a program.

We are recording it here so it may be useful to another set of desperate souls who want color in their mdbootstrap css.

btn-success In a nutshell

btn-success is a bootstrap class, which highlights the cell green. If you use btn_success instead of btn-success, your cell will not be highlighted in green.

Usage of btn-success

 

In the above example, a ? is displayed with in a button, which has the background color green.

Wednesday, October 04, 2017

Learning HTML Online, Fast and FREE



A FREE Online Course for Web Development


Yes! It is true. Though, it was a serendipitous discovery. There aren't many sites that offer you the best quality training on the web. And that too, for no cost.


A run through of the syllabus and the course structure has not failed to amaze us. Such is the smooth and easy flow of the lessons, which will take the student through all the aspects of the course.


FreeCodeCamp is my first choice if you want to learn a new subject, such as web development.


According to their website, they are a community that helps you learn to code, then get experience by contributing to open source projects used by nonprofits.


Established in 2014, freeCodeCamp has helped over 14,000 people get jobs or get better offers. They have helped over 30 non-profit organizations with their web sites too.


For the student, in addition to the course content, they also have a Youtube channel, which contains classroom sessions, which can be utilized by the student to improve their techniques.


You can follow them on twitter, facebook, Subreddit and 


Their LinkedIn University page is here


So, if you are looking to learn JavaScript, jQuery, HTML5 and web development online for FREE, freecodecamp is where you need to go.

Monday, September 11, 2017

Knee Jerk Governance ?!



A Country of RULES


I do not know how many of you have noticed. We are a country of RULES, RULES & more RULES.

Probably the only country in the world with the most RULES (LAWS) for anything and everything.

Somebody alleged that it is because laying down rules are the easiest of tasks; doesn't involve any responsibility. 

Make a rule that helmet is mandatory. But, don't make a rule that safe roads are mandatory. Because, making safe roads involves effort. Whereas, forcing the biker to wear a helmet is simple. And, if he fails, more money to the government kitty.

I have been wanting to write this for a long time now. See, the idea is not to find fault with anybody. The idea is to highlight the problem in the system.


School tragedies


The trigger for this article is the sad loss of the innocent child in a Gurgaon school on account of murder.


Similar incidents have happened in many parts of the country. It is alleged that in every case, there was always a reaction from the authorities and an assurance that steps have been taken to prevent the occurrence of such incidents in the future.


One such incident that comes into our mind in this context is the Kumbakonam school fire accident tragedy. 

There was another such incident in Bengaluru, following which schools in Chennai were asked to install CCTV cameras in their premises.

The schools were also asked to verify the credentials of the employees.


Follow up IS IMPORTANT

take action based on advisories

What would be the ideal course of action? Now, it is up to the local authorities, the police and civic administration, to verify periodically, if the advisories are being followed.

Regular visits to the schools by the police and the corporation authorities and frequent meetings with the principals of the schools would keep them on their toes at all times.

Getting updates on the status of security and safety protocols from the schools on a regular basis will give the schools a sense of fear and responsibility that they are being monitored. This will definitely ensure that the schools take extra care and do not let their guard down.

School infrastructure and layout of the schools, with entry and exit details, whether MCBs are installed, the ratio of students vs teachers vs maintenance and security staff and all such things need to be shared with the authorities.
Actions need accountability. Someone needs to assume the responsibility.
The authorities can then formulate a plan or ideal scenario, which can be recommended to the school to follow up and implement. A timeline may be given to the school for the implementation of the ideal security protocol system.

We do not know if such an exercise was taken up by the corporation and the police with the schools in Chennai.



Status of safety and security

The Blue book on school safety has to be drafted NOW.

In the context of safety and security of the children, what will be the present status of safety and security in our schools across the country? Is there a blue book available on such safety and security aspects of all schools in the country with the authorities? It would be a sweet surprise if such information is available with them. We, as citizens would be most proud.

That would have been wonderful. But, given the track record of our authorities, we are just waiting for another mishap to happen.

Then there will be another knee jerk action from the government, authorities and the schools, which everybody will forget over a period of time.

A Blue Book on School safety is the immediate need of the hour.


Knee jerk governance


As we all know, all our governments have always been reactive, not pro active. Our governance have been reactive and not proactive. The focus is always on rectifying the problem after it has happened and not taking steps to prevent the occurrence of a problem.

We have never been in a situation where we were on top of a situation all through our 70 years of governance of independent India. Let us take for example, the 2015 and 2016 floods of Chennai and the 2004 tsunami in the coastal areas of Tamilnadu.

Do you think the government is now prepared to tackle such an incident if it were to happen again? Think about it.

We are a reactive and relief offering system. We are never an anticipating and well prepared system. The problem is systemic.

It is not because we do not want to be prepared. It is because, there is no system in place. There are no long term plans that are prepared and put into place.

Is there a Solution for our ills?

Most definitely. But, we need to have long term plans for nation development along with the short term plans. We need to have at least a basic set of rules [as we all know, our governments are experts in laying down rules] for each department of the government, going down to the grass roots.

Presently, we have 5 year plans. We have governments that run for 5 years. And, if there is a change of guard after 5 years, there is a tendency to put the plans of the previous government in the back burner, or put them in the cold storage.

Hence forth, all our government decisions should be based on the merits of the plans. We need to take all the intelligentsia of the population into confidence and all decisions will have to put the interest of the nation paramount.

We need not all those 5 year plans or 10 year plans. 

We need to have 20 year plans. How do we envisage our city 20 years from now? 
How do we see our state 20 years from now? How do we want our country to be 20 years ahead?

This takes time, but it would be well worth the effort that is put into this.

Mould the young minds


We need to mould the young minds of today; they are going to be the rulers of tomorrow. There is a dire need to create a healthy future generation that is fit in body and mind, which is capable of leading the nation into its bright future.

We need to introduce compulsory physical exercises, yoga and meditation, to keep the mid and body focused and keep them from harm's way.

Follow the Japanese way


I recently saw a Japanese video, which emphasized the attitude of the Japanese people, which is respect and caring for the others. Every Japanese is known to be respectful of the others. That is a quality, which we need to inculcate in our future citizens. We need a country full of citizens who are concerned about other citizens.

We should tell our future generation about the glorious past of our country, which was the fount of civilization in its heyday, till greed and selfishness brought us down.

This is sure to bring down all the ills of corruption and greed, which are pulling the nation down from all sides.

There is HOPE for the future


We hope that at least from this incident onward, the government takes serious cognizance of its responsibilities as the ruler of this great nation.


Link: School buses in chennai to be equipped with cctv cameras

Sunday, August 27, 2017

What is FREEDOM?

The definition of FREEDOM


It is probably the most misused word in the country today.

Everybody wants freedom; everybody is free to do whatever they want to do; and they do it, in the name of freedom of expression, freedom of action, individual freedom, freedom of the press, freedom of politics...

But, nobody ever thinks about where our freedom ends and we intersect on others' freedom. Look around us and we can see live examples of this attitude in everyday life.


Do we stop before the stop line?


Take a simple example of stopping our vehicles before the stop line. If you stop before the
stop line, invariably there is one who overtakes you and stops ahead. This goes on till finally, the vehicles are beyond the zebra and at the junction, while the poor pedestrian weaves in and out of the halted vehicles to cross the road.
When we drive along the road, we see a jaywalker suddenly cutting across the median putting his life and others in the line.

We see the policeman stopping all vehicles after 10pm and asking politely to blow. Are all people driving on the road after 10 in the night drunkards?

We see vehicles weaving in and out or lanes [lane markers are non existent in our roads is another matter] with scant regard to other vehicles on the road.

We see vehicles occupying the opposite lanes, especially at signals, inconveniencing incoming traffic.

Right of way? We don't care



We have also seen those sudden processions and road rokos in peak hour traffic, taking the entire city to ransom.




No freedom for our children


We see the British royalty lip locking on prime time news, while our two, five and ten year old children look at it with curiosity. Don't the children have the freedom to be protected from unnecessary inputs at their age?


Then there is a condom ad at prime time, which is discomforting even to adults, under the name of freedom of expression.


Freedom to Tax, but not to tAsk


We have a government which finds out devious ways to get more money out of the citizen, no offense meant. There is freedom to tax, but there is also freedom to get the basic rights in return; food, water, roads, electricity, free education, free medical support etc. When the government does that, people will voluntarily share their money.
And the list goes on...

Freedom is a two way street


But, not here. So, instead of free India, it is essentially, free for all India.

It could be ignorance, but ignorance is not an excuse. If it is ignorance, it is high time that we told people that freedom is a two way street; everybody in here have equal rights.

People have to realize that with freedom comes responsibility. The idea is about creating the next generation, and if possible, change the mindset of the present generation, which will understand this dire need for FREEDOM WITH RESPONSIBILITY.

Let us be the change we want


The idea is to promote this thought and make it heard and understood by every citizen of the country.

In my opinion, the only freedom that we can exercise without borders is freedom of thought. But, even thought should be restrained, because, as we know, thoughts become action.

And we all know that some of the destructive thoughts that became action have wreaked havoc on this planet.

If your thoughts reflect ours, do visit the FreeWiRes facebook page that we have created, like and become a member.

Start posting images where you believe we, as citizens, can make a difference.

Let us begin the change, starting with us.

Monday, August 21, 2017

How to create video sub-titles in 10 minutes easily

You are visiting to find out if there are easy ways to create captions/sub-titles/translations for your videos. Of course, there are. 

There are a couple of simple sub-title software, which you may use to select the portion of audio/video to create the sub-title, type in your translation in the box meant for it and then save the translated text; it is as simple as 1, 2, 3.

Let us see them below.

Choosing the sub-titling software

Aegisub is a free sub-title software that I used recently. It is so simple to use that you can begin your sub-titling work in less than 10 minutes. It is one of the easiest to use and best in the free category of sub-title software.


According to its web site, Aegisub is a free, cross-platform open source tool for creating and modifying subtitles. As I found out, it is definitely quick and easy to create subtitles synchronized to audio, using this simple and easy to use sub-title software.

Aegisub is available in Windows 32/64 and OS X Platforms

Free Aegisub is available in Windows (32/64 bit editions) and OS X platforms.

One other sub-title software is Subtitle Edit, which too has received high ratings from its users.

Installing the sub-title software

I chose to install the portable edition of Aegisub. The portable version allows us to run the software from even a thumb-drive.

If you want to be able to start sub-titling in an instant, just connect the portable flash drive to a laptop and you are good to go.

It is as easy as that. 

Follow the instructions and install the software.


Installing Aegisub

Note: You can leave the destination folder as it is, or if you want to keep your application portable, choose a common folder for all your portables.

I installed it in e:\portable\aegisub







Create a shortcut to the application


If you find that the Aegisub shortcut is missing from your desktop,


  • Open the folder where you installed Aegisub
  • Right click on the aegisubXX.exe file and create a Desktop shortcut 

Opening the sub-title software

Double click on the Aegisub icon to open the sub-title software.

Creating sub-titles using Aegisub

Before we start creating the sub-titles, we need to open the source video file for the sub-titles.



Click, Video, Open Video and choose your video file for creating sub-titles.










The video file is open now and you are ready to create your subtitles.



The above picture is the Aegisub main screen. 1 is the selected Audio track, 2 is the button you click to play the selected audio, 3 is the box where you will type your sub-titles, 4 is the button you click to save your sub-title, and 5 is the box where your saved sub-titles are displayed.

The steps to create sub-title

Click and drag (from left [1] to right [2], see picture below) on the audio track to select the portion to create your sub-titles. Please take care to select only a small portion, to make a small statement of one or two lines.

The purpose of our sub-titles is to make it easier for the viewer. The viewer may not be able to follow the sub-titles if there are too many lines or if they change too fast.

Now, click on button  [marked by arrow 3] to play the selected portion of the audio. Start typing your sub-titles in the box below. After you have typed the sub-titles for the selection, click on the Save button [see arrow 4 in the pic below]. 

The moment you click the save  button, it is saved and the next part of the audio is selected. 

Note: Right-click on the end point of the selected audio to extend or shorten the audio selection.


The different sub-title formats

There are different sub-title formats such as .srt, .sub and so on. After complete or partial sub-titling, you may want to test it.

Saving it in the required sub-title format

Use the Export Subtitles option and export it in a suitable format (popular formats are .srt and .sub) and save it.




Congratulations! You have just created your own sub-title file.






How do I name the sub-title file?

If you save the sub-title file in the same name as the video file, the sub-titles will be detected and shown by the video player, automatically.

So, if you have only one sub-title file, it is better to name it by the video file.

However, note that sites such as Youtube will insist that the sub-title is named with the translation language such as -en for English and so on.


Tuesday, July 11, 2017

How do I Extend a Linux partition in AWS EC2


Extending our Linux partition (in AWS EC2) is the resizing of your partition to use the whole disk.

Our running instance size was a Centos with 25GB hard disk space. Now, Amazon has told us that "This instance is scheduled for retirement" and we want to migrate to another instance. We found that we needed a little more space and wanted to extend the linux partition. So, when we created an image, we chose to provide for 50GB in storage.

So, we took a snapshot of the image and launched an instance from the image.

When creating the instance, the size was defined as 50GB. Then, the instance is started. 


The used hard disk space


Before we resized the Linux root partition, of the AWS EC2 instance, we needed to find out the status of the storage now. The df -h command will show us the storage space in the running instance. As seen below, it shows only 25GB.

al@ip-192-230-185-43:~/> df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvde1       25G   17G  7.3G  71% /
none            1.8G     0  1.8G   0% /dev/shm


The available and non-allocated space


We need to utilize the non-allocated space in our Centos Linux system. To find out if there is really 50GB of space in the storage, we issue the lsblk command

al@ip-192-230-185-43:~/> lsblk
NAME  MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvde1 202:65   0  50G  0 disk /


Extend the hard disk space


Great! The next step would be to resize the Linux partition (of the AWS EC2 instance) so that it uses the non-allocated space. Issue the resize2fs command which extends the drive to occupy the whole available hard disk.

al@ip-192-230-185-43:~/> resize2fs /dev/xvde1
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/xvde1 is mounted on /; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 4
Performing an on-line resize of /dev/xvde1 to 13107200 (4k) blocks.
The filesystem on /dev/xvde1 is now 13107200 blocks long.


Find out if resizing (resize2fs) worked


The command df -h is issued again to see if the "Size" has changed. We found out that it had changed from the 25GB before to 50GB, which was the extended size.

al@ip-192-230-185-43:~/> df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvde1       50G   17G   32G  35% /
none            1.8G     0  1.8G   0% /dev/shm

The root partition was thus extended to utilize all the non-allocated space in the Linux disk, of your AWS EC2 instance.

How to not print columns on display while printing on paper

Many of you may or may not be aware of a javascript code that is capable of printing page content. We had created a report which looked s...

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