Skip to content

Instantly share code, notes, and snippets.

@Abiwax
Abiwax / Simple Example
Last active September 20, 2016 21:54
Simple array example in c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ClassTutorial1
{
class Program
@Abiwax
Abiwax / Dictionary Example
Last active October 1, 2016 07:42
Example
public class Student{
public Dictionary<string, object> CustomProperties =
new Dictionary<string, object>();
}
public class Program
{
public void FindName(List<Student> student, string name)
{
List<Student> names = student;
@Abiwax
Abiwax / Inheritance Tutorial
Last active September 20, 2016 21:57
Simple inheritance tutorial
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Shape
{
@Abiwax
Abiwax / Array declaration
Created September 20, 2016 21:55
Array example
string[] name = new string[] { "Tom", "Sreejata", "Kashif" };
int[] java = new int[] { 70, 88, 30 };
int[] statistics = new int[] { 76, 40, 90 };
int[] age = new int[] { 20, 22, 25 };
@Abiwax
Abiwax / Calling functions in C#
Last active October 1, 2016 00:24
Working with functions
//You can only call functions with the same declared type without instantiating an object of the class.
public void Test1(){
Console.WriteLine("Ist Function and Other Function "+Test());
}
public int Test(){
return 2;
}
@Abiwax
Abiwax / Code Examples
Last active October 2, 2016 00:57
Data Structures
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
{
//Array
@Abiwax
Abiwax / list of province
Created October 20, 2016 22:07
provincelist
if (DropDownList3.SelectedIndex == 1)
{
DropDownList4.Items.Add(new ListItem("", "0"));
DropDownList4.Items.Add(new ListItem("Alberta", "AB"));
DropDownList4.Items.Add(new ListItem("British Columbia", "BC"));
DropDownList4.Items.Add(new ListItem("Manitoba", "MB"));
DropDownList4.Items.Add(new ListItem("New Brunswick", "NB"));
DropDownList4.Items.Add(new ListItem("Newfoundland and Labrador", "NL"));
DropDownList4.Items.Add(new ListItem("Northwest Territories", "NT"));
DropDownList4.Items.Add(new ListItem("Nova Scotia", "NS"));
@Abiwax
Abiwax / database
Created October 22, 2016 15:04
VB.net database connection
'First, Right click On references In your project via solution explorer,
'click On Add reference, on the left side, click extension, scroll down till you find MySql.Data,
'add it To your project, then continue coding as below.
Imports MySql.Data.MySqlClient
Module Module1
Dim conn As New MySqlConnection
Dim DatabaseName As String = "reservation"
Dim server As String = "localhost"
@Abiwax
Abiwax / index.html
Created October 4, 2017 23:52
Charts.js HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="../node_modules/chart.js/dist/Chart.js"></script>
<script>
$(document).ready(function () {
var SERVER_URL = "http://localhost:3000/";
$.get(SERVER_URL, function (record) {
@Abiwax
Abiwax / app.js
Created October 4, 2017 23:52
Node MySQL connection
var mysql = require('mysql');
var express = require('express');
var app = express();
var connection = mysql.createConnection({
host : "localhost",
user : "username",
password: "yourpassword",
database: "Example"
});