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<time.h> | |
#include<math.h> | |
#include<stdlib.h> | |
#define Max 1000 | |
void genMatrix(int** a,int n) { | |
srand(time(NULL)); | |
for(int i=0; i< n; i++) { | |
for (int j=0; j<n; j++) { | |
a[i][j] = rand()% 1000; |
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
/** | |
* 2 for loop: 9952.51 9887.98 9891.36 9950.76 9890.16 | |
* 1 for loop: 9885.17 9888.52 9886.23 9885.01 9882.4 | |
* original : | |
* 1 for loop: 34841.14 34953.85 34823.9 | |
* 2 for loop: 34842.56 34914.84 34912.07 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
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
/* | |
* i+= 1: 1429.11 1431.84 1430.81 1435.61 1430.51 | |
* i+= 2: 1392.57 1401.44 1399.31 1390.12 1398.40 | |
* i+= 1 & Hung's idea: | |
* 802.61 802.2 803.17 800.61 820.3 | |
* i+= 2 & Hung's idea: | |
* 779.11 783.59 783.59 804.49 780.27 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
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 javax.swing.*; | |
import java.awt.*; | |
import java.awt.event.*; | |
import java.util.*; | |
public class Main { | |
public static void main(String[] args) { | |
Diagram diagram = new Diagram(Diagram.WIDTH, Diagram.HEIGHT); | |
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 java.io.*; | |
import java.net.HttpURLConnection; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.util.Arrays; | |
public class IO { | |
public static String readFile(File f) throws IOException { |
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
package test; | |
public class TestGenerics { | |
public static void main(String[] args) { | |
Pair<Circle> pair = new Pair<>(1, new Circle(2.0f)); | |
Pair<Person> pair2 = new Pair<>(1, new Person(20)); | |
System.out.println(pair); | |
System.out.println(pair2); |
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
#!/bin/bash | |
ssh -i ~/.ssh/private_key -N -R 3388:127.0.0.1:3389 -o ServerAliveInterval=120 root@remote_server |
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
Private Sub Worksheet_Change(ByVal Target As Range) | |
If Not Application.Intersect(Range("U6:U50"), Range(Target.Address)) Is Nothing Then | |
Call Colorize | |
End If | |
End Sub | |
Sub Colorize() | |
For i = 6 To 50 | |
For j = 1 To 20 | |
If IsEmpty(Cells(i, 21)) = False Then |
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 org.eclipse.jdt.core.dom.*; | |
import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; | |
import org.eclipse.jface.text.BadLocationException; | |
import org.eclipse.jface.text.Document; | |
import org.eclipse.jface.text.IDocument; | |
import org.eclipse.text.edits.TextEdit; | |
import org.eclipse.text.edits.UndoEdit; | |
import org.junit.Assert; | |
import org.junit.Test; |
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 <iostream> | |
#include <bits/stdc++.h> | |
using namespace std; | |
class Array { | |
private: | |
int n; | |
vector<int> data; |
OlderNewer