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 <cstring> | |
#include <cstdio> | |
#include <algorithm> | |
using namespace std; | |
char line[256] = {0}; | |
int n; | |
char names[10][16]; | |
char* tmp; |
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 IEnumerable<int[]> Permut(int[] arr){ | |
while (true){ | |
yield return arr; | |
var j = arr.Length - 2; | |
while (j >= 0 && arr[j] >= arr[j+1]) j--; | |
if (j < 0) break; | |
var l = arr.Length -1; | |
while (arr[j] >= arr[l]) l--; |
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
#ifdef _WIN32_ | |
#include <Windows.h> | |
volatile LONG g_heap_mutex = 0; | |
#define LOCK(mtx) { \ | |
while(InterlockedCompareExchange(&mtx,1,0)==1){\ | |
Sleep(0);\ | |
}} | |
#define UNLOCK(mtx) {InterlockedExchange(&mtx,0);} |
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
# JavaScript: Comments & Keywords | |
# | |
# In this exercise you will write token definition rules for all of the | |
# tokens in our subset of JavaScript *except* IDENTIFIER, NUMBER and | |
# STRING. In addition, you will handle // end of line comments | |
# as well as /* delimited comments */. | |
# | |
# We will assume that JavaScript is case sensitive and that keywords like | |
# 'if' and 'true' must be written in lowercase. There are 26 possible | |
# tokens that you must handle. The 'tokens' variable below has been |
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
cmake_minimum_required(VERSION 2.8) | |
project (lab4 CXX) | |
set(CMAKE_C_FLAGS "-fpermissive") | |
set(CMAKE_CXX_FLAGS "-fpermissive -g") | |
add_executable(task1 task1.cpp thirdparty.h) | |
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
cmake_minimum_required(VERSION 2.8) | |
project (lab3 CXX) | |
set(CMAKE_C_FLAGS "-fpermissive") | |
set(CMAKE_CXX_FLAGS "-fpermissive -g") | |
add_executable(task1 task1.cpp thirdparty.h testtables.h) | |
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 ( | |
"fmt" | |
) | |
type Node struct{ | |
val interface{} | |
next *Node | |
} |
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
[PyScripter] | |
Version=2.5.3.0 | |
[Highlighters\Python] | |
Name=SynPythonSyn | |
Tag=0 | |
DefaultFilter=Python Files (*.py;*.pyw)|*.py;*.pyw | |
Enabled=TRUE | |
[Highlighters\Python\CommentAttri] |
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
class minheap(object): | |
""" lst - is list of tuples (vertex id, path lenth)""" | |
def __init__(self, lst): | |
self.vlist = {} | |
self.q = [x for x in lst] | |
self.size = len(self.q) | |
for idx, val in enumerate(self.q): | |
self.vlist[val[0]] = idx | |
self.__buildheap() |
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
#lang racket | |
(require rackunit "hw5.rkt") | |
(require rackunit/text-ui) | |
(define hw5-tests | |
(test-suite | |
"Tests for HW 5" | |
(test-equal? "MUPL list -> Racket list #1" | |
(list (int 3) (int 4) (int 9)) |
NewerOlder