Skip to content

Instantly share code, notes, and snippets.

View chiragmongia's full-sized avatar

Chirag Mongia chiragmongia

View GitHub Profile
<html>
<body bgcolor="#F0F8FF">
<h1 align="center">HTML form exercise</h1>
<p>
<font color="red">Please note: </font>
This Example demonstrates how HTML forms can be used. Submit button should
submit the button and reset button should reset the form(revert the changes
in form fields). The form layout should be the same as below.<br>
<form action="MAILTO:chiragmongia05@gmail.com" method="post;">
<b>Contact form</b><br>
Part-1
desc tastes;
+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| name | varchar(40) | YES | | NULL | |
| filling | varchar(40) | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
create database vtapp;
create user 'vtapp_user'@'localhost' identified by 'pass';
grant all on vtapp.* to 'vtapp_user'@'localhost';
$ mysqldump -uroot -p exercise1 > newbackup.sql;
Enter password:
mysql>create database restored;
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| exercise1 |
desc testing_table ;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| username | varchar(30) | YES | | NULL | |
| roll_no | int(5) | YES | | NULL | |
| first_name | varchar(30) | YES | | NULL | |
| last_name | varchar(30) | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
desc user_type;
+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| usertype | varchar(20) | YES | | NULL | |
| user | varchar(20) | YES | | NULL | |
+----------+-------------+------+-----+---------+-------+
desc user_category;
+----------+-------------+------+-----+---------+-------+
arr= "Ruby is scripting language".split(//)
h1 = Hash.new(0)
arr.each { |word| h1[word] += 1}
h1.each {|word, h1| puts word+"-"+h1.to_s}
def fibonacci(number)
first = 0
second = 1
while first <= number
yield first
temp = first
first = second
second = first + temp
end
end
p 'Enter text'
a = gets
puts a.gsub(/[aeiou]|[AEIOU]/, '*')
def palindrome
print "Enter the string\n"
line = gets.chomp
if line.reverse == line
p "String is a palindrome!"
else
p "String is not a palindrome!"
end
end