Posts

Validation Form

Image
A program in Java Script to demonstrate general validation using regular expression in Java Script. Validation is an important part while building a website or general page since it helps us validating  the entered data from the users and reporting any errors. This helps us gathering proper data rather than garbage. Now validation can be done in different methods  or at different stages but it here are few simple ones. In this example program below the validation rules for: Name - should start with a capital letter and can have any number of words but should start with capitals. RollNo - It should have a basic number as "12103158" in the start and can have number ranging from 1 to 68. Program: The screen shot of the html program function nameVal() { nm=document.getElementById("un").value; if(nm.search(/^[A-Z][a-z]+( [A-Z][a-z]+)*$/)==0) alert("valid name"); else alert("invalid name"); } function rollVal() { r=docu

Refrigeration By ice cutting.

Image
History :  Even before refrigerators were invented people used to store food using big ice blocks, some evidences show it dated back to early 1700's when they found ice houses in Mesopotamia . This was not available to all until tools were created and it became more affordable . It all started in the late 1780 B.c when Fredric Tudor started shipping ice blocks to different places in America and even as far as 4 months journey to India from the lakes in Boston. People need to replenish their ice storage when the ice gets melted all summer long. Method they used to follow: Using tools they draw a grid over a plain sheet of ice.  Then with the help of hacksaw people used to manually cut the blocks. This picture is taken from google images(wikimedia.org) Then they will  pull out the blocks from the lake using huge ice prongs and send them to huge ice houses and later sent to the required destinations by different means of transportation . This picture is t

How to check if you're buying a stolen phone.

Image
If you are buying a already used phone from online websites or from any other dealers we probably don't know if the phone is a stolen one or not. And finding out is getting a bit easier today. The US wireless industry, through its trade group the CTIA, has launched a tool called the "Stolen Phone Checker, which allows us to check whether a particular phone is a stolen or not. This site works properly as the all the reported stolen device's IMEI, MEID or ESN - unique codes are stored in the database . Usually the IMEI number is either somewhere deep inside the device or for some devices it is printed outside on the back. Checking the phone is a bit important because the stolen phones are not allowed to access the service.  Steps to be followed : step1: Go to some search engine (like google, yahoo,Bing) and type "Stolen Phone checker " and press enter. step2: Go to any of the websites give according to your choice (most of them will work pro

Sony Xperia L1

The Sony's Budget Smart Phone Sony Xperia L1 Sony has today, on March 11th 2017 has released their new phone the Xperia L1 with a price tag of $199. It is available in both pink and white right now straight from the Amazon or BestBuy. Specifications: 5.5- inch 720p display. 2 GB RAM. 16 GB of storage. Media Tek MT6737T quad-core processor. powered by 2,620mAh battery, enough for daily driver. equipped with bluetooth 4.2. has USB-C port. Although it is not a great invention  but it may be suitable for people with low budget for their first smartphone because as usual sony has one of the best camera setup and every other required hardware. 

Life after Chernobyl

As many people around the globe know that Chernobyl is the one of the worst disasters ever happened to mankind destroying thousands of lives. The biggest nuclear disaster ever happened in the history of mankind . During the disaster 8 tons of radioactive material was released spread across the zone . It is 400 times effective than that of the Hiroshima bomb and 5 times the Fukushima disaster in Japan . Even now after just over 3 decades the radiation is so high that 20 kilometer area surrounding it is declared as an exclusion zone and entry is strictly prohibited . Although the nuclear debris and the top layer of most of the regions in exclusion zone was removed , Theresa's a forest included in the exclusion which was intensely effected by radioactivity . There was a change in the species due to this. The trees are radioactive now ,when they have burned a pile of dry leafs they(authorities) have noticed a spike in radioactivity levels which could be potentially an another

PRODUCER CONSUMER PROBLEM

PRODUCER CONSUMER PROBLEM The producer-consumer problem(also know as bounded buffer problem) in real life is a classic problem faced while solving the multi-process synchronization problem.  As considered in real-life the producer-consumer use a fixed buffer (storage space) for producing or consuming goods(i.e the resources). The problem may arise if the producer and the consumer are not in synchronization. If the producer produced more than required or the consumer is trying to consume more than the produced material. To solve this problem using semaphores the program is given below: import java.util.concurrent.Semaphore;  class globe{      //for counting the number of items the varialble is made global. public class ConsumerProducer{     public static void main(String[] args)     do   ch=sc.nextInt();        break;                                           else Output: semaphoreProducer permit=1 | semaphoreConsumer permit=0 1 import java.lang.*; import java.util.*;   pu

Chernobyl Disaster

Image
   Chernobyl Nuclear Accident, in history chernobyl nuclear accident near the city of Pripyat in Soviet Russia on 26th April 1986 in the No.4 light water graphite moderated reactor at the Chernobyl Nuclear Power Plant is one of the worst nuclear disasters ever happened on planet earth.  The test to be conducted on that day was to be conducted before the start of the reactor but due to builders interest in getting a bonus instead of safety the reactor was opened many defects.During the system power-failure stress test in which the security systems were turned off knowingly , a combination of both the design faults and operator’s wrong decision of running the test even if the reactor is not in the specified checklist conditions has lead to this gnarly disaster. The head of the department is Dyatlov who has already worked in nuclear field while installing reactors in submarines and was exposed to radiation of 3 life times(200 Rems). The operators in the room on the day were i