Skip to content

Instantly share code, notes, and snippets.

@abrarShariar
abrarShariar / lab-01.cpp
Created June 2, 2016 12:54
Data structure problem (LAB)
/*
There are 40 students in a class. Each student record contains student ID, Name, Marks of four class tests of a course.
Write a program to print the ID, name and average marks of best three tests for each student
*/
#include<iostream>
using namespace std;
double findAverage(double *pmark);
struct student{
@abrarShariar
abrarShariar / varArray.cpp
Created May 4, 2016 09:36
dynamic array with pointer (new)
#include<iostream>
using namespace std;
int main(){
int N=2;
int parr[N];
int *arr01=NULL;
int line;
cin>>line;
@abrarShariar
abrarShariar / ajaxGetJSON.html
Created March 18, 2016 18:54
fetch data from a .json file with AJAX call
<html>
<head>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.1.min.js"></script>
<title></title>
</head>
<body>
<button id="click">Click</button>
@abrarShariar
abrarShariar / getFileData.js
Created March 18, 2016 18:19
get data from file in JSON format and parse with JS
var xmlhttp=new XMLHttpRequest();
var url="data.txt"; //name of the file to fetch data
var dataArr=[];
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4 && xmlhttp.status==200){
var myArr=JSON.parse(xmlhttp.responseText);
dataArr=spitData(myArr);
}
};
@abrarShariar
abrarShariar / case_convert.asm
Last active March 11, 2016 18:00
Lowercase to uppercase (vice versa) using logical OR, XOR
.model small
.stack 100h
.data
lower db 'Lower: $'
upper db 'Upper: $'
inval db 'INVALID INPUT $'
.code
@abrarShariar
abrarShariar / conversion_loop.asm
Created March 10, 2016 16:43
conversion between lower and upper case letters (vice versa)
.model small
.stack 100h
.data
letter db ?
err db 'INVALID INPUT$'
.code
main proc
@abrarShariar
abrarShariar / ajax_01.html
Created March 10, 2016 07:53
Ajax load() with jquery
<script src="https://code.jquery.com/jquery-2.2.1.min.js"></script>
<input type="button" id="active" value="AJAX ME..">
<div id="info">
<!-- display ajax data here -->
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#active").click(function(){
@abrarShariar
abrarShariar / colorMyName.html
Created March 4, 2016 18:11
fun with setTimeout() in JS
<html>
<head>
<title>JS</title>
</head>
<body>
<div id="box">
</div>
<script type="text/javascript">
@abrarShariar
abrarShariar / loadFun.html
Created March 4, 2016 16:35
Loading status fun with JS
<style type="text/css">
#mainBox{
border-style: groove;
margin-right: 46.5%;
}
</style>
<body>
<h3 id="head">Loading JS... </h3>
@abrarShariar
abrarShariar / cssChange.js
Created March 4, 2016 09:14
just a snippet of changing attributes with JS
var colorArr=["red","blue","black","grey","yellow","pink"];
var fontArr=["sans-serif","monospace","fantasy"];
// var marginArr=["120%","100%","100%","120%"];
var btn=document.getElementById("btn"); //your button id
var text=document.getElementById("text"); //your text id
var countColor=0,countFont=0,countMargin=0;
btn.onclick=function(){
if(countColor<colorArr.length){ //change color