This file contains hidden or 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
public static class Ex { | |
public static List<object> Flatten(this List<object> list) { | |
var result = new List<object>(); | |
foreach (var item in list) { | |
if (item is List<object>) { | |
result.AddRange(Flatten(item as List<object>)); | |
} else { | |
result.Add(item); | |
} |
This file contains hidden or 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<iostream> | |
#include<conio.h> | |
#include<iomanip> | |
using namespace std; | |
const int ROW = 5; | |
const int COL = 5; | |
class matrix |
This file contains hidden or 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 <iostream> | |
using namespace std; | |
bool a(bool in) | |
{ | |
cout << "a" << endl; | |
return in; | |
} | |
bool b(bool in) |
This file contains hidden or 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
# Use 26 since it’ll never actually equal 26 | |
# Floor will return integers; stores in vector | |
nums <- c(floor(runif(20, min=-10, max=26))) | |
# Give the chart file a name | |
png(file = “boxplotrand.png”) | |
# Plot the graph, using vector nums from first question | |
boxplot(y ~ x, data = nums, xlab = “X Values”, | |
ylab = “Y Values”, main = “Values”) | |
# Save the file |
This file contains hidden or 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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"strings" | |
) | |
func main() { |
This file contains hidden or 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 <signal.h> | |
main () | |
{ | |
void (*oldHandler) (); /* To hold old handler value */ | |
int count = 0; /* Loop counter, initialized at 0 */ | |
oldHandler = signal (SIGINT, SIG_IGN); /* Ignore Control-C */ | |
printf ("I've started looping and I can't be killed with ^C\n"); | |
while(1) | |
{ |
This file contains hidden or 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
#!/bin/bash | |
declare -i counter sum | |
declare -a -i var | |
declare -a order | |
order=([0]="first" [1]="second" [2]="third" [3]="fourth" [4]="fifth") | |
counter=0 | |
sum=0 | |
while(($counter < 5)) | |
do | |
echo "Enter the ${order[$counter]} number to add:" |
OlderNewer