Skip to content

Instantly share code, notes, and snippets.

@Abiwax
Abiwax / Simple Example
Last active Sep 20, 2016
Simple array example in c#
View Simple Example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ClassTutorial1
{
class Program
View Dictionary 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 Sep 20, 2016
Simple inheritance tutorial
View Inheritance Tutorial
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Shape
{
View Array declaration
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 Oct 1, 2016
Working with functions
View Calling functions in C#
//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 Oct 2, 2016
Data Structures
View Code Examples
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
{
//Array
View list of province
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 Oct 22, 2016
VB.net database connection
View database
'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 Oct 4, 2017
Charts.js HTML
View index.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 Oct 4, 2017
Node MySQL connection
View app.js
var mysql = require('mysql');
var express = require('express');
var app = express();
var connection = mysql.createConnection({
host : "localhost",
user : "username",
password: "yourpassword",
database: "Example"
});