Skip to content

Instantly share code, notes, and snippets.

View sriannamalai's full-sized avatar
😇
God Is Love!

Sri Annamalai sriannamalai

😇
God Is Love!
View GitHub Profile
@sriannamalai
sriannamalai / Wizpert7.vb
Last active December 24, 2015 12:29
Code to calculate the Winners from Runners based on their Finish Time
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Dim Runner1, Runner2, Runner3 As String
Dim FT1, FT2, FT3 As Decimal
Runner1 = txtRunner1.Text
Runner2 = txtRunner2.Text
Runner3 = txtRunner3.Text
FT1 = Convert.ToDecimal(txtFT1.Text)
@sriannamalai
sriannamalai / Wizpert6.php
Created September 18, 2013 11:29
Code to calculate the Virality of Social Networks.
<?php
$social = "TWITTER";
$result1 = mysql_query("SELECT * FROM table3") or die("Cannot get the results!");
$visits = mysql_num_rows($result1);
$result2 = mysql_query("SELECT * FROM table3 WHERE SOCIAL_SITE='".$social."'") or die("Cannot get the results!");
$clicks = mysql_num_rows($result2);
$virality = $clicks / $visits * 100;
@sriannamalai
sriannamalai / Wizpert5.php
Last active December 23, 2015 08:19
Code to update data on two Tables based on their Hashes
<?php
$result = mysql_query("UPDATE table1 a, table2 b
SET b.user_id = a.user_id, b.user_site = a.user_site
WHERE a.hashes = b.hash");
if (!$result) {
die("ERROR: ".mysql_error());
} else {
echo "Successfully updated!<br /><br />";
print_r($result);
@sriannamalai
sriannamalai / Wizpert4.sql
Created September 18, 2013 10:24
Code to update two Tables based on their Hashes
SELECT a.user_id, a.user_site, b.user_id, b.user_site
FROM table1 a, table2 b
WHERE a.user_id = b.user_id AND a.hashes = b.hash
@sriannamalai
sriannamalai / Wizpert3.html
Last active December 22, 2015 12:09
Code to validate Payment methods
<form id="optionForm">
<select name="submitted[Which_your_registration][select]" id="edit-submitted-which-your-registration-select" class="select-or-other-select form-select required">
<option selected="selected" value="">- Select -</option>
<option value="credit_card">Pay by credit card</option>
<option value="send_me_an_invoice">Send me an invoice</option>
<option value="select_or_other">Contact me by phone</option>
</select>
<label for="payment">Payment Method:</label>
<input type="radio" name="payment" id="paypal" value="paypal" /> PayPal
<input type="radio" name="payment" id="google" value="google" /> Google Wallet
@sriannamalai
sriannamalai / Wizpert2.html
Last active December 22, 2015 11:59
Code to open a URL upon exiting from the currently visited site in the Browser
<html>
<head>
<script language="javascript">
var isExit = true;
</script>
</head>
<body>
<a href="some-other-link-inside-your-site" onclick="isExit = false;">some other link inside your site</a>
<script language="javascript">
@sriannamalai
sriannamalai / Wizpert1.php
Last active December 22, 2015 03:59
Code for simple Login verification
<?php
$username = $_POST['username'];
$password = $_POST['password'];
if ($username && $password)
{
$connect = mysql_connect("localhost", "root", "") or die("Couldn't Connect!");
mysql_select_db("phplogin") or die("Couldn't Find DB!");
}