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
// might work with compiler optimilization turned on, but better when disabled | |
#include <thread> | |
#include <iostream> | |
#include <string> | |
#include <Windows.h> // for Sleep() | |
typedef unsigned long long uint64; | |
constexpr int CPU_N = 4; // the more the longer it will wait (reduce n), 99+ will break the array |
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
var diff = 'a'.codePointAt(0) - 'A'.codePointAt(0); | |
var N = 'z'.codePointAt(0) - 'a'.codePointAt(0); | |
fs.readFile('05_input', 'utf8', function (err, _contents) | |
{ | |
max = 1111111; | |
for (aa = 0; aa < N; ++aa) { | |
l = String.fromCodePoint(aa + 'a'.codePointAt(0)); | |
l2 = String.fromCodePoint(aa + 'A'.codePointAt(0)); | |
contents = _contents.replace(new RegExp(l, 'g'), ''); |
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
fs.readFile('07_input', 'utf8', function (err, _contents) { | |
let contents = _contents.split`\n`; | |
contents.splice(-1, 1); | |
let nodes = new Map(); | |
for (row of contents) { | |
let from = row[5]; | |
let to = row[36]; | |
if (!nodes.get(from)) nodes.set(from, { edges: new Map() } ); |
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> | |
const int ArrSize = 44; | |
struct ArrNode{ | |
int size; | |
ArrNode* prev; | |
ArrNode* next; | |
int arr[ArrSize] = { 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
var fs = require('fs'); | |
var diff = 'a'.codePointAt(0) - 'A'.codePointAt(0); | |
var N = 'z'.codePointAt(0) - 'a'.codePointAt(0); | |
fs.readFile('E:\\javascript\\AdventOfCode\\13_input', 'utf8', function (err, _contents) | |
{ | |
let contents = _contents.split`\n`.map(c=>c.split``); |
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 <list> | |
using namespace std; | |
list<int> A ={ 3,7 }; | |
list<int>::iterator elf1 = A.begin(); | |
list<int>::iterator elf2 = ++A.begin(); | |
void move_A_iterator( list<int>::iterator & it, int steps ) { | |
while( steps-- ) { |
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
create table #CHANNEL( | |
pk [int] IDENTITY(1,1) NOT NULL, | |
ChannelNumber nvarchar(10) NULL, | |
DisplayName nvarchar(10) NULL, | |
ChannelID int NOT NULL, | |
PRIMARY KEY CLUSTERED (pk ASC) | |
) |
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
endsWith = function (str, suffix) { | |
if (str.length < suffix.length) | |
return false; | |
var suff_i = suffix.length - 1; | |
var str_i = str.length - 1; | |
for (; suff_i >= 0;) { | |
if (str.charAt(str_i) != suffix.charAt(suff_i)) | |
return false; | |
--suff_i; | |
--str_i; |
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
/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/ | |
BEGIN TRANSACTION | |
SET QUOTED_IDENTIFIER ON | |
SET ARITHABORT ON | |
SET NUMERIC_ROUNDABORT OFF | |
SET CONCAT_NULL_YIELDS_NULL ON | |
SET ANSI_NULLS ON | |
SET ANSI_PADDING ON | |
SET ANSI_WARNINGS ON | |
COMMIT |
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
CLASSES.FIELD_BASIC_INPUT = function () { }; | |
copy( CLASSES.FIELD_BASIC_INPUT, | |
[FIELD_BASIC_proto, FIELD_VALUE_proto, FIELD_DOM_proto, FIELD_BASIC_INPUT_proto]); | |
CLASSES.FIELD_BASIC_TEXTAREA = function () { }; | |
copy( CLASSES.FIELD_BASIC_TEXTAREA, | |
[FIELD_BASIC_proto, FIELD_VALUE_proto, FIELD_DOM_proto, FIELD_BASIC_TEXTAREA_proto]); | |
CLASSES.FIELD_BASIC_LABEL = function () { }; | |
copy( CLASSES.FIELD_BASIC_LABEL, |
OlderNewer