This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() { | |
int a[50], n, i, j, temp = 0; | |
printf("Enter how many elements you want:\n"); | |
scanf("%d", &n); | |
printf("\nEnter the %d elements:\n", n); | |
for (i = 0; i < n; i++) { | |
scanf("%d", &a[i]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define LL_OK 0 | |
#define LL_NOTOK 1 | |
typedef struct ll_node { | |
void* value; | |
struct ll_node* next; | |
} ll_node; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stddef.h> | |
typedef struct _List { | |
struct _List *next; | |
int val; | |
} List; | |
enum { | |
SWAPSUCCESS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tasksTypes(deadlines, day) { | |
var resultArray = new Array(3); | |
var today = 0; | |
var upcoming = 0; | |
var later = 0; | |
for(i=0; i<deadlines.length; i++){ | |
if(deadlines[i] <= day) { | |
today++; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function digitSum(n) { | |
var sum = 0; | |
var string = n.toString(); | |
for(i=0; i < string.length; i++){ | |
sum = sum + parseInt(string.substring(i, i+1)); | |
} | |
return sum; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"><head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
html, body { | |
height: 100%; | |
} | |
body { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datatype 'a Btree = Empty | Node of 'a * 'a Btree * 'a Btree; | |
fun member(x: 'a, ordering_relation: 'a * 'a -> bool, equality_relation: 'a * 'a -> bool, Empty) = false | |
| member(x: 'a, ordering_relation: 'a * 'a -> bool, equality_relation: 'a * 'a -> bool, Node(y, left, right)) = | |
if equality_relation(x,y) then true | |
else | |
if ordering_relation(x,y) then member(x, ordering_relation, equality_relation, left) | |
else member(x, ordering_relation, equality_relation, right); | |
fun insert(x, ordering_relation: 'a * 'a -> bool, equality_relation: 'a * 'a -> bool, Empty) = Node(x, Empty, Empty) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import os | |
from pathlib import Path | |
import sqlite3 | |
from shutil import copyfile | |
# Takes the filename of the script, converts it to an absolute path. | |
# Then extracts the directory of that path, then changes into that directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
expander = {"n":"\n", "s": " ", "q": "~~~~~~"} | |
os.system(['clear','cls'][os.name == 'nt']) | |
animation = [] | |
animation.append("""nnnnnnqqq""") | |
animation.append("""n/nnnnnqqq""") | |
animation.append("""n /n/nnnnqqq""") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var modifier = Math.random()*360; | |
$( "#svgMain" ).click(function() { | |
var svg = document.getElementById("svgMain") | |
var allElements = svg.getElementsByTagName("*"); | |
for(var i = 0; i < allElements.length; i++) { | |
var element = allElements[i]; | |
console.log(element); | |
$(element).css({ fill: changeHue($(element).css('fill'),modifier)}); | |
} |
OlderNewer