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
function putPixel(x: number, y: number) { | |
const textureVectorWithLightColor = textureVectorsWithLightColor[x][y]; | |
const distortedNormalVector = distortedNormalVectors[x][y]; | |
// cos theta = v1 * v2 / (norm(v1) * norm(v2)) | |
// Since lightDirectionVersor and distortedNormalVector are unit vectors, cos theta is just | |
// a dot product | |
const cosTheta = Vector3.dotProduct(lightDirectionVersor, distortedNormalVector); | |
const clampedCosTheta = Math.max(0, Math.min(1, cosTheta)); |
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
onmessage = (e: MessageEvent) => { | |
const messageType: FillWorkerMessageType = e.data.type; | |
switch (messageType) { | |
case FillWorkerMessageType.InitialData: | |
appFillData = e.data.appFillData; | |
canvasWidth = e.data.width; | |
canvasHeight = e.data.height; | |
break; |
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 Northwind; | |
GO | |
CREATE PROCEDURE AllocateEmployees | |
AS | |
DECLARE @UnallocatedStayID int | |
DECLARE @HotelID int | |
DECLARE UnallocatedRooms CURSOR LOCAL FOR SELECT StayID, HotelID FROM HotelStays WHERE EndDate IS NULL AND RoomID IS NULL ORDER BY NEWID() | |
OPEN UnallocatedRooms | |
FETCH NEXT FROM UnallocatedRooms INTO @UnallocatedStayID, @HotelID | |
WHILE @@FETCH_STATUS = 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
using System; | |
using System.Diagnostics; | |
using ASD.Graphs; | |
namespace ASD | |
{ | |
#region Types | |
public class SmurfphoneFactoryTestCase : TestCase | |
{ |
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
using System; | |
using System.Linq; | |
using System.Collections.Generic; | |
using ASD; | |
using ASD.Graphs; | |
namespace lab10 | |
{ | |
class MatchingTestCase : TestCase |
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
using System; | |
using System.Linq; | |
using ASD; | |
using ASD.Graphs; | |
namespace Lab9 | |
{ | |
class MuseumTestCase : TestCase | |
{ | |
public static bool NumberOnly; |
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
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <sys/time.h> | |
#include <netinet/in.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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ASD | |
{ | |
class BridgeCrossingTestCase : TestCase |
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
#define _GNU_SOURCE | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/socket.h> | |
#include <errno.h> | |
#include <sys/un.h> | |
#include <pthread.h> | |
#include <sys/time.h> | |
#include <stdint.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
CC=gcc | |
CFLAGS=-Wall -std=gnu99 | |
LDLIBS=-lrt |
NewerOlder