General computer science topics applicable to any subdomain.
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
// --- instance.id ------------------------------------------------------------ | |
// Thanks to TheZombieKiller and Peter77 for creating this | |
// https://forum.unity.com/threads/editor-skinning-thread.711059/#post-4785434 | |
// Tested on Unity 2019.3.0b1 - 95% Dark mode Conversion | |
// Example Screenshot - https://i.imgur.com/9q5VPQk.png | |
// (Note - Once I ran this, I had to hit play and then it took effect) | |
// ---------------------------------------------------------------------------- | |
using System; | |
using System.Text.RegularExpressions; |
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
//Read | |
//BsonDocument | |
var collection = db.GetCollection<BsonDocument>("people"); | |
var builder = Builders<BsonDocument>.Filter; | |
//Note that the '&' '!' '|' operators are overloaded when used in the FilterBuilder | |
var filter = builder.Lt("Age", 33) & !builder.Eq("Name", "Ericsson"); | |
var list = await collection.Find(filter).ToListAsync(); | |
------------------------------------------------------------------------------------ |
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
adb help // List all comands | |
== Adb Server | |
adb kill-server | |
adb start-server | |
== Adb Reboot | |
adb reboot | |
adb reboot recovery | |
adb reboot-bootloader |
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
// This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. | |
// To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ | |
// or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Net.Sockets; | |
using System.Text; | |
using System.Threading; | |
using UnityEngine; |
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
// Copyright (c) 2016 StagPoint Software | |
namespace StagPoint.Networking | |
{ | |
using System; | |
using UnityEngine; | |
using UnityEngine.Networking; | |
/// <summary> | |
/// Provides some commonly-used functions for transferring compressed data over the network using |
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
public class Crc64 | |
{ | |
private static readonly ulong[] Table = { | |
0x0000000000000000, 0x7ad870c830358979, | |
0xf5b0e190606b12f2, 0x8f689158505e9b8b, | |
0xc038e5739841b68f, 0xbae095bba8743ff6, | |
0x358804e3f82aa47d, 0x4f50742bc81f2d04, | |
0xab28ecb46814fe75, 0xd1f09c7c5821770c, | |
0x5e980d24087fec87, 0x24407dec384a65fe, | |
0x6b1009c7f05548fa, 0x11c8790fc060c183, |
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
using System; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Text; | |
namespace UDP | |
{ | |
public class UDPSocket | |
{ | |
private Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); |
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
/* | |
http://entitycrisis.blogspot.com/2010/02/spatial-hash-class-in-c.html | |
This is a rather useful class, the Spatial Hash. It is used for creating an index of spatial data (3D things in space) and allowing fast queries to be run against the index. | |
Effectively, you can use this class to ask, "I'm at this position, what other objects are near me?". | |
*/ | |
using UnityEngine; //This needs to be 'removed' to make 'universal', i.e. not tied to Unity3D | |
using System.Collections; |
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
// Asynchronous Client Socket Example | |
// http://msdn.microsoft.com/en-us/library/bew39x2a.aspx | |
using System; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Threading; | |
using System.Text; | |
// State object for receiving data from remote device. |
NewerOlder