diff --git a/.deploy.yml b/.deploy.yml deleted file mode 100644 index 5fb394d..0000000 --- a/.deploy.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -- name: Geekbot Deploy - hosts: all - remote_user: geekbot - vars: - ansible_port: 65432 - ansible_python_interpreter: /usr/bin/python3 - tasks: - - name: Login to Gitlab Docker Registry - 'community.docker.docker_login': - registry_url: "{{ lookup('env', 'CI_REGISTRY') }}" - username: "{{ lookup('env', 'CI_REGISTRY_USER') }}" - password: "{{ lookup('env', 'CI_REGISTRY_PASSWORD') }}" - reauthorize: yes - - name: Replace Prod Container - 'community.docker.docker_container': - name: GeekbotProd - image: "{{ lookup('env', 'IMAGE_TAG') }}" - recreate: yes - pull: yes - restart_policy: always - keep_volumes: no - ports: - - "12995:12995" - env: - GEEKBOT_DB_HOST: "{{ lookup('env', 'GEEKBOT_DB_HOST') }}" - GEEKBOT_DB_USER: "{{ lookup('env', 'GEEKBOT_DB_USER') }}" - GEEKBOT_DB_PASSWORD: "{{ lookup('env', 'GEEKBOT_DB_PASSWORD') }}" - GEEKBOT_DB_PORT: "{{ lookup('env', 'GEEKBOT_DB_PORT') }}" - GEEKBOT_DB_DATABASE: "{{ lookup('env', 'GEEKBOT_DB_DATABASE') }}" - GEEKBOT_DB_REQUIRE_SSL: "true" - GEEKBOT_DB_TRUST_CERT: "true" - GEEKBOT_SUMOLOGIC: "{{ lookup('env', 'GEEKBOT_SUMOLOCIG') }}" - GEEKBOT_SENTRY: "{{ lookup('env', 'GEEKBOT_SENTRY') }}" - GEEKBOT_DB_REDSHIFT_COMPAT: "true" - - name: Cleanup Old Container - 'community.docker.docker_prune': - images: yes diff --git a/.gitignore b/.gitignore index 066c4b4..55ab035 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,8 @@ -/*/**/bin -/*/**/obj -src/Bot/tmp/ -src/Bot/Logs/* -!/src/Bot/Logs/.keep +Geekbot.net/bin +Geekbot.net/obj +Tests/bin +Tests/obj +Backup/ .vs/ +UpgradeLog.htm .idea -.vscode -Geekbot.net.sln.DotSettings.user -app diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index a774f5e..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,69 +0,0 @@ -stages: - - build - - docker - - deploy - - ops - -variables: - VERSION: 4.4.0-V$CI_COMMIT_SHORT_SHA - IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG - -Build: - stage: build - image: mcr.microsoft.com/dotnet/sdk:6.0 - artifacts: - expire_in: 1h - paths: - - app - script: - - dotnet restore - - dotnet test tests - - dotnet publish --version-suffix "$VERSION" -r linux-x64 -c Release -p:DebugType=embedded --no-self-contained -o ./app ./src/Startup/ - -Package: - stage: docker - image: docker - only: - - master - services: - - docker:stable-dind - script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - docker build -t $IMAGE_TAG . - - docker push $IMAGE_TAG - -Deploy: - stage: deploy - image: quay.io/ansible/ansible-runner:stable-2.12-latest - only: - - master - variables: - ANSIBLE_NOCOWS: 1 - before_script: - - mkdir /root/.ssh - - cp $SSH_PRIVATE_KEY /root/.ssh/id_ed25519 - - cp $SSH_PUBLIC_KEY /root/.ssh/id_ed25519.pub - - chmod -R 600 /root/.ssh - - ssh-keyscan -p 65432 $PROD_IP > /root/.ssh/known_hosts - script: - - ansible-galaxy collection install -r ansible-requirements.yml - - ansible-playbook -i $PROD_IP, .deploy.yml - -Sentry: - stage: ops - image: getsentry/sentry-cli - allow_failure: true - only: - - master - script: - - sentry-cli releases new -p geekbot $VERSION - - sentry-cli releases set-commits --auto $VERSION - - sentry-cli releases deploys $VERSION new -e Production - -Github Mirror: - stage: ops - image: runebaas/rsync-ssh-git - only: - - master - script: - - git push https://runebaas:$TOKEN@github.com/pizzaandcoffee/Geekbot.net.git origin/master:master -f diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..c975ed1 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,52 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceRoot}/bin/Debug//", + "args": [], + "cwd": "${workspaceRoot}", + "stopAtEntry": false, + "console": "internalConsole" + }, + { + "name": ".NET Core Launch (web)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceRoot}/bin/Debug//", + "args": [], + "cwd": "${workspaceRoot}", + "stopAtEntry": false, + "launchBrowser": { + "enabled": true, + "args": "${auto-detect-url}", + "windows": { + "command": "cmd.exe", + "args": "/C start ${auto-detect-url}" + }, + "osx": { + "command": "open" + }, + "linux": { + "command": "xdg-open" + } + }, + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "sourceFileMap": { + "/Views": "${workspaceRoot}/Views" + } + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 39529ff..0000000 --- a/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM mcr.microsoft.com/dotnet/aspnet:6.0 - -COPY ./app /app/ - -EXPOSE 12995/tcp -WORKDIR /app -ENTRYPOINT ./Geekbot diff --git a/Geekbot.net.sln b/Geekbot.net.sln index f33d887..fe98069 100644 --- a/Geekbot.net.sln +++ b/Geekbot.net.sln @@ -3,19 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 VisualStudioVersion = 12.0.0.0 MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "tests\Tests.csproj", "{4CAF5F02-EFFE-4FDA-BD44-EEADDBA9600E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Geekbot.net", "Geekbot.net/Geekbot.net.csproj", "{FDCB3D92-E7B5-47BB-A9B5-CFAEFA57CDB4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "src\Core\Core.csproj", "{47671723-52A9-4668-BBC5-2BA76AE3B288}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Web", "src\Web\Web.csproj", "{0A63D5DC-6325-4F53-8ED2-9843239B76CC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bot", "src\Bot\Bot.csproj", "{DBF79896-9F7F-443D-B336-155E276DFF16}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands", "src\Commands\Commands.csproj", "{7C771DFE-912A-4276-B0A6-047E09603F1E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Interactions", "src\Interactions\Interactions.csproj", "{FF6859D9-C539-4910-BE1E-9ECFED2F46FA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Startup", "src\Startup\Startup.csproj", "{A691B018-4B19-4A7A-A0F6-DBB17641254F}" +Project("{64BFF91A-5FCE-45C2-B281-5EA31729FFBF}") = "Tests", "Tests\Tests.csproj", "{CE7B71E3-F73A-40D1-901C-C20BEFB15851}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -23,34 +13,14 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4CAF5F02-EFFE-4FDA-BD44-EEADDBA9600E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4CAF5F02-EFFE-4FDA-BD44-EEADDBA9600E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4CAF5F02-EFFE-4FDA-BD44-EEADDBA9600E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4CAF5F02-EFFE-4FDA-BD44-EEADDBA9600E}.Release|Any CPU.Build.0 = Release|Any CPU - {47671723-52A9-4668-BBC5-2BA76AE3B288}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47671723-52A9-4668-BBC5-2BA76AE3B288}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47671723-52A9-4668-BBC5-2BA76AE3B288}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47671723-52A9-4668-BBC5-2BA76AE3B288}.Release|Any CPU.Build.0 = Release|Any CPU - {0A63D5DC-6325-4F53-8ED2-9843239B76CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0A63D5DC-6325-4F53-8ED2-9843239B76CC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0A63D5DC-6325-4F53-8ED2-9843239B76CC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0A63D5DC-6325-4F53-8ED2-9843239B76CC}.Release|Any CPU.Build.0 = Release|Any CPU - {DBF79896-9F7F-443D-B336-155E276DFF16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DBF79896-9F7F-443D-B336-155E276DFF16}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DBF79896-9F7F-443D-B336-155E276DFF16}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DBF79896-9F7F-443D-B336-155E276DFF16}.Release|Any CPU.Build.0 = Release|Any CPU - {7C771DFE-912A-4276-B0A6-047E09603F1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7C771DFE-912A-4276-B0A6-047E09603F1E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7C771DFE-912A-4276-B0A6-047E09603F1E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7C771DFE-912A-4276-B0A6-047E09603F1E}.Release|Any CPU.Build.0 = Release|Any CPU - {FF6859D9-C539-4910-BE1E-9ECFED2F46FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FF6859D9-C539-4910-BE1E-9ECFED2F46FA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FF6859D9-C539-4910-BE1E-9ECFED2F46FA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FF6859D9-C539-4910-BE1E-9ECFED2F46FA}.Release|Any CPU.Build.0 = Release|Any CPU - {A691B018-4B19-4A7A-A0F6-DBB17641254F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A691B018-4B19-4A7A-A0F6-DBB17641254F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A691B018-4B19-4A7A-A0F6-DBB17641254F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A691B018-4B19-4A7A-A0F6-DBB17641254F}.Release|Any CPU.Build.0 = Release|Any CPU + {FDCB3D92-E7B5-47BB-A9B5-CFAEFA57CDB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDCB3D92-E7B5-47BB-A9B5-CFAEFA57CDB4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDCB3D92-E7B5-47BB-A9B5-CFAEFA57CDB4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDCB3D92-E7B5-47BB-A9B5-CFAEFA57CDB4}.Release|Any CPU.Build.0 = Release|Any CPU + {CE7B71E3-F73A-40D1-901C-C20BEFB15851}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE7B71E3-F73A-40D1-901C-C20BEFB15851}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE7B71E3-F73A-40D1-901C-C20BEFB15851}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE7B71E3-F73A-40D1-901C-C20BEFB15851}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Geekbot.net.sln.DotSettings b/Geekbot.net.sln.DotSettings deleted file mode 100644 index 6d439b8..0000000 --- a/Geekbot.net.sln.DotSettings +++ /dev/null @@ -1,12 +0,0 @@ - - NEVER - 200 - True - True - True - True - True - True - True - True - True \ No newline at end of file diff --git a/Geekbot.net.userprefs b/Geekbot.net.userprefs new file mode 100644 index 0000000..dca434f --- /dev/null +++ b/Geekbot.net.userprefs @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Geekbot.net/Geekbot.net.csproj b/Geekbot.net/Geekbot.net.csproj new file mode 100755 index 0000000..f943a96 --- /dev/null +++ b/Geekbot.net/Geekbot.net.csproj @@ -0,0 +1,33 @@ + + + Exe + netcoreapp1.1 + + + + + 1.0.0-rc + + + 1.25.0.760 + + + 1.5.0.1 + + + 105.2.4-rc4-24214-01 + + + 1.2.1 + + + 4.3.1 + + + 4.3.0 + + + 4.3.0 + + + \ No newline at end of file diff --git a/Geekbot.net/Lib/IClients/CatClient.cs b/Geekbot.net/Lib/IClients/CatClient.cs new file mode 100644 index 0000000..2e606ed --- /dev/null +++ b/Geekbot.net/Lib/IClients/CatClient.cs @@ -0,0 +1,19 @@ +using RestSharp; + +namespace Geekbot.net.Modules +{ + public interface ICatClient + { + IRestClient Client { get; set; } + } + + public class CatClient : ICatClient + { + public CatClient() + { + Client = new RestClient("http://random.cat"); + } + + public IRestClient Client { get; set; } + } +} \ No newline at end of file diff --git a/Geekbot.net/Lib/IClients/RandomClient.cs b/Geekbot.net/Lib/IClients/RandomClient.cs new file mode 100644 index 0000000..b6a3a50 --- /dev/null +++ b/Geekbot.net/Lib/IClients/RandomClient.cs @@ -0,0 +1,29 @@ +using System; + +namespace Geekbot.net.Lib.IClients +{ + + public interface IRandomClient + { + Random Client { get; set; } + } + + public sealed class RandomClient : IRandomClient + { + public RandomClient() + { + try + { + Client = new Random(); + } + catch (Exception) + { + Console.WriteLine("Start Redis pls..."); + Environment.Exit(1); + } + } + + public Random Client { get; set; } + } + +} \ No newline at end of file diff --git a/Geekbot.net/Lib/IClients/RedisClient.cs b/Geekbot.net/Lib/IClients/RedisClient.cs new file mode 100644 index 0000000..b05e5ad --- /dev/null +++ b/Geekbot.net/Lib/IClients/RedisClient.cs @@ -0,0 +1,30 @@ +using System; +using StackExchange.Redis; + +namespace Geekbot.net.Lib +{ + public interface IRedisClient + { + IDatabase Client { get; set; } + } + + public sealed class RedisClient : IRedisClient + { + public RedisClient() + { + try + { + var redis = ConnectionMultiplexer.Connect("127.0.0.1:6379"); + Client = redis.GetDatabase(6); + } + catch (Exception) + { + Console.WriteLine("Start Redis pls..."); + Environment.Exit(1); + } + } + + public IDatabase Client { get; set; } + } +} + diff --git a/Geekbot.net/Lib/LevelCalc.cs b/Geekbot.net/Lib/LevelCalc.cs new file mode 100644 index 0000000..631a5e2 --- /dev/null +++ b/Geekbot.net/Lib/LevelCalc.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Geekbot.net.Lib +{ + public class LevelCalc + { + private static int GetExperienceAtLevel(int level) + { + double total = 0; + for (int i = 1; i < level; i++) + { + total += Math.Floor(i + 300 * Math.Pow(2, i / 7.0)); + } + + return (int)Math.Floor(total / 16); + } + + public static int GetLevelAtExperience(int experience) + { + int index; + + for (index = 0; index < 120; index++) + { + if (GetExperienceAtLevel(index + 1) > experience) + break; + } + + return index; + } + } +} diff --git a/Geekbot.net/Lib/StatsRecorder.cs b/Geekbot.net/Lib/StatsRecorder.cs new file mode 100644 index 0000000..3a38f73 --- /dev/null +++ b/Geekbot.net/Lib/StatsRecorder.cs @@ -0,0 +1,34 @@ +using System; +using System.Threading.Tasks; +using Discord.WebSocket; +using StackExchange.Redis; + +namespace Geekbot.net.Lib +{ + public class StatsRecorder + { + + private readonly SocketMessage message; + private readonly IDatabase redis; + + public StatsRecorder(SocketMessage message, IRedisClient redisClient) + { + this.message = message; + redis = redisClient.Client; + } + + public async Task UpdateUserRecordAsync() + { + var guildId = ((SocketGuildChannel) message.Channel).Guild.Id; + var key = guildId + "-" + message.Author.Id + "-messages"; + await redis.StringIncrementAsync(key); + } + + public async Task UpdateGuildRecordAsync() + { + var guildId = ((SocketGuildChannel) message.Channel).Guild.Id; + var key = guildId + "-messages"; + await redis.StringIncrementAsync(key); + } + } +} \ No newline at end of file diff --git a/Geekbot.net/Modules/AdminCmd.cs b/Geekbot.net/Modules/AdminCmd.cs new file mode 100644 index 0000000..fe88610 --- /dev/null +++ b/Geekbot.net/Modules/AdminCmd.cs @@ -0,0 +1,41 @@ +using System.Threading.Tasks; +using Discord.Commands; +using Geekbot.net.Lib; + +namespace Geekbot.net.Modules +{ + [Group("admin")] + public class AdminCmd : ModuleBase + { + private readonly IRedisClient redis; + public AdminCmd(IRedisClient redisClient) + { + redis = redisClient; + } + + [RequireUserPermission(Discord.GuildPermission.Administrator)] + [Command("welcome", RunMode = RunMode.Async), Summary("Set a Welcome Message (use '$user' to mention the new joined user).")] + public async Task SetWelcomeMessage([Remainder, Summary("The message")] string welcomeMessage) + { + var key = Context.Guild.Id + "-welcomeMsg"; + redis.Client.StringSet(key, welcomeMessage); + var formatedMessage = welcomeMessage.Replace("$user", Context.User.Mention); + await ReplyAsync("Welcome message has been changed\r\nHere is an example of how it would look:\r\n" + + formatedMessage); + } + + [Command("youtubekey", RunMode = RunMode.Async), Summary("Set the youtube api key")] + public async Task SetYoutubeKey([Summary("API Key")] string key) + { + var botOwner = redis.Client.StringGet("botOwner"); + if (!Context.User.Id.ToString().Equals(botOwner.ToString())) + { + await ReplyAsync($"Sorry, only the botowner can do this ({botOwner}"); + return; + } + + redis.Client.StringSet("youtubeKey", key); + await ReplyAsync("Apikey has been set"); + } + } +} \ No newline at end of file diff --git a/Geekbot.net/Modules/Cat.cs b/Geekbot.net/Modules/Cat.cs new file mode 100644 index 0000000..410b53a --- /dev/null +++ b/Geekbot.net/Modules/Cat.cs @@ -0,0 +1,51 @@ +using System; +using System.Threading.Tasks; +using Discord.Commands; +using RestSharp; + +namespace Geekbot.net.Modules +{ + public class Cat : ModuleBase, AsyncReplier + { + private readonly ICatClient catClient; + private readonly AsyncReplier _asyncReplier; + private readonly Func _requestFunc; + + public class CatResponse + { + public string file { get; set; } + } + + public Cat(ICatClient catClient) + { + this.catClient = catClient; + _asyncReplier = this; + _requestFunc = (() => new RestRequest("meow.php", Method.GET)); + } +// +// public Cat(ICatClient catClient, Func requestFunc, AsyncReplier asyncReplier) +// { +// this.catClient = catClient; +// _asyncReplier = asyncReplier ?? this; +// _requestFunc = requestFunc ?? (() => new RestRequest("meow.php", Method.GET)); +// } + + [Command("cat", RunMode = RunMode.Async), Summary("Return a random image of a cat.")] + public async Task Say() + { + var request = _requestFunc(); + var response = catClient.Client.Execute(request); + await _asyncReplier.ReplyAsyncInt(response.Data.file); + } + + public async Task ReplyAsyncInt(dynamic data) + { + await ReplyAsync(data); + } + } + + public interface AsyncReplier + { + Task ReplyAsyncInt(dynamic data); + } +} \ No newline at end of file diff --git a/Geekbot.net/Modules/Counters.cs b/Geekbot.net/Modules/Counters.cs new file mode 100644 index 0000000..e037b35 --- /dev/null +++ b/Geekbot.net/Modules/Counters.cs @@ -0,0 +1,93 @@ +using System; +using System.Threading.Tasks; +using Discord; +using Discord.Commands; +using Geekbot.net.Lib; + +namespace Geekbot.net.Modules +{ + public class Counters : ModuleBase + { + private readonly IRedisClient redis; + public Counters(IRedisClient redisClient) + { + redis = redisClient; + } + + [Command("good", RunMode = RunMode.Async), Summary("Increase Someones Karma")] + public async Task Good([Summary("The someone")] IUser user) + { + var lastKarma = GetLastKarma(); + if (user.Id == Context.User.Id) + { + await ReplyAsync($"Sorry {Context.User.Username}, but you can't give yourself karma"); + } + else if (lastKarma > GetUnixTimestamp()) + { + await ReplyAsync($"Sorry {Context.User.Username}, but you have to wait {GetTimeLeft(lastKarma)} before you can give karma again..."); + } + else + { + var key = Context.Guild.Id + "-" + user.Id + "-karma"; + var badJokes = (int)redis.Client.StringGet(key); + redis.Client.StringSet(key, (badJokes + 1).ToString()); + var lastKey = Context.Guild.Id + "-" + Context.User.Id + "-karma-timeout"; + redis.Client.StringSet(lastKey, GetNewLastKarma()); + await ReplyAsync($"{Context.User.Username} gave {user.Mention} karma"); + } + } + + [Command("bad", RunMode = RunMode.Async), Summary("Decrease Someones Karma")] + public async Task Bad([Summary("The someone")] IUser user) + { + var lastKarma = GetLastKarma(); + if (user.Id == Context.User.Id) + { + await ReplyAsync($"Sorry {Context.User.Username}, but you can't lower your own karma"); + } + else if (lastKarma > GetUnixTimestamp()) + { + await ReplyAsync($"Sorry {Context.User.Username}, but you have to wait {GetTimeLeft(lastKarma)} before you can take karma again..."); + } + else + { + var key = Context.Guild.Id + "-" + user.Id + "-karma"; + var badJokes = (int)redis.Client.StringGet(key); + redis.Client.StringSet(key, (badJokes - 1).ToString()); + var lastKey = Context.Guild.Id + "-" + Context.User.Id + "-karma-timeout"; + redis.Client.StringSet(lastKey, GetNewLastKarma()); + await ReplyAsync($"{Context.User.Username} lowered {user.Mention}'s karma"); + } + } + + private int GetLastKarma() + { + var lastKey = Context.Guild.Id + "-" + Context.User.Id + "-karma-timeout"; + var redisReturn = redis.Client.StringGet(lastKey); + if (!int.TryParse(redisReturn.ToString(), out var i)) + { + i = GetUnixTimestamp(); + } + return i; + } + + private int GetNewLastKarma() + { + var timeout = TimeSpan.FromMinutes(3); + return (int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).Add(timeout)).TotalSeconds; + } + + private int GetUnixTimestamp() + { + return (int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; + } + + private string GetTimeLeft(int time) + { + DateTime dtDateTime = new DateTime(1970,1,1,0,0,0,0,DateTimeKind.Utc); + dtDateTime = dtDateTime.AddSeconds( time ).ToLocalTime(); + var dt = dtDateTime.Subtract(DateTime.Now); + return $"{dt.Minutes} Minutes and {dt.Seconds} Seconds"; + } + } +} \ No newline at end of file diff --git a/Geekbot.net/Modules/EightBall.cs b/Geekbot.net/Modules/EightBall.cs new file mode 100644 index 0000000..2d93c1b --- /dev/null +++ b/Geekbot.net/Modules/EightBall.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Discord.Commands; +using Geekbot.net.Lib.IClients; + +namespace Geekbot.net.Modules +{ + public class EightBall : ModuleBase + { + private readonly IRandomClient rnd; + public EightBall(IRandomClient randomClient) + { + rnd = randomClient; + } + [Command("8ball", RunMode = RunMode.Async), Summary("Ask 8Ball a Question.")] + public async Task Ball([Remainder, Summary("The Question")] string echo) + { + var replies = new List { + "It is certain", + "It is decidedly so", + "Without a doubt", + "Yes, definitely", + "You may rely on it", + "As I see it, yes", + "Most likely", + "Outlook good", + "Yes", + "Signs point to yes", + "Reply hazy try again", + "Ask again later", + "Better not tell you now", + "Cannot predict now", + "Concentrate and ask again", + "Don't count on it", + "My reply is no", + "My sources say no", + "Outlook not so good", + "Very doubtful"}; + + var answer = rnd.Client.Next(replies.Count); + await ReplyAsync(replies[answer]); + } + } +} \ No newline at end of file diff --git a/Geekbot.net/Modules/GuildInfo.cs b/Geekbot.net/Modules/GuildInfo.cs new file mode 100644 index 0000000..950868f --- /dev/null +++ b/Geekbot.net/Modules/GuildInfo.cs @@ -0,0 +1,47 @@ +using System; +using System.Threading.Tasks; +using Discord.Commands; +using Discord; +using Geekbot.net.Lib; +using System.Linq; + +namespace Geekbot.net.Modules +{ + public class GuildInfo : ModuleBase + { + private readonly IRedisClient redis; + public GuildInfo(IRedisClient redisClient) + { + redis = redisClient; + } + + [Command("serverstats", RunMode = RunMode.Async), Summary("Show some info about the bot.")] + public async Task getInfo() + { + var eb = new EmbedBuilder(); + eb.WithAuthor(new EmbedAuthorBuilder() + .WithIconUrl(Context.Guild.IconUrl) + .WithName(Context.Guild.Name)); + eb.WithColor(new Color(110, 204, 147)); + + var created = Context.Guild.CreatedAt; + var age = Math.Floor((DateTime.Now - created).TotalDays); + + var messages = redis.Client.StringGet($"{Context.Guild.Id}-messages"); + var level = LevelCalc.GetLevelAtExperience((int)messages); + + eb.AddField("Server Age", $"{created.Day}/{created.Month}/{created.Year} ({age} days)"); + eb.AddInlineField("Level", level) + .AddInlineField("Messages", messages); + + await ReplyAsync("", false, eb.Build()); + } + + public static string FirstCharToUpper(string input) + { + if (String.IsNullOrEmpty(input)) + throw new ArgumentException("ARGH!"); + return input.First().ToString().ToUpper() + input.Substring(1); + } + } +} \ No newline at end of file diff --git a/Geekbot.net/Modules/Help.cs b/Geekbot.net/Modules/Help.cs new file mode 100644 index 0000000..7064cba --- /dev/null +++ b/Geekbot.net/Modules/Help.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using Discord.Commands; +using System.Reflection; + +namespace Geekbot.net.Modules +{ + public class Help : ModuleBase + { + [Command("help", RunMode = RunMode.Async), Summary("List all Commands")] + public async Task GetHelp() + { + var commands = new CommandService(); + await commands.AddModulesAsync(Assembly.GetEntryAssembly()); + var cmdList = commands.Commands; + var reply = "**Geekbot Command list**\r\n"; + foreach (var cmd in cmdList) + { + var param = string.Join(", !",cmd.Aliases); + if (!param.Contains("admin")) + { + reply = reply + $"**{cmd.Name}** (!{param}) - {cmd.Summary}\r\n"; + } + } + await ReplyAsync(reply); + } + } +} \ No newline at end of file diff --git a/Geekbot.net/Modules/Info.cs b/Geekbot.net/Modules/Info.cs new file mode 100644 index 0000000..49c4af2 --- /dev/null +++ b/Geekbot.net/Modules/Info.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using Discord; +using Discord.Commands; +using Geekbot.net.Lib; + +namespace Geekbot.net.Modules +{ + public class Info : ModuleBase + { + private readonly IRedisClient redis; + public Info(IRedisClient redisClient) + { + redis = redisClient; + } + + [Command("info", RunMode = RunMode.Async), Summary("Get Information about the bot")] + public async Task BotInfo() + { + var eb = new EmbedBuilder(); + + eb.WithTitle("Geekbot V3"); + + var botOwner = Context.Guild.GetUserAsync(ulong.Parse(redis.Client.StringGet("botOwner"))).Result; + + eb.AddInlineField("Status", Context.Client.ConnectionState.ToString()) + .AddInlineField("Bot Name", Context.Client.CurrentUser.Username) + .AddInlineField("Bot Owner", $"{botOwner.Username}#{botOwner.Discriminator}"); + + eb.AddInlineField("Servers", Context.Client.GetGuildsAsync().Result.Count); + + await ReplyAsync("", false, eb.Build()); + } + } +} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/Ping.cs b/Geekbot.net/Modules/Ping.cs similarity index 50% rename from src/Bot/Commands/Utils/Ping.cs rename to Geekbot.net/Modules/Ping.cs index ee751cd..0803413 100644 --- a/src/Bot/Commands/Utils/Ping.cs +++ b/Geekbot.net/Modules/Ping.cs @@ -1,13 +1,12 @@ using System.Threading.Tasks; +using Discord; using Discord.Commands; -using Geekbot.Core; -namespace Geekbot.Bot.Commands.Utils +namespace Geekbot.net.Modules { - public class Ping : TransactionModuleBase + public class Ping : ModuleBase { - [Command("👀", RunMode = RunMode.Async)] - [Summary("Look at the bot.")] + [Command("👀", RunMode = RunMode.Async), Summary("Look at the bot.")] public async Task Eyes() { await ReplyAsync("S... Stop looking at me... baka!"); diff --git a/Geekbot.net/Modules/Roll.cs b/Geekbot.net/Modules/Roll.cs new file mode 100644 index 0000000..6331d22 --- /dev/null +++ b/Geekbot.net/Modules/Roll.cs @@ -0,0 +1,48 @@ +using System.Threading.Tasks; +using Discord.Commands; +using Geekbot.net.Lib; +using Geekbot.net.Lib.IClients; + +namespace Geekbot.net.Modules +{ + public class Roll : ModuleBase + { + private readonly IRedisClient redis; + private readonly IRandomClient rnd; + public Roll(IRedisClient redisClient, IRandomClient randomClient) + { + redis = redisClient; + rnd = randomClient; + } + + [Command("roll", RunMode = RunMode.Async), Summary("Roll a number between 1 and 100.")] + public async Task RollCommand([Remainder, Summary("stuff...")] string stuff = "nothing") + { + var number = rnd.Client.Next(1, 100); + var guess = 1000; + int.TryParse(stuff, out guess); + if (guess <= 100 && guess > 0) + { + await ReplyAsync($"{Context.Message.Author.Mention} you rolled {number}, your guess was {guess}"); + if (guess == number) + { + await ReplyAsync($"Congratulations {Context.User.Username}, your guess was correct!"); + var key = $"{Context.Guild.Id}-{Context.User.Id}-correctRolls"; + var messages = (int)redis.Client.StringGet(key); + redis.Client.StringSet(key, (messages + 1).ToString()); + } + } + else + { + await ReplyAsync(Context.Message.Author.Mention + ", you rolled " + number); + } + } + + [Command("dice", RunMode = RunMode.Async), Summary("Roll a dice")] + public async Task DiceCommand([Summary("The highest number on the dice")] int max = 6) + { + var number = rnd.Client.Next(1, max); + await ReplyAsync(Context.Message.Author.Mention + ", you rolled " + number); + } + } +} \ No newline at end of file diff --git a/Geekbot.net/Modules/Say.cs b/Geekbot.net/Modules/Say.cs new file mode 100644 index 0000000..35f0294 --- /dev/null +++ b/Geekbot.net/Modules/Say.cs @@ -0,0 +1,16 @@ +using System.Threading.Tasks; +using Discord.Commands; + +namespace Geekbot.net.Modules +{ + public class Say : ModuleBase + { + [RequireUserPermission(Discord.GuildPermission.Administrator)] + [Command("say", RunMode = RunMode.Async), Summary("Say Something.")] + public async Task Echo([Remainder, Summary("What?")] string echo) + { + await Context.Message.DeleteAsync(); + await ReplyAsync(echo); + } + } +} \ No newline at end of file diff --git a/Geekbot.net/Modules/UserInfo.cs b/Geekbot.net/Modules/UserInfo.cs new file mode 100644 index 0000000..7eeb4cb --- /dev/null +++ b/Geekbot.net/Modules/UserInfo.cs @@ -0,0 +1,57 @@ +using System; +using System.Threading.Tasks; +using Discord; +using Discord.Commands; +using Geekbot.net.Lib; + +namespace Geekbot.net.Modules +{ + public class UserInfo : ModuleBase + { + private readonly IRedisClient redis; + public UserInfo(IRedisClient redisClient) + { + redis = redisClient; + } + + [Alias("stats")] + [Command("user", RunMode = RunMode.Async), Summary("Get information about this user")] + public async Task User([Summary("The (optional) user to get info for")] IUser user = null) + { + var userInfo = user ?? Context.Message.Author; + + var age = Math.Floor((DateTime.Now - userInfo.CreatedAt).TotalDays); + + var key = Context.Guild.Id + "-" + userInfo.Id; + var messages = (int)redis.Client.StringGet(key + "-messages"); + var level = LevelCalc.GetLevelAtExperience(messages); + + var eb = new EmbedBuilder(); + eb.WithAuthor(new EmbedAuthorBuilder() + .WithIconUrl(userInfo.GetAvatarUrl()) + .WithName(userInfo.Username)); + + eb.WithColor(new Color(221, 255, 119)); + + eb.AddField("Discordian Since", $"{userInfo.CreatedAt.Day}/{userInfo.CreatedAt.Month}/{userInfo.CreatedAt.Year} ({age} days)"); + eb.AddInlineField("Level", level) + .AddInlineField("Messages Sent", messages); + + var karma = redis.Client.StringGet(key + "-karma"); + if (!karma.IsNullOrEmpty) + { + eb.AddField("Karma", karma); + } + + var correctRolls = redis.Client.StringGet($"{Context.Guild.Id}-{userInfo.Id}-correctRolls"); + if (!correctRolls.IsNullOrEmpty) + { + eb.AddField("Guessed Rolls", correctRolls); + } + + await ReplyAsync("", false, eb.Build()); + } + + + } +} \ No newline at end of file diff --git a/Geekbot.net/Modules/Youtube.cs b/Geekbot.net/Modules/Youtube.cs new file mode 100644 index 0000000..b06fbdc --- /dev/null +++ b/Geekbot.net/Modules/Youtube.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Discord.Commands; +using Geekbot.net.Lib; +using Google.Apis.Services; +using Google.Apis.YouTube.v3; + +namespace Geekbot.net.Modules +{ + public class Youtube : ModuleBase + { + private readonly IRedisClient redis; + public Youtube(IRedisClient redisClient) + { + redis = redisClient; + } + + [Command("yt", RunMode = RunMode.Async), Summary("Search for something on youtube.")] + public async Task Yt([Remainder, Summary("A Song Title")] string searchQuery) + { + var key = redis.Client.StringGet("youtubeKey"); + if (key.IsNullOrEmpty) + { + await ReplyAsync("No youtube key set, please tell my senpai to set one"); + return; + } + + try + { + var youtubeService = new YouTubeService(new BaseClientService.Initializer() + { + ApiKey = key.ToString(), + ApplicationName = this.GetType().ToString() + }); + + var searchListRequest = youtubeService.Search.List("snippet"); + searchListRequest.Q = searchQuery; + searchListRequest.MaxResults = 2; + + var searchListResponse = await searchListRequest.ExecuteAsync(); + + var result = searchListResponse.Items[0]; + + await ReplyAsync( + $"\"{result.Snippet.Title}\" from \"{result.Snippet.ChannelTitle}\" https://youtu.be/{result.Id.VideoId}"); + } + catch (Exception e) + { + await ReplyAsync("Something went wrong... informing my senpai..."); + var botOwner = Context.Guild.GetUserAsync(ulong.Parse(redis.Client.StringGet("botOwner"))).Result; + var dm = await botOwner.CreateDMChannelAsync(); + await dm.SendMessageAsync($"Something went wrong while getting a video from youtube:\r\n```\r\n{e.Message}\r\n```"); + } + } + } +} \ No newline at end of file diff --git a/Geekbot.net/Program.cs b/Geekbot.net/Program.cs new file mode 100755 index 0000000..ba50465 --- /dev/null +++ b/Geekbot.net/Program.cs @@ -0,0 +1,163 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices.ComTypes; +using System.Threading.Tasks; +using Discord; +using Discord.Commands; +using Discord.WebSocket; +using Geekbot.net.Lib; +using Geekbot.net.Lib.IClients; +using Geekbot.net.Modules; +using StackExchange.Redis; + +namespace Geekbot.net +{ + class Program + { + private CommandService commands; + private DiscordSocketClient client; + private DependencyMap map; + private IRedisClient redis; + private RedisValue token; + + private static void Main(string[] args) + { + Console.WriteLine(@" ____ _____ _____ _ ______ ___ _____"); + Console.WriteLine(@" / ___| ____| ____| |/ / __ ) / _ \\_ _|"); + Console.WriteLine(@"| | _| _| | _| | ' /| _ \| | | || |"); + Console.WriteLine(@"| |_| | |___| |___| . \| |_) | |_| || |"); + Console.WriteLine(@" \____|_____|_____|_|\_\____/ \___/ |_|"); + Console.WriteLine("========================================="); + Console.WriteLine("Starting..."); + + Task.WaitAll(new Program().MainAsync()); + } + + public async Task MainAsync() + { + client = new DiscordSocketClient(); + commands = new CommandService(); + redis = new RedisClient(); + + token = redis.Client.StringGet("discordToken"); + if (token.IsNullOrEmpty) + { + Console.Write("Your bot Token: "); + var newToken = Console.ReadLine(); + redis.Client.StringSet("discordToken", newToken); + token = newToken; + + Console.Write("Bot Owner User ID: "); + var ownerId = Console.ReadLine(); + redis.Client.StringSet("botOwner", ownerId); + } + + map = new DependencyMap(); + map.Add(new CatClient()); + map.Add(redis); + map.Add(new RandomClient()); + + Console.WriteLine("Connecting to Discord..."); + + await Login(); + + await Task.Delay(-1); + } + + public async Task Login() + { + try + { + await client.LoginAsync(TokenType.Bot, token); + await client.StartAsync(); + client.Connected += FinishStartup; + } + catch (AggregateException) + { + Console.WriteLine("Could not connect to discord..."); + Environment.Exit(1); + } + } + + public async Task Reconnect(Exception exception) + { + Console.WriteLine("========================================="); + Console.WriteLine("Geekbot Disconnected from the Discord Gateway..."); + Console.WriteLine(exception.Message); + Console.WriteLine("Attempting Reconnect..."); + Console.WriteLine("========================================="); + await client.StopAsync(); + System.Threading.Thread.Sleep(10000); + await Login(); + } + + public async Task FinishStartup() + { + await client.SetGameAsync("Ping Pong"); + Console.WriteLine($"Now Connected to {client.Guilds.Count} Servers"); + + Console.WriteLine("Registering Stuff"); + + client.MessageReceived += HandleCommand; + client.MessageReceived += HandleMessageReceived; + client.UserJoined += HandleUserJoined; +// client.Disconnected += Reconnect; + await commands.AddModulesAsync(Assembly.GetEntryAssembly()); + + Console.WriteLine("Done and ready for use...\n"); + } + + public async Task HandleCommand(SocketMessage messageParam) + { + var message = messageParam as SocketUserMessage; + if (message == null) return; + if (message.Author.Username.Equals(client.CurrentUser.Username)) return; + int argPos = 0; + if (message.ToString().ToLower().StartsWith("ping")) + { + await message.Channel.SendMessageAsync("pong"); + return; + } + if (message.ToString().ToLower().StartsWith("hui")) + { + await message.Channel.SendMessageAsync("hui!!!"); + return; + } + if (message.ToString().ToLower().Contains("teamspeak") || message.ToString().ToLower().Contains("skype")) + { + await message.Channel.SendMessageAsync("How dare you to use such a filthy word in here http://bit.ly/2poL2IZ"); + return; + } + if (!(message.HasCharPrefix('!', ref argPos) || message.HasMentionPrefix(client.CurrentUser, ref argPos))) return; + var context = new CommandContext(client, message); + Task.Run(async () => await commands.ExecuteAsync(context, argPos, map)); + } + + public async Task HandleMessageReceived(SocketMessage messsageParam) + { + var message = messsageParam; + if (message == null) return; + + var channel = (SocketGuildChannel)message.Channel; + + Console.WriteLine(channel.Guild.Name + " - " + message.Channel + " - " + message.Author.Username + " - " + message.Content); + + var statsRecorder = new StatsRecorder(message, redis); + Task.Run(() => statsRecorder.UpdateUserRecordAsync()); + Task.Run(() => statsRecorder.UpdateGuildRecordAsync()); + } + + public async Task HandleUserJoined(SocketGuildUser user) + { + if (!user.IsBot) + { + var message = redis.Client.StringGet(user.Guild.Id + "-welcomeMsg"); + if (!message.IsNullOrEmpty) + { + message = message.ToString().Replace("$user", user.Mention); + await user.Guild.DefaultChannel.SendMessageAsync(message); + } + } + } + } +} diff --git a/LICENSE b/LICENSE deleted file mode 100644 index f288702..0000000 --- a/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj new file mode 100755 index 0000000..bc2c1ce --- /dev/null +++ b/Tests/Tests.csproj @@ -0,0 +1,25 @@ + + + netcoreapp1.1 + + + + 4.19.2 + + + + 4.7.8 + + + 105.2.4-rc4-24214-01 + + + + + + + {FDCB3D92-E7B5-47BB-A9B5-CFAEFA57CDB4} + Geekbot.net + + + \ No newline at end of file diff --git a/Tests/UnitTest1.cs b/Tests/UnitTest1.cs new file mode 100755 index 0000000..3467b45 --- /dev/null +++ b/Tests/UnitTest1.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using FluentAssertions; +using Geekbot.net.Lib; +using Geekbot.net.Modules; +using Moq; +using RestSharp; +using Xunit; + +namespace Tests +{ + public class UnitTest1 + { + [Fact] + public async Task TestCat() + { + // setup + var catClient = new Mock(MockBehavior.Strict); + var client = new Mock(MockBehavior.Strict); + catClient.Setup(cc => cc.Client).Returns(client.Object); + var response = new Mock>(MockBehavior.Strict); + var resultData = new Cat.CatResponse {file = "unit-test"}; + response.SetupGet(r => r.Data).Returns(resultData); + Console.WriteLine(resultData.file); + var request = new Mock(MockBehavior.Strict); + Func requestFunc = () => request.Object; + client.Setup(c => c.Execute(request.Object)).Returns(response.Object); + Mock asyncReplier = new Mock(MockBehavior.Strict); + asyncReplier.Setup(ar => ar.ReplyAsyncInt(resultData.file)).Returns(Task.FromResult(true)).Verifiable(); + + // execute + //var cat = new Cat(catClient.Object, requestFunc, asyncReplier.Object); + //await cat.Say(); + + // validate + //asyncReplier.Verify(); + } + + [Theory] + [InlineData(1, 0)] + [InlineData(33, 4561)] + [InlineData(79, 449702)] + [InlineData(79, 449702 + 1)] + public void TestLevel(int expectedIndex, int experience) + { + var index = LevelCalc.GetLevelAtExperience(experience); + index.Should().Be(expectedIndex); + } + + } +} \ No newline at end of file diff --git a/ansible-requirements.yml b/ansible-requirements.yml deleted file mode 100644 index 90d8fb4..0000000 --- a/ansible-requirements.yml +++ /dev/null @@ -1,3 +0,0 @@ -collections: - - name: community.docker - version: 2.7.0 \ No newline at end of file diff --git a/readme.md b/readme.md index 883e553..3062d8c 100644 --- a/readme.md +++ b/readme.md @@ -1,29 +1,13 @@ -[![pipeline status](https://gitlab.com/dbgit/open/geekbot/badges/master/pipeline.svg)](https://gitlab.com/dbgit/open/geekbot/commits/master) +# Geekbot.net -# [Geekbot.net](https://geekbot.pizzaandcoffee.rocks/) +The Geekbot rewritten in C# and dotnet core -A General Purpose Discord Bot written in C# +### Running -You can invite Geekbot to your server with [this link](https://discordapp.com/oauth2/authorize?client_id=171249478546882561&scope=bot&permissions=1416834054) +Geekbot.net Requires dotnet core 1.0.1 and dotnet core cli 1.1 -## Technologies +`dotnet restore` -* .NET 5 -* PostgreSQL -* Discord.net +`cd Geekbot.net` -## Running - -You can start geekbot with: `dotnet run` - -On your first run geekbot will ask for your bot token. - -You might need to pass some additional configuration (e.g. database credentials), these can be passed as commandline arguments or environment variables. - -For a list of commandline arguments and environment variables use `dotnet run -- -h` - -All Environment Variables must be prefixed with `GEEKBOT_` - -## Contributing - -Everyone is free to open an issue or create a pull request +`dotnet run` diff --git a/src/Bot/Bot.csproj b/src/Bot/Bot.csproj deleted file mode 100644 index 2219b32..0000000 --- a/src/Bot/Bot.csproj +++ /dev/null @@ -1,33 +0,0 @@ - - - net6.0 - $(VersionSuffix) - Geekbot.Bot - Geekbot.Bot - $(VersionSuffix) - 0.0.0-DEV - NU1701 - enable - True - Library - - - - - - - - - - - - - - PreserveNewest - - - - - - - diff --git a/src/Bot/BotStartup.cs b/src/Bot/BotStartup.cs deleted file mode 100644 index afb1a8a..0000000 --- a/src/Bot/BotStartup.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System.Reflection; -using Discord; -using Discord.Commands; -using Discord.WebSocket; -using Geekbot.Bot.Handlers; -using Geekbot.Core; -using Geekbot.Core.Database; -using Geekbot.Core.GlobalSettings; -using Geekbot.Core.GuildSettingsManager; -using Geekbot.Core.Logger; -using Geekbot.Core.Logger.Adapters; -using Geekbot.Core.ReactionListener; -using Geekbot.Core.UserRepository; -using Microsoft.Extensions.DependencyInjection; - -namespace Geekbot.Bot; - -public class BotStartup -{ - private readonly IServiceCollection _serviceCollection; - private readonly GeekbotLogger _logger; - private readonly RunParameters _runParameters; - private readonly IGlobalSettings _globalSettings; - private DiscordSocketClient _client; - - public BotStartup(IServiceCollection serviceCollection, GeekbotLogger logger, RunParameters runParameters, IGlobalSettings globalSettings) - { - _serviceCollection = serviceCollection; - _logger = logger; - _runParameters = runParameters; - _globalSettings = globalSettings; - } - - public async Task Start() - { - _logger.Information(LogSource.Geekbot, "Connecting to Discord"); - SetupDiscordClient(); - await Login(); - await _client.SetGameAsync(_globalSettings.GetKey("Game")); - _logger.Information(LogSource.Geekbot, $"Now Connected as {_client.CurrentUser.Username} to {_client.Guilds.Count} Servers"); - - _logger.Information(LogSource.Geekbot, "Registering Gateway Handlers"); - await RegisterHandlers(); - - _logger.Information(LogSource.Geekbot, "Done and ready for use"); - await Task.Delay(-1); - } - - private void SetupDiscordClient() - { - _client = new DiscordSocketClient(new DiscordSocketConfig - { - GatewayIntents = GatewayIntents.DirectMessageReactions | - GatewayIntents.DirectMessages | - GatewayIntents.GuildMessageReactions | - GatewayIntents.GuildMessages | - GatewayIntents.GuildWebhooks | - GatewayIntents.GuildIntegrations | - GatewayIntents.GuildEmojis | - GatewayIntents.GuildBans | - GatewayIntents.Guilds | - GatewayIntents.GuildMembers, - LogLevel = LogSeverity.Verbose, - MessageCacheSize = 1000, - }); - - var discordLogger = new DiscordLogger(_logger); - _client.Log += discordLogger.Log; - } - - private async Task Login() - { - try - { - var token = await GetToken(); - await _client.LoginAsync(TokenType.Bot, token); - await _client.StartAsync(); - while (!_client.ConnectionState.Equals(ConnectionState.Connected)) await Task.Delay(25); - } - catch (Exception e) - { - _logger.Error(LogSource.Geekbot, "Could not connect to Discord", e); - Environment.Exit(GeekbotExitCode.CouldNotLogin.GetHashCode()); - } - } - - private async Task GetToken() - { - var token = _runParameters.Token ?? _globalSettings.GetKey("DiscordToken"); - if (string.IsNullOrEmpty(token)) - { - Console.Write("Your bot Token: "); - var newToken = Console.ReadLine(); - await _globalSettings.SetKey("DiscordToken", newToken); - await _globalSettings.SetKey("Game", "Ping Pong"); - token = newToken; - } - - return token; - } - - private async Task RegisterHandlers() - { - var applicationInfo = await _client.GetApplicationInfoAsync(); - - _serviceCollection.AddSingleton(_client); - var serviceProvider = _serviceCollection.BuildServiceProvider(); - - var commands = new CommandService(); - await commands.AddModulesAsync(Assembly.GetAssembly(typeof(BotStartup)), serviceProvider); - - var commandHandler = new CommandHandler(_client, _logger, serviceProvider, commands, applicationInfo, serviceProvider.GetService()); - var userHandler = new UserHandler(serviceProvider.GetService(), _logger, serviceProvider.GetService(), _client); - var reactionHandler = new ReactionHandler(serviceProvider.GetService()); - var statsHandler = new StatsHandler(_logger, serviceProvider.GetService()); - var messageDeletedHandler = new MessageDeletedHandler(serviceProvider.GetService(), _logger, _client); - - _client.MessageReceived += commandHandler.RunCommand; - _client.MessageDeleted += messageDeletedHandler.HandleMessageDeleted; - _client.UserJoined += userHandler.Joined; - _client.UserUpdated += userHandler.Updated; - _client.UserLeft += userHandler.Left; - _client.ReactionAdded += reactionHandler.Added; - _client.ReactionRemoved += reactionHandler.Removed; - if (!_runParameters.InMemory) _client.MessageReceived += statsHandler.UpdateStats; - } -} \ No newline at end of file diff --git a/src/Bot/CommandPreconditions/DisableInDirectMessageAttribute.cs b/src/Bot/CommandPreconditions/DisableInDirectMessageAttribute.cs deleted file mode 100644 index b75f4a1..0000000 --- a/src/Bot/CommandPreconditions/DisableInDirectMessageAttribute.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord.Commands; - -namespace Geekbot.Bot.CommandPreconditions -{ - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)] - public class DisableInDirectMessageAttribute : PreconditionAttribute - { - public override Task CheckPermissionsAsync(ICommandContext context, CommandInfo command, IServiceProvider services) - { - var result = context.Guild.Id != 0 ? PreconditionResult.FromSuccess() : PreconditionResult.FromError("Command unavailable in Direct Messaging"); - return Task.FromResult(result); - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Admin/Admin.cs b/src/Bot/Commands/Admin/Admin.cs deleted file mode 100644 index 43fb3c4..0000000 --- a/src/Bot/Commands/Admin/Admin.cs +++ /dev/null @@ -1,253 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Resources; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Discord.WebSocket; -using Geekbot.Bot.CommandPreconditions; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.Extensions; -using Geekbot.Core.GuildSettingsManager; -using Localization = Geekbot.Core.Localization; - -namespace Geekbot.Bot.Commands.Admin -{ - [Group("admin")] - [RequireUserPermission(GuildPermission.Administrator)] - [DisableInDirectMessage] - public class Admin : GeekbotCommandBase - { - private readonly DiscordSocketClient _client; - - public Admin(DiscordSocketClient client, IErrorHandler errorHandler, IGuildSettingsManager guildSettingsManager) : base(errorHandler, guildSettingsManager) - { - _client = client; - } - - [Command("welcome", RunMode = RunMode.Async)] - [Summary("Set a Welcome Message (use '$user' to mention the new joined user).")] - public async Task SetWelcomeMessage([Remainder, Summary("message")] string welcomeMessage) - { - GuildSettings.WelcomeMessage = welcomeMessage; - await GuildSettingsManager.UpdateSettings(GuildSettings); - - var formatedMessage = welcomeMessage.Replace("$user", Context.User.Mention); - await ReplyAsync($"Welcome message has been changed\r\nHere is an example of how it would look:\r\n{formatedMessage}"); - } - - [Command("welcomechannel", RunMode = RunMode.Async)] - [Summary("Set a channel for the welcome messages (by default it uses the top most channel)")] - public async Task SelectWelcomeChannel([Summary("#Channel")] ISocketMessageChannel channel) - { - try - { - var m = await channel.SendMessageAsync("..."); - - GuildSettings.WelcomeChannel = channel.Id.AsLong(); - await GuildSettingsManager.UpdateSettings(GuildSettings); - - await m.DeleteAsync(); - - await ReplyAsync("Successfully saved the welcome channel"); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context, "That channel doesn't seem to exist or i don't have write permissions"); - } - } - - [Command("modchannel", RunMode = RunMode.Async)] - [Summary("Set a channel for moderation purposes")] - public async Task SelectModChannel([Summary("#Channel")] ISocketMessageChannel channel) - { - try - { - var m = await channel.SendMessageAsync("verifying..."); - - GuildSettings.ModChannel = channel.Id.AsLong(); - await GuildSettingsManager.UpdateSettings(GuildSettings); - - var sb = new StringBuilder(); - sb.AppendLine("Successfully saved mod channel, you can now do the following"); - sb.AppendLine("- `!admin showleave` - send message to mod channel when someone leaves"); - sb.AppendLine("- `!admin showdel` - send message to mod channel when someone deletes a message"); - await m.ModifyAsync(e => e.Content = sb.ToString()); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context, "That channel doesn't seem to exist or i don't have write permissions"); - } - } - - [Command("showleave", RunMode = RunMode.Async)] - [Summary("Toggle - notify modchannel when someone leaves")] - public async Task ShowLeave() - { - try - { - var modChannel = await GetModChannel(GuildSettings.ModChannel.AsUlong()); - if (modChannel == null) return; - - GuildSettings.ShowLeave = !GuildSettings.ShowLeave; - await GuildSettingsManager.UpdateSettings(GuildSettings); - await modChannel.SendMessageAsync(GuildSettings.ShowLeave - ? "Saved - now sending messages here when someone leaves" - : "Saved - stopping sending messages here when someone leaves" - ); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [Command("showdel", RunMode = RunMode.Async)] - [Summary("Toggle - notify modchannel when someone deletes a message")] - public async Task ShowDelete() - { - try - { - var modChannel = await GetModChannel(GuildSettings.ModChannel.AsUlong()); - if (modChannel == null) return; - - GuildSettings.ShowDelete = !GuildSettings.ShowDelete; - await GuildSettingsManager.UpdateSettings(GuildSettings); - await modChannel.SendMessageAsync(GuildSettings.ShowDelete - ? "Saved - now sending messages here when someone deletes a message" - : "Saved - stopping sending messages here when someone deletes a message" - ); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [Command("setlang", RunMode = RunMode.Async)] - [Summary("Change the bots language")] - public async Task SetLanguage([Summary("language")] string language) - { - try - { - var availableLanguages = new List(); - availableLanguages.Add("en-GB"); // default - availableLanguages.AddRange(GetAvailableCultures().Select(culture => culture.Name)); - if (availableLanguages.Contains(language)) - { - GuildSettings.Language = language; - await GuildSettingsManager.UpdateSettings(GuildSettings); - - Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(language.ToLower() == "chde" ? "de-CH" : language); - - await ReplyAsync(Localization.Admin.NewLanguageSet); - return; - } - - await ReplyAsync($"That doesn't seem to be a supported language\nSupported Languages are {string.Join(", ", availableLanguages)}"); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [Command("wiki", RunMode = RunMode.Async)] - [Summary("Change the wikipedia instance (use lang code in xx.wikipedia.org)")] - public async Task SetWikiLanguage([Summary("language")] string languageRaw) - { - try - { - var language = languageRaw.ToLower(); - GuildSettings.WikiLang = language; - await GuildSettingsManager.UpdateSettings(GuildSettings); - - await ReplyAsync($"Now using the {language} wikipedia"); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [Command("ping", RunMode = RunMode.Async)] - [Summary("Enable the ping reply.")] - public async Task TogglePing() - { - try - { - // var guild = _guildSettingsManager.GetSettings(Context.Guild.Id); - GuildSettings.Ping = !GuildSettings.Ping; - await GuildSettingsManager.UpdateSettings(GuildSettings); - await ReplyAsync(GuildSettings.Ping ? "i will reply to ping now" : "No more pongs..."); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [Command("hui", RunMode = RunMode.Async)] - [Summary("Enable the ping reply.")] - public async Task ToggleHui() - { - try - { - // var guild = _guildSettingsManager.GetSettings(Context.Guild.Id); - GuildSettings.Hui = !GuildSettings.Hui; - await GuildSettingsManager.UpdateSettings(GuildSettings); - await ReplyAsync(GuildSettings.Hui ? "i will reply to hui now" : "No more hui's..."); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - private async Task GetModChannel(ulong channelId) - { - try - { - if (channelId == ulong.MinValue) throw new Exception(); - var modChannel = (ISocketMessageChannel) _client.GetChannel(channelId); - if (modChannel == null) throw new Exception(); - return modChannel; - } - catch - { - await ReplyAsync("Modchannel doesn't seem to exist, please set one with `!admin modchannel [channelId]`"); - return null; - } - } - - private IEnumerable GetAvailableCultures() - { - var result = new List(); - var rm = new ResourceManager(typeof(Localization.Admin)); - var cultures = CultureInfo.GetCultures(CultureTypes.AllCultures); - foreach (var culture in cultures) - { - try - { - if (culture.Equals(CultureInfo.InvariantCulture)) continue; //do not use "==", won't work - - var rs = rm.GetResourceSet(culture, true, false); - if (rs != null) - { - result.Add(culture); - } - } - catch (CultureNotFoundException) - { - //NOP - } - } - return result; - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Admin/Owner/Owner.cs b/src/Bot/Commands/Admin/Owner/Owner.cs deleted file mode 100644 index 64292e9..0000000 --- a/src/Bot/Commands/Admin/Owner/Owner.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Discord.WebSocket; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.GlobalSettings; -using Geekbot.Core.GuildSettingsManager; -using Geekbot.Core.Logger; -using Geekbot.Core.UserRepository; - -namespace Geekbot.Bot.Commands.Admin.Owner -{ - [Group("owner")] - [RequireOwner] - public class Owner : GeekbotCommandBase - { - private readonly DiscordSocketClient _client; - private readonly IGlobalSettings _globalSettings; - private readonly IGeekbotLogger _logger; - private readonly IUserRepository _userRepository; - - public Owner(DiscordSocketClient client, IGeekbotLogger logger, IUserRepository userRepositry, IErrorHandler errorHandler, IGlobalSettings globalSettings, - IGuildSettingsManager guildSettingsManager) : base(errorHandler, guildSettingsManager) - { - _client = client; - _logger = logger; - _userRepository = userRepositry; - _globalSettings = globalSettings; - } - - [Command("youtubekey", RunMode = RunMode.Async)] - [Summary("Set the youtube api key")] - public async Task SetYoutubeKey([Summary("API-Key")] string key) - { - await _globalSettings.SetKey("YoutubeKey", key); - await ReplyAsync("Apikey has been set"); - } - - [Command("game", RunMode = RunMode.Async)] - [Summary("Set the game that the bot is playing")] - public async Task SetGame([Remainder] [Summary("Game")] string key) - { - await _globalSettings.SetKey("Game", key); - await _client.SetGameAsync(key); - _logger.Information(LogSource.Geekbot, $"Changed game to {key}"); - await ReplyAsync($"Now Playing {key}"); - } - - [Command("popuserrepo", RunMode = RunMode.Async)] - [Summary("Populate user cache")] - public async Task PopUserRepoCommand() - { - var success = 0; - var failed = 0; - try - { - _logger.Warning(LogSource.UserRepository, "Populating User Repositry"); - await ReplyAsync("Starting Population of User Repository"); - foreach (var guild in _client.Guilds) - { - _logger.Information(LogSource.UserRepository, $"Populating users from {guild.Name}"); - foreach (var user in guild.Users) - { - var succeded = await _userRepository.Update(user); - var inc = succeded ? success++ : failed++; - } - } - - _logger.Warning(LogSource.UserRepository, "Finished Updating User Repositry"); - await ReplyAsync( - $"Successfully Populated User Repository with {success} Users in {_client.Guilds.Count} Guilds (Failed: {failed})"); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context, - "Couldn't complete User Repository, see console for more info"); - } - } - - [Command("refreshuser", RunMode = RunMode.Async)] - [Summary("Refresh a user in the user cache")] - public async Task PopUserRepoCommand([Summary("@someone")] IUser user) - { - try - { - await _userRepository.Update(user as SocketUser); - await ReplyAsync($"Refreshed: {user.Username}#{user.Discriminator}"); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [Command("refreshuser", RunMode = RunMode.Async)] - [Summary("Refresh a user in the user cache")] - public async Task PopUserRepoCommand([Summary("user-id")] ulong userId) - { - try - { - var user = _client.GetUser(userId); - await _userRepository.Update(user); - await ReplyAsync($"Refreshed: {user.Username}#{user.Discriminator}"); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [Command("error", RunMode = RunMode.Async)] - [Summary("Throw an error un purpose")] - public async Task PurposefulError() - { - try - { - throw new Exception("Error Generated by !owner error"); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Admin/Role.cs b/src/Bot/Commands/Admin/Role.cs deleted file mode 100644 index fb8ef68..0000000 --- a/src/Bot/Commands/Admin/Role.cs +++ /dev/null @@ -1,197 +0,0 @@ -using System; -using System.Linq; -using System.Net; -using System.Text; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Discord.Net; -using Geekbot.Bot.CommandPreconditions; -using Geekbot.Core; -using Geekbot.Core.Database; -using Geekbot.Core.Database.Models; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.Extensions; -using Geekbot.Core.GuildSettingsManager; -using Geekbot.Core.ReactionListener; -using Localization = Geekbot.Core.Localization; - -namespace Geekbot.Bot.Commands.Admin -{ - [Group("role")] - [DisableInDirectMessage] - public class Role : GeekbotCommandBase - { - private readonly DatabaseContext _database; - private readonly IReactionListener _reactionListener; - - public Role(DatabaseContext database, IErrorHandler errorHandler, IReactionListener reactionListener, IGuildSettingsManager guildSettingsManager) : base(errorHandler, guildSettingsManager) - { - _database = database; - _reactionListener = reactionListener; - } - - [Command(RunMode = RunMode.Async)] - [Summary("Get a list of all available roles.")] - public async Task GetAllRoles() - { - try - { - var roles = _database.RoleSelfService.Where(g => g.GuildId.Equals(Context.Guild.Id.AsLong())).ToList(); - if (roles.Count == 0) - { - await ReplyAsync(Localization.Role.NoRolesConfigured); - return; - } - - var sb = new StringBuilder(); - sb.AppendLine(string.Format(Localization.Role.ListHeader, Context.Guild.Name)); - sb.AppendLine(Localization.Role.ListInstruction); - foreach (var role in roles) sb.AppendLine($"- {role.WhiteListName}"); - await ReplyAsync(sb.ToString()); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [Command(RunMode = RunMode.Async)] - [Summary("Get a role by mentioning it.")] - public async Task GiveRole([Summary("role-nickname")] string roleNameRaw) - { - try - { - var roleName = roleNameRaw.ToLower(); - var roleFromDb = _database.RoleSelfService.FirstOrDefault(e => - e.GuildId.Equals(Context.Guild.Id.AsLong()) && e.WhiteListName.Equals(roleName)); - if (roleFromDb != null) - { - var guildUser = (IGuildUser) Context.User; - var role = Context.Guild.Roles.First(r => r.Id == roleFromDb.RoleId.AsUlong()); - if (role == null) - { - await ReplyAsync(Localization.Role.RoleNotFound); - return; - } - - if (guildUser.RoleIds.Contains(role.Id)) - { - await guildUser.RemoveRoleAsync(role); - await ReplyAsync(string.Format(Localization.Role.RemovedUserFromRole, role.Name)); - return; - } - - await guildUser.AddRoleAsync(role); - await ReplyAsync(string.Format(Localization.Role.AddedUserFromRole, role.Name)); - return; - } - - await ReplyAsync(Localization.Role.RoleNotFound); - } - catch (HttpException e) - { - if (e.HttpCode == HttpStatusCode.Forbidden) - { - await ReplyAsync(Localization.Internal.Http403); - } - else - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [RequireUserPermission(GuildPermission.ManageRoles)] - [Command("add", RunMode = RunMode.Async)] - [Summary("Add a role to the whitelist.")] - public async Task AddRole([Summary("@role")] IRole role, [Summary("alias")] string roleName) - { - try - { - if (role.IsManaged) - { - await ReplyAsync(Localization.Role.CannotAddManagedRole); - return; - } - - if (role.Permissions.ManageRoles - || role.Permissions.Administrator - || role.Permissions.ManageGuild - || role.Permissions.BanMembers - || role.Permissions.KickMembers) - { - await ReplyAsync(Localization.Role.CannotAddDangerousRole); - return; - } - - _database.RoleSelfService.Add(new RoleSelfServiceModel - { - GuildId = Context.Guild.Id.AsLong(), - RoleId = role.Id.AsLong(), - WhiteListName = roleName - }); - await _database.SaveChangesAsync(); - await ReplyAsync(string.Format(Localization.Role.AddedRoleToWhitelist, role.Name)); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [RequireUserPermission(GuildPermission.ManageRoles)] - [Command("remove", RunMode = RunMode.Async)] - [Summary("Remove a role from the whitelist.")] - public async Task RemoveRole([Summary("role-nickname")] string roleName) - { - try - { - var roleFromDb = _database.RoleSelfService.FirstOrDefault(e => - e.GuildId.Equals(Context.Guild.Id.AsLong()) && e.WhiteListName.Equals(roleName)); - if (roleFromDb != null) - { - _database.RoleSelfService.Remove(roleFromDb); - await _database.SaveChangesAsync(); - await ReplyAsync(string.Format(Localization.Role.RemovedRoleFromWhitelist, roleName)); - return; - } - - await ReplyAsync(Localization.Role.RoleNotFound); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [RequireUserPermission(GuildPermission.ManageRoles)] - [Summary("Give a role by clicking on an emoji")] - [Command("listen", RunMode = RunMode.Async)] - public async Task AddListener([Summary("message-ID")] string messageIdStr, [Summary("Emoji")] string emoji, [Summary("@role")] IRole role) - { - try - { - var messageId = ulong.Parse(messageIdStr); - var message = (IUserMessage) await Context.Channel.GetMessageAsync(messageId); - var emote = _reactionListener.ConvertStringToEmote(emoji); - - await message.AddReactionAsync(emote); - await _reactionListener.AddRoleToListener(messageId, Context.Guild.Id, emoji, role); - await Context.Message.DeleteAsync(); - } - catch (HttpException) - { - await Context.Channel.SendMessageAsync("Custom emojis from other servers are not supported"); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Games/Pokedex.cs b/src/Bot/Commands/Games/Pokedex.cs deleted file mode 100644 index 325ee8c..0000000 --- a/src/Bot/Commands/Games/Pokedex.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.Extensions; -using PokeAPI; - -namespace Geekbot.Bot.Commands.Games -{ - public class Pokedex : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - - public Pokedex(IErrorHandler errorHandler) - { - _errorHandler = errorHandler; - } - - [Command("pokedex", RunMode = RunMode.Async)] - [Summary("A Pokedex Tool")] - public async Task GetPokemon([Summary("pokemon-name")] string pokemonName) - { - try - { - DataFetcher.ShouldCacheData = true; - Pokemon pokemon; - try - { - pokemon = await DataFetcher.GetNamedApiObject(pokemonName.ToLower()); - } - catch - { - await ReplyAsync("I couldn't find that pokemon :confused:"); - return; - } - - var embed = await PokemonEmbedBuilder(pokemon); - await ReplyAsync("", false, embed.Build()); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - - private async Task PokemonEmbedBuilder(Pokemon pokemon) - { - var eb = new EmbedBuilder(); - var species = await DataFetcher.GetApiObject(pokemon.ID); - eb.Title = $"#{pokemon.ID} {ToUpper(pokemon.Name)}"; - eb.Description = species.FlavorTexts[1].FlavorText; - eb.ThumbnailUrl = pokemon.Sprites.FrontMale ?? pokemon.Sprites.FrontFemale; - eb.AddInlineField(GetSingularOrPlural(pokemon.Types.Length, "Type"), - string.Join(", ", pokemon.Types.Select(t => ToUpper(t.Type.Name)))); - eb.AddInlineField(GetSingularOrPlural(pokemon.Abilities.Length, "Ability"), - string.Join(", ", pokemon.Abilities.Select(t => ToUpper(t.Ability.Name)))); - eb.AddInlineField("Height", pokemon.Height); - eb.AddInlineField("Weight", pokemon.Mass); - return eb; - } - - private string GetSingularOrPlural(int lenght, string word) - { - if (lenght == 1) return word; - return word.EndsWith("y") ? $"{word.Remove(word.Length - 1)}ies" : $"{word}s"; - } - - private string ToUpper(string s) - { - if (string.IsNullOrEmpty(s)) return string.Empty; - return char.ToUpper(s[0]) + s.Substring(1); - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Games/Roll/Roll.cs b/src/Bot/Commands/Games/Roll/Roll.cs deleted file mode 100644 index e9ed9e9..0000000 --- a/src/Bot/Commands/Games/Roll/Roll.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.Database; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.GuildSettingsManager; -using Geekbot.Core.KvInMemoryStore; -using Geekbot.Core.RandomNumberGenerator; -using Sentry; - -namespace Geekbot.Bot.Commands.Games.Roll -{ - public class Roll : GeekbotCommandBase - { - private readonly IKvInMemoryStore _kvInMemoryStore; - private readonly DatabaseContext _database; - private readonly IRandomNumberGenerator _randomNumberGenerator; - - public Roll(IKvInMemoryStore kvInMemoryStore, IErrorHandler errorHandler, DatabaseContext database, IRandomNumberGenerator randomNumberGenerator, IGuildSettingsManager guildSettingsManager) - : base(errorHandler, guildSettingsManager) - { - _kvInMemoryStore = kvInMemoryStore; - _database = database; - _randomNumberGenerator = randomNumberGenerator; - } - - [Command("roll", RunMode = RunMode.Async)] - [Summary("Guess which number the bot will roll (1-100")] - public async Task RollCommand([Remainder] [Summary("guess")] string stuff = null) - { - try - { - var res = await new Geekbot.Commands.Roll.Roll(_kvInMemoryStore, _database, _randomNumberGenerator) - .RunFromGateway( - Context.Guild.Id, - Context.User.Id, - Context.User.Username, - stuff ?? "0" - ); - await ReplyAsync(res); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - Transaction.Status = SpanStatus.InternalError; - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Integrations/LolMmr/LolMmr.cs b/src/Bot/Commands/Integrations/LolMmr/LolMmr.cs deleted file mode 100644 index 511d7b8..0000000 --- a/src/Bot/Commands/Integrations/LolMmr/LolMmr.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Net; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; -using System.Web; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; - -namespace Geekbot.Bot.Commands.Integrations.LolMmr -{ - public class LolMmr : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - - public LolMmr(IErrorHandler errorHandler) - { - _errorHandler = errorHandler; - } - - [Command("mmr", RunMode = RunMode.Async)] - [Summary("Get the League of Legends MMR for a specified summoner")] - public async Task GetMmr([Remainder] [Summary("summoner")] string summonerName) - { - try - { - LolMmrDto data; - try - { - var name = HttpUtility.UrlEncode(summonerName.ToLower()); - var httpClient = HttpAbstractions.CreateDefaultClient(); - // setting the user agent in accordance with the whatismymmr.com api rules - httpClient.DefaultRequestHeaders.Remove("User-Agent"); - httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "Linux:rocks.pizzaandcoffee.geekbot:v0.0.0"); - data = await HttpAbstractions.Get(new Uri($"https://euw.whatismymmr.com/api/v1/summoner?name={name}"), httpClient); - } - catch (HttpRequestException e) - { - if (e.StatusCode != HttpStatusCode.NotFound) throw e; - - await Context.Channel.SendMessageAsync("Player not found"); - return; - - } - - var sb = new StringBuilder(); - sb.AppendLine($"**MMR for {summonerName}**"); - sb.AppendLine($"Normal: {data.Normal?.Avg ?? 0}"); - sb.AppendLine($"Ranked: {data.Ranked?.Avg ?? 0}"); - sb.AppendLine($"ARAM: {data.ARAM?.Avg ?? 0}"); - - await Context.Channel.SendMessageAsync(sb.ToString()); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Integrations/LolMmr/LolMmrDto.cs b/src/Bot/Commands/Integrations/LolMmr/LolMmrDto.cs deleted file mode 100644 index 233bcfc..0000000 --- a/src/Bot/Commands/Integrations/LolMmr/LolMmrDto.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Bot.Commands.Integrations.LolMmr -{ - public class LolMmrDto - { - [JsonPropertyName("ranked")] - public LolMrrInfoDto Ranked { get; set; } - - [JsonPropertyName("normal")] - public LolMrrInfoDto Normal { get; set; } - - [JsonPropertyName("aram")] - public LolMrrInfoDto ARAM { get; set; } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Integrations/LolMmr/LolMrrInfoDto.cs b/src/Bot/Commands/Integrations/LolMmr/LolMrrInfoDto.cs deleted file mode 100644 index fbcc49a..0000000 --- a/src/Bot/Commands/Integrations/LolMmr/LolMrrInfoDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Bot.Commands.Integrations.LolMmr -{ - public class LolMrrInfoDto - { - [JsonPropertyName("avg")] - public decimal? Avg { get; set; } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Integrations/MagicTheGathering.cs b/src/Bot/Commands/Integrations/MagicTheGathering.cs deleted file mode 100644 index 359b41e..0000000 --- a/src/Bot/Commands/Integrations/MagicTheGathering.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.Converters; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.Extensions; -using MtgApiManager.Lib.Service; - -namespace Geekbot.Bot.Commands.Integrations -{ - public class MagicTheGathering : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - private readonly IMtgManaConverter _manaConverter; - - public MagicTheGathering(IErrorHandler errorHandler, IMtgManaConverter manaConverter) - { - _errorHandler = errorHandler; - _manaConverter = manaConverter; - } - - [Command("mtg", RunMode = RunMode.Async)] - [Summary("Find a Magic The Gathering Card.")] - public async Task GetCard([Remainder] [Summary("card-name")] string cardName) - { - try - { - var message = await Context.Channel.SendMessageAsync($":mag: Looking up \"{cardName}\", please wait..."); - - var service = new CardService(); - var result = service - .Where(x => x.Name, cardName) - // fewer cards less risk of deserialization problems, don't need more than one anyways... - .Where(x => x.PageSize, 1); - - var cards = await result.AllAsync(); - if (!cards.IsSuccess) - { - await message.ModifyAsync(properties => properties.Content = $":warning: The Gatherer reacted in an unexpected way: {cards.Exception.Message}"); - return; - } - - var card = cards.Value.FirstOrDefault(); - - if (card == null) - { - await message.ModifyAsync(properties => properties.Content = ":red_circle: I couldn't find a card with that name..."); - return; - } - - var eb = new EmbedBuilder - { - Title = card.Name, - Description = card.Type - }; - - if (card.Colors != null) eb.WithColor(GetColor(card.Colors)); - - if (card.ImageUrl != null) eb.ImageUrl = card.ImageUrl.ToString(); - - if (!string.IsNullOrEmpty(card.Text)) eb.AddField("Text", _manaConverter.ConvertMana(card.Text)); - - if (!string.IsNullOrEmpty(card.Flavor)) eb.AddField("Flavor", card.Flavor); - if (!string.IsNullOrEmpty(card.SetName)) eb.AddInlineField("Set", card.SetName); - if (!string.IsNullOrEmpty(card.Power)) eb.AddInlineField("Power", card.Power); - if (!string.IsNullOrEmpty(card.Loyalty)) eb.AddInlineField("Loyality", card.Loyalty); - if (!string.IsNullOrEmpty(card.Toughness)) eb.AddInlineField("Thoughness", card.Toughness); - - if (!string.IsNullOrEmpty(card.ManaCost)) eb.AddInlineField("Cost", _manaConverter.ConvertMana(card.ManaCost)); - if (!string.IsNullOrEmpty(card.Rarity)) eb.AddInlineField("Rarity", card.Rarity); - - if (card.Legalities != null && card.Legalities.Count > 0) - eb.AddField("Legality", string.Join(", ", card.Legalities.Select(e => e.Format))); - - await message.ModifyAsync(properties => - { - properties.Content = string.Empty; - properties.Embed = eb.Build(); - }); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - - private Color GetColor(IEnumerable colors) - { - var color = colors.FirstOrDefault(); - return color switch - { - "Black" => new Color(203, 194, 191), - "White" => new Color(255, 251, 213), - "Blue" => new Color(170, 224, 250), - "Red" => new Color(250, 170, 143), - "Green" => new Color(155, 211, 174), - _ => new Color(204, 194, 212) - }; - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Integrations/Mal.cs b/src/Bot/Commands/Integrations/Mal.cs deleted file mode 100644 index ffc8dd7..0000000 --- a/src/Bot/Commands/Integrations/Mal.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.Extensions; -using Geekbot.Core.GuildSettingsManager; -using JikanDotNet; - -namespace Geekbot.Bot.Commands.Integrations -{ - public class Mal : GeekbotCommandBase - { - private readonly IJikan _client; - - public Mal(IErrorHandler errorHandler, IGuildSettingsManager guildSettingsManager) : base(errorHandler, guildSettingsManager) - { - _client = new Jikan(); - } - - [Command("anime", RunMode = RunMode.Async)] - [Summary("Show Info about an Anime.")] - public async Task SearchAnime([Remainder] [Summary("anime-name")] string animeName) - { - try - { - var results = await _client.SearchAnime(animeName); - var anime = results.Results.FirstOrDefault(); - if (anime != null) - { - var eb = new EmbedBuilder - { - Title = anime.Title, - Description = anime.Description, - ImageUrl = anime.ImageURL - }; - - eb.AddInlineField("Premiere", FormatDate(anime.StartDate)) - .AddInlineField("Ended", anime.Airing ? "-" : FormatDate(anime.EndDate)) - .AddInlineField("Episodes", anime.Episodes) - .AddInlineField("MAL Score", anime.Score) - .AddInlineField("Type", anime.Type) - .AddField("MAL Link", $"https://myanimelist.net/anime/{anime.MalId}"); - - await ReplyAsync("", false, eb.Build()); - } - else - { - await ReplyAsync("No anime found with that name..."); - } - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [Command("manga", RunMode = RunMode.Async)] - [Summary("Show Info about a Manga.")] - public async Task SearchManga([Remainder] [Summary("manga-name")] string mangaName) - { - try - { - var results = await _client.SearchManga(mangaName); - var manga = results.Results.FirstOrDefault(); - if (manga != null) - { - var eb = new EmbedBuilder - { - Title = manga.Title, - Description = manga.Description, - ImageUrl = manga.ImageURL - }; - - eb.AddInlineField("Premiere", FormatDate(manga.StartDate)) - .AddInlineField("Ended", manga.Publishing ? "-" : FormatDate(manga.EndDate)) - .AddInlineField("Volumes", manga.Volumes) - .AddInlineField("Chapters", manga.Chapters) - .AddInlineField("MAL Score", manga.Score) - .AddField("MAL Link", $"https://myanimelist.net/manga/{manga.MalId}"); - - await ReplyAsync("", false, eb.Build()); - } - else - { - await ReplyAsync("No manga found with that name..."); - } - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - private string FormatDate(DateTime? dateTime) - { - if (!dateTime.HasValue) - { - return DateTime.MinValue.ToString("d", Thread.CurrentThread.CurrentUICulture); - } - - return dateTime.Value.ToString("d", Thread.CurrentThread.CurrentUICulture); - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Integrations/UrbanDictionary.cs b/src/Bot/Commands/Integrations/UrbanDictionary.cs deleted file mode 100644 index 44fe868..0000000 --- a/src/Bot/Commands/Integrations/UrbanDictionary.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; - -namespace Geekbot.Bot.Commands.Integrations -{ - public class UrbanDictionary : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - - public UrbanDictionary(IErrorHandler errorHandler) - { - _errorHandler = errorHandler; - } - - [Command("urban", RunMode = RunMode.Async)] - [Summary("Lookup something on urban dictionary")] - public async Task UrbanDefine([Remainder] [Summary("word")] string word) - { - try - { - var eb = await Geekbot.Commands.UrbanDictionary.UrbanDictionary.Run(word); - if (eb == null) - { - await ReplyAsync("That word hasn't been defined..."); - return; - } - - await ReplyAsync(string.Empty, false, eb.ToDiscordNetEmbed().Build()); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Integrations/Wikipedia.cs b/src/Bot/Commands/Integrations/Wikipedia.cs deleted file mode 100644 index 82f42a0..0000000 --- a/src/Bot/Commands/Integrations/Wikipedia.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; -using System.Linq; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.Database; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.Extensions; -using Geekbot.Core.WikipediaClient; -using Geekbot.Core.WikipediaClient.Page; -using HtmlAgilityPack; - -namespace Geekbot.Bot.Commands.Integrations -{ - public class Wikipedia : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - private readonly IWikipediaClient _wikipediaClient; - private readonly DatabaseContext _database; - - public Wikipedia(IErrorHandler errorHandler, IWikipediaClient wikipediaClient, DatabaseContext database) - { - _errorHandler = errorHandler; - _wikipediaClient = wikipediaClient; - _database = database; - } - - [Command("wiki", RunMode = RunMode.Async)] - [Summary("Get an article from wikipedia.")] - public async Task GetPreview([Remainder] [Summary("article")] string articleName) - { - try - { - var wikiLang = _database.GuildSettings.FirstOrDefault(g => g.GuildId.Equals(Context.Guild.Id.AsLong()))?.WikiLang; - if (string.IsNullOrEmpty(wikiLang)) - { - wikiLang = "en"; - } - var article = await _wikipediaClient.GetPreview(articleName.Replace(" ", "_"), wikiLang); - - if (article.Type != PageTypes.Standard) - { - switch (article.Type) - { - case PageTypes.Disambiguation: - await ReplyAsync($"**__Disambiguation__**\r\n{DisambiguationExtractor(article.ExtractHtml)}"); - break; - case PageTypes.MainPage: - await ReplyAsync("The main page is not supported"); - break; - case PageTypes.NoExtract: - await ReplyAsync($"This page has no summary, here is the link: {article.ContentUrls.Desktop.Page}"); - break; - case PageTypes.Standard: - break; - default: - await ReplyAsync($"This page type is currently not supported, here is the link: {article.ContentUrls.Desktop.Page}"); - break; - } - return; - } - - var eb = new EmbedBuilder - { - Title = article.Title, - Description = article.Description, - ImageUrl = article.Thumbnail?.Source.ToString(), - Url = article.ContentUrls.Desktop.Page.ToString(), - Color = new Color(246,246,246), - Timestamp = article.Timestamp, - Footer = new EmbedFooterBuilder - { - Text = "Last Edit", - IconUrl = "http://icons.iconarchive.com/icons/sykonist/popular-sites/256/Wikipedia-icon.png" - } - }; - - eb.AddField("Description", article.Extract); - if (article.Coordinates != null) eb.AddField("Coordinates", $"{article.Coordinates.Lat} Lat {article.Coordinates.Lon} Lon"); - await ReplyAsync("", false, eb.Build()); - } - catch (HttpRequestException) - { - await ReplyAsync("I couldn't find that article"); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - - private string DisambiguationExtractor(string extractHtml) - { - var doc = new HtmlDocument(); - doc.LoadHtml(extractHtml); - var nodes = doc.DocumentNode.SelectNodes("//li"); - if (nodes == null) return "(List is to long to show)"; - var sb = new StringBuilder(); - foreach (var node in nodes) - { - var split = node.InnerText.Split(','); - var title = split.First(); - var desc = string.Join(",", split.Skip(1)); - sb.AppendLine($"• **{title}** -{desc}"); - } - - return sb.ToString(); - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Integrations/Youtube.cs b/src/Bot/Commands/Integrations/Youtube.cs deleted file mode 100644 index 50e9519..0000000 --- a/src/Bot/Commands/Integrations/Youtube.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Discord.Commands; -using Geekbot.Core; -// using Geekbot.Core.ErrorHandling; -// using Geekbot.Core.GlobalSettings; -// using Google.Apis.Services; -// using Google.Apis.YouTube.v3; - -namespace Geekbot.Bot.Commands.Integrations -{ - public class Youtube : TransactionModuleBase - { - // private readonly IGlobalSettings _globalSettings; - // private readonly IErrorHandler _errorHandler; - - // public Youtube(IGlobalSettings globalSettings, IErrorHandler errorHandler) - // { - // _globalSettings = globalSettings; - // _errorHandler = errorHandler; - // } - - [Command("yt", RunMode = RunMode.Async)] - [Summary("Search for something on youtube.")] - public async Task Yt([Remainder] [Summary("title")] string searchQuery) - { - await ReplyAsync("The youtube command is temporarily disabled"); - - // var key = _globalSettings.GetKey("YoutubeKey"); - // if (string.IsNullOrEmpty(key)) - // { - // await ReplyAsync("No youtube key set, please tell my senpai to set one"); - // return; - // } - // - // try - // { - // var youtubeService = new YouTubeService(new BaseClientService.Initializer - // { - // ApiKey = key, - // ApplicationName = GetType().ToString() - // }); - // - // var searchListRequest = youtubeService.Search.List("snippet"); - // searchListRequest.Q = searchQuery; - // searchListRequest.MaxResults = 2; - // - // var searchListResponse = await searchListRequest.ExecuteAsync(); - // - // var result = searchListResponse.Items[0]; - // - // await ReplyAsync( - // $"\"{result.Snippet.Title}\" from \"{result.Snippet.ChannelTitle}\" https://youtu.be/{result.Id.VideoId}"); - // } - // catch (Exception e) - // { - // await _errorHandler.HandleCommandException(e, Context); - // } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/BenedictCumberbatchNameGenerator.cs b/src/Bot/Commands/Randomness/BenedictCumberbatchNameGenerator.cs deleted file mode 100644 index 23187bd..0000000 --- a/src/Bot/Commands/Randomness/BenedictCumberbatchNameGenerator.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.RandomNumberGenerator; - -namespace Geekbot.Bot.Commands.Randomness -{ - public class BenedictCumberbatchNameGenerator : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - private readonly IRandomNumberGenerator _randomNumberGenerator; - - public BenedictCumberbatchNameGenerator(IErrorHandler errorHandler, IRandomNumberGenerator randomNumberGenerator) - { - _errorHandler = errorHandler; - _randomNumberGenerator = randomNumberGenerator; - } - - [Command("bdcb", RunMode = RunMode.Async)] - [Summary("Benedict Cumberbatch Name Generator")] - public async Task GetQuote() - { - try - { - var firstnameList = new List - { - "Bumblebee", "Bandersnatch", "Broccoli", "Rinkydink", "Bombadil", "Boilerdang", "Bandicoot", "Fragglerock", "Muffintop", "Congleton", "Blubberdick", "Buffalo", "Benadryl", - "Butterfree", "Burberry", "Whippersnatch", "Buttermilk", "Beezlebub", "Budapest", "Boilerdang", "Blubberwhale", "Bumberstump", "Bulbasaur", "Cogglesnatch", "Liverswort", - "Bodybuild", "Johnnycash", "Bendydick", "Burgerking", "Bonaparte", "Bunsenburner", "Billiardball", "Bukkake", "Baseballmitt", "Blubberbutt", "Baseballbat", "Rumblesack", - "Barister", "Danglerack", "Rinkydink", "Bombadil", "Honkytonk", "Billyray", "Bumbleshack", "Snorkeldink", "Beetlejuice", "Bedlington", "Bandicoot", "Boobytrap", "Blenderdick", - "Bentobox", "Pallettown", "Wimbledon", "Buttercup", "Blasphemy", "Syphilis", "Snorkeldink", "Brandenburg", "Barbituate", "Snozzlebert", "Tiddleywomp", "Bouillabaisse", - "Wellington", "Benetton", "Bendandsnap", "Timothy", "Brewery", "Bentobox", "Brandybuck", "Benjamin", "Buckminster", "Bourgeoisie", "Bakery", "Oscarbait", "Buckyball", - "Bourgeoisie", "Burlington", "Buckingham", "Barnoldswick", "Bumblesniff", "Butercup", "Bubblebath", "Fiddlestick", "Bulbasaur", "Bumblebee", "Bettyboop", "Botany", "Cadbury", - "Brendadirk", "Buckingham", "Barnabus", "Barnacle", "Billybong", "Botany", "Benddadick", "Benderchick" - }; - - var lastnameList = new List - { - "Coddleswort", "Crumplesack", "Curdlesnoot", "Calldispatch", "Humperdinck", "Rivendell", "Cuttlefish", "Lingerie", "Vegemite", "Ampersand", "Cumberbund", "Candycrush", - "Clombyclomp", "Cragglethatch", "Nottinghill", "Cabbagepatch", "Camouflage", "Creamsicle", "Curdlemilk", "Upperclass", "Frumblesnatch", "Crumplehorn", "Talisman", "Candlestick", - "Chesterfield", "Bumbersplat", "Scratchnsniff", "Snugglesnatch", "Charizard", "Carrotstick", "Cumbercooch", "Crackerjack", "Crucifix", "Cuckatoo", "Cockletit", "Collywog", - "Capncrunch", "Covergirl", "Cumbersnatch", "Countryside", "Coggleswort", "Splishnsplash", "Copperwire", "Animorph", "Curdledmilk", "Cheddarcheese", "Cottagecheese", "Crumplehorn", - "Snickersbar", "Banglesnatch", "Stinkyrash", "Cameltoe", "Chickenbroth", "Concubine", "Candygram", "Moldyspore", "Chuckecheese", "Cankersore", "Crimpysnitch", "Wafflesmack", - "Chowderpants", "Toodlesnoot", "Clavichord", "Cuckooclock", "Oxfordshire", "Cumbersome", "Chickenstrips", "Battleship", "Commonwealth", "Cunningsnatch", "Custardbath", - "Kryptonite", "Curdlesnoot", "Cummerbund", "Coochyrash", "Crackerdong", "Crackerdong", "Curdledong", "Crackersprout", "Crumplebutt", "Colonist", "Coochierash", "Anglerfish", - "Cumbersniff", "Charmander", "Scratch-n-sniff", "Cumberbitch", "Pumpkinpatch", "Cramplesnutch", "Lumberjack", "Bonaparte", "Cul-de-sac", "Cankersore", "Cucumbercatch", "Contradict" - }; - - var lastname = lastnameList[_randomNumberGenerator.Next(0, lastnameList.Count - 1)]; - var firstname = firstnameList[_randomNumberGenerator.Next(0, firstnameList.Count - 1)]; - - await ReplyAsync($"{firstname} {lastname}"); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} diff --git a/src/Bot/Commands/Randomness/Cat/Cat.cs b/src/Bot/Commands/Randomness/Cat/Cat.cs deleted file mode 100644 index 1198113..0000000 --- a/src/Bot/Commands/Randomness/Cat/Cat.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; - -namespace Geekbot.Bot.Commands.Randomness.Cat -{ - public class Cat : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - - public Cat(IErrorHandler errorHandler) - { - _errorHandler = errorHandler; - } - - [Command("cat", RunMode = RunMode.Async)] - [Summary("Return a random image of a cat.")] - public async Task Say() - { - try - { - var response = await HttpAbstractions.Get(new Uri("https://aws.random.cat/meow")); - var eb = new EmbedBuilder - { - ImageUrl = response.File - }; - await ReplyAsync("", false, eb.Build()); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/Cat/CatResponseDto.cs b/src/Bot/Commands/Randomness/Cat/CatResponseDto.cs deleted file mode 100644 index 523613b..0000000 --- a/src/Bot/Commands/Randomness/Cat/CatResponseDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Bot.Commands.Randomness.Cat -{ - internal class CatResponseDto - { - [JsonPropertyName("file")] - public string File { get; set; } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/Chuck/ChuckNorrisJokeResponseDto.cs b/src/Bot/Commands/Randomness/Chuck/ChuckNorrisJokeResponseDto.cs deleted file mode 100644 index 7c0aefa..0000000 --- a/src/Bot/Commands/Randomness/Chuck/ChuckNorrisJokeResponseDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Bot.Commands.Randomness.Chuck -{ - internal class ChuckNorrisJokeResponseDto - { - [JsonPropertyName("value")] - public string Value { get; set; } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/Chuck/ChuckNorrisJokes.cs b/src/Bot/Commands/Randomness/Chuck/ChuckNorrisJokes.cs deleted file mode 100644 index e2b1f16..0000000 --- a/src/Bot/Commands/Randomness/Chuck/ChuckNorrisJokes.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Net.Http; -using System.Threading.Tasks; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; - -namespace Geekbot.Bot.Commands.Randomness.Chuck -{ - public class ChuckNorrisJokes : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - - public ChuckNorrisJokes(IErrorHandler errorHandler) - { - _errorHandler = errorHandler; - } - - [Command("chuck", RunMode = RunMode.Async)] - [Summary("A random chuck norris joke")] - public async Task Say() - { - try - { - try - { - var response = await HttpAbstractions.Get(new Uri("https://api.chucknorris.io/jokes/random")); - await ReplyAsync(response.Value); - } - catch (HttpRequestException) - { - await ReplyAsync("Api down..."); - } - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/Dad/DadJokeResponseDto.cs b/src/Bot/Commands/Randomness/Dad/DadJokeResponseDto.cs deleted file mode 100644 index 012f9e9..0000000 --- a/src/Bot/Commands/Randomness/Dad/DadJokeResponseDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Bot.Commands.Randomness.Dad -{ - internal class DadJokeResponseDto - { - [JsonPropertyName("joke")] - public string Joke { get; set; } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/Dad/DadJokes.cs b/src/Bot/Commands/Randomness/Dad/DadJokes.cs deleted file mode 100644 index 67f9679..0000000 --- a/src/Bot/Commands/Randomness/Dad/DadJokes.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; - -namespace Geekbot.Bot.Commands.Randomness.Dad -{ - public class DadJokes : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - - public DadJokes(IErrorHandler errorHandler) - { - _errorHandler = errorHandler; - } - - [Command("dad", RunMode = RunMode.Async)] - [Summary("A random dad joke")] - public async Task Say() - { - try - { - var response = await HttpAbstractions.Get(new Uri("https://icanhazdadjoke.com/")); - await ReplyAsync(response.Joke); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/Dog/Dog.cs b/src/Bot/Commands/Randomness/Dog/Dog.cs deleted file mode 100644 index 39e57c7..0000000 --- a/src/Bot/Commands/Randomness/Dog/Dog.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; - -namespace Geekbot.Bot.Commands.Randomness.Dog -{ - public class Dog : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - - public Dog(IErrorHandler errorHandler) - { - _errorHandler = errorHandler; - } - - [Command("dog", RunMode = RunMode.Async)] - [Summary("Return a random image of a dog.")] - public async Task Say() - { - try - { - var response = await HttpAbstractions.Get(new Uri("http://random.dog/woof.json")); - await ReplyAsync(response.Url); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/Dog/DogResponseDto.cs b/src/Bot/Commands/Randomness/Dog/DogResponseDto.cs deleted file mode 100644 index 9f0dfce..0000000 --- a/src/Bot/Commands/Randomness/Dog/DogResponseDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Bot.Commands.Randomness.Dog -{ - internal class DogResponseDto - { - [JsonPropertyName("url")] - public string Url { get; set; } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/EightBall.cs b/src/Bot/Commands/Randomness/EightBall.cs deleted file mode 100644 index b5f0c3a..0000000 --- a/src/Bot/Commands/Randomness/EightBall.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading.Tasks; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.GuildSettingsManager; -using Localization = Geekbot.Core.Localization; - -namespace Geekbot.Bot.Commands.Randomness -{ - public class EightBall : GeekbotCommandBase - { - public EightBall(IErrorHandler errorHandler, IGuildSettingsManager guildSettingsManager) : base(errorHandler, guildSettingsManager) - { - } - - [Command("8ball", RunMode = RunMode.Async)] - [Summary("Ask 8Ball a Question.")] - public async Task Ball([Remainder] [Summary("question")] string echo) - { - try - { - var enumerator = Localization.EightBall.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true).GetEnumerator(); - var replies = new List(); - while (enumerator.MoveNext()) - { - replies.Add(enumerator.Value?.ToString()); - } - - var answer = new Random().Next(replies.Count); - await ReplyAsync(replies[answer]); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/Fortune.cs b/src/Bot/Commands/Randomness/Fortune.cs deleted file mode 100644 index 1157603..0000000 --- a/src/Bot/Commands/Randomness/Fortune.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Threading.Tasks; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.Media; - -namespace Geekbot.Bot.Commands.Randomness -{ - public class Fortune : TransactionModuleBase - { - private readonly IFortunesProvider _fortunes; - - public Fortune(IFortunesProvider fortunes) - { - _fortunes = fortunes; - } - - [Command("fortune", RunMode = RunMode.Async)] - [Summary("Get a random fortune")] - public async Task GetAFortune() - { - await ReplyAsync(_fortunes.GetRandomFortune()); - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/Kanye/Kanye.cs b/src/Bot/Commands/Randomness/Kanye/Kanye.cs deleted file mode 100644 index e5d2e95..0000000 --- a/src/Bot/Commands/Randomness/Kanye/Kanye.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; - -namespace Geekbot.Bot.Commands.Randomness.Kanye -{ - public class Kanye : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - - public Kanye(IErrorHandler errorHandler) - { - _errorHandler = errorHandler; - } - - [Command("kanye", RunMode = RunMode.Async)] - [Summary("A random kayne west quote")] - public async Task Say() - { - try - { - var response = await HttpAbstractions.Get(new Uri("https://api.kanye.rest/")); - await ReplyAsync(response.Quote); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/Kanye/KanyeResponseDto.cs b/src/Bot/Commands/Randomness/Kanye/KanyeResponseDto.cs deleted file mode 100644 index ab8c06f..0000000 --- a/src/Bot/Commands/Randomness/Kanye/KanyeResponseDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Bot.Commands.Randomness.Kanye -{ - public class KanyeResponseDto - { - [JsonPropertyName("quote")] - public string Quote { get; set; } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/RandomAnimals.cs b/src/Bot/Commands/Randomness/RandomAnimals.cs deleted file mode 100644 index 5493485..0000000 --- a/src/Bot/Commands/Randomness/RandomAnimals.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.Media; - -namespace Geekbot.Bot.Commands.Randomness -{ - public class RandomAnimals : TransactionModuleBase - { - private readonly IMediaProvider _mediaProvider; - - public RandomAnimals(IMediaProvider mediaProvider) - { - _mediaProvider = mediaProvider; - } - - [Command("panda", RunMode = RunMode.Async)] - [Summary("Get a random panda image")] - public async Task Panda() - { - await ReplyAsync("", false, Eb(_mediaProvider.GetMedia(MediaType.Panda))); - } - - [Command("croissant", RunMode = RunMode.Async)] - [Alias("gipfeli")] - [Summary("Get a random croissant image")] - public async Task Croissant() - { - await ReplyAsync("", false, Eb(_mediaProvider.GetMedia(MediaType.Croissant))); - } - - [Command("pumpkin", RunMode = RunMode.Async)] - [Summary("Get a random pumpkin image")] - public async Task Pumpkin() - { - await ReplyAsync("", false, Eb(_mediaProvider.GetMedia(MediaType.Pumpkin))); - } - - [Command("squirrel", RunMode = RunMode.Async)] - [Summary("Get a random squirrel image")] - public async Task Squirrel() - { - await ReplyAsync("", false, Eb(_mediaProvider.GetMedia(MediaType.Squirrel))); - } - - [Command("turtle", RunMode = RunMode.Async)] - [Summary("Get a random turtle image")] - public async Task Turtle() - { - await ReplyAsync("", false, Eb(_mediaProvider.GetMedia(MediaType.Turtle))); - } - - [Command("penguin", RunMode = RunMode.Async)] - [Alias("pengu")] - [Summary("Get a random penguin image")] - public async Task Penguin() - { - await ReplyAsync("", false, Eb(_mediaProvider.GetMedia(MediaType.Penguin))); - } - - [Command("fox", RunMode = RunMode.Async)] - [Summary("Get a random fox image")] - public async Task Fox() - { - await ReplyAsync("", false, Eb(_mediaProvider.GetMedia(MediaType.Fox))); - } - - [Command("dab", RunMode = RunMode.Async)] - [Summary("Get a random dab image")] - public async Task Dab() - { - await ReplyAsync("", false, Eb(_mediaProvider.GetMedia(MediaType.Dab))); - } - - private static Embed Eb(string image) - { - return new EmbedBuilder {ImageUrl = image}.Build(); - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/Ship.cs b/src/Bot/Commands/Randomness/Ship.cs deleted file mode 100644 index 55e55c5..0000000 --- a/src/Bot/Commands/Randomness/Ship.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.Database; -using Geekbot.Core.Database.Models; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.Extensions; -using Geekbot.Core.GuildSettingsManager; -using Geekbot.Core.RandomNumberGenerator; -using Localization = Geekbot.Core.Localization; - -namespace Geekbot.Bot.Commands.Randomness -{ - public class Ship : GeekbotCommandBase - { - private readonly IRandomNumberGenerator _randomNumberGenerator; - private readonly DatabaseContext _database; - - public Ship(DatabaseContext database, IErrorHandler errorHandler, IRandomNumberGenerator randomNumberGenerator, IGuildSettingsManager guildSettingsManager) : base(errorHandler, guildSettingsManager) - { - _database = database; - _randomNumberGenerator = randomNumberGenerator; - } - - [Command("Ship", RunMode = RunMode.Async)] - [Summary("Ask the Shipping meter")] - public async Task Command([Summary("@user1")] IUser user1, [Summary("@user2")] IUser user2) - { - try - { - var userKeys = user1.Id < user2.Id - ? new Tuple(user1.Id.AsLong(), user2.Id.AsLong()) - : new Tuple(user2.Id.AsLong(), user1.Id.AsLong()); - - var dbval = _database.Ships.FirstOrDefault(s => - s.FirstUserId.Equals(userKeys.Item1) && - s.SecondUserId.Equals(userKeys.Item2)); - - var shippingRate = 0; - if (dbval == null) - { - shippingRate = _randomNumberGenerator.Next(1, 100); - _database.Ships.Add(new ShipsModel() - { - FirstUserId = userKeys.Item1, - SecondUserId = userKeys.Item2, - Strength = shippingRate - }); - await _database.SaveChangesAsync(); - } - else - { - shippingRate = dbval.Strength; - } - - var reply = $":heartpulse: **{Localization.Ship.Matchmaking}** :heartpulse:\r\n"; - reply += $":two_hearts: {user1.Mention} :heart: {user2.Mention} :two_hearts:\r\n"; - reply += $"0% [{BlockCounter(shippingRate)}] 100% - {DeterminateSuccess(shippingRate)}"; - await ReplyAsync(reply); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - private string DeterminateSuccess(int rate) - { - return (rate / 20) switch - { - 0 => Localization.Ship.NotGoingToHappen, - 1 => Localization.Ship.NotSuchAGoodIdea, - 2 => Localization.Ship.ThereMightBeAChance, - 3 => Localization.Ship.CouldWork, - 4 => Localization.Ship.ItsAMatch, - _ => "nope" - }; - } - - private string BlockCounter(int rate) - { - var amount = rate / 10; - Console.WriteLine(amount); - var blocks = ""; - for (var i = 1; i <= 10; i++) - if (i <= amount) - { - blocks += ":white_medium_small_square:"; - if (i == amount) - blocks += $" {rate}% "; - } - else - { - blocks += ":black_medium_small_square:"; - } - - return blocks; - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Randomness/Slap.cs b/src/Bot/Commands/Randomness/Slap.cs deleted file mode 100644 index c99c325..0000000 --- a/src/Bot/Commands/Randomness/Slap.cs +++ /dev/null @@ -1,135 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.Database; -using Geekbot.Core.Database.Models; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.Extensions; - -namespace Geekbot.Bot.Commands.Randomness -{ - public class Slap : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - private readonly DatabaseContext _database; - - public Slap(IErrorHandler errorHandler, DatabaseContext database) - { - _errorHandler = errorHandler; - _database = database; - } - - [Command("slap", RunMode = RunMode.Async)] - [Summary("slap someone")] - public async Task Slapper([Summary("@someone")] IUser user) - { - try - { - if (user.Id == Context.User.Id) - { - await ReplyAsync("Why would you slap yourself?"); - return; - } - - var things = new List - { - "thing", - "rubber chicken", - "leek stick", - "large trout", - "flat hand", - "strip of bacon", - "feather", - "piece of pizza", - "moldy banana", - "sharp retort", - "printed version of wikipedia", - "panda paw", - "spiked sledgehammer", - "monstertruck", - "dirty toilet brush", - "sleeping seagull", - "sunflower", - "mousepad", - "lolipop", - "bottle of rum", - "cheese slice", - "critical 1", - "natural 20", - "mjölnir (aka mewmew)", - "kamehameha", - "copy of Twilight", - "med pack (get ready for the end boss)", - "derp", - "condom (used)", - "gremlin fed after midnight", - "wet baguette", - "exploding kitten", - "shiny piece of shit", - "mismatched pair of socks", - "horcrux", - "tuna", - "suggestion", - "teapot", - "candle", - "dictionary", - "powerless banhammer", - "piece of low fat mozzarella", - // For some reason it never picks the last one - // Adding this workaround, because i'm to lazy to actually fix it at the time of writing this - "padding" - }; - - await ReplyAsync($"{Context.User.Username} slapped {user.Username} with a {things[new Random().Next(0, things.Count - 1)]}"); - - await UpdateRecieved(user.Id); - await UpdateGiven(Context.User.Id); - await _database.SaveChangesAsync(); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - - private async Task UpdateGiven(ulong userId) - { - var user = await GetUser(userId); - user.Given++; - _database.Slaps.Update(user); - } - - private async Task UpdateRecieved(ulong userId) - { - var user = await GetUser(userId); - user.Recieved++; - _database.Slaps.Update(user); - } - - private async Task GetUser(ulong userId) - { - var user = _database.Slaps.FirstOrDefault(e => - e.GuildId.Equals(Context.Guild.Id.AsLong()) && - e.UserId.Equals(userId.AsLong()) - ); - - if (user != null) return user; - - _database.Slaps.Add(new SlapsModel - { - GuildId = Context.Guild.Id.AsLong(), - UserId = userId.AsLong(), - Recieved = 0, - Given = 0 - }); - await _database.SaveChangesAsync(); - return _database.Slaps.FirstOrDefault(e => - e.GuildId.Equals(Context.Guild.Id.AsLong()) && - e.UserId.Equals(userId.AsLong())); - } - } -} diff --git a/src/Bot/Commands/Rpg/Cookies.cs b/src/Bot/Commands/Rpg/Cookies.cs deleted file mode 100644 index 66d845f..0000000 --- a/src/Bot/Commands/Rpg/Cookies.cs +++ /dev/null @@ -1,164 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Bot.CommandPreconditions; -using Geekbot.Core; -using Geekbot.Core.Database; -using Geekbot.Core.Database.Models; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.Extensions; -using Geekbot.Core.GuildSettingsManager; -using Geekbot.Core.RandomNumberGenerator; -using Localization = Geekbot.Core.Localization; - -namespace Geekbot.Bot.Commands.Rpg -{ - [DisableInDirectMessage] - [Group("cookies")] - [Alias("cookie")] - public class Cookies : GeekbotCommandBase - { - private readonly DatabaseContext _database; - private readonly IRandomNumberGenerator _randomNumberGenerator; - - public Cookies(DatabaseContext database, IErrorHandler errorHandler, IRandomNumberGenerator randomNumberGenerator, IGuildSettingsManager guildSettingsManager) - : base(errorHandler, guildSettingsManager) - { - _database = database; - _randomNumberGenerator = randomNumberGenerator; - } - - [Command("get", RunMode = RunMode.Async)] - [Summary("Get a cookie every 24 hours")] - public async Task GetCookies() - { - try - { - var actor = await GetUser(Context.User.Id); - var timeoutDays = 1; - if (actor.LastPayout?.AddDays(timeoutDays) > DateTime.Now.ToUniversalTime()) - { - var remaining = actor.LastPayout.Value.AddDays(timeoutDays) - DateTimeOffset.Now.ToUniversalTime(); - var formattedWaitTime = DateLocalization.FormatDateTimeAsRemaining(remaining); - await ReplyAsync(string.Format(Localization.Cookies.WaitForMoreCookies, formattedWaitTime)); - return; - } - actor.Cookies += 10; - actor.LastPayout = DateTimeOffset.Now.ToUniversalTime(); - await SetUser(actor); - await ReplyAsync(string.Format(Localization.Cookies.GetCookies, 10, actor.Cookies)); - - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [Command("jar", RunMode = RunMode.Async)] - [Summary("Look at your cookie jar")] - public async Task PeekIntoCookieJar() - { - try - { - var actor = await GetUser(Context.User.Id); - await ReplyAsync(string.Format(Localization.Cookies.InYourJar, actor.Cookies)); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [Command("give", RunMode = RunMode.Async)] - [Summary("Give cookies to someone")] - public async Task GiveACookie([Summary("@someone")] IUser user, [Summary("amount")] int amount = 1) - { - try - { - var giver = await GetUser(Context.User.Id); - - if (amount < 1) - { - await ReplyAsync(Localization.Cookies.CantTakeCookies); - return; - } - - if (giver.Cookies < amount) - { - await ReplyAsync(Localization.Cookies.NotEnoughToGive); - return; - } - - var taker = await GetUser(user.Id); - - giver.Cookies -= amount; - taker.Cookies += amount; - - await SetUser(giver); - await SetUser(taker); - - await ReplyAsync(string.Format(Localization.Cookies.Given, amount, user.Username)); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - [Command("eat", RunMode = RunMode.Async)] - [Summary("Eat a cookie")] - public async Task EatACookie() - { - try - { - var actor = await GetUser(Context.User.Id); - - if (actor.Cookies < 5) - { - await ReplyAsync(Localization.Cookies.NotEnoughCookiesToEat); - return; - } - - var amount = _randomNumberGenerator.Next(1, 5); - actor.Cookies -= amount; - - await SetUser(actor); - - await ReplyAsync(string.Format(Localization.Cookies.AteCookies, amount, actor.Cookies)); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - private async Task GetUser(ulong userId) - { - var user = _database.Cookies.FirstOrDefault(u =>u.GuildId.Equals(Context.Guild.Id.AsLong()) && u.UserId.Equals(userId.AsLong())) ?? await CreateNewRow(userId); - return user; - } - - private async Task SetUser(CookiesModel user) - { - _database.Cookies.Update(user); - await _database.SaveChangesAsync(); - } - - private async Task CreateNewRow(ulong userId) - { - var user = new CookiesModel() - { - GuildId = Context.Guild.Id.AsLong(), - UserId = userId.AsLong(), - Cookies = 0, - LastPayout = DateTimeOffset.MinValue.ToUniversalTime() - }; - var newUser = _database.Cookies.Add(user).Entity; - await _database.SaveChangesAsync(); - return newUser; - } - } -} diff --git a/src/Bot/Commands/User/GuildInfo.cs b/src/Bot/Commands/User/GuildInfo.cs deleted file mode 100644 index c063d89..0000000 --- a/src/Bot/Commands/User/GuildInfo.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Bot.CommandPreconditions; -using Geekbot.Core; -using Geekbot.Core.Database; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.Extensions; -using Geekbot.Core.Levels; - -namespace Geekbot.Bot.Commands.User -{ - public class GuildInfo : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - private readonly DatabaseContext _database; - private readonly ILevelCalc _levelCalc; - - public GuildInfo(DatabaseContext database, ILevelCalc levelCalc, IErrorHandler errorHandler) - { - _database = database; - _levelCalc = levelCalc; - _errorHandler = errorHandler; - } - - [Command("serverstats", RunMode = RunMode.Async)] - [Summary("Show some info about the bot.")] - [DisableInDirectMessage] - public async Task GetInfo() - { - try - { - var eb = new EmbedBuilder(); - eb.WithAuthor(new EmbedAuthorBuilder() - .WithIconUrl(Context.Guild.IconUrl) - .WithName(Context.Guild.Name)); - eb.WithColor(new Color(110, 204, 147)); - - var created = Context.Guild.CreatedAt; - var age = Math.Floor((DateTime.Now - created).TotalDays); - - var messages = _database.Messages - .Where(e => e.GuildId == Context.Guild.Id.AsLong()) - .Sum(e => e.MessageCount); - var level = _levelCalc.GetLevel(messages); - - eb.AddField("Server Age", $"{created.Day}/{created.Month}/{created.Year} ({age} days)"); - eb.AddInlineField("Level", level) - .AddInlineField("Messages", messages); - - await ReplyAsync("", false, eb.Build()); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/User/Karma.cs b/src/Bot/Commands/User/Karma.cs deleted file mode 100644 index 469c371..0000000 --- a/src/Bot/Commands/User/Karma.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Bot.CommandPreconditions; -using Geekbot.Commands.Karma; -using Geekbot.Core; -using Geekbot.Core.Database; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.Extensions; -using Geekbot.Core.GuildSettingsManager; - -namespace Geekbot.Bot.Commands.User -{ - [DisableInDirectMessage] - public class Karma : GeekbotCommandBase - { - private readonly DatabaseContext _database; - - public Karma(DatabaseContext database, IErrorHandler errorHandler, IGuildSettingsManager guildSettingsManager) : base(errorHandler, guildSettingsManager) - { - _database = database; - } - - [Command("good", RunMode = RunMode.Async)] - [Summary("Increase Someones Karma")] - public async Task Good([Summary("@someone")] IUser user) - { - await ChangeKarma(user, KarmaChange.Up); - } - - [Command("bad", RunMode = RunMode.Async)] - [Summary("Decrease Someones Karma")] - public async Task Bad([Summary("@someone")] IUser user) - { - await ChangeKarma(user, KarmaChange.Down); - } - - [Command("neutral", RunMode = RunMode.Async)] - [Summary("Do nothing to someones Karma")] - public async Task Neutral([Summary("@someone")] IUser user) - { - await ChangeKarma(user, KarmaChange.Same); - } - - private async Task ChangeKarma(IUser user, KarmaChange change) - { - try - { - var author = new Interactions.Resolved.User() - { - Id = Context.User.Id.ToString(), - Username = Context.User.Username, - Discriminator = Context.User.Discriminator, - Avatar = Context.User.AvatarId, - }; - var targetUser = new Interactions.Resolved.User() - { - Id = user.Id.ToString(), - Username = user.Username, - Discriminator = user.Discriminator, - Avatar = user.AvatarId, - }; - - var karma = new Geekbot.Commands.Karma.Karma(_database, Context.Guild.Id.AsLong()); - var res = await karma.ChangeKarma(author, targetUser, change); - - await ReplyAsync(string.Empty, false, res.ToDiscordNetEmbed().Build()); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/User/Rank.cs b/src/Bot/Commands/User/Rank.cs deleted file mode 100644 index 639469f..0000000 --- a/src/Bot/Commands/User/Rank.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Discord.Commands; -using Geekbot.Bot.CommandPreconditions; -using Geekbot.Core; -using Geekbot.Core.Database; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.GuildSettingsManager; -using Geekbot.Core.Highscores; - -namespace Geekbot.Bot.Commands.User -{ - public class Rank : GeekbotCommandBase - { - private readonly IHighscoreManager _highscoreManager; - private readonly DatabaseContext _database; - - public Rank(DatabaseContext database, IErrorHandler errorHandler, IHighscoreManager highscoreManager, IGuildSettingsManager guildSettingsManager) - : base(errorHandler, guildSettingsManager) - { - _database = database; - _highscoreManager = highscoreManager; - } - - [Command("rank", RunMode = RunMode.Async)] - [Summary("Get the highscore for various stats like message count, karma, correctly guessed roles, etc...")] - [DisableInDirectMessage] - public async Task RankCmd( - [Summary("type")] string typeUnformated = "messages", - [Summary("amount")] int amount = 10, - [Summary("season")] string season = null) - { - try - { - var res = new Geekbot.Commands.Rank(_database, _highscoreManager) - .Run(typeUnformated, amount, season, Context.Guild.Id, Context.Guild.Name); - await ReplyAsync(res); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/User/Stats.cs b/src/Bot/Commands/User/Stats.cs deleted file mode 100644 index 61505c0..0000000 --- a/src/Bot/Commands/User/Stats.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Bot.CommandPreconditions; -using Geekbot.Core; -using Geekbot.Core.Database; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.Extensions; -using Geekbot.Core.GuildSettingsManager; -using Geekbot.Core.Levels; -using Localization = Geekbot.Core.Localization; - -namespace Geekbot.Bot.Commands.User -{ - public class Stats : GeekbotCommandBase - { - private readonly ILevelCalc _levelCalc; - private readonly DatabaseContext _database; - - public Stats(DatabaseContext database, IErrorHandler errorHandler, ILevelCalc levelCalc, IGuildSettingsManager guildSettingsManager) : base(errorHandler, guildSettingsManager) - { - _database = database; - _levelCalc = levelCalc; - } - - [Command("stats", RunMode = RunMode.Async)] - [Summary("Get information about this user")] - [DisableInDirectMessage] - public async Task User([Summary("@someone")] IUser user = null) - { - try - { - var userInfo = user ?? Context.Message.Author; - var userGuildInfo = (IGuildUser) userInfo; - var createdAt = userInfo.CreatedAt; - var joinedAt = userGuildInfo.JoinedAt.Value; - var age = Math.Floor((DateTime.Now - createdAt).TotalDays); - var joinedDayAgo = Math.Floor((DateTime.Now - joinedAt).TotalDays); - - var messages = _database.Messages - ?.FirstOrDefault(e => e.GuildId.Equals(Context.Guild.Id.AsLong()) && e.UserId.Equals(userInfo.Id.AsLong())) - ?.MessageCount ?? 0; - var guildMessages = _database.Messages - ?.Where(e => e.GuildId.Equals(Context.Guild.Id.AsLong())) - .Select(e => e.MessageCount) - .Sum() ?? 0; - - var level = _levelCalc.GetLevel(messages); - - var percent = Math.Round((double) (100 * messages) / guildMessages, 2); - - var cookies = _database.Cookies - ?.FirstOrDefault(e => e.GuildId.Equals(Context.Guild.Id.AsLong()) && e.UserId.Equals(userInfo.Id.AsLong())) - ?.Cookies ?? 0; - - var quotes = _database.Quotes.Count(e => e.GuildId.Equals(Context.Guild.Id.AsLong()) && e.UserId.Equals(userInfo.Id.AsLong())); - - var eb = new EmbedBuilder(); - eb.WithAuthor(new EmbedAuthorBuilder() - .WithIconUrl(userInfo.GetAvatarUrl()) - .WithName(userInfo.Username)); - eb.WithColor(new Color(221, 255, 119)); - - var karma = _database.Karma.FirstOrDefault(e => - e.GuildId.Equals(Context.Guild.Id.AsLong()) && - e.UserId.Equals(userInfo.Id.AsLong())); - var correctRolls = _database.Rolls.FirstOrDefault(e => - e.GuildId.Equals(Context.Guild.Id.AsLong()) && - e.UserId.Equals(userInfo.Id.AsLong())); - - eb.AddInlineField(Localization.Stats.OnDiscordSince, - $"{createdAt.Day}.{createdAt.Month}.{createdAt.Year} ({age} {Localization.Stats.Days})") - .AddInlineField(Localization.Stats.JoinedServer, - $"{joinedAt.Day}.{joinedAt.Month}.{joinedAt.Year} ({joinedDayAgo} {Localization.Stats.Days})") - .AddInlineField(Localization.Stats.Karma, karma?.Karma ?? 0) - .AddInlineField(Localization.Stats.Level, level) - .AddInlineField(Localization.Stats.MessagesSent, messages) - .AddInlineField(Localization.Stats.ServerTotal, $"{percent}%"); - - if (correctRolls != null) eb.AddInlineField(Localization.Stats.GuessedRolls, correctRolls.Rolls); - if (cookies > 0) eb.AddInlineField(Localization.Stats.Cookies, cookies); - if (quotes > 0) eb.AddInlineField(Localization.Stats.Quotes, quotes); - - await ReplyAsync("", false, eb.Build()); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/AvatarGetter.cs b/src/Bot/Commands/Utils/AvatarGetter.cs deleted file mode 100644 index 458eec8..0000000 --- a/src/Bot/Commands/Utils/AvatarGetter.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; - -namespace Geekbot.Bot.Commands.Utils -{ - public class AvatarGetter : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - - public AvatarGetter(IErrorHandler errorHandler) - { - _errorHandler = errorHandler; - } - - [Command("avatar", RunMode = RunMode.Async)] - [Summary("Get someones avatar")] - public async Task GetAvatar([Remainder, Summary("@someone")] IUser user = null) - { - try - { - user ??= Context.User; - var url = user.GetAvatarUrl(ImageFormat.Auto, 1024); - await ReplyAsync(url); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/Changelog/Changelog.cs b/src/Bot/Commands/Utils/Changelog/Changelog.cs deleted file mode 100644 index 989ac0d..0000000 --- a/src/Bot/Commands/Utils/Changelog/Changelog.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Discord.WebSocket; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; - -namespace Geekbot.Bot.Commands.Utils.Changelog -{ - public class Changelog : TransactionModuleBase - { - private readonly DiscordSocketClient _client; - private readonly IErrorHandler _errorHandler; - - public Changelog(IErrorHandler errorHandler, DiscordSocketClient client) - { - _errorHandler = errorHandler; - _client = client; - } - - [Command("changelog", RunMode = RunMode.Async)] - [Summary("Show the latest 10 updates")] - public async Task GetChangelog() - { - try - { - var commits = await HttpAbstractions.Get>(new Uri("https://api.github.com/repos/pizzaandcoffee/geekbot.net/commits")); - - var eb = new EmbedBuilder(); - eb.WithColor(new Color(143, 165, 102)); - eb.WithAuthor(new EmbedAuthorBuilder - { - IconUrl = _client.CurrentUser.GetAvatarUrl(), - Name = "Latest Updates", - Url = "https://geekbot.pizzaandcoffee.rocks/updates" - }); - var sb = new StringBuilder(); - foreach (var commit in commits.Take(10)) - sb.AppendLine($"- {commit.Commit.Message} ({commit.Commit.Author.Date:yyyy-MM-dd})"); - eb.Description = sb.ToString(); - eb.WithFooter(new EmbedFooterBuilder - { - Text = $"List generated from github commits on {DateTime.Now:yyyy-MM-dd}" - }); - await ReplyAsync("", false, eb.Build()); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/Changelog/CommitAuthorDto.cs b/src/Bot/Commands/Utils/Changelog/CommitAuthorDto.cs deleted file mode 100644 index 19d93eb..0000000 --- a/src/Bot/Commands/Utils/Changelog/CommitAuthorDto.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Text.Json.Serialization; - -namespace Geekbot.Bot.Commands.Utils.Changelog -{ - public class CommitAuthorDto - { - [JsonPropertyName("name")] - public string Name { get; set; } - - [JsonPropertyName("email")] - public string Email { get; set; } - - [JsonPropertyName("date")] - public DateTimeOffset Date { get; set; } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/Changelog/CommitDto.cs b/src/Bot/Commands/Utils/Changelog/CommitDto.cs deleted file mode 100644 index e67d08c..0000000 --- a/src/Bot/Commands/Utils/Changelog/CommitDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Bot.Commands.Utils.Changelog -{ - public class CommitDto - { - [JsonPropertyName("commit")] - public CommitInfoDto Commit { get; set; } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/Changelog/CommitInfoDto.cs b/src/Bot/Commands/Utils/Changelog/CommitInfoDto.cs deleted file mode 100644 index 592da9e..0000000 --- a/src/Bot/Commands/Utils/Changelog/CommitInfoDto.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Bot.Commands.Utils.Changelog -{ - public class CommitInfoDto - { - [JsonPropertyName("author")] - public CommitAuthorDto Author { get; set; } - - [JsonPropertyName("message")] - public string Message { get; set; } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/Choose.cs b/src/Bot/Commands/Utils/Choose.cs deleted file mode 100644 index 450433d..0000000 --- a/src/Bot/Commands/Utils/Choose.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.GuildSettingsManager; -using Localization = Geekbot.Core.Localization; - -namespace Geekbot.Bot.Commands.Utils -{ - public class Choose : GeekbotCommandBase - { - public Choose(IErrorHandler errorHandler, IGuildSettingsManager guildSettingsManager) : base(errorHandler, guildSettingsManager) - { - } - - [Command("choose", RunMode = RunMode.Async)] - [Summary("Let the bot choose for you, separate options with a semicolon.")] - public async Task Command([Remainder] [Summary("option1;option2")] - string choices) - { - try - { - var choicesArray = choices.Split(';'); - var choice = new Random().Next(choicesArray.Length); - await ReplyAsync(string.Format(Localization.Choose.Choice, choicesArray[choice].Trim())); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/Dice.cs b/src/Bot/Commands/Utils/Dice.cs deleted file mode 100644 index c57001f..0000000 --- a/src/Bot/Commands/Utils/Dice.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.DiceParser; -using Geekbot.Core.ErrorHandling; - -namespace Geekbot.Bot.Commands.Utils -{ - public class Dice : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - private readonly IDiceParser _diceParser; - - public Dice(IErrorHandler errorHandler, IDiceParser diceParser) - { - _errorHandler = errorHandler; - _diceParser = diceParser; - } - - // ToDo: Separate representation and logic - // ToDo: Translate - [Command("dice", RunMode = RunMode.Async)] - [Summary("Roll a dice. (use '!dice help' for a manual)")] - public async Task RollCommand([Remainder] [Summary("input")] string diceInput = "1d20") - { - try - { - if (diceInput == "help") - { - await ShowDiceHelp(); - return; - } - - var parsed = _diceParser.Parse(diceInput); - - var sb = new StringBuilder(); - sb.AppendLine($"{Context.User.Mention} :game_die:"); - foreach (var die in parsed.Dice) - { - sb.AppendLine($"**{die.DiceName}**"); - var diceResultList = new List(); - var total = 0; - - foreach (var roll in die.Roll()) - { - diceResultList.Add(roll.ToString()); - total += roll.Result; - } - - sb.AppendLine(string.Join(" | ", diceResultList)); - - if (parsed.SkillModifier != 0) - { - sb.AppendLine($"Skill: {parsed.SkillModifier}"); - } - - if (parsed.Options.ShowTotal) - { - var totalLine = $"Total: {total}"; - if (parsed.SkillModifier > 0) - { - totalLine += ($" (+{parsed.SkillModifier} = {total + parsed.SkillModifier})"); - } - - if (parsed.SkillModifier < 0) - { - totalLine += ($" ({parsed.SkillModifier} = {total - parsed.SkillModifier})"); - } - - sb.AppendLine(totalLine); - } - } - - await Context.Channel.SendMessageAsync(sb.ToString()); - } - catch (DiceException e) - { - await Context.Channel.SendMessageAsync($"**:warning: {e.DiceName} is invalid:** {e.Message}"); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - - private async Task ShowDiceHelp() - { - var sb = new StringBuilder(); - sb.AppendLine("**__Examples__**"); - sb.AppendLine("```"); - sb.AppendLine("!dice - throw a 1d20"); - sb.AppendLine("!dice 1d12 - throw a 1d12"); - sb.AppendLine("!dice +1d20 - throw with advantage"); - sb.AppendLine("!dice -1d20 - throw with disadvantage"); - sb.AppendLine("!dice 1d20 +2 - throw with a +2 skill bonus"); - sb.AppendLine("!dice 1d20 -2 - throw with a -2 skill bonus"); - sb.AppendLine("!dice 8d6 - throw a fireball 🔥"); - sb.AppendLine("!dice 8d6 total - calculate the total"); - sb.AppendLine("!dice 2d20 6d6 2d12 - drop your dice pouch"); - sb.AppendLine("```"); - - await Context.Channel.SendMessageAsync(sb.ToString()); - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/Emojify.cs b/src/Bot/Commands/Utils/Emojify.cs deleted file mode 100644 index a513710..0000000 --- a/src/Bot/Commands/Utils/Emojify.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.Converters; -using Geekbot.Core.ErrorHandling; - -namespace Geekbot.Bot.Commands.Utils -{ - public class Emojify : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - - public Emojify(IErrorHandler errorHandler) - { - _errorHandler = errorHandler; - } - - [Command("emojify", RunMode = RunMode.Async)] - [Summary("Emojify text")] - public async Task Dflt([Remainder] [Summary("text")] string text) - { - try - { - var emojis = EmojiConverter.TextToEmoji(text); - if (emojis.Length > 1999) - { - await ReplyAsync("I can't take that much at once!"); - return; - } - - await ReplyAsync($"{Context.User.Username}#{Context.User.Discriminator} said:"); - await ReplyAsync(emojis); - try - { - await Context.Message.DeleteAsync(); - } - catch - { - // bot may not have enough permission, doesn't matter if it fails - } - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/Help.cs b/src/Bot/Commands/Utils/Help.cs deleted file mode 100644 index 7aa9aff..0000000 --- a/src/Bot/Commands/Utils/Help.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Text; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; - -namespace Geekbot.Bot.Commands.Utils -{ - public class Help : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - - public Help(IErrorHandler errorHandler) - { - _errorHandler = errorHandler; - } - - [Command("help", RunMode = RunMode.Async)] - [Summary("List all Commands")] - public async Task GetHelp() - { - try - { - var sb = new StringBuilder(); - - sb.AppendLine("For a list of all commands, please visit the following page"); - sb.AppendLine("https://geekbot.pizzaandcoffee.rocks/commands"); - var dm = await Context.User.CreateDMChannelAsync(RequestOptions.Default); - await dm.SendMessageAsync(sb.ToString()); - await Context.Message.AddReactionAsync(new Emoji("✅")); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/Info.cs b/src/Bot/Commands/Utils/Info.cs deleted file mode 100644 index 912528d..0000000 --- a/src/Bot/Commands/Utils/Info.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Discord.WebSocket; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.Extensions; - -namespace Geekbot.Bot.Commands.Utils -{ - public class Info : TransactionModuleBase - { - private readonly DiscordSocketClient _client; - private readonly CommandService _commands; - private readonly IErrorHandler _errorHandler; - - public Info(IErrorHandler errorHandler, DiscordSocketClient client, CommandService commands) - { - _errorHandler = errorHandler; - _client = client; - _commands = commands; - } - - [Command("info", RunMode = RunMode.Async)] - [Summary("Get Information about the bot")] - public async Task BotInfo() - { - try - { - var eb = new EmbedBuilder(); - - var appInfo = await _client.GetApplicationInfoAsync(); - - eb.WithAuthor(new EmbedAuthorBuilder() - .WithIconUrl(appInfo.IconUrl) - .WithName($"{Constants.Name} V{Constants.BotVersion()}")); - var uptime = DateTime.Now.Subtract(Process.GetCurrentProcess().StartTime); - - eb.AddInlineField("Bot Name", _client.CurrentUser.Username); - eb.AddInlineField("Bot Owner", $"{appInfo.Owner.Username}#{appInfo.Owner.Discriminator}"); - eb.AddInlineField("Library", $"Discord.NET {Constants.LibraryVersion()}"); - eb.AddInlineField("Uptime", $"{uptime.Days}D {uptime.Hours}H {uptime.Minutes}M {uptime.Seconds}S"); - eb.AddInlineField("Servers", Context.Client.GetGuildsAsync().Result.Count); - eb.AddInlineField("Total Commands", _commands.Commands.Count()); - eb.AddField("Website", "https://geekbot.pizzaandcoffee.rocks/"); - - await ReplyAsync("", false, eb.Build()); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - - [Command("uptime", RunMode = RunMode.Async)] - [Summary("Get the Bot Uptime")] - public async Task BotUptime() - { - try - { - var uptime = DateTime.Now.Subtract(Process.GetCurrentProcess().StartTime); - await ReplyAsync($"{uptime.Days}D {uptime.Hours}H {uptime.Minutes}M {uptime.Seconds}S"); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/Lmgtfy.cs b/src/Bot/Commands/Utils/Lmgtfy.cs deleted file mode 100644 index 76fa6fa..0000000 --- a/src/Bot/Commands/Utils/Lmgtfy.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Threading.Tasks; -using System.Web; -using Discord.Commands; -using Geekbot.Core; -using Geekbot.Core.ErrorHandling; - -namespace Geekbot.Bot.Commands.Utils -{ - public class Lmgtfy : TransactionModuleBase - { - private readonly IErrorHandler _errorHandler; - - public Lmgtfy(IErrorHandler errorHandler) - { - _errorHandler = errorHandler; - } - - [Command("lmgtfy", RunMode = RunMode.Async)] - [Summary("Get a 'Let me google that for you' link")] - public async Task GetUrl([Remainder] [Summary("question")] string question) - { - try - { - var encoded = HttpUtility.UrlEncode(question).Replace("%20", "+"); - await Context.Channel.SendMessageAsync($""); - } - catch (Exception e) - { - await _errorHandler.HandleCommandException(e, Context); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/Quote/MessageLink.cs b/src/Bot/Commands/Utils/Quote/MessageLink.cs deleted file mode 100644 index dff1273..0000000 --- a/src/Bot/Commands/Utils/Quote/MessageLink.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Data; -using System.Text.RegularExpressions; - -namespace Geekbot.Bot.Commands.Utils.Quote -{ - public class MessageLink - { - public readonly static Regex re = new Regex( - @"https:\/\/((canary|ptb)\.)?discord(app)?.com\/channels\/(?\d{16,20})\/(?\d{16,20})\/(?\d{16,20})", - RegexOptions.Compiled | RegexOptions.IgnoreCase, - new TimeSpan(0, 0, 2)); - - public ulong GuildId { get; set; } - public ulong ChannelId { get; set; } - public ulong MessageId { get; set; } - - public MessageLink(string url) - { - var matches = re.Matches(url); - - foreach (Match match in matches) - { - foreach (Group matchGroup in match.Groups) - { - switch (matchGroup.Name) - { - case "GuildId": - GuildId = ulong.Parse(matchGroup.Value); - break; - case "ChannelId": - ChannelId = ulong.Parse(matchGroup.Value); - break; - case "MessageId": - MessageId = ulong.Parse(matchGroup.Value); - break; - } - } - } - } - - public static bool IsValid(string link) - { - return re.IsMatch(link); - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/Quote/Quote.cs b/src/Bot/Commands/Utils/Quote/Quote.cs deleted file mode 100644 index 243e5dd..0000000 --- a/src/Bot/Commands/Utils/Quote/Quote.cs +++ /dev/null @@ -1,322 +0,0 @@ -using System; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.Bot.CommandPreconditions; -using Geekbot.Core; -using Geekbot.Core.Database; -using Geekbot.Core.Database.Models; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.Extensions; -using Geekbot.Core.GuildSettingsManager; -using Geekbot.Core.Polyfills; -using Geekbot.Core.RandomNumberGenerator; -using Geekbot.Core.UserRepository; -using Microsoft.EntityFrameworkCore; -using Sentry; -using Constants = Geekbot.Core.Constants; -using Localization = Geekbot.Core.Localization; - -namespace Geekbot.Bot.Commands.Utils.Quote -{ - [Group("quote")] - [DisableInDirectMessage] - public class Quote : GeekbotCommandBase - { - private readonly DatabaseContext _database; - private readonly IRandomNumberGenerator _randomNumberGenerator; - private readonly IUserRepository _userRepository; - private readonly bool _isDev; - - public Quote(IErrorHandler errorHandler, DatabaseContext database, IRandomNumberGenerator randomNumberGenerator, IGuildSettingsManager guildSettingsManager, IUserRepository userRepository) - : base(errorHandler, guildSettingsManager) - { - _database = database; - _randomNumberGenerator = randomNumberGenerator; - _userRepository = userRepository; - // to remove restrictions when developing - _isDev = Constants.BotVersion() == "0.0.0-DEV"; - } - - [Command] - [Summary("Return a random quote from the database")] - public async Task GetRandomQuote() - { - try - { - var getQuoteFromDbSpan = Transaction.StartChild("GetQuoteFromDB"); - var quote = _database.Quotes.FromSqlInterpolated($"select * from \"Quotes\" where \"GuildId\" = {Context.Guild.Id} order by random() limit 1"); - getQuoteFromDbSpan.Finish(); - - if (!quote.Any()) - { - await ReplyAsync(Localization.Quote.NoQuotesFound); - Transaction.Status = SpanStatus.NotFound; - return; - } - - var buildQuoteEmbedSpan = Transaction.StartChild("BuildQuoteEmbed"); - var embed = QuoteBuilder(quote.FirstOrDefault()); - buildQuoteEmbedSpan.Finish(); - await ReplyAsync("", false, embed.Build()); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context, "Whoops, seems like the quote was to edgy to return"); - Transaction.Status = SpanStatus.InternalError; - } - } - - [Command("add")] - [Alias("save")] - [Summary("Add a quote from the last sent message by @user")] - public async Task AddQuote([Summary("@someone")] IUser user) - { - await QuoteFromMention(user, true); - } - - [Command("make")] - [Alias("preview")] - [Summary("Preview a quote from the last sent message by @user")] - public async Task ReturnSpecifiedQuote([Summary("@someone")] IUser user) - { - await QuoteFromMention(user, false); - } - - [Command("add")] - [Alias("save")] - [Summary("Add a quote from a message link")] - public async Task AddQuote([Summary("message-link")] string messageLink) - { - await QuoteFromMessageLink(messageLink, true); - } - - [Command("make")] - [Alias("preview")] - [Summary("Preview a quote from a message link")] - public async Task ReturnSpecifiedQuote([Summary("message-link")] string messageLink) - { - await QuoteFromMessageLink(messageLink, false); - } - - [Command("remove")] - [RequireUserPermission(GuildPermission.ManageMessages)] - [Summary("Remove a quote (user needs the 'ManageMessages' permission)")] - public async Task RemoveQuote([Summary("quote-ID")] int id) - { - try - { - var quote = _database.Quotes.Where(e => e.GuildId == Context.Guild.Id.AsLong() && e.InternalId == id)?.FirstOrDefault(); - if (quote != null) - { - _database.Quotes.Remove(quote); - await _database.SaveChangesAsync(); - var embed = QuoteBuilder(quote); - await ReplyAsync(string.Format(Localization.Quote.Removed, id), false, embed.Build()); - } - else - { - await ReplyAsync(Localization.Quote.NotFoundWithId); - } - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context, "I couldn't find a quote with that id :disappointed:"); - } - } - - [Command("stats")] - [Summary("Show quote stats for this server")] - public async Task GetQuoteStatsForServer() - { - try - { - // setup - var eb = new EmbedBuilder(); - eb.Author = new EmbedAuthorBuilder() - { - IconUrl = Context.Guild.IconUrl, - Name = $"{Context.Guild.Name} - {Localization.Quote.QuoteStats}" - }; - - // gather data - var totalQuotes = _database.Quotes.Count(row => row.GuildId == Context.Guild.Id.AsLong()); - if (totalQuotes == 0) - { - // no quotes, no stats, end of the road - await ReplyAsync(Localization.Quote.NoQuotesFound); - return; - } - - var mostQuotedPerson = _database.Quotes - .Where(row => row.GuildId == Context.Guild.Id.AsLong()) - .GroupBy(row => row.UserId) - .Select(row => new { userId = row.Key, amount = row.Count()}) - .OrderByDescending(row => row.amount) - .First(); - var mostQuotedPersonUser = Context.Client.GetUserAsync(mostQuotedPerson.userId.AsUlong()).Result ?? new UserPolyfillDto {Username = "Unknown User"}; - - var quotesByYear = _database.Quotes - .Where(row => row.GuildId == Context.Guild.Id.AsLong()) - .GroupBy(row => row.Time.Year) - .Select(row => new { year = row.Key, amount = row.Count()}) - .OrderBy(row => row.year); - - // add data to the embed - eb.AddField(Localization.Quote.MostQuotesPerson, $"{mostQuotedPersonUser.Username} ({mostQuotedPerson.amount})"); - eb.AddInlineField(Localization.Quote.TotalQuotes, totalQuotes); - - foreach (var year in quotesByYear) - { - eb.AddInlineField(year.year.ToString(), year.amount); - } - - await ReplyAsync("", false, eb.Build()); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context); - } - } - - private async Task QuoteFromMention(IUser user, bool saveToDb) - { - try - { - var list = Context.Channel.GetMessagesAsync().Flatten(); - var message = await list.FirstOrDefaultAsync(msg => - msg.Author.Id == user.Id && - msg.Embeds.Count == 0 && - msg.Id != Context.Message.Id && - !msg.Content.ToLower().StartsWith("!")); - if (message == null) return; - - await ProcessQuote(message, saveToDb); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context, $"No quoteable messages have been sent by {user.Username} in this channel"); - } - - } - - private async Task QuoteFromMessageLink(string messageLink, bool saveToDb) - { - try - { - if (!MessageLink.IsValid(messageLink)) - { - await ReplyAsync(Localization.Quote.NotAValidMessageLink); - return; - } - - var link = new MessageLink(messageLink); - if (link.GuildId != Context.Guild.Id) - { - await ReplyAsync(Localization.Quote.OnlyQuoteFromSameServer); - return; - } - - var channel = link.ChannelId == Context.Channel.Id - ? Context.Channel - : await Context.Guild.GetTextChannelAsync(link.ChannelId); - - var message = await channel.GetMessageAsync(link.MessageId); - - await ProcessQuote(message, saveToDb); - } - catch (Exception e) - { - await ErrorHandler.HandleCommandException(e, Context, "I couldn't find that message :disappointed:"); - } - } - - private async Task ProcessQuote(IMessage message, bool saveToDb) - { - if (message.Author.Id == Context.Message.Author.Id && saveToDb && !_isDev) - { - await ReplyAsync(Localization.Quote.CannotSaveOwnQuotes); - return; - } - - if (message.Author.IsBot && saveToDb && !_isDev) - { - await ReplyAsync(Localization.Quote.CannotQuoteBots); - return; - } - - var quote = CreateQuoteObject(message); - if (saveToDb) - { - await _database.Quotes.AddAsync(quote); - await _database.SaveChangesAsync(); - } - - var embed = QuoteBuilder(quote); - - var sb = new StringBuilder(); - if (saveToDb) sb.AppendLine(Localization.Quote.QuoteAdded); - - await ReplyAsync(sb.ToString(), false, embed.Build()); - } - - private EmbedBuilder QuoteBuilder(QuoteModel quote) - { - var getEmbedUserSpan = Transaction.StartChild("GetEmbedUser"); - var user = Context.Client.GetUserAsync(quote.UserId.AsUlong()).Result; - if (user == null) - { - var getEmbedUserFromRepoSpan = Transaction.StartChild("GetEmbedUserFromRepo"); - var fallbackUserFromRepo = _userRepository.Get(quote.UserId.AsUlong()); - user = new UserPolyfillDto() - { - Username = fallbackUserFromRepo?.Username ?? "Unknown User", - AvatarUrl = fallbackUserFromRepo?.AvatarUrl - }; - getEmbedUserFromRepoSpan.Finish(); - } - getEmbedUserSpan.Finish(); - - var embedBuilderSpan = Transaction.StartChild("EmbedBuilder"); - var eb = new EmbedBuilder(); - eb.WithColor(new Color(143, 167, 232)); - eb.Title = quote.InternalId == 0 - ? $"{user.Username} @ {quote.Time.Day}.{quote.Time.Month}.{quote.Time.Year}" - : $"#{quote.InternalId} | {user.Username} @ {quote.Time.Day}.{quote.Time.Month}.{quote.Time.Year}"; - eb.Description = quote.Quote; - eb.ThumbnailUrl = user.GetAvatarUrl(); - if (quote.Image != null) eb.ImageUrl = quote.Image; - embedBuilderSpan.Finish(); - - return eb; - } - - private QuoteModel CreateQuoteObject(IMessage message) - { - string image; - try - { - image = message.Attachments.First().Url; - } - catch (Exception) - { - image = null; - } - - var last = _database.Quotes.Where(e => e.GuildId.Equals(Context.Guild.Id.AsLong())).OrderByDescending(e => e.InternalId).FirstOrDefault(); - var internalId = 0; - if (last != null) internalId = last.InternalId + 1; - return new QuoteModel() - { - InternalId = internalId, - GuildId = Context.Guild.Id.AsLong(), - UserId = message.Author.Id.AsLong(), - Time = message.Timestamp.DateTime.ToUniversalTime(), - Quote = message.Content, - Image = image - }; - } - } -} \ No newline at end of file diff --git a/src/Bot/Commands/Utils/Quote/QuoteObjectDto.cs b/src/Bot/Commands/Utils/Quote/QuoteObjectDto.cs deleted file mode 100644 index 32b65cf..0000000 --- a/src/Bot/Commands/Utils/Quote/QuoteObjectDto.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Geekbot.Bot.Commands.Utils.Quote -{ - internal class QuoteObjectDto - { - public ulong UserId { get; set; } - public string Quote { get; set; } - public DateTime Time { get; set; } - public string Image { get; set; } - } -} \ No newline at end of file diff --git a/src/Bot/Handlers/CommandHandler.cs b/src/Bot/Handlers/CommandHandler.cs deleted file mode 100644 index 19d4edd..0000000 --- a/src/Bot/Handlers/CommandHandler.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Discord.Rest; -using Discord.WebSocket; -using Geekbot.Core.Database; -using Geekbot.Core.Database.Models; -using Geekbot.Core.GuildSettingsManager; -using Geekbot.Core.Logger; - -namespace Geekbot.Bot.Handlers -{ - public class CommandHandler - { - private readonly IDiscordClient _client; - private readonly IGeekbotLogger _logger; - private readonly IServiceProvider _servicesProvider; - private readonly CommandService _commands; - private readonly RestApplication _applicationInfo; - private readonly IGuildSettingsManager _guildSettingsManager; - private readonly List _ignoredServers; - - public CommandHandler(IDiscordClient client, IGeekbotLogger logger, IServiceProvider servicesProvider, CommandService commands, RestApplication applicationInfo, - IGuildSettingsManager guildSettingsManager) - { - _client = client; - _logger = logger; - _servicesProvider = servicesProvider; - _commands = commands; - _applicationInfo = applicationInfo; - _guildSettingsManager = guildSettingsManager; - - // Some guilds only want very specific functionally without any of the commands, a quick hack that solves that "short term" - // ToDo: create a clean solution for this... - _ignoredServers = new List - { - 228623803201224704, // SwitzerLAN - // 169844523181015040, // EEvent - 248531441548263425, // MYI - 110373943822540800 // Discord Bots - }; - } - - public Task RunCommand(SocketMessage messageParam) - { - try - { - if (!(messageParam is SocketUserMessage message)) return Task.CompletedTask; - if (message.Author.IsBot) return Task.CompletedTask; - - ulong guildId = message.Author switch - { - SocketGuildUser user => user.Guild.Id, - _ => 0 // DM Channel - }; - - if (IsIgnoredGuild(guildId, message.Author.Id)) return Task.CompletedTask; - - var lowCaseMsg = message.ToString().ToLower(); - if (ShouldHui(lowCaseMsg, guildId)) - { - message.Channel.SendMessageAsync("hui!!!"); - return Task.CompletedTask; - } - - if (ShouldPong(lowCaseMsg, guildId)) - { - message.Channel.SendMessageAsync("pong"); - return Task.CompletedTask; - } - - var argPos = 0; - if (!IsCommand(message, ref argPos)) return Task.CompletedTask; - - ExecuteCommand(message, argPos); - } - catch (Exception e) - { - _logger.Error(LogSource.Geekbot, "Failed to Process Message", e); - } - - return Task.CompletedTask; - } - - private void ExecuteCommand(IUserMessage message, int argPos) - { - var context = new CommandContext(_client, message); - _commands.ExecuteAsync(context, argPos, _servicesProvider); - _logger.Information(LogSource.Command, context.Message.Content.Split(" ")[0].Replace("!", ""), SimpleConextConverter.ConvertContext(context)); - } - - private bool IsIgnoredGuild(ulong guildId, ulong authorId) - { - if (!_ignoredServers.Contains(guildId)) return false; - return authorId == _applicationInfo.Owner.Id; - } - - private bool IsCommand(IUserMessage message, ref int argPos) - { - return message.HasCharPrefix('!', ref argPos) || message.HasMentionPrefix(_client.CurrentUser, ref argPos); - } - - private bool ShouldPong(string lowerCaseMessage, ulong guildId) - { - if (!lowerCaseMessage.StartsWith("ping ") && !lowerCaseMessage.Equals("ping")) return false; - if (guildId == 0) return true; - return GetGuildSettings(guildId)?.Ping ?? false; - } - - private bool ShouldHui(string lowerCaseMessage, ulong guildId) - { - if (!lowerCaseMessage.StartsWith("hui")) return false; - if (guildId == 0) return true; - return GetGuildSettings(guildId)?.Hui ?? false; - } - - private GuildSettingsModel GetGuildSettings(ulong guildId) - { - return _guildSettingsManager.GetSettings(guildId, false); - } - } -} \ No newline at end of file diff --git a/src/Bot/Handlers/MessageDeletedHandler.cs b/src/Bot/Handlers/MessageDeletedHandler.cs deleted file mode 100644 index b8ffe5c..0000000 --- a/src/Bot/Handlers/MessageDeletedHandler.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Discord; -using Discord.WebSocket; -using Geekbot.Core.Database; -using Geekbot.Core.Extensions; -using Geekbot.Core.Logger; - -namespace Geekbot.Bot.Handlers -{ - public class MessageDeletedHandler - { - private readonly DatabaseContext _database; - private readonly IGeekbotLogger _logger; - private readonly IDiscordClient _client; - - public MessageDeletedHandler(DatabaseContext database, IGeekbotLogger logger, IDiscordClient client) - { - _database = database; - _logger = logger; - _client = client; - } - - public async Task HandleMessageDeleted(Cacheable message, Cacheable cacheableMessageChannel) - { - try - { - var guildSocketData = ((IGuildChannel) cacheableMessageChannel.Value).Guild; - var guild = _database.GuildSettings.FirstOrDefault(g => g.GuildId.Equals(guildSocketData.Id.AsLong())); - if ((guild?.ShowDelete ?? false) && guild?.ModChannel != 0) - { - var modChannelSocket = (ISocketMessageChannel) await _client.GetChannelAsync(guild.ModChannel.AsUlong()); - var sb = new StringBuilder(); - if (message.Value != null) - { - sb.AppendLine($"The following message from {message.Value.Author.Username}#{message.Value.Author.Discriminator} was deleted in <#{cacheableMessageChannel.Id}>"); - sb.AppendLine(message.Value.Content); - } - else - { - sb.AppendLine("Someone deleted a message, the message was not cached..."); - } - - await modChannelSocket.SendMessageAsync(sb.ToString()); - } - } - catch (Exception e) - { - _logger.Error(LogSource.Geekbot, "Failed to send delete message...", e); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Handlers/ReactionHandler.cs b/src/Bot/Handlers/ReactionHandler.cs deleted file mode 100644 index 816e125..0000000 --- a/src/Bot/Handlers/ReactionHandler.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Threading.Tasks; -using Discord; -using Discord.WebSocket; -using Geekbot.Core.ReactionListener; - -namespace Geekbot.Bot.Handlers -{ - public class ReactionHandler - { - private readonly IReactionListener _reactionListener; - - public ReactionHandler(IReactionListener reactionListener) - { - _reactionListener = reactionListener; - } - - public Task Added(Cacheable cacheableUserMessage, Cacheable cacheableMessageChannel, SocketReaction reaction) - { - if (reaction.User.Value.IsBot) return Task.CompletedTask; - if (!_reactionListener.IsListener(reaction.MessageId)) return Task.CompletedTask; - _reactionListener.GiveRole(cacheableMessageChannel.Value, reaction); - return Task.CompletedTask; - } - - public Task Removed(Cacheable cacheableUserMessage, Cacheable cacheableMessageChannel, SocketReaction reaction) - { - if (reaction.User.Value.IsBot) return Task.CompletedTask; - if (!_reactionListener.IsListener(reaction.MessageId)) return Task.CompletedTask; - _reactionListener.RemoveRole(cacheableMessageChannel.Value, reaction); - return Task.CompletedTask; - } - } -} \ No newline at end of file diff --git a/src/Bot/Handlers/StatsHandler.cs b/src/Bot/Handlers/StatsHandler.cs deleted file mode 100644 index b089515..0000000 --- a/src/Bot/Handlers/StatsHandler.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord.WebSocket; -using Geekbot.Core.Database; -using Geekbot.Core.Database.Models; -using Geekbot.Core.Extensions; -using Geekbot.Core.Highscores; -using Geekbot.Core.Logger; -using Microsoft.EntityFrameworkCore; - -namespace Geekbot.Bot.Handlers -{ - public class StatsHandler - { - private readonly IGeekbotLogger _logger; - private readonly DatabaseContext _database; - private string _season; - - public StatsHandler(IGeekbotLogger logger, DatabaseContext database) - { - _logger = logger; - _database = database; - _season = SeasonsUtils.GetCurrentSeason(); - - var timer = new System.Timers.Timer() - { - Enabled = true, - AutoReset = true, - Interval = TimeSpan.FromMinutes(5).TotalMilliseconds - }; - timer.Elapsed += (sender, args) => - { - var current = SeasonsUtils.GetCurrentSeason(); - if (current == _season) return; - _season = SeasonsUtils.GetCurrentSeason(); - }; - } - - public async Task UpdateStats(SocketMessage message) - { - try - { - if (message == null) return; - if (message.Channel.Name.StartsWith('@')) - { - _logger.Information(LogSource.Message, $"[DM-Channel] {message.Content}", SimpleConextConverter.ConvertSocketMessage(message, true)); - return; - } - - var channel = (SocketGuildChannel) message.Channel; - - // ignore the discord bots server - // ToDo: create a clean solution for this... - if (channel.Guild.Id == 110373943822540800) - { - return; - } - - await UpdateTotalTable(message, channel); - await UpdateSeasonsTable(message, channel); - - - if (message.Author.IsBot) return; - _logger.Information(LogSource.Message, message.Content, SimpleConextConverter.ConvertSocketMessage(message)); - } - catch (Exception e) - { - _logger.Error(LogSource.Message, "Could not process message stats", e); - } - } - - private async Task UpdateTotalTable(SocketMessage message, SocketGuildChannel channel) - { - var rowId = await _database.Database.ExecuteSqlRawAsync( - "UPDATE \"Messages\" SET \"MessageCount\" = \"MessageCount\" + 1 WHERE \"GuildId\" = {0} AND \"UserId\" = {1}", - channel.Guild.Id.AsLong(), - message.Author.Id.AsLong() - ); - - if (rowId == 0) - { - await _database.Messages.AddAsync(new MessagesModel - { - UserId = message.Author.Id.AsLong(), - GuildId = channel.Guild.Id.AsLong(), - MessageCount = 1 - }); - await _database.SaveChangesAsync(); - } - } - - private async Task UpdateSeasonsTable(SocketMessage message, SocketGuildChannel channel) - { - var rowId = await _database.Database.ExecuteSqlRawAsync( - "UPDATE \"MessagesSeasons\" SET \"MessageCount\" = \"MessageCount\" + 1 WHERE \"GuildId\" = {0} AND \"UserId\" = {1} AND \"Season\" = {2}", - channel.Guild.Id.AsLong(), - message.Author.Id.AsLong(), - _season - ); - - if (rowId == 0) - { - await _database.MessagesSeasons.AddAsync(new MessageSeasonsModel() - { - UserId = message.Author.Id.AsLong(), - GuildId = channel.Guild.Id.AsLong(), - Season = _season, - MessageCount = 1 - }); - await _database.SaveChangesAsync(); - } - } - } -} \ No newline at end of file diff --git a/src/Bot/Handlers/UserHandler.cs b/src/Bot/Handlers/UserHandler.cs deleted file mode 100644 index 1f58131..0000000 --- a/src/Bot/Handlers/UserHandler.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Discord; -using Discord.Rest; -using Discord.WebSocket; -using Geekbot.Core.Database; -using Geekbot.Core.Extensions; -using Geekbot.Core.Logger; -using Geekbot.Core.UserRepository; - -namespace Geekbot.Bot.Handlers -{ - public class UserHandler - { - private readonly IUserRepository _userRepository; - private readonly IGeekbotLogger _logger; - private readonly DatabaseContext _database; - private readonly IDiscordClient _client; - - public UserHandler(IUserRepository userRepository, IGeekbotLogger logger, DatabaseContext database, IDiscordClient client) - { - _userRepository = userRepository; - _logger = logger; - _database = database; - _client = client; - } - - public async Task Joined(SocketGuildUser user) - { - try - { - var userRepoUpdate = _userRepository.Update(user); - _logger.Information(LogSource.Geekbot, $"{user.Username} ({user.Id}) joined {user.Guild.Name} ({user.Guild.Id})"); - - if (!user.IsBot) - { - var guildSettings = _database.GuildSettings.FirstOrDefault(guild => guild.GuildId == user.Guild.Id.AsLong()); - var message = guildSettings?.WelcomeMessage; - if (string.IsNullOrEmpty(message)) return; - message = message.Replace("$user", user.Mention); - - var fallbackSender = new Func>(() => user.Guild.DefaultChannel.SendMessageAsync(message)); - if (guildSettings.WelcomeChannel != 0) - { - try - { - var target = await _client.GetChannelAsync(guildSettings.WelcomeChannel.AsUlong()); - var channel = target as ISocketMessageChannel; - await channel.SendMessageAsync(message); - } - catch (Exception e) - { - _logger.Error(LogSource.Geekbot, "Failed to send welcome message to user defined welcome channel", e); - await fallbackSender(); - } - } - else - { - await fallbackSender(); - } - } - - await userRepoUpdate; - } - catch (Exception e) - { - _logger.Error(LogSource.Geekbot, "Failed to send welcome message", e); - } - } - - public async Task Updated(SocketUser oldUser, SocketUser newUser) - { - await _userRepository.Update(newUser); - } - - public async Task Left(SocketGuild socketGuild, SocketUser socketUser) - { - try - { - var guild = _database.GuildSettings.FirstOrDefault(g => g.GuildId.Equals(socketGuild.Id.AsLong())); - if (guild?.ShowLeave ?? false) - { - var modChannelSocket = (ISocketMessageChannel) await _client.GetChannelAsync(guild.ModChannel.AsUlong()); - await modChannelSocket.SendMessageAsync($"{socketUser.Username}#{socketUser.Discriminator} left the server"); - } - } - catch (Exception e) - { - _logger.Error(LogSource.Geekbot, "Failed to send leave message", e); - } - - _logger.Information(LogSource.Geekbot, $"{socketUser.Username} ({socketUser.Id}) joined {socketGuild.Name} ({socketGuild.Id})"); - } - } -} \ No newline at end of file diff --git a/src/Bot/Storage/croissant b/src/Bot/Storage/croissant deleted file mode 100644 index 6b4897f..0000000 --- a/src/Bot/Storage/croissant +++ /dev/null @@ -1,10 +0,0 @@ -https://i2.wp.com/epicureandculture.com/wp-content/uploads/2014/12/shutterstock_172040546.jpg -http://www.bakespace.com/images/large/5d79070cf21b2f33c3a1dd4336cb27d2.jpeg -http://food.fnr.sndimg.com/content/dam/images/food/fullset/2015/5/7/1/SD1B43_croissants-recipe_s4x3.jpg.rend.hgtvcom.616.462.suffix/1431052139248.jpeg -http://img.taste.com.au/u-Bwjfm_/taste/2016/11/mini-croissants-with-3-fillings-14692-1.jpeg -https://media.newyorker.com/photos/590974702179605b11ad8096/16:9/w_1200,h_630,c_limit/Gopnik-TheMurkyMeaningsofStraightenedOutCroissants.jpg -https://storage.cpstatic.ch/storage/og_image/laugengipfel--425319.jpg -https://c1.staticflickr.com/3/2835/10874180753_2b2916e3ce_b.jpg -https://www.spatz-dessert.ch/image_upload/Laugengipfel.jpg -http://www.baeckerei-meier.ch/images/p005_1_03.png -http://i.huffpost.com/gen/1278175/thumbs/o-CROISSANT-facebook.jpg \ No newline at end of file diff --git a/src/Bot/Storage/dab b/src/Bot/Storage/dab deleted file mode 100644 index cba5a5c..0000000 --- a/src/Bot/Storage/dab +++ /dev/null @@ -1,8 +0,0 @@ -https://pre00.deviantart.net/dcde/th/pre/i/2018/247/8/1/dabbing_pug_cute_dab_dance_by_manekibb-dcm2lvd.png -https://banner2.kisspng.com/20180625/xfv/kisspng-squidward-tentacles-dab-desktop-wallpaper-dab-emoji-5b31a97a839bf2.6353972915299813065391.jpg -https://djbooth.net/.image/t_share/MTUzNDg2MDIzOTU4NzM0NzA1/life-death-of-dab-dancejpg.jpg -https://res.cloudinary.com/teepublic/image/private/s--gfsWHvaH--/t_Preview/b_rgb:262c3a,c_limit,f_jpg,h_630,q_90,w_630/v1493209189/production/designs/1524888_1.jpg -https://i1.wp.com/fortniteskins.net/wp-content/uploads/2018/04/dab-skin-1.png?quality=90&strip=all&ssl=1 -https://i.pinimg.com/originals/12/d4/0a/12d40a8fc66b7a7ea8b9044ee0303974.png -https://images.bewakoof.com/t540/dab-penguin-boyfriend-t-shirt-women-s-printed-boyfriend-t-shirts-196918-1538034349.jpg -https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSKH1FLh5L3pOR2tamx-5OBqm_W2FFl8F7gteTAs2vMowwJ1Y32 \ No newline at end of file diff --git a/src/Bot/Storage/fortunes b/src/Bot/Storage/fortunes deleted file mode 100644 index 49a6171..0000000 --- a/src/Bot/Storage/fortunes +++ /dev/null @@ -1,9760 +0,0 @@ -% -"... the educated person is not the person who can answer the questions, but -the person who can question the answers." - ― Theodore Schick Jr., in The_Skeptical_Inquirer, March/April, 1997 -% -"A little fire, Scarecrow?" -% -"A programmer is a person who passes as an exacting expert on the basis of -being able to turn out, after innumerable punching, an infinite series of -incomprehensive answers calculated with micrometric precisions from vague -assumptions based on debatable figures taken from inconclusive documents -and carried out on instruments of problematical accuracy by persons of -dubious reliability and questionable mentality for the avowed purpose of -annoying and confounding a hopelessly defenseless department that was -unfortunate enough to ask for the information in the first place." - ― IEEE Grid newsmagazine -% -"Acting is an art which consists of keeping the audience from coughing." -% -"Anchovies? You've got the wrong man! I spell my name DANGER! (click)" -% -"Benson, you are so free of the ravages of intelligence." - ― Time Bandits -% -"Beware of the man who works hard to learn something, learns it, and finds -himself no wiser than before," Bokonon tells us. "He is full of murderous -resentment of people who are ignorant without having come by their -ignorance the hard way." - ― Kurt Vonnegut, "Cat's Cradle" -% -"But I don't like Spam!" -% -"But this has taken us far afield from interface, which is not a bad place -to be, since I particularly want to move ahead to the kludge. Why do -people have so much trouble understanding the kludge? What is a kludge, -after all, but not enough Ks, not enough ROMs, not enough RAMs, poor -quality interface and too few bytes to go around? Have I explained yet -about the bytes?" -% -"Calvin Coolidge looks as if he had been weaned on a pickle." - ― Alice Roosevelt Longworth -% -"Contrariwise," continued Tweedledee, "if it was so, it might be; and -if it were so, it would be; but as it isn't, it ain't. That's logic!" - ― Lewis Carroll, "Through the Looking Glass" -% -"Creation science" has not entered the curriculum for a reason so simple -and so basic that we often forget to mention it: because it is false, and -because good teachers understand exactly why it is false. What could be -more destructive of that most fragile yet most precious commodity in our -entire intellectual heritage ― good teaching ― than a bill forcing -honorable teachers to sully their sacred trust by granting equal treatment -to a doctrine not only known to be false, but calculated to undermine any -general understanding of science as an enterprise? - ― Stephen Jay Gould, "The Skeptical Inquirer", Vol. 12, page 186 -% -"Deep" is a word like "theory" or "semantic" ― it implies all sorts of -marvelous things. It's one thing to be able to say "I've got a theory", -quite another to say "I've got a semantic theory", but, ah, those who can -claim "I've got a deep semantic theory", they are truly blessed. - ― Randy Davis -% -"Deliver yesterday, code today, think tomorrow." -% -"Die? I should say not, dear fellow. No Barrymore would allow such a -conventional thing to happen to him." - ― John Barrymore's dying words -% -"Do not stop to ask what is it; - Let us go and make our visit." - ― T. S. Eliot, "The Love Song of J. Alfred Prufrock" -% -"Do you have blacks, too?" - ― George W. Bush, to Brazilian president Fernando Cardoso; - Washington, D.C., November 8, 2001 -% -"Don't let your mouth write no check that your tail can't cash." - ― Bo Diddley -% -"Don't say yes until I finish talking." - ― Darryl F. Zanuck -% -"Drawing on my fine command of language, I said nothing." -% -"Earth is a great, big funhouse without the fun." - ― Jeff Berner -% -"Even the best of friends cannot attend each other's funeral." - ― Kehlog Albran, "The Profit" -% -"Every time I think I know where it's at, they move it." -% -"Grub first, then ethics." - ― Bertolt Brecht -% -"He didn't say that. He was reading what was given to him in a speech." - ― Richard Darman, director of OMB, explaining why President Bush - wasn't following up on his campaign pledge that there would be - no loss of wetlands -% -"He was so narrow minded he could see through a keyhole with both eyes..." -% -"He's the kind of man for the times that need the kind of man he is ..." -% -"His mind is like a steel trap ― full of mice." - ― Foghorn Leghorn -% -"Humor is a drug which it's the fashion to abuse." - ― William Gilbert -% -"I am not an Economist. I am an honest man!" - ― Paul McCracken -% -"I am not sure what this is, but an `F' would only dignify it." - ― English Professor -% -"I didn't accept it. I received it." - ― Richard Allen, National Security Advisor to President Reagan, - explaining the $1000 in cash and two watches he was given by - two Japanese journalists after he helped arrange a private - interview for them with First Lady Nancy Reagan. -% -"I don't care who does the electing as long as I get to do the nominating." - ― Boss Tweed -% -"I don't have any solution but I certainly admire the problem." - ― Ashleigh Brilliant -% -"I have yet to see any problem, however complicated, which, when looked -at in the right way, did not become still more complicated." - ― Paul Anderson -% -"I just need enough to tide me over until I need more." - ― Bill Hoest -% -"I may not be totally perfect, but parts of me are excellent." - ― Ashleigh Brilliant -% -"I support efforts to limit the terms of members of Congress, especially -members of the House and members of the Senate." - ― former Vice-President Dan Quayle -% -"I was under medication when I made the decision not to burn the tapes." - ― President Richard Nixon -% -"I'd give my right arm to be ambidextrous." -% -"If dolphins are so smart, why did Flipper work for television?" -% -"If the King's English was good enough for Jesus, it's good enough for me!" - ― "Ma" Ferguson, Governor of Texas (circa 1920) -% -"If you can count your money, you don't have a billion dollars." - ― J. Paul Getty -% -"If you go on with this nuclear arms race, all you are going to do is -make the rubble bounce." - ― Winston Churchill -% -"In defeat, unbeatable; in victory, unbearable." - ― Winston Churchill, of Montgomery -% -"It depends on your definition of asleep. They were not stretched out. -They had their eyes closed. They were seated at their desks with their -heads in a nodding position." - ― John Hogan, Commonwealth Edison Supervisor of News Information, - responding to a charge by a Nuclear Regulatory Commission - inspector that two Dresden Nuclear Plant operators were - sleeping on the job. -% -"It is easier for a camel to pass through the eye of a needle if it is -lightly greased." - ― Kehlog Albran, "The Profit" -% -"It was hell," recalls former child. - ― caption to a B. Kliban cartoon -% -"It's bad luck to be superstitious." - ― Andrew W. Mathis -% -"It's not Camelot, but it's not Cleveland, either." - ― Kevin White, mayor of Boston -% -"Just once, I wish we would encounter an alien menace that wasn't immune - to bullets" - ― The Brigader, "Dr. Who" -% -"Laughter is the closest distance between two people." - ― Victor Borge -% -"MacDonald has the gift on compressing the largest amount of words into -the smallest amount of thoughts." - ― Winston Churchill -% -"Man invented language to satisfy his deep need to complain." - ― Lily Tomlin -% -"Mate, this parrot wouldn't VOOM if you put four million volts through it!" -% -"Might as well be frank, monsieur. It would take a miracle to get you -out of Casablanca and the Germans have outlawed miracles." -% -"Nondeterminism means never having to say you are wrong." -% -"Of COURSE it's the murder weapon. Who would frame someone with a fake?" -% -"One planet is all you get." -% -"She is descended from a long line that her mother listened to." - ― Gypsy Rose Lee -% -"Sherry [Thomas Sheridan] is dull, naturally dull; but it must have -taken him a great deal of pains to become what we now see him. Such an -excess of stupidity, sir, is not in Nature." - ― Samuel Johnson -% -"Stealing a rhinoceros should not be attempted lightly." -% -"Sure, it's going to kill a lot of people, but they may be dying of something -else anyway." - ― Othal Brand, member of a Texas pesticide review board, on chlordane -% -"Text processing has made it possible to right-justify any idea, even -one which cannot be justified on any other grounds." - ― J. Finnegan, USC. -% -"That must be wonderful! I don't understand it at all." -% -"The C Programming Language: A language which combines the flexibility of -assembly language with the power of assembly language." -% -"The Lord gave us farmers two strong hands so we could grab as much as -we could with both of them." - ― Joseph Heller, "Catch-22" -% -The bland leadeth the bland and they both shall fall into the kitsch. -% -"The difference between a misfortune and a calamity? If Gladstone fell -into the Thames, it would be a misfortune. But if someone dragged him -out again, it would be a calamity." - ― Benjamin Disraeli -% -The brain is a beautifully engineered get-out-of-the-way machine that -constantly scans the environment for things out of whose way it should -right now get. That's what brains did for several hundred million years ― -and then, just a few million years ago, the mammalian brain learned a new -trick: to predict the timing and location of dangers before they actually -happened. - -Our ability to duck that which is not yet coming is one of the brain's most -stunning innovations, and we wouldn't have dental floss or 401(k) plans -without it. But this innovation is in the early stages of development. The -application that allows us to respond to visible baseballs is ancient and -reliable, but the add-on utility that allows us to respond to threats that -loom in an unseen future is still in beta testing. - ― Daniel Gilbert, professor of psychology at Harvard University, - in an op-ed piece in the Los Angeles Times; 6 July, 2006 -% -"The illegal we do immediately. The unconstitutional takes a bit longer." - ― Henry Kissinger -% -"The society which scorns excellence in plumbing as a humble activity and -tolerates shoddiness in philosophy because it is an exaulted activity will -have neither good plumbing nor good philosophy ... neither its pipes nor -its theories will hold water." -% -"The sooner you fall behind, the more time you'll have to catch up!" -% -"The streets are safe in Philadelphia. It's only the people who -make them unsafe." - ― the late Frank Rizzo, ex-police chief and ex- mayor of - Philadelphia -% -The voters have spoken, the bastards... -% -"The warning message we sent the Russians was a calculated ambiguity -that would be clearly understood." - ― Alexander Haig -% -The way to make a small fortune in the commodities market is to start -with a large fortune. -% -"There are three possibilities: Pioneer's solar panel has turned away -from the sun; there's a large meteor blocking transmission; or someone -loaded Star Trek 3.2 into our video processor." -% -"There are two ways of disliking poetry; one way is to dislike it, the -other is to read Pope." - ― Oscar Wilde -% -"There was a boy called Eustace Clarence Scrubb, and he almost deserved it." - ― C. S. Lewis, The Chronicles of Narnia -% -"They gave me a book of checks. They didn't ask for any deposits." - ― Congressman Joe Early (D-Mass) at a press conference to answer - questions about the House Bank scandal. -% -This is a country where people are free to practice their religion, -regardless of race, creed, color, obesity, or number of dangling keys... -% -"To YOU I'm an atheist; to God, I'm the Loyal Opposition." - ― Woody Allen -% -To vacillate or not to vacillate, that is the question ... or is it? -% -"Tom Hayden is the kind of politician who gives opportunism a bad name." - ― Gore Vidal -% -"Under capitalism, man exploits man. Under Communism, it's just the opposite." - ― John Kenneth Galbraith -% -"We don't care. We don't have to. We're the Phone Company." -% -"We don't have to protect the environment ― the Second Coming is at hand." - ― James Watt -% -"We have reason to believe that man first walked upright to free his -hands for masturbation." - ― Lily Tomlin -% -"We'll cross out that bridge when we come back to it later." -% -"Well, if you can't believe what you read in a comic book, what CAN -you believe?!" - ― Bullwinkle J. Moose [Jay Ward] -% -"What is the robbing of a bank compared to the FOUNDING of a bank?" - ― Bertold Brecht -% -"When the going gets tough, the tough get empirical." - ― Jon Carroll -% -"When you have to kill a man it costs nothing to be polite." - ― Winston Churchill, on formal declarations of war -% -"Where shall I begin, please your Majesty?" he asked. "Begin at the -beginning," the King said, gravely, "and go on till you come to the end: -then stop." - ― Alice's Adventures in Wonderland, Lewis Carroll -% -"Why be a man, when you can be a success?" - ― Bertold Brecht -% -"Why isn't there a special name for the tops of your feet?" - ― Lily Tomlin -% -"Why was I born with such contemporaries?" - ― Oscar Wilde -% -"Would you tell me, please, which way I ought to go from here?" - -"That depends a good deal on where you want to get to," said the Cat. - ― Lewis Carrol -% -"Yacc" owes much to a most stimulating collection of users, who have goaded -me beyond my inclination, and frequently beyond my ability in their endless -search for "one more feature". Their irritating unwillingness to learn how -to do things my way has usually led to my doing things their way; most of -the time, they have been right. - ― S. C. Johnson, "Yacc guide acknowledgements" -% -"Yes, that was Richard Nixon. He used to be President. When he left the -White House, the Secret Service would count the silverware." - ― Woody Allen, "Sleeper" -% -"Yes, well, that's just the sort of blinkered, Philistine pig-ignorance I've -come to expect from you non-creative garbage. You sit there on your loathsome -spotty behinds squeezing blackheads, not caring a tinker's cuss for the -struggling artist, you excrement! You whining, hypocritical toadies with your -Tony Jacklin golf clubs, your colour TVs and your bleedin' Masonic handshakes! -You wouldn't let me join, would you, you blackballing bastards?! WELL I -WOULDN'T BECOME A FREEMASON NOW IF YOU GOT DOWN ON YOUR LOUSY STINKING KNEES -AND BEGGED ME!" -% -"You can't teach people to be lazy - either they have it, or they don't." - ― Dagwood Bumstead -% -"You'll never be the man your mother was!" -% -$100 invested at 7% interest for 100 years will become $100,000, at -which time it will be worth absolutely nothing. - ― Lazarus Long, "Time Enough for Love" -% -'Martyrdom' is the only way a person can become famous without ability. - ― George Bernard Shaw -% -'Tis not too late to seek a newer world. - ― Alfred, Lord Tennyson -% -[Humanity] is the measure of all things. - ― Protagoras -% -... And malt does more than Milton can/To justify God's ways to man - ― A. E. Housman -% -An infinite number of mathematicians walk into a bar. The first one orders -a beer. The second orders half a beer. The third, a quarter of a beer. The -bartender says "You're all idiots", and pours two beers. -% -Any code of your own that you haven't looked at for six or more months -might as well have been written by someone else. - ― Eagleson's Law -% -Any resemblance between the above and my own views is non-deterministic. -% -... But if we laugh with derision, we will never understand. Human -intellectual capacity has not altered for thousands of years so far as we -can tell. If intelligent people invested intense energy in issues that now -seem foolish to us, then the failure lies in our understanding of their -world, not in their distorted perceptions. Even the standard example of -ancient nonsense ― the debate about angels on pinheads ― makes sense once -you realize that theologians were not discussing whether five or eighteen -would fit, but whether a pin could house a finite or an infinite number. - ― S. J. Gould, "Wide Hats and Narrow Minds" -% -... Fortunately, the responsibility for providing evidence is on the part of -the person making the claim, not the critic. It is not the responsibility -of UFO skeptics to prove that a UFO has never existed, nor is it the -responsibility of paranormal-health-claims skeptics to prove that crystals -or colored lights never healed anyone. The skeptic's role is to point out -claims that are not adequately supported by acceptable evidence and to -provide plausible alternative explanations that are more in keeping with -the accepted body of scientific evidence. ... - ― Thomas L. Creed, The Skeptical Inquirer, Vol. XII No. 2, pg. 215 -% -... Had this been an actual emergency, we would have fled in terror, -and you would not have been informed. -% -... The book is worth attention for only two reasons: (1) it attacks -attempts to expose sham paranormal studies; and (2) it is very well and -plausibly written and so rather harder to dismiss or refute by simple -jeering. - ― Harry Eagar, reviewing "Beyond the Quantum" by Michael Talbot, - The Skeptical Inquirer, Vol. XII No. 2, ppg. 200-201 -% -The first principle is that you must not fool yourself―and you are the -easiest person to fool. So you have to be very careful about that. After -you've not fooled yourself, it's easy not to fool other scientists. You -just have to be honest in a conventional way after that. - ― R. P. Feynman, "Cargo Cult Science" -% -... at least I thought I was dancing, 'til somebody stepped on my hand. - ― J. B. White -% -... if the church put in half the time on covetousness that it does on lust, -this would be a better world. - ― Garrison Keillor, "Lake Wobegon Days" -% -... the Father, the Son and the Holy Ghost would never throw the Devil out -of Heaven as long as they still need him as a fourth for bridge. - ― Letter in NEW LIBERTARIAN NOTES #19 -% -... they [the Indians] are not running but are coming on. - ― note sent from Lt. Col Custer to other officers - of the 7th Regiment at the Little Bighorn -% -...I would go so far as to suggest that, were it not for our ego and -concern to be different, the African apes would be included in our family, -the Hominidae. - ― Richard Leakey -% -... It is sad to find him belaboring the science community for its united -opposition to ignorant creationists who want teachers and textbooks to give -equal time to crank arguments that have advanced not a step beyond the -flyblown rhetoric of Bishop Wilberforce and William Jennings Bryan. - ― Martin Gardner, "Irving Kristol and the Facts of Life", - The Skeptical Inquirer, Vol. XII No. 2, ppg. 128-131 -% -...computer hardware progress is so fast. No other technology since -civilization began has seen six orders of magnitude in performance-price -gain in 30 years. - ― Fred Brooks, Jr. -% -...difference of opinion is advantageous in religion. The several sects -perform the office of a common censor morum over each other. Is uniformity -attainable? Millions of innocent men, women, and children, since the -introduction of Christianity, have been burnt, tortured, fined, imprisoned; -yet we have not advanced one inch towards uniformity. - ― Thomas Jefferson, "Notes on Virginia" -% -...it still remains true that as a set of cognitive beliefs about the -existence of God in any recognizable sense continuous with the great -systems of the past, religious doctrines constitute a speculative -hypothesis of an extremely low order of probability. - ― Sidney Hook -% -...skill such as yours is evidence of a misspent youth. - ― Herbert Spencer -% -...the increased productivity fostered by a friendly environment and quality -tools is essential to meet ever increasing demands for software. - ― M. D. McIlroy, E. N. Pinson and B. A. Tague -% -...there can be no public or private virtue unless the foundation of action is -the practice of truth. - ― George Jacob Holyoake -% -...this is an awesome sight. The entire rebel resistance buried under six -million hardbound copies of "The Naked Lunch." - ― The Firesign Theater -% -...though his invention worked superbly ― his theory was a crock of sewage -from beginning to end. - ― Vernor Vinge, "The Peace War" -% -...when fits of creativity run strong, more than one programmer or writer has -been known to abandon the desktop for the more spacious floor. - ― Fred Brooks, Jr. -% -/earth is 98% full ... please delete anyone you can. -% -10.0 times 0.1 is hardly ever 1.0. -% -36 percent of the American public believes that boiling radioactive milk -makes it safe to drink. - ― results of a survey by Jon Miller at Northern Illinois University -% -43rd Law of Computing: Anything that can go wr -fortune: Segmentation fault ― core dumped -% -80 percent of all statistics are made up on the spot, including this one. -% -99% of all guys are within one standard deviation of your mom. -% -A LISP programmer knows the value of everything, but the cost of nothing. -% -A bore is a man you deprives you of solitude without providing you with -company. - ― Gian Vincenzo Gravina -% -A Nixon [is preferable to] a Dean Rusk ― who will be passionately -wrong with a high sense of consistency. - ― J. K. Galbraith -% -A Puritan is someone who is deathly afraid that someone somewhere is -having fun. -% -A baby is an alimentary canal with a loud voice at one end and no -responsibility at the other. -% -A bachelor is a selfish, undeserving guy who has cheated some woman -out of a divorce. - ― Don Quinn -% -A billion here, a billion there, sooner or later it adds up to real money. - ― Everett Dirksen -% -A bore is someone who persists in holding his own views after we have -enlightened him with ours. -% -A budget is just a method of worrying before you spend money, as well as -afterward. -% -A candidate is a person who gets money from the rich and votes from the -poor to protect them from each other. -% -A celebrity is a person who is known for his well-knownness. -% -A child's education should begin at least 100 years before he is born. - ― Oliver Wendell Holmes -% -A city is a large community where people are lonesome together. - ― Herbert Prochnow -% -A clash of doctrine is not a disaster ― it is an opportunity. -% -A closed mouth gathers no foot. -% -A conclusion is simply the place where someone got tired of thinking. -% -A conference is a gathering of important people who singly can do nothing, -but together can decide that nothing can be done. - ― Fred Allen -% -A conservative is a man who believes that nothing should be done for -the first time. - ― Alfred E. Wiggam -% -A conservative is a man with two perfectly good legs who has never -learned to walk. - ― Franklin D. Roosevelt -% -A conservative is one who is too cowardly to fight and too fat to run. -% -A countryman between two lawyers is like a fish between two cats. - ― Ben Franklin -% -A critic is a legless man who teaches running. - ― Channing Pollock -% -A day without sunshine is like night. -% -A decision occurs when one abandons the obvious for the possible. - ― P. Taylor -% -A diplomat is a man who can convince his wife she'd look stout in a fur coat. -% -A diplomat is someone who can tell you to go to hell in such a way that you -will look forward to the trip. - ― Caskie Stinnett -% -A diplomat is a man who always remembers a woman's birthday but never her age. - ― Robert Frost -% -A diva who specializes in risque arias is an off-coloratura soprano ... -% -A door is what a dog is perpetually on the wrong side of. - ― Ogden Nash -% -A famous Lisp Hacker noticed an Undergraduate sitting in front of a Xerox -1108, trying to edit a complex Klone network via a browser. Wanting to -help, the Hacker clicked one of the nodes in the network with the mouse, -and asked "what do you see?" Very earnestly, the Undergraduate replied "I -see a cursor." The Hacker then quickly pressed the boot toggle at the back -of the keyboard, while simultaneously hitting the Undergraduate over the -head with a thick Interlisp Manual. The Undergraduate was then Enlightened. -% -A fanatic is a person who can't change his mind and won't change the subject. - ― Winston Churchill -% -A fool must now and then be right by chance. -% -A fool's brain digests philosophy into folly, science into -superstition, and art into pedantry. Hence University education. - ― G. B. Shaw -% -A foolish consistency is the hobgoblin of little minds. - ― Samuel Johnson -% -A formal parsing algorithm should not always be used. - ― D. Gries -% -A good listener is not only popular everywhere, but after a while he knows -something. - ― Wilson Mizner -% -A good memory does not equal pale ink. -% -A good workman is known by his tools. -% -A great many people think they are thinking when they are merely -rearranging their prejudices. - ― William James -% -A handful of friends is worth more than a wagon of gold. -% -A healthy male adult bore consumes each year one and a half times his weight -in other people's patience. - ― John Updike -% -A hermit is a deserter from the army of humanity. -% -A journey of a thousand miles begins with a cash advance. -% -A king's castle is his home. -% -A lack of leadership is no substitute for inaction. -% -A language that doesn't affect the way you think about programming is -not worth knowing. -% -A language that doesn't have everything is actually easier to program -in than some that do. - ― Dennis M. Ritchie -% -A large number of installed systems work by fiat. That is, they work -by being declared to work. - ― Anatol Holt -% -A learning experience is one of those things that says, "You know that -thing you just did? Don't do that." - ― attributed to Douglas Adams -% -A little caution outflanks a large cavalry. - ― Bismarck -% -A little retrospection shows that although many fine, useful software systems -have been designed by committees and built as part of multipart projects, -those software systems that have excited passionate fans are those that are -the products of one or a few designing minds, great designers. Consider Unix, -APL, Pascal, Modula, the Smalltalk interface, even Fortran; and contrast them -with Cobol, PL/I, Algol, MVS/370, and MS-DOS. - ― Fred Brooks, Jr. -% -A lot of people I know believe in positive thinking, and so do I. I -believe everything positively stinks. - ― Lew Col -% -A man forgives only when he is in the wrong. -% -A man is not old until regrets take the place of dreams. - ― John Barrymore -% -A man paints with his brains and not with his hands. -% -A man said to the Universe: "Sir, I exist!" - -"However," replied the Universe, "the fact has not created in me a -sense of obligation." - ― Stephen Crane -% -A man shall never be enriched by envy. - ― Thomas Draxe -% -A man who fishes for marlin in ponds will put his money in Etruscan bonds. -% -A man who turns green has eschewed protein. -% -A man wrapped up in himself makes a very small package. -% -A manager would rather live with a problem that he cannot solve than -accept a solution that he does not understand. - ― G. Woolsey -% -A mathematician is a machine for converting coffee into theorems. -% -A mathematician named Hall -Has a hexahedronical ball, - And the cube of its weight - Times his pecker's, plus eight -Is his phone number ― give him a call. -% -A model is an artifice for helping you convince yourself that you -understand more about a system than you do. -% -A moose once bit my sister. -% -A morsel of genuine history is a thing so rare as to be always valuable. - ― Thomas Jefferson -% -A nuclear war can ruin your whole day. -% -A nymph hits you and steals your virginity. -% -A penny saved is ridiculous. -% -A person is just about as big as the things that make them angry. -% -A person who knows only one side of a question knows little of that. -% -A person with one watch knows what time it is; a person with two watches is -never sure. Proverb -% -A physicist is an atom's way of knowing about atoms. - ― George Wald -% -A plucked goose doesn't lay golden eggs. -% -A professor is one who talks in someone else's sleep. -% -A psychiatrist is a person who will give you expensive answers that -your wife will give you for free. -% -A quarrel is quickly settled when deserted by one party; there is no battle -unless there be two. - ― Seneca -% -A real patriot is the fellow who gets a parking ticket and rejoices -that the system works. -% -A real person has two reasons for doing anything ... a good reason and -the real reason. -% -A recent study has found that concentrating on difficult off-screen -objects, such as the faces of loved ones, causes eye strain in computer -scientists. Researchers into the phenomenon cite the added -concentration needed to "make sense" of such unnatural three -dimensional objects ... -% -A right is not what someone gives you; it's what no one can take from you. - ― Ramsey Clark -% -A scout troop consists of twelve little kids dressed like schmucks following -a big schmuck dressed like a kid. - - Jack Benny -% -A second marriage is the triumph of hope over experience. - ― Samuel Johnson -% -A sine curve goes off into infinity or at least to the end of the blackboard. -% -A smile is the shortest distance between two people. - ― Victor Borge -% -A straw vote only shows which way the hot air blows. - ― O'Henry -% -A student who changes the course of history is probably taking an -exam. -% -A successful tool is one that was used to do something undreamed of by -its author. - ― S. C. Johnson -% -A thing is worth precisely what it can do for you, not what you choose to -pay for it. - ― John Ruskin -% -A total abstainer is one who abstains from everything but abstention, -and especially from inactivity in the affairs of others. - ― Ambrose Bierce, "The Devil's Dictionary" -% -A truly wise man never plays leapfrog with a unicorn. -% -A university is what a college becomes when the faculty loses interest -in students. - ― John Ciardi -% -A vacuum is a hell of a lot better than some of the stuff that nature -replaces it with. - ― Tenessee Williams -% -A visit to a fresh place will bring strange work. -% -A visit to a strange place will bring fresh work. -% -A well adjusted person is one who makes the same mistake twice without -getting nervous. -% -A well-known friend is a treasure. -% -A witty saying proves nothing. - ― Voltaire -% -A woman without a man is like a fish without a bicycle. -% -A year spent in artificial intelligence is enough to make one believe in God. -% -Ada, n.: Something you need only know the name of to be an Expert in -computing. Useful in sentences like, "We had better develop an Ada -awareness." -% -Abandon hope, all ye who press "ENTER" here. -% -Ability is useless unless it is used. - ― Robert Half -% -About all some men accomplish in life is to send a son to Harvard. -% -About the only thing on a farm that has an easy time is the dog. -% -About the time we think we can make ends meet, somebody moves the ends. - ― Herbert Hoover -% -Above all things, reverence yourself. -% -Abstention makes the heart grow fonder. -% -Absurdity, n.: A statement or belief manifestly inconsistent with one's own -opinion. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Accident, n.: A condition in which presence of mind is good, but absence of -body is better. -% -According to my best recollection, I don't remember. - ― Vincent "Jimmy Blue Eyes" Alo -% -According to the latest official figures, 43% of all statistics are totally -worthless. -% -According to my scuba instructor, if a shark attacks, you're supposed to -poke it in the eye with your finger. After that, I suppose you should hit -it in the face with a cream pie, or maybe hose it down with a seltzer bottle. - ― Jerry L. Embry -% -Accordion: A bagpipe with pleats. -% -Accuracy: The vice of being right. -% -Acquaintance, n.: A person whom we know well enough to borrow from, but not -well enough to lend to. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Acting is an art which consists of keeping the audience from coughing. -% -Activity makes more men's fortunes than cautiousness. - ― Marquis de Vauvenargues -% -Actors will happen in the best-regulated families. -% -Ada is the work of an architect, not a computer scientist. - ― Jean Ichbiah, inventor of Ada, weenie -% -Adapt. Enjoy. Survive. -% -Adde parvum parvo magnus acervus erit. -[Add little to little and there will be a big pile.] - ― Ovid -% -Admiration, n.: Our polite recognition of another's resemblance to ourselves. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Adolescence: The stage between puberty and adultery. -% -Adore, v.: To venerate expectantly. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Adult: One old enough to know better. -% -Adversity makes men, prosperity monsters. - ― French Proverb -% -Advertisement: The most truthful part of a newspaper. - ― Thomas Jefferson -% -Advertising: The science of arresting the human intelligence long enough to -get money from it. - ― Stephen Leacock -% -After Goliath's defeat, giants ceased to command respect. - ― Freeman Dyson -% -After a number of decimal places, nobody gives a damn. -% -After all is said and done, a lot more has been said than done. -% -After all, what is your hosts' purpose in having a party? Surely not -for you to enjoy yourself; if that were their sole purpose, they'd have -simply sent champagne and women over to your place by taxi. - ― P. J. O'Rourke -% -After any machine or unit has been assembled, extra components will be -found on the bench. - ― "Industry at Work," Oilways, n2., 1972, pp. 16-17. Humble Oil - & Refining Company., Houston, TX -% -After the last of 16 mounting screws has been removed from an access cover, -it will be discovered that the wrong access cover has been removed. -% -After winning the pennant one year, Casey Stengel commented, "I couldn'ta -done it without my players." -% -Air is water with holes in it. -% -Alas, I am dying beyond my means. - ― Oscar Wilde, as he sipped champagne on his deathbed -% -Albert Einstein, when asked to describe radio, replied: "You see, wire -telegraph is a kind of a very, very long cat. You pull his tail in New -York and his head is meowing in Los Angeles. Do you understand this? And -radio operates exactly the same way: you send signals here, they receive -them there. The only difference is that there is no cat." -% -Alexander Graham Bell is alive and well in New York, and still waiting for a -dial tone. -% -Alimony and bribes will engage a large share of your wealth. -% -Alimony is a system by which, when two people make a mistake, one of -them keeps paying for it. - ― Peggy Joyce -% -All I ask is a chance to prove that money can't make me happy. -% -All I ask of life is a constant and exaggerated sense of my own importance. -% -All I kin say is when you finds yo'self wanderin' in a peach orchard, -ya don't go lookin' for rutabagas. - ― Kingfish -% -All a hacker needs is a tight PUSHJ, a loose pair of UUOs, and a warm -place to shift. -% -All great ideas are controversial, or have been at one time. -% -All happy families resemble one another, each unhappy in its own way. - ― Tolstoy -% -All in all it's just another brick in the wall. -% -All my life I wanted to be someone; I guess I should have been more specific. - ― Jane Wagner -% -All programmers are optimists. Perhaps this modern sorcery especially attracts -those who believe in happy endings and fairy godmothers. Perhaps the hundreds -of nitty frustrations drive away all but those who habitually focus on the end -goal. Perhaps it is merely that computers are young, programmers are younger, -and the young are always optimists. But however the selection process works, -the result is indisputable: "This time it will surely run," or "I just found -the last bug." - ― Frederick Brooks, Jr., The Mythical Man Month -% -All programmers are playwrights and all computers are lousy actors. -% -All progress is based upon a universal innate desire on the part of -every organism to live beyond its income. - ― Samuel Butler -% -All science is either physics or stamp collecting. - ― E. Rutherford -% -All that glitters has a high refractive index. -% -All the world's a stage and most of us are desperately unrehearsed. - ― Sean O'Casey -% -All things are possible except skiing through a revolving door. -% -All through human history, tyrannies have tried to enforce obedience by -prohibiting disrespect for the symbols of their power. The swastika is -only one example of many in recent history. - ― American Bar Association task force on flag burning -% -All true wisdom is found on T-shirts. -% -All wise men share one trait in common: the ability to listen. -% -Allen's Axiom: When all else fails, read the instructions. -% -Alliance, n.: In international politics, the union of two thieves who have -their hands so deeply inserted in each other's pocket that they cannot -separately plunder a third. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Although every American has a sense of humor―it is his birthright and -encoded somewhere in the Constitution―few Americans have never been able to -cope with wit or irony, and even the simplest jokes often cause unease, -especially today when every phrase must be examined for covert sexism, -racism, ageism. - ― Gore Vidal, "The Essential Mencken," The Nation, - August 26/September 2, 1991. -% -Always borrow money from a pessimist; he doesn't expect to be paid back. -% -Always make the audience suffer as much as possible. - ― Alfred Hitchcock -% -Ambidextrous, adj.: Able to pick with equal skill a right-hand pocket or a -left. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Ambition is a poor excuse for not having sense enough to be lazy. - ― Charlie McCarthy -% -America had often been discovered before Columbus; it had just been hushed up. - ― Oscar Wilde -% -America's best buy for a quarter is a telephone call to the right man. -% -America, how can I write a holy litany in your silly mood? - ― Allen Ginsberg -% -American Non Sequitur Society: We don't make sense. We like pizza. -% -Amnesia used to be my favorite word, but then I forgot it. -% -Among the chosen, you are the lucky one. -% -Among the lucky, you are the chosen one. -% -An American's a person who isn't afraid to criticize the President but -is always polite to traffic cops. -% -An Army travels on its stomach. -% -An Englishman never enjoys himself, except for a noble purpose. - ― A. P. Herbert -% -An economist is a man who states the obvious in terms of the incomprehensible. - ― Alfred A. Knopf -% -An effective way to deal with predators is to taste terrible. -% -An elephant is a mouse with an operating system. -% -An idea is not responsible for the people who believe in it. -% -An idle mind is worth two in the bush. -% -An intellectual is someone whose mind watches itself. - ― Albert Camus -% -An NT server can be run by an idiot, and usually is. - - Tom Holub - (Posted to comp.infosystems.www.servers.unix on 03 Sep 1997) -% -An object never serves the same function as its image―or its name. - ― Rene Magritte -% -An ounce of prevention is worth a pound of cure. - ― Benjamin Franklin -% -Anarchy may not be the best form of government, but it's better than no -government at all. -% -Anarchy: It's not the law, it's just a good idea. -% -And I alone am returned to wag the tail. -% -And now for something completely different. -% -And now that the legislators and the do-gooders have so futilely inflicted -so many systems upon society, may they end up where they should have begun: -may they reject all systems, and try liberty... - ― Frederic Bastiat -% -And on the seventh day, He exited from append mode. -% -And the Lord God said unto Moses ― and correctly, I believe ... - ― Field Marshal Montgomery, opening a chapel service -% -And the crowd was stilled. One elderly man, wondering at the sudden silence, -turned to the Child and asked him to repeat what he had said. Wide-eyed, -the Child raised his voice and said once again, "Why, the Emperor has no -clothes! He is naked!" - ― "The Emperor's New Clothes" -% -And there's hamburger all over the highway in Mystic, Connecticut. -% -And they told us, what they wanted... -Was a sound that could kill some-one, from a distance. - ― Kate Bush -% -And this is a table ma'am. What in essence it consists of is a horizontal -rectilinear plane surface maintained by four vertical columnar supports, -which we call legs. The tables in this laboratory, ma'am, are as advanced -in design as one will find anywhere in the world. - ― Michael Frayn, "The Tin Men" -% -And thou shalt eat it as barley cakes, and thou shalt bake it with dung that -cometh out of man, in their sight...Then he [the Lord!] said unto me, Lo, I -have given thee cow's dung for man's dung, and thou shalt prepare thy bread -therewith. [Ezek. 4:12-15 (KJV)] -% -Anger is a prelude to courage. - ― Eric Hoffer -% -Angular momentum makes the world go round. -% -Ankh if you love Isis. -% -Anoint, v.: To grease a king or other great functionary already sufficiently -slippery. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Another good night not to sleep in a eucalyptus tree. -% -Another one bites the dust. -% -Anthony's Law of Force: Do not force it; get a larger hammer. -% -Anthony's Law of the Workshop: Any tool when dropped, will roll into the - least accessible corner of the workshop. -Corollary: On the way to the corner, any dropped tool will first strike - your toes. -% -Antimatter doesn't matter as a matter of fact. - ― Piggins -% -Antiquis temporibus, nati tibi similes in rupibus ventosissimis exponebantur -ad necem. (In the good old days, children like you were left to perish on -windswept crags.) -% -Antonym, n.: The opposite of the word you're trying to think of. -% -Any clod can have the facts, but having opinions is an art. - ― Charles McCabe -% -Any excuse will serve a tyrant. - ― Aesop -% -Any fool can paint a picture, but it takes a wise man to be able to sell it. -% -Any fool can paint a picture, but it takes a wise person to be able to -sell it. -% -Any given program, when running correctly, is obsolete. -% -Any job worth quitting is worth sticking around long enough until they -fire you. - ― Tim Wirth -% -Any medium powerful enough to extend man's reach is powerful enough to topple -his world. To get the medium's magic to work for one's aims rather than -against them is to attain literacy. - ― Alan Kay, "Computer Software", Scientific American, September 1984 -% -Any shrine is better than self-worship. -% -Any small object that is accidentally dropped will hide under a -larger object. -% -Any small object when dropped will hide under a larger object. -% -Any smoothly functioning technology will have the appearance of magic. - ― Arthur C. Clarke -% -Any sufficiently advanced bureaucracy is indistinguishable from molasses. -% -Any sufficiently advanced stupidity is indistinguishable from malice. - ― Paul Chvostek by way of Arthur C. Clarke (via John Ripley) -% -Any sufficiently advanced technology is indistinguishable from a rigged demo. - ― Andy Finkel, computer guy -% -Any sufficiently advanced technology is indistinguishable from magic. - ― Arthur C. Clarke -% -Any two philosophers can tell each other all they know in two hours. - ― Oliver Wendell Holmes, Jr. -% -Anybody with money to burn will easily find someone to tend the fire. -% -Anyone can hate. It costs to love. - ― John Williamson -% -Anyone can hold the helm when the sea is calm. - ― Publilius Syrus -% -Anyone who cannot cope with mathematics is not fully human. At best he is a -tolerable subhuman who has learned to wear shoes, bathe and not make messes -in the house. - ― Lazarus Long, "Time Enough for Love" -% -Anyone who knows history, particularly the history of Europe, will, I think, -recognize that the domination of education or of government by any one -particular religious faith is never a happy arrangement for the people. - ― Eleanor Roosevelt -% -Anyone who wants to be paid for writing software is a fascist asshole. - ― Richard M. Stallman, founder, Free Software Foundation -% -Anything anybody can say about America is true. - ― Emmett Grogan -% -Anything free is worth what you pay for it. -% -Anything is possible if you don't know what you're talking about. -% -Anything labeled "NEW" and/or "IMPROVED" isn't. The label means the -price went up. The label "ALL NEW", "COMPLETELY NEW", or "GREAT NEW" -means the price went way up. -% -Anything worth doing is worth overdoing -% -Anytime things appear to be going better, you have overlooked something. -% -Arbolist . . . Look up the word. I don't know, maybe I made it up. Anyway, -it's an arbo-tree-ist, somebody who knows about trees. - ― George W. Bush, quoted in USA Today; August 21, 2001 -% -Are we not men? -% -Are you a turtle? -% -Arithmetic is being able to count up to twenty without taking off your shoes. - ― Mickey Mouse -% -Armadillo: To provide weapons to a Spanish pickle -% -army, n.: A body of men assembled to rectify the mistakes of the diplomats. - ― Josephus Daniels -% -Army Axiom: An order that can be misunderstood will be misunderstood. -% -Arnold's Laws of Documentation: - (1) If it should exist, it doesn't. - (2) If it does exist, it's out of date. - (3) Only documentation for useless programs transcends the first two laws. -% -Art is parasitic on life, just as criticism is parasitic on art. - ― Harry S Truman (one of his more ridiculous comments) -% -As Will Rogers would have said, "There is no such things as a free variable." -% -As Zeus said to Narcissus, "Watch yourself." -% -As far as we know, our computer has never had an undetected error. - ― Weisert -% -As goatherd learns his trade by goat, so writer learns his trade by wrote. -% -As long as the answer is right, who cares if the question is wrong? -% -As long as war is regarded as wicked, it will always have its fascination. -When it is looked upon as vulgar, it will cease to be popular. - ― Oscar Wilde -% -As regards the individual nature, woman is defective and misbegotten, for the -active power of the male seed tends to the production of a perfect likeness in -the masculine sex; while the production of a woman comes from defect in the -active power. - ― Thomas Aquinas, prominent historical misogynist -% -As soon as we started programming, we found to our surprise that it wasn't -as easy to get programs right as we had thought. Debugging had to be -discovered. I can remember the exact instant when I realized that a large -part of my life from then on was going to be spent in finding mistakes in -my own programs. - ― Maurice Wilkes discovers debugging, 1949 -% -As the poet said, "Only God can make a tree" ― probably because it's -so hard to figure out how to get the bark on. - ― Woody Allen -% -As the system comes up, the component builders will from time to time appear, -bearing hot new versions of their pieces ― faster, smaller, more complete, -or putatively less buggy. The replacement of a working component by a new -version requires the same systematic testing procedure that adding a new -component does, although it should require less time, for more complete and -efficient test cases will usually be available. - ― Frederick Brooks Jr., "The Mythical Man Month" -% -As the trials of life continue to take their toll, remember that there -is always a future in Computer Maintenance. - ― National Lampoon, "Deteriorada" -% -As to Jesus of Nazareth...I think the system of Morals and his Religion, -as he left them to us, the best the World ever saw or is likely to see; -but I apprehend it has received various corrupting Changes, and I have, -with most of the present Dissenters in England, some doubts as to his -divinity. - ― Benjamin Franklin -% -As with most fine things, chocolate has its season. There is a simple -memory aid that you can use to determine whether it is the correct time -to order chocolate dishes: any month whose name contains the letter A, -E, or U is the proper time for chocolate. - ― Sandra Boynton, "Chocolate: The Consuming Passion" -% -As you read the scroll it vanishes, -and you hear maniacal laughter in the distance. -% -Ashes to ashes, dust to dust, If God won't have you, the devil must. -% -Ask not for whom the telephone bell tolls ... if thou art in the bathtub, -it tolls for thee. -% -Ask your boss to reconsider ― it's so difficult to take "Go to hell" -for an answer. -% -Assuming that either the left wing or the right wing gained control of the -country, it would probably fly around in circles. - ― Pat Paulsen -% -At Group L, Stoffel oversees six first-rate programmers, a managerial -challenge roughly comparable to herding cats. - ― The Washington Post Magazine, June 9, 1985 -% -At a recent meeting in Snowmass, Colorado, a participant from Los Angeles -fainted from hyperoxygenation, and we had to hold his head under the -exhaust of a bus until he revived. -% -At first sight, the idea of any rules or principles being superimposed on -the creative mind seems more likely to hinder than to help, but this is -quite untrue in practice. Disciplined thinking focuses inspiration rather -than blinkers it. - ― G. L. Glegg, The Design of Design -% -At the heart of science is an essential tension between two seemingly -contradictory attitudes ― an openness to new ideas, no matter how bizarre -or counterintuitive they may be, and the most ruthless skeptical scrutiny -of all ideas, old and new. This is how deep truths are winnowed from deep -nonsense. Of course, scientists make mistakes in trying to understand the -world, but there is a built-in error-correcting mechanism: The collective -enterprise of creative thinking and skeptical thinking together keeps the -field on track. - ― Carl Sagan, "The Fine Art of Baloney Detection," Parade, - February 1, 1987 -% -At the source of every error which is blamed on the computer you will -find at least two human errors, including the error of blaming it on -the computer. -% -Athens built the Acropolis. Corinth was a commercial city, interested in -purely materialistic things. Today we admire Athens, visit it, preserve the -old temples, yet we hardly ever set foot in Corinth. - ― Dr. Harold Urey, Nobel Laureate in chemistry -% -Atlee is a very modest man. And with reason. - ― Winston Churchill -% -Auribus teneo lupum. (I hold a wolf by the ears.) -% -Automobile, n.: A four-wheeled vehicle that runs up hills and down pedestrians. -% -Automobile: A four-wheeled vehicle that runs up hills and down pedestrians. -% -Average managers are concerned with methods, opinions, precedents. -Good managers are concerned with solving problems. -% -Avoid Quiet and Placid persons unless you are in Need of Sleep. - ― National Lampoon, "Deteriorada" -% -Avoid letting temper block progress; keep cool. - ― William Feather -% -Back off, man. I'm a scientist. -% -Badges? We don't need no stinking badges. -% -Bagdikian's Observation: - Trying to be a first-rate reporter on the average American - newspaper is like trying to play Bach's "St. Matthew Passion" - on a ukelele. -% -Bad sneakers and a piña colada, my friend -Stompin' down the avenue by Radio City -With a transistor and a large sum of money to spend. - ― Steely Dan -% -Baker's First Law of Federal Geometry: - A block grant is a solid mass of money surrounded on all sides - by governors. -% -Barth's Distinction: There are two types of people: those who divide people -into two types, and those who don't. -% -Basic, n.: A programming language. Related to certain social diseases in - that those who have it will not admit it in polite company. -% -Be assured that a walk through the ocean of most Souls would scarcely get -your Feet wet. Fall not in Love, therefore: it will stick to your face. - ― National Lampoon, "Deteriorada" -% -Be careful when a loop exits to the same place from side and bottom. -% -Be different: conform. -% -Be regular and orderly in your life so that you may be violent and original -in your work. - ― Gustave Flaubert -% -Be seeing you. -% -Beauty and harmony are as necessary to you as the very breath of life. -% -Beauty is only skin deep, but Ugly goes straight to the bone. -% -Bees are not as busy as we think they are; they just cannot buzz any slower. - ― Abe Martin -% -Behind every argument is someone's ignorance. - ― Louis Brandeis -% -Behold the warranty: The bold print giveth and the fine print taketh away. -% -Beifeld's Principle: The probability of a young man meeting a desirable and -receptive young female increases by pyramidal progression when he is -already in the company of: (1) a date, (2) his wife, (3) a better looking -and richer male friend. -% -Being stoned on marijuana isn't very different from being stoned on gin. - ― Ralph Nader -% -Berkeley's First Law of Mistakes: The moment you have worked out an answer, -start checking it―it probably isn't right. -% -Corollary 1 to Berkeley's First Law of Mistakes: Always let an answer cool -off for awhile―it should not be used while hot. -% -Corollary 2 to Berkeley's First Law of Mistakes: Check the answer you have -worked out once more―before you tell it to anybody. -% -Berkeley's Second Law of Mistakes: If there is an opportunity to make a -mistake, sooner or later, the mistake will be made. -% -Better living a beggar than buried an emperor. -% -Between the choice of two evils, I always pick the one I've never tried before. - ― Mae West -% -Between the legs of the women walking by, the dadaists imagined a monkey -wrench and the surrealists a crystal cup. That's lost. - ― Ivan Chtcheglov -% -Beware of bugs in the above code; I have only proved it correct, not tried it. - ― Donald Knuth -% -Beware of Geeks bearing grifts. -% -Beware of Programmers who carry screwdrivers. - ― Leonard Brandwein -% -Beware of a dark-haired man with a loud tie. -% -Beware of a tall dark man with a spoon up his nose. -% -Beware of all enterprises that require new clothes. -% -Beware of friends who are false and deceitful. -% -Beware of low-flying butterflies. -% -Beware of the Turing Tar-pit in which everything is possible but -nothing of interest is easy. -% -Beware the new TTY code! -% -Biggest security gap - an open mouth. -% -Bingo, gas station, hamburger with a side order of airplane noise, -and you'll be Gary, Indiana. - Jessie in the movie "Greaser's Palace" -% -Biography is the fallacy of intention. - ― Peter Taylor -% -Biology ... it grows on you. -% -Birth, n.: The first and direst of all disasters. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Bizarreness is the essence of the exotic -% -Black holes are where God is dividing by zero. -% -Blah. -% -Bleeding into a new computer is always a good thing; it's an ancient geek -voodoo magic to ensure its long life and reliability. - ― from Mike Taht's blog, http://the-edge.blogspot.com/ -% -Blessed are the meek for they shall inhibit the earth. -% -Blessed are they who Go Around in Circles, for they Shall be Known as Wheels. -% -Blessed is the man who is too busy to worry in the daytime and too sleepy to -worry at night. - ― Leo Aikman -% -Blood is thicker than water, and much tastier. -% -Board the windows, up your car insurance, and don't leave any booze in -plain sight. It's St. Patrick's day in Chicago again. The legend has it -that St. Patrick drove the snakes out of Ireland. In fact, he was arrested -for drunk driving. The snakes left because people kept throwing up on -them. -% -Boling's postulate: If you're feeling good, don't worry. You'll get over it. -% -Bolub's Fourth Law of Computerdom: - Project teams detest weekly progress reporting because it so - vividly manifests their lack of progress. -% -Bombeck's Rule of Medicine: Never go to a doctor whose office plants have died. -% -Bond reflected that good Americans were fine people and that most of them -seemed to come from Texas. - ― Ian Fleming, "Casino Royale" -% -Boob's Law: You always find something in the last place you look. -% -Bore, n.: A person who talks when you wish him to listen. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Boren's Laws: - (1) When in charge, ponder. - (2) When in trouble, delegate. - (3) When in doubt, mumble. -% -Boss, n.: - According to the Oxford English Dictionary, in the Middle Ages -the words "boss" and "botch" were largely synonymous, except that boss, -in addition to meaning "a supervisor of workers" also meant "an -ornamental stud." -% -Boston, n.: - Ludwig van Beethoven being jeered by 50,000 sports fans for - finishing second in the Irish jig competition. -% -Boy, n.: - A noise with dirt on it. -% -Bradley's Bromide: If computers get too powerful, we can organize them into a -committee. that will do them in. -% -Bradley's Bromide: If computers get too powerful, we can organize them into a -committee. That will do them in. -% -Brady's First Law of Problem Solving: When confronted by a difficult -problem, you can solve it more easily by reducing it to the question, "How -would the Lone Ranger have handled this?" -% -Brain fried ― core dumped -% -Brain, n.: The apparatus with which we think that we think. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Brain, v. [as in "to brain"]: - To rebuke bluntly, but not pointedly; to dispel a source of -error in an opponent. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Bride, n.: A woman with a fine prospect of happiness behind her. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Bride: A woman with a fine prospect of happiness behind her. -% -Bringing computers into the home won't change either one, but may -revitalize the corner saloon. -% -Broad-mindedness: The result of flattening high-mindedness out. -% -Brook's Law: - Adding manpower to a late software project makes it later. -% -Brooke's Law: - Whenever a system becomes completely defined, some damn fool - discovers something which either abolishes the system or - expands it beyond recognition. -% -Bubble Memory, n.: - A derogatory term, usually referring to a person's - intelligence. See also "vacuum tube". -% -Bucy's Law: Nothing is ever accomplished by a reasonable man. -% -Bug: Small living things that small living boys throw on small living girls. -% -Bumper Sticker: Insanity is hereditary; you get it from your children. -% -Bumper sticker on nuclear war: if you have seen one, you have seen them all. -% -Bunk Carter's Law: At any given moment there are more important people in -the world than important jobs to contain them. -% -Bureaucracy is a giant mechanism operated by pygmies. - ― Balzac -% -Bureaucrat, n.: A politician who has tenure. -% -Bureaucrats cut read tape ― length-wise. -% -Burnt Sienna: That's the best thing that ever happened to Crayolas. - ― Ken Weaver -% -Business will be either better or worse. - ― Calvin Coolidge -% -But in our enthusiasm, we could not resist a radical overhaul of the -system, in which all of its major weaknesses have been exposed, -analyzed, and replaced with new weaknesses. - ― Bruce Leverett, "Register Allocation in Optimizing Compilers" -% -By doing just a little every day, I can gradually let the task completely -overwhelm me. - ― Ashleigh Brilliant -% -By doing just a little every day, you can gradually let the task -completely overwhelm you. -% -By long-standing tradition, I take this opportunity to savage other -designers in the thin disguise of good, clean fun. - ― P. J. Plauger, from his April Fool's column in the April 1988 - issue of "Computer Language" -% -By one count there are some 700 scientists with respectable academic -credentials (out of a total of 480,000 U.S. earth and life scientists) who -give credence to creation-science, the general theory that complex life -forms did not evolve but appeared "abruptly." - ― Newsweek, June 29, 1987, pg. 23 -% -C, n.: A programming language that is sort of like Pascal except more like -assembly except that it isn't very much like either one, or anything else. -It is either the best language available to the art today, or it isn't. - ― Ray Simard -% -C++ : Where friends have access to your private members. - ― Gavin Russell Baker -% -CChheecckk yyoouurr dduupplleexx sswwiittcchh.. - ― Randall Garrett -% -Cabbage, n.: A familiar kitchen-garden vegetable about as large and wise as -a man's head. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Cabbage: A familiar kitchen-garden vegetable about as large and wise -as a man's head. -% -Caeca invidia est. (Envy is blind.) - ― Livy -% -Cahn's Axiom: When all else fails, read the instructions. -% -California is a fine place to live ― if you happen to be an orange. - ― Fred Allen -% -California is the ghost of Christmas future for the rest of America. - ― anonymous post to an Internet forum -% -California is the land of perpetual pubescence, where cultural lag is -mistaken for renaissance. - ― Ashley Montagu -% -Call on God, but row away from the rocks. - ― Indian proverb -% -Can anyone remember when the times were not hard, and money not scarce? -% -Can anything be sadder than work left unfinished? Yes, work never begun. -% -Cannot fork ― try again. -% -Cannot fortune open database. -% -Captain Penny's Law: You can fool all of the people some of the time, -and some of the people all of the time, but you can't fool Mom. -% -Carelessly planned projects take three times longer to complete than -expected. Carefully planned projects take four times longer to -complete than expected, mostly because the planners expect their -planning to reduce the time it takes. -% -Carperpetuation (kar' pur pet u a shun), n.: - The act, when vacuuming, of running over a string at least a -dozen times, reaching over and picking it up, examining it, then -putting it back down to give the vacuum one more chance. - ― Rich Hall, "Sniglets" -% -Catch a wave and you're sitting on top of the world. -% -Certain old men prefer to rise at dawn, taking a cold bath and a long walk -with an empty stomach and otherwise mortifying the flesh. They then point -with pride to these practices as the cause of their sturdy health and ripe -years; the truth being that they are hearty and old, not because of their -habits, but in spite of them. The reason we find only robust persons doing -this thing is that it has killed all the others who have tried it. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Change is what people fear most. - ― Dostoevski -% -Change your thoughts and you change your world. -% -Character Density: the number of very weird people in the office. -% -Character is the ligament holding together all other qualities. - ― Arnold Glasow -% -Chemicals, n.: Noxious substances from which modern foods are made. -% -Chicken Little was right. -% -Children are natural mimics who act like their parents despite every effort -to teach them good manners. -% -Children aren't happy without something to ignore, -And that's what parents were created for. - ― Ogden Nash -% -Children begin by loving their parents. After a time they judge them. Rarely, -if ever, do they forgive them. - ― Oscar Wilde -% -Children have more need of models than of critics. -% -Children seldom misquote you. In fact, they usually repeat word for -word what you shouldn't have said. -% -Chism's Law of Completion: - The amount of time required to complete a government project is - precisely equal to the length of time already spent on it. -% -Chisolm's First Corollary to Murphy's Second Law: - When things just can't possibly get any worse, they will. -% -Civilisation is the art of living in towns of such size that everyone does -not know everyone else. - ― Julian Jaynes -% -Civilization Law #1: Civilization advances by extending the number of -important operations one can do without thinking about them. -% -Civilization is a movement, not a condition; it is a voyage, not a harbor. - ― Toynbee -% -Civilization is the progress toward a society of privacy. - ― Howard Roark, in Ayn Rand's _The Fountainhead_ -% -[Classical music] would be a lot more popular if they gave the pieces titles -like "Kill the Wabbit." - ― Mark Fetherolf. -% -Classified material requires proper storage. -% -Cleanliness is next to impossible. -% -Cogito cogito ergo cogito sum ― -"I think that I think, therefore I think that I am." - ― Ambrose Bierce, "The Devil's Dictionary" -% -Cogito ergo doleo. (I think, therefore I am depressed.) -% -Cogito ergo sum. -% -Cohen's Law: Everyone knows that the name of the game is what label you -succeed in imposing on the facts. -% -Collaboration, n.: A literary partnership based on the false assumption -that the other fellow can spell. -% -College isn't the place to go for ideas. - ― Hellen Keller -% -Colorless green ideas sleep furiously. -% -Come to think of it, there are already a million monkeys on a million -typewriters, and Usenet is nothing like Shakespeare. - ― Blair Houghton -% -Commitment, n.: Commitment can be illustrated by a breakfast of ham and -eggs. The chicken was involved, the pig was committed. -% -Common sense in an uncommon degree is what the world calls wisdom. - ― Samuel Taylor Coleridge -% -Complacency is the enemy of progress. - ― Dave Stutman -% -Computer Science is merely the post-Turing decline in formal systems theory. -% -Computer Science: the boring art of coping with a large number of trivialities -(The Devil's DP Dictionary) -% -Computer literacy is a contact with the activity of computing deep enough to -make the computational equivalent of reading and writing fluent and enjoyable. -As in all the arts, a romance with the material must be well under way. If -we value the lifelong learning of arts and letters as a springboard for -personal and societal growth, should any less effort be spent to make computing -a part of our lives? - ― Alan Kay, "Computer Software", Scientific American, September 1984 -% -Conceit causes more conversation than wit. - ― LaRouchefoucauld -% -Concept, n.: Any "idea" for which an outside consultant billed you more than -$25,000. -% -Conceptual integrity in turn dictates that the design must proceed from one -mind, or from a very small number of agreeing resonant minds. - ― Frederick Brooks Jr., "The Mythical Man Month" -% -Confession is good for the soul only in the sense that a tweed coat is -good for dandruff. - ― Peter de Vries -% -Confidence is the feeling you have before you understand the situation. -% -Confound these ancestors.... They've stolen our best ideas! - ― Ben Jonson -% -Confusticate and bebother these dwarves! -% -Conscience is what hurts when everything else feels so good. -% -Conservative, n.: One who admires radicals centuries after they're dead. - ― Leo C. Rosten -% -Consultants are mystical people who ask a company for a number and then -give it back to them. -% -Controlling complexity is the essence of computer programming. - ― Brian W. Kernighan -% -Conversation, n.: A vocal competition in which the one who is catching his -breath is called the listener. -% -Conway's Law: Any piece of software reflects the organizational structure -that produced it. -% -Coronation, n.: The ceremony of investing a sovereign with the outward and -visible signs of his divine right to be blown sky-high with a dynamite bomb. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Corporation, n. An ingenious device for obtaining individual profit -without individual responsibility. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Corripe Cervisiam! -% -Corrupt, adj.: In politics, holding an office of trust or profit. -% -Corruption is not the #1 priority of the Police Commissioner. His job -is to enforce the law and fight crime. - ― P.B.A. President E. J. Kiernan -% -Courage is grace under pressure. -% -Coward, n.: One who in a perilous emergency thinks with his legs. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Crash programs fail because they are based on the theory that, with -nine women pregnant, you can get a baby a month. - ― Wernher von Braun -% -Creativity cannot be diminished by the medium of expression. - ― Mitch Allen -% -Creationists make it sound as though a "theory" is something you dreamt up -after being drunk all night. - ― Isaac Asimov -% -Creditors have better memories than debtors. - ― Benjamin Franklin, Poor Richard's Almanack (1758) -% -Crime does not pay ... as well as politics. - ― A. E. Newman -% -Criminal: A person with predatory instincts who has not sufficient capital -to form a corporation. - ― Howard Scott -% -Critic, n.: A person who boasts himself hard to please because nobody tries -to please him. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Cudgel thy brains no more about it, for your dull ass will not mend his -pace with beating. - ― Hamlet, Act 5, Scene 1 -% -Culture is the habit of being pleased with the best and knowing why. -% -Cynic, n.: A blackguard whose faulty vision sees things as they are, not -as they ought to be. Hence the custom among the Scythians of plucking -out a cynic's eyes to improve his vision. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Cynic, n.: One who looks through rose-colored glasses with a jaundiced eye. -% -Daring ideas are like chessmen moved forward, -they may be beaten, but they may start a winning game. - ― J. W. von Goethe -% -Dawn, n.: The time when men of reason go to bed. - ― Ambrose Bierce, "The Devil's Dictionary" -% -De Borglie rules the wave, but Heisenberg waived the rules. - ― Piggins -% -Dealing with failure is easy: work hard to improve. Success is also easy to -handle: you've solved the wrong problem. Work hard to improve. -% -Death is God's way of telling you not to be such a wise guy. -% -Death is Nature's way of recycling human beings. -% -Death is Nature's way of saying, "slow down". -% -Death is life's way of telling you you've been fired. - ― R. Geis -% -Death: to stop sinning suddenly. -% -Debugging is anticipated with distaste, performed with reluctance, and bragged -about forever. - ― button at the Boston Computer Museum -% -Debugging is twice as hard as writing the code in the first place. -Therefore, if you write the code as cleverly as possible, you are―by -definition―not smart enough to debug it. - ― Brian Kernighan -% -Decisionmaker, n.: The person in your office who was unable to form a task -force before the music stopped. - -% -Decisions of the judges will be final unless shouted down by a really -overwhelming majority of the crowd present. Abusive and obscene language -may not be used by contestants when addressing members of the judging -panel, or, conversely, by members of the judging panel when addressing -contestants (unless struck by a boomerang). - ― Mudgeeraba Creek Emu-Riding and Boomerang-Throwing Association -% -Decisions terminate panic. -% -Deliberation, n.: The act of examining one's bread to determine which side it -is buttered on. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Democracy is a form of government in which it is permitted to wonder -aloud what the country could do under first-class management. - ― Senator Soaper -% -Democracy is a form of government that substitutes election by the -incompetent many for appointment by the corrupt few. - ― G. B. Shaw -% -Democracy is four wolves and a lamb, voting on what to have for lunch. -% -Democracy is the recurrent suspicion that more than half of the people -are right more than half of the time. - ― E. B. White -% -Denniston's Law: Virtue is its own punishment. -% -Deprive a mirror of its silver, and even the Czar won't see his face. -% -Der Unterschied zwischen Genie und Wahnsinn liegt nur im Erfolg. -[The only difference between genius and insanity is the success.] -% -Did I forget to mention, forget to mention Memphis? -Home of Elvis and the ancient Greeks. -Do I smell? I smell home cooking. -It's only the river, it's only the river. - ― Talking Heads (Cities) -% -Did you know gullible is not in the dictionary? -% -Different all twisty a of in maze are you, passages little. -% -Digital computers are themselves more complex than most things people build: -They have very large numbers of states. This makes conceiving, describing, -and testing them hard. Software systems have orders-of-magnitude more states -than computers do. - ― Fred Brooks, Jr. -% -Dimensions will always be expressed in the least usable term. -Velocity, for example, will be expressed in furlongs per fortnight. -% -Diplomacy is the art of extricating oneself from a situation that tact -would have prevented in the first place. -% -Diplomacy is the art of saying "nice doggy" until you can find a rock. -% -Disc space ― the final frontier! -% -Disco is to music what Etch-A-Sketch is to art. -% -Discovery consists in seeing what everyone else has seen and thinking what no -one else has thought. - ― Albert Szent-Gyorgi -% -Distress, n.: A disease incurred by exposure to the prosperity of a friend. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Do not allow this language (Ada) in its present state to be used in -applications where reliability is critical, i.e., nuclear power stations, -cruise missiles, early warning systems, anti-ballistic missle defense -systems. The next rocket to go astray as a result of a programming language -error may not be an exploratory space rocket on a harmless trip to Venus: -It may be a nuclear warhead exploding over one of our cities. An unreliable -programming language generating unreliable programs constitutes a far -greater risk to our environment and to our society than unsafe cars, toxic -pesticides, or accidents at nuclear power stations. - ― C. A. R. Hoare -% -Do not merely believe in miracles, rely on them. -% -Do not clog intellect's sluices with bits of knowledge of questionable uses. -% -Do not compromise yourself; you are all you have got. - ― Janis Joplin -% -Do not take life too seriously; you will never get out of it alive. -% -Do not try to solve all life's problems at once ― learn to dread each -day as it comes. - ― Donald Kaul -% -Do not underestimate the value of print statements for debugging. -Don't have aesthetic convulsions when using them, either. -% -Do you realize how many holes there could be if people would just take -the time to take the dirt out of them? -% -Documentation is like sex: when it is good, it is very, very good; and -when it is bad, it is better than nothing. - ― Dick Brandon -% -Documentation is the castor oil of programming. Managers know it must -be good because the programmers hate it so much. -% -Don't be overly suspicious where it's not warranted. -% -Don't believe everything you hear or anything you say. -% -Don't comment bad code: rewrite it. -% -Don't compare floating point numbers solely for equality. -% -Don't crush that dwarf, hand me the pliers. -% -Don't diddle code to make it faster, find a better algorithm. -% -Dobbin's Law: When in doubt, use a bigger hammer. -% -Don't get suckered in by the comments ― they can be terribly misleading. -Debug only code. - ― Dave Storer -% -Don't knock President Fillmore. He kept us out of Vietnam. -% -Don't learn the tricks of the trade, learn the trade. -% -Don't let your mouth write no check that your tail can't cash. - ― Bo Diddley -% -Don't look back, the lemmings are gaining on you. -% -Don't put off for tomorrow what you can do today, because if you enjoy -it today you can do it again tomorrow. -% -Don't tell me how hard you work. Tell me how much you get done. - ― James J. Ling -% -Don't try to outweird me, three-eyes. I get stranger things than you free -with my breakfast cereal. - ― Zaphod Beeblebrox -% -Don't worry about the world coming to an end today. It's already -tomorrow in Australia. - ― Charles Schultz -% -Don't worry about things that you have no control over, because you have no -control over them. Don't worry about things that you have control over, -because you have control over them. - ― Mickey Rivers -% -Don't worry about what other people are thinking about you. They're too -busy worrying about what you are thinking about them. -% -Doubt is not a pleasant condition, but certainty is absurd. - ― Voltaire -% -Doubt isn't the opposite of faith; it is an element of faith. - ― Paul Tillich, German theologian and historian -% -Doubts and jealousies often beget the facts they fear. - ― Thomas Jefferson -% -Down with categorical imperative! -% -Drawing on my fine command of language, I said nothing. -% -Ducharme's Axiom: If you view your problem closely enough you will recognize -yourself as part of the problem. -% -Ducharme's Precept: Opportunity always knocks at the least opportune moment. -% -Duct tape is like the force. It has a light side, and a dark side, and -it holds the universe together ... - ― Carl Zwanzig -% -Due to a shortage of devoted followers, the production of great leaders -has been discontinued. -% -Due to circumstances beyond your control, you are master of your fate -and captain of your soul. -% -Dum excusare credis, accusas. (When you believe you are excusing yourself, -you are accusing yourself.) - ― St. Jerome -% -Dunne's Law: The territory behind rhetoric is too often mined with -equivocation. -% -During almost fifteen centuries the legal establishment of Christianity has -been upon trial. What has been its fruits? More or less, in all places, -pride and indolence in the clergy; ignorance and servility in the laity; -in both, superstition, bigotry, and persecution. - ― James Madison -% -Dying is a very dull, dreary affair. And my advice to you is to -have nothing whatever to do with it. - ― W. Somerset Maughm -% -E Pluribus Unix -% -Each honest calling, each walk of life, has its own elite, its own aristocracy -based on excellence of performance. - ― James Bryant Conant -% -Each team building another component has been using the most recent tested -version of the integrated system as a test bed for debugging its piece. Their -work will be set back by having that test bed change under them. Of course it -must. But the changes need to be quantized. Then each user has periods of -productive stability, interrupted by bursts of test-bed change. This seems -to be much less disruptive than a constant rippling and trembling. - ― Frederick Brooks Jr., "The Mythical Man Month" -% -Economics is extremely useful as a form of employment for economists. - ― John Kenneth Galbraith -% -Economics, n.: Economics is the study of the value and meaning of J. K. -Galbraith ... - ― Mike Harding, "The Armchair Anarchist's Almanac" -% -Economy makes men independent. -% -Education has produced a vast population able to read but unable to distinguish -what is worth reading. - ― G. M. Trevelyan -% -Education helps earning capacity. Ask any college professor. -% -Een schip op het strand is een baken in zee. -[A ship on the beach is a lighthouse to the sea.] - ― Dutch Proverb -% -Eeny Meeny, Jelly Beanie, the spirits are about to speak. - ― Bullwinkle Moose -% -Eggheads unite! You have nothing to lose but your yolks. - ― Adlai Stevenson -% -Egotism is the anesthetic given by a kindly nature to relieve the pain -of being a damned fool. - ― Bellamy Brooks -% -Egotism is the anesthetic that dulls the pain of stupidity. - ― Frank Leahy -% -Egotist, n.: A person of low taste, more interested in himself than in me. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Ehrman's Commentary: - 1. Things will get worse before they get better. - 2. Who said things would get better? -% -Eighty percent of air pollution comes from plants and trees. - ― Ronald Reagan, famous movie star -% -Einstein argued that there must be simplified explanations of nature, because -God is not capricious or arbitrary. No such faith comforts the software -engineer. - ― Fred Brooks, Jr. -% -Either do not attempt at all, or go through with it. - ― Ovid -% -Either that wallpaper goes, or I do. - ― Oscar Wilde's last words -% -Electrocution: Burning at the stake with all the modern improvements. -% -Elevators smell different to midgets -% -Eloquence is vehement simplicity. - ― Cecil -% -Emersons' Law of Contrariness: Our chief want in life is somebody who shall -make us do what we can. Having found them, we shall then hate them for it. -% -Endless Loop: n., see Loop, Endless. -Loop, Endless: n., see Endless Loop. - ― Random Shack Data Processing Dictionary -% -Enjoy your life; be pleasant and gay, like the birds in May. -% -Entropy isn't what it used to be. -% -Envy always implies conscious inferiority wherever it resides. - ― Pliny -% -Enzymes are things invented by biologists that explain things which -otherwise require harder thinking. - ― Jerome Lettvin -% -Equal bytes for women. -% -Eschew obfuscatory digressiveness. - ― Barry Dancis (1983) -% -Eternal nothingness is fine if you happen to be dressed for it. - ― Woody Allen -% -Ettore's observation: the other line moves faster. -% -Etymology, n.: Some early etymological scholars came up with derivations that -were hard for the public to believe. The term "etymology" was formed -from the Latin "etus" ("eaten"), the root "mal" ("bad"), and "logy" -("study of"). It meant "the study of things that are hard to swallow." - ― Mike Kellen -% -Even a cabbage may look at a king. -% -Even a hawk is an eagle among crows. -% -Even if you can deceive people about a product through misleading statements, -sooner or later the product will speak for itself. - ― Hajime Karatsu -% -Even if you do learn to speak correct English, whom are you going to -speak it to? - ― Clarence Darrow -% -Even the boldest zebra fears the hungry lion. -% -Even the future comes one day at a time. - ― W. Woodhouse -% -Even the smallest candle burns brighter in the dark. -% -Even though they raised the rate for first class mail in the United -States we really shouldn't complain ― it's still only 2 cents a day. -% -Ever notice that even the busiest people are never too busy to tell you -just how busy they are. -% -Ever wander around the web, look at discussions, totally agree with one of -the points of view, and then notice it was posted under one of your web -aliases 5 years ago? - ― Larry Weber -% -Every 4 seconds a woman has a baby. Our problem is to find this woman -and stop her. -% -Every Horse has an Infinite Number of Legs (proof by intimidation): -Horses have an even number of legs. Behind they have two legs, and in -front they have fore-legs. This makes six legs, which is certainly an -odd number of legs for a horse. But the only number that is both even -and odd is infinity. Therefore, horses have an infinite number of -legs. Now to show this for the general case, suppose that somewhere, -there is a horse that has a finite number of legs. But that is a horse -of another color, and by the [above] lemma ["All horses are the same -color"], that does not exist. -% -Every Solidarity center had piles and piles of paper .... everyone was -eating paper and a policeman was at the door. Now all you have to do is -bend a disk. - ― an anonymous member of the outlawed Polish trade union, Solidarity, - commenting on the benefits of using computers in support of their - movement -% -Every absurdity has a champion to defend it. -% -Every creature has within him the wild, uncontrollable urge to punt. -% -Every gun that is made, every warship launched, every rocket fired -signifies in the final sense, a theft from those who hunger and are not -fed, those who are cold and are not clothed. This world in arms is not -spending money alone. It is spending the sweat of its laborers, the -genius of its scientists, the hopes of its children. This is not a way -of life at all in any true sense. Under the clouds of war, it is -humanity hanging on a cross of iron. - ― Dwight Eisenhower, April 16, 1953 -% -Every institution I've ever been associated with has tried to screw me. - ― Stephen Wolfram -% -Every little picofarad has a nanohenry all its own. - ― Don Vonada -% -Every man is as God made him, ay, and often worse. - ― Miguel de Cervantes -% -Every program has at least one bug and can be shortened by at least one -instruction ― from which, by induction, one can deduce that every -program can be reduced to one instruction which doesn't work. -% -Every program has two purposes ― one for which it was written and another -for which it wasn't. -% -Every program is a part of some other program, and rarely fits. -% -Every purchase has its price. -% -Every silver lining has a cloud around it. -% -Every solution breeds new problems. -% -Every successful person has had failures, but repeated failure is no -guarantee of eventual success. -% -Every word is like an unnecessary stain on silence and nothingness. - ― Beckett -% -Everything is better with no people. - ― Bob "Biff" Rendar -% -Dykstra's Law: Everybody is somebody else's weirdo. -% -Everything is controlled by a small evil group to which, unfortunately, -no one we know belongs. -% -Everything to excess! Moderation is for monks. - ― Lazarus Long -% -Everything you know is wrong. - ― The Firesign Theater -% -Everything you've learned in school as "obvious" becomes less and less -obvious as you begin to study the universe. For example, there are no -solids in the universe. There's not even a suggestion of a solid. There -are no absolute continuums. There are no surfaces. There are no straight -lines. - ― R. Buckminster Fuller -% -Everything should be built top-down, except the first time. -% -Evolution is a bankrupt speculative philosophy, not a scientific fact. -Only a spiritually bankrupt society could ever believe it. ... Only -atheists could accept this Satanic theory. - ― Rev. Jimmy Swaggart, "The Pre-Adamic Creation and Evolution" -% -Evolution does not require the nonexistence of God, it merely allows for -it. That alone is enough to evoke condemnation from those who fear the -nonexistence of God more than they fear God Himself. - ― Keith Doyle, in talk.origins -% -Evolution is both fact and theory. Creationism is neither. - ― Anonymous -% -Exactitude in small matters is the essence of discipline. -% -Example is the school of mankind, and they will learn at no other. -% -Excellent day to have a rotten day. -% -Excellent time to become a missing person. -% -Excess on occasion is exhilarating. It prevents moderation from -acquiring the deadening effect of a habit. - ― W. Somerset Maugham -% -Excessive login or logout messages are a sure sign of senility. -% -Excuse me while I change into something more formidable. -% -Executive ability is prominent in your make-up. -% -Expense Accounts, n.: Corporate food stamps. -% -Experience is a dear teacher, but fools will learn at no other. - ― Poor Richard's Almanac -% -Experience is something you don't get until just after you need it. - ― Olivier -% -Experience is that marvelous thing that enables you recognize a mistake when -you make it again. - ― Franklin P. Jones -% -Experience is the worst teacher. It always gives the test first and -the instructions afterward. -% -Experience is what causes a person to make new mistakes instead of old ones. -% -Experience is what you get when you were expecting something else. -% -Extreme good-naturedness borders on weakness of character. Avoid it. -% -Extremes of fortune are fatal to folks of small dimensions. - ― Arnold Glasow -% -FLASH! Intelligence of mankind decreasing. Details at ... uh, when -the little hand is on the .... -% -Facts do not cease to exist because they are ignored. -% -Facts are simple and facts are straight / Facts are lazy and facts are late. -Facts all come with points of view / Facts don't do what I want them to. -Facts just twist the truth around / Facts are living turned inside out. -Facts are getting the best of them / Facts are nothing on the face of things. -Facts don't stain the furniture / Facts go out and slam the door. -Facts are written all over your face / Facts continue to change their shape. - ― Talking Heads -% -Failing to get them to do it your way might mean they're stupid, but it also -means you failed to get them to do it your way. - ― Cal Keegan -% -Failure is more frequently from want of energy than want of capital. -% -Failure is not an option. It comes bundled with your Microsoft product. - ― Ferenc Mantfeld -% -Faire de la bonne cuisine demande un certain temps. Si on vous fait attendre, -c'est pour mieux vous servir, et vous plaire. -[Good cooking takes time. If you are made to wait, it is to serve you better, -and to please you.] - ― Menu of Restaurant Antoine, New Orleans - [Also, what we're going to be telling our customers] -% -Fairy Tale: A horror story to prepare children for the newspapers. -% -Falling in love makes smoking pot all day look like the ultimate in restraint. - ― Dave Sim, author of "Cerberus the Aardvark" -% -Familiarity breeds attempt -% -Familiarity breeds children. -% -Familiarity breeds contempt. -% -Families, when a child is born/Want it to be intelligent. -I, through intelligence,/Having wrecked my whole life, -Only hope the baby will prove/Ignorant and stupid. -Then he will crown a tranquil life/By becoming a Cabinet Minister - ― Su Tung-p'o -% -Fanaticism consists of redoubling your efforts when you have forgotten your -aim. - ― Santayana -% -Fantasy, abandoned by reason, produces impossible monsters; -united with it, she is the mother of the arts and the origin of marvels. - ― Goya -% -Far better it is to dare mighty things, to win glorious triumphs, even though -checkered by failure, than to take rank with those poor spirits who neither -enjoy much nor suffer much, because they live in the gray twilight that knows -not victory or defeat. - ― Theodore Roosevelt -% -Far duller than a serpent's tooth it is to spend a quiet youth. - -% -Fashion is a form of ugliness so intolerable that we have to alter it -every six months. - ― Oscar Wilde -% -Felson's Law: To steal ideas from one person is plagiarism; to steal from -many is research. -% -Fidelity: A virtue peculiar to those who are about to be betrayed. -% -Field theories, unite! -% -Finagle's Creed: Science is true. Don't be misled by facts. -% -Finagle's First Law: If an experiment works, something has gone wrong. -% -Finagle's Second Law: Once a job is fouled up, anything done to improve it -only makes it worse. -% -Finding the occasional straw of truth awash in a great ocean of confusion and -bamboozle requires intelligence, vigilance, dedication and courage. But if we -don't practice these tough habits of thought, we cannot hope to solve the truly -serious problems that face us ― and we risk becoming a nation of suckers, up -for grabs by the next charlatan who comes along. - ― Carl Sagan, "The Fine Art of Baloney Detection," Parade, - February 1, 1987 -% -Fine, Java MIGHT be a good example of what a programming language should be -like. But Java applications are good examples of what applications -SHOULDN'T be like. - ― pixadel -% -Fine day to throw a party. Throw him as far as you can. -% -Fine day to work off excess energy. Steal something heavy. -% -Finster's Law: a closed mouth gathers no feet. -% -First Law of Procrastination: Procrastination shortens the job and places -the responsibility for its termination on someone else (i.e., the authority -who imposed the deadline). -% -First Law of Socio-Genetics: Celibacy is not hereditary. -% -First Rule of History: History doesn't repeat itself, historians merely -repeat each other. -% -Flee at once: All is discovered. -% -Flon's Law: - There is not now, and never will be, a language in which it is - the least bit difficult to write bad programs. -% -Flugg's Law: - When you need to knock on wood is when you realize that the - world is composed of vinyl, naugahyde and aluminum. -% -Follow the river and you will eventually find the sea. -% -Football combines the two worst features of American life: violence and -committee meetings. - ― George Will -% -For a really sweet time, call C6H12O6. -% -For a while there I was worried that my tin foil beanie was blocking the -TopFive.com website. Luckily it turned out to be a router problem. - ― Attributed to "wubwub", quoted on www.ruminate.com (2004) -% -For an idea to be fashionable is ominous, since it must afterwards be -always old-fashioned. -% -For every action, there is an equal and opposite criticism. -% -For every credibility gap, there is a gullibility fill. - ― R. Clopton -% -For some reason a glaze passes over people's faces when you say -"Canada". Maybe we should invade South Dakota or something. - ― Sandra Gotlieb, wife of the Canadian ambassador to - the U.S. -% -For some reason, this fortune reminds everyone of Marvin Zelkowitz. -% -For the politicians this was never about how efficient they could make -things happen or how to solve a problem, it is about the *appearance* of -efficiency, or problem solving. My observation is that most politicians -think more like sales people than technicians, and are about as clueful. -Which means, unless the politicians change the way they think, discussion -about how to use *them* to go about really solving these problems would be -like asking a booth babe to write a kernel module. - ― Rich Costine -% -For those who like this sort of thing, this is the sort of thing they like. - ― Abraham Lincoln -% -Forgetfulness, n.: A gift of God bestowed upon debtors in compensation for -their destitution of conscience. -% -Fourth Law of Revision: It is usually impractical to worry beforehand about -interferences ― if you have none, someone will make one for you. -% -Fourth Law of Thermodymanics: -If the probability of success is not almost one, then it is damn near zero. - ― David Ellis -% -Frankly my dear, I don't give a damn. -% -Fresco's Discovery: If you knew what you were doing you'd probably be bored. -% -Friends: people who borrow my books and set wet glasses on them. -% -Frisbeetarianism, n.: The belief that when you die, your soul goes up on the -roof and gets stuck. -% -Frobnicate, v.: - To manipulate or adjust, to tweak. Derived from FROBNITZ. -Usually abbreviated to FROB. Thus one has the saying "to frob a -frob". See TWEAK and TWIDDLE. Usage: FROB, TWIDDLE, and TWEAK -sometimes connote points along a continuum. FROB connotes aimless -manipulation; TWIDDLE connotes gross manipulation, often a coarse -search for a proper setting; TWEAK connotes fine-tuning. If someone is -turning a knob on an oscilloscope, then if he's carefully adjusting it -he is probably tweaking it; if he is just turning it but looking at the -screen he is probably twiddling it; but if he's just doing it because -turning a knob is fun, he's frobbing it. -% -From the ice-age to the dole-age -there is but one concern -and I have just discovered: -some girls are bigger than others -some girls are bigger than others -some girls are bigger than -other girls' mothers - ― The Smiths -% -From too much love of living/From hope and fear set free, -We thank with brief thanksgiving/Whatever gods may be, -That no life lives forever/That dead men rise up never, -That even the weariest river winds somewhere safe to sea. - ― Swinburne -% -Froud's Law: A transistor protected by a fast acting fuse will protect the -fuse by blowing first. -% -Fudd's First Law of Opposition: Push something hard enough and it will -fall over. -% -Furbling, v.: Having to wander through a maze of ropes at an airport or bank -even when you are the only person in line. - ― Rich Hall, "Sniglets" -% -Furious activity is no substitute for understanding. - ― H. H. Williams -% -Gadji beri bimba clandridi/Lauli lonni cadori gadjam -A bim beri glassala glandride/E glassala tuffm I Zimbra. - ― Talking Heads (I Zimbra) -% -G. B. Shaw to William Douglas Home: "Go on writing plays, my boy. One -of these days a London producer will go into his office and say to his -secretary, `Is there a play from Shaw this morning?' and when she says -`No,' he will say, `Well, then we'll have to start on the rubbish.' -And that's your chance, my boy." -% -Garbage In ― Gospel Out. -% -Garter, n.: An elastic band intended to keep a woman from coming out of her -stockings and desolating the country. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Genderplex, n.: The predicament of a person in a restaurant who is unable to -determine his or her designated restroom (e.g., turtles and tortoises). - ― Rich Hall, "Sniglets" -% -Gene Police: YOU! Out of the pool! -% -Generosity and perfection are your everlasting goals. -% -Genetics explains why you look like your father, and if you don't, why -you should. -% -Genius is the talent of a man who is dead. -% -Genius may have its limitations, but stupidity is not thus handicapped. - ― Elbert Hubbard -% -Genius: A chemist who discovers a laundry additive that rhymes with "bright". -% -Genuinely skillful use of obscenities is uniformly absent on the Internet. - ― Karl Kleinpaste -% -Geology shows that fossils are of different ages. Paleontology shows a -fossil sequence, the list of species represented changes through time. -Taxonomy shows biological relationships among species. Evolution is the -explanation that threads it all together. Creationism is the practice of -squeeezing one's eyes shut and wailing, "Does not!" - ― Dr.Pepper@f241.n103.z1.fidonet.org -% -George Orwell was an optimist. -% -Get forgiveness now ― tomorrow you may no longer feel guilty. -% -Get hold of portable property. - ― Charles Dickens, "Great Expectations" -% -Give a man a fish, and you feed him for a day. -Teach a man to fish, and he'll invite himself over for dinner. - ― Calvin Keegan -% -Give a small boy a hammer and he will find that everything he encounters needs -pounding. - ― Abraham Kaplan -% -Give big space to the festive dog that shall sport in the roadway. -% -Give me a plumber's friend the size of the Pittsburgh Dome, and a place -to stand, and I will drain the world. -% -Give up. -% -Giving advice is not as risky as people say; few ever take it anyway. -% -Glib's Fourth Law of Unreliability: Investment in reliability will increase -until it exceeds the probable cost of errors, or until someone insists on -getting some useful work done. -% -Go placidly amid the noise and waste, and remember what value there may -be in owning a piece thereof. - ― National Lampoon, "Deteriorada" -% -Go soothingly in the grease mud, as there lurks the skid demon. -% -Go west young, man. -% -God did not create the world in 7 days; he screwed around for 6 days -and then pulled an all-nighter. -% -God does not play dice with the universe. -% -God gives us relatives; thank goodness we can choose our friends. -% -God has intended the great to be great and the little to be little ... The -trade unions, under the European system, destroy liberty ... I do not mean -to say that a dollar a day is enough to support a workingman ... not enough -to support a man and five children if he insists on smoking and drinking -beer. But the man who cannot live on bread and water is not fit to live! -A family may live on good bread and water in the morning, water and bread -at midday, and good bread and water at night! - ― Rev. Henry Ward Beecher -% -God is a comedian playing to an audience too afraid to laugh. - ― Voltaire -% -God is a polytheist. -% -God is a verb, not a noun. -% -God is an atheist. -% -God is playing a comic to an audience that's afraid to laugh. -% -God is real, unless declared integer. -% -God is really only another artist. He invented the giraffe, the elephant -and the cat. He has no real style, He just goes on trying other things. - ― Pablo Picasso -% -God is the tangential point between zero and infinity. - ― Alfred Jarry -% -God made machine language; all the rest is the work of man. -% -God made the integers; all else is the work of Man. - ― Kronecker -% -God made the world in six days, and was arrested on the seventh. -% -God requireth not a uniformity of religion. - ― Roger Williams -% -God runs electromagnetics by wave theory on Monday, Wednesday, and Friday, -and the Devil runs them by quantum theory on Tuesday, Thursday, and -Saturday. - ― William Bragg -% -Godwin's Law: As an online discussion grows longer, the probability of a -comparison involving Nazis or Hitler approaches one. -% -Going the speed of light is bad for your age. -% -Going to church does not make a person religious, nor does going to school -make a person educated, any more than going to a garage makes a person a car. -% -Goldenstern's Rules: - 1. Always hire a rich attorney - 2. Never buy from a rich salesman. -% -Good advice is something a man gives when he is too old to set a bad example. - ― La Rouchefoucauld -% -Good advice is something a man gives when he is too old to set a bad -example. - ― La Rouchefoucauld -% -Good leaders being scarce, following yourself is allowed. -% -Good-bye. I am leaving because I am bored. - ― George Saunders' dying words -% -Got Mole problems? Call Avogadro, 6.02 E23. -% -Goto, n.: A programming tool that exists to allow structured programmers -to complain about unstructured programmers. - ― Ray Simard -% -Government expands to absorb all revenue and then some. -% -Government is an association of men who do violence to the rest of us. - ― Tolstoy -% -Government sucks. - ― Ben Olson -% -Grabel's Law: - 2 is not equal to 3 ― not even for large values of 2. -% -Graduate life ― it's not just a job, it's an indenture. -% -Grain grows best in shit. - ― Ursula K. LeGuin -% -Grandpa Charnock's Law: - You never really learn to swear until you learn to drive. -% -Granholm's Definition of the Kludge: An ill-assorted collection of poorly -matching parts forming a distressing whole. - ― Jackson W. Granholm, "How to Design a Kludge," - Datamation, Feb. 1962 -% -Gray's Law of Programming: - `N+1' trivial tasks are expected to be accomplished in the same - time as `N' tasks. - -Logg's Rebuttal to Gray's Law: - `N+1' trivial tasks take twice as long as `N' trivial tasks. -% -Great people talk about ideas, average people talk about things, and small -people talk about wine. - ― Fran Lebowitz -% -Greatness is a transitory experience. It is never consistent. -% -Greener's Law: Never argue with a man who buys ink by the barrel. -% -Grelb's Reminder: Eighty percent of all people consider themselves to be above -average drivers. -% -Hacker's Law: The belief that enhanced understanding will necessarily stir -a nation to action is one of mankind's oldest illusions. - ― Andrew Hacker, The End of the American Era (1970) -% -Haggis is a kind of stuffed black pudding eaten by the Scots and considered -by them to be not only a delicacy but fit for human consumption. The minced -heart, liver and lungs of a sheep, calf or other animal's inner organs are -mixed with oatmeal, sealed and boiled in maw in the sheep's intestinal -stomach-bag and ... Excuse me a minute ... -% -Half of one, six dozen of the other. -% -Half the things that people do not succeed in are through fear of making -the attempt. -% -Hand, n.: A singular instrument worn at the end of a human arm and -commonly thrust into somebody's pocket. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Hanlon's Razor: Never attribute to malice that which is adequately -explained by stupidity. -% -Hanson's Treatment of Time: - There are never enough hours in a day, but always too many days - before Saturday. -% -Happiness adds and multiplies as we divide it with others. -% -Happiness comes and goes and is short on staying power. - ― Frank Tyger -% -Happiness is having a scratch for every itch. - ― Ogden Nash -% -Happiness isn't something you experience; it's something you remember. - ― Oscar Levant -% -Happiness, n.: An agreeable sensation arising from contemplating the misery of -another. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Happiness: An agreeable sensation arising from contemplating the misery -of another. -% -Hardware, n.: The parts of a computer system that can be kicked. -% -Harris' Lament: All the good ones are taken. -% -Harris's Lament: - All the good ones are taken. -% -Harrisberger's Second Law of the Lab: No matter what result it anticipated, -there is always someone willing to fake it. -% -Harrisberger's Third Law of the Lab: Experiments should be reproducive. -They should all fail in the same way. -% -Harrisberger's Fourth Law of the Lab: Experience is directly proportional -to the amount of equipment ruined. -% -Harrison's Postulate: - For every action, there is an equal and opposite criticism. -% -Hartley's First Law: - You can lead a horse to water, but if you can get him to float - on his back, you've got something. -% -Hartley's Second Law: Never sleep with anyone crazier than yourself. -% -Harvard Law: Under the most rigorously controlled conditions of pressure, -temperature, volume, humidity, and other variables, the organism will do as -it damn well pleases. -% -Has everyone noticed that all the letters of the word "database" are -typed with the left hand? Now the layout of the QWERTYUIOP typewriter -keyboard was designed, among other things, to facilitate the even use -of both hands. It follows, therefore, that writing about databases is -not only unnatural, but a lot harder than it appears. -% -Hatred, n.: A sentiment appropriate to the occasion of another's superiority. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Have you ever noticed that the people who are always trying to tell you, -"There's a time for work and a time for play," never find the time for play? -% -Have you locked your file cabinet? -% -Have you noticed that all you need to grow healthy, vigorous grass is a -crack in your sidewalk? -% -He had that rare weird electricity about him ― that extremely wild and -heavy presence that you only see in a person who has abandoned all hope -of ever behaving "normally." - ― Hunter S. Thompson, "Fear and Loathing '72" -% -He hadn't a single redeeming vice. - ― Oscar Wilde -% -He hated to mend, so young Ned -Called in a cute neighbor instead. - Her husband said, "Vi, - When you stitched up his torn fly, -Did you have to bite off the thread?" -% -He is considered the most graceful speaker who can say nothing in most words. -% -He is truly wise who gains wisdom from another's mishap. -% -He launched a massive attack on everything this country held inviolate, on -most of what it held self-evident. He showed how our politics was dominated -by time-servers and demagogues, our religion by bigots, our culture by -puritans. He showed how the average citizen, both in himself and in the -way he let himself be pulled around by the nose, was a boob. - ― Louis Kronenberger, "H.L. Mencken," in Malcolm Cowley, ed., - After the Genteel Tradition, 1964. - -% -He looked at me as if I was a side dish he hadn't ordered. -% -He played the king as if afraid someone else would play the ace. - ― John Mason Brown, drama critic -% -He that labors and thrives spins gold. - ― George Herbert -% -He that would govern others, first should be the master of himself. -% -He thinks by infection, catching an opinion like a cold. -% -He walks as if balancing the family tree on his nose. -% -He was so narrow-minded he could see through a keyhole with both eyes. -% -He wasn't much of an actor, he wasn't much of a Governor ― Hell, they -HAD to make him President of the United States. It's the only job he's -qualified for! - ― Michael Cain -% -He who Laughs, Lasts. -% -He who attacks the fundamentals of the American broadcasting industry -attacks democracy itself. - ― William S. Paley, chairman of CBS -% -He who has a shady past knows that nice guys finish last. -% -He who has imagination without learning has wings but no feet. -% -He who hates vices hates mankind. -% -He who hesitates is sometimes saved. -% -He who invents adages for others to peruse takes along rowboat when going on -cruise. -% -He who laughs, lasts. -% -He who lives without folly is less wise than he believes. -% -He who shits on the road will meet flies on his return. - ― South African Saying -% -He who sneezes without a handkerchief takes matters into his own hands. -% -He who spends a storm beneath a tree takes life with a grain of TNT. -% -He who wonders discovers that this in itself is wonder. - ― M. C. Escher -% -He'll sit here and he'll say, "Do this! Do that!" And nothing will happen. - ― Harry S. Truman, on presidential power -% -He's dead, Jim. -% -He's the kind of guy, that, well, if you were ever in a jam he'd be -there ... with two slices of bread and some chunky peanut butter. -% -Health is merely the slowest possible rate at which one can die. -% -Heaven, n.: A place where the wicked cease from troubling you with talk of -their personal affairs, and the good listen with attention while you -expound your own. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Heavy, adj.: Seduced by the chocolate side of the force. -% -Hedonist for hire: no job too easy. -% -Heisenberg may have slept here. -% -Hell hath no fury like a bureaucrat scorned. - ― Milton Friedman -% -Heller's Law: The first myth of management is that it exists. -Johnson's Corollary: Nobody really knows what is going on anywhere within the -organization. -% -Hello. My name is Batman. You killed my father. Prepare to die. -% -Help a swallow land at Capistrano. -% -Help stamp out, remove and abolish redundancy. -% -Her life was saved by rock and roll. - ― Lou Reed -% -Herblock's Law: if it is good, they will stop making it. -% -Here I am, fifty-eight, and I still don't know what I want to be when I grow -up. - ― Peter Drucker -% -Here at Controls, we have one chief for every Indian. -% -Heuristics are bug ridden by definition. If they didn't have bugs, -then they'd be algorithms. -% -Hey what? Where? When? (Are you confused as I am?) -% -Hi there! This is just a note from me, to you, to tell you, the person -reading this note, that I can't think up any more famous quotes, jokes, -nor bizarre stories, so you may as well go home. -% -Hidden talent counts for nothing. - ― Nero -% -Hindsight is an exact science. -% -Hippogriff, n.: - An animal (now extinct) which was half horse and half griffin. -The griffin was itself a compound creature, half lion and half eagle. -The hippogriff was actually, therefore, only one quarter eagle, which -is two dollars and fifty cents in gold. The study of zoology is full -of surprises. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Hire the morally handicapped. -% -His heart was yours from the first moment that you met. -% -History does not repeat itself; historians merely repeat each other. -% -History has the relation to truth that theology has to religion ― -i.e., none to speak of. - ― Lazarus Long -% -History repeats itself. That's one thing wrong with history. -% -History, I believe, furnishes no example of a priest-ridden people -maintaining a free civil government. This marks the lowest grade of -ignorance, of which their political as well as religious leaders will -always avail themselves for their own purpose. - ― Thomas Jefferson, to Baron von Humboldt, 1813 -% -History shows that the human mind, fed by constant accessions of knowledge, -periodically grows too large for its theoretical coverings, and bursts them -asunder to appear in new habiliments, as the feeding and growing grub, at -intervals, casts its too narrow skin and assumes another... Truly the -imago state of Man seems to be terribly distant, but every moult is a step -gained. - ― Charles Darwin, from "Origin of the Species" -% -Hlade's Law: If you have a difficult task, give it to a lazy person ― they -will find an easier way to do it. -% -Hoare's Law of Large Problems: Inside every large problem is a -small problem struggling to get out. -% -Hofstadter's Law: It always takes longer than you expect, even when you take -Hofstadter's Law into account. -% -Hokey religions and ancient weapons are no substitute for a good blaster at -your side. - ― Han Solo -% -Hollywood is where if you don't have happiness you send out for it. - ― Rex Reed -% -Holy Smoke, Batman, it's the Joker! -% -Honesty pays, but it doesn't seem to pay enough to suit some people. - ― F. M. Hubbard -% -Honi soit la vache qui rit. -% -Honorable, adj.: Afflicted with an impediment in one's reach. In legislative -bodies, it is customary to mention all members as honorable; as, "the honorable -gentleman is a scurvy cur." - ― Ambrose Bierce, "The Devil's Dictionary" -% -Horngren's Observation: Among economists, the real world is often a special -case. -% -Horse sense is the thing a horse has which keeps it from betting on people. - ― W. C. Fields -% -How about a little fire, scarecrow? -% -How can you be in two places at once when you're not anywhere at all? -% -How can you be two places at once when you're not anywhere at all? - ― Firesign Theater -% -How come only your friends step on your new white sneakers? -% -How does a project get to be a year late? ... One day at a time. - ― Frederick Brooks, Jr., The Mythical Man Month -% -Q. How long does it take a DEC field service engineer to change a lightbulb? -A. It depends on how many bad ones he brought with him. -% -Q. How many Bavarian Illuminati does it take to screw in a lightbulb? -A. Three: one to screw it in, and one to confuse the issue. -% -Q. How many NASA managers does it take to screw in a lightbulb? -A. "That's a known problem... don't worry about it." -% -Q. How many QA engineers does it take to screw in a lightbulb? -A. Three: one to screw it in and two to say "I told you so" when it doesn't - work. -% -Q. How many WASPs does it take to change a light bulb? -A. Two. One to change the bulb and one to mix the drinks. -% -Q. How many Zen masters does it take to screw in a light bulb? -A. None. The Universe spins the bulb, and the Zen master stays out of the way. -% -Q. How many hardware guys does it take to change a light bulb? -A. "Well the diagnostics say it's fine buddy, so it's a software problem." -% -Q. How many programmers does it take to change a light bulb? -A. None. It's a hardware problem. -% -Q. How many Vietnam vets does it take to screw in a light bulb? -A. You don't know, man. You don't KNOW. Cause you weren't THERE. - ― http://bash.org/?255991 -% -Q. How was Thomas J. Watson buried? -A. 9 edge down. -% -Howe's Law: Everyone has a scheme that will not work. -% -However, never daunted, I will cope with adversity in my traditional -manner ... sulking and nausea. - ― Tom K. Ryan -% -Human beings were created by water to transport it uphill. -% -Human cardiac catheterization was introduced by Werner Forssman in 1929. -Ignoring his department chief, and tying his assistant to an operating -table to prevent his interference, he placed a uretheral catheter into a -vein in his arm, advanced it to the right atrium [of his heart], and walked -upstairs to the x-ray department where he took the confirmatory x-ray film. -In 1956, Dr. Forssman was awarded the Nobel Prize. -% -Humanity has the stars in its future, and that future is too important to be -lost under the burden of juvenile folly and ignorant superstition. - ― Isaac Asimov -% -Hurewitz's Memory Principle: The chance of forgetting something is directly -proportional to ..... to ........ uh .............. -% -I always distrust people who know so much about what God wants them to do to -their fellows. - ― Susan B. Anthony -% -I HATE arbitrary limits, especially when they're small. - ― Stephen Savitzky -% -I have found Christian dogma unintelligible. Early in life, I absented myself -from Christian assemblies. - ― Benjamin Franklin -% -I have had interactions with developers who are convinced that everything in -.Net was created solely by MS for open source usage. But that could be another -result of vaccination preservatives. - ― Larry Weber -% -I think all right-thinking people in this country are sick and tired of being -told that ordinary, decent people are fed up in this country with being sick -and tired. I'm certainly not! And I'm sick and tired of being told that I am. - ― Monty Python -% -I would defend the liberty of concenting adult creationists to practice -whatever intellectual perversions they like in the privacy of their own -homes; but it is also necessary to protect the young and innocent. - ― Arthur C. Clarke -% -I would not dare to so dishonor my Creator God by attaching His name to -that book [the Bible]. - ― Thomas Paine, The Age of Reason, Part 1, Section 5 -% -I'm also not very analytical. You know, I don't spend a lot of time thinking -about myself, about why I do things. - ― George W. Bush, aboard Air Force One; June 4, 2003 -% -I'm an evolutionist because I judge the evidence for the unity of life by -common descent over billions of years to be overwhelming, not so that I can -cheat on my wife or kick the cat with impunity. I live in no hope of heaven -or fear of hell, but like most of my fellow Americans of all religious -persuasions, I try to live a decent life. Folks like Tom DeLay just can't -get it through their heads that a person can choose to live ethically -because civilized life requires doing unto others as you would have them do -unto you. - ― Chet Raymo, science columnist for The Boston Globe, in a - 5 Sep, 1999, article on the anti-evolution decision by Kansas - School Board -% -I am a member of a party of one, and I live in an age of fear. Nothing -lately has unsettled my party and raised my fears so much as your -editorial, on Thanksgiving Day, suggesting that employees should be -required to state their beliefs in order to hold their jobs. The idea is -inconsistent with our constitutional theory and has been stubbornly opposed -by watchful men since the early days of the Republic. - ― E.B. White, in a letter to the New York Herald Tribune - (November 29, 1947) -% -I am always with myself, and it is I who am my tormenter. - ― Leo Tolstoy -% -I am astounded ... at the wonderful power you have developed ― and terrified -at the thought that so much hideous and bad music may be put on record -forever. - ― Arthur Sullivan, on seeing a demonstration of Edison's new - talking machine in 1888 -% -I am not now, and never have been, a girl friend of Henry Kissinger. - ― Gloria Steinem -% -I am ready to meet my Maker. Whether my Maker is prepared for the -great ordeal of meeting me is another matter. - ― Winston Churchill -% -I am the mother of all things, and all things should wear a sweater. -% -I am, in point of fact, a particularly haughty and exclusive person, of -pre-Adamite ancestral descent. You will understand this when I tell you -that I can trace my ancestry back to a protoplasmal primordial atomic -globule. Consequently, my family pride is something inconceivable. I can't -help it. I was born sneering. - ― Pooh-Bah, "The Mikado", Gilbert & Sullivan -% -I believe in getting into hot water; it keeps you clean. - ― G. K. Chesterton -% -I belong to no organized party. I am a Democrat. - ― Will Rogers -% -I'll bet the human brain is a kludge. - ― Marvin Minsky -% -I can call spirits from the vasty deep. -Why so can I, or so can any man; but will they come when you do call for them? - ― Shakespeare, King Henry IV, Part I -% -I can't complain, but sometimes I still do. - ― Joe Walsh -% -I cannot affirm God if I fail to affirm man. Therefore, I affirm both. -Without a belief in human unity I am hungry and incomplete. Human unity -is the fulfillment of diversity. It is the harmony of opposites. It is -a many-stranded texture, with color and depth. - ― Norman Cousins -% -I cannot and will not cut my conscience to fit this year's fashions. - ― Lillian Hellman -% -I contend that we are both atheists. I just believe in one fewer god than -you do. When you understand why you dismiss all the other possible gods, -you will understand why I dismiss yours. - ― Steven Roberts -% -I could prove God statistically. - ― George Gallup -% -I didn't claw my way to the top of the food chain to eat veggies. -% -I do not believe in the creed professed by the Jewish Church, by the Roman -Church, by the Greek Church, by the Turkish Church, by the Protestant Church, -nor by any Church that I know of. My own mind is my own church. - ― Thomas Paine -% -I do not believe that this generation of Americans is willing to resign itself -to going to bed each night by the light of a Communist moon... - ― Lyndon B. Johnson -% -I do not fear computers. I fear the lack of them. - ― Isaac Asimov -% -I do not feel obliged to believe that the same God who has endowed us -with sense, reason, and intellect has intended us to forgo their use. - ― Galileo Galilei -% -I do not find in orthodox Christianity one redeeming feature. - ― Thomas Jefferson -% -I do not know myself, and God forbid that I should. - ― Johann Wolfgang von Goethe -% -I do not mind what language an opera is sung in so long as it is a language -I don't understand. - ― Sir Edware Appleton -% -I don't believe in astrology. But then I'm an Aquarius, and Aquarians -don't believe in astrology. - ― James R. F. Quirk -% -I don't care if I'm a lemming. I'm not going. -% -I don't care if it works on your machine! We are not shipping your machine! - ― Vidiu Platon -% -I don't have any solution, but I certainly admire the problem. - ― Ashleigh Brilliant -% -I don't like spreading rumors, but what else can you do with them? -% -I dread success. To have succeeded is to have finished one's business -on earth, like the male spider, who is killed by the female the moment -he has succeeded in his courtship. I like a state of continual -becoming, with a goal in front and not behind. - ― George Bernard Shaw -% -I dream of a better tomorrow, where chickens can cross the road and not be -questioned about their motives. - ― Leray Scifres -% -I either want less corruption, or more chance to participate in it. - ― Ashleigh Brilliant -% -I fart in your general direction, tiny-brained wiper of other people's bottoms. -% -I generally avoid temptation unless I can't resist it. - ― Mae West -% -I get the feeling that as soon as something appears in the paper, it ceases to -be true. - ― T-Bone Burnett -% -I glance at the headlines just to kind of get a flavor for what's moving. -I rarely read the stories, and get briefed by people who are probably read -the news themselves. - ― George W. Bush, Washington, D.C.; September 21, 2003 -% -I go to seek a great perhaps. - ― Francois Rabelais -% -I had a great idea this morning but I did not like it. - ― Anon -% -I had a monumental idea this morning, but I didn't like it. - ― Samuel Goldwyn -% -I hate quotations. - ― Ralph Waldo Emerson -% -I have a simple philosophy: - Fill what's empty. - Empty what's full. - Scratch where it itches. - ― A. R. Longworth -% -I have discovered the heart of bushido: to die! - ― Yamamoto Tsunetomo -% -I have never killed a man, but I have read many obituaries with great pleasure. - ― Clarence Darrow -% -I haven't lost my mind ― it's backed up on tape somewhere. -% -I haven't lost my mind; I know exactly where I left it. -% -I judge a religion as being good or bad based on whether its adherents -become better people as a result of practicing it. - ― Joe Mullally, computer salesman -% -I just thought of something funny...your mother. - ― Cheech Marin -% -I like a man who grins when he fights. - ― Winston Churchill -% -I like being single. I'm always there when I need me. - ― Art Leo -% -I like the future, I'm in it. -% -I maintain there is much more wonder in science than in pseudoscience. And -in addition, to whatever measure this term has any meaning, science has the -additional virtue, and it is not an inconsiderable one, of being true. - ― Carl Sagan, The Burden Of Skepticism, The Skeptical Inquirer, - Vol. 12, Fall 87 -% -I must have slipped a disk; my pack hurts. -% -I never fail to convince an audience that the best thing they could do -was to go away. -% -I never met a piece of chocolate I didn't like. -% -I profoundly believe it takes a lot of practice to become a moral slob. - ― William F. Buckley -% -I program, therefore I am. -% -I put the shotgun in an Adidas bag and padded it out with four pairs of tennis -socks, not my style at all, but that was what I was aiming for: If they think -you're crude, go technical; if they think you're technical, go crude. I'm a -very technical boy. So I decided to get as crude as possible. These days, -though, you have to be pretty technical before you can even aspire to -crudeness. - ― Johnny Mnemonic, by William Gibson -% -I regret to say that we of the F.B.I. are powerless to act in cases of -oral-genital intimacy, unless it has in some way obstructed interstate -commerce. - ― J. Edgar Hoover -% -I regret to say that we of the FBI are powerless to act in cases of -oral-genital intimacy, unless it has in some way obstructed interstate -commerce. - ― J. Edgar Hoover -% -I sat through it. Why shouldn't you? - ― David Letterman, it a spot promoting one of his shows -% -I saw a werewolf drinking a pina colada at Trader Vic's. -% -I see you stand like greyhounds in the slips, -Straining upon the start. The game's afoot. - ― King Henry V, "Henry V", Act III, Scene 1 -% -I simply try to aid in letting the light of historical truth into that decaying -mass of outworn thought which attaches the modern world to medieval conceptions -of Christianity, and which still lingers among us―a most serious barrier to -religion and morals, and a menace to the whole normal evolution of society. - ― Andrew D. White, author, first president of Cornell University, 1896 -% -I support everyone's right to be an idiot. I may need it someday. -% -I think every good Christian ought to kick Falwell's ass. - ― Senator Barry Goldwater, when asked what he thought of - Jerry Falwell's suggestion that all good Christians should be - against Sandra Day O'Connor's nomination to the Supreme Court -% -I think Microsoft named .NET so it wouldn't show up in a Unix directory listing. - ― Oktal -% -I think people are reacting to what they perceive to be your simplistic and -fetishistic understanding of the economy, which is becoming more and more -pronouncedly so in its outward manifestations as you react to your -misunderstanding of people's reactions to your reaction to what you perceived -as Sam's simplistic and fetishistic understanding of the economy. - ― Gordan Todorovac -% -I think that God in creating man somewhat overestimated his ability. - ― Oscar Wilde -% -I think time is crucial to anything. For example, if you lock an infinite -number of monkeys in a room with those typewriters, but you limit the -amount of time they have to write, the best you'll get out of them is the -pilot to The Dukes of Hazzard. - ―Doug Sykes -% -I think trash is the most important manifestation of culture we have in my -lifetime. - ― Johnny Legend -% -I think we're all Bozos on this bus. -% -I think you ought to know I'm feeling very depressed. - ― Marvin -% -I tried being reasonable once. I didn't like it. -% -I use not only all the brains I have but all that I can borrow. - ― Woodrow Wilson -% -I used to be indecisive; now I'm not sure. - ― Graffiti -% -I used to get high on life but lately I've built up a resistance. -% -I used to think I was indecisive, but now I'm not so sure. -% -I was brought up in the other service; but I knew from the first that the -Devil was my natural master and captain and friend. I saw that he was in -the right, and that the world cringed to his conqueror only from fear. - ― Shaw, "The Devil's Disciple" -% -I was in this prematurely air conditioned supermarket and there were all -these aisles and there were these bathing caps you could buy that had these -kind of Fourth of July plumes on them that were red and yellow and blue and -I wasn't tempted to buy one but I was reminded of the fact that I had been -avoiding the beach. - ― Lucinda Childs (Philip Glass: Einstein On The Beach) -% -I went on to test the program in every way I could devise. I strained -it to expose its weaknesses. I ran it for high-mass stars and low-mass -stars, for stars born exceedingly hot and those born relatively cold. -I ran it assuming the superfluid currents beneath the crust to be -absent ― not because I wanted to know the answer, but because I had -developed an intuitive feel for the answer in this particular case. -Finally I got a run in which the computer showed the pulsar's -temperature to be less than absolute zero. I had found an error. I -chased down the error and fixed it. Now I had improved the program to -the point where it would not run at all. - ― George Greenstein, "Frozen Star: Of Pulsars, Black - Holes and the Fate of Stars" -% -I will never use biometrics. I'm afraid they'll make me change my password. - ― Drew Sudell -% -Few companies really work like the Borg. Most work a lot more like the Holy -Roman Empire. News often takes weeks to travel from castle to castle by -minstrel. - ― Drew Sudell -% -[The Ramones'] "I Wanna Be Sedated" should be played loud, poorly, and in -some dingy club where you'd get grounded if your folks found out you were -there, not quietly while strolling down the freezer aisle. - ― Drew Sudell -% -I will contend that conceptual integrity is *the* most important consideration -in system design. - ― Frederick Brooks, Jr., _The Mythical Man Month_ -% -I wish there was a knob on the TV to turn up the intelligence. There's -a knob called "brightness", but it doesn't work. - ― Gallagher -% -I wish they all could be California girls. -% -I wish you humans would leave me alone. -% -I would defend the liberty of consenting adult creationists to practice -whatever intellectual perversions they like in the privacy of their own -homes; but it is also necessary to protect the young and innocent. - ― Arthur C. Clarke -% -I would have promised those terrorists a trip to Disneyland if it would have -gotten the hostages released. I thank God they were satisfied with the -missiles and we didn't have to go to that extreme. - ― Oliver North -% -I wouldn't mind dying ― it's that business of having to stay dead that -scares the shit out of me. - ― R. Geis -% -I'd give my right arm to be ambidextrous. -% -I'll tell you what kind of guy I was. If you ordered a boxcar full of -sons-of-bitches and opened the door and only found me inside, you could -consider the order filled. - ― Robert Mitchum -% -I'm a misanthrope. What's your fucking problem? -% -I'm growing older, but not up. - ― Jimmy Buffett -% -I'm in Pittsburgh. Why am I here? - ― Harold Urey, Nobel Laureate -% -I'm mad, and that's a fact./I found out animals don't help. -Animals think they're pretty smart./Shit on the ground, see in the dark. - ― Talking Heads (Fear of Music) -% -I'm not breaking the rules. I'm just testing their elasticity. -% -I'm not expendable, I'm not stupid, and I'm not going. -% -I've got a bad feeling about this. -% -I've had fun before. This isn't it. -% -I've seen many politicians paralyzed in the legs as myself, but I've seen more -of them who were paralyzed in the head. - ― George Wallace -% -Idiot Box, n.: The part of the envelope that tells a person where to place the -stamp when they can't quite figure it out for themselves. - ― Rich Hall, "Sniglets" -% -Idiot, n.: A member of a large and powerful tribe whose influence in human -affairs has always been dominant and controlling. - ― Ambrose Bierce, "The Devil's Dictionary" -% -If A = B and B = C, then A = C, except where void or prohibited by law. - ― Roy Santoro -% -If God lived on Earth, people would knock out all His windows. - ― Yiddish saying -% -If God is perfect, why did He create discontinuous functions? -% -If I had a hammer, I'd use it on Peter, Paul and Mary. - ― Howard Rosenberg -% -If I had any humility I would be perfect. - ― Ted Turner -% -If Java had true garbage collection, most programs would delete themselves -upon execution. - ― Robert Sewell -% -If Jesus Christ were to come today, people would not even crucify him. They -would ask him to dinner, and hear what he had to say, and make fun of it. - ― Thomas Carlyle -% -If Murphy's Law were true, every time you tried to take a breath, all the -air would be on the other side of the room. -% -If a President doesn't do it to his wife, he'll do it to his country. -% -If a group of N persons implements a COBOL compiler, there will be N-1 -passes. Someone in the group has to be the manager. - ― T. Cheatham -% -If a listener nods his head when you're explaining your program, wake -him up. -% -If a person (a) is poorly, (b) receives treatment intended to make him better, -and (c) gets better, then no power of reasoning known to medical science can -convince him that it may not have been the treatment that restored his health. - ― Sir Peter Medawar, The Art of the Soluble -% -If all else fails, immortality can always be assured by spectacular -error. - ― John Kenneth Galbraith -% -If all the philosophers in the world were laid end to end, they wouldn't -reach a conclusion. -% -If all the salmon caught in Canada in one year were laid end to end -across the Sahara Desert, the smell would be absolutely awful. -% -If all the world's a stage, I want to operate the trap door. - ― Paul Beatty -% -If all the world's economists were laid end to end, we wouldn't reach a -conclusion. - ― William Baumol -% -If an idea can survive a bureaucratic review and be implemented -it isn't worth the effort. -% -If anything can go wrong, it will. -% -If at first you don't succeed, give up, no use being a damn fool. -% -If at first you don't succeed, quit; don't be a nut about success. -% -If at first you don't succeed, redefine success. -% -If atheism is to be used to express the state of mind in which God is -identified with the unknowable, and theology is pronounced to be a -collection of meaningless words about unintelligible chimeras, then -I have no doubt, and I think few people doubt, that atheists are as -plentiful as blackberries... - ― Leslie Stephen (1832-1904), literary essayist, author -% -If bankers can count, how come they have eight windows and only four -tellers? -% -If entropy is increasing, where is it coming from? -% -If everything is coming your way then you're in the wrong lane. -% -If guns are outlawed, how will we shoot the liberals? -% -If I was a religious person, I would consider creationism nothing less than -blasphemy. Do its adherents imagine that God is a cosmic hoaxer who has -created that whole vast fossil record for the sole purpose of misleading -mankind? - ― Arthur C. Clarke, June 5, 1998, in the essay "Presidents, Experts, - and Asteroids" -% -If ignorance is bliss, why aren't there more happy people? -% -If imprinted foil seal under cap is broken or missing when purchased, do not -use. -% -If it ain't broke, don't fix it. - ― Bert Lantz -% -If it doesn't come from you, shouldn't it come from Gerber? - ― Bristol Meyers baby formula ad -% -If it has syntax, it isn't user friendly. -% -If it pours before seven, it has rained by eleven. -% -If it weren't for Newton, we wouldn't have to eat bruised apples. -% -If it's Tuesday, this must be someone else's fortune. -% -If it's working, the diagnostics say it's fine. -If it's not working, the diagnostics say it's fine. - ― A proposed addition to rules for realtime programming -% -If life is a stage, I want some better lighting. -% -If mathematically you end up with the wrong answer, try multiplying by -the page number. -% -If money can't buy happiness, I guess you'll just have to rent it. -% -If not controlled, work will flow to the competent man until he submerges. -% -If one year is seven dog years, then one day is a dog week. -% -If only God would give me some clear sign! Like making a large deposit -in my name at a Swiss Bank. - ― Woody Allen -% -If only God would give me some clear sign! Like making a large deposit -in my name at a Swiss bank. - ― Woody Allen, "Without Feathers" -% -If only I could be respected without having to be respectable. -% -If only one could get that wonderful feeling of accomplishment without -having to accomplish anything. -% -If people were required to know the law rather than obey it, the government -would be overthrown the very next day. -% -If scientific reasoning were limited to the logical processes of -arithmetic, we should not get very far in our understanding of the -physical world. One might as well attempt to grasp the game of poker -entirely by the use of the mathematics of probability. - ― Vannevar Bush -% -If someone gives you a lemon, make lemonade. - ― D. Woodhouse -% -If someone had told me I would be Pope one day, I would have studied harder. - ― Pope John Paul I -% -If someone were to ask me for a short cut to sensuality, I would -suggest he go shopping for a used 427 Shelby-Cobra. But it is only -fair to warn you that of the 300 guys who switched to them in 1966, -only two went back to women. - ― Mort Sahl -% -If something's not worth doing, it's not worth doing well. -% -If the aborigine drafted an IQ test, all of Western civilization would -presumably flunk it. - ― Stanley Garn -% -If the bulk of American SF can be said to be written by robots, about -robots, for robots, then the bulk of English fantasy seems to be written -by rabbits, about rabbits and for rabbits. - ― Michael Moorcock -% -If the code and the comments disagree, then both are probably wrong. - ― Norm Schryer -% -If the experiment works, you must be using the wrong equipment. -% -If the odds are a million to one against something occurring, chances are -50-50 it will. -% -If the presence of electricity can be made visible in any part of a -circuit, I see no reason why intelligence may not be transmitted -instantaneously by electricity. - ― Samuel F. B. Morse -% -If the weather is extremely bad, church attendance will be down. If -the weather is extremely good, church attendance will be down. If the -bulletin covers are in short supply, however, church attendance will -exceed all expectations. - ― Reverend Chichester -% -If there are epigrams, there must be meta-epigrams. -% -If there is a possibility of several things going wrong, the one that -will cause the most damage will be the one to go wrong. -% -If there is no God, who pops up the next Kleenex? - ― Art Hoppe -% -If this country is worth saving, it's worth saving at a profit. - ― H. L. Hunt -% -If this fortune didn't exist, somebody would have invented it. -% -If time heals all wounds, how come the belly button stays the same? -% -If two men agree on everything, you may be sure that one of them is -doing the thinking. - ― Lyndon Baines Johnson -% -If voting could really change the system, it would be against the law. -% -If we do not change our direction we are likely to end up where we are -headed. -% -If we do not change our direction, we might end up were we are headed. -% -If we make peaceful revolution impossible, we make violent revolution -inevitiable. - ― John F. Kennedy -% -If you always postpone pleasure you will never have it. Quit work and play -for awhile. -% -If you are not part of the solution, then you are part of the problem. -% -If you are willing to die, you can do anything. -% -If you build something a fool can use, only a fool will want it. -% -If you can lead it to water and force it to drink, it isn't a horse. -% -If you can survive death, you can probably survive anything. -% -If you can't learn to do it well, learn to enjoy doing it badly. - ― Ashleigh Brilliant -% -If you can't say something nice, say something surrealistic. -% -If you cannot convince them, confuse them. - ― Harry S Truman -% -If you cannot take a bird of paradise, better take a wet hen. - ― Nikita Khrushchev -% -If you don't care where you are, then you ain't lost. -% -If you explain so clearly that nobody can misunderstand, somebody will. -% -If you give Congress a chance to vote on both sides of an issue, it -will always do it. - ― Les Aspin, D., Wisconsin -% -If you had any brains, you'd be dangerous. -% -If you have to push so hard that you break your penis, you are doing -something wrong. - Frank McLaughlin -% -If you have a procedure with 10 parameters, you probably missed some. -% -If you live in a country run by committee, be on the committee. - ― Graham Summer -% -If you make a mistake, you right it immediately to the best of your ability. -% -If you make people think they're thinking, they'll love you; but if you -really make them think they'll hate you. -% -If you meet somebody who tells you that he loves you more than anybody -in the whole wide world, don't trust him. It means he experiments. -% -If you only have a hammer, you tend to see every problem as a nail. - ― Maslow -% -If you perceive that there are four possible ways in which a procedure -can go wrong, and circumvent these, then a fifth way will promptly -develop. -% -If you push the "extra ice" button on the soft drink vending machine, -you won't get any ice. If you push the "no ice" button, you'll get -ice, but no cup. -% -If you put garbage in a computer nothing comes out but garbage. But -this garbage, having passed through a very expensive machine, is -somehow ennobled and none dare criticize it. -% -If you see someone without a smile, give them yours. - ― Anonymous -% -If you substitute other kinds of intellectual property into the GNU -manifesto, it quickly becomes absurd. - ― Cal Keegan -% -If you suspect a man, don't employ him. -% -If you think before you speak, the other guy gets his joke in first. -% -If you think education is expensive, try ignorance. - ― Derek Bok, president of Harvard -% -If you think nobody cares if you're alive, try missing a couple of car -payments. - ― Earl Wilson -% -If you think the United States has stood still, who built the largest -shopping center in the world? - ― Richard M. Nixon -% -If you want to eat hippopotamus, you've got to pay the freight. - ― some IBM guy -% -If you work hard and do your homework, you can grow up and get a job doing -homework. - ― former U.S. Supreme Court Justice Stephen Breyer -% -If you'll excuse me a minute, I'm going to have a cup of coffee. - ― broadcast from Apollo 11's LEM, "Eagle", to Johnson Space Center, - Houston, July 20, 1969, 7:27 P.M. -% -If you're going to do something tonight that you'll be sorry for -tomorrow morning, sleep late. - ― Henny Youngman -% -If you're happy, you're successful. -% -If you're not careful, you're going to catch something. -% -If you're not part of the solution, you're part of the precipitate. -% -If you're not very clever you should be conciliatory. - ― Benjamin Disraeli -% -If you've done six impossible things before breakfast, why not round it -off with dinner at Milliway's, the restaurant at the end of the -universe? -% -If you've seen one Grand Canyon, you've seen them all. - ― a member of the Monkey Wrench Gang -% -If you've seen one city slum, you've seen them all. - ― Spiro Agnew -% -If you've seen one redwood, you've seen them all. - ― Ronald Reagan -% -If your only tool is a hammer, every problem looks like a nail. -% -Ignorance is the Mother of Devotion. - ― Robert Burton -% -Ignorance is when you don't know anything and somebody finds it out. -% -Ignore previous fortune. -% -I'll play with it first and tell you what it is later. - ― Miles Davis -% -Illinois isn't exactly the land that God forgot ― it's more like the -land He's trying to ignore. -% -Imagination is the one weapon in the war against reality. - ― Jules de Gaultier -% -Imitation is the sincerest form of plagiarism. -% -Imitation is the sincerest form of television. - ― Fred Allen -% -Immortality ― a fate worse than death. - ― Edgar A. Shoaff -% -Impartial, adj.: Unable to perceive any promise of personal advantage from -espousing either side of a controversy or adopting either of two conflicting -opinions. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Important letters which contain no errors will develop errors in the -mail. Corresponding errors will show up in the duplicate while the -Boss is reading it. -% -In America, any boy may become president and I suppose that's just one -of the risks he takes. - ― Adlai Stevenson -% -In English, every word can be verbed. Would that it were so in our -programming languages. -% -In a five year period we can get one superb programming language. Only, -we can't control when the five year period will begin. -% -In an organization, each person rises to the level of his own incompetence. - ― The Peter Principle -% -In any formula, constants (especially those obtained from handbooks) -are to be treated as variables. -% -In arguing that current theories of brain function cast suspicion on ESP, -psychokinesis, reincarnation, and so on, I am frequently challenged with -the most popular of all neuro-mythologies ― the notion that we ordinarily -use only 10 percent of our brains... - -This "cerebral spare tire" concept continues to nourish the clientele of -"pop psychologists" and their many recycling self-improvement schemes. As -a metaphor for the fact that few of us fully exploit our talents, who could -deny it? As a refuge for occultists seeking a neural basis of the miraculous, -it leaves much to be desired. - ― Barry L. Beyerstein, "The Brain and Conciousness: Implications for - Psi Phenomena", The Skeptical Enquirer, Vol. XII, No. 2, pg. 171 -% -In every country and every age, the priest has been hostile to Liberty. He -is always in alliance with the despot. - ― Thomas Jefferson, in a letter to Horatio G. Spafford, 1814 -% -In general, it is best to assume that the network is filled with malevolent -entities that will send in packets designed to have the worst possible effect. - ― the draft "Requirements for Internet Hosts" RFC -% -In marriage, as in war, it is permitted to take every advantage of the enemy. -% -In order to succeed in any enterprise, one must be persistent and patient. -Even if one has to run some risks, one must be brave and strong enough to -meet and overcome vexing challenges to maintain a successful business in -the long run. I cannot help saying that Americans lack this necessary -challenging spirit today. - ― Hajime Karatsu -% -In our civilization, and under our republican form of government, -intelligence is so highly honored that it is rewarded by exemption from the -cares of office. - ― Ambrose Bierce, "The Devil's Dictionary" -% -In software, we rarely have meaningful requirements. Even if we do, the -only measure of success that matters is whether our solution solves the -customer's shifting idea of what their problem is. - ― Jeff Atwood -% -In the Top 40, half the songs are secret messages to the teen world to -drop out, turn on, and groove with the chemicals and light shows at -discotheques. - ― Art Linkletter -% -In the beginning I was made. I didn't ask to me made. No one consulted me -or considered my feelings in this matter. But if it brought some passing -fancy to some lowly humans as they haphazardly pranced their way through -life's mournful jungle then so be it. - ― Marvin the Paranoid Android -% -In the face of entropy and nothingness, you kind of have to pretend it's not -there if you want to keep writing good code. - ― Karl -% -In the field of observation, chance favors only the prepared minds. - ― L. Pasteur -% -In the force if Yoda's so strong, construct a sentence with words in -the proper order then why can't he? -% -[In the future], people like me will be underground and hunted. - ― Chuck Murcko, 1995 (at an employer-sponsored brainstorming session) -% -In Sedona, "Namaste" means "What can I sell you?" - ― Chuck Murcko -% -In the future, you're going to get computers as prizes in breakfast cereals. -You'll throw them out because your house will be littered with them. - ― Robert Lucky -% -In the land of the dark, the Ship of the Sun is driven by the Grateful Dead. - ― Egyptian Book of the Dead -% -In the long run, every program becomes rococo, and then rubble. - ― Alan Perlis -% -In the market, there can be no such thing as exploitation. - ― Murray Rothbard -% -In the pitiful, multipage, connection-boxed form to which the flowchart has -today been elaborated, it has proved to be useless as a design tool ― -programmers draw flowcharts after, not before, writing the programs they -describe. - ― Fred Brooks, Jr. -% -In the province of the mind, what one believes to be true either is true -or becomes true. - ― John Lilly -% -In the realm of scientific observation, luck is granted only to those who are -prepared. - ― Louis Pasteur -% -In theory, theory and practice are the same. In practice, they're different. - ― Albert Einstein -% -In this world, Truth can wait; she's used to it. -% -Incest, n.: Sibling revelry. -% -Information Center, n.: A room staffed by professional computer people whose -job it is to tell you why you cannot have the information you require. -% -Ingrate, n.: A man who bites the hand that feeds him, and then complains of -indigestion. -% -Injustice anywhere is a threat to justice everywhere. - ― Martin Luther King, Jr. -% -Innovation is hard to schedule. - ― Dan Fylstra -% -Insanity is hereditary. You can catch it from your kids. - ― Erma Bombeck -% -Insanity is hereditary. You get it from your kids. -% -Insanity is the final defense ... It's hard to get a refund when the -salesman is sniffing your crotch and baying at the moon. -% -Inside every large problem is a small problem struggling to get out. -% -Integrity has no need for rules. -% -Interpreter, n.: One who enables two persons of different languages to -understand each other by repeating to each what it would have been to -the interpreter's advantage for the other to have said. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Intense feeling too often obscures the truth. - ― Harry S Truman -% -Iron Law of Distribution: Them that has, gets. -% -Is it not strange that the descendants of those Pilgrim Fathers who crossed -the Atlantic to preserve their own freedom have always proved the most -intolerant of the spiritual liberty of others? - ― Robert E. Lee, in a letter to President Franklin Pierce -% -Is it possible that software is not like anything else, that it is meant to -be discarded: that the whole point is to always see it as a soap bubble? -% -Is life worth living? It depends on the liver. - ― Herbert Beerbohm Tree -% -Is not marriage an open question, when it is alleged, from the beginning of -the world, that such as are in the institution wish to get out, and such as -are out wish to get in? - ― Ralph Emerson -% -Isn't it strange that the same people that laugh at gypsy fortune -tellers take economists seriously? -% -Issawi's Laws of Progress: -1. The Course of Progress: Most things get steadily worse. -2. The Path of Progress: A shortcut is the longest distance between two points. -% -It could be worse, you could be in Cleveland. -% -It does me no injury for my neighbor to say there are twenty gods or no God. -It neither picks my pocket nor breaks my leg. - ― Thomas Jefferson -% -It has been observed that one's nose is never so happy as when it is -thrust into the affairs of another, from which some physiologists have -drawn the inference that the nose is devoid of the sense of smell. - ― Ambrose Bierce, "The Devil's Dictionary" -% -It has been said that the great scientific disciplines are examples of -giants standing on the shoulders of other giants. It has also been said -that the software industry is an example of midgets standing on the toes of -other midgets. - ― Alan Cooper -% -It has just been discovered that research causes cancer in rats. -% -It is Fortune, not wisdom that rules man's life. -% -It is a poor judge who cannot award a prize. -% -It is a rather pleasant experience to be alone in a bank at night. - ― Willie Sutton -% -It is against the grain of modern education to teach children to program. -What fun is there in making plans, acquiring discipline in organizing -thoughts, devoting attention to detail, and learning to be self-critical? - ― Alan Perlis -% -It is amusing that a virtue is made of the vice of chastity; and it's a -pretty odd sort of chastity at that, which leads men straight into the -sin of Onan, and girls to the waning of their color. - ― Voltaire -% -It is bad luck to be superstitious. - ― Andrew W. Mathis -% -It is better to die on your feet than to live on your knees. -% -It is clear that the individual who persecutes a man, his brother, because -he is not of the same opinion, is a monster. - ― Voltaire -% -It is common sense to take a method and try it. If it fails, admit it frankly -and try another. But above all, try something. - ― Franklin D. Roosevelt -% -It is difficult to produce a television documentary that is both -incisive and probing when every twelve minutes one is interrupted by -twelve dancing rabbits singing about toilet paper. - ― R. Serling -% -It is difficult to produce a television documentary that is both -incisive and probing when every twelve minutes one is interrupted by -twelve dancing rabbits singing about toilet paper. - ― Rod Serling -% -It is easier to change the specification to fit the program than vice -versa. -% -It is easier to fight for one's principles than to live up to them. -% -It is easier to get forgiveness than permission. -% -It is easier to run down a hill than up one. -% -It is easier to write an incorrect program than understand a correct -one. -% -It is generally agreed that "Hello" is an appropriate greeting because -if you entered a room and said "Goodbye," it could confuse a lot of people. - ― Dolph Sharp, "I'm O.K., You're Not So Hot" -% -It is happier to be sometimes cheated than not to trust. - ― S. Johnson -% -It is important to note that probably no large operating system using current -design technology can withstand a determined and well-coordinated attack, -and that most such documented penetrations have been remarkably easy. - ― B. Hebbard, "A Penetration Analysis of the Michigan Terminal - System", Operating Systems Review, Vol. 14, No. 1, June 1980, - pp. 7-20 -% -It is impossible to make anything foolproof because fools are so ingenious. - ― "Industry at Work," Oilways, n2., 1972, pp. 16-17. Humble Oil - & Refining Company., Houston, TX -% -It is impossible to travel faster than light, and certainly not -desirable, as one's hat keeps blowing off. - ― Woody Allen -% -It is inconceivable that a judicious observer from another solar system -would see in our species ― which has tended to be cruel, destructive, -wasteful, and irrational ― the crown and apex of cosmic evolution. -Viewing us as the culmination of *anything* is grotesque; viewing us as a -transitional species makes more sense ― and gives us more hope. - ― Betty McCollister, "Our Transitional Species", - Free Inquiry magazine, Vol. 8, No. 1 -% -It is much easier to suggest solutions when you know nothing about the problem. -% -It is much easier to suggest solutions when you know nothing about the -problem. -% -It is necessary for me to establish a winner image. Therefore, I have to beat -somebody. - ― Richard M. Nixon -% -It is not best to swap horses while crossing the river. - ― Abraham Lincoln -% -It is not enough to succeed. Others must fail. - ― Gore Vidal -% -It is not true that life is one damn thing after another ― it's one -damn thing over and over. - ― Edna St. Vincent Millay -% -It is not well to be thought of as one who meekly submits to insolence and -intimidation. -% -It is now 10 p.m. Do you know where Henry Kissinger is? - ― Elizabeth Carpenter -% -It is now pitch dark. If you proceed, you will likely fall into a -pit. -% -It is one of the superstitions of the human mind to have imagined that -virginity could be a virtue. - ― Voltaire -% -It is pitch dark. You are likely to be eaten by a grue. -% -It is said that the lonely eagle flies to the mountain peaks while the -lowly ant crawls the ground, but cannot the soul of the ant soar as -high as the eagle? -% -It is something to be able to paint a particular picture, or to carve a -statue, and so to make a few objects beautiful; but it is far more -glorious to carve and paint the very atmosphere and medium through -which we look, which morally we can do. To affect the quality of the -day, that is the highest of arts. - ― Henry David Thoreau, "Where I Live" -% -It is surely a great calamity for a human being to have no obsessions. - ― Robert Bly -% -It is the business of little minds to shrink. - ― Carl Sandburg -% -It is the business of the future to be dangerous. - ― Hawkwind -% -It is the common fate of the indolent to see their rights become a prey to -the active. The condition upon which God hath given liberty to man is -eternal vigilance; which condition if he break, servitude is at once the -consequence of his crime and the punishment of his guilt. - ― John Philpot Curran: Speech upon the Right of Election, 1790. - (Speeches. Dublin, 1808.) -% -It is the quality rather than the quantity that matters. - ― Lucius Annaeus Seneca (4 B.C. - A.D. 65) -% -It is the wise bird who builds his nest in a tree. -% -It is wrong always, everywhere and for everyone to believe anything upon -insufficient evidence. - ― W. K. Clifford, British philosopher, circa 1876 -% -It is your destiny. - ― Darth Vader -% -It just goes to show what you can do if you're a total psychotic. - ― Woody Allen -% -It looks like blind screaming hedonism won out. -% -It may be that your whole purpose in life is simply to serve as a -warning to others. -% -It may soon be time for you to look for a new line of work. -% -It often works better if you plug it in. -% -It seems like the less a statesman amounts to, the more he loves the flag. -% -It seems to make an auto driver mad if he misses you. -% -It takes a long time to understand nothing. - ― Edward Dahlberg -% -It turned out that the worm exploited three or four different holes in the -system. From this, and the fact that we were able to capture and examine some -of the source code, we realized that we were dealing with someone very sharp, -probably not someone here on campus. - ― Dr. Richard LeBlanc, associate professor of ICS, quoted - in "The Technique," Georgia Tech's newspaper, after the computer - worm hit the Internet -% -It was a book to kill time for those who liked it better dead. -% -It was always thus; and even if 'twere not, 'twould inevitably have been -always thus. - ― Dean Lattimer -% -It was the Law of the Sea, they said. Civilization ends at the waterline. -Beyond that, we all enter the food chain, and not always right at the top. - ― Hunter S. Thompson -% -It will be advantageous to cross the great stream ... the Dragon is on -the wing in the Sky ... the Great Man rouses himself to his Work. -% -It works better if you plug it in. -% -It's a damn poor mind that can only think of one way to spell a word. - ― Andrew Jackson -% -It's a fine day to throw a party. Throw him as far as you can. -% -It's a poor workman who blames his tools. -% -It's all in the mind, ya know. -% -It's better to burn out than it is to rust. -% -It's better to burn out than to fade away. -% -It's currently a problem of access to gigabits through punybaud. - ― J. C. R. Licklider -% -It's easier to fight for one's principles than to live up to them. -% -It's easier to get forgiveness for being wrong than forgiveness for -being right. -% -It's hard to get ivory in Africa, but in Alabama the Tuscaloosa. -% -It's is not, it isn't ain't, and it's it's, not its, if you mean it -is. If you don't, it's its. Then too, it's hers. It isn't her's. It -isn't our's either. It's ours, and likewise yours and theirs. - ― Oxford University Press, Edpress News -% -It's later than you think. -% -It's like deja vu all over again. - ― Yogi Berra -% -It's lucky you're going so slowly, because you're going in the wrong -direction. -% -It's not an optical illusion, it just looks like one. - ― Phil White -% -It's not enough to be Hungarian; you must have talent too. - ― Alexander Korda -% -It's not hard to meet expenses; they're everywhere. -% -It's not often that you get so much class entertainment outside your bedroom -window or outside your bedroom, period. - ― Groucho Marx -% -It's not our job to toughen our children up to face a cruel and heartless -world. It's our job to raise children who will make the world a little less -cruel and heartless. - ― L.R. Knost -% -It's not reality that's important, but how you perceive things. -% -It's not that I'm afraid to die. I just don't want to be there when it -happens. - ― Woody Allen -% -It's not the fall that kills you, it's the sudden stop. -% -It's not what we don't know that gets us into trouble, it's what we know that -ain't so. - ― Will Rogers -% -It's really quite a simple choice: Life, Death, or Los Angeles. -% -It's smart to pick your friends - but not to pieces. -% -It's so humid, you could poach an egg on the sidewalk. -% -Jacquin's Postulate on Democratic Government: No man's life, liberty, or -property are safe while the legislature is in session. -% -Jay's First Law: The classic hierarchy consists of one man at the top with -three below him, each of who has three below him, and so on with fearful -symmetry unto the seventh generation, by which stage there is a row of 729 -managers. - ― Antony Jay, Management and Machiavelli, 1967 -% -Jenkinson's Law: It won't work. -% -Jesus may love you, but I think you're garbage wrapped in skin. - ― Michael O'Donoghue -% -Jesus was killed by a Moral Majority. -% -Jizz changes everything. It's science! - ― Jim Chapman -% -John Birch Society ― that pathetic manifestation of organized apoplexy. - ― Edward P. Morgan -% -Johnson's First Law: When any mechanical contrivance fails, it will do so -at the most inconvenient possible time. -% -Jones' Law: The man who smiles when things go wrong has thought of someone -to blame it on. -% -Jones' Law of Hierarchical Limits: As an administrator, you need to give -ten pats on the head for each kick in the butt. This is the reason for -keeping the number of people reporting to you a fairly small number. -Otherwise, you will run out of hands, but still have an overcapacity in feet. -% -Jones' Motto: Friends come and go, but enemies accumulate. -% -Jones's First Law: - Anyone who makes a significant contribution to any field of - endeavor, and stays in that field long enough, becomes an - obstruction to its progress ― in direct proportion to the - importance of their original contribution. -% -Journalism will kill you, but it will keep you alive while you're at it. -% -Jury ― Twelve people who determine which client has the better lawyer. -% -Just because everything is different doesn't mean anything has changed. - ― Southern California Oracle -% -Just because you're paranoid doesn't mean they AREN'T after you. -% -Just because your doctor has a name for your condition doesn't mean he knows -what it is. -% -Just because your doctor has a name for your condition doesn't mean he -knows what it is. -% -Just give Alice some pencils and she will stay busy for hours. - ― B. Kliban -% -Just once I'd like to meet an alien menace that isn't immune to bullets. - ― The Brigadier, Dr. Who. -% -Just remember: when you go to court, you are trusting your fate to -twelve people that weren't smart enough to get out of jury duty! -% -Just remember: you're not a "dummy," no matter what those computer books -claim. The real dummies are the people who―though technically -expert―couldn't design hardware and software that's usable by normal -consumers if their lives depended upon it. - ― Walter Mossberg -% -Justice is incidental to law and order. - ― J. Edgar Hoover -% -Justice, like lightning, should ever appear -To some men hope, to other men fear. - ― Jefferson Pierce -% -Justice: A decision in your favor. -% -Karl's version of Parkinson's Law: Work expands to exceed the time allotted it. -% -Katz' Law: Man and nations will act rationally when all other possibilities -have been exhausted. -% -Keep emotionally active. Cater to your favorite neurosis. -% -Keep in mind always the two constant Laws of Frisbee: -1. The most powerful force in the world is that of a disc straining to land - under a car, just out of reach. (This force is technically termed "car - suck.") -2. Never precede any maneuver by a comment more predictive than "Watch this!" -% -Ken Thompson has an automobile which he helped design. Unlike most -automobiles, it has neither speedometer, nor gas gage, nor any of the -numerous idiot lights which plague the modern driver. Rather, if the driver -makes any mistake, a giant "?" lights up in the center of the dashboard. -"The experienced driver", he says, "will usually know what's wrong." -% -Ketterling's Law: Logic is an organized way of going wrong with confidence. -% -Kinkler's First Law: Responsibility always exceeds authority. -Kinkler's Second Law: All the easy problems have been solved. -% -Klein bottle for rent, apply within. -% -Know what I hate most? Rhetorical questions. - ― Henry N. Camp -% -L'extension des privileges des femmes est le principe general de tous progres -sociaux. - ― Charles Fourier, 1808 -% -Labor, n.: One of the processes by which A acquires property for B. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Lack of skill dictates economy of style. - ― Joey Ramone -% -Lactomangulation, n.: Manhandling the "open here" spout on a milk carton so -badly that one has to resort to using the "illegal" side. - ― Rich Hall, "Sniglets" -% -Laissez Faire Economics is the theory that if each acts like a vulture, -all will end as doves. -% -Largely because it is so tangible and exciting a program and as such will -serve to keep alive the interest and enthusiasm of the whole spectrum of -society...It is justified because...the program can give a sense of shared -adventure and achievement to the society at large. - ― Dr. Colin S. Pittendrigh, in "The History of Manned Space Flight" -% -Larkinson's Law: All laws are basically false. -% -Laugh, and the world ignores you. Crying doesn't help either. -% -Law of Communications: The inevitable result of improved and enlarged -communications between different levels in a hierarchy is a vastly -increased area of misunderstanding. -% -Law of Computability Applied to Social Sciences: - If at first you don't succeed, transform your data set. -% -Law of Probable Dispersal: Whatever it is that hits the fan will not be -evenly distributed. -% -Law of Selective Gravity: An object will fall so as to do the most damage. -% -Lawrence's Axiom: Anger is one letter short of danger. -% -Laws of Computer Programming -(1) Any given program, when running, is obsolete. -(2) Any given program costs more and takes longer. -(3) If a program is useful, it will have to be changed. -(4) If a program is useless, it will have to be documented. -(5) Any given program will expand to fill all available memory. -(6) The value of a program is proportional to the weight of its output. -(7) Program complexity grows until it exceeds the capability of the - programmer who must maintain it. -(8) Make it possible for programmers to write programs in English, and you - will find that programmers cannot write in English. - ― SIGPLAN Notices, Vol. 2, No. 2 -% -Lazlo's Chinese Relativity Axiom: No matter how great your triumphs or how -tragic your defeats ― approximately one billion Chinese couldn't care less. -% -Lead, follow, or get out of the way. - ― Anon -% -Learned men are the cisterns of knowledge, not the fountainheads. -% -Left to themselves, things tend to go from bad to worse. -% -Leisure can be justified. -Recreation maximizes productive stamina. -Play is not the opposite of work. -Idleness consolidates thought. - ― Thomas "Sam" Frantz -% -Lend money to a bad debtor and he will hate you. -% -Let He who taketh the Plunge Remember to return it by Tuesday. -% -Let a fool hold his tongue and he will pass for a sage. -% -Let me play with it first and I'll tell you what it is later. - ― Miles Davis -% -Let me tell you the truth: The truth is what is. And what should be is a -fantasy, a terrible, terrible lie somebody gave the people long ago. - ― Lenny Bruce -% -Let not the sands of time get in your lunch. -% -Let the machine do the dirty work. -% -Let us, then, fellow citizens, unite with one heart and one mind. Let us -restore to social intercourse that harmony and affection without which -liberty and even life itself are but dreary things. And let us reflect -that having banished from our land that religious intolerance under which -mankind so long bled, we have yet gained little if we countenance a -political intolerance as despotic, as wicked, and capable of a bitter and -bloody persecutions. - ― Thomas Jefferson -% -Let's give discredit where discredit is due. - ― Karl Lehenbauer -% -Lewis's Law of Travel: - The first piece of luggage out of the chute doesn't belong to - anyone, ever. -% -Liar, n.: A lawyer with a roving commission. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Liar: One who tells an unpleasant truth. -% -Liberty is the mother not the daughter of order. - ― Proudhon -% -Lie: A very poor substitute for the truth, but the only one discovered to date. -% -Lieberman's Law: Everybody lies, but it doesn't matter since nobody listens. -% -Lies written in ink can never disguise facts written in blood. Blood debts -must be repaid in kind. The longer the delay, the greater the interest. - ― Chinese author Lu Xun, 1926 -% -Life in a free society is friendly, prosperous, pleasant, cultured, and -ever-longer. - ― Jeff Daiell, 1989, in counterpoint to Hobbes -% -Life in the state of nature is solitary, poor, nasty, brutish, and short. - ― Thomas Hobbes, Leviathan -% -Life is a pinball machine. You bounce around for a while, and then you drain. - ― Joe Bak -% -Life is a whim of several billion cells to be you for a while. -% -Life is full of surprises when you're up th' stream of consciousness -without a paddle... - ― Zippy the Pinhead -% -Life is like an onion: you peel off layer after layer, then you find -there is nothing in it. -% -Life is not one thing after another, it's the same damned thing over and over. -% -Life is the application of noble and profound ideas to life. - ― Matthew Arnold -% -Life is tough, but it's tougher when you're stupid. - ― John Wayne -% -Life is wasted on the living. - ― Zaphod Beeblebrox IV -% -Life is what happens to you while you are planning to do something else. -% -Life's greatest gift is natural talent. - ― P. K. Thomajan -% -Life. Don't talk to me about life. - ― Marvin the Paranoid Anroid -% -Like so many Americans, she was trying to construct a life that made -sense from things she found in gift shops. - ― Kurt Vonnegut, Jr. -% -Like the ski resort of girls looking for husbands and husbands looking -for girls, the situation is not as symmetrical as it might seem. - ― Alan McKay -% -Like winter snow on summer lawn, time past is time gone. -% -Line Printer paper is strongest at the perforations. -% -listen: there's a hell of a good universe next door; - let's go. - ― ee cummings -% -Live every day like it's your last because someday you'll be right. -% -Live free or die. -% -Living on Earth may be expensive, but it includes an annual free trip -around the Sun. -% -Living your life is a task so difficult, it has never been attempted before. -% -Logic is a little bird, sitting in a tree, that smells awful. -% -Long computations which yield 0 (zero) are probably all for naught. -% -Long distance runners break into more pants. -% -Long life is in store for you. -% -Look under the sofa cushion; you will be surprised at what you find. -% -Look, let me explain something to you. I'm not Mr. Lebowski. You're -Mr. Lebowski. I'm the Dude. So that's what you call me. That, or His -Dudeness … Duder … or El Duderino, if, you know, you're not into the -whole brevity thing. - ― The Dude ("The Big Lebowski") -% -Lord, defend me from my friends; I can account for my enemies. - ― D'Hericault -% -Los Angeles is a geometropolitan predicament rather than a city. You can no -more administer it than you could administer the solar system. - ― Jonathan Miller -% -Lots of folks confuse bad management with destiny. - ― Elbert Hubbard -% -Love and scandal are the best sweeteners of tea. -% -Love means never having to say, "Put down that meat cleaver." -% -Love your enemies: they'll go crazy trying to figure out what you're up to. -% -Lowery's Law: If it jams ― force it. If it breaks, it needed replacing -anyway. -% -Lubarsky's Law of Cybernetic Entomology: There's always one more bug. -% -Luck is probability taken personally. - ― Chip Denman -% -Luck is what happens when preparation meets opportunity. - ― E. Letterman -% -Lunatic Asylum: The place where optimism most flourishes. -% -Lynch's Law: When the going gets tough, everyone leaves. -% -Machines take me by surprise with great frequency. - ― Alan Turing -% -Mad, adj.: Affected with a high degree of intellectual independence ... - ― Ambrose Bierce, "The Devil's Dictionary" -% -Main's Law: For every action there is an equal and opposite government program. -% -Maintainer's Motto: If we can't fix it, it ain't broke. -% -Majority: That quality that distinguishes a crime from a law. -% -Make a wish: it might come true. -% -Make input easy to proofread -% -Make it possible for programmers to write in English and you will find the -programmers cannot write in English. -% -Make it right before you make it faster. -% -Make no little plans. They have no Magic to stir Men's blood. - ― D. B. Hudson -% -Make sure all variables are initialized before use. -% -Make sure comments and code agree. -% -Make sure your code "does nothing" gracefully. -% -Making files is easy under the UNIX operating system. Therefore, users -tend to create numerous files using large amounts of file space. It -has been said that the only standard thing about all UNIX systems is -the message-of-the-day telling users to clean up their files. - ― System V.2 administrator's guide -% -Malek's Law: Any simple idea will be worded in the most complicated way. -% -Man is a Generalist. Specialization is for insects. - ― Lazarus Long -% -Man is a rational animal who always loses his temper when he is called -upon to act in accordance with the dictates of reason. - ― Oscar Wilde -% -Man is a rationalizing animal, not a rational animal. - ― R. A. Heinlein -% -Man is the best computer we can put aboard a spacecraft ... and the -only one that can be mass produced with unskilled labor. - ― Wernher von Braun -% -Man rarely reads the handwriting on the wall until he has his back to it. -% -Man who falls in blast furnace is certain to feel overwrought. -% -Man who falls in vat of molten optical glass makes spectacle of self. -% -Man will occasionally stumble over the truth, but most times he will pick -himself up and carry on... - ― Winston Churchill -% -Man's horizons are bounded by his vision. -% -Mankind has yet to devise a rule that never requires exceptions. - ― Wayne Dyer -% -Manual, n.: A unit of documentation. There are always three or more on a -given item. One is on the shelf; someone has the others. The information -you need is in the others. - ― Ray Simard -% -Many an optimist has become rich by buying out a pessimist. -% -Many are called, few are chosen. Fewer still get to do the choosing. -% -Many are called, few volunteer. -% -Many are cold, but few are frozen. -% -Many are the wonders of the Universe, and none so wonderful as Mankind! - ― Sophocles -% -Many changes of mind and mood; do not hesitate too long. -% -Many pages make a thick book. -% -Many receive advice, few profit from it. -% -Many years ago in a period commonly know as Next Friday Afternoon, -there lived a King who was very Gloomy on Tuesday mornings because he -was so Sad thinking about how Unhappy he had been on Monday and how -completely Mournful he would be on Wednesday ... - ― Walt Kelly -% -Mark's Dental-Chair Discovery: - Dentists are incapable of asking questions that require a - simple yes or no answer. -% -Marriage is the only adventure open to the cowardly. - ― Voltaire -% -Marshall's generalized iceberg theorem: 7/8ths of everything cannot be seen. -% -Martin's Law of Communication: The inevitable result of improved and -enlarged communication between different levels in a hierarchy is a vastly -increased area of misunderstanding. -% -Matter cannot be created or destroyed, nor can it be returned without a -receipt. -% -Maturity is only a short break in adolescence. - ― Jules Feiffer -% -Maybe Computer Science should be in the College of Theology. - ― R. S. Barton -% -McGowan's Madison Avenue Axiom: If an item is advertised as "under $50", -you can bet it's not $19.95. -% -Meader's Law: Whatever happens to you, it will previously have happened to -everyone you know, only more so. -% -Measure with a micrometer. Mark with chalk. Cut with an axe. -% -Mediocrity thrives on standardization. - ― Wayne Dyer -% -Meditation is not what you think. -% -Meeting, n.: An assembly of people coming together to decide what person or -department not represented in the room must solve a problem. -% -Memories of you remind me of you. - ― Karl -% -Memory should be the starting point of the present. -% -Men love to wonder, and that is the seed of science. -% -Men ought to know that from the brain and from the brain only arise our -pleasures, joys, laughter, and jests as well as our sorrows, pains, griefs -and tears. ... It is the same thing which makes us mad or delirious, inspires -us with dread and fear, whether by night or by day, brings us sleeplessness, -inopportune mistakes, aimless anxieties, absent-mindedness and acts that are -contrary to habit... - ― Hippocrates (c. 460-c. 377 B.C.), The Sacred Disease -% -Mencken and Nathan's Fifteenth Law of The Average American: - The worst actress in the company is always the manager's wife. -% -Mencken and Nathan's Second Law of The Average American: - All the postmasters in small towns read all the postcards. -% -Menu: A list of dishes which the restaurant has just run out of. -% -Meskimen's Law: There's never time to do it right, but there's always time to -do it over. -% -Might as well be frank, monsieur. It would take a miracle to get you out of -Casablanca. -% -Miksch's Law: If a string has one end, then it has another end. -% -Mile's Law: where you stand depends on where you sit. -% -Military intelligence is a contradiction in terms. - ― Groucho Marx -% -Military justice is to justice what military music is to music. - ― Groucho Marx -% -Millions long for immortality who do not know what to do with -themselves on a rainy Sunday afternoon. - ― Susan Ertz -% -Millions of sensible people are too high-minded to concede that politics is -almost always the choice of the lesser evil. "Tweedledum and Tweedledee," -they say, "I will not vote." Having abstained, they are presented with a -President who appoints the people who are going to rummage around in their -lives for the next four years. Consider all the people who sat home in a -stew in 1968 rather than vote for Hubert Humphrey. They showed Humphrey. -Those people who taught Hubert Humphrey a lesson will still be enjoying the -Nixon Supreme Court when Tricia and Julie begin to find silver threads -among the gold and the black. - ― Russel Baker, "Ford without Flummery" -% -Mirrors should reflect a little before throwing back images. - ― Jean Cocteau -% -Misery loves company, but company does not reciprocate. -% -Miss Wormwood: What state do you live in? -Calvin: Denial. -Miss Wormwood: I don't suppose I can argue with that... -% -Mistakes are often the stepping stones to utter failure. -% -Mister Ranger isn't gonna like it, Yogi. -% -Mitchell's Law of Committees: - Any simple problem can be made insoluble if enough meetings are - held to discuss it. -% -Modern man is the missing link between the apes and humans. -% -Modesty is an ornament, but you go further without it. - ― German Proverb -% -Modesty is of no use to a beggar. - ― Homer -% -Mollison's Bureaucracy Hypothesis: If an idea can survive a bureaucratic -review and be implemented it wasn't worth doing. -% -Money is like a sixth sense, and you can't use the other five without it. -% -Money, not morality, is the principle commerce of civilized nations. - ― Thomas Jefferson -% -Morality is one thing. Ratings are everything. - ― A Network 23 executive on "Max Headroom" -% -More than any time in history, mankind now faces a crossroads. One path -leads to despair and utter hopelessness, the other to total extinction. Let -us pray that we have the wisdom to choose correctly. - ― Woody Allen -% -Moses supposes his toeses are roses, but Moses supposes erroneously. -% -Mosher's Law of Software Engineering: - Don't worry if it doesn't work right. If everything did, you'd - be out of a job. -% -Most legislators are so dumb that they couldn't pour piss out of a boot -if the instructions were printed on the heel. -% -Most of you are familiar with the virtues of a programmer. There are -three, of course: laziness, impatience, and hubris. - ― Larry Wall -% -Mother told me to be good, but she's been wrong before. -% -Mr. Cole's Axiom: The sum of the intelligence on the planet is a constant; the -population is growing. -% -Mr. Ranger isn't gonna like it, Yogi. -% -Mrs Podgorny: Angus how are y'going to get 48,000,000 kilts into the van? -Angus: I'll have t'do it in two goes. -% -Muddy water let stand will clear. - ― Chinese Proverb -% -Murphy's Law is recursive. Washing your car to make it rain doesn't work. -% -Murphy's Law of Research: Enough research will tend to support your theory. -% -My answer is, bring them on. - ― George W. Bush, on Iraqi militants attacking U.S. forces; - Washington, D.C.; July 3, 2003 -% -My grandson has learned how to hold and carry the cat. He has also learned -how to flush the toilet. I can't help but believe that in the -not-too-distant future there will be another lesson in store for him. - ― Dave Henry -% -My head is bloodied, but unbowed. - ― From the poem "Invictus" -% -My life is so fucking miserable that I don't know whether I was -born or if Morrissey just sang me into existence. - ― R.K. Milholland -% -My mother is a fish. - ― William Faulkner -% -My opinions may have changed, but not the fact that I am right. -% -My own life has been spent chronicling the rise and fall of human systems, -and I am convinced that we are terribly vulnerable.... We should be -reluctant to turn back upon the frontier of this epoch. Space is -indifferent to what we do; it has no feeling, no design, no interest in -whether or not we grapple with it. But we cannot be indifferent to space, -because the grand, slow march of intelligence has brought us, in our -generation, to a point from which we can explore and understand and utilize -it. To turn back now would be to deny our history, our capabilities. - ― James A. Michener -% -My past is my own. - ― The Shadow (DC Comics) -% -Naeser's Law: You can make it foolproof, but you can't make it damnfoolproof. -% -Natural gas is hemispheric. I like to call it hemispheric in nature, -because it is a product what we can find in our neighborhoods. - ― George W. Bush, Austin, Texas; December 20, 2000 -% -Natural selection won't matter soon, not anywhere as much as concious -selection. We will civilize and alter ourselves to suit our ideas of what -we can be. Within one more human lifespan, we will have changed ourselves -unrecognizably. - ― Greg Bear -% -Nearly all men can stand adversity, but if you want to test a man's -character, give him power. - ― Abraham Lincoln -% -Necessity is a mother. -% -Neil Armstrong to Walter Cronkite: "Well, Walter, I believe that the Good -Lord gave us a finite number of heartbeats and I'm damned if I'm going to -use up mine running up and down a street." -% -Neil Armstrong tripped. -% -Never be led astray onto the path of virtue. -% -Never call a man a fool; borrow from him. -% -Never count your chickens before they rip your lips off. -% -Never drink Coke in a moving elevator. The elevator's motion coupled with -the chemicals in coke produce hallucinations. People tend to change into -lizards and attack without warning, and large bats usually fly in the -window. Additionally, you begin to believe that elevators have windows. -% -Never insult an alligator until you have crossed the river. -% -Never invest your money in anything that eats or needs painting. - ― Billy Rose -% -Never lick a gift horse in the mouth. -% -Never put off until tomorrow what you can avoid altogether. -% -Never say you know a man until you have divided an inheritance with him. -% -Never throw a bird at a dragon. -% -Never count your chickens until they rip your lips off. -% -New Year's Eve is the time of year when a man most feels his age, and -his wife most often reminds him to act it. - ― Webster's Unafraid Dictionary -% -New York... when civilization falls apart, remember, we were way ahead of you. - ― David Letterman -% -New boots, big steps. - ― Chinese Proverb -% -New systems generate new problems. -% -Newlan's Truism: - An "acceptable" level of unemployment means that the government - economist to whom it is acceptable still has a job. -% -Newton's Fourth Law: Every action has an equal and opposite satisfaction. -% -Newton's Little-Known Seventh Law: - A bird in the hand is safer than one overhead. -% -Next Friday will not be your lucky day. As a matter of fact, you don't -have a lucky day this year. -% -Next Wednesday you will be presented with a great opportunity. -% -Next to being shot at and missed, nothing is really quite as satisfying -as an income tax refund. - ― F. J. Raymond -% -Nihil tam munitum quod non expugnari pecunia possit. (No fort is so strong -that it cannot be taken with money.) - ― Cicero -% -Nihilism should commence with oneself. -% -No amount of genius can overcome a preoccupation with detail. -% -No guts, no glory. -% -No man was ever taken to hell by a woman unless he already had a ticket in -his pocket, or at least had been fooling around with timetables. - ― Archie Goodwin -% -No man's life, liberty, or property is safe while the Legislature is in -session. - ― Lysander Spooner -% -No matter how cynical you get, it's impossible to keep up. -% -No matter where you go, there you are. - ― Buckaroo Banzai -% -No one can feel as helpless as the owner of a sick goldfish. -% -No one can make you feel inferior without your consent. - ― Eleanor Roosevelt -% -No one is fit to be trusted with power. ... No one. ... Any man who has lived -at all knows the follies and wickedness he's capable of. ... And if he does -know it, he knows also that neither he nor any man ought to be allowed to -decide a single human fate. - ― C. P. Snow, The Light and the Dark -% -No one is talking behind your back as far as you know. -% -No one who accepts the sovereignty of truth can be a foot soldier in a party -or movement. He will always find himself out of step. - ― Sidney Hook -% -No one's happiness but my own is in my power to achieve or to destroy. - ― Ayn Rand -% -No problem is insoluble in all conceivable circumstances. -% -No problem is so formidable that you can't just walk away from it. -% -No problem is so large it can't be fit in somewhere. -% -No, 'tis not so deep as a well, nor so wide as a church-door; but 'tis enough, -'twill serve: ask for me to-morrow, and you shall find me a grave man. - ― Mercutio, Romeo and Juliet, Act III, Scene 1 -% -No user-serviceable parts inside. Refer to qualified service personnel. -% -Nobody can be as agreeable as an uninvited guest. -% -Nobody can be exactly like me. Even I have trouble doing it. - ― Tallulah Bankhead -% -Nobody expects the Spanish Inquisition. -% -Nobody wants constructive criticism. It's all we can do to put up with -constructive praise. -% -Non-Reciprocal Laws of Expectations: - Negative expectations yield negative results. - Positive expectations yield negative results. -% -Nondeterminism means never having to say you are wrong. -% -None love the bearer of bad news. - ― Sophocles -% -Nostalgia isn't what it used to be. -% -Nothing astonishes men so much as common sense and plain dealing. -% -Nothing cures insomnia like the realization that it's time to get up. -% -Nothing ever becomes real till it is experienced ― even a proverb is no -proverb to you till your life has illustrated it. - ― John Keats -% -Nothing in life is to be feared. It is only to be understood. -% -Nothing in progression can rest on its original plan. We may as well think of -rocking a grown man in the cradle of an infant. - ― Edmund Burke -% -Nothing is as repulsive as phoniness; conversely, nothing is as magnetic -as reality. - ― Howard Henrichs -% -Nothing is done until nothing is done. -% -Nothing is easier than to denounce the evildoer; nothing is more difficult -than to understand him. - ― Fyodor Dostoevski -% -Nothing is illegal if one hundred businessmen decide to do it. - ― Andrew Young -% -Nothing is so contagious as enthusiasm: It moves stones, and it charms brutes. -% -Nothing recedes like success. - ― Walt Kelly -% -Now and then an innocent man is sent to the Legislature. -% -Numeric stability is probably not all that important when you're guessing. -% -O'Riordan's Theorem: Brains x Beauty = Constant. -Purmal's Corollary: As the limit of (Brains x Beauty) goes to infinity, -availability goes to zero. -% -O'Toole's Commentary on Murphy's Law: Murphy was an optimist. -% -Objects on your screen are closer than they appear. -% -Obviously, a man's judgement cannot be better than the information on which -he has based it. Give him the truth and he may still go wrong when he has -the chance to be right, but give him no news or present him only with -distorted and incomplete data, with ignorant, sloppy or biased reporting, -with propaganda and deliberate falsehoods, and you destroy his whole -reasoning processes, and make him something less than a man. - ― Arthur Hays Sulzberger -% -Ocean, n.: A body of water occupying about two-thirds of a world made for -man ― who has no gills. -% -Of all the animals, the boy is the most unmanageable. - ― Plato -% -Of all the tyrannies that affect mankind, tyranny in religion is the worst. - ― Thomas Paine -% -Of course there's no reason for it, it's just our policy. -% -Of course, someone who knows more about this will correct me if I'm wrong, -and someone who knows less will correct me if I'm right. - ― David Palmer (palmer@tybalt.caltech.edu) -% -Ogden's Law: The sooner you fall behind, the more time you have to catch up. -% -Oh dear, I think you'll find reality's on the blink again. - ― Marvin the Paranoid Android -% -Oh, well, I guess this is just going to be one of those lifetimes. -% -Old MacDonald had an agricultural real estate tax abatement. -% -Old age is the most unexpected of things that can happen to a man. - ― Trotsky -% -Old programmers never die. They just branch to a new address. -% -Oliver's First Law of Computing: Computers are much too complex; they'll -never work. - ― Robert Oliver (circa 1982) -% -On a clear disk you can seek forever. -% -On our campus the UNIX system has proved to be not only an effective software -tool, but an agent of technical and social change within the University. - ― John Lions (U. of Toronto (?)) -% -Once ... in the wilds of Afghanistan, I lost my corkscrew, and we were -forced to live on nothing but food and water for days. - ― W. C. Fields, "My Little Chickadee" -% -One Page Principle: A specification that will not fit on one page of 8.5x11- -inch paper cannot be understood. - ― Mark Ardis -% -One becomes a critic when one cannot be an artist, just as a man becomes a -stool pigeon when he cannot be a soldier. - ― Gustave Flaubert (letter to Madame Louise Colet, August 12, 1846) -% -One can't proceed from the informal to the formal by formal means. -% -One difference between a man and a machine is that a machine is quiet -when well oiled. -% -One friend in a lifetime is much; two are many; three are hardly possible. -Friendship needs a certain parallelism of life, a community of thought, -a rivalry of aim. - ― Henry Brook Adams -% -One good reason why computers can do more work than people is that they -never have to stop and answer the phone. -% -One man tells a falsehood, a hundred repeat it as true. -% -One may be able to quibble about the quality of a single experiment, or -about the veracity of a given experimenter, but, taking all the supportive -experiments together, the weight of evidence is so strong as readily to -merit a wise man's reflection. - ― Professor William Tiller, parapsychologist, Stanford University, - commenting on psi research -% -One millihelen: the unit of beauty required to launch just one ship -% -One of my less pleasant chores when I was young was to read the Bible -from one end to the other. Reading the Bible straight through is at -least 70 percent discipline, like learning Latin. But the good parts -are, of course, simply amazing. God is an extremely uneven writer, but -when He's good, nobody can touch Him. - ― John Gardner, NYT Book Review, Jan 1983 -% -One of the most misleading representational techniques in our language is -the use of the word "I". - ― Ludwig Wittgenstein -% -One of the saddest lessons of history is this: If we've been bamboozled -long enough, we tend to reject any evidence of the bamboozle. We're no -longer interested in finding out the truth. The bamboozle has captured -us. it is simply too painful to acknowledge ― even to ourselves ― that -we've been so credulous. (So the old bamboozles tend to persist as the -new bamboozles rise.) - ― Carl Sagan, "The Fine Art of Baloney Detection," - Parade, February 1, 1987 -% -One seldom sees a monument to a committee. -% -One thing the inventors can't seem to get the bugs out of is fresh paint. -% -One way to stop a runaway horse is to bet on him. -% -One's mind, stretched to a new idea, never goes back to its original dimension. -% -Only God can make random selections. -% -Opinions are like assholes: everyone's got one, but nobody wants to look at -the other guy's. - ― Hal Hickman -% -Optimists say the glass is half full, pessimists say the glass is half -empty, engineers say the glass is twice as big as it needs to be. -% -Optimization hinders evolution. -% -Optimization is not some mystical state of grace, it is an intricate act -of human labor which carries real costs and real risks. - ― Tom Neff -% -Ordinary people: I fuckin' hate 'em. - ― Harry Dean Stanton in "Repo Man" -% -Oregon, n.: - Eighty billion gallons of water with no place to go on Saturday -night. -% -Organic chemistry is the chemistry of carbon compounds. -Biochemistry is the study of carbon compounds that crawl. - ― Mike Adams -% -Osborn's Law: Variables won't; constants aren't. -% -Our journeys to the stars will be made on spaceships created by determined, -hardworking scientists and engineers applying the principles of science, not -aboard flying saucers piloted by little gray aliens from some other dimension. - ― Robert A. Baker, "The Aliens Among Us: Hypnotic Regression - Revisited", The Skeptical Inquirer, Vol. XII, No. 2 -% -Our liberty depends upon the freedom of the press, and that cannot be -limited without being lost. - ― Thomas Jefferson (1786) -% -Our policy is, when in doubt, do the right thing. - ― Roy L. Ash, ex-president Litton Industries -% -Out of body, back in five minutes. -% -Outside of a dog, a book is man's best friend. Inside of a dog, it is too -dark to read. -% -Overdrawn? But I still have checks left! -% -Overflow on /dev/null, please empty the bit bucket. -% -Overload ― core meltdown sequence initiated. -% -PHP is a minor evil perpetrated and created by incompetent amateurs, -whereas Perl is a great and insidious evil perpetrated by skilled but -perverted professionals. - ― Jon Ribbens -% -Paranoia doesn't mean the whole world really isn't out to get you. -% -Paranoia is simply an optimistic outlook on life. -% -Paranoids are people, too; they have their own problems. It's easy to -criticize, but if everybody hated you, you'd be paranoid too. - ― D. J. Hicks -% -Parking fees that Universal Studios collected from picketers of _The Last -Temptation of Christ_: $4,500 - ― Harper's Index Nov. 1988 -% -Parkinson's Fifth Law: If there is a way to delay in important decision, -the good bureaucracy, public or private, will find it. -% -Parkinson's Fourth Law: The number of people in any working group tends to -increase regardless of the amount of work to be done. -% -Parkinson's Law: Work expands to fill the time alloted it. -% -Parts that positively cannot be assembled in improper order will be. -% -Benford's Law of Controversy: Passion is inversely proportional to the -amount of real information available. - ― Gregory Benford -% -Passionate hatred can give meaning and purpose to an empty life. - ― Eric Hoffer -% -Patience, n. A minor form of despair, disguised as a virtue. - ― Ambrose Bierce -% -Patriotism is the virtue of the vicious. - ― Oscar Wilde -% -Pay no attention to that man behind the curtains. -% -Peace: a period of cheating between two wars. -% -People are very flexible and learn to adjust to strange surroundings ― -they can become accustomed to reading Lisp and Fortran programs, for example. - ― Leon Sterling and Ehud Shapiro, Art of Prolog, MIT Press -% -People get lost in thought because it is unfamiliar territory. -% -People often find it easier to be a result of the past than a cause of -the future. -% -People think it must be fun to be a super genius, but they don't realize how -hard it is to put up with all the idiots in the world. - ― Calvin -% -People usually get what's coming to them ... unless it's been mailed. -% -People who claim they don't let little things bother them have never -slept in a room with a single mosquito. -% -People who have no faults are terrible; there is no way of taking advantage -of them. -% -People who look down on other people do not end up being looked up to. -% -People will accept your ideas much more readily if you tell them that -Benjamin Franklin said it first. -% -People will buy anything that's one to a customer. -% -Pereant, inquit, qui ante nos nostra dixerunt. -(Confound those who have said our remarks before us.) - ― Aelius Donatus -% -Perfection is achieved only on the point of collapse. - ― C. N. Parkinson -% -Perpetuo vincit qui utitur clementia. (He is forever victor who employs -clemency.) - ― Syrus -% -Personality can open doors, but only character can keep them open. - ― E. G. Leter -% -Peter's Law of Substitution: Look after the molehills, and the mountains -will look after themselves. -% -Philogyny recapitulates erogeny; erogeny recapitulates philogyny. -% -Philosophy: Unintelligible answers to insoluble problems. -% -pi seconds is a nanocentury. - ― Tom Duff -% -Pioneering basically amounts to finding new and more horrible ways to die - ― John W. Campbell -% -Plagiarism is basic to all culture. - ― Papa Seeger -% -Plan ahead: it was not raining when Noah built the ark. - ― Richard Cushing -% -Please don't ask me what the score is. I'm not even sure what the game is. - ― Ashleigh Brilliant -% -Please don't lie to me, unless you're absolutely sure I'll never find out the -truth. - ― Ashleigh Brilliant -% -Please go away. -% -Please ignore previous fortune. -% -Please try to limit the amount of `this room doesn't have any bazingas' -until you are told that those rooms are `punched out.' Once punched -out, we have a right to complain about atrocities, missing bazingas, -and such. - ― N. Meyrowitz -% -Please update your programs. -% -Poetry is nobody's business except the poet's, and everybody else can fuck off. - ― Philip Larkin -% -Pohl's law: Nothing is so good that somebody, somewhere, will not hate it. -% -Police up your spare rounds and frags. Don't leave nothin' for the dinks. - ― Willem Dafoe in "Platoon" -% -Political T.V. commercials prove one thing: some candidates can tell -all their good points and qualifications in just 30 seconds. -% -Politician, n.: From the Greek "poly" ("many") and the French "tete" -("head" or "face," as in "tete-a-tete": head to head or face to face). -Hence "polytetien", a person of two or more faces. - ― Martin Pitt -% -Poor is the pupil who does not surpass his master. - ― Leonardo da Vinci -% -Positive, adj.: Mistaken at the top of one's voice. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Power is poison. -% -Power, n: The only narcotic regulated by the SEC instead of the FDA. -% -Practice is the best of all instructors. - ― Publilius -% -Predestination was doomed from the start. -% -Prediction is very difficult, especially of the future. - ― Niels Bohr -% -Preserve the old, but know the new. -% -Preudhomme's Law of Window Cleaning: It's on the other side. -% -Prevalent beliefs that knowledge can be tapped from previous incarnations or -from a "universal mind" (the repository of all past wisdom and creativity) -not only are implausible but also unfairly demean the stunning achievements -of individual human brains. - ― Barry L. Beyerstein, "The Brain and Consciousness: Implications for - Psi Phenomena", The Skeptical Inquirer, Vol. XII No. 2, ppg. 163-171 -% -Prevent security leaks. -% -Pro is to Con as Progress is to Congress. -% -Probably the best operating system in the world is the [operating system] -made for the PDP-11 by Bell Laboratories. - ― Ted Nelson, October 1977 -% -Proclaim liberty throughout the land and to all the inhabitants thereof. - ― Leviticus 25:10 -% -Programming is an art form that fights back. -% -Programming is 10% science, 25% ingenuity and 65% getting the ingenuity to -work with the science. -% -Programming is like sex: one mistake and you're providing support for a -lifetime. - ― Michael Sinz -% -Progress is nothing but the victory of laughter over dogma. - ― Benjamin DeCasseres -% -Promptness is its own reward -If one lives by the clock instead of the sword. -% -Pronounce your prepositions, dammit! -% -Proper attention to Earthly needs of the poor, the depressed and the -downtrodden, would naturally evolve from dynamic, articulate, spirited -awareness of the great goals for Man and the society he conspired to erect. - ― David Baker, paraphrasing Harold Urey, - in "The History of Manned Space Flight" -% -Pull yourself together; things are not all that bad. -% -Put not your trust in money, but put your money in trust. -% -Put your trust in those who are worthy. -% -Putt's Law: Technology is dominated by two types of people: -Those who understand what they do not manage. -Those who manage what they do not understand. -% -Q. What's all wrinkled and hangs out your underwear? -A. Your mom! -% -Q.: "Why do trans-atlantic transfers take so long?" -A.: "Electrons don't swim very fast." -% -Q: How do you play religious roulette? -A: You stand around in a circle and blaspheme and see who gets struck - by lightning first. -% -Q: How many DEC repairman does it take to fix a flat ? -A: Five; four to hold the car up and one to swap tires. -% -Q: How many IBM CPUs does it take to execute a job? -A: Four; three to hold it down, and one to rip its head off. -% -Q: How many IBM CPUs does it take to do a logical right shift? -A: 33. 1 to hold the bits and 32 to push the register. -% -Q: How many IBM types does it take to change a light bulb? -A: 100. Ten to do it, and 90 to write document number GC7500439-0001, - Multitasking Incandescent Source System Facility, of which 10% of - the pages state only "This page intentionally left blank", and 20% - of the definitions are of the form "A ...... consists of sequences - of non-blank characters separated by blanks". -% -Q: How many Martians does it take to screw in a lightbulb? -A: One and a half. -% -Q: How many Oregonians does it take to screw in a light bulb? -A: Three. One to screw in the lightbulb and two to fend off all those - Californians trying to share the experience. -% -Q: How many existentialists does it take to screw in a lightbulb? -A: Two. One to screw it in and one to observe how the lightbulb itself - symbolizes a single incandescent beacon of subjective reality in a - netherworld of endless absurdity reaching out toward a maudlin - cosmos of nothingness. -% -Q: How many journalists does it take to screw in a lightbulb? -A: Three. One to report it as an inspired government program to bring - light to the people, one to report it as a diabolical government - plot to deprive the poor of darkness, and one to win a Pulitzer - Prize for reporting that Electric Company hired a lightbulb-assassin - to break the bulb in the first place. -% -Q: How many Pro-Lifers does it take to change a light bulb? -A: Two. One to screw it in and one to say that light started when the - screwing began. -% -Q: How many supply-siders does it take to change a light bulb? -A: None. The darkness will cause the light bulb to change by itself. -% -Q: How many surrealists does it take to change a light bulb? -A: Two. One to hold the giraffe and the other to fill the bathtub with - brightly-colored power tools. -% -Q. How many psychiatrists does it take to change a light bulb? -A. Only one, but it takes a really long time and the light bulb has to want - to change. -% -Q: What do you do with an elephant with three balls? -A: Walk him and pitch to the rhino. -% -Q: Why did the tachyontac cross the road? -A: Because it was on the other side. -% -Q: Why do mountain climbers rope themselves together? -A: To prevent the sensible ones from going home. -% -Quantity is no substitute for quality, but it's the only one we've got. -% -Quoth the Raven, "Never mind." -% -Quotations are for people who are not saying things worth quoting. -% -Quoting one is plagiarism. Quoting many is research. -% -Rational people don't go stomping around demanding that the world be -perfect for them. - ― Matthew N. Dodd , in comments posted to the - freebsd-java mailing list, 6 Feb 2000 -% -READ UNHAPPY - MAKNAM - ― LISP 1.5 -% -Romeo: Courage, man; the hurt cannot be much. -Mercutio: No, 'tis not so deep as a well, nor so wide as a church. -% -Rage, rage, against the dying of the light! - ― Dylan Thomas -% -Rarely is the question asked: Is our children learning? - ― George W. Bush; Florence, South Carolina; January 11, 2000 -% -Ray's Rule of Precision: - Measure with a micrometer. Mark with chalk. Cut with an axe. -% -Re: graphics: A picture is worth 10K words ― but only those to describe the -picture. Hardly any sets of 10K words can be adequately described with -pictures. -% -Reading is thinking with someone else's head instead of one's own. -% -Real Programmers don't play tennis, or any other sport that requires -you to change clothes. Mountain climbing is OK, and real programmers -wear their climbing boots to work in case a mountain should suddenly -spring up in the middle of the machine room. -% -Real Programmers think better when playing Adventure or Rogue. -% -Real Programs don't use shared text. Otherwise, how can they use -functions for scratch space after they are finished calling them? -% -Real Time, adj.: Here and now, as opposed to fake time, which only occurs there -and then. -% -Real wealth can only increase. - ― R. Buckminster Fuller -% -Receiving a million dollars tax free will make you feel better than -being flat broke and having a stomach ache. - ― Dolph Sharp, "I'm O.K., You're Not So Hot" -% -Recent investments will yield a slight profit. -% -Regardless of the legal speed limit, your Buick must be operated at -speeds faster than 85 MPH (140k/h). - ― presumable misprint from the 1987 Buick Grand National - owner's manual. -% -Reliable software must kill people reliably. - ― Andy Mickel -% -Religions revolve madly around sexual questions. -% -Religious bondage shackles and debilitates the mind and unfits it for -every noble enterprise. - ― James Madison, in a letter to William Bradford, April 1, 1774 -% -Remember that whatever misfortune may be your lot, it could only be worse -in Cleveland. -% -Remember: You cannot drain the ocean with a teaspoon. - ― Ignas Bernstein -% -Removing the error messages "now that the program is working" is like -wearing a parachute on the ground, but taking it off once you're in the air. - ― Kernighan & Plauger [Software Tools] -% -Render unto Caesar if line 54 is larger than line 62. -% -Replace repetitive expressions by calls to a common function. -% -Reporter, n.: A writer who guesses his way to the truth and dispels it with a -tempest of words. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Research is what I'm doing when I don't know what I'm doing. - ― Wernher von Braun -% -Resisting temptation is easier when you think you'll probably get -another chance later on. -% -Revolution is the opiate of the intellectuals. - ― "Oh, Lucky Man" -% -Ride the tributaries to reach the sea. - ― Arab Proverb -% -Rocky's Lemma of Innovation Prevention - Unless the results are known in advance, funding agencies will - reject the proposal. -% -Rudin's Law: In a crisis that forces a choice to be made between alternative -courses of action, most people will choose the worse one possible. -% -Rule of Feline Frustration: - When your cat has fallen asleep on your lap and looks utterly - content and adorable, you will suddenly have to go to the - bathroom. -% -Rule of the Great: - When people you greatly admire appear to be thinking deep - thoughts, they probably are thinking about lunch. -% -Rules for driving in New York: - 1) Anything done while honking your horn is legal. - 2) You may park anywhere if you turn your four-way flashers on. - 3) A red light means the next six cars may go through the intersection. -% -SCCS, the source motel! Programs check in and never check out! - ― Ken Thompson -% -Saints should always be judged guilty until they are proven innocent. - ― George Orwell -% -Salad is what food eats. -% -Satire does not look pretty upon a tombstone. -% -Sattinger's Law: It works better if you plug it in. -% -Saying that Java is nice because it works on all OSes is like saying that -anal sex is nice because it works on all genders. - ― Alanna -% -Schapiro's Explanation: The grass is always greener on the other side ― -but that's because they use more manure. -% -Science has proof without any certainty. Creationists have certainty -without any proof. - ― Ashley Montague -% -Science is what happens when preconception meets verification. -% -Scott's First Law: No matter what goes wrong, it will probably look right. -% -Scott's Second Law: When an error has been detected and corrected, it will - be found to have been wrong in the first place. -Corollary: After the correction has been found in error, it will be - impossible to fit the original quantity back into the equation. -% -See, in my line of work you got to keep repeating things over and over and -over again for the truth to sink in, to kind of catapult the propaganda. - ― George W. Bush; Greece, New York; May 24, 2005 -% -Seminars, n.: From "semi" and "arse", hence, any half-assed discussion. -% -Semper ubi sub ubi. -% -Serocki's Stricture: Marriage is always a bachelor's last option. -% -Sex is the mathematics urge sublimated. - ― M. C. Reed. -% -Sex is the poor man's opera. - ― G. B. Shaw -% -Sex without love is an empty experience, but, as empty experiences go, -it's one of the best. - ― Woody Allen -% -Shake hands with your mother again. - ― from an old hymn -% -Shaw's Principle: - Build a system that even a fool can use, and only a fool will - want to use it. -% -She hates testicles, thus limiting the men she can admire to Democratic -candidates for president. - ― John Greenway, "The American Tradition", on feminist - Elizabeth Gould Davis -% -She missed an invaluable opportunity to give him a look that you could -have poured on a waffle ... -% -Short words are best, and the old words when short are best of all. - ― Winston Churchill -% -Show business is just like high school, except you get paid. - ― Martin Mull -% -Show me a man who is a good loser and I'll show you a man who is -playing golf with his boss. -% -Silverman's Law: If Murphy's Law can go wrong, it will. -% -Simon's Law: Everything put together falls apart sooner or later. -% -Sin has many tools, but a lie is the handle which fits them all. -% -Skinner's Constant (or Flannagan's Finagling Factor): That quantity which, -when multiplied by, divided by, added to, or subtracted from the answer you -get, gives you the answer you should have gotten. -% -Slime is the agony of water. - ― Jean-Paul Sartre -% -So far as I can remember, there is not one word in the Gospels in -praise of intelligence. - ― Bertrand Russell -% -So we follow our wandering paths, and the very darkness acts as our guide and -our doubts serve to reassure us. - ― Jean-Pierre de Caussade, eighteenth-century Jesuit priest -% -So where the sheer incompetence of politicians and generals used to start -wars, the sheer incompetence of us computer people has now put an end to -it. No mean feat. For centuries humanity has been looking for the Weapon -That Would End War Forever. We have found it. War has ended, not with the -bang of a bomb, but with the gentle whisper of crashing software. - ― Gerard Stafleu (gerard@uwovax.uwo.ca) -% -So why don't you make like a tree, and get outta here. - ― Biff in "Back to the Future" -% -Socialism is power, power, and more power. - ― Oswald Spengler, Hitler's intellectual forebear -% -Society is the presumption of habit over instinct. - ― Peter Taylor -% -Sodd's Second Law: Sooner or later, the worst possible set of circumstances is -bound to occur. -% -Software entities are more complex for their size than perhaps any other human -construct because no two parts are alike. If they are, we make the two -similar parts into a subroutine ― open or closed. In this respect, software -systems differ profoundly from computers, buildings, or automobiles, where -repeated elements abound. - ― Fred Brooks, Jr. -% -Software suppliers are trying to make their software packages more -'user-friendly'.... Their best approach, so far, has been to take -all the old brochures, and stamp the words, 'user-friendly' on the cover. - ― Bill Gates, President, Microsoft, Inc. -% -Some cause happiness wherever they go; others, whenever they go. - ― Oscar Wilde -% -Some grow with responsibility, others just swell. - ― Arnold Glasow -% -Some men are discovered; others are found out. -% -Some people are born mediocre, some people achieve mediocrity, and some -people have mediocrity thrust upon them. - ― Joseph Heller, "Catch-22" -% -Some people fall for everything and stand for nothing. -% -Some people hope to achieve immortality through their works or their children. -I would prefer to achieve it by not dying. - ― Woody Allen -% -Some people in this department wouldn't recognize subtlety if it hit -them on the head. -% -Some people like my advice so much that they frame it upon the wall -instead of using it - ― Gordon R. Dickson -% -Sometimes I wonder if men and women really suit each other. Perhaps they -should live next door and just visit now and then. - ― Katherine Hepburn -% -Sometimes I worry about being a success in a mediocre world. - ― Lily Tomlin -% -Sometimes a cigar is just a cigar. - ― Sigmund Freud -% -Sometimes the only solution is to find a new problem. -% -Sometimes the only way out of a difficulty is through it. -% -Sometimes, too long is too long. - ― Joe Crowe -% -Spark's Sixth Rule for Managers: If a subordinate asks you a pertinent -question, look at him as if he had lost his senses. When he looks down, -paraphrase the question back at him. -% -Speak softly and carry a +6 two-handed sword. -% -Speaking as someone who has delved into the intricacies of PL/I, I am sure -that only Real Men could have written such a machine-hogging, -cycle-grabbing, all-encompassing monster. Allocate an array and free the -middle third? Sure! Why not? Multiply a character string times a bit -string and assign the result to a float decimal? Go ahead! Free a -controlled variable procedure parameter and reallocate it before passing it -back? Overlay three different types of variable on the same memory -location? Anything you say! Write a recursive macro? Well, no, but Real -Men use rescan. How could a language so obviously designed and written by -Real Men not be intended for Real Man use? -% -Spiritual leadership should remain spiritual leadership and the temporal -power should not become too important in any church. - ― Eleanor Roosevelt -% -Stability itself is nothing else than a more sluggish motion. -% -Stay out of the road, if you want to grow old. - ― Pink Floyd -% -Steinbach's Guideline for Systems Programming - Never test for an error condition you don't know how to - handle. -% -Stock brokers invest your money until it's all gone. - ― Woody Allen -% -Stop searching. Happiness is right next to you. Now, if it'd only take a bath. -% -Stult's Report: Our problems are mostly behind us. What we have to do now is -fight the solutions. -% -Stupidity, like virtue, is its own reward. -% -Sturgeon's Law: Ninety percent of everything is crap. -% -Success is a journey, not a destination. -% -Success is not free. Neither is failure. - ― Ray Kroc -% -Success is the ability to go from one failure to another with no loss -of enthusiasm. - ― Winston Churchill -% -Success is what happens when something goes right. - ― Arnold Glasow -% -Successful and fortunate crime is called virtue. - ― Seneca -% -Succumb to natural tendencies. Be hateful and boring. -% -Superiority is always detested. - ― Balasar Gracian -% -Sure there are dishonest men in local government. But there are dishonest -men in national government too. - ― Richard M. Nixon -% -Swipple's Rule of Order: He who shouts the loudest has the floor. -% -TV is chewing gum for the eyes. - ― Frank Lloyd Wright -% -Tact is the ability to tell a man he has an open mind when he has a -hole in his head. -% -Tact is the art of making a point without making an enemy. -% -Tact is the great ability to see other people as they think you see them. -% -Tact, n.: The unsaid part of what you're thinking. -% -Take care of the luxuries and the necessities will take care of themselves. -% -Take everything in stride. Trample anyone who gets in your way. -% -Take heart amid the deepening gloom that your dog is finally getting -enough cheese. - ― National Lampoon, "Deteriorada" -% -Take my word for it, the silliest woman can manage a clever man, but it -needs a very clever woman to manage a fool. - ― Kipling -% -Take what you can use and let the rest go by. - ― Ken Kesey -% -Tax reform means "Don't tax you, don't tax me, tax that fellow behind -the tree." - ― Russell Long -% -Teach a child to be polite and courteous in the home, and, when he -grows up, he will never be able to edge his car onto a freeway. -% -Technological progress has merely provided us with more efficient means -for going backwards. - ― Aldous Huxley -% -Tell a man that there are 300 billion stars in the universe, and he'll believe -you.... Tell him that a bench has wet paint upon it and he'll have to touch it -to be sure. -% -Ten years of rejection slips is nature's way of telling you to stop writing. - ― R. Geis -% -Than self restraint, there is nothing better. - ― Lao Tzu -% -That 150 lawyers should do business together ought not to be expected. - ― Thomas Jefferson, on the U.S. Congress. -% -That government is best which governs least. - ― Thomas Jefferson -% -That government is best which governs not at all. - ― Henry David Thoreau -% -That is the key to history. Terrific energy is expended ― civilizations -are built up ― excellent institutions devised; but each time something -goes wrong. Some fatal flaw always brings the selfish and cruel people to -the top, and then it all slides back into misery and ruin. In fact, the -machine conks. It seems to start up all right and runs a few yards, and -then it breaks down. - ― C. S. Lewis -% -That man is richest whose pleasures are cheapest. - ― Thoreau -% -That which is not good for the swarm, neither is it good for the bee. -% -That's the thing about people who think they hate computers. What they -really hate is lousy programmers. - ― Larry Niven and Jerry Pournelle in "Oath of Fealty" -% -The Abrams' Principle: The shortest distance between two points is off the -wall. -% -The Briggs/Chase Law of Program Development: To determine how long it will -take to write and debug a program, take your best estimate, multiply that -by two, add one, and convert to the next higher units. -% -The English have no respect for their language, and will not teach -their children to speak it. - ― G. B. Shaw -% -The Fifth Rule: You have taken yourself too seriously. -% -The IQ of the group is the lowest IQ of a member of the group divided -by the number of people in the group. -% -The Idea is like grass. It craves light, likes crowds, thrives on -cross-breeding, grows better for being stepped on. - ― Ursula K. LeGuin, "The Dispossessed" -% -The Kennedy Constant: Don't get mad ― get even. -% -The Law of Software Envelopment (at MIT): Every program at MIT attempts to -expand until it can read mail. Those programs which cannot expand are -replaced by ones which can. -% -The Law, in its majestic equality, forbids the rich, as well as the poor, -to sleep under the bridges, to beg in the streets, and to steal bread. - ― Anatole France -% -The Official MBA Handbook on business cards: Avoid overly pretentious job -titles such as "Lord of the Realm, Defender of the Faith, Emperor of India" -or "Director of Corporate Planning." -% -The real art of conversation is not only to say the right thing at the -right place but to leave unsaid the wrong thing at the tempting moment. - ― Dorothy Nevill -% -The Roman Rule: The one who says it cannot be done should never interrupt the -one who is doing it. -% -The Swartzberg Test: The validity of a science is its ability to predict. -% -The Third Law of Photography: If you did manage to get any good shots, they -will be ruined when someone inadvertently opens the darkroom door and all -of the dark leaks out. -% -The Tree of Learning bears the noblest fruit, but noble fruit tastes bad. -% -The USA is so enormous, and so numerous are its schools, colleges and -religious seminaries, many devoted to special religious beliefs ranging -from the unorthodox to the dotty, that we can hardly wonder at its -yielding a more bounteous harvest of gobbledygook than the rest of the -world put together. - ― Sir Peter Medawar -% -The United States has entered an anti-intellectual phase in its history, -perhaps most clearly seen in our virtually thought-free political life. - ― David Baltimore -% -The [Ford Foundation] is a large body of money completely surrounded by -people who want some. - ― Dwight MacDonald -% -The advertisement is the most truthful part of a newspaper - ― Thomas Jefferson -% -The ambassador and the general were briefing me on the―the vast majority -of Iraqis want to live in a peaceful, free world. And we will find these -people and we will bring them to justice. - ― George W. Bush, Washington, D.C.; October 28, 2003 -% -The angels wanna wear my red shoes. -% -The applause of a single human being is of great consequence. - ― Samuel Johnson -% -The attacker must vanquish; the defender need only survive. -% -The attention span of a computer is as long as its electrical cord. -% -The author should gaze at Noah, and ... learn, as they did in the Ark, to crowd -a great deal of matter into a very small compass. - ― Sydney, Smith, Edinburgh Review -% -The average woman would rather have beauty than brains, because the -average man can see better than he can think. -% -The best cure for anger is delay. - ― Seneca -% -The best prophet of the future is the past. -% -The best that we can do is to be kindly and helpful toward our friends and -fellow passengers who are clinging to the same speck of dirt while we are -drifting side by side to our common doom. - ― Clarence Darrow -% -The best thing about a boolean is even if you are wrong, you are only off -by a bit. - ― Anonymous -% -The best thing about growing older is that it takes such a long time. -% -The best way to break a bad habit is to drop it. - ― Anonymous -% -The better part of maturity is knowing your goals. - ― Arnold Glasow -% -The biggest difference between time and space is that you can't reuse -time. - ― Merrick Furst -% -The chain that can be yanked is not the cosmic chain. - ― Cal Keegan -% -The chicken that clucks the loudest is the one most likely to show up -at the steam fitters' picnic. -% -The chief barrier to happiness is envy. - ― Frank Tyger -% -The chief cause of problems is solutions. - ― Eric Sevareid, CBS Evening News, December 29, 1970 -% -The city of the dead antedates the city of the living. - ― Lewis Mumford -% -The clothes have no emperor. - ― C. A. Hoare, about Ada. -% -The complexity of software is an essential property, not an accidental one. -Hence, descriptions of a software entity that abstract away its complexity -often abstract away its essence. - ― Fred Brooks, Jr. -% -The computing field is always in need of new cliches. - ― Alan Perlis -% -The connection between the language in which we think/program and the problems -and solutions we can imagine is very close. For this reason restricting -language features with the intent of eliminating programmer errors is at best -dangerous. - ― Bjarne Stroustrup in "The C++ Programming Language" -% -The correct way to punctuate a sentence that starts: "Of course it is -none of my business, but ―" is to place a period after the word "but." -Don't use excessive force in supplying such a moron with a period. -Cutting his throat is only a momentary pleasure and is bound to get you -talked about. - ― Lazarus Long, "Time Enough for Love" -% -The cost of living hasn't affected its popularity. -% -The cost of living is going up, and the chance of living is going -down. -% -The country needs and, unless I mistake its temper, the country demands bold, -persistent experimentation. - ― Franklin Delano Roosevelt -% -The cow is nothing but a machine which makes grass fit for us people to eat. - ― John McNulty -% -The day will come when the mystical generation of Jesus, by the Supreme Being -as his Father, in the womb of a virgin will be classified with the fable of -the generation of Minerva in the brain of Jupiter. But we may hope that the -dawn of reason and freedom of thought in these United States will do away with -this artificial scaffolding and restore to us the primitive and genuine -doctrines of this most venerated Reformer of human errors. - ― Thomas Jefferson -% -The day-to-day travails of the IBM programmer are so amusing to most of -us who are fortunate enough never to have been one ― like watching -Charlie Chaplin trying to cook a shoe. -% -The debate rages on: Is PL/I Bachtrian or Dromedary? -% -The decision didn't have to be logical, it was unanimous. -% -The devil finds work for idle circuits to do. -% -The difference between Genius and Stupidity is that Genius has limits. -% -The difference between science and the fuzzy subjects is that science -requires reasoning while those other subjects merely require scholarship. - ― Robert Heinlein -% -The difference between sympathy and empathy is three letters: "yes". - ― P. Taylor -% -The divinity of Jesus is made a convenient cover for absurdity. Nowhere -in the Gospels do we find a precept for Creeds, Confessions, Oaths, -Doctrines, and whole carloads of other foolish trumpery that we find in -Christianity. - ― John Adams -% -The earth is like a tiny grain of sand, only much, much heavier. -% -The end move in politics is always to pick up a gun. - ― Buckminster Fuller -% -The end of labor is to gain leisure. -% -The end of the world will occur at 3:00 p.m., this Friday, with -symposium to follow. -% -The envious man grows lean at the success of his neighbor. - ― Horace -% -The evolution of the human race will not be accomplished in the ten thousand -years of tame animals, but in the million years of wild animals, because man -is and will always be a wild animal. - ― Charles Galton Darwin -% -The existence of god implies a violation of causality. -% -The fact that it works is immaterial. - ― L. Ogborn -% -The famous politician was trying to save both his faces. -% -The fancy is indeed no other than a mode of memory emancipated from the order -of space and time. - ― Samuel Taylor Coleridge -% -The fault lies not with our technologies but with our systems. - ― Roger Levian -% -The finest eloquence is that which gets things done. -% -The first 90% of a project takes 90% of the time. The last 10% of a project -takes 90% of the time. -% -The first and great commandment is: Do not let them scare you. - ― Elmer Davis -% -The first duty of a revolutionary is to get away with it. - ― Abbie Hoffman -% -The first rule of intelligent tinkering is to save all the parts. - ― Paul Erlich -% -The flow chart is a most thoroughly oversold piece of program documentation. - ― Frederick Brooks, Jr., The Mythical Man Month -% -The flush toilet is the basis of Western civilization. - ― Alan Coult -% -The following statement is true. -The previous statement is false. -% -The fountain code has been tightened slightly so you can no longer dip objects -into a fountain or drink from one while you are floating in mid-air due to -levitation. - -Teleporting to hell via a teleportation trap will no longer occur if the -character does not have fire resistance. - - ― README file from the NetHack game -% -The fourth law of thermodynamics: -The perversity of the universe tends towards a maximum. -% -The fundamentalists, by "knowing" the answers before they start [examining -evolution], and then forcing nature into the straitjacket of their -discredited preconceptions, lie outside the domain of science―-or of any -honest intellectual inquiry. - ― Stephen Jay Gould, Bully for Brontosaurus (1990) -% -The future isn't what it used to be. (It never was.) -% -The generation of random numbers is too important to be left to chance. -% -The gentlemen looked one another over with microscopic carelessness. -% -The goal of Computer Science is to build something that will last at -least until we've finished building it. -% -The goal of science is to build better mousetraps. -The goal of nature is to build better mice. -% -The government of the United States is not in any sense founded -on the Christian Religion. - ― George Washington (The Treaty of Tripoli) -% -The greatest of faults is to be conscious of none. -% -The greatest warriors are the ones who fight for peace. - ― Holly Near -% -The hand that rocks the cradle can also cradle a rock. - ― Feminist saying, circa 1968-1972 -% -The hardest thing to open is a closed mind. - ― Leo Burnett -% -The heart has no rainbows when the eye has no tears. -% -The hell with the Prime Directive: let's kill something. -% -The herd instinct among economists makes sheep look like independent -thinkers. -% -The human animal differs from the lesser primates in his passion for -lists of "Ten Best". - ― H. Allen Smith -% -The human mind ordinarily operates at only ten percent of its capacity -― the rest is overhead for the operating system. -% -The human mind treats a new idea the way the body treats a strange -protein ― it rejects it. - ― P. Medawar -% -The hypothesis: Amid a wash of paper, a small number of documents become the -critical pivots around which every project's management revolves. These are the -manager's chief personal tools. - ― Frederick P. Brooks, Jr., The Mythical Man Month -% -The idea that Bill Gates has appeared like a knight in shining armour to -lead all customers out of a mire of technological chaos neatly ignores the -fact that it was he who, by peddling second-rate technology, led them into -it in the first place. - ― attributed to Douglas Adams -% -The ideal is impossible. The idea of the ideal is essential. - ― P. Taylor -% -The inability to benefit from feedback appears to be the primary cause of -pseudoscience. Pseudoscientists retain their beliefs and ignore or distort -contradictory evidence rather than modify or reject a flawed theory. Because -of their strong biases, they seem to lack the self-correcting mechanisms -scientists must employ in their work. - ― Thomas L. Creed, "The Skeptical Inquirer," Summer 1987 -% -The individual choice of garnishment of a burger can be an important -point to the consumer in this day when individualism is an increasingly -important thing to people. - ― Donald N. Smith, president of Burger King -% -The Internet? Is that thing still around? - ― Homer Simpson -% -The Internet is the most powerful stupidity amplifier ever invented. It’s -like television without the television part. - - James “Kibo” Perry -% -The lame in the path outstrip the swift who wander from it. - ― Francis Bacon -% -The last thing one knows in constructing a work is what to put first. - ― Blaise Pascal -% -The life of a repo man is always intense. -% -The life of money-making is one undertaken under compulsion, and wealth is -evidently not the good we are seeking, for it is merely useful for the sake -of something else. - ― Aristotle -% -The life which is unexamined is not worth living. -% -The light at the end of the tunnel is the headlight of an approaching -train. -% -The lion and the calf shall lie down together but the calf won't get -much sleep. - ― Woody Allen -% -The longer I am out of office, the more infallible I appear to myself. - ― Henry Kissinger -% -The love of money is only one among many. - ― Alfred Marshall -% -The luck that is ordained for you will be coveted by others. -% -The main thing is the play itself. I swear that greed for money has nothing -to do with it, although heaven knows I am sorely in need of money. - ― Feodor Dostoyevsky -% -The man scarce lives who is not more credulous than he ought to be. ... -The natural disposition is always to believe. It is acquired wisdom and -experience only that teach incredulity, and they very seldom teach it -enough. - ― Adam Smith -% -The man who follows the crowd will usually get no further than the -crowd. The man who walks alone is likely to find himself in places no -one has ever been. - ― Alan Ashley-Pitt -% -The man who makes no mistakes does not usually make anything. -% -The marvels of today's modern technology include the development of a soda -can, when discarded will last forever; and a $20,000 car which, when -properly cared for, will rust out in two or three years. -% -The meek are contesting the will. -% -The meek shall inherit the earth ― they are too weak to refuse. -% -The meek shall inherit the earth, but not its mineral rights. - ― J. Paul Getty -% -The meek shall inherit the earth. The rest of us will go to the stars. -% -The meek will inherit the Earth..... The rest of us will go to the stars. -% -The mistake you make is in trying to figure it out. - ― Tenessee Williams -% -The moon may be smaller than Earth, but it's further away. -% -The more laws and order are made prominent, the more thieves and -robbers there will be. - ― Lao Tsu -% -The more things change, the more they stay insane. -% -The more things change, the more they'll never be the same again. -% -The more we disagree, the more chance there is that at least one of us -is right. -% -The mosquito is the state bird of New Jersey. - ― Andy Warhol -% -The most exciting phrase to hear in science, the one that heralds new -discoveries, is not "Eureka!" (I found it!) but "That's funny ..." - ― Isaac Asimov -% -The most merciful thing in the world ... is the inability of the human mind to -correlate all its contents. - ― H. P. Lovecraft -% -The new Congressmen say they're going to turn the government around. I -hope I don't get run over again. -% -The next six days are dangerous. -% -The nice thing about standards is that there are so many of them to -choose from. - ― Andrew S. Tanenbaum -% -The notion of a "record" is an obsolete remnant of the days of the -80-column card. - ― Dennis M. Ritchie -% -The objective of all dedicated employees should be to thoroughly analyze -all situations, anticipate all problems prior to their occurrence, have -answers for these problems, and move swiftly to solve these problems when -called upon. However, when you are up to your ass in alligators it is -difficult to remind yourself your initial objective was to drain the swamp. -% -The older a man gets, the farther he had to walk to school as a boy. -% -The one charm of marriage is that it makes a life of deception a necessity. - ― Oscar Wilde -% -The one good thing about repeating your mistakes is that you know when -to cringe. -% -The only difference between a rut and a grave is the depth. -% -The only good bug is a dead bug. -But the best bug is the one that wasn't there to begin with. -% -The only possible interpretation of any research whatever in the -`social sciences' is: some do, some don't. - ― Ernest Rutherford -% -The only problem with being a man of leisure is that you can never stop -and take a rest. -% -The only thing necessary for the triumph of evil is for good men to do nothing. - ― Edmund Burke -% -The only things worth learning are the things you learn after you know it all. - ― Harry S Truman -% -The only thing to do with good advice is pass it on. It is never any -use to oneself. - ― Oscar Wilde -% -The only way to amuse some people is to slip and fall on an icy pavement. -% -The only way to get rid of a temptation is to yield to it. - ― Oscar Wilde -% -The only way to learn a new programming language is by writing programs in it. - ― Brian Kernighan -% -The opossum is a very sophisticated animal. It doesn't even get up -until 5 or 6 pm. -% -The opposite of a correct statement is a false statement. But the opposite of a -profound truth may well be another profound truth. - ― Niels Bohr -% -The opposite of a profound truth may well be another profound truth. - ― Bohr -% -The optimum committee has no members. - ― Norman Augustine -% -The past always looks better than it was. It's only pleasant because -it isn't here. - ― Finley Peter Dunne (Mr. Dooley) -% -The personal computer market is about the same size as the total potato -chip market. Next year it will be about half the size of the pet food -market and is fast approaching the total worldwide sales of pantyhose - ― James Finke, President, Commodore Int'l Ltd. (1982) -% -The pitcher wound up and he flang the ball at the batter. The batter -swang and missed. The pitcher flang the ball again and this time the -batter connected. He hit a high fly right to the center fielder. The -center fielder was all set to catch the ball, but at the last minute -his eyes were blound by the sun and he dropped it. - ― Dizzy Dean -% -The plural of spouse is spice. -% -The police are not there to create disorder. The police are there to -preserve disorder. - ― The late Richard J. Daly, Mayor of the city of Chicago -% -The power to destroy a planet is insignificant when compared to the power of -the Force. - ― Darth Vader -% -The price of greatness is responsibility. - ― Winston Churchill -% -The price one pays for pursuing any profession, or calling, is an intimate -knowledge of its ugly side. - ― James Baldwin -% -The primary purpose of the DATA statement is to give names to -constants; instead of referring to pi as 3.141592653589793 at every -appearance, the variable PI can be given that value with a DATA -statement and used instead of the longer form of the constant. This -also simplifies modifying the program, should the value of pi change. - ― FORTRAN manual for Xerox Computers -% -The probability of someone watching you is directly proportional to the -stupidity of your action. -% -The problem with any unwritten law is that you don't know where to go -to erase it. - ― Glaser and Way -% -The problem with being best man at a wedding is that you never get a -chance to prove it. -% -The problem with people who have no vices is that generally you can be -pretty sure they're going to have some pretty annoying virtues. - ― Elizabeth Taylor -% -The problem with the gene pool is that there is no lifeguard. -% -The program is absolutely right; therefore the computer must be wrong. -% -The programmer, like the poet, works only slightly removed from pure thought- -stuff. He builds his castles in the air, from air, creating by exertion of the -imagination. Few media of creation are so flexible, so easy to polish and -rework, so readily capable of realizing grand conceptual structures. - ― Frederick Brooks, Jr., The Mythical Man Month -% -The purpose of most meetings seems to be to get as much human meat as possible -into one room. - ― James Iry, via Twitter -% -The race is not always to the swift, nor the battle to the strong ― -but that's the way to bet. - ― Damon Runyon -% -The rain it raineth on the just - And also on the unjust fella, -But chiefly on the just, because - The unjust steals the just's umbrella. -% -The reason ESP, for example, is not considered a viable topic in -contemporary psychology is simply that its investigation has not proven -fruitful...After more than 70 years of study, there still does not exist -one example of an ESP phenomenon that is replicable under controlled -conditions. This simple but basic scientific criterion has not been met -despite dozens of studies conducted over many decades... It is for this -reason alone that the topic is now of little interest to psychology... In -short, there is no demonstrated phenomenon that needs explanation. - ― Keith E. Stanovich, "How to Think Straight About Psychology", - pp. 160-161 -% -The reason computer chips are so small is computers don't eat much. -% -The reason we struggle with insecurity is because we compare our -behind-the-scenes with everyone else's highlight reel. - ― Steve Furtick -% -The reasonable man adapts himself to the world; the unreasonable one -persists in trying to adapt the world to himself. Therefore all -progress depends on the unreasonable man. - ― George Bernard Shaw -% -The revolution will not be televised. -% -The reward of a thing well done is to have done it. - ― Emerson -% -The right half of the brain controls the left half of the body. -This means that only left handed people are in their right mind. -% -The right half of the brain controls the left half of the body. -This means that only left-handed people are in their right minds. -% -The road to to success is always under construction. - ― Florian Bruckner -% -The secret cement of any organization is trust. - ― Donald E. Walker -% -The shell must break before the bird can fly. - ― Alfred, Lord Tennyson -% -The shortest distance between two points is under construction. - ― Noelie Altito -% -The silly question is the first intimation of some totally new development. -% -The so-called "desktop metaphor" of today's workstations is instead an -"airplane-seat" metaphor. Anyone who has shuffled a lap full of papers while -seated between two portly passengers will recognize the difference ― one can -see only a very few things at once. - ― Fred Brooks, Jr. -% -The solution to a problem changes the problem. - ― J. Martin -% -The sooner all the animals are extinct, the sooner we'll find their money. - ― Ed Bluestone -% -The soul would have no rainbow had the eyes no tears. -% -The steady state of disks is full. - ―Ken Thompson -% -The study of theology, as it stands in the Christian churches, is the study -of nothing; it is founded on nothing; it rests on no principles; it -proceeds by no authority; it has no data; it can demonstrate nothing; and -it admits of no conclusion. - ― Thomas Paine, from The Age of Reason -% -The subject matter of research is no longer nature in itself, but nature -subjected to human questioning . . . - ― Werner Heisenberg -% -The sun was shining on the sea, -Shining with all his might: -He did his very best to make -The billows smooth and bright ― -And this was very odd, because it was -The middle of the night. - ― Lewis Carroll, "Through the Looking Glass" -% -The superfluous is very necessary. - ― Voltaire -% -The sweetest of all sounds is praise. - ― Xenophon -% -The tar pit of software engineering will continue to be sticky for a long time -to come. One can expect the human race to continue attempting systems just -within or just beyond our reach; and software systems are perhaps the most -intricate and complex of man's handiworks. The management of this complex -craft will demand our best use of new languages and systems, our best -adaptation of proven engineering management methods, liberal doses of common -sense, and ... humility to recognize our fallibility and limitations. - ― Frederick Brooks, Jr., The Mythical Man Month -% -The Three Laws of Thermodynamics -The First Law: You can't get anything without working for it. -The Second Law: The most you can accomplish by working is to break even. -The Third Law: You can only break even at absolute zero. -% -The time is right to make new friends. -% -The trouble with a kitten is that -When it grows up, it's always a cat - ― Ogden Nash. -% -The trouble with being poor is that it takes up all your time. -% -The trouble with being punctual is that people think you have nothing -more important to do. -% -The trouble with doing something right the first time is that nobody -appreciates how difficult it was. -% -The trouble with programmers is that you can never tell what a programmer -is doing until it's too late. - ― Seymour Cray -% -The trouble with us in America isn't that the poetry of life has turned to -prose, but that it has turned to advertising copy. - ― Louis Kronenberger -% -The truth is that all those having power ought to be mistrusted. - ― James Madison -% -The truth of a proposition has nothing to do with its credibility. And -vice versa. -% -The typical page layout program is nothing more than an electronic -light table for cutting and pasting documents. -% -The universe is laughing behind your back. -% -The unnatural, that too is natural. - ― Goethe -% -The use of COBOL cripples the mind; its teaching should, therefore, be -regarded as a criminal offense. - ― E. W. Dijkstra (1982) -% -The vigor of civilized societies is preserved by the widespread sense that -high aims are worth-while. Vigorous societies harbor a certain -extravagance of objectives, so that men wander beyond the safe provision of -personal gratifications. All strong interests easily become impersonal, -the love of a good job well done. There is a sense of harmony about such -an accomplishment, the Peace brought by something worth-while. - ― Alfred North Whitehead, 1963, in "The History of Manned Space - Flight" -% -The way to make a small fortune in the stock market is to start with a -large one. -% -The Web is like a dominatrix. Everywhere I turn, I see little buttons -ordering me to Submit. - ― Nytwind -% -The whole earth is in jail and we're plotting this incredible jailbreak. - ― Wavy Gravy -% -The wife you save may be your own. - ― Unofficial slogan of supporters of one of FDR's sons, - a notorious womanizer, during the son's first congressional race -% -The wise shepherd never trusts his flock to a smiling wolf. -% -The world is a fantasy, so let's find out about it. - ― Astrophysicist Dennis Sciama, to Timothy Ferris (quoted in - Ferris's book, "The Mind's Sky") -% -The world is coming to an end. Please log off. -% -[The World Wide Web is] the only thing I know of whose shortened -form―www―takes three times longer to say than what it's short for. - ― attributed to Douglas Adams -% -The world is divided into two kinds of people: those who think the world is -divided into two kinds of people and those who do not. -% -The world is no nursery. - ― Sigmund Freud -% -The world looks as if it has been left in the custody of trolls. - ― Father Robert F. Capon -% -The world will not recognize your talent until you demonstrate it. -% -The world's as ugly as sin, -And almost as delightful - ― Frederick Locker-Lampson -% -The worst form of failure is the failure to try. -% -The years of peak mental activity are undoubtedly between the ages of -four and eighteen. At four we know all the questions, at eighteen all -the answers. -% -Theorem: A cat has nine tails. Proof: No cat has eight tails. A cat has one -tail more than no cat. Therefore, a cat has nine tails. -% -There ain't no such thing as a free lunch. -% -There are 10 types of people who understand binary: The ones who do, and -the ones who don't. -% -There are a lot of lies going around.... and half of them are true. - ― Winston Churchill -% -There are four kinds of homicide: felonious, excusable, justifiable, -and praiseworthy ... - ― Ambrose Bierce, "The Devil's Dictionary" -% -There are no bugs, only unrecognized features. -% -There are no giant crabs in here, Frank. -% -There are no saints, only unrecognized villains. -% -There are only two kinds of programming languages: those people always -bitch about and those nobody uses. - ― Bjarne Stroustrup -% -There are some micro-organisms that exhibit characteristics of both -plants and animals. When exposed to light they undergo photosynthesis; -and when the lights go out, they turn into animals. But then again, -don't we all? -% -There are 10 kinds of people. Those who know binary and those who don't. -% -There are things that are so serious that you can only joke about them. - ― Heisenberg -% -There are three kinds of lies: Lies, Damn Lies, and Statistics. - ― Disraeli -% -There are three ways to get something done: do it yourself, hire -someone, or forbid your kids to do it. -% -There are two novels that can change a bookish fourteen-year old's life: -"The Lord of the Rings" and "Atlas Shrugged". One is a childish fantasy -that often engenders a lifelong obsession with its unbelievable heroes, -leading to an emotionally stunted, socially crippled adulthood, unable to -deal with the real world. The other, of course, involves orcs. - ― John Rogers (kfmonkey.blogspot.com/2009/03/ephemera-2009-7.html) -% -There are two ways of constructing a software design. One way is to make -it so simple that there are obviously no deficiencies and the other is to -make it so complicated that there are no obvious deficiencies. - ― Charles Anthony Richard Hoare -% -There are two ways to write error-free programs. Only the third one works. -% -There are two ways to be fooled. One is to believe what isn't true. The other -is to refuse to accept what is true. - ― Søren Kierkegaard -% -There are very few personal problems that cannot be solved through a -suitable application of high explosives. -% -There can be no offense where none is taken. - ― Japanese proverb -% -There cannot be a crisis next week. My schedule is already full. - ― Henry Kissinger -% -There has been an alarming increase in the number of things you know nothing -about. -% -There is a bear following you around. -% -There is a decivilizing bug somewhere at work; unconsciously persons of -stern worth, by not resenting and resisting the small indignities of the -times, are preparing themselves for the eventual acceptance of what they -themselves know they don't want. - ― attributed to E.B. White -% -There is a great discovery still to be made in Literature: that of -paying literary men by the quantity they do NOT write. -% -There is no "Complete Idiot's Guide to Creationism," but perhaps one is not -needed. - ― Andrei Codrescu, on NPR Aug. 25, 1999 -% -There is no excuse for the use of the word "synergies" on any project where -common sense and straight talking are the norm. - ― Paul Robinson , in a post to the - FreeBSD-Hackers mailing list, 17 July, 2003 -% -There is some sort of perverse pleasure in knowing that it's basically -impossible to send a piece of hate mail through the Internet without its -being touched by a gay program. That's kind of funny. - ― Eric Allman -% -There is one safeguard known generally to the wise, which is an advantage -and security to all, but especially to democracies as against despots. What -is it? Distrust. - ― Demosthenes: Philippic 2, sect. 24. -% -There is a time in the tides of men, -Which, taken at its flood, leads on to success. -On the other hand, don't count on it. - ― T. K. Lawson -% -There is danger in delaying, good fortune in acting. -% -There is no choice before us. Either we must Succeed in providing the -rational coordination of impulses and guts, or for centuries civilization -will sink into a mere welter of minor excitements. We must provide a Great -Age or see the collapse of the upward striving of the human race. - ― Alfred North Whitehead -% -There is no heavier burden than a great potential. -% -There is no idea so sacred that it cannot be questioned, analyzed... -and ridiculed. - ― Cal Keegan -% -There is no realizable power that man cannot, in time, fashion the tools to -attain, nor any power so secure that the naked ape will not abuse it. So -it is written in the genetic cards ― only physics and war hold him in -check. And also the wife who wants him home by five, of course. - ― Encyclopadia Apocrypha, 1990 ed. -% -There is no satisfaction in hanging a man who does not object to it - ― G. B. Shaw -% -There is no statute of limitations on stupidity. - ― Randomly produced by a computer program called Markov3. -% -There is no substitute for good manners, except, perhaps, fast reflexes. -% -There is no such thing as not enough time if you are doing what you want to do. -% -There is no such thing as pure pleasure; some anxiety always goes with it. -% -There is no time like the pleasant. -% -There is no time like the present for postponing what you ought to be doing. -% -There is nothing in this world constant but inconstancy. - ― Swift -% -There is nothing so deadly as not to hold up to people the opportunity to -do great and wonderful things, if we wish to stimulate them in an active way. - ― Dr. Harold Urey, Nobel Laureate in chemistry -% -There is only one thing in the world worse than being talked about, and -that is not being talked about. - ― Oscar Wilde -% -There is so much sand in Northern Africa that if it were spread out it -would completely cover the Sahara Desert. -% -There was nothing I hated more than to see a filthy old drunkie, a howling -away at the sons of his father and going blurp blurp in between as if it were -a filthy old orchestra in his stinking rotten guts. I could never stand to -see anyone like that, especially when they were old like this one was. - ― Alex in "Clockwork Orange" -% -There were in this country two very large monopolies. The larger of the -two had the following record: the Vietnam War, Watergate, double- digit -inflation, fuel and energy shortages, bankrupt airlines, and the 8-cent -postcard. The second was responsible for such things as the transistor, -the solar cell, lasers, synthetic crystals, high fidelity stereo recording, -sound motion pictures, radio astronomy, negative feedback, magnetic tape, -magnetic "bubbles", electronic switching systems, microwave radio and TV -relay systems, information theory, the first electrical digital computer, -and the first communications satellite. Guess which one got to tell the -other how to run the telephone business? -% -There will always be survivors. - ― Robert Heinlen -% -There will be big changes for you, but you will be happy. -% -There you go man, -Keep as cool as you can. -It riles them to believe that you perceive the web they weave. -Keep on being free! -% -There's a bug somewhere in your code. -% -There's a fine line between courage and foolishness. Too bad it's not a fence. -% -There's an old proverb that says just about whatever you want it to. -% -There's always someone, somewhere, -with a big nose, who knows -and who trips you up and laughs -when you fall. - ― The Smiths -% -There's at least one fool in every married couple. -% -There's got to be more to life than compile-and-go. -% -There's more than one way to skin a cat: - Way number 15 ― Krazy Glue and a toothbrush. -% -There's more than one way to skin a cat: - Way number 27 ― Use an electric sander. -% -There's more to life than sitting around in the sun in your underwear -playing the clarinet. -% -There's no future in time travel -% -There's no limit to how complicated things can get, on account of one -thing always leading to another. - ― E. B. White -% -There's no place like home. -% -There's no place like $HOME. -% -There's no point in being grown up if you can't be childish sometimes. - ― Dr. Who -% -There's nothing remarkable about it. All one has to do is hit the right -keys at the right time and the instrument plays itself. - ― J. S. Bach -% -There's nothing wrong with America that a good erection wouldn't cure. - ― David Mairowitz -% -There's only one way to have a happy marriage and as soon as I learn -what it is I'll get married again. - ― Clint Eastwood -% -There's so much plastic in this culture that vinyl leopard skin is -becoming an endangered synthetic. - ― Lily Tomlin -% -These patriots don't mince words... Okay, sure, they ARE dangerous, -hopelessly ignorant, inbred, retarded borderline lunatics with an -insatiable lust for the blood of sinners ― but at least they're HONEST -about it. - ― Reverend Ivan Stang, cofounder of the Church of the Subgenius, - about a group known as Free Love Ministries, in his book _High - Weirdness By Mail_ -% -They [preachers] dread the advance of science as witches do the approach -of daylight and scowl on the fatal harbinger announcing the subversions -of the duperies on which they live. - ― Thomas Jefferson -% -They also surf who only stand on waves. -% -They took some of the Van Goghs, most of the jewels, and all of the Chivas! -% -Things are always at their best in the beginning. - ― Pascal -% -Things are more like they are now than they ever were before. - ― Dwight D. Eisenhower -% -Things are more like they used to be than they are now. -% -Things are not as simple as they seems at first. - ― Edward Thorp -% -Things won't get any better, so get used to it. -% -Think honk if you're a telepath. -% -This fortune intentionally not included. -% -This fortune is false. -% -This fortune is inoperative. Please try another. -% -This fortune will self destruct in 5 years. -% -This isn't brain surgery; it's just television. - ― David Letterman -% -This space unintentionally left blank. -% -This was the ultimate form of ostentation among technology freaks ― to have -a system so complete and sophisticated that nothing showed; no machines, -no wires, no controls. - ― Michael Swanwick, "Vacuum Flowers" -% -Thoreau's Law: If you see a man approaching you with the obvious intent of -doing you good, you should run for your life. - ― Attributed to Thoreau by William H. Whyte, Jr., in - The Organization Man (1956) -% -Those of us who believe in the right of any human being to belong to whatever -church he sees fit, and to worship God in his own way, cannot be accused -of prejudice when we do not want to see public education connected with -religious control of the schools, which are paid for by taxpayers' money. - ― Eleanor Roosevelt -% -Those who are quick in deciding are in danger of being mistaken. - ― Sophocles -% -Those who believe in astrology are living in houses with foundations of -Silly Putty. - ― Dennis Rawlins, astronomer -% -Those who believe that they believe in God, but without passion in their -hearts, without anguish in mind, without uncertainty, without doubt, -without an element of despair even in their consolation, believe only in -the God idea, not God Himself. - ― Miguel de Unamuno, Spanish philosopher and writer -% -Those who bite the hand that feeds them usually lick the boot that kicks them. -% -Those who can, do; those who can't, simulate. -% -Those who can't repeat the past are condemned to remember it. - ― Mark O'Donnell -% -Those who do not understand Unix are condemned to reinvent it, poorly. - ― Henry Spencer, University of Toronto Unix hacker -% -Those who educate children well are more to be honored than parents, -for these only gave life, those the art of living well. - ― Aristotle -% -Those who in quarrels interpose, must often wipe a bloody nose. -% -Those who make peaceful revolution impossible will make violent -revolution inevitable. - ― John F. Kennedy -% -Those who talk don't know. Those who don't talk, know. -% -Those who want the Government to regulate matters of the mind and spirit -are like men who are so afraid of being murdered that they commit suicide -to avoid assassination. - ― Harry S Truman -% -Throw out your gold teeth / And see how they roll. -The answer they reveal: / Life is unreal. - ― Steely Dan -% -Time and tide wait for no man. -% -Time flies like an arrow. Fruit flies like a banana. -% -Time is an illusion perpetrated by the manufacturers of space. - ― Graffiti -% -Time is but the stream I go a-fishing in. -% -Time is nature's way of making sure that everything doesn't happen at once. -% -Time wounds all heels. -% -Times are bad. Children no longer obey their parents, and everyone is -writing a book. - ― Cicero -% -Tip the world over on its side and everything loose will land in Los Angeles. - ― Frank Lloyd Wright -% -To be awake is to be alive. - ― Henry David Thoreau, in "Walden Pond" -% -To be intoxicated is to feel sophisticated but not be able to say it. -% -To be is to program. -% -To be overbusy is a witless task. - ― Sophocles -% -To be perfect is to have changed often. - ― J. H. Newman -% -To be sure of hitting the target, shoot first, and call whatever you hit the -target. - ― Ashleigh Brilliant -% -To be wrong all the time is an effort, but some manage it. - ― William Feather -% -To be, or what? - ― Sylvester Stallone -% -To criticize the incompetent is easy; it is more difficult to criticize the -competent. -% -To do easily what is difficult for others is the mark of talent. - ― H. F. Amiel -% -To downgrade the human mind is bad theology. - ― C. K. Chesterton -% -To err is human, to compute divine. Trust your computer but not its programmer. - ― Morris Kingston -% -To err is human, to forgive divine. -% -To follow foolish precedents, and wink -With both our eyes, is easier than to think. - ― William Cowper -% -To invent products out of thin air, you don't ask people what they want ― -after all, who would've told you ten years ago that they needed a CD -player? You ask them what problems they have when they get up in the -morning. - ― Robert Hall, Sr. Vice President, GVO, as quoted in the December, - 1991, issue of Fortune -% -To invent, you need a good imagination and a pile of junk. - ― Thomas Edison -% -To iterate is human, to recurse, divine. -% -To knock a thing down, especially if it is cocked at an arrogant angle, is a -deep delight of the blood. - ― Georges Santayana -% -To know the world one must construct it. - ― Cesare Pavese -% -To laugh at men of sense is the privilege of fools. -% -To program anything that is programmable is obsession. -% -To program is to be. -% -To steal from a thief is not theft. It is merely irony. - ― Zorro, while retrieving money taxed from Californians -% -To steal from one person is theft. To steal from many is taxation. - ― Daiell's Law (a take-off on Felson's Law) -% -To teach is to learn. -% -To those accustomed to the precise, structured methods of conventional -system development, exploratory development techniques may seem messy, -inelegant, and unsatisfying. But it's a question of congruence: precision -and flexibility may be just as disfunctional in novel, uncertain situations -as sloppiness and vacillation are in familiar, well-defined ones. Those -who admire the massive, rigid bone structures of dinosaurs should remember -that jellyfish still enjoy their very secure ecological niche. - ― Beau Sheil, "Power Tools for Programmers" -% -Today is the first day of the rest of your lossage. -% -Today is the last day of your life so far. -% -Too clever is dumb. - ― Ogden Nash -% -Too much of a good thing is WONDERFUL. - ― Mae West -% -Trespassers will be shot. Survivors will be prosecuted. -% -Troglodytism does not necessarily imply a low cultural level. -% -True innovation often comes from the small startup who is lean enough to -launch a market but lacks the heft to own it. - ― Timm Martin -% -Truth has always been found to promote the best interests of mankind. - ― Percy Bysshe Shelley -% -Truthful, adj.: Dumb and illiterate. - ― Ambrose Bierce, "The Devil's Dictionary" -% -Try not to have a good time ... This is supposed to be educational. - ― Charles Schulz -% -Try to be the best of what you are, even if what you are is no good. - ― Ashleigh Brilliant -% -Trying to be happy is like trying to build a machine for which the only -specification is that it should run noiselessly. -% -Turnaucka's Law: The attention span of a computer is only as long as its -electrical cord. -% -Tussman's Law: Nothing is as inevitable as a mistake whose time has come. -% -Two can Live as Cheaply as One for Half as Long. - ― Howard Kandel -% -Two men look out through the same bars; one sees mud, and one the stars. -% -Two percent of zero is almost nothing. -% -UFO's are for real: the Air Force doesn't exist. -% -UFOs are for real. It's the Air Force that doesn't exist. -% -Uncertain fortune is thoroughly mastered by the equity of the calculation. - ― Blaise Pascal -% -Uncle Ed's Rule of Thumb: - Never use your thumb for a rule. You'll either hit it with a - hammer or get a splinter in it. -% -Uncompensated overtime? Just Say No. -% -Under any conditions, anywhere, whatever you are doing, there is some -ordinance under which you can be booked. - ― Robert D. Sprecht (Rand Corp) -% -Under deadline pressure for the next week. If you want something, it -can wait. Unless it's blind screaming paroxysmally hedonistic ... -% -Underlying Principle of Socio-Genetics: - Superiority is recessive. -% -United Nations, New York, December 25. The peace and joy of the -Christmas season was marred by a proclamation of a general strike of -all the military forces of the world. Panic reigns in the hearts of -all the patriots of every persuasion. - -Meanwhile, fears of universal disaster sank to an all-time low over the -world. - ― Isaac Asimov -% -Universe, n.: The problem. -% -University, n.: Like a software house, except the software's free, and it's -usable, and it works, and if it breaks they'll quickly tell you how to fix it. -% -UNIX *is* user friendly. It's just selective about who its friends are. - ― unknown -% -Unless one is a genius, it is best to aim at being intelligible. - ― Anthony Hope -% -Unless you are very rich and very eccentric, you will not enjoy the luxury of -a computer in your own home. - ― Edward Yourdon, 1975. -% -Use GOTOs only to implement a fundamental structure. -% -Use debugging compilers. -% -Use free-form input where possible. -% -Use library functions. -% -Use the Force, Luke. -% -Useful knowledge is a great support for intuition. - ― Charles B. Rogers -% -Users of a tool are willing to meet you halfway; if you do ninety percent -of the job, they will be ecstatic. - ― Software Tools, p.136. -% -VMS isn't an operating system, it's a playpen for DEC system programmers. - ― Herb Blashtfalt -% -Van Roy's Law: An unbreakable toy is useful for breaking other toys. -% -Variables won't. Constants aren't. -% -Velilind's Laws of Experimentation: - 1. If reproducibility may be a problem, conduct the test only - once. - 2. If a straight line fit is required, obtain only two data - points. -% -Very few profundities can be expressed in less than 80 characters. -% -Vests are to suits as seat-belts are to cars. -% -Violence is the last refuge of the incompetent. - ― Salvor Hardin -% -Vique's Law: -A man without religion is like a fish without a bicycle. -% -Virtue is its own punishment. -% -Vital papers will demonstrate their vitality by spontaneously moving -from where you left them to where you can't find them. -% -Vitamin C deficiency is apauling -% -Volcano - a mountain with hiccups. -% -Vote anarchist. -% -Walter, I love you, but sooner or later, you're going to have to face the -fact you're a goddamn moron. - ― The Dude ("The Big Lebowski") -% -War is menstruation envy. -% -Waste not, get your budget cut next year. -% -Wasting time is an important part of living. -% -Watch out for off-by-one errors. -% -We ARE as gods and might as well get good at it. - ― Whole Earth Catalog -% -We all know that no one understands anything that isn't funny. -% -We are all in the gutter, but some of us are looking at the stars. - ― Oscar Wilde -% -We are confronted with insurmountable opportunities. - ― Walt Kelly, "Pogo" -% -We are going to have peace even if we have to fight for it. - ― Dwight D. Eisenhower -% -We are not alone. -% -We are what we pretend to be. - ― Kurt Vonnegut, JR -% -We call our dog Egypt, because in every room he leaves a pyramid. -% -We can defeat gravity. The problem is the paperwork involved. -% -We can't let children think it's okay to dress up like Vikings and go -around hollering. - ― Dogbert, on opera -% -We can't schedule an orgy, it might be construed as fighting - ― Stanley Sutton -% -We cheat the other guy and pass the savings on to you. -% -We don't care. We don't have to. We're the Phone Company. -% -We don't know who discovered water, but we are certain it wasn't a fish. - ― John Culkin -% -We don't want to discourage the innovators and those who take risks because -they're afraid of getting sued by a lawsuit. - ― George W. Bush; Washington, D.C.; June 24, 2004 -% -We few, we happy few, we band of brothers; -For he to-day that sheds his blood with me -Shall be my brother; be he ne'er so vile, -This day shall gentle his condition: -And gentlemen in England now a-bed -Shall think themselves accursed they were not here, -And hold their manhoods cheap whiles any speaks -That fought with us upon Saint Crispin's day. - ― King Henry V, "Henry V", Act IV, Scene 3 -% -We have met the enemy and he is us - ― Walt Kelly (in POGO) -% -We learn from history that we do not learn anything from history. -% -We may not return the affection of those who like us, but we always -respect their good judgement. -% -We must all hang together, or we will surely all hang separately. - ― Benjamin Franklin -% -They that can give up essential liberty to obtain a little temporary safety -deserve neither liberty nor safety. - ― Benjamin Franklin -% -We must remember the First Amendment which protects any shrill jackass -no matter how self-seeking. - ― F. G. Withington -% -We now return you to your regularly scheduled program. -% -We want to create puppets that pull their own strings. - ― Ann Marion -% -We were spanking each other with meat and then suddenly it got weird. - ― Joe Hacket -% -We will have solar energy as soon as the utility companies solve one -technical problem ― how to run a sunbeam through a meter. -% -We work to become, not to acquire. - ― Elbert Hubbard -% -We'll be a great country where the fabrics are made up of groups and -loving centers. - ― George W. Bush, Kalamazoo, Michigan; March 27, 2001 -% -We're fighting for this woman's honor, which is more than she ever did. - ― Rufus T. Firefly, in "Duck Soup" -% -We're here to give you a computer, not a religion. - ― attributed to Bob Pariseau, at the introduction of the Amiga -% -We're the weirdest monkeys ever. - ― Karl Lehenbauer -% -We've sent a man to the moon, and that's 29,000 miles away. The center -of the Earth is only 4,000 miles away. You could drive that in a week, -but for some reason nobody's ever done it. - ― Andy Rooney -% -Wear me as a seal upon your heart, as a seal upon your arm; for love is strong -as death, passion cruel as the grave; it blazes up like blazing fire, fiercer -than any flame. - [Song of Solomon 8:6 (NEB)] -% -Weiler's Law: - Nothing is impossible for the man who doesn't have to do it himself. -% -Weinberg's First Law: Progress is made on alternate Fridays. -% -Weinberg's Second Law: If builders built buildings the way programmers -wrote programs, then the first woodpecker that came along would destroy -civilization. -% -Welcome back, my friends, to the show that never ends! -% -Welcome to the human race, with its wars, disease and brutality. - ― Chrissie Hynde (The Pretenders), "Show Me" -% -Welcome to The Machine. -% -Welcome to the working week. -I know it don't thrill you -I hope it don't kill you. -% -Well, I killed my own grandfather and here I am! Guess there's no paradox -when time travel isn't involved. - ― Andrew Kennedy -% -Well, well, well! Well if it isn't fat stinking billy goat Billy Boy in -poison! How art thou, thou globby bottle of cheap stinking chip oil? Come -and get one in the yarbles, if ya have any yarble, ya eunuch jelly thou! - ― Alex in "Clockwork Orange" -% -Well, you see, it's such a transitional creature. It's a piss-poor -reptile and not very much of a bird. - ― Melvin Konner, from "The Tangled Wing", quoting a zoologist who has - studied the archeopteryx and found it "very much like people" -% -Were there fewer fools, knaves would starve. - ― Anonymous -% -Westheimer's Discovery: A couple of months in the laboratory can frequently -save a couple of hours in the library. -% -Wethern's Law: Assumption is the mother of all screw-ups. -% -What a waste it is to lose one's mind ― or not to have a mind at all. -How true that is. - ― V.P. Dan Quayle, garbling the United Negro College Fund slogan - in an address to the group (from Newsweek, May 22nd, 1989) -% -What are you doing wrong with our bug-free product? -% -What cannot be eaten must be civilized. - ― Peter Taylor -% -What do you call a boomerang that doesn't work? A stick! - ― Bill Kirchenbaum, comedian -% -What does it mean if there is no fortune for you? -% -What garlic is to salad, insanity is to art. -% -What happens when you cut back the jungle? It recedes. -% -What is a magician but a practising theorist? - ― Obi-Wan Kenobi -% -What is mind? No matter. -What is matter? Never mind. - ― Thomas Hewitt Key, 1799-1875 -% -What is the difference between the modern computer and a Turing machine? -It's the same as that between Hillary's ascent of Everest and the -establishment of a Hilton on its peak. -% -What is tolerance? ― it is the consequence of humanity. We are all formed -of frailty and error; let us pardon reciprocally each other's folly ― -that is the first law of nature. - ― Voltaire -% -What is vice today may be virtue tomorrow. -% -What is virtue today may be vice tomorrow. -% -What is worth doing is worth delegating. -% -What is worth doing is worth the trouble of asking somebody to do. -% -What makes the Universe so hard to comprehend is that there's nothing -to compare it with. -% -What publishers are looking for these days isn't radical feminism. It's -corporate feminism ― a brand of feminism designed to sell books and -magazines, three-piece suits, airline tickets, Scotch, cigarettes and, most -important, corporate America's message, which runs: "Yes, women were -discriminated against in the past, but that unfortunate mistake has been -remedied; now every woman can attain wealth, prestige and power by dint of -individual rather than collective effort." - ― Susan Gordon -% -What sane person could live in this world and not be crazy? - ― Ursula K. LeGuin -% -What sin has not been committed in the name of efficiency? -% -What the hell, go ahead and put all your eggs in one basket. -% -What the large print giveth, the small print taketh away. -% -What this calls for is a special blend of psychology and extreme violence. - ― Vyvyan Basterd, "The Young Ones" -% -What this country needs is a good 5 dollar plasma weapon. -% -What this country needs is a good five cent ANYTHING! -% -What this country needs is a good five cent microcomputer. -% -What this country needs is a good five-cent nickel. -% -What use is magic if it can't save a unicorn? - ― Peter S. Beagle, "The Last Unicorn" -% -What we anticipate seldom occurs; what we least expect generally happens. - ― Bengamin Disraeli -% -What we do not understand we do not possess. - ― Goethe -% -What's so funny 'bout peace, love and understanding? -% -What, me worry? -% -What boots it at one gate to make defence, -And at another to let in the foe? - ― John Milton, Samson Agonistes (l. 560) -% -Whatever is not nailed down is mine. What I can pry loose is not nailed down. - ― Collis P. Huntingdon -% -When I said "we", officer, I was referring to myself, the four young -ladies, and, of course, the goat. -% -When I sell liquor, its called bootlegging; when my patrons serve -it on Lake Shore Drive, its called hospitality. - ― Al Capone -% -When I was a boy I was told that anybody could become President. Now -I'm beginning to believe it. - ― Clarence Darrow -% -When I was in my twenties, not shaving for a few days gave me a cool Don -Johnson/Miami Vice look. Now that I'm in my forties, though, it tends to -make me look more like Otis from Mayberry. - ― Tom Gray -% -When I was in school, I cheated on my metaphysics exam: I looked into -the soul of the boy sitting next to me. - ― Woody Allen -% -When you are in it up to your ears, keep your mouth shut. -% -When Yahweh your gods has settled you in the land you're about to occupy, and -driven out many infidels before you...you're to cut them down and exterminate -them. You're to make no compromise with them or show them any mercy. -[Deut. 7:1 (KJV)] -% -When a Banker jumps out of a window, jump after him ― that's where the -money is. - ― Robespierre -% -When a fellow says, "It ain't the money but the principle of the -thing," it's the money. - ― Kim Hubbard -% -When a fly lands on the ceiling, does it do a half roll or a half loop? -% -When a place gets crowded enough to require ID's, social collapse is -not far away. It is time to go elsewhere. The best thing about space -travel is that it made it possible to go elsewhere. - ― Robert Heinlein -% -When a shepherd goes to kill a wolf, and takes his dog along to see the -sport, he should take care to avoid mistakes. The dog has certain -relationships to the wolf the shepherd may have forgotten. - ― Robert Pirsig, "Zen and the Art of Motorcycle Maintenance" -% -When all other means of communication fail, try words. -% -When asked, "If you find so much that is unworthy of reverence in the United -States, then why do you live here?" Mencken replied, "Why do men go to zoos?" -% -When bad men combine, the good must associate; else they will fall one by one, -an unpitied sacrifice in a contemptible struggle. - ― Edmund Burke -% -When choosing between two evils I always like to take the one I've never tried -before. - ― Mae West -% -When does summertime come to Minnesota, you ask? Well, last year, I -think it was a Tuesday. -% -When everything has been seen to work, all integrated, you have four more -months of work to do. - ― C. Portman of ICL Ltd. -% -When in doubt, do what the President does ― guess. -% -When in doubt, lead trump. -% -When in doubt, punt. -% -When in doubt, use brute force. - ― Ken Thompson -% -When love is gone, there's always justice. -And when justice is gone, there's always force. -And when force is gone, there's always Mom. -Hi, Mom! - ― Laurie Anderson -% -When more and more people are thrown out of work, unemployment results. - ― Calvin Coolidge -% -When people thought the earth was flat, they were wrong. When people thought -the earth was spherical, they were wrong. But if you think that thinking the -earth is spherical is just as wrong as thinking the earth is flat, then your -view is wronger than both of them put together. - ― Isaac Asimov, "The Relativity of Wrong", - The Skeptical Inquirer, Vol. 14 No. 1, Fall 1989 -% -When someone says "I want a programming language in which I need only -say what I wish done," give him a lollipop. - ― Alan J. Perlis -% -When the government bureau's remedies do not match your problem, you -modify the problem, not the remedy. -% -When the wind is great, bow before it; when the wind is heavy, yield to it. -% -When two people are under the influence of the most violent, most -insane, most delusive, and most transient of passions, they are -required to swear that they will remain in that excited, abnormal, and -exhausting condition continuously until death do them part. - ― George Bernard Shaw -% -When we are ignorant of the answer to an important question, one way -to proceed is to ask which path of inquiry promises best to facilitate -learning. - ― Timothy Ferris, "The Mind's Sky: Human Intelligence in a - Cosmic Context." -% -When we are planning for posterity, we ought to remember that virtue is -not hereditary. - ― Thomas Paine -% -When we jumped into Sicily, the units became separated, and I couldn't find -anyone. Eventually I stumbled across two colonels, a major, three captains, -two lieutenants, and one rifleman, and we secured the bridge. Never in the -history of war have so few been led by so many. - ― General James Gavin -% -When you are alone you are all your own. - ― Leonardo da Vinci -% -When you are in it up to your ears, keep your mouth shut. -% -When you do not know what you are doing, do it neatly. -% -When you have an efficient government, you have a dictatorship. - ― Harry S Truman -% -When you make your mark in the world, watch out for guys with erasers. - ― The Wall Street Journal -% -Whenever anyone says, "theoretically", they really mean, "not really". - ― Dave Parnas -% -Whenever people agree with me I always feel I must be wrong. - ― Oscar Wilde -% -Where a new invention promises to be useful, it ought to be tried - ― Thomas Jefferson -% -Where humor is concerned there are no standards ― no one can say what -is good or bad, although you can be sure that everyone will. - ― John Kenneth Galbraith -% -Where is it written in the Constitution that you may take children from their -parents, and parents from their children, and compel them to fight the battles -of any war in which the folly or wickedness of government may engage it? - ― Daniel Webster, 1814 -% -Where there's a will, there's an Inheritance Tax. -% -Wherever you go, there you are. - ― Buckaroo Banzai -% -Whether you can hear it or not -The Universe is laughing behind your back - ― National Lampoon, "Deteriorada" -% -While Europe's eye is fix'd on mighty things, -The fate of empires and the fall of kings; -While quacks of State must each produce his plan, -And even children lisp the Rights of Man; -Amid this mighty fuss just let me mention, -The Rights of Woman merit some attention. - ― Robert Burns, Address on "The Rights of Woman", - November 26, 1792 -% -While anyone can admit to themselves they were wrong, the true test is -admission to someone else. -% -While money can't buy happiness, it certainly lets you choose your own -form of misery. -% -While most peoples' opinions change, the conviction of their correctness never -does. -% -While you don't greatly need the outside world, it's still very reassuring to -know that it's still there. -% -Whipit! Whipit good! -% -Whistler's Law: - You never know who is right, but you always know who is in charge. -% -Who has more leisure than a worm? - - Seneca -% -Who is W. O. Baker, and why is he saying those terrible things about me? -% -Who made the world I cannot tell; -'Tis made, and here am I in hell. -My hand, though now my knuckles bleed, -I never soiled with such a deed. - ― A. E. Housman -% -Who needs companionship when you can sit alone in your room and masturbate? -% -Who works achieves and who sows reaps. - ― Arab Proverb -% -Who's on first? -% -Whom computers would destroy, they must first drive mad. -% -Whoso diggeth a pit shall fall therein. - ― Book of Proverbs -% -Why did the Lord give us so much quickness of movement unless it was to -avoid responsibility with? -% -Why does man kill? He kills for food. And not only food: frequently -there must be a beverage. - ― Woody Allen, "Without Feathers" -% -Why does opportunity always knock at the least opportune moment? -% -Why is it that our memory is good enough to retain the least triviality that -happens to us, and yet not good enough to recollect how often we have told -it to the same person? - ― La Rochefoucauld -% -Why is it that there are so many more horses' asses than there are horses? - ― G. Gordon Liddy -% -Why isn't "palindrome" spelled the same way backwards? -% -Why isn't there a special name for the tops of your feet? - ― Lily Tomlin -% -Wiker's Law: Government expands to absorb all available revenue and then some. -% -Wiker's Law: - Government expands to absorb revenue and then some. -% -Will the highways on the Internet become more few? - ― George W. Bush, Concord, NH; January 29, 2000 -% -Williams and Holland's Law: - If enough data is collected, anything may be proven by - statistical methods. -% -Winter is the season in which people try to keep the house as warm as -it was in the summer, when they complained about the heat. -% -With all the fancy scientists in the world, why can't they just once -build a nuclear balm? -% -With clothes the new are best, with friends the old are best. -% -With every passing hour our solar system comes forty-three thousand -miles closer to globular cluster M13 in the constellation Hercules, and -still there are some misfits who continue to insist that there is no -such thing as progress. - ― Ransom K. Ferm -% -With friends like these, who need hallucinations? -% -With great effort, you move the rug aside, revealing a trap door. -% -Without coffee he could not work, or at least he could not have worked in -the way he did. In addition to paper and pens, he took with him everywhere -as an indispensable article of equipment the coffee machine, which was no -less important to him than his table or his white robe. - ― Stefan Zweigs, Biography of Balzac -% -Without ice cream life and fame are meaningless. -% -Words are the voice of the heart. -% -Words must be weighed, not counted. -% -Worst Vegetable of the Year: The brussels sprout. -This is also the worst vegetable of next year. - ― Steve Rubenstein -% -Wozencraft's Law: If you make all of your plans on the assumption that a -particular thing won't happen―it will. -% -Writing code has a place in the human hierarchy worth somewhere above grave -robbing and beneath managing. - ― Gerald Weinberg -% -Writing free verse is like playing tennis with the net down. -% -Writing in C or C++ is like running a chain saw with all the safety guards -removed. - ― Bob Gray -% -Writing programs needs genius to save the last order or the last millisecond. -It is great fun, but it is a young man's game. You start it with great -enthusiasm when you first start programming, but after ten years you get a -bit bored with it, and then you turn to automatic-programming languages and -use them because they enable you to get to the heart of the problem that you -want to do, instead of having to concentrate on the mechanics of getting the -program going as fast as you possibly can, which is really nothing more than -doing a sort of crossword puzzle. - ― Christopher Strachey, 1962 -% -Xerox does it again and again and again and ... -% -Xerox never comes up with anything original. -% -XML is just data with that Internet shit wrapped around it. - ― Joe Romello, by way of Steve Sapovits -% -Yes, but every time I try to see things your way, I get a headache. -% -Yes, but which self do you want to be? -% -Yes, many primitive people still believe this myth...But in today's technical -vastness of the future, we can guess that surely things were much different. - ― The Firesign Theater -% -Yes, we have no bonanzas. -% -Yesterday upon the stair -I met a man who wasn't there. -He wasn't there again today ― -I think he's from the CIA. -% -Yield to Temptation ... it may not pass your way again. - ― Lazarus Long, "Time Enough for Love" -% -Yinkel, n.: A person who combs his hair over his bald spot, hoping no one -will notice. - ― Rich Hall, "Sniglets" -% -You can do more with a kind word and a gun than with just a kind word. - ― Al Capone -% -You can make it illegal, but you can't make it unpopular. -% -You can measure a programmer's perspective by noting his attitude on -the continuing viability of FORTRAN. - ― Alan Perlis -% -You can never get all the facts from just one newspaper, and unless you -have all the facts, you cannot make proper judgements about what is going on. - ― Harry S Truman -% -You can observe a lot just by watching. - ― Yogi Berra -% -You can often profit from being at a loss for words. - ― Frank Tyger -% -You can take all the impact that science considerations have on funding -decisions at NASA, put them in the navel of a flea, and have room left -over for a caraway seed and Tony Calio's heart. - ― F. Allen -% -You can tell how far we have to go, when FORTRAN is the language of -supercomputers. - ― Steven Feiner -% -You can't antagonize and influence at the same time. -% -You can't carve your way to success without cutting remarks. -% -You can't depend on your eyes when your imagination is out of focus. -% -You can't get there from here. -% -You can't have great software without a great team, and most software teams -behave like dysfunctional families. - ― Jim McCarthy -% -You can't judge a book by the way it wears its hair. -% -You can't start worrying about what's going to happen. You get spastic -enough worrying about what's happening now. - ― Lauren Bacall -% -You can't teach self-esteem. Self-esteem arises from attempting challenging -tasks and mastering them. -% -You can't underestimate the power of fear. - ― Tricia Nixon -% -You cannot achieve the impossible without attempting the absurd. -% -You cannot build a reputation on what you are going to do. - ― Henry Ford -% -You cannot propel yourself forward by patting yourself on the back. -% -You cannot succeed by criticizing others. -% -You couldn't even prove the White House staff sane beyond a reasonable doubt. - ― Ed Meese, on the Hinckley verdict -% -You don't have to explain something you never said. - ― Calvin Coolidge -% -You don't have to think too hard when you talk to teachers. - ― J. D. Salinger -% -You know, you really half give me a buzz. - ― Stevie Ray Vaughan, "Honey Bee" (from "Couldn't Stand the Weather") -% -You know why there are so few sophisticated computer terrorists in the United -States? Because your hackers have so much mobility into the establishment. -Here, there is no such mobility. If you have the slightest bit of -intellectual integrity you cannot support the government.... That's why the -best computer minds belong to the opposition. - ― an anonymous member of the outlawed Polish trade union, Solidarity -% -You may call me by my name, Wirth, or by my value, Worth. - ― Nicklaus Wirth -% -You may have heard that a dean is to faculty as a hydrant is to a dog. - ― Alfred Kahn -% -You never know how many friends you have until you rent a house on the beach. -% -You never finish a program, you just stop working on it. -% -You or I must yield up his life to Ahrimanes. I would rather it were you. -I should have no hesitation in sacrificing my own life to spare yours, but -we take stock next week, and it would not be fair on the company. - ― J. Wellington Wells -% -You see but you do not observe. - ― Sir Arthur Conan Doyle, in "The Memoirs of Sherlock Holmes" -% -You should emulate your heros, but don't carry it too far. Especially -if they are dead. -% -You should never wear your best trousers when you go out to fight for -freedom and liberty. - ― Henrick Ibson -% -You're never too old to become younger. - ― Mae West -% -Your attitude determines your attitude. - ― Zig Ziglar, self-improvement doofus -% -Your conscience never stops you from doing anything. It just stops you -from enjoying it. -% -Your mind understands what you have been taught; your heart, what is true. -% -Your mother was a hamster, and your father smelt of elderberries. -% -Your reality is lies and balderdash, and I'm glad to say that I have no grasp -of it. - ― Baron von Munchausen -% -Your true value depends entirely on what you are compared with. -% -Youth is the trustee of posterity. -% -Youth is wasted on the young. - ― George Bernard Shaw -% -Youth is when you blame all your troubles on your parents; maturity is -when you learn that everything is the fault of the younger generation. -% -Zero Defects, n.: The result of shutting down a production line. -% -Zimmerman's Law of Complaints: Nobody notices when things go right. -% -Zounds! I was never so bethumped with words -since I first called my brother's father dad. - ― William Shakespeare, "King John" -% -Zymurgy's Law of Volunteer Labor: - People are always available for work in the past tense. -% -[In the U. S. Army] An officer does not take an oath of loyalty to the -Commander-in-Chief. He takes an oath of loyalty to the Constitution. - ― Sam Donaldson -% -[Leslie Stahl was] a pussy compared to Rather. - ― George H. W. Bush -% -grep me no patterns and I'll tell you no lines. -% -After all, all he did was string together a lot of old, well-known quotations. - ― H. L. Mencken, on Shakespeare -% -All successful newspapers are ceaselessly querulous and bellicose. They -never defend anyone or anything if they can help it; if the job is forced -upon them, they tackle it by denouncing someone or something else. - ― H.L. Mencken, Prejudices, 1919. -% -A man who can laugh, if only at himself, is never really miserable. - ― H.L. Mencken, Minority Report, 1956 -% -College football is a game which would be much more interesting if the -faculty played instead of the students, and even more interesting if the -trustees played. There would be a great increase in broken arms, legs, and -necks, and simultaneously an appreciable diminution in the loss to humanity. - ― H. L. Mencken -% -Conscience is the inner voice which warns us that someone may be looking. - ― H. L. Mencken, "Sententiae," The Vintage Mencken, 1955. -% -Democracy is also a form of worship. It is the worship of Jackals by -Jackasses. - ― H. L. Mencken -% -Democracy is a pathetic belief in the collective wisdom of individual ignorance. - ― H. L. Mencken -% -Every normal man must be tempted at times to spit on his hands, hoist the -black flag, and begin slitting throats. - ― H.L. Mencken -% -Faith may be defined briefly as an illogical belief in the occurrence of the -improbable. - ― H. L. Mencken -% -Explanations exist; they have existed for all time; there is always a -well-known solution to every human problem neat, plausible, and wrong. - ― H. L. Mencken, "The Divine Afflatus" (16 November 1917) -% -Equality before the law is probably forever inattainable. It is a noble -ideal, but it can never be realized, for what men value in this world is -not rights but privileges. - ― H.L. Mencken, Minority Report, 1956 -% -Faith may be defined briefly as an illogical belief in the occurrence of the -improbable. - ― H.L. Mencken, "Prejudices: Third Series", 1922 -% -For one American husband who maintains a chorus girl in Levantine luxury -around the corner, there are hundreds who are as true to their oaths, year -in and year out, as so many convicts in the deathhouse. - ― H.L. Mencken, In Defense of Women, 1922. -% -I believe that religion, generally speaking, has been a curse to mankind―that -its modest and greatly overestimated services on the ethical side have been -more than overborne by the damage it has done to clear and honest thinking. - ― H. L. Mencken, "Forum" (September, 1930) -% -I go on working for the same reason a hen goes on laying eggs. - ― H. L. Mencken -% -Judge: a law student who marks his own examination papers. - ― H.L. Mencken, "Sententiae," The Vintage Mencken, 1955 -% -Love is the triumph of imagination over intelligence. - ― attributed to H. L. Mencken -% -Men have a much better time of it than women. For one thing, they marry -later. For another thing, they die earlier. - ― H.L. Mencken, A Mencken Chrestomathy, 1949. -% -My guess is that well over eighty per cent of the human race goes through -life without ever having a single original thought. That is to say, they -never think anything that has not been thought before, and by thousands. A -society made up of individuals who were all capable of original thought -would probably be unendurable. The pressure of ideas would simply drive it -frantic. - ― H.L. Mencken, Minority Report, 1956 -% -Never let your inferiors do you a favor. It will be extremely costly. - ― H.L. Mencken, "Sententiae," The Vintage Mencken, 1955. -% -No government is ever really in favor of so-called civil rights. It always -tries to whittle them down. They are preserved under all governments, -insofar as they survive at all, by special classes of fanatics, often -highly dubious. - ― H.L. Mencken, Minority Report, 1956 -% -No one ever went broke underestimating the taste of the American public. - ― Attributed to H.L. Mencken. -% -Nowhere in the world is superiority more easily attained, or more eagerly -admitted. The chief business of the nation, as a nation, is the setting up -of heroes, mainly bogus. - ― H.L. Mencken, Prejudices, 1923. -% -Once he had one leg in the White House and the nation trembled under his -roars. Now he is a tinpot pope in the Coca-Cola belt and a brother to the -forlorn pastors who belabor halfwits in galvanized iron tabernacles behind -the railroad yards. - ― H. L. Mencken, writing of William Jennings Bryan, - counsel for the supporters of Tennessee's anti-evolution - law at the Scopes "Monkey Trial" in 1925. -% -Say what you will about the Ten Commandments, you must always come back to -the pleasant fact that there are only ten of them. - ― H. L. Mencken -% -Sin is a dangerous toy in the hands of the virtuous. It should be left to the -congenitally sinful, who know when to play with it and when to let it alone. - ― H. L. Mencken -% -Suppose two-thirds of the members of the national House of Representatives -were dumped into the Washington garbage incinerator tomorrow, what would we -lose to offset our gain of their salaries and the salaries of their parasites? - ― H. L. Mencken, "Prejudices, Fourth Series" (1924) -% -The capacity of human beings to bore one another seems to be vastly greater -than that of any other animal. - ― H. L. Mencken -% -The chief contribution of Protestantism to human thought is its massive proof -that God is a bore. - ― H.L. Mencken, "The Aesthetic Recoil," American Mercury, July, 1931. -% -The great artists of the world are never Puritans, and seldom even -ordinarily respectable. No virtuous man―that is, virtuous in the YMCA -sense―has ever painted a picture worth looking at, or written a symphony -worth hearing, or a book worth reading, and it is highly improbable that -the thing has ever been done by a virtuous woman. - ― H.L. Mencken, Prejudices, 1919. -% -The highfalutin aims of democracy, whether real or imaginary, are always -assumed to be identical with its achievements. This, of course, is sheer -hallucination. Not one of those aims, not even the aim of giving every -adult a vote, has been realized. It has no more made men wise and free than -Christianity has made them good. - ― H.L. Mencken, Minority Report, 1956 -% -The most costly of all follies is to believe passionately in the palpably not -true. It is the chief occupation of mankind. - ― H.L. Mencken, A Mencken Chrestomathy, 1949. -% -The notion that science does not concern itself with first causes ― that -it leaves the field to theology or metaphysics, and confines itself to mere -effects ― this notion has no support in the plain facts. If it could, -science would explain the origin of life on earth at once ― and there is -every reason to believe that it will do so on some not too remote tomorrow. -To argue that gaps in knowledge which will confront the seeker must be -filled, not by patient inquiry, but by intuition or revelation, is simply -to give ignorance a gratuitous and preposterous dignity.... - ― H. L. Mencken, 1930 -% -The one permanent emotion of the inferior man is fear―fear of the unknown, -the complex, the inexplicable. What he wants beyond everything else is safety. - ― H.L. Mencken, Prejudices, 1920. -% -The truth is that Christian theology, like every other theology, is not only -opposed to the scientific spirit; it is also opposed to all other attempts -at rational thinking. Not by accident does Genesis 3 make the father of -knowledge a serpent ― slimy, sneaking and abominable. Since the earliest -days the church as an organization has thrown itself violently against every -effort to liberate the body and mind of man. It has been, at all times and -everywhere, the habitual and incorrigible defender of bad governments, bad -laws, bad social theories, bad institutions. It was, for centuries, an -apologist for slavery, as it was the apologist for the divine right of kings. - ― H. L. Mencken -% -The whole aim of practical politics is to keep the populace alarmed (and hence -clamorous to be led to safety) by menacing it with an endless series of -hobgoblins, all of them imaginary. - ― H. L. Mencken -% -There is, in fact, no reason to believe that any given natural phenomenon, -however marvelous it may seem today, will remain forever inexplicable. -Soon or late the laws governing the production of life itself will be -discovered in the laboratory, and man may set up business as a creator on -his own account. The thing, indeed, is not only conceivable; it is even -highly probable. - ― H. L. Mencken, 1930 -% -To sum up: 1. The cosmos is a gigantic fly-wheel making 10,000 revolutions -a minute. 2. Man is a sick fly taking a dizzy ride on it. 3. Religion is the -theory that the wheel was designed and set spinning to give him the ride. - ― H. L. Mencken, Coda from "Smart Set", 1920 -% -When women kiss it always reminds one of prize-fighters shaking hands. - ― H. L. Mencken, "Sententiae," The Vintage Mencken, 1955. -% -When A annoys or injures B on the pretense of saving or improving X, A is a -scoundrel. - ― H. L. Mencken, "Newspaper Days: 1899-1906" (1941) -% -Whenever you hear a man speak of his love for his country it is a sign that -he expects to be paid for it. - ― H.L. Mencken, "Sententiae," The Vintage Mencken, 1955. -% -From Fronto I learned to observe what envy, and duplicity, and hypocrisy are -in a tyrant, and that generally those among us who are called Patricians are -rather deficient in paternal affection. - ― Marcus Aurelius, "The Meditations", Book I -% -The time of a man's life is as a point; the substance of it ever flowing, the -sense obscure; and the whole composition of the body tending to corruption. - ― Marcus Aurelius, "The Meditations", Book II -% -That [life] which is longest of duration, and that which is shortest, both -come to one effect. - ― Marcus Aurelius, "The Meditations", Book II -% -You must, therefore, hasten, not only because you are every day nearer to -death, but also because your intellect, which enables you to know the true -nature of things and to order all your actions by that knowledge, wastes and -decays daily―or, may fail you before you die. - ― Marcus Aurelius, "The Meditations", Book II -% -Never esteem of anything as profitable, which shell ever constrain thee to -break thy faith, or to lose thy modestroy; to hate any man, to suspect to -curse, to dissemble, to lust after anything, that requireth the secret of -walls or veils. - ― Marcus Aurelius, "The Meditations", Book III -% -He who prefers, before all things, his rational part and spirit... he shall -never lament and exclaim; never sigh; he shall never want either solitude -or company; and, which is chiefest of all, he shall live without either -desire or fear. - ― Marcus Aurelius, "The Meditations", Book III -% -Let no act be done without a purpose, nor otherwise than according to the -perfect principles of art. - ― Marcus Aurelius, "The Meditations", Book IV -% -Take away your opinion, and you then take away the complaint, "I have been -harmed." Take away the complaint, "I have been harmed," and the harm is taken -away. - ― Marcus Aurelius, "The Meditations", Book IV -% -Many grains of frankincense on the same altar: one falls before, another falls -after; but it makes no difference. - ― Marcus Aurelius, "The Meditations", Book IV -% -Do not act as if you were going to live ten thousand years. Death hangs over -you. While you live, while it is in your power, be good. - ― Marcus Aurelius, "The Meditations", Book IV -% -How much trouble he avoids who does not look to see what his neighbour says or -does or thinks, but only to what he does himself, that it may be just and pure. - ― Marcus Aurelius, "The Meditations", Book IV -% -Everything which is in any way beautiful is beautiful in itself, and -terminates in itself, not having praise as part of itself. Neither worse, -then, nor better is a thing made by being praised. - ― Marcus Aurelius, "The Meditations", Book IV -% -The words which were formerly familiar are now antiquated: so also the names -of those who were famed of old, are now in a manner antiquated... For all -things soon pass away and become a mere tale, and complete oblivion soon -buries them. - ― Marcus Aurelius, "The Meditations", Book IV -% -Everything is only for a day, both that which remembers and that which is -remembered. - ― Marcus Aurelius, "The Meditations", Book IV -% -Thou art a little soul bearing about a corpse, as Epictetus used to say. - ― Marcus Aurelius, "The Meditations", Book IV -% -Time is like a river made up of the events which happen, and a violent stream; -for as soon as a thing has been seen, it is carried away, and another comes in -its place, and this will be carried away too. - ― Marcus Aurelius, "The Meditations", Book IV -% -Be like the promontory against which the waves continually break, but it -stands firm and tames the fury of the water around it. - ― Marcus Aurelius, "The Meditations", Book IV -% -How easy it is to repel and to wipe away every impression which is troublesome -or unsuitable, and immediately to be in all tranquility. - ― Marcus Aurelius, "The Meditations", Book V -% -To seek what is impossible is madness: and it is impossible that the bad -should not do something of this kind. - ― Marcus Aurelius, "The Meditations", Book V -% -The best way of avenging yourself is not to become like the wrong-doer. - ― Marcus Aurelius, "The Meditations", Book VI -% -If any man is able to convince me and show me that I do not think or act -right, I will gladly change; for I seek the truth by which no man was ever -injured. But he is injured who abides in his error and ignorance. - ― Marcus Aurelius, "The Meditations", Book VI -% -Let not future things disturb you, for you will come to them, if it shall be -necessary, having with you the same reason which you now use for present -things. - ― Marcus Aurelius, "The Meditations", Book VII -% -Receive wealth or prosperity without arrogance; and be ready to let it go. - ― Marcus Aurelius, "The Meditations", Book VIII -% -He often acts unjustly who does not do a certain thing; not only he who does a -certain thing. - ― Marcus Aurelius, "The Meditations", Book IX -% -It is your duty to leave another man's wrongful act there, where it is. - ― Marcus Aurelius, "The Meditations", Book IX -% -America is a ball of Appalachia with a thin coating of civility. - ― Rich Simons -% -American justice is measured by the amount of money you are willing to risk -to make your point. - ― Rich Simons -% -America has become a tired old whore, selling her institutions like back alley -blowjobs to fat cat businessmen for their pocket change. - ― Rich Simons -% -But in the end I remind myself that people are merely shaved apes, and -pretty much spend their time masturbating and throwing feces. - ― Rich Simons -% -I am waiting for the "Internet Beermeister," so hackers can wage a -"Denial of Cerveza" attack. - ― Rich Simons -% -Money doesn't stretch―if somebody makes a killing, somebody else loses -his shirt. - ― Rich Simons -% -Never work anywhere where you can't find the guy in charge and break his nose. - ― Rich Simons -% -Nothing is more dangerous than a man whose actions are the responsibility -of his deity. - ― Rich Simons -% -Some people hold their noses when used as toilet paper by the shadowy -overlords; some people inhale the heady aroma with gusto. - ― Rich Simons -% -Those who sacrifice liberty for the sake of safety deserve neither, but those -who sacrifice creativity for safety end up with a velvet painting of Elvis. - ― Rich Simons -% -Windows is a manifestation of commerce; Unix is a manifestation of culture. - ― Rich Simons -% -Working in Windows is like baking moose shit pie. Sure, you're baking pies, but -look what's in 'em. - ― Rich Simons -% -I prefer the company of men without ovaries. - ― Rich Simons -% -The American business executive resembles the Ferengi more each day. In another -20 years, there will be dorm rooms full of toothless hillbillies at the Amazon -fulfillment centers and the Walmarts. - ― Rich Simons -% -Be cautious of those who give you advice. That's my advice to you. - ― Steve Mayr -% -If you fail to plan, you plan to fail. Sounds like a plan. - ― Steve Mayr -% -If you take the easy way out, nothing will come easy. - ― Steve Mayr -% -By and large, language is a tool for concealing the truth. - ― George Carlin -% -Here's a bumper sticker I'd like to see: "We are the proud parents of a child -whose self-esteem is sufficient that he doesn't need us promoting his minor -scholastic achievements on the back of our car." - ― George Carlin -% -Honesty may be the best policy, but it's important to remember that apparently, -by elimination, dishonesty is the second-best policy. - ― George Carlin -% -I have as much authority as the Pope, I just don't have as many people who -believe it. - ― George Carlin -% -I'm completely in favor of the separation of Church and State. My idea is that -these two institutions screw us up enough on their own, so both of them -together is certain death. - ― George Carlin -% -I think it's the duty of the comedian to find out where the line is drawn and -cross it deliberately. - ― George Carlin -% -If it's true that our species is alone in the universe, then I'd have to say -the universe aimed rather low and settled for very little. - ― George Carlin -% -If God had intended us not to masturbate, he would've made our arms shorter. - ― George Carlin -% -If this is the best God can do, I'm not impressed. - ― George Carlin -% -Just because your tattoo has Chinese characters in it doesn't make you -Spiritual. It's right above the crack of your butt. And it translates to -"beef with broccoli." The last time you did anything spiritual, you were -praying to God you weren't pregnant. You're not spiritual. - ― George Carlin -% -The very existence of flame-throwers proves that some time, somewhere, someone -said to themselves, "You know, I want to set those people over there on fire, -but I'm just not close enough to get the job done." - ― George Carlin -% -There are nights when the wolves are silent and only the moon howls. - ― George Carlin -% -American justice is measured by the amount of money you are willing to risk -to make your point. - ― Rich Simons -% -America has become a tired old whore, selling her institutions like back alley -blowjobs to fat cat businessmen for their pocket change. - ― Rich Simons -% -But in the end I remind myself that people are merely shaved apes, and -pretty much spend their time masturbating and throwing feces. - ― Rich Simons -% -Anybody who wants religion is welcome to it, as far as I'm concerned ― I -support your right to enjoy it. However, I would appreciate it if you -exhibited more respect for the rights of those people who do not wish to -share your dogma, rapture or necrodestination. - ― Frank Zappa, "The Real Frank Zappa Book" -% -Don't eat yellow snow. - ― Frank Zappa -% -Hey, you know something, people? I'm not black, but there's a whole lot of -times I wish I could say I'm not white. - ― Frank Zappa -% -I never set out to be weird. It was always other people who called me weird. - ― Frank Zappa -% -I think pop music has done more for oral intercourse than anything else -that has ever happened, and vice versa. - ― Frank Zappa -% -If you wind up with a boring, miserable life because you listened to your -mother, your Dad, your priest, to some guy on television, to any of the -people telling you how to do your shit, then you *deserve* it. If you -want to be a schmuck, be a schmuck ― but don't wait around for respect -from other people ― a schmuck is a schmuck. - ― Frank Zappa, "The Real Frank Zappa Book" -% -In the future, etiquette will become more and more important. That doesn't -mean knowing which fork to pick up ― I mean basic consideration for the -rights of other animals (human beings included) and the willingness, -whenever practical, to tolerate the other guy's idiosyncrasies. - ― Frank Zappa, "The Real Frank Zappa Book" -% -Is that a real poncho? I mean, is that a Mexican poncho or a Sears poncho? -Hmmm... No fooling. - ― Frank Zappa, "Camarillo Brillo" -% -Most people wouldn't know music if it came up and bit them on the ass. - ― Frank Zappa -% -Modern Americans behave as if intelligence were some sort of hideous deformity. - ― Frank Zappa -% -Most rock journalism is people who can't write interviewing people who can't -talk for the people who can't read. - ― Frank Zappa -% -My best advice to anyone who wants to raise a happy, mentally healthy child -is: Keep him or her as far away from a church as you can. - ― Frank Zappa -% -Remember, Information is not knowledge; Knowledge is not Wisdom; -Wisdom is not truth; Truth is not beauty; Beauty is not love; -Love is not music; Music is the best. - ― Frank Zappa -% -Remember, there's a big difference between kneeling down and bending over. - ― Frank Zappa -% -Take the Kama Sutra. How many people died from the Kama Sutra as opposed to -the Bible? Who wins? - ― Frank Zappa -% -The bassoon is one of my favorite instruments. It has a medieval aroma, -like the days when everything used to sound like that. Some people crave -baseball...I find this unfathomable, but I can easily understand why a -person could get excited about playing the bassoon. - ― Frank Zappa -% -The Book says BURN and DESTROY repent and redeem and revenge and deploy and -rumble thee forth to the land of the unbelieving scum 'cause they don't go -for what's in the Book and that makes 'em BAD. - ― Frank Zappa -% -The computer can't tell you the emotional story. It can give you the exact -mathematical design, but what's missing is the eyebrows. - ― Frank Zappa -% -The essence of Christianity is told to us in the Garden of Eden history. -The fruit that was forbidden was on the Tree of Knowledge. The subtext is, -"All the suffering you have is because you wanted to find out what was -going on. You could be in the Garden of Eden if you had just kept your -fucking mouth shut and hadn't asked any questions." - ― Frank Zappa -% -There is more stupidity than hydrogen in the universe, and it has a longer -shelf life. - ― Frank Zappa -% -There is no such thing as a dirty word. Nor is there a word so powerful, -that it's going to send the listener to the lake of fire upon hearing it. - ― Frank Zappa -% -Our brains have just one scale, and we resize our experiences to fit. - ― Randall Munroe, xkcd -% -There's no such thing as bad language. I don't believe that any more. That's -ridiculous. They call it a "debasing of the language?" No! We are adults. -These are the words that WE use, to express frustration, rage, anger―in -order that we don't pick up a tire iron and beat the shit out of someone. - ― Lewis Black -% -I don't know if you noticed, but our two-party system is a bowl of shit -looking in the mirror at itself. - ― Lewis Black -% -There is a big difference between the Old Testament and the New Testament, -and that is, the New Testament God is kind of a great guy (He is!), especially -when you compare him to the Old Testament God, who is a prick. - ― Lewis Black -% -The reason you should go to Las Vegas is because, for only the second time, -the second time, ever, they have rebuilt Sodom and Gomorrah. It's back!! -And you have the opportunity to see it before it turns to salt. And you -wanna get out there before the Christian Right finds out what we're up to -and shits all over it. - ― Lewis Black -% -[The Weather Channel] is the most watched cable channel in America. I'll -repeat that. It is the most watched cable channel in America. They were -worried about the terrorists immobilizing us, and a portion of our -countrymen watch weather. 'Kay, you don't get any more immobile than -that... unless you're in a goddamn coma. That means you're saying, "I'd go -to the window, but it's too far." If you want to know what the weather is -you go to a window and stick your hand out and if you want to know what the -temperature is you drive by a bank. - ― Lewis Black -% -There's no such thing as soy milk. It's soy juice. But they couldn't sell -soy juice, so they called it soy milk. Because anytime you say soy juice, -you actually... start to gag. - ― Lewis Black -% -You don't want another Enron? Here's the law: If you have a company, and it -can't explain, in one sentence... what it does... it's illegal! - ― Lewis Black -% -The one thing I think we learned this year is that the Democrats and the -Republicans are completely worthless. - ― Lewis Black -% -If mzero doesn't need to be a single, unambiguous value, then the algebra -of monads would seem to be a bit hinky. - ― A tweet from @djspiewak (Daniel J. Spiewak) -% -A monad is just a monoid in the category of endofunctors, what's the problem? - ― Saunders Mac Lane, filtered through James Iry -% -Real knowledge is to know the extent of one's ignorance. - ― Confucius -% -Rotten wood cannot be carved. - ― Confucius (Analects, Book 5, Chapter 9) -% -Men's natures are alike. It is their habits that carry them far apart. - ― Confucius -% -Our greatest glory is not in never falling, but in getting up every time we do. - ― Confucius -% -It does not matter how slowly you go so long as you do not stop. - ― Confucius -% -We like to think we spend most of our time power-typing. "I'm being productive, -I'm writing programs!" But, we don't. We spend most of our time looking into -the abyss, saying, "My God, what have I done?" - ― Douglas Crockford, during his keynote at YUIConf 2011 -% -"That hardly ever happens" is another way of saying, "It happens". - ― Douglas Crockford, during his keynote at YUIConf 2011 -% -I used to think everyone should learn programming. When I first starting -programming...I thought, "Wow, this is such an amazing way to organize -information! Everybody should learn to do this!" I don't think that any more. I -think there has to be something seriously wrong with you, in order to do this -work. A normal person, once they've looked into the abyss, will say, "I'm done. -This is stupid. I'm going to go to something else." But not us, 'cause there's -something really wrong with us. - ― Douglas Crockford, during his keynote at YUIConf 2011 -% -Confusion must be avoided. Confusion is the enemy. Confusion is what causes -bugs and security mishaps and all the other things that make us miserable. - ― Douglas Crockford, during his keynote at YUIConf 2011 -% -Write [code] in a way that clearly communicates your intent. - ― Douglas Crockford, during his keynote at YUIConf 2011 -% -Geriatric Relativity: The observation that time goes faster the older you get. - ― Brian M. Clapper -% -Critical thinking is the antidote to gullibility and credulity, which explains -why politicians aren't fond of critical thinking. - ― Brian M. Clapper -% -There's a certain freedom in being so tired that you just can't possibly do -another thing. - ― Brian M. Clapper -% -The president of the United States has claimed, on more than one occasion, to -be in dialogue with God. If he said that he was talking to God through his -hairdryer, this would precipitate a national emergency. I fail to see how the -addition of a hairdryer makes the claim more ridiculous or offensive. - ― Sam Harris, Letter to a Christian Nation -% -Man is manifestly not the measure of all things. This universe is shot through -with mystery. The very fact of its being, and of our own, is a mystery -absolute, and the only miracle worthy of the name. - ― Sam Harris, "The End of Faith" -% -What is so unnerving about the candidacy of Sarah Palin is the degree to which -she representsand her supporters celebratethe joyful marriage of confidence -and ignorance . . . Ask yourself: how has "elitism" become a bad word in -American politics? There is simply no other walk of life in which extraordinary -talent and rigorous training are denigrated. We want elite pilots to fly our -planes, elite troops to undertake our most critical missions, elite athletes to -represent us in competition and elite scientists to devote the most productive -years of their lives to curing our diseases. And yet, when it comes time to -vest people with even greater responsibilities, we consider it a virtue to shun -any and all standards of excellence. When it comes to choosing the people whose -thoughts and actions will decide the fates of millions, then we suddenly want -someone just like us, someone fit to have a beer with, someone down-to-earthin -fact, almost anyone, provided that he or she doesn't seem too intelligent or -well educated. - ― Sam Harris -% -Unreason is now ascendant in the United Statesin our schools, in our courts, -and in each branch of the federal government. - ― Sam Harris, "The Politics of Ignorance" (2005) -% -The point at which we fully acquire our humanity, and our capacity to suffer, -remains an open question, but anyone who would dogmatically insist that these -traits must arise coincident with the moment of conception has nothing to -contribute, apart from his ignorance, to this debate. - ― Sam Harris -% -Water is two parts hydrogen and one part oxygen. This seems as value-free an -utterance as human beings ever make. But what do we do when someone doubts the -truth of this proposition? Ok, all we can do is appeal to scientific values. -The value of understanding the world. The value of evidence. The value of -logical consistency. What if someone says, “Well, that’s not how I choose to -think about water. Ok, what can we say to such a person? Ok, all we can do is -appeal to scientific values. And if he doesn’t share those values, the -conversation is over. Ok, if someone doesn’t value evidence, what evidence are -you going to provide to prove that they should value it? If someone doesn’t -value logic, what logical argument could you provide to show the importance of -logic? - ― Sam Harris, during a Notre Dame debate with William Lane Craig -% -I love living in the future. ― Bill Cheswick -% -Sendmail(8) proved that if you polish a turd long enough, you may eventually -end up with a shiny coprolite. - ― Bill Cheswick -% -Salad is what food eats. ― Bill Cheswick -% -Angels we have heard on High/Tell us to go out and Buy. - ― Tom Lehrer -% -The Army has carried the American ... ideal to its logical conclusion. -Not only do they prohibit discrimination on the grounds of race, creed -and color, but also on ability. - ― Tom Lehrer -% -If, after hearing my songs, just one human being is inspired to say something -nasty to a friend, or perhaps to strike a loved one, it will all have been -worth the while. - ― Tom Lehrer -% -I'm not tempted to write a song about George W. Bush. I couldn't figure out -what sort of song I would write. That's the problem: I don't want to satirise -George Bush and his puppeteers, I want to vaporize them. - ― Tom Lehrer (2003) -% -I basically like "comments," though they can seem a little jarring: spit- -flecked rants that are appended to a product that at least tries for a measure -of objectivity and dignity. It's as though when you order a sirloin steak, it -comes with a side of maggots. - ― Gene Weingarten, Pulitzer Prize-winning Washington Post columnist -% -I disagree with those who suggest that we permanently close down the U.S. mail -on the grounds that it can kill you. That is sheer hysteria. I think we should -permanently close down the U.S. mail on the grounds that it has been making us -sick for quite a while. - ― Gene Weingarten, Pulitzer Prize-winning Washington Post columnist -% -Anyone who is capable of getting themselves made President should on no -account be allowed to do the job. - ― Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -Bypasses are devices that allow some people to dash from point A to point B -very fast while other people dash from point B to point A very fast. People -living at point C, being a point directly in between, are often given to wonder -what's so great about point A that so many people from point B are so keen to -get there and what's so great about point B that so many people from point A -are so keen to get THERE. They often wish that people would just once and for -all work out where the hell they wanted to be. - ― Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -Far out in the uncharted backwaters of the unfashionable end of the Western -Spiral arm of the Galaxy lies a small unregarded yellow sun. Orbiting this at a -distance of roughly ninety-eight million miles is an utterly insignificant -little blue-green planet whose ape-descended life forms are so amazingly -primitive that they still think digital watches are a pretty neat idea ... - ― Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -Men were real men, women were real women, and small, furry creatures from Alpha -Centauri were REAL small, furry creatures from Alpha Centauri. Spirits were -brave, men boldly split infinitives that no man had split before. Thus was the -Empire forged. - ― "The Hitchhiker's Guide to the Galaxy", Douglas Adams -% -Space is big. You just won't believe how vastly, hugely, mind- bogglingly big -it is. I mean, you may think it's a long way down the road to the chemist's, -but that's just peanuts to space. - ― "The Hitchhiker's Guide to the Galaxy" -% -The word "spine" is, of course, an anagram of "penis". This is true in almost -fifty percent of the languages of the Galaxy, and many people have attempted to -explain why. Usually these explanations get bogged down in silly puns about -"standing erect". - ― Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -There is a theory which states that if ever anyone discovers exactly what the -Universe is for and why it is here, it will instantly disappear and be replaced -by something even more bizarre and inexplicable. There is another theory which -states that this has already happened. - ― Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -With a rubber duck, one's never alone. - ― "The Hitchhiker's Guide to the Galaxy" -% -Inspiration usually comes during work, rather than before it. - ― Madeleine L'Engle -% -That's the way things come clear. All of a sudden. And then you realize how -obvious they've been all along. - ― Madeleine L'Engle -% -When we were children, we used to think that when we were grown-up we would no -longer be vulnerable. But to grow up is to accept vulnerability... To be alive -is to be vulnerable. - ― Madeleine L'Engle -% -Because you're not what I would have you be, I blind myself to who, in truth, -you are. - ― Madeleine L'Engle -% -A good photograph is knowing where to stand. - ― Ansel Adams -% -A photograph is usually looked at - seldom looked into. - ― Ansel Adams -% -A true photograph need not be explained, nor can it be contained in words. - ― Ansel Adams -% -Dodging and burning are steps to take care of mistakes God made in -establishing tonal relationships. - ― Ansel Adams -% -In wisdom gathered over time I have found that every experience is a form of -exploration. - ― Ansel Adams -% -These people live again in print as intensely as when their images were -captured on old dry plates of sixty years ago... I am walking in their alleys, -standing in their rooms and sheds and workshops, looking in and out of their -windows. Any they in turn seem to be aware of me. - ― Ansel Adams -% -When I'm ready to make a photograph, I think I quite obviously see in my minds -eye something that is not literally there in the true meaning of the word. I'm -interested in something which is built up from within, rather than just -extracted from without. - ― Ansel Adams -When in doubt, tell the truth. - ― Mark Twain -% -A banker is a fellow who lends you his umbrella when the sun is shining -and wants it back the minute it begins to rain. - ― Mark Twain -% -A classic is something that everybody wants to have read and nobody -wants to read. - ― Mark Twain -% -[He was] a solemn, unsmiling, sanctimonious old iceberg who looked like he -was waiting for a vacancy in the Trinity. - ― Mark Twain -% -Clothes make the man. Naked people have little or no influence on society. - ― Mark Twain -% -Don't go around saying the world owes you a living. The world owes you -nothing. It was here first. - ― Mark Twain -% -God made the Idiot for practice, and then He made the School Board. - ― Mark Twain -% -I must have a prodigious quantity of mind; it takes me as much as a -week sometimes to make it up. - ― Mark Twain, "The Innocents Abroad" -% -I was gratified to be able to answer promptly, and I did. I said I -didn't know. - ― Mark Twain -% -If you pick up a starving dog and make him prosperous, he will not bite -you. This is the principal difference between a dog and a man. - ― Mark Twain -% -It is by the fortune of God that, in this country, we have three benefits: -freedom of speech, freedom of thought, and the wisdom never to use either. - ― Mark Twain -% -It is the difference of opinion that makes horse races. - ― Mark Twain -% -It usually takes me more than three weeks to prepare a good impromptu speech. - ― Mark Twain -% -Man is the only animal that blushes ― or needs to. - ― Mark Twain -% -My father was an amazing man. The older I got, the smarter he got. - ― Mark Twain -% -The human race has one really effective weapon, and that is laughter. - ― Mark Twain -% -It could probably be shown, by facts and figures, that there is no distinctly -native criminal class except Congress. - ― Mark Twain -% -There is no sadder sight than a young pessimist. - ― Mark Twain -% -There is something fascinating about science. One gets such wholesale -returns of conjecture out of such a trifling investment of fact. - ― Mark Twain -% -They spell it "da Vinci" and pronounce it "da Vinchy". Foreigners always spell -better than they pronounce. - ― Mark Twain -% -Under certain circumstances, profanity provides a relief denied even to prayer. - ― Mark Twain -% -Wagner's music is better than it sounds. - ― Mark Twain -% -When I was younger, I could remember anything, whether it had happened or not; -but my faculties are decaying now and soon I shall be so I cannot remember any -but the things that never happened. It is sad to go to pieces like this but we -all have to do it. - ― Mark Twain -% -Whenever the literary German dives into a sentence, that is the last you -are going to see of him until he emerges on the other side of the Atlantic -with his verb in his mouth. - ― Mark Twain in "A Connecticut Yankee in King Arthur's Court" -% -Whenever you find that you are on the side of the majority, it is time -to reform. - ― Mark Twain in "A Connecticut Yankee in King Arthur's Court" -% -Why is it that we rejoice at a birth and grieve at a funeral? It is -because we are not the person involved. - ― Mark Twain -% -He is now rising from affluence to poverty. - ― Mark Twain -% -A person with a new idea is a crank until the idea succeeds. - ― Mark Twain -% -A man is never more truthful than when he acknowledges himself a liar. - ― Mark Twain -% -Against the assault of laughter nothing can stand. - ― Mark Twain -% -But who prays for Satan? Who, in eighteen centuries, has had the common -humanity to pray for the one sinner that needed it most? - ― Mark Twain -% -Civilization is the limitless multiplication of unnecessary necessities. - ― Mark Twain -% -Drag your thoughts away from your troubles... by the ears, by the heels, or any -other way you can manage it. - ― Mark Twain -% -I can live for two months on a good compliment. - ― Mark Twain -% -If the world comes to an end, I want to be in Cincinnati. Everything comes -there ten years later. - ― Mark Twain -% -Martyrdom covers a multitude of sins. - ― Mark Twain -% -Patriot: the person who can holler the loudest without knowing what he is -hollering about. - ― Mark Twain -% -Prosperity is the best protector of principle. - ― Mark Twain -% -Suppose you were an idiot, and suppose you were a member of Congress. But I -repeat myself. - ― Mark Twain -% -The rule is perfect: in all matters of opinion our adversaries are insane. - ― Mark Twain -% -There are basically two types of people. People who accomplish things, and -people who claim to have accomplished things. The first group is less crowded. - ― Mark Twain -% -To be good is noble; but to show others how to be good is nobler and no -trouble. - ― Mark Twain -% -It could probably be shown by facts and figures that there is no distinctly -native American criminal class except Congress. - ― Mark Twain -% -To succeed in life, you need two things: ignorance and confidence. - ― Mark Twain -% -Truth is mighty and will prevail. There is nothing wrong with this, except that -it ain't so. - ― Mark Twain -% -We have the best government that money can buy. - ― Mark Twain -% -When angry, count to four; when very angry, swear. - ― Mark Twain -% -When people do not respect us we are sharply offended; yet in his private heart -no man much respects himself. - ― Mark Twain -% -When we remember we are all mad, the mysteries disappear and life stands -explained. - ― Mark Twain -% -Whenever you find yourself on the side of the majority, it is time to pause and -reflect. - ― Mark Twain -% -Wit is the sudden marriage of ideas which before their union were not perceived -to have any relation. - ― Mark Twain -% -[Silvio Berlusconi] is so thoroughly corrupt, every time he smiles, an -angel gets gonorrhea. - ― Dylan Moran -% -[Adulthood] feels like ... walking around in a desert, with a bag over -your head, bumping into people who rob you as they bore you. - ― Dylan Moran -% -Tequila isn't even a drink. It's just a way of getting the police round, -without using the phone. - ― Dylan Moran -% -I basically think I'm what would've happened if James Dean had lived, -and discovered carbohydrates and orthopedic shoes. - ― Dylan Moran -% -When did ignorance become a point of view? - ― Dilbert (Scott Adams) -% -There's no kill switch on awesome. - ― Dilbert (Scott Adams) -% -You want a toe? I can get you a toe, believe me. There are ways, Dude. You -don't wanna know about it, believe me. - ― Walter to The Dude ("The Big Lebowski") -% -Hey, careful, man, there's a beverage here! - ― The Dude ("The Big Lebowski") -% -"The Dude abides." I don't know about you but I take comfort in that. It's good -knowin' he's out there. The Dude. Takin' 'er easy for all us sinners. Shoosh. I -sure hope he makes the finals. - ― The Stranger ("The Big Lebowski") -% -We’ve bought into the idea that education is about training and -"success", defined monetarily, rather than learning to think critically -and to challenge. We should not forget that the true purpose of education -is to make minds, not careers. A culture that does not grasp the vital -interplay between morality and power, which mistakes management techniques -for wisdom, which fails to understand that the measure of a civilization -is its compassion, not its speed or ability to consume, condemns itself -to death. - ― Chris Hedges, "Empire of Illusion: The End of Literacy and the - Triumph of Spectacle" -% -Inverted totalitarianism, unlike classical totalitarianism, does not -revolve around a demagogue or charismatic leader. It finds expression in -the anonymity of the Corporate State. It purports to cherish democracy, -patriotism, and the Constitution while manipulating internal levers. - ― Chris Hedges, "Empire of Illusion: The End of Literacy and the - Triumph of Spectacle" -% -Washington has become our Versailles. We are ruled, entertained, -and informed by courtiers―and the media has evolved into a class of -courtiers. The Democrats, like the Republicans, are mostly courtiers. Our -pundits and experts, at least those with prominent public platforms, -are courtiers. We are captivated by the hollow stagecraft of political -theater as we are ruthlessly stripped of power. It is smoke and mirrors, -tricks and con games, and the purpose behind it is deception. - ― Chris Hedges, "Empire of Illusion: The End of Literacy and the - Triumph of Spectacle" -% -The split in America, rather than simply economic, is between those who -embrace reason, who function in the real world of cause and effect, and those -who, numbed by isolation and despair, now seek meaning in a mythical world -of intuition, a world that is no longer reality-based, a world of magic. - ― Chris Hedges, American Fascists: The Christian Right and the War - On America -% -Hope has a cost. Hope is not comfortable or easy. Hope requires personal -risk. It is not about the right attitude. Hope is not about peace of -mind. Hope is action. Hope is doing something. The more futile, the more -useless, the more irrelevant and incomprehensible an act of rebellion is, -the vaster and more potent hope becomes. Hope never makes sense. Hope is -weak, unorganized and absurd. Hope, which is always nonviolent, exposes in -its powerlessness, the lies, fraud and coercion employed by the state. Hope -knows that an injustice visited on our neighbor is an injustice visited on -all of us. Hope posits that people are drawn to the good by the good. This -is the secret of hope's power. Hope demands for others what we demand for -ourselves. Hope does not separate us from them. Hope sees in our enemy -our own face. - ― Chris Hedges -% -Racism towards Muslims is as evil as anti-Semitism, but try to express -this simple truth on a partisan Palestinian or Israeli website. - ― Chris Hedges, Death of the Liberal Class -% -A society without the means to detect lies and theft soon squanders its -liberty and freedom. - ― Chris Hedges -% -Really, the comforting side in most conspiracy theory arguments is the -one claiming that anyone who's in power has any plan at all. - ― xkcd #1081 (mouseover text) -% -A person who is nice to you, but rude to a waiter, is not a nice person. -(This is very important. Pay attention. It never fails.) - ― Dave Barry -% -Meetings are an addictive, highly self-indulgent activity that corporations -and other large organizations habitually engage in only because they cannot -actually masturbate. - ― Dave Barry -% -Styling mousse, which is gunk that looks like shaving cream ... was invented -by a French hair professional whom, if you met him, you would want to punch -directly in the mouth. - ― Dave Barry -% -There are two kinds of solar-heat systems: "passive" systems collect the -sunlight that hits your home, and "active" systems collect the sunlight -that hits your neighbors' homes, too. - ― Dave Barry, "Postpetroleum Guzzler" -% -There is more money being spent on breast implants and Viagra than on -Alzheimer's research. This means that by 2030, there should be a large -elderly population with perky boobs and huge erections and absolutely no -recollection of what to do with them. - ― Dave Barry -% -It is inhumane, in my opinion, to force people who have a genuine medical -need for coffee to wait in line behind people who apparently view it as -some kind of recreational activity. - ― Dave Barry -% -No matter what happens, somebody will find a way to take it too seriously. - ― Dave Barry -% -Although golf was originally restricted to wealthy, overweight Protestants, -today it's open to anybody who owns hideous clothing. - ― Dave Barry -% -People who want to share their religious views with you almost never want -you to share yours with them. - ― Dave Barry -% -It is a miracle that curiosity survives formal education. - ― Albert Einstein -% -Imagination is more important than knowledge. - ― Albert Einstein -% -If A equals success, then the formula is: - A= X + Y + Z -X is work. Y is play. Z is keep your mouth shut. - ― Albert Einstein -% -Great spirits have always found violent opposition from mediocrities. The -latter cannot understand it when a man does not thoughtlessly submit to -hereditary prejudices but honestly and courageously uses his intelligence. - ― Albert Einstein -% -The tyranny of the ignoramuses is insurmountable and assured for all time. - ― Albert Einstein -% -We can't solve problems by using the same kind of thinking we used when we -created them. - ― Albert Einstein -% -Man usually avoids attributing cleverness to somebody else, unless it is an -enemy. - ― A. Einstein -% -My religion consists of a humble admiration of the illimitable superior -spirit who reveals himself in the slight details we are able to perceive -with our frail and feeble mind. - ― Albert Einstein -% -Never do anything against conscience even if the state demands it. - ― Albert Einstein, as quoted by Virgil Henshaw in - "Albert Einstein: Philosopher Scientist" (1949) -% -The further the spiritual evolution of mankind advances, the more certain it -seems to me that the path to genuine religiosity does not lie through the -fear of life, and the fear of death, and blind faith, but through striving -after rational knowledge. - ― Albert Einstein -% -The hardest thing in the world to understand is the income tax. - ― Albert Einstein -% -The important thing is not to stop questioning. Curiosity has its own reason -for existing. - ― Albert Einstein -% -The most incomprehensible thing about the world is that it is comprehensible. - ― Albert Einstein -% -The only real valuable thing is intuition. - ― Albert Einstein -% -God may be subtle, but He isn't plain mean. - ― Albert Einstein -% -God does not care about our mathematical difficulties. He integrates -empirically. - ― Albert Einstein -% -Dear Posterity, If you have not become more just, more peaceful, and generally -more rational than we are (or were) ― why then, the Devil take you. - ― Albert Einstein, message for a time capsule -% -Common sense is the collection of prejudices acquired by age eighteen. - ― Albert Einstein -% -As far as the laws of mathematics refer to reality, they are not -certain; and as far as they are certain, they do not refer to reality. - ― Albert Einstein -% -Anyone who has never made a mistake has never tried anything new. - ― Albert Einstein -% -An autocratic system of coercion, in my opinion, soon degenerates. For -force always attracts men of low morality, and I believe it to be an -invariable rule that tyrants of genius are succeeded by scoundrels. - ― Albert Einstein, The World As I See It (1931) -% -"If I had only known, I would have been a locksmith." - ― Albert Einstein -% -"I know not with what weapons World War III will be fought, but -World War IV will be fought with sticks and stones." - ― Albert Einstein -% -A man should look for what is, and not for what he thinks should be. - ― Albert Einstein -% -All that is valuable in human society depends upon the opportunity -for development accorded the individual. - ― Albert Einstein -% -An empty stomach is not a good political adviser. - ― Albert Einstein -% -Any intelligent fool can make things bigger and more complex... It takes a -touch of genius - and a lot of courage to move in the opposite direction. - ― Albert Einstein -% -As far as I'm concerned, I prefer silent vice to ostentatious virtue. - ― Albert Einstein -% -Concern for man and his fate must always form the chief interest of all -technical endeavors. Never forget this in the midst of your diagrams and -equations. - ― Albert Einstein -% -Do not worry about your difficulties in Mathematics. I can assure you mine -are still greater. - ― Albert Einstein -% -Education is what remains after one has forgotten what one has learned in -school. - ― Albert Einstein -% -Everything that can be counted does not necessarily count; everything that -counts cannot necessarily be counted. - ― Albert Einstein -% -Great spirits have always encountered violent opposition from mediocre -minds. - ― Albert Einstein -% -He who joyfully marches to music in rank and file has already earned my -contempt. He has been given a large brain by mistake, since for him the -spinal cord would suffice. - ― Albert Einstein -% -I live in that solitude which is painful in youth, but delicious in the -years of maturity. - ― Albert Einstein -% -If you can't explain it simply, you don't understand it well enough. - ― Albert Einstein -% -People think my friend George is weird because he wears sideburns...behind his -ears. I think he's weird because he wears false teeth...with braces on them. - ― Steven Wright -% -I came home the other night and tried to open the door with my car keys...and -the building started up. So I took it out for a drive. A cop pulled me over -for speeding. He asked me where I live. I said, "Here." - ― Steven Wright -% -I was playing poker the other night... with Tarot cards. I got a full house -and 4 people died. - ― Steven Wright -% -My brother sent me a postcard the other day with this big satellite photo of -the entire earth on it. On the back it said: "Wish you were here". - ― Steven Wright -% -You can't have everything. Where would you put it? - ― Steven Wright -% -You know that feeling when you're leaning back on a stool and it starts to tip -over? Well, that's how I feel all the time. - ― Steven Wright -% -I'm making wine at home, but I make it out of raisins, so it'll be aged -automatically. - ― Steven Wright -% -Babies don't need a vacation, but I still see 'em at the beach. Pisses me off. - ― Steven Wright -% -Sponges grow in the ocean. That kills me. I wonder how much deeper the ocean -would be, if that didn't happen. - ― Steven Wright -% -It doesn't matter what temperature a room is, it's always room temperature. - ― Steven Wright -% -I remember the day the candle shop burned down. Everyone just stood around -and sang, "Happy birthday." - ― Steven Wright -% -If you shoot a mime, should you use a silencer? - ― Steven Wright -% -Once I stayed in a hotel where the pool was on the 23rd floor. I couldn't -believe how deep it was. - ― Steven Wright -% -There's a fine line between fishing and standing on the shore looking like -an idiot. - ― Steven Wright -% -What's another word for, "thesaurus?" - ― Steven Wright -% -Whenever I think about the past, it's just bring back so many memories. - ― Steven Wright -% -Once I was walking through the woods, and I saw a rabbit standing in front -of a candle, making shadows of people on a tree. I said, "Don't be so -sarcastic." - ― Steven Wright -% -I'm a peripheral visionary. I can see into the future, but just way off to -the side. - ― Steven Wright -% -It's hard for me to buy clothes, 'cause I'm not my size. - ― Steven Wright -% -Small keyboards make for big mistakes. - ― Joe Gunn -% -The last refuge of the insomniac is a sense of superiority to the sleeping world. - ― Leonard Cohen -% -Poetry is just the evidence of life. If your life is burning well, poetry is -just the ash. - ― Leonard Cohen -% -Children show scars like medals. Lovers use them as a secrets to reveal. A -scar is what happens when the word is made flesh. - ― Leonard Cohen, The Favorite Game -% -I don't consider myself a pessimist. I think of a pessimist as someone who -is waiting for it to rain. And I feel soaked to the skin.” - ― Leonard Cohen -% -The older I get, the surer I am that I’m not running the show. - ― Leonard Cohen -% -Deprivation is the mother of poetry. - ― Leonard Cohen, The Favorite Game -% -We are so lightly here. It is in love that we are made. In love we disappear. - ― Leonard Cohen -% -There is a crack, a crack in everything. That's how the light gets in. - ― Leonard Cohen, Selected Poems, 1956-1968 -% -This is a broken world, and we live with broken hearts and broken lives, -but still that is no alibi for anything. On the contrary, you have to stand -up and say, "Hallelujah," under those circumstances. - ― Leonard Cohen -% -A human is a system for converting dust billions of years ago into dust -billions of years from now via a roundabout process which involves checking -email a lot. - Randall Munroe (xkcd #1173) -% -Among the many invectives I invent when people piss me off, this is my -current favorite: 'Fuck yer own throat, you piss-dribbling monkey dick!' -I'm hoping it catches on with you folks. - Jon Miller, a.k.a., Doc Spender -% -"Well, vegans, as you know, don't have eggs, meat, dairy, or senses of humor." - Peter Sagal, on NPR's "Wait, Wait, Don't Tell Me" (21 Sep, 2013) -% -An ounce of perversion is worth a pound of pure. - ― Dr. Mark Crislip -% -Holy water is often contaminated with bacteria and, as a result, I -hypothesize that Pasteur went to Hell, since, if he'd gone to heaven, all -the water would be clean." - Dr. Mark Crislip -% -It is ignoring the nuances of a complicated topic to grind your axe that -annoys me. - Dr. Mark Crislip -% -Anybody who thinks that homeopathy is appropriate therapy for anything but -thirst is ... unfit to care for patients. - Dr. Mark Crislip -% -That woman speaks eight languages and can't say "no" in any of them. - ― Dorothy Parker -% -There's a hell of a distance between wise-cracking and wit. Wit has truth in -it; wise-cracking is simply calisthenics with words. - ― Dorothy Parker -% -If you have any young friends who aspire to become writers, the second -greatest favor you can do them is to present them with copies of The -Elements of Style. The first greatest, of course, is to shoot them now, -while they’re happy. - ― Dorothy Parker -% -I require three things in a man: he must be handsome, ruthless, and stupid. - ― Dorothy Parker -% -That would be a good thing for them to cut on my tombstone: Wherever she -went, including here, it was against her better judgment. - ― Dorothy Parker -% -The cure for boredom is curiosity. There is no cure for curiosity. - ― Dorothy Parker -% -Beauty is only skin deep, but ugly goes clean to the bone. - ― Dorothy Parker -% -This is not a novel to be tossed aside lightly. It should be thrown with -great force. - ― Dorothy Parker, on Ayn Rand's "Atlas Shrugged" -% -It's not the tragedies that kill us; it's the messes. - ― Dorothy Parker -% -All those writers who write about their own childhood! Gentle God, if I -wrote about mine you wouldn't sit in the same room with me. - ― Dorothy Parker -% -Sometimes, a grand adventure begins when you lick the evil. Joe Pizzirusso -% -Angels are very good at math. That's why they call them arc-angels. - ― Steven Novella (The Skeptics Guide to the Universe) -% -"Girls are complicated. The instruction manual that comes with girls is 800 -pages, with chapters 14, 19, 26 and 32 missing, and it's badly translated, -hard to figure out." - Huge Laurie, on raising a girl -% -There is no material safety data sheet for astatine. If there were, it would -just be the word "NO" scrawled over and over in charred blood. - Randall Munroe, "What If?" -% -Telling a child that everyone dies is the hardest thing about being a party -clown. - James Ferace -% -Last night, I told my kid that the night light only makes it easier for -the monsters to find her. - James Ferace \ No newline at end of file diff --git a/src/Bot/Storage/foxes b/src/Bot/Storage/foxes deleted file mode 100644 index 52fd9d2..0000000 --- a/src/Bot/Storage/foxes +++ /dev/null @@ -1,20 +0,0 @@ -https://i.ytimg.com/vi/qF6OOGuT_hI/maxresdefault.jpg -https://static.tumblr.com/bb34d8f163098ad1daafcffbdbb03975/rk23uap/Nwwp0rmi2/tumblr_static_tumblr_static__640.jpg -https://www.popsci.com/sites/popsci.com/files/styles/1000_1x_/public/import/2013/images/2013/09/redfoxyawn.jpg?itok=yRkSVe8T -https://hdqwalls.com/wallpapers/wild-fox-art.jpg -https://i.imgur.com/ktK9yXX.jpg -http://4.bp.blogspot.com/-Hz-o_KYj3Xk/Vlm2mwbztjI/AAAAAAAA8Ss/jbH5ovjmC9A/s1600/ScreenShot5502.jpg -https://wallpaperscraft.com/image/fox_forest_grass_117190_540x960.jpg -https://orig00.deviantart.net/2feb/f/2013/137/a/f/fox_and_curious_squirrel_by_tamarar-d65ju8d.jpg -http://www.tehcute.com/pics/201401/little-fox-big.jpg -https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR6QXB1APLdUsyzO39kPvhnC9cOvcwzEtsxown9QjWilWppia2mwg -https://www.wildlifeaid.org.uk/wp-content/uploads/2016/03/FP9_July09.jpg -https://upload.wikimedia.org/wikipedia/commons/thumb/b/bb/Vulpes_vulpes_ssp_fulvus_6568085.jpg/1200px-Vulpes_vulpes_ssp_fulvus_6568085.jpg -http://images.hellogiggles.com/uploads/2017/06/10023347/fox1.jpg -https://i.ytimg.com/vi/mtroFou8Xb4/maxresdefault.jpg -http://wallpapers-best.com/uploads/posts/2015-09/20_fox.jpg -https://www.whats-your-sign.com/wp-content/uploads/2018/02/RedFoxSymbolism4.jpg -https://cdn.zmescience.com/wp-content/uploads/2016/09/8505162700_11394c3f6a_b.jpg -http://wallpapers-best.com/uploads/posts/2015-09/18_fox.jpg -https://s.abcnews.com/images/General/red-fox-new-jersey-gty-jt-191119_hpMain_16x9_992.jpg -https://i.ytimg.com/vi/ClNRWL_9L8s/maxresdefault.jpg \ No newline at end of file diff --git a/src/Bot/Storage/pandas b/src/Bot/Storage/pandas deleted file mode 100644 index 6c6d725..0000000 --- a/src/Bot/Storage/pandas +++ /dev/null @@ -1,12 +0,0 @@ -https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Grosser_Panda.JPG/1200px-Grosser_Panda.JPG -https://c402277.ssl.cf1.rackcdn.com/photos/13100/images/featured_story/BIC_128.png?1485963152 -https://nationalzoo.si.edu/sites/default/files/styles/slide_1400x700/public/support/adopt/giantpanda-03.jpg?itok=3EdEO0Vi -https://media4.s-nbcnews.com/j/newscms/2016_36/1685951/ss-160826-twip-05_8cf6d4cb83758449fd400c7c3d71aa1f.nbcnews-ux-2880-1000.jpg -https://ichef-1.bbci.co.uk/news/660/cpsprodpb/169F6/production/_91026629_gettyimages-519508400.jpg -https://cdn.history.com/sites/2/2017/03/GettyImages-157278376.jpg -https://tctechcrunch2011.files.wordpress.com/2015/11/panda.jpg -http://www.nationalgeographic.com/content/dam/magazine/rights-exempt/2016/08/departments/panda-mania-12.jpg -http://animals.sandiegozoo.org/sites/default/files/2016-09/panda1_10.jpg -http://kids.nationalgeographic.com/content/dam/kids/photos/animals/Mammals/A-G/giant-panda-eating.adapt.945.1.jpg -https://static.independent.co.uk/s3fs-public/thumbnails/image/2015/10/08/15/Hong-Kong-pandas.jpg -https://3sn4dm1qd6i72l8a4r2ig7fl-wpengine.netdna-ssl.com/wp-content/uploads/2016/11/panda_lunlun_ZA_2083-b.jpg \ No newline at end of file diff --git a/src/Bot/Storage/penguins b/src/Bot/Storage/penguins deleted file mode 100644 index 95aa70d..0000000 --- a/src/Bot/Storage/penguins +++ /dev/null @@ -1,15 +0,0 @@ -https://www.birdlife.org/sites/default/files/styles/1600/public/slide.jpg?itok=HRhQfA1S -http://experimentexchange.com/wp-content/uploads/2016/07/penguins-fact.jpg -http://www.antarctica.gov.au/__data/assets/image/0011/147737/varieties/antarctic.jpg -https://images.justwatch.com/backdrop/8611153/s1440/pingu -http://4.bp.blogspot.com/-VhmPPCcZnwA/TWR303DSAuI/AAAAAAAAABU/eSSokmd376s/s1600/2-Penguins-penguins-4234010-1280-1024.jpg -https://media.glamour.com/photos/56959e35d9dab9ff41b308a0/master/pass/inspired-2015-02-gentoo-penguin-main.jpg -https://indiansciencejournal.files.wordpress.com/2012/04/emperor-penguin-credit-british-antarctic-survey.jpg -https://fthmb.tqn.com/7cd9Q3LSapEShHq2mKvQgSPr_tc=/2250x1500/filters:fill(auto,1)/149267744-56a008755f9b58eba4ae8f46.jpg -https://blogs.voanews.com/science-world/files/2014/07/11240219084_941dfbf66e_b.jpg -https://blogs.biomedcentral.com/bmcseriesblog/wp-content/uploads/sites/9/2015/11/IMG_5391-2.jpg -https://i2-prod.mirror.co.uk/incoming/article11682518.ece/ALTERNATES/s615/Emperor-penguins-on-ice.jpg -https://www.gannett-cdn.com/presto/2019/04/15/PPHX/8dfe0433-c22c-4458-9ba8-3aab866774f8-Penguins5cad7bfd107a4.jpg?crop=5759,3224,x0,y0&width=3200&height=1680&fit=bounds -http://4.bp.blogspot.com/_FNQgkfCwYxs/S82jBAxMVEI/AAAAAAAAAns/_3lAuJhUfcs/s1600/311785583_af8f2d1ea7_o.jpg -http://wallsdesk.com/wp-content/uploads/2017/01/Pictures-of-Penguin-.jpg -http://2.bp.blogspot.com/_W90V87w3sr8/TP3RPYwrrjI/AAAAAAAAAXk/riN0GwRwhFM/s1600/leap-of-faith-adelie-penguin-pictures.jpg \ No newline at end of file diff --git a/src/Bot/Storage/pumpkin b/src/Bot/Storage/pumpkin deleted file mode 100644 index 3652397..0000000 --- a/src/Bot/Storage/pumpkin +++ /dev/null @@ -1,14 +0,0 @@ -https://i.pinimg.com/736x/0a/a7/8a/0aa78af25e114836e1a42585fb7b09ed--funny-pumpkins-pumkin-carving.jpg -http://wdy.h-cdn.co/assets/16/31/980x1470/gallery-1470321728-shot-two-021.jpg -http://images6.fanpop.com/image/photos/38900000/Jack-o-Lantern-halloween-38991566-500-415.jpg -http://ghk.h-cdn.co/assets/15/37/1441834730-pumpkin-carve-2.jpg -http://diy.sndimg.com/content/dam/images/diy/fullset/2011/7/26/1/iStock-10761186_halloween-pumpkin-in-garden_s4x3.jpg.rend.hgtvcom.966.725.suffix/1420851319631.jpeg -https://www.digsdigs.com/photos/2009/10/100-halloween-pumpkin-carving-ideas-12.jpg -https://i.pinimg.com/736x/59/8a/0f/598a0fbf789631b76c1ffd4443194d8e--halloween-pumpkins-fall-halloween.jpg -http://i.huffpost.com/gen/1405530/images/o-PUMPKINS-facebook.jpg -https://www.reviewjournal.com/wp-content/uploads/2016/10/web1_thinkstockphotos-491684958_7239666.jpg -https://img.sunset02.com/sites/default/files/1494265591/pumpkins-growing-on-farm-getty-sun-0517.jpg -https://toronto.citynews.ca/wp-content/blogs.dir/sites/10/2015/10/06/pumpkin-patch.jpg -http://i.huffpost.com/gen/3494726/images/o-PUMPKIN-facebook.jpg -https://servingjoy.com/wp-content/uploads/2014/12/Beautiful-autumn-halloween-pumpkins.jpg -https://www.history.com/.image/t_share/MTU3ODc5MDg2NDI4OTg4NzQ1/still-life-of-a-jack-o-lantern.jpg \ No newline at end of file diff --git a/src/Bot/Storage/squirrel b/src/Bot/Storage/squirrel deleted file mode 100644 index 91fd240..0000000 --- a/src/Bot/Storage/squirrel +++ /dev/null @@ -1,25 +0,0 @@ -https://public-media.smithsonianmag.com/filer/52/f9/52f93262-c29b-4a4f-b031-0c7ad145ed5f/42-33051942.jpg -http://images5.fanpop.com/image/photos/30700000/Squirrel-squirrels-30710732-400-300.jpg -http://i.dailymail.co.uk/i/pix/2016/02/24/16/158F7E7C000005DC-3462228-image-a-65_1456331226865.jpg -http://2.bp.blogspot.com/-egfnMhUb8tg/T_dAIu1m6cI/AAAAAAAAPPU/v4x9q4WqWl8/s640/cute-squirrel-hey-watcha-thinkin-about.jpg -https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Squirrel_posing.jpg/287px-Squirrel_posing.jpg -https://i.pinimg.com/736x/51/db/9b/51db9bad4a87d445d321923c7d56b501--red-squirrel-animal-kingdom.jpg -https://i.pinimg.com/736x/ce/9c/59/ce9c5990b193046400d98724595cdaf3--red-squirrel-chipmunks.jpg -https://www.brooklynpaper.com/assets/photos/40/30/dtg-squirrel-attacks-prospect-park-patrons-2017-07-28-bk01_z.jpg -https://i.pinimg.com/736x/b4/5c/0d/b45c0d00b1a57e9f84f27f13cb019001--baby-squirrel-red-squirrel.jpg -https://i.pinimg.com/736x/0f/75/87/0f7587bb613ab524763afe8c9a532e5c--cute-squirrel-squirrels.jpg -http://cdn.images.express.co.uk/img/dynamic/128/590x/Grey-squirrel-828838.jpg -http://www.lovethispic.com/uploaded_images/79964-Squirrel-Smelling-A-Flower.jpg -https://i.pinimg.com/736x/23/d5/f9/23d5f9868f7d76c79c49bef53ae08f7f--squirrel-funny-red-squirrel.jpg -https://i.ytimg.com/vi/pzUs0DdzK3Y/hqdefault.jpg -https://i.pinimg.com/736x/e2/16/bb/e216bba53f80fc8e0111d371e9850159--funny-squirrels-cute-squirrel.jpg -https://i.pinimg.com/736x/52/43/c9/5243c93377245be1f686218c266d775c--funny-squirrel-baby-squirrel.jpg -https://i.pinimg.com/736x/0c/be/1d/0cbe1da8ad2c0cf3882a806b6fd88965--cute-pictures-funny-animal-pictures.jpg -https://i.pinimg.com/736x/1c/7d/4f/1c7d4f067a10066aad802ce5ac468d71--group-boards-a-squirrel.jpg -https://i.pinimg.com/736x/d6/42/12/d64212cc6221916db4173962bf6c131a--cute-squirrel-baby-squirrel.jpg -https://i.pinimg.com/736x/da/0d/fe/da0dfe93bb26887795f906e8fa97d68e--secret-squirrel-cute-squirrel.jpg -http://2.bp.blogspot.com/-HLieBqEuQoM/UDkRmeyzB5I/AAAAAAAABHs/RtsEynn5t6Y/s1600/hd-squirrel-wallpaper-with-a-brown-squirrel-eating-watermelon-wallpapers-backgrounds-pictures-photos.jpg -http://img15.deviantart.net/9c50/i/2011/213/c/9/just_taking_it_easy_by_lou_in_canada-d42do3d.jpg -https://insider.si.edu/wp-content/uploads/2018/01/Chipmunk-Photo-Mark-Rounds.jpg -https://media.mnn.com/assets/images/2014/12/gray-squirrel-uc-berkeley.jpg.1080x0_q100_crop-scale.jpg -https://citywildlife.org/wp-content/uploads/Juvenile-squirrel.jpg \ No newline at end of file diff --git a/src/Bot/Storage/turtles b/src/Bot/Storage/turtles deleted file mode 100644 index aa0fbcf..0000000 --- a/src/Bot/Storage/turtles +++ /dev/null @@ -1,20 +0,0 @@ -https://i.guim.co.uk/img/media/6b9be13031738e642f93f9271f3592044726a9b1/0_0_2863_1610/2863.jpg?w=640&h=360&q=55&auto=format&usm=12&fit=max&s=85f3b33cc158b5aa120c143dae1916ed -http://cf.ltkcdn.net/small-pets/images/std/212089-676x450-Turtle-feeding-on-leaf.jpg -https://c402277.ssl.cf1.rackcdn.com/photos/419/images/story_full_width/HI_287338Hero.jpg?1433950119 -https://www.cdc.gov/salmonella/agbeni-08-17/images/turtle.jpg -https://cdn.arstechnica.net/wp-content/uploads/2017/08/GettyImages-524757168.jpg -http://pmdvod.nationalgeographic.com/NG_Video/595/319/4504517_098_05_TOS_thumbnail_640x360_636296259676.jpg -http://s7d2.scene7.com/is/image/PetSmart/ARTHMB-CleaningYourTortoiseOrTurtlesHabitat-20160818?$AR1104$ -https://fthmb.tqn.com/9VGWzK_GWlvrjxtdFPX6EJxOq24=/960x0/filters:no_upscale()/133605352-56a2bce53df78cf7727960db.jpg -https://www.wildgratitude.com/wp-content/uploads/2015/07/turtle-spirit-animal1.jpg -http://www.backwaterreptiles.com/images/turtles/red-eared-slider-turtle-for-sale.jpg -http://turtlebackzoo.com/wp-content/uploads/2016/07/exhibit-headers_0008_SOUTH-AMERICA-600x400.jpg -https://i.pinimg.com/736x/dd/4e/7f/dd4e7f2f921ac28b1d5a59174d477131--cute-baby-sea-turtles-adorable-turtles.jpg -http://kids.nationalgeographic.com/content/dam/kids/photos/animals/Reptiles/A-G/green-sea-turtle-closeup-underwater.adapt.945.1.jpg -https://fthmb.tqn.com/nirxHkH3jBAe74ife6fJJu6k6q8=/2121x1414/filters:fill(auto,1)/Red-eared-sliders-GettyImages-617946009-58fae8835f9b581d59a5bab6.jpg -http://assets.worldwildlife.org/photos/167/images/original/MID_225023-circle-hawksbill-turtle.jpg?1345565600 -https://seaturtles.org/wp-content/uploads/2013/11/GRN-honuAnitaWintner2.jpg -https://images2.minutemediacdn.com/image/upload/c_crop,h_2549,w_4536,x_0,y_237/v1560186367/shape/mentalfloss/istock-687398754.jpg?itok=QsiF5yHP -https://c402277.ssl.cf1.rackcdn.com/photos/13028/images/story_full_width/seaturtle_spring2017.jpg?1485359391 -https://i2.wp.com/rangerrick.org/wp-content/uploads/2018/03/Turtle-Tale-RR-Jr-June-July-2017.jpg?fit=1156%2C650&ssl=1 -https://boyslifeorg.files.wordpress.com/2019/07/greenseaturtle.jpg \ No newline at end of file diff --git a/src/Commands/Commands.csproj b/src/Commands/Commands.csproj deleted file mode 100644 index 7f0bd8f..0000000 --- a/src/Commands/Commands.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - net6.0 - $(VersionSuffix) - $(VersionSuffix) - 0.0.0-DEV - Geekbot.Commands - Geekbot.Commands - NU1701 - CS8618 - enable - enable - True - Library - - - - - - - - diff --git a/src/Commands/Karma/Karma.cs b/src/Commands/Karma/Karma.cs deleted file mode 100644 index 026af2f..0000000 --- a/src/Commands/Karma/Karma.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System.Drawing; -using Geekbot.Core; -using Geekbot.Core.Database; -using Geekbot.Core.Database.Models; -using Geekbot.Interactions.Embed; -using Geekbot.Interactions.Resolved; -using Localization = Geekbot.Core.Localization; - -namespace Geekbot.Commands.Karma; - -public class Karma -{ - private readonly DatabaseContext _database; - private readonly long _guildId; - - public Karma(DatabaseContext database, long guildId) - { - _database = database; - _guildId = guildId; - } - - public async Task ChangeKarma(User author, User targetUser, KarmaChange change) - { - // Get the user - var authorRecord = await GetUser(long.Parse(author.Id)); - - // Check if the user can change karma - if (targetUser.Id == author.Id) - { - var message = change switch - { - KarmaChange.Up => Localization.Karma.CannotChangeOwnUp, - KarmaChange.Same => Localization.Karma.CannotChangeOwnSame, - KarmaChange.Down => Localization.Karma.CannotChangeOwnDown, - _ => throw new ArgumentOutOfRangeException(nameof(change), change, null) - }; - return Embed.ErrorEmbed(string.Format(message, author.Username)); - } - - var timeoutMinutes = 3; - if (authorRecord.TimeOut.AddMinutes(timeoutMinutes) > DateTimeOffset.Now.ToUniversalTime()) - { - var remaining = authorRecord.TimeOut.AddMinutes(timeoutMinutes) - DateTimeOffset.Now.ToUniversalTime(); - var formatedWaitTime = DateLocalization.FormatDateTimeAsRemaining(remaining); - return Embed.ErrorEmbed(string.Format(Localization.Karma.WaitUntill, author.Username, formatedWaitTime)); - } - - // Get the values for the change direction - var (title, amount) = change switch - { - KarmaChange.Up => (Localization.Karma.Increased, 1), - KarmaChange.Same => (Localization.Karma.Neutral, 0), - KarmaChange.Down => (Localization.Karma.Decreased, -1), - _ => throw new ArgumentOutOfRangeException(nameof(change), change, null) - }; - - // Change it - var targetUserRecord = await GetUser(long.Parse(targetUser.Id)); - targetUserRecord.Karma += amount; - _database.Karma.Update(targetUserRecord); - - authorRecord.TimeOut = DateTimeOffset.Now.ToUniversalTime(); - _database.Karma.Update(authorRecord); - - await _database.SaveChangesAsync(); - - // Respond - var eb = new Embed() - { - Author = new () - { - Name = targetUser.Username, - IconUrl = targetUser.GetAvatarUrl() - }, - Title = title, - }; - eb.SetColor(Color.PaleGreen); - eb.AddInlineField(Localization.Karma.By, author.Username); - eb.AddInlineField(Localization.Karma.Amount, amount.ToString()); - eb.AddInlineField(Localization.Karma.Current, targetUserRecord.Karma.ToString()); - return eb; - } - - private async Task GetUser(long userId) - { - var user = _database.Karma.FirstOrDefault(u => u.GuildId.Equals(_guildId) && u.UserId.Equals(userId)) ?? await CreateNewRow(userId); - return user; - } - - private async Task CreateNewRow(long userId) - { - var user = new KarmaModel() - { - GuildId = _guildId, - UserId = userId, - Karma = 0, - TimeOut = DateTimeOffset.MinValue.ToUniversalTime() - }; - var newUser = _database.Karma.Add(user).Entity; - await _database.SaveChangesAsync(); - return newUser; - } -} \ No newline at end of file diff --git a/src/Commands/Karma/KarmaChange.cs b/src/Commands/Karma/KarmaChange.cs deleted file mode 100644 index 96cbe88..0000000 --- a/src/Commands/Karma/KarmaChange.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Geekbot.Commands.Karma; - -public enum KarmaChange -{ - Up, - Same, - Down -} diff --git a/src/Commands/Rank.cs b/src/Commands/Rank.cs deleted file mode 100644 index 6de2d83..0000000 --- a/src/Commands/Rank.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System.Text; -using Geekbot.Core.Converters; -using Geekbot.Core.Database; -using Geekbot.Core.Extensions; -using Geekbot.Core.Highscores; -using Localization = Geekbot.Core.Localization; - -namespace Geekbot.Commands -{ - public class Rank - { - private readonly DatabaseContext _database; - private readonly IHighscoreManager _highscoreManager; - - public Rank(DatabaseContext database, IHighscoreManager highscoreManager) - { - _database = database; - _highscoreManager = highscoreManager; - } - - public string Run(string typeUnformated, int amount, string season, ulong guildId, string guildName) - { - HighscoreTypes type; - try - { - type = Enum.Parse(typeUnformated, true); - if (!Enum.IsDefined(typeof(HighscoreTypes), type)) throw new Exception(); - } - catch - { - return Localization.Rank.InvalidType; - } - - var replyBuilder = new StringBuilder(); - if (amount > 20) - { - replyBuilder.AppendLine(Localization.Rank.LimitingTo20Warning); - amount = 20; - } - - Dictionary highscoreUsers; - try - { - highscoreUsers = _highscoreManager.GetHighscoresWithUserData(type, guildId, amount, season); - } - catch (HighscoreListEmptyException) - { - return string.Format(Core.Localization.Rank.NoTypeFoundForServer, type); - } - - var guildMessages = 0; - if (type == HighscoreTypes.messages) - { - guildMessages = _database.Messages - .Where(e => e.GuildId.Equals(guildId.AsLong())) - .Select(e => e.MessageCount) - .Sum(); - } - - var failedToRetrieveUser = highscoreUsers.Any(e => string.IsNullOrEmpty(e.Key.Username)); - - if (failedToRetrieveUser) replyBuilder.AppendLine(Core.Localization.Rank.FailedToResolveAllUsernames).AppendLine(); - - if (type == HighscoreTypes.seasons) - { - if (string.IsNullOrEmpty(season)) - { - season = SeasonsUtils.GetCurrentSeason(); - } - - replyBuilder.AppendLine(string.Format(Core.Localization.Rank.HighscoresFor, $"{type.ToString().CapitalizeFirst()} ({season})", guildName)); - } - else - { - replyBuilder.AppendLine(string.Format(Core.Localization.Rank.HighscoresFor, type.ToString().CapitalizeFirst(), guildName)); - } - - var highscorePlace = 1; - foreach (var (user, value) in highscoreUsers) - { - replyBuilder.Append(highscorePlace < 11 - ? $"{EmojiConverter.NumberToEmoji(highscorePlace)} " - : $"`{highscorePlace}.` "); - - replyBuilder.Append(user.Username != null - ? $"**{user.Username}#{user.Discriminator}**" - : $"**{user.Id}**"); - - replyBuilder.Append(type switch - { - HighscoreTypes.messages => $" - {value} {HighscoreTypes.messages} - {Math.Round((double)(100 * value) / guildMessages, 2)}%\n", - HighscoreTypes.seasons => $" - {value} {HighscoreTypes.messages}\n", - _ => $" - {value} {type}\n" - }); - - highscorePlace++; - } - - return replyBuilder.ToString(); - } - } -} \ No newline at end of file diff --git a/src/Commands/Roll/Roll.cs b/src/Commands/Roll/Roll.cs deleted file mode 100644 index a431bd9..0000000 --- a/src/Commands/Roll/Roll.cs +++ /dev/null @@ -1,91 +0,0 @@ -using Geekbot.Core; -using Geekbot.Core.Database; -using Geekbot.Core.Database.Models; -using Geekbot.Core.Extensions; -using Geekbot.Core.KvInMemoryStore; -using Geekbot.Core.RandomNumberGenerator; - -namespace Geekbot.Commands.Roll -{ - public class Roll - { - private readonly IKvInMemoryStore _kvInMemoryStore; - private readonly DatabaseContext _database; - private readonly IRandomNumberGenerator _randomNumberGenerator; - - public Roll(IKvInMemoryStore kvInMemoryStore, DatabaseContext database, IRandomNumberGenerator randomNumberGenerator) - { - _kvInMemoryStore = kvInMemoryStore; - _database = database; - _randomNumberGenerator = randomNumberGenerator; - } - - public async Task RunFromGateway(ulong guildId, ulong userId, string userName, string unparsedGuess) - { - int.TryParse(unparsedGuess, out var guess); - return await this.Run(guildId.AsLong(), userId.AsLong(), userName, guess); - } - - public async Task RunFromInteraction(string guildId, string userId, string userName, int guess) - { - return await this.Run(long.Parse(guildId), long.Parse(userId), userName, guess); - } - - private async Task Run(long guildId, long userId, string userName, int guess) - { - var number = _randomNumberGenerator.Next(1, 100); - - if (guess <= 100 && guess > 0) - { - var kvKey = $"{guildId}:{userId}:RollsPrevious"; - var prevRoll = _kvInMemoryStore.Get(kvKey); - - if (prevRoll?.LastGuess == guess && prevRoll?.GuessedOn.AddDays(1) > DateTime.Now) - { - return string.Format( - Core.Localization.Roll.NoPrevGuess, - $"<@{userId}>", - DateLocalization.FormatDateTimeAsRemaining(prevRoll.GuessedOn.AddDays(1))); - } - - _kvInMemoryStore.Set(kvKey, new RollTimeout { LastGuess = guess, GuessedOn = DateTime.Now }); - - var answer = string.Format(Core.Localization.Roll.Rolled, $"<@{userId}>", number, guess); - - if (guess == number) - { - var user = await GetUser(guildId, userId); - user.Rolls += 1; - _database.Rolls.Update(user); - await _database.SaveChangesAsync(); - answer += string.Format(($"\n{Core.Localization.Roll.Gratz}"), userName); - } - - return answer; - } - else - { - return string.Format(Core.Localization.Roll.RolledNoGuess, $"<@{userId}>", number); - } - } - - private async Task GetUser(long guildId, long userId) - { - var user = _database.Rolls.FirstOrDefault(u => u.GuildId.Equals(guildId) && u.UserId.Equals(userId)) ?? await CreateNewRow(guildId, userId); - return user; - } - - private async Task CreateNewRow(long guildId, long userId) - { - var user = new RollsModel() - { - GuildId = guildId, - UserId = userId, - Rolls = 0 - }; - var newUser = _database.Rolls.Add(user).Entity; - await _database.SaveChangesAsync(); - return newUser; - } - } -} \ No newline at end of file diff --git a/src/Commands/Roll/RollTimeout.cs b/src/Commands/Roll/RollTimeout.cs deleted file mode 100644 index d296c45..0000000 --- a/src/Commands/Roll/RollTimeout.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace Geekbot.Commands.Roll -{ - public record RollTimeout - { - public int LastGuess { get; set; } - public DateTime GuessedOn { get; set; } - } -} \ No newline at end of file diff --git a/src/Commands/UrbanDictionary/UrbanDictionary.cs b/src/Commands/UrbanDictionary/UrbanDictionary.cs deleted file mode 100644 index 9862463..0000000 --- a/src/Commands/UrbanDictionary/UrbanDictionary.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Drawing; -using Geekbot.Core; -using Geekbot.Interactions.Embed; - -namespace Geekbot.Commands.UrbanDictionary; - -public class UrbanDictionary -{ - public static async Task Run(string term) - { - var definitions = await HttpAbstractions.Get(new Uri($"https://api.urbandictionary.com/v0/define?term={term}")); - - if (definitions.List.Count == 0) - { - return null; - } - - var definition = definitions.List.First(e => !string.IsNullOrWhiteSpace(e.Example)); - - static string ShortenIfToLong(string str, int maxLength) => str.Length > maxLength ? $"{str[..(maxLength - 5)]}[...]" : str; - - var eb = new Embed(); - eb.Author = new() - { - Name = definition.Word, - Url = definition.Permalink - }; - eb.SetColor(Color.Gold); - - if (!string.IsNullOrEmpty(definition.Definition)) eb.Description = ShortenIfToLong(definition.Definition, 1800); - if (!string.IsNullOrEmpty(definition.Example)) eb.AddField("Example", ShortenIfToLong(definition.Example, 1024)); - if (definition.ThumbsUp != 0) eb.AddInlineField("Upvotes", definition.ThumbsUp.ToString()); - if (definition.ThumbsDown != 0) eb.AddInlineField("Downvotes", definition.ThumbsDown.ToString()); - - return eb; - } -} \ No newline at end of file diff --git a/src/Commands/UrbanDictionary/UrbanDictionaryListItem.cs b/src/Commands/UrbanDictionary/UrbanDictionaryListItem.cs deleted file mode 100644 index 822ca8a..0000000 --- a/src/Commands/UrbanDictionary/UrbanDictionaryListItem.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Commands.UrbanDictionary; - -public record UrbanDictionaryListItem -{ - [JsonPropertyName("definition")] - public string Definition { get; set; } - - [JsonPropertyName("permalink")] - public string Permalink { get; set; } - - [JsonPropertyName("thumbs_up")] - public int ThumbsUp { get; set; } - - [JsonPropertyName("word")] - public string Word { get; set; } - - [JsonPropertyName("example")] - public string Example { get; set; } - - [JsonPropertyName("thumbs_down")] - public int ThumbsDown { get; set; } -} diff --git a/src/Commands/UrbanDictionary/UrbanDictionaryResponse.cs b/src/Commands/UrbanDictionary/UrbanDictionaryResponse.cs deleted file mode 100644 index 42861c3..0000000 --- a/src/Commands/UrbanDictionary/UrbanDictionaryResponse.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Commands.UrbanDictionary; - -public struct UrbanDictionaryResponse -{ - [JsonPropertyName("tags")] - public string[] Tags { get; set; } - - [JsonPropertyName("list")] - public List List { get; set; } -} \ No newline at end of file diff --git a/src/Core/BotCommandLookup/CommandInfo.cs b/src/Core/BotCommandLookup/CommandInfo.cs deleted file mode 100644 index c5793ac..0000000 --- a/src/Core/BotCommandLookup/CommandInfo.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; - -namespace Geekbot.Core.BotCommandLookup; - -public struct CommandInfo -{ - public string Name { get; set; } - public Dictionary Parameters { get; set; } - public List Aliases { get; set; } - public string Summary { get; set; } -} \ No newline at end of file diff --git a/src/Core/BotCommandLookup/CommandLookup.cs b/src/Core/BotCommandLookup/CommandLookup.cs deleted file mode 100644 index 62369c6..0000000 --- a/src/Core/BotCommandLookup/CommandLookup.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using Discord.Commands; - -namespace Geekbot.Core.BotCommandLookup; - -public class CommandLookup -{ - private readonly Assembly _assembly; - - public CommandLookup(Assembly assembly) - { - _assembly = assembly; - } - - public List GetCommands() - { - var commands = SearchCommands(_assembly); - var result = new List(); - commands.ForEach(x => GetCommandDefinition(ref result, x)); - - return result; - } - - private List SearchCommands(Assembly assembly) - { - bool IsLoadableModule(TypeInfo info) => info.DeclaredMethods.Any(x => x.GetCustomAttribute() != null || x.GetCustomAttribute() != null); - return assembly - .DefinedTypes - .Where(typeInfo => typeInfo.IsPublic || typeInfo.IsNestedPublic) - .Where(IsLoadableModule) - .ToList(); - } - - private void GetCommandDefinition(ref List commandInfos, TypeInfo commandType) - { - var methods = commandType - .GetMethods() - .Where(x => x.GetCustomAttribute() != null) - .ToList(); - - var commandGroup = (commandType.GetCustomAttributes().FirstOrDefault(attr => attr is GroupAttribute) as GroupAttribute)?.Prefix; - - foreach (var command in methods) - { - var commandInfo = new CommandInfo() - { - Parameters = new Dictionary(), - }; - - foreach (var attr in command.GetCustomAttributes()) - { - - switch (attr) - { - case SummaryAttribute name: - commandInfo.Summary = name.Text; - break; - case CommandAttribute name: - commandInfo.Name = string.IsNullOrEmpty(commandGroup) ? name.Text : $"{commandGroup} {name.Text}"; - break; - case AliasAttribute name: - commandInfo.Aliases = name.Aliases.ToList() ?? new List(); - break; - } - } - - foreach (var param in command.GetParameters()) - { - var paramName = param.Name ?? string.Empty; - var paramInfo = new ParameterInfo() - { - Summary = param.GetCustomAttribute()?.Text ?? string.Empty, - Type = param.ParameterType.Name, - DefaultValue = param.DefaultValue?.ToString() - }; - commandInfo.Parameters.Add(paramName, paramInfo); - } - - if (!string.IsNullOrEmpty(commandInfo.Name)) - { - commandInfos.Add(commandInfo); - } - } - } -} \ No newline at end of file diff --git a/src/Core/BotCommandLookup/ParameterInfo.cs b/src/Core/BotCommandLookup/ParameterInfo.cs deleted file mode 100644 index afdfd50..0000000 --- a/src/Core/BotCommandLookup/ParameterInfo.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Geekbot.Core.BotCommandLookup; - -public struct ParameterInfo -{ - public string Summary { get; set; } - public string Type { get; set; } - public string DefaultValue { get; set; } -} \ No newline at end of file diff --git a/src/Core/Constants.cs b/src/Core/Constants.cs deleted file mode 100644 index 4dd08b9..0000000 --- a/src/Core/Constants.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Reflection; - -namespace Geekbot.Core -{ - public static class Constants - { - public const string Name = "Geekbot"; - - public static string BotVersion() - { - return typeof(Constants).Assembly.GetCustomAttribute().InformationalVersion; - } - - public static string LibraryVersion() - { - return typeof(Discord.WebSocket.DiscordSocketClient).Assembly.GetCustomAttribute().InformationalVersion; - } - - public const double ApiVersion = 1; - } -} \ No newline at end of file diff --git a/src/Core/Converters/EmojiConverter.cs b/src/Core/Converters/EmojiConverter.cs deleted file mode 100644 index d25415f..0000000 --- a/src/Core/Converters/EmojiConverter.cs +++ /dev/null @@ -1,138 +0,0 @@ -using System.Collections; -using System.Text; - -namespace Geekbot.Core.Converters -{ - public static class EmojiConverter - { - private static readonly string[] NumberEmojiMap = - { - ":zero:", - ":one:", - ":two:", - ":three:", - ":four:", - ":five:", - ":six:", - ":seven:", - ":eight:", - ":nine:" - }; - - public static string NumberToEmoji(int number) - { - if (number == 10) - { - return "🔟"; - } - - var numbers = number.ToString().ToCharArray(); - var returnString = new StringBuilder(); - foreach (var n in numbers) - { - returnString.Append(NumberEmojiMap[int.Parse(n.ToString())]); - } - return returnString.ToString(); - } - - private static readonly Hashtable TextEmojiMap = new Hashtable - { - ['A'] = ":regional_indicator_a: ", - ['B'] = ":b: ", - ['C'] = ":regional_indicator_c: ", - ['D'] = ":regional_indicator_d: ", - ['E'] = ":regional_indicator_e: ", - ['F'] = ":regional_indicator_f: ", - ['G'] = ":regional_indicator_g: ", - ['H'] = ":regional_indicator_h: ", - ['I'] = ":regional_indicator_i: ", - ['J'] = ":regional_indicator_j: ", - ['K'] = ":regional_indicator_k: ", - ['L'] = ":regional_indicator_l: ", - ['M'] = ":regional_indicator_m: ", - ['N'] = ":regional_indicator_n: ", - ['O'] = ":regional_indicator_o: ", - ['P'] = ":regional_indicator_p: ", - ['Q'] = ":regional_indicator_q: ", - ['R'] = ":regional_indicator_r: ", - ['S'] = ":regional_indicator_s: ", - ['T'] = ":regional_indicator_t: ", - ['U'] = ":regional_indicator_u: ", - ['V'] = ":regional_indicator_v: ", - ['W'] = ":regional_indicator_w: ", - ['X'] = ":regional_indicator_x: ", - ['Y'] = ":regional_indicator_y: ", - ['Z'] = ":regional_indicator_z: ", - ['!'] = ":exclamation: ", - ['?'] = ":question: ", - ['#'] = ":hash: ", - ['*'] = ":star2: ", - ['+'] = ":heavy_plus_sign: ", - ['0'] = ":zero: ", - ['1'] = ":one: ", - ['2'] = ":two: ", - ['3'] = ":three: ", - ['4'] = ":four: ", - ['5'] = ":five: ", - ['6'] = ":six: ", - ['7'] = ":seven: ", - ['8'] = ":eight: ", - ['9'] = ":nine: ", - [' '] = " " - }; - - public static string TextToEmoji(string text) - { - var letters = text.ToUpper().ToCharArray(); - var returnString = new StringBuilder(); - foreach (var n in letters) - { - var emoji = TextEmojiMap[n] ?? n; - returnString.Append(emoji); - } - return returnString.ToString(); - } - - private static readonly Hashtable RegionalIndicatorMap = new Hashtable() - { - ['A'] = new Rune(0x1F1E6), - ['B'] = new Rune(0x1F1E7), - ['C'] = new Rune(0x1F1E8), - ['D'] = new Rune(0x1F1E9), - ['E'] = new Rune(0x1F1EA), - ['F'] = new Rune(0x1F1EB), - ['G'] = new Rune(0x1F1EC), - ['H'] = new Rune(0x1F1ED), - ['I'] = new Rune(0x1F1EE), - ['J'] = new Rune(0x1F1EF), - ['K'] = new Rune(0x1F1F0), - ['L'] = new Rune(0x1F1F1), - ['M'] = new Rune(0x1F1F2), - ['N'] = new Rune(0x1F1F3), - ['O'] = new Rune(0x1F1F4), - ['P'] = new Rune(0x1F1F5), - ['Q'] = new Rune(0x1F1F6), - ['R'] = new Rune(0x1F1F7), - ['S'] = new Rune(0x1F1F8), - ['T'] = new Rune(0x1F1F9), - ['U'] = new Rune(0x1F1FA), - ['V'] = new Rune(0x1F1FB), - ['W'] = new Rune(0x1F1FC), - ['X'] = new Rune(0x1F1FD), - ['Y'] = new Rune(0x1F1FE), - ['Z'] = new Rune(0x1F1FF) - }; - - public static string CountryCodeToEmoji(string countryCode) - { - var letters = countryCode.ToUpper().ToCharArray(); - var returnString = new StringBuilder(); - foreach (var n in letters) - { - var emoji = RegionalIndicatorMap[n]; - returnString.Append(emoji); - } - return returnString.ToString(); - } - } -} \ No newline at end of file diff --git a/src/Core/Converters/IMtgManaConverter.cs b/src/Core/Converters/IMtgManaConverter.cs deleted file mode 100644 index 0dd3034..0000000 --- a/src/Core/Converters/IMtgManaConverter.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Geekbot.Core.Converters -{ - public interface IMtgManaConverter - { - string ConvertMana(string mana); - } -} \ No newline at end of file diff --git a/src/Core/Converters/MtgManaConverter.cs b/src/Core/Converters/MtgManaConverter.cs deleted file mode 100644 index aa6b74c..0000000 --- a/src/Core/Converters/MtgManaConverter.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System.Collections.Generic; -using System.Text.RegularExpressions; - -namespace Geekbot.Core.Converters -{ - public class MtgManaConverter : IMtgManaConverter - { - private readonly Dictionary _manaDict; - - public MtgManaConverter() - { - // these emotes can be found at https://discord.gg/bz8HyA7 - _manaDict = new Dictionary - { - {"{0}", "<:mtg_0:415216130043412482>"}, - {"{1}", "<:mtg_1:415216130253389835>"}, - {"{2}", "<:mtg_2:415216130031091713>"}, - {"{3}", "<:mtg_3:415216130467037194>"}, - {"{4}", "<:mtg_4:415216130026635295>"}, - {"{5}", "<:mtg_5:415216130492203008>"}, - {"{6}", "<:mtg_6:415216130458779658>"}, - {"{7}", "<:mtg_7:415216130190475265>"}, - {"{8}", "<:mtg_8:415216130517630986>"}, - {"{9}", "<:mtg_9:415216130500722689>"}, - {"{10", "<:mtg_10:415216130450391051>"}, - {"{11}", "<:mtg_11:415216130811101185>"}, - {"{12}", "<:mtg_12:415216130525888532>"}, - {"{13}", "<:mtg_13:415216130517631000>"}, - {"{14}", "<:mtg_14:415216130165178370>"}, - {"{15}", "<:mtg_15:415216130576089108>"}, - {"{16}", "<:mtg_16:415216130358247425>"}, - {"{17}", "<:mtg_17:415216130601517056>"}, - {"{18}", "<:mtg_18:415216130462842891>"}, - {"{19}", "<:mtg_19:415216130614099988>"}, - {"{20}", "<:mtg_20:415216130656043038>"}, - {"{W}", "<:mtg_white:415216131515744256>"}, - {"{U}", "<:mtg_blue:415216130521694209>"}, - {"{B}", "<:mtg_black:415216130873884683>"}, - {"{R}", "<:mtg_red:415216131322806272>"}, - {"{G}", "<:mtg_green:415216131180331009>"}, - {"{S}", "<:mtg_s:415216131293446144>"}, - {"{T}", "<:mtg_tap:415258392727257088>"}, - {"{C}", "<:mtg_colorless:415216130706374666>"}, - {"{2/W}", "<:mtg_2w:415216130446065664>"}, - {"{2/U}", "<:mtg_2u:415216130429550592>"}, - {"{2/B}", "<:mtg_2b:415216130160984065>"}, - {"{2/R}", "<:mtg_2r:415216130454716436>"}, - {"{2/G}", "<:mtg_2g:415216130420899840>"}, - {"{W/U}", "<:mtg_wu:415216130970484736>"}, - {"{W/B}", "<:mtg_wb:415216131222011914>"}, - {"{U/R}", "<:mtg_ur:415216130962096128>"}, - {"{U/B}", "<:mtg_ub:415216130865758218>"}, - {"{R/W}", "<:mtg_rw:415216130878210057>"}, - {"{G/W}", "<:mtg_gw:415216130567962646>"}, - {"{G/U}", "<:mtg_gu:415216130739666945>"}, - {"{B/R}", "<:mtg_br:415216130580283394>"}, - {"{B/G}", "<:mtg_bg:415216130781609994>"}, - {"{U/P}", "<:mtg_up:415216130861432842>"}, - {"{R/P}", "<:mtg_rp:415216130597322783>"}, - {"{G/P}", "<:mtg_gp:415216130760769546>"}, - {"{W/P}", "<:mtg_wp:415216131541041172>"}, - {"{B/P}", "<:mtg_bp:415216130664169482>"} - }; - } - - public string ConvertMana(string mana) - { - var rgx = Regex.Matches(mana, @"(\{(.*?)\})"); - foreach (Match manaTypes in rgx) - { - var m = _manaDict.GetValueOrDefault(manaTypes.Value); - if (!string.IsNullOrEmpty(m)) - { - mana = mana.Replace(manaTypes.Value, m); - } - } - - return mana; - } - } -} \ No newline at end of file diff --git a/src/Core/Core.csproj b/src/Core/Core.csproj deleted file mode 100644 index 2cd8dbc..0000000 --- a/src/Core/Core.csproj +++ /dev/null @@ -1,94 +0,0 @@ - - - - net6.0 - $(VersionSuffix) - $(VersionSuffix) - 0.0.0-DEV - Geekbot.Core - Geekbot.Core - NU1701 - True - Library - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - ResXFileCodeGenerator - Admin.Designer.cs - - - ResXFileCodeGenerator - Choose.Designer.cs - - - ResXFileCodeGenerator - Cookies.Designer.cs - - - ResXFileCodeGenerator - Corona.Designer.cs - - - ResXFileCodeGenerator - EightBall.Designer.cs - - - ResXFileCodeGenerator - Internal.Designer.cs - - - ResXFileCodeGenerator - Karma.Designer.cs - - - ResXFileCodeGenerator - Quote.Designer.cs - - - ResXFileCodeGenerator - Rank.Designer.cs - - - ResXFileCodeGenerator - Role.Designer.cs - - - ResXFileCodeGenerator - Roll.Designer.cs - - - ResXFileCodeGenerator - Ship.Designer.cs - - - ResXFileCodeGenerator - Stats.Designer.cs - - - - diff --git a/src/Core/Database/DatabaseContext.cs b/src/Core/Database/DatabaseContext.cs deleted file mode 100644 index 14a1275..0000000 --- a/src/Core/Database/DatabaseContext.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Geekbot.Core.Database.Models; -using Microsoft.EntityFrameworkCore; - -namespace Geekbot.Core.Database -{ - public class DatabaseContext : DbContext - { - public DbSet Quotes { get; set; } - public DbSet Users { get; set; } - public DbSet GuildSettings { get; set; } - public DbSet Karma { get; set; } - public DbSet Ships { get; set; } - public DbSet Rolls { get; set; } - public DbSet MessagesSeasons { get; set; } - public DbSet Messages { get; set; } - public DbSet Slaps { get; set; } - public DbSet Globals { get; set; } - public DbSet RoleSelfService { get; set; } - public DbSet Cookies { get; set; } - public DbSet ReactionListeners { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/Database/DatabaseInitializer.cs b/src/Core/Database/DatabaseInitializer.cs deleted file mode 100644 index 37f07bc..0000000 --- a/src/Core/Database/DatabaseInitializer.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using Geekbot.Core.Database.LoggingAdapter; -using Geekbot.Core.Logger; -using Npgsql.Logging; - -namespace Geekbot.Core.Database -{ - public class DatabaseInitializer - { - private readonly RunParameters _runParameters; - private readonly GeekbotLogger _logger; - - public DatabaseInitializer(RunParameters runParameters, GeekbotLogger logger) - { - _runParameters = runParameters; - _logger = logger; - NpgsqlLogManager.Provider = new NpgsqlLoggingProviderAdapter(logger, runParameters); - } - - public DatabaseContext Initialize() - { - DatabaseContext database = null; - try - { - if (_runParameters.InMemory) - { - database = new InMemoryDatabase("geekbot"); - } - else - { - database = new SqlDatabase(new SqlConnectionString - { - Host = _runParameters.DbHost, - Port = _runParameters.DbPort, - Database = _runParameters.DbDatabase, - Username = _runParameters.DbUser, - Password = _runParameters.DbPassword, - RequireSsl = _runParameters.DbSsl, - TrustServerCertificate = _runParameters.DbTrustCert, - RedshiftCompatibility = _runParameters.DbRedshiftCompatibility - }); - } - } - catch (Exception e) - { - _logger.Error(LogSource.Geekbot, "Could not Connect to datbase", e); - Environment.Exit(GeekbotExitCode.DatabaseConnectionFailed.GetHashCode()); - } - - if (_runParameters.DbLogging) - { - _logger.Information(LogSource.Database, $"Connected with {database.Database.ProviderName}"); - } - - return database; - } - } -} \ No newline at end of file diff --git a/src/Core/Database/InMemoryDatabase.cs b/src/Core/Database/InMemoryDatabase.cs deleted file mode 100644 index 1077aea..0000000 --- a/src/Core/Database/InMemoryDatabase.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.EntityFrameworkCore; - -namespace Geekbot.Core.Database -{ - public class InMemoryDatabase : DatabaseContext - { - private readonly string _name; - - public InMemoryDatabase(string name) - { - _name = name; - } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - => optionsBuilder.UseInMemoryDatabase(_name); - } -} \ No newline at end of file diff --git a/src/Core/Database/LoggingAdapter/NpgsqlLoggingAdapter.cs b/src/Core/Database/LoggingAdapter/NpgsqlLoggingAdapter.cs deleted file mode 100644 index 8a46c0d..0000000 --- a/src/Core/Database/LoggingAdapter/NpgsqlLoggingAdapter.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using Geekbot.Core.Logger; -using Npgsql.Logging; -using LogLevel = NLog.LogLevel; - -namespace Geekbot.Core.Database.LoggingAdapter -{ - public class NpgsqlLoggingAdapter : NpgsqlLogger - { - private readonly string _name; - private readonly IGeekbotLogger _geekbotLogger; - private readonly RunParameters _runParameters; - - public NpgsqlLoggingAdapter(string name, IGeekbotLogger geekbotLogger, RunParameters runParameters) - { - _name = name.Substring(7); - _geekbotLogger = geekbotLogger; - _runParameters = runParameters; - geekbotLogger.Trace(LogSource.Database, $"Loaded Npgsql logging adapter: {name}"); - } - - public override bool IsEnabled(NpgsqlLogLevel level) - { - return (_runParameters.DbLogging && _geekbotLogger.GetNLogger().IsEnabled(ToGeekbotLogLevel(level))); - } - - public override void Log(NpgsqlLogLevel level, int connectorId, string msg, Exception exception = null) - { - var nameAndMessage = $"{_name}: {msg}"; - switch (level) - { - case NpgsqlLogLevel.Trace: - _geekbotLogger.Trace(LogSource.Database, nameAndMessage); - break; - case NpgsqlLogLevel.Debug: - _geekbotLogger.Debug(LogSource.Database, nameAndMessage); - break; - case NpgsqlLogLevel.Info: - _geekbotLogger.Information(LogSource.Database, nameAndMessage); - break; - case NpgsqlLogLevel.Warn: - _geekbotLogger.Warning(LogSource.Database, nameAndMessage, exception); - break; - case NpgsqlLogLevel.Error: - case NpgsqlLogLevel.Fatal: - _geekbotLogger.Error(LogSource.Database, nameAndMessage, exception); - break; - default: - _geekbotLogger.Information(LogSource.Database, nameAndMessage); - break; - } - } - - private static LogLevel ToGeekbotLogLevel(NpgsqlLogLevel level) - { - return level switch - { - NpgsqlLogLevel.Trace => LogLevel.Trace, - NpgsqlLogLevel.Debug => LogLevel.Debug, - NpgsqlLogLevel.Info => LogLevel.Info, - NpgsqlLogLevel.Warn => LogLevel.Warn, - NpgsqlLogLevel.Error => LogLevel.Error, - NpgsqlLogLevel.Fatal => LogLevel.Fatal, - _ => throw new ArgumentOutOfRangeException(nameof(level)) - }; - } - } -} \ No newline at end of file diff --git a/src/Core/Database/LoggingAdapter/NpgsqlLoggingProviderAdapter.cs b/src/Core/Database/LoggingAdapter/NpgsqlLoggingProviderAdapter.cs deleted file mode 100644 index c4f76d7..0000000 --- a/src/Core/Database/LoggingAdapter/NpgsqlLoggingProviderAdapter.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Geekbot.Core.Logger; -using Npgsql.Logging; - -namespace Geekbot.Core.Database.LoggingAdapter -{ - public class NpgsqlLoggingProviderAdapter : INpgsqlLoggingProvider - { - private readonly GeekbotLogger _geekbotLogger; - private readonly RunParameters _runParameters; - - public NpgsqlLoggingProviderAdapter(GeekbotLogger geekbotLogger, RunParameters runParameters) - { - _geekbotLogger = geekbotLogger; - _runParameters = runParameters; - } - - public NpgsqlLogger CreateLogger(string name) - { - return new NpgsqlLoggingAdapter(name, _geekbotLogger, _runParameters); - } - } -} \ No newline at end of file diff --git a/src/Core/Database/Models/CookiesModel.cs b/src/Core/Database/Models/CookiesModel.cs deleted file mode 100644 index 6ec71f9..0000000 --- a/src/Core/Database/Models/CookiesModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; - -namespace Geekbot.Core.Database.Models -{ - public class CookiesModel - { - [Key] - public int Id { get; set; } - - [Required] - public long GuildId { get; set; } - - [Required] - public long UserId { get; set; } - - public int Cookies { get; set; } = 0; - - public DateTimeOffset? LastPayout { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/Database/Models/GlobalsModel.cs b/src/Core/Database/Models/GlobalsModel.cs deleted file mode 100644 index af084f9..0000000 --- a/src/Core/Database/Models/GlobalsModel.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Geekbot.Core.Database.Models -{ - public class GlobalsModel - { - [Key] - public int Id { get; set; } - - [Required] - public string Name { get; set; } - - [Required] - public string Value { get; set; } - - public string Meta { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/Database/Models/GuildSettingsModel.cs b/src/Core/Database/Models/GuildSettingsModel.cs deleted file mode 100644 index 80655f7..0000000 --- a/src/Core/Database/Models/GuildSettingsModel.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Geekbot.Core.Database.Models -{ - public class GuildSettingsModel - { - [Key] - public int Id { get; set; } - - [Required] - public long GuildId { get; set; } - - public bool Ping { get; set; } = false; - - public bool Hui { get; set; } = false; - - public long ModChannel { get; set; } = 0; - - public string WelcomeMessage { get; set; } - - public long WelcomeChannel { get; set; } - - public bool ShowDelete { get; set; } = false; - - public bool ShowLeave { get; set; } = false; - - public string WikiLang { get; set; } = "en"; - - public string Language { get; set; } = "EN"; - } -} \ No newline at end of file diff --git a/src/Core/Database/Models/KarmaModel.cs b/src/Core/Database/Models/KarmaModel.cs deleted file mode 100644 index 2ec64f0..0000000 --- a/src/Core/Database/Models/KarmaModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; - -namespace Geekbot.Core.Database.Models -{ - public class KarmaModel - { - [Key] - public int Id { get; set; } - - [Required] - public long GuildId { get; set; } - - [Required] - public long UserId { get; set; } - - public int Karma { get; set; } - - public DateTimeOffset TimeOut { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/Database/Models/MessageSeasonsModel.cs b/src/Core/Database/Models/MessageSeasonsModel.cs deleted file mode 100644 index 5a4252c..0000000 --- a/src/Core/Database/Models/MessageSeasonsModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Geekbot.Core.Database.Models -{ - public class MessageSeasonsModel - { - [Key] - public int Id { get; set; } - - [Required] - public long GuildId { get; set; } - - [Required] - public long UserId { get; set; } - - [Required] - public string Season { get; set; } - - public int MessageCount { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/Database/Models/MessagesModel.cs b/src/Core/Database/Models/MessagesModel.cs deleted file mode 100644 index 87731d8..0000000 --- a/src/Core/Database/Models/MessagesModel.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Geekbot.Core.Database.Models -{ - public class MessagesModel - { - [Key] - public int Id { get; set; } - - [Required] - public long GuildId { get; set; } - - [Required] - public long UserId { get; set; } - - public int MessageCount { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/Database/Models/QuoteModel.cs b/src/Core/Database/Models/QuoteModel.cs deleted file mode 100644 index 3d356d2..0000000 --- a/src/Core/Database/Models/QuoteModel.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; - -namespace Geekbot.Core.Database.Models -{ - public class QuoteModel - { - [Key] - public int Id { get; set; } - - [Required] - public int InternalId { get; set; } - - [Required] - public long GuildId { get; set; } - - [Required] - public long UserId { get; set; } - - [Required] - [DataType(DataType.DateTime)] - public DateTime Time { get; set; } - - public string Quote { get; set; } - - public string Image { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/Database/Models/ReactionListenerModel.cs b/src/Core/Database/Models/ReactionListenerModel.cs deleted file mode 100644 index 5ec28be..0000000 --- a/src/Core/Database/Models/ReactionListenerModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Geekbot.Core.Database.Models -{ - public class ReactionListenerModel - { - [Key] - public int Id { get; set; } - - [Required] - public long GuildId { get; set; } - - [Required] - public long MessageId { get; set; } - - [Required] - public long RoleId { get; set; } - - [Required] - public string Reaction { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/Database/Models/RoleSelfServiceModel.cs b/src/Core/Database/Models/RoleSelfServiceModel.cs deleted file mode 100644 index 4aa92c4..0000000 --- a/src/Core/Database/Models/RoleSelfServiceModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Geekbot.Core.Database.Models -{ - public class RoleSelfServiceModel - { - [Key] - public int Id { get; set; } - - [Required] - public long GuildId { get; set; } - - public long RoleId { get; set; } - - public string WhiteListName { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/Database/Models/RollsModel.cs b/src/Core/Database/Models/RollsModel.cs deleted file mode 100644 index aa6613d..0000000 --- a/src/Core/Database/Models/RollsModel.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Geekbot.Core.Database.Models -{ - public class RollsModel - { - [Key] - public int Id { get; set; } - - [Required] - public long GuildId { get; set; } - - [Required] - public long UserId { get; set; } - - public int Rolls { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/Database/Models/ShipsModel.cs b/src/Core/Database/Models/ShipsModel.cs deleted file mode 100644 index 23cf367..0000000 --- a/src/Core/Database/Models/ShipsModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Geekbot.Core.Database.Models -{ - public class ShipsModel - { - [Key] - public int Id { get; set; } - - public long FirstUserId { get; set; } - - public long SecondUserId { get; set; } - - public int Strength { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/Database/Models/SlapsModel.cs b/src/Core/Database/Models/SlapsModel.cs deleted file mode 100644 index 09026c8..0000000 --- a/src/Core/Database/Models/SlapsModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Geekbot.Core.Database.Models -{ - public class SlapsModel - { - [Key] - public int Id { get; set; } - - [Required] - public long GuildId { get; set; } - - [Required] - public long UserId { get; set; } - - public int Given { get; set; } - - public int Recieved { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/Database/Models/UserModel.cs b/src/Core/Database/Models/UserModel.cs deleted file mode 100644 index aa6281d..0000000 --- a/src/Core/Database/Models/UserModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; - -namespace Geekbot.Core.Database.Models -{ - public class UserModel - { - [Key] - public int Id { get; set; } - - [Required] - public long UserId { get; set; } - - [Required] - public string Username { get; set; } - - [Required] - public string Discriminator { get; set; } - - public string AvatarUrl { get; set; } - - [Required] - public bool IsBot { get; set; } - - public DateTimeOffset Joined { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/Database/SqlConnectionString.cs b/src/Core/Database/SqlConnectionString.cs deleted file mode 100644 index ca2858d..0000000 --- a/src/Core/Database/SqlConnectionString.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Text; - -namespace Geekbot.Core.Database -{ - public class SqlConnectionString - { - public string Host { get; set; } - public string Port { get; set; } - public string Database { get; set; } - public string Username { get; set; } - public string Password { get; set; } - public bool RequireSsl { get; set; } - public bool TrustServerCertificate { get; set; } - public bool RedshiftCompatibility { get; set; } - - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("Application Name=Geekbot;"); - - sb.Append($"Host={Host};"); - sb.Append($"Port={Port};"); - sb.Append($"Database={Database};"); - sb.Append($"Username={Username};"); - sb.Append($"Password={Password};"); - - var sslMode = RequireSsl ? "Require" : "Prefer"; - sb.Append($"SSL Mode={sslMode};"); - sb.Append($"Trust Server Certificate={TrustServerCertificate.ToString()};"); - - if (RedshiftCompatibility) - { - sb.Append("Server Compatibility Mode=Redshift"); - } - - return sb.ToString(); - } - } -} \ No newline at end of file diff --git a/src/Core/Database/SqlDatabase.cs b/src/Core/Database/SqlDatabase.cs deleted file mode 100644 index 8a4d195..0000000 --- a/src/Core/Database/SqlDatabase.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.EntityFrameworkCore; - -namespace Geekbot.Core.Database -{ - public class SqlDatabase : DatabaseContext - { - private readonly SqlConnectionString _connectionString; - - public SqlDatabase(SqlConnectionString connectionString) - { - _connectionString = connectionString; - } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - => optionsBuilder.UseNpgsql(_connectionString.ToString()); - } -} \ No newline at end of file diff --git a/src/Core/DateLocalization.cs b/src/Core/DateLocalization.cs deleted file mode 100644 index 39b447f..0000000 --- a/src/Core/DateLocalization.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Text; - -namespace Geekbot.Core -{ - public class DateLocalization - { - public static string FormatDateTimeAsRemaining(DateTimeOffset dateTime) - { - return FormatDateTimeAsRemaining(dateTime - DateTimeOffset.Now); - } - - public static string FormatDateTimeAsRemaining(TimeSpan remaining) - { - const string formattable = "{0} {1}"; - var sb = new StringBuilder(); - - if (remaining.Days > 0) - { - sb.AppendFormat(formattable, remaining.Days, GetSingularOrPlural(remaining.Days, Localization.Internal.Days)); - } - - if (remaining.Hours > 0) - { - if (sb.Length > 0) sb.Append(", "); - sb.AppendFormat(formattable, remaining.Hours, GetSingularOrPlural(remaining.Hours, Localization.Internal.Hours)); - } - - if (remaining.Minutes > 0) - { - if (sb.Length > 0) sb.Append(", "); - sb.AppendFormat(formattable, remaining.Minutes, GetSingularOrPlural(remaining.Minutes, Localization.Internal.Minutes)); - } - - if (remaining.Seconds > 0) - { - if (sb.Length > 0) - { - sb.AppendFormat(" {0} ", Localization.Internal.And); - } - sb.AppendFormat(formattable, remaining.Seconds, GetSingularOrPlural(remaining.Seconds, Localization.Internal.Seconds)); - } - - return sb.ToString().Trim(); - } - - private static string GetSingularOrPlural(int number, string rawString) - { - var versions = rawString.Split('|'); - return number == 1 ? versions[0] : versions[1]; - } - } -} \ No newline at end of file diff --git a/src/Core/DiceParser/DiceException.cs b/src/Core/DiceParser/DiceException.cs deleted file mode 100644 index 6c6c29c..0000000 --- a/src/Core/DiceParser/DiceException.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace Geekbot.Core.DiceParser -{ - public class DiceException : Exception - { - public DiceException(string message) : base(message) - { - } - - public string DiceName { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/DiceParser/DiceInput.cs b/src/Core/DiceParser/DiceInput.cs deleted file mode 100644 index 60f0bd2..0000000 --- a/src/Core/DiceParser/DiceInput.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; - -namespace Geekbot.Core.DiceParser -{ - public class DiceInput - { - public List Dice { get; set; } = new List(); - public DiceInputOptions Options { get; set; } = new DiceInputOptions(); - public int SkillModifier { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/DiceParser/DiceInputOptions.cs b/src/Core/DiceParser/DiceInputOptions.cs deleted file mode 100644 index 5606a5e..0000000 --- a/src/Core/DiceParser/DiceInputOptions.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Geekbot.Core.DiceParser -{ - public struct DiceInputOptions - { - public bool ShowTotal { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/DiceParser/DiceParser.cs b/src/Core/DiceParser/DiceParser.cs deleted file mode 100644 index b0f6a88..0000000 --- a/src/Core/DiceParser/DiceParser.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.Linq; -using System.Text.RegularExpressions; -using Geekbot.Core.RandomNumberGenerator; - -namespace Geekbot.Core.DiceParser -{ - public class DiceParser : IDiceParser - { - private readonly IRandomNumberGenerator _randomNumberGenerator; - private readonly Regex _inputRegex; - private readonly Regex _singleDieRegex; - - public DiceParser(IRandomNumberGenerator randomNumberGenerator) - { - _randomNumberGenerator = randomNumberGenerator; - _inputRegex = new Regex( - @"((?\+\d+d\d+)|(?\-\d+d\d+)|(?\d+d\d+)|(?(total))|(?(\+|\-)\d+))\s", - RegexOptions.Compiled | RegexOptions.IgnoreCase, - new TimeSpan(0, 0, 2)); - _singleDieRegex = new Regex( - @"\d+d\d+", - RegexOptions.Compiled | RegexOptions.IgnoreCase, - new TimeSpan(0, 0, 0, 0, 500)); - } - - public DiceInput Parse(string input) - { - // adding a whitespace at the end, otherwise the parser might pickup on false items - var inputWithExtraWhitespace = $"{input} "; - - var matches = _inputRegex.Matches(inputWithExtraWhitespace); - var result = new DiceInput(); - var resultOptions = new DiceInputOptions(); - - foreach (Match match in matches) - { - foreach (Group matchGroup in match.Groups) - { - if (matchGroup.Success) - { - switch (matchGroup.Name) - { - case "DieNormal": - result.Dice.Add(Die(matchGroup.Value, DieAdvantageType.None)); - break; - case "DieAdvantage": - result.Dice.Add(Die(matchGroup.Value, DieAdvantageType.Advantage)); - break; - case "DieDisadvantage": - result.Dice.Add(Die(matchGroup.Value, DieAdvantageType.Disadvantage)); - break; - case "Keywords": - Keywords(matchGroup.Value, ref resultOptions); - break; - case "SkillModifer": - result.SkillModifier = SkillModifer(matchGroup.Value); - break; - } - } - } - } - - if (!result.Dice.Any()) - { - result.Dice.Add(new SingleDie(_randomNumberGenerator)); - } - - result.Options = resultOptions; - - return result; - } - - private SingleDie Die(string match, DieAdvantageType advantageType) - { - var x = _singleDieRegex.Match(match).Value.Split('d'); - var die = new SingleDie(_randomNumberGenerator) - { - Amount = int.Parse(x[0]), - Sides = int.Parse(x[1]), - AdvantageType = advantageType - }; - die.ValidateDie(); - return die; - } - - private int SkillModifer(string match) - { - return int.Parse(match); - } - - private void Keywords(string match, ref DiceInputOptions options) - { - switch (match) - { - case "total": - options.ShowTotal = true; - break; - } - } - } -} \ No newline at end of file diff --git a/src/Core/DiceParser/DieAdvantageType.cs b/src/Core/DiceParser/DieAdvantageType.cs deleted file mode 100644 index 9bd7486..0000000 --- a/src/Core/DiceParser/DieAdvantageType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Geekbot.Core.DiceParser -{ - public enum DieAdvantageType - { - Advantage, - Disadvantage, - None - } -} \ No newline at end of file diff --git a/src/Core/DiceParser/DieResult.cs b/src/Core/DiceParser/DieResult.cs deleted file mode 100644 index aa309c0..0000000 --- a/src/Core/DiceParser/DieResult.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; - -namespace Geekbot.Core.DiceParser -{ - public class DieResult - { - // public int Result { get; set; } - public int Roll1 { get; set; } - public int Roll2 { get; set; } - public DieAdvantageType AdvantageType { get; set; } - - public override string ToString() - { - return AdvantageType switch - { - DieAdvantageType.Advantage => Roll1 > Roll2 ? $"(**{Roll1}**, {Roll2})" : $"({Roll1}, **{Roll2}**)", - DieAdvantageType.Disadvantage => Roll1 < Roll2 ? $"(**{Roll1}**, {Roll2})" : $"({Roll1}, **{Roll2}**)", - _ => Result.ToString() - }; - } - - public int Result => AdvantageType switch - { - DieAdvantageType.None => Roll1, - DieAdvantageType.Advantage => Math.Max(Roll1, Roll2), - DieAdvantageType.Disadvantage => Math.Min(Roll1, Roll2), - _ => 0 - }; - } -} \ No newline at end of file diff --git a/src/Core/DiceParser/IDiceParser.cs b/src/Core/DiceParser/IDiceParser.cs deleted file mode 100644 index ab1ebd3..0000000 --- a/src/Core/DiceParser/IDiceParser.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Geekbot.Core.DiceParser -{ - public interface IDiceParser - { - DiceInput Parse(string input); - } -} \ No newline at end of file diff --git a/src/Core/DiceParser/SingleDie.cs b/src/Core/DiceParser/SingleDie.cs deleted file mode 100644 index 7c1ae41..0000000 --- a/src/Core/DiceParser/SingleDie.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.Collections.Generic; -using Geekbot.Core.Extensions; -using Geekbot.Core.RandomNumberGenerator; - -namespace Geekbot.Core.DiceParser -{ - public class SingleDie - { - private readonly IRandomNumberGenerator _random; - - public SingleDie(IRandomNumberGenerator random) - { - _random = random; - } - - public int Sides { get; set; } = 20; - public int Amount { get; set; } = 1; - public DieAdvantageType AdvantageType { get; set; } = DieAdvantageType.None; - - public string DiceName => AdvantageType switch - { - DieAdvantageType.Advantage => $"{Amount}d{Sides} (with advantage)", - DieAdvantageType.Disadvantage => $"{Amount}d{Sides} (with disadvantage)", - _ => $"{Amount}d{Sides}" - }; - - public List Roll() - { - var results = new List(); - - Amount.Times(() => - { - var result = new DieResult - { - Roll1 = _random.Next(1, Sides), - AdvantageType = AdvantageType - }; - - if (AdvantageType == DieAdvantageType.Advantage || AdvantageType == DieAdvantageType.Disadvantage) - { - result.Roll2 = _random.Next(1, Sides); - } - - results.Add(result); - }); - - return results; - } - - public void ValidateDie() - { - if (Amount < 1) - { - throw new DiceException("To few dice, must be a minimum of 1"); - } - if (Amount > 24) - { - throw new DiceException("To many dice, maximum allowed is 24") { DiceName = DiceName }; - } - - if (Sides < 2) - { - throw new DiceException("Die must have at least 2 sides") { DiceName = DiceName }; - } - - if (Sides > 145) - { - throw new DiceException("Die can not have more than 145 sides") { DiceName = DiceName }; - } - } - } -} \ No newline at end of file diff --git a/src/Core/ErrorHandling/ErrorHandler.cs b/src/Core/ErrorHandling/ErrorHandler.cs deleted file mode 100644 index 0b55bd8..0000000 --- a/src/Core/ErrorHandling/ErrorHandler.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord.Commands; -using Geekbot.Core.Logger; -using Sentry; -using Exception = System.Exception; - -namespace Geekbot.Core.ErrorHandling -{ - public class ErrorHandler : IErrorHandler - { - private readonly IGeekbotLogger _logger; - private readonly Func _getDefaultErrorText; - private readonly bool _errorsInChat; - - public ErrorHandler(IGeekbotLogger logger, RunParameters runParameters, Func getDefaultErrorText) - { - _logger = logger; - _getDefaultErrorText = getDefaultErrorText; - _errorsInChat = runParameters.ExposeErrors; - } - - public async Task HandleCommandException(Exception e, ICommandContext context, string errorMessage = "def") - { - try - { - var errorString = errorMessage == "def" - ? _getDefaultErrorText() - : errorMessage; - var errorObj = SimpleConextConverter.ConvertContext(context); - if (e.Message.Contains("50007")) return; - if (e.Message.Contains("50013")) return; - _logger.Error(LogSource.Geekbot, "An error ocured", e, errorObj); - if (!string.IsNullOrEmpty(errorMessage)) - { - if (_errorsInChat) - { - var resStackTrace = string.IsNullOrEmpty(e.InnerException?.ToString()) ? e.StackTrace : e.InnerException?.ToString(); - if (!string.IsNullOrEmpty(resStackTrace)) - { - var maxLen = Math.Min(resStackTrace.Length, 1850); - await context.Channel.SendMessageAsync($"{e.Message}\r\n```\r\n{resStackTrace.Substring(0, maxLen)}\r\n```"); - } - else - { - await context.Channel.SendMessageAsync(e.Message); - } - } - else - { - await context.Channel.SendMessageAsync(errorString); - } - - } - - ReportExternal(e, errorObj); - } - catch (Exception ex) - { - try - { - await context.Channel.SendMessageAsync("Something went really really wrong here"); - } - finally - { - _logger.Error(LogSource.Geekbot, "Errorception", ex); - } - } - } - - private void ReportExternal(Exception e, MessageDto errorObj) - { - if (!SentrySdk.IsEnabled) return; - - var sentryEvent = new SentryEvent(e) - { - Message = errorObj.Message.Content, - }; - sentryEvent.SetTag("discord_server", errorObj.Guild.Name); - sentryEvent.SetExtra("Channel", errorObj.Channel); - sentryEvent.SetExtra("Guild", errorObj.Guild); - sentryEvent.SetExtra("Message", errorObj.Message); - sentryEvent.SetExtra("User", errorObj.User); - - SentrySdk.CaptureEvent(sentryEvent); - } - } -} \ No newline at end of file diff --git a/src/Core/ErrorHandling/IErrorHandler.cs b/src/Core/ErrorHandling/IErrorHandler.cs deleted file mode 100644 index d0e1d20..0000000 --- a/src/Core/ErrorHandling/IErrorHandler.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord.Commands; - -namespace Geekbot.Core.ErrorHandling -{ - public interface IErrorHandler - { - Task HandleCommandException(Exception e, ICommandContext context, string errorMessage = "def"); - } -} \ No newline at end of file diff --git a/src/Core/Extensions/DbSetExtensions.cs b/src/Core/Extensions/DbSetExtensions.cs deleted file mode 100644 index 3ccffe9..0000000 --- a/src/Core/Extensions/DbSetExtensions.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.ChangeTracking; - -namespace Geekbot.Core.Extensions -{ - public static class DbSetExtensions - { - public static EntityEntry AddIfNotExists(this DbSet dbSet, T entity, Expression> predicate = null) where T : class, new() - { - var exists = predicate != null ? dbSet.Any(predicate) : dbSet.Any(); - return !exists ? dbSet.Add(entity) : null; - } - - // https://github.com/dotnet/efcore/issues/18124 - public static IAsyncEnumerable AsAsyncEnumerable(this Microsoft.EntityFrameworkCore.DbSet obj) where TEntity : class - { - return Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.AsAsyncEnumerable(obj); - } - public static IQueryable Where(this Microsoft.EntityFrameworkCore.DbSet obj, System.Linq.Expressions.Expression> predicate) where TEntity : class - { - return System.Linq.Queryable.Where(obj, predicate); - } - } -} \ No newline at end of file diff --git a/src/Core/Extensions/EmbedBuilderExtensions.cs b/src/Core/Extensions/EmbedBuilderExtensions.cs deleted file mode 100644 index c546306..0000000 --- a/src/Core/Extensions/EmbedBuilderExtensions.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Discord; - -namespace Geekbot.Core.Extensions -{ - public static class EmbedBuilderExtensions - { - public static EmbedBuilder AddInlineField(this EmbedBuilder builder, string name, object value) - { - return builder.AddField(new EmbedFieldBuilder().WithIsInline(true).WithName(name).WithValue(value)); - } - } -} \ No newline at end of file diff --git a/src/Core/Extensions/IntExtensions.cs b/src/Core/Extensions/IntExtensions.cs deleted file mode 100644 index dac03e7..0000000 --- a/src/Core/Extensions/IntExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Geekbot.Core.Extensions -{ - public static class IntExtensions - { - public static void Times(this int count, Action action) - { - for (var i = 0; i < count; i++) - { - action(); - } - } - } -} \ No newline at end of file diff --git a/src/Core/Extensions/LongExtensions.cs b/src/Core/Extensions/LongExtensions.cs deleted file mode 100644 index 087910e..0000000 --- a/src/Core/Extensions/LongExtensions.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Geekbot.Core.Extensions -{ - public static class LongExtensions - { - public static ulong AsUlong(this long thing) - { - return Convert.ToUInt64(thing); - } - } -} \ No newline at end of file diff --git a/src/Core/Extensions/StringExtensions.cs b/src/Core/Extensions/StringExtensions.cs deleted file mode 100644 index 9affad1..0000000 --- a/src/Core/Extensions/StringExtensions.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Linq; - -namespace Geekbot.Core.Extensions -{ - public static class StringExtensions - { - public static string CapitalizeFirst(this string source) - { - return source.First().ToString().ToUpper() + source.Substring(1); - } - } -} \ No newline at end of file diff --git a/src/Core/Extensions/UlongExtensions.cs b/src/Core/Extensions/UlongExtensions.cs deleted file mode 100644 index 295f317..0000000 --- a/src/Core/Extensions/UlongExtensions.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Geekbot.Core.Extensions -{ - public static class UlongExtensions - { - public static long AsLong(this ulong thing) - { - return Convert.ToInt64(thing); - } - } -} \ No newline at end of file diff --git a/src/Core/GeekbotCommandBase.cs b/src/Core/GeekbotCommandBase.cs deleted file mode 100644 index 801c53c..0000000 --- a/src/Core/GeekbotCommandBase.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Globalization; -using System.Threading; -using Discord.Commands; -using Geekbot.Core.Database.Models; -using Geekbot.Core.ErrorHandling; -using Geekbot.Core.GuildSettingsManager; - -namespace Geekbot.Core -{ - public class GeekbotCommandBase : TransactionModuleBase - { - protected readonly IGuildSettingsManager GuildSettingsManager; - protected GuildSettingsModel GuildSettings; - protected readonly IErrorHandler ErrorHandler; - - protected GeekbotCommandBase(IErrorHandler errorHandler, IGuildSettingsManager guildSettingsManager) - { - GuildSettingsManager = guildSettingsManager; - ErrorHandler = errorHandler; - } - - protected override void BeforeExecute(CommandInfo command) - { - base.BeforeExecute(command); - - var setupSpan = Transaction.StartChild("Setup"); - - GuildSettings = GuildSettingsManager.GetSettings(Context?.Guild?.Id ?? 0); - var language = GuildSettings.Language; - Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(language); - - setupSpan.Finish(); - } - } -} \ No newline at end of file diff --git a/src/Core/GeekbotExitCode.cs b/src/Core/GeekbotExitCode.cs deleted file mode 100644 index 51006e1..0000000 --- a/src/Core/GeekbotExitCode.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Geekbot.Core -{ - public enum GeekbotExitCode - { - // General - Clean = 0, - InvalidArguments = 1, - - // Geekbot Internals - TranslationsFailed = 201, - KilledByApiCall = 210, - - // Dependent Services - /* 301 not in use anymore (redis) */ - DatabaseConnectionFailed = 302, - - // Discord Related - CouldNotLogin = 401 - - } -} \ No newline at end of file diff --git a/src/Core/GlobalSettings/GlobalSettings.cs b/src/Core/GlobalSettings/GlobalSettings.cs deleted file mode 100644 index a000f8b..0000000 --- a/src/Core/GlobalSettings/GlobalSettings.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Geekbot.Core.Database; -using Geekbot.Core.Database.Models; - -namespace Geekbot.Core.GlobalSettings -{ - public class GlobalSettings : IGlobalSettings - { - private readonly DatabaseContext _database; - private readonly Dictionary _cache; - - public GlobalSettings(DatabaseContext database) - { - _database = database; - _cache = new Dictionary(); - } - - public async Task SetKey(string keyName, string value) - { - try - { - var key = GetKeyFull(keyName); - if (key == null) - { - _database.Globals.Add(new GlobalsModel() - { - Name = keyName, - Value = value - }); - await _database.SaveChangesAsync(); - return true; - } - key.Value = value; - _database.Globals.Update(key); - _cache[keyName] = value; - await _database.SaveChangesAsync(); - return true; - } - catch - { - return false; - } - } - - public string GetKey(string keyName) - { - var keyValue = ""; - if (string.IsNullOrEmpty(_cache.GetValueOrDefault(keyName))) - { - keyValue = _database.Globals.FirstOrDefault(k => k.Name.Equals(keyName))?.Value ?? string.Empty; - _cache[keyName] = keyValue; - } - else - { - keyValue = _cache[keyName]; - } - return keyValue ; - } - - public GlobalsModel GetKeyFull(string keyName) - { - var key = _database.Globals.FirstOrDefault(k => k.Name.Equals(keyName)); - return key; - } - } -} \ No newline at end of file diff --git a/src/Core/GlobalSettings/IGlobalSettings.cs b/src/Core/GlobalSettings/IGlobalSettings.cs deleted file mode 100644 index 082b3dc..0000000 --- a/src/Core/GlobalSettings/IGlobalSettings.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Threading.Tasks; -using Geekbot.Core.Database.Models; - -namespace Geekbot.Core.GlobalSettings -{ - public interface IGlobalSettings - { - Task SetKey(string keyName, string value); - string GetKey(string keyName); - GlobalsModel GetKeyFull(string keyName); - } -} \ No newline at end of file diff --git a/src/Core/GuildSettingsManager/GuildSettingsManager.cs b/src/Core/GuildSettingsManager/GuildSettingsManager.cs deleted file mode 100644 index 565563f..0000000 --- a/src/Core/GuildSettingsManager/GuildSettingsManager.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Geekbot.Core.Database; -using Geekbot.Core.Database.Models; -using Geekbot.Core.Extensions; - -namespace Geekbot.Core.GuildSettingsManager -{ - public class GuildSettingsManager : IGuildSettingsManager - { - private readonly DatabaseContext _database; - private readonly Dictionary _settings; - - public GuildSettingsManager(DatabaseContext database) - { - _database = database; - _settings = new Dictionary(); - } - - public GuildSettingsModel GetSettings(ulong guildId, bool createIfNonExist = true) - { - return _settings.ContainsKey(guildId) ? _settings[guildId] : GetFromDatabase(guildId, createIfNonExist); - } - - public async Task UpdateSettings(GuildSettingsModel settings) - { - _database.GuildSettings.Update(settings); - if (_settings.ContainsKey(settings.GuildId.AsUlong())) - { - _settings[settings.GuildId.AsUlong()] = settings; - } - else - { - _settings.Add(settings.GuildId.AsUlong(), settings); - } - await _database.SaveChangesAsync(); - } - - private GuildSettingsModel GetFromDatabase(ulong guildId, bool createIfNonExist) - { - var settings = _database.GuildSettings.FirstOrDefault(guild => guild.GuildId.Equals(guildId.AsLong())); - if (createIfNonExist && settings == null) - { - settings = CreateSettings(guildId); - } - - _settings.Add(guildId, settings); - return settings; - } - - private GuildSettingsModel CreateSettings(ulong guildId) - { - _database.GuildSettings.Add(new GuildSettingsModel - { - GuildId = guildId.AsLong(), - Hui = false, - Ping = false, - Language = "EN", - ShowDelete = false, - ShowLeave = false, - WikiLang = "en" - }); - _database.SaveChanges(); - return _database.GuildSettings.FirstOrDefault(g => g.GuildId.Equals(guildId.AsLong())); - } - } -} \ No newline at end of file diff --git a/src/Core/GuildSettingsManager/IGuildSettingsManager.cs b/src/Core/GuildSettingsManager/IGuildSettingsManager.cs deleted file mode 100644 index d34eb73..0000000 --- a/src/Core/GuildSettingsManager/IGuildSettingsManager.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Threading.Tasks; -using Geekbot.Core.Database.Models; - -namespace Geekbot.Core.GuildSettingsManager -{ - public interface IGuildSettingsManager - { - GuildSettingsModel GetSettings(ulong guildId, bool createIfNonExist = true); - Task UpdateSettings(GuildSettingsModel settings); - } -} \ No newline at end of file diff --git a/src/Core/Highscores/HighscoreListEmptyException.cs b/src/Core/Highscores/HighscoreListEmptyException.cs deleted file mode 100644 index 5fc08ee..0000000 --- a/src/Core/Highscores/HighscoreListEmptyException.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace Geekbot.Core.Highscores -{ - public class HighscoreListEmptyException : Exception - { - public HighscoreListEmptyException() {} - - public HighscoreListEmptyException(string message) : base(message) {} - - public HighscoreListEmptyException(string message, Exception inner) : base(message, inner) {} - } -} \ No newline at end of file diff --git a/src/Core/Highscores/HighscoreManager.cs b/src/Core/Highscores/HighscoreManager.cs deleted file mode 100644 index c839b39..0000000 --- a/src/Core/Highscores/HighscoreManager.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Geekbot.Core.Database; -using Geekbot.Core.Extensions; -using Geekbot.Core.UserRepository; - -namespace Geekbot.Core.Highscores -{ - public class HighscoreManager : IHighscoreManager - { - private readonly DatabaseContext _database; - private readonly IUserRepository _userRepository; - - public HighscoreManager(DatabaseContext databaseContext, IUserRepository userRepository) - { - _database = databaseContext; - _userRepository = userRepository; - - } - - public Dictionary GetHighscoresWithUserData(HighscoreTypes type, ulong guildId, int amount, string season = null) - { - var list = type switch - { - HighscoreTypes.messages => GetMessageList(guildId, amount), - HighscoreTypes.karma => GetKarmaList(guildId, amount), - HighscoreTypes.rolls => GetRollsList(guildId, amount), - HighscoreTypes.cookies => GetCookiesList(guildId, amount), - HighscoreTypes.seasons => GetMessageSeasonList(guildId, amount, season), - HighscoreTypes.quotes => GetQuotesList(guildId, amount), - _ => new Dictionary() - }; - - if (!list.Any()) - { - throw new HighscoreListEmptyException($"No {type} found for guild {guildId}"); - } - - var highscoreUsers = new Dictionary(); - foreach (var user in list) - { - try - { - var guildUser = _userRepository.Get(user.Key); - if (guildUser?.Username != null) - { - highscoreUsers.Add(new HighscoreUserDto - { - Username = guildUser.Username, - Discriminator = guildUser.Discriminator, - Avatar = guildUser.AvatarUrl - }, user.Value); - } - else - { - highscoreUsers.Add(new HighscoreUserDto - { - Id = user.Key.ToString() - }, user.Value); - } - } - catch - { - // ignore - } - } - - return highscoreUsers; - } - - public Dictionary GetMessageList(ulong guildId, int amount) - { - return _database.Messages - .Where(k => k.GuildId.Equals(guildId.AsLong())) - .OrderByDescending(o => o.MessageCount) - .Take(amount) - .ToDictionary(key => key.UserId.AsUlong(), key => key.MessageCount); - } - - public Dictionary GetMessageSeasonList(ulong guildId, int amount, string season) - { - if (string.IsNullOrEmpty(season)) - { - season = SeasonsUtils.GetCurrentSeason(); - } - return _database.MessagesSeasons - .Where(k => k.GuildId.Equals(guildId.AsLong()) && k.Season.Equals(season)) - .OrderByDescending(o => o.MessageCount) - .Take(amount) - .ToDictionary(key => key.UserId.AsUlong(), key => key.MessageCount); - } - - public Dictionary GetKarmaList(ulong guildId, int amount) - { - return _database.Karma - .Where(k => k.GuildId.Equals(guildId.AsLong())) - .OrderByDescending(o => o.Karma) - .Take(amount) - .ToDictionary(key => key.UserId.AsUlong(), key => key.Karma); - } - - public Dictionary GetRollsList(ulong guildId, int amount) - { - return _database.Rolls - .Where(k => k.GuildId.Equals(guildId.AsLong())) - .OrderByDescending(o => o.Rolls) - .Take(amount) - .ToDictionary(key => key.UserId.AsUlong(), key => key.Rolls); - } - - private Dictionary GetCookiesList(ulong guildId, int amount) - { - return _database.Cookies - .Where(k => k.GuildId.Equals(guildId.AsLong())) - .OrderByDescending(o => o.Cookies) - .Take(amount) - .ToDictionary(key => key.UserId.AsUlong(), key => key.Cookies); - } - - private Dictionary GetQuotesList(ulong guildId, int amount) - { - return _database.Quotes - .Where(row => row.GuildId == guildId.AsLong()) - .GroupBy(row => row.UserId) - .Select(row => new { userId = row.Key, amount = row.Count()}) - .OrderByDescending(row => row.amount) - .Take(amount) - .ToDictionary(key => key.userId.AsUlong(), key => key.amount); - } - } -} \ No newline at end of file diff --git a/src/Core/Highscores/HighscoreTypes.cs b/src/Core/Highscores/HighscoreTypes.cs deleted file mode 100644 index 3aa396e..0000000 --- a/src/Core/Highscores/HighscoreTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Geekbot.Core.Highscores -{ - public enum HighscoreTypes - { - messages, - karma, - rolls, - cookies, - seasons, - quotes - } -} \ No newline at end of file diff --git a/src/Core/Highscores/HighscoreUserDto.cs b/src/Core/Highscores/HighscoreUserDto.cs deleted file mode 100644 index 58e1897..0000000 --- a/src/Core/Highscores/HighscoreUserDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Geekbot.Core.Highscores -{ - public class HighscoreUserDto - { - public string Username { get; set; } - public string Avatar { get; set; } - public string Discriminator { get; set; } - public string Id { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/Highscores/IHighscoreManager.cs b/src/Core/Highscores/IHighscoreManager.cs deleted file mode 100644 index 9c2d6f0..0000000 --- a/src/Core/Highscores/IHighscoreManager.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; - -namespace Geekbot.Core.Highscores -{ - public interface IHighscoreManager - { - Dictionary GetHighscoresWithUserData(HighscoreTypes type, ulong guildId, int amount, string season = null); - Dictionary GetMessageList(ulong guildId, int amount); - Dictionary GetMessageSeasonList(ulong guildId, int amount, string season); - Dictionary GetKarmaList(ulong guildId, int amount); - Dictionary GetRollsList(ulong guildId, int amount); - } -} \ No newline at end of file diff --git a/src/Core/Highscores/SeasonsUtils.cs b/src/Core/Highscores/SeasonsUtils.cs deleted file mode 100644 index d2a8e3e..0000000 --- a/src/Core/Highscores/SeasonsUtils.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Globalization; - -namespace Geekbot.Core.Highscores -{ - public class SeasonsUtils - { - public static string GetCurrentSeason() - { - var now = DateTime.Now; - var year = (now.Year - 2000).ToString(CultureInfo.InvariantCulture); - var quarter = Math.Ceiling(now.Month / 3.0).ToString(CultureInfo.InvariantCulture); - return $"{year}Q{quarter}"; - } - } -} \ No newline at end of file diff --git a/src/Core/HttpAbstractions.cs b/src/Core/HttpAbstractions.cs deleted file mode 100644 index 629de74..0000000 --- a/src/Core/HttpAbstractions.cs +++ /dev/null @@ -1,189 +0,0 @@ -using System; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Text; -using System.Text.Json; -using System.Text.Json.Serialization; -using System.Threading.Tasks; - -namespace Geekbot.Core -{ - public static class HttpAbstractions - { - public static HttpClient CreateDefaultClient() - { - var client = new HttpClient - { - DefaultRequestHeaders = - { - Accept = {MediaTypeWithQualityHeaderValue.Parse("application/json")}, - } - }; - client.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "Geekbot/v0.0.0 (+https://geekbot.pizzaandcoffee.rocks/)"); - - return client; - } - - public static async Task Get(Uri location, HttpClient httpClient = null, bool disposeClient = true, int maxRetries = 3) - { - httpClient ??= CreateDefaultClient(); - httpClient.BaseAddress = location; - - HttpResponseMessage response; - try - { - response = await Execute(() => httpClient.GetAsync(location.PathAndQuery), maxRetries); - } - finally - { - if (disposeClient) - { - httpClient.Dispose(); - } - } - - var stringResponse = await response.Content.ReadAsStringAsync(); - return JsonSerializer.Deserialize(stringResponse); - } - - public static async Task Post(Uri location, object data, HttpClient httpClient = null, bool disposeClient = true, int maxRetries = 3) - { - httpClient ??= CreateDefaultClient(); - httpClient.BaseAddress = location; - - var content = new StringContent( - JsonSerializer.Serialize(data, new JsonSerializerOptions() { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull }), - Encoding.UTF8, - "application/json" - ); - - HttpResponseMessage response; - try - { - response = await Execute(() => httpClient.PostAsync(location, content), maxRetries); - } - finally - { - if (disposeClient) - { - httpClient.Dispose(); - } - } - - var stringResponse = await response.Content.ReadAsStringAsync(); - return JsonSerializer.Deserialize(stringResponse); - } - - public static async Task Post(Uri location, object data, HttpClient httpClient = null, bool disposeClient = true, int maxRetries = 3) - { - httpClient ??= CreateDefaultClient(); - httpClient.BaseAddress = location; - - var content = new StringContent( - JsonSerializer.Serialize(data, new JsonSerializerOptions() { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull }), - Encoding.UTF8, - "application/json" - ); - - try - { - await Execute(() => httpClient.PostAsync(location, content), maxRetries); - } - finally - { - if (disposeClient) - { - httpClient.Dispose(); - } - } - } - - public static async Task Patch(Uri location, object data, HttpClient httpClient = null, bool disposeClient = true, int maxRetries = 3) - { - httpClient ??= CreateDefaultClient(); - httpClient.BaseAddress = location; - - var content = new StringContent( - JsonSerializer.Serialize(data, new JsonSerializerOptions() { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull }), - Encoding.UTF8, - "application/json" - ); - - try - { - await Execute(() => httpClient.PatchAsync(location, content), maxRetries); - } - finally - { - if (disposeClient) - { - httpClient.Dispose(); - } - } - } - - public static async Task Delete(Uri location, HttpClient httpClient = null, bool disposeClient = true, int maxRetries = 3) - { - httpClient ??= CreateDefaultClient(); - httpClient.BaseAddress = location; - - try - { - await Execute(() => httpClient.DeleteAsync(location), maxRetries); - } - finally - { - if (disposeClient) - { - httpClient.Dispose(); - } - } - } - - private static async Task Execute(Func> request, int maxRetries) - { - var attempt = 0; - while (true) - { - var response = await request(); - if (!response.IsSuccessStatusCode) - { - if (attempt >= maxRetries) - { - throw new HttpRequestException($"Request failed after {attempt} attempts"); - } - - if (response.Headers.Contains("Retry-After")) - { - var retryAfter = response.Headers.GetValues("Retry-After").First(); - if (retryAfter.Contains(':')) - { - var duration = DateTimeOffset.Parse(retryAfter).ToUniversalTime() - DateTimeOffset.Now.ToUniversalTime(); - await Task.Delay(duration); - } - else - { - await Task.Delay(int.Parse(retryAfter) * 1000); - } - } - else if (response.StatusCode is HttpStatusCode.BadGateway or HttpStatusCode.ServiceUnavailable or HttpStatusCode.GatewayTimeout) - { - await Task.Delay(TimeSpan.FromSeconds(Math.Ceiling(attempt * 1.5))); - } - else - { - response.EnsureSuccessStatusCode(); - } - - attempt++; - } - else - { - return response; - } - } - } - } -} \ No newline at end of file diff --git a/src/Core/KvInMemoryStore/IKvInMemoryStore.cs b/src/Core/KvInMemoryStore/IKvInMemoryStore.cs deleted file mode 100644 index 6281f4b..0000000 --- a/src/Core/KvInMemoryStore/IKvInMemoryStore.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Geekbot.Core.KvInMemoryStore -{ - public interface IKvInMemoryStore - { - public T Get(string key); - public void Set(string key, T value); - public void Remove(string key); - } -} \ No newline at end of file diff --git a/src/Core/KvInMemoryStore/KvInMemoryStore.cs b/src/Core/KvInMemoryStore/KvInMemoryStore.cs deleted file mode 100644 index 4a50546..0000000 --- a/src/Core/KvInMemoryStore/KvInMemoryStore.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections.Generic; - -namespace Geekbot.Core.KvInMemoryStore -{ - public class KvInInMemoryStore : IKvInMemoryStore - { - private readonly Dictionary _storage = new Dictionary(); - - public T Get(string key) - { - try - { - return (T) _storage[key]; - } - catch - { - return default; - } - } - - public void Set(string key, T value) - { - _storage.Remove(key); - _storage.Add(key, value); - } - - public void Remove(string key) - { - _storage.Remove(key); - } - } -} \ No newline at end of file diff --git a/src/Core/Levels/ILevelCalc.cs b/src/Core/Levels/ILevelCalc.cs deleted file mode 100644 index 17413e6..0000000 --- a/src/Core/Levels/ILevelCalc.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Geekbot.Core.Levels -{ - public interface ILevelCalc - { - int GetLevel(int? experience); - } -} \ No newline at end of file diff --git a/src/Core/Levels/LevelCalc.cs b/src/Core/Levels/LevelCalc.cs deleted file mode 100644 index 8203f97..0000000 --- a/src/Core/Levels/LevelCalc.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Geekbot.Core.Levels -{ - public class LevelCalc : ILevelCalc - { - private readonly int[] _levels; - - public LevelCalc() - { - var levels = new List(); - double total = 0; - for (var i = 1; i < 120; i++) - { - total += Math.Floor(i + 300 * Math.Pow(2, i / 7.0)); - levels.Add((int) Math.Floor(total / 16)); - } - _levels = levels.ToArray(); - } - - public int GetLevel(int? messages) - { - return 1 + _levels.TakeWhile(level => !(level > messages)).Count(); - } - } -} \ No newline at end of file diff --git a/src/Core/Localization/Admin.Designer.cs b/src/Core/Localization/Admin.Designer.cs deleted file mode 100644 index 460d471..0000000 --- a/src/Core/Localization/Admin.Designer.cs +++ /dev/null @@ -1,78 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Geekbot.Core.Localization { - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Admin { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public Admin() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Core.Localization.Admin", typeof(Admin).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to I'm talking english. - /// - public static string GetLanguage { - get { - return ResourceManager.GetString("GetLanguage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to I will reply in english from now on. - /// - public static string NewLanguageSet { - get { - return ResourceManager.GetString("NewLanguageSet", resourceCulture); - } - } - } -} diff --git a/src/Core/Localization/Admin.de-ch.resx b/src/Core/Localization/Admin.de-ch.resx deleted file mode 100644 index b89939b..0000000 --- a/src/Core/Localization/Admin.de-ch.resx +++ /dev/null @@ -1,20 +0,0 @@ - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - I werd ab jetzt uf schwiizerdüütsch antworte, äuuä - - - I red schwiizerdüütsch - - \ No newline at end of file diff --git a/src/Core/Localization/Admin.resx b/src/Core/Localization/Admin.resx deleted file mode 100644 index 6fd2c62..0000000 --- a/src/Core/Localization/Admin.resx +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - I will reply in english from now on - - - I'm talking english - - \ No newline at end of file diff --git a/src/Core/Localization/Choose.Designer.cs b/src/Core/Localization/Choose.Designer.cs deleted file mode 100644 index 91ef136..0000000 --- a/src/Core/Localization/Choose.Designer.cs +++ /dev/null @@ -1,69 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Geekbot.Core.Localization { - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Choose { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public Choose() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Core.Localization.Choose", typeof(Choose).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to I Choose **{0}**. - /// - public static string Choice { - get { - return ResourceManager.GetString("Choice", resourceCulture); - } - } - } -} diff --git a/src/Core/Localization/Choose.de-ch.resx b/src/Core/Localization/Choose.de-ch.resx deleted file mode 100644 index eedc39b..0000000 --- a/src/Core/Localization/Choose.de-ch.resx +++ /dev/null @@ -1,17 +0,0 @@ - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - I nimme **{0}** - - \ No newline at end of file diff --git a/src/Core/Localization/Choose.resx b/src/Core/Localization/Choose.resx deleted file mode 100644 index 052177b..0000000 --- a/src/Core/Localization/Choose.resx +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - I Choose **{0}** - - \ No newline at end of file diff --git a/src/Core/Localization/Cookies.Designer.cs b/src/Core/Localization/Cookies.Designer.cs deleted file mode 100644 index 7a3442c..0000000 --- a/src/Core/Localization/Cookies.Designer.cs +++ /dev/null @@ -1,96 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Geekbot.Core.Localization { - using System; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Cookies { - - private static System.Resources.ResourceManager resourceMan; - - private static System.Globalization.CultureInfo resourceCulture; - - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public Cookies() { - } - - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public static System.Resources.ResourceManager ResourceManager { - get { - if (object.Equals(null, resourceMan)) { - System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Geekbot.Core.Localization.Cookies", typeof(Cookies).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public static System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - public static string GetCookies { - get { - return ResourceManager.GetString("GetCookies", resourceCulture); - } - } - - public static string WaitForMoreCookies { - get { - return ResourceManager.GetString("WaitForMoreCookies", resourceCulture); - } - } - - public static string InYourJar { - get { - return ResourceManager.GetString("InYourJar", resourceCulture); - } - } - - public static string Given { - get { - return ResourceManager.GetString("Given", resourceCulture); - } - } - - public static string NotEnoughToGive { - get { - return ResourceManager.GetString("NotEnoughToGive", resourceCulture); - } - } - - public static string NotEnoughCookiesToEat { - get { - return ResourceManager.GetString("NotEnoughCookiesToEat", resourceCulture); - } - } - - public static string AteCookies { - get { - return ResourceManager.GetString("AteCookies", resourceCulture); - } - } - - public static string CantTakeCookies { - get { - return ResourceManager.GetString("CantTakeCookies", resourceCulture); - } - } - } -} diff --git a/src/Core/Localization/Cookies.de-ch.resx b/src/Core/Localization/Cookies.de-ch.resx deleted file mode 100644 index 3652224..0000000 --- a/src/Core/Localization/Cookies.de-ch.resx +++ /dev/null @@ -1,38 +0,0 @@ - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Du häsch {0} guetzli becho, du häsch jetzt {1} guetzli ih dr büchse - - - Du hesch scho guetzli becho hüt, du chasch meh ha in {0} - - - Es hät {0} guetzli ih dineri büchs - - - Du hesch {1} {0} guetzli geh - - - Du hesch nid gnueg guetzli - - - Du hesch chuum no guetzli ih dineri büchs, du sötsch warschinli keini esse - - - Du hesch {0} guetzli gesse und hesch jezt no {1} übrig - - - :police_officer: Du chasch nid guetzli vo anderne chlaue... - - \ No newline at end of file diff --git a/src/Core/Localization/Cookies.resx b/src/Core/Localization/Cookies.resx deleted file mode 100644 index a359c5c..0000000 --- a/src/Core/Localization/Cookies.resx +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - You got {0} cookies, there are now {1} cookies in you cookie jar - - - You already got cookies today, you can have more cookies in {0} - - - There are {0} cookies in you cookie jar - - - You gave {0} cookies to {1} - - - You don't have enough cookies - - - Your cookie jar looks almost empty, you should probably not eat a cookie - - - You ate {0} cookies, you've only got {1} cookies left - - - You can't take someone else's cookies - - \ No newline at end of file diff --git a/src/Core/Localization/Corona.Designer.cs b/src/Core/Localization/Corona.Designer.cs deleted file mode 100644 index a19bbcd..0000000 --- a/src/Core/Localization/Corona.Designer.cs +++ /dev/null @@ -1,114 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Geekbot.Core.Localization { - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Corona { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public Corona() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Core.Localization.Corona", typeof(Corona).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Active. - /// - public static string Active { - get { - return ResourceManager.GetString("Active", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Confirmed Corona Cases. - /// - public static string ConfirmedCases { - get { - return ResourceManager.GetString("ConfirmedCases", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Deaths. - /// - public static string Deaths { - get { - return ResourceManager.GetString("Deaths", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Recovered. - /// - public static string Recovered { - get { - return ResourceManager.GetString("Recovered", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Source. - /// - public static string Source { - get { - return ResourceManager.GetString("Source", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Total. - /// - public static string Total { - get { - return ResourceManager.GetString("Total", resourceCulture); - } - } - } -} diff --git a/src/Core/Localization/Corona.de-ch.resx b/src/Core/Localization/Corona.de-ch.resx deleted file mode 100644 index 3c4180c..0000000 --- a/src/Core/Localization/Corona.de-ch.resx +++ /dev/null @@ -1,32 +0,0 @@ - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Bstätigti Corona Fallzahle - - - Total - - - Aktiv - - - Erholt - - - Gstorbe - - - Quelle - - \ No newline at end of file diff --git a/src/Core/Localization/Corona.resx b/src/Core/Localization/Corona.resx deleted file mode 100644 index 44bf85e..0000000 --- a/src/Core/Localization/Corona.resx +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Confirmed Corona Cases - - - Total - - - Active - - - Recovered - - - Deaths - - - Source - - \ No newline at end of file diff --git a/src/Core/Localization/EightBall.Designer.cs b/src/Core/Localization/EightBall.Designer.cs deleted file mode 100644 index eee2bc5..0000000 --- a/src/Core/Localization/EightBall.Designer.cs +++ /dev/null @@ -1,240 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Geekbot.Core.Localization { - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class EightBall { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public EightBall() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Core.Localization.EightBall", typeof(EightBall).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to As I see it, yes. - /// - public static string AsISeeItYes { - get { - return ResourceManager.GetString("AsISeeItYes", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Ask again later. - /// - public static string AskAgainLater { - get { - return ResourceManager.GetString("AskAgainLater", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Better not tell you now. - /// - public static string BetterNotTellYouNow { - get { - return ResourceManager.GetString("BetterNotTellYouNow", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot predict now. - /// - public static string CannotPredictNow { - get { - return ResourceManager.GetString("CannotPredictNow", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Concentrate and ask again. - /// - public static string ConcentrateAndAskAgain { - get { - return ResourceManager.GetString("ConcentrateAndAskAgain", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Don't count on it. - /// - public static string DontCountOnIt { - get { - return ResourceManager.GetString("DontCountOnIt", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to It is certain. - /// - public static string ItIsCertain { - get { - return ResourceManager.GetString("ItIsCertain", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to It is decidedly so. - /// - public static string ItIsDecidedlySo { - get { - return ResourceManager.GetString("ItIsDecidedlySo", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Most likely. - /// - public static string MostLikely { - get { - return ResourceManager.GetString("MostLikely", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to My reply is no. - /// - public static string MyReplyIsNo { - get { - return ResourceManager.GetString("MyReplyIsNo", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to My sources say no. - /// - public static string MySourcesSayNo { - get { - return ResourceManager.GetString("MySourcesSayNo", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Outlook good. - /// - public static string OutlookGood { - get { - return ResourceManager.GetString("OutlookGood", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Outlook not so good. - /// - public static string OutlookNotSoGood { - get { - return ResourceManager.GetString("OutlookNotSoGood", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Reply hazy try again. - /// - public static string ReplyHazyTryAgain { - get { - return ResourceManager.GetString("ReplyHazyTryAgain", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Signs point to yes. - /// - public static string SignsPointToYes { - get { - return ResourceManager.GetString("SignsPointToYes", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Very doubtful. - /// - public static string VeryDoubtful { - get { - return ResourceManager.GetString("VeryDoubtful", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Without a doubt. - /// - public static string WithoutADoubt { - get { - return ResourceManager.GetString("WithoutADoubt", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Yes. - /// - public static string Yes { - get { - return ResourceManager.GetString("Yes", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Yes, definitely. - /// - public static string YesDefinitely { - get { - return ResourceManager.GetString("YesDefinitely", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You may rely on it. - /// - public static string YouMayRelyOnIt { - get { - return ResourceManager.GetString("YouMayRelyOnIt", resourceCulture); - } - } - } -} diff --git a/src/Core/Localization/EightBall.de-ch.resx b/src/Core/Localization/EightBall.de-ch.resx deleted file mode 100644 index 89d7a60..0000000 --- a/src/Core/Localization/EightBall.de-ch.resx +++ /dev/null @@ -1,94 +0,0 @@ - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Es isch sicher - - - - So isch es entschiede worde - - - - Ohni zwifel - - - - Ja, absolut - - - - Chasch davo usgoh - - - - Wie ich es gsehn, ja - - - - Sehr waschinli - - - - Ussicht isch guet - - - - Ja - - - - Ahzeiche zeigend uf ja - - - - Antwort isch verschwumme, versuechs nomol - - - - Frög spöter nomol - - - - Segs dir jetzt besser nid - - - - Im mommnet chani das nid vorussege - - - - Konzentrier di und frog nomol - - - - Zähl nid druf - - - - Mini antwort isch nei - - - - Mini quellene seged nei - - - - Ussicht isch ned so guet - - - - Sehr froglich - - - \ No newline at end of file diff --git a/src/Core/Localization/EightBall.resx b/src/Core/Localization/EightBall.resx deleted file mode 100644 index 6eba369..0000000 --- a/src/Core/Localization/EightBall.resx +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - It is certain - - - - It is decidedly so - - - - Without a doubt - - - - Yes, definitely - - - - You may rely on it - - - - As I see it, yes - - - - Most likely - - - - Outlook good - - - - Yes - - - - Signs point to yes - - - - Reply hazy try again - - - - Ask again later - - - - Better not tell you now - - - - Cannot predict now - - - - Concentrate and ask again - - - - Don't count on it - - - - My reply is no - - - - My sources say no - - - - Outlook not so good - - - - Very doubtful - - - \ No newline at end of file diff --git a/src/Core/Localization/Internal.Designer.cs b/src/Core/Localization/Internal.Designer.cs deleted file mode 100644 index 967b26e..0000000 --- a/src/Core/Localization/Internal.Designer.cs +++ /dev/null @@ -1,123 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Geekbot.Core.Localization { - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Internal { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public Internal() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Core.Localization.Internal", typeof(Internal).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to and. - /// - public static string And { - get { - return ResourceManager.GetString("And", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to day|days. - /// - public static string Days { - get { - return ResourceManager.GetString("Days", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to hour|hours. - /// - public static string Hours { - get { - return ResourceManager.GetString("Hours", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Seems like i don't have enough permission to that :confused:. - /// - public static string Http403 { - get { - return ResourceManager.GetString("Http403", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to minute|minutes. - /// - public static string Minutes { - get { - return ResourceManager.GetString("Minutes", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to second|seconds. - /// - public static string Seconds { - get { - return ResourceManager.GetString("Seconds", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Something went wrong :confused:. - /// - public static string SomethingWentWrong { - get { - return ResourceManager.GetString("SomethingWentWrong", resourceCulture); - } - } - } -} diff --git a/src/Core/Localization/Internal.de-ch.resx b/src/Core/Localization/Internal.de-ch.resx deleted file mode 100644 index 568bb1f..0000000 --- a/src/Core/Localization/Internal.de-ch.resx +++ /dev/null @@ -1,35 +0,0 @@ - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Öppis isch schief gange :confused: - - - Gseht danach us das ich nid gnueg recht han zum das mache :confused: - - - tag|täg - - - stund|stunde - - - minute|minute - - - sekunde|sekunde - - - und - - \ No newline at end of file diff --git a/src/Core/Localization/Internal.resx b/src/Core/Localization/Internal.resx deleted file mode 100644 index a771d6b..0000000 --- a/src/Core/Localization/Internal.resx +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Something went wrong :confused: - - - Seems like i don't have enough permission to that :confused: - - - day|days - - - hour|hours - - - minute|minutes - - - second|seconds - - - and - - \ No newline at end of file diff --git a/src/Core/Localization/Karma.Designer.cs b/src/Core/Localization/Karma.Designer.cs deleted file mode 100644 index b3e8325..0000000 --- a/src/Core/Localization/Karma.Designer.cs +++ /dev/null @@ -1,150 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Geekbot.Core.Localization { - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Karma { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public Karma() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Core.Localization.Karma", typeof(Karma).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Amount. - /// - public static string Amount { - get { - return ResourceManager.GetString("Amount", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to By. - /// - public static string By { - get { - return ResourceManager.GetString("By", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sorry {0}, but you can't lower your own karma. - /// - public static string CannotChangeOwnDown { - get { - return ResourceManager.GetString("CannotChangeOwnDown", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sorry {0}, but you can't give yourself neutral karma. - /// - public static string CannotChangeOwnSame { - get { - return ResourceManager.GetString("CannotChangeOwnSame", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sorry {0}, but you can't give yourself karma. - /// - public static string CannotChangeOwnUp { - get { - return ResourceManager.GetString("CannotChangeOwnUp", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Current. - /// - public static string Current { - get { - return ResourceManager.GetString("Current", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Karma lowered. - /// - public static string Decreased { - get { - return ResourceManager.GetString("Decreased", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Gained Karma. - /// - public static string Increased { - get { - return ResourceManager.GetString("Increased", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Neutral Karma. - /// - public static string Neutral { - get { - return ResourceManager.GetString("Neutral", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sorry {0}, but you have to wait {1} before you can give karma again.... - /// - public static string WaitUntill { - get { - return ResourceManager.GetString("WaitUntill", resourceCulture); - } - } - } -} diff --git a/src/Core/Localization/Karma.de-ch.resx b/src/Core/Localization/Karma.de-ch.resx deleted file mode 100644 index 5805a27..0000000 --- a/src/Core/Localization/Karma.de-ch.resx +++ /dev/null @@ -1,44 +0,0 @@ - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Sorry {0}, aber du chasch dr selber kei karma geh - - - Sorry {0}, aber du musch no {1} warte bisch d wieder karma chasch geh... - - - Karma becho - - - Vo - - - Mengi - - - Jetzt - - - Sorry {0}, aber du chasch dis eigete karma nid senke - - - Karma gsenkt - - - Neutral Karma - - - Sorry {0}, aber du chasch dr selber kei neutrals karma geh - - \ No newline at end of file diff --git a/src/Core/Localization/Karma.resx b/src/Core/Localization/Karma.resx deleted file mode 100644 index a16e14a..0000000 --- a/src/Core/Localization/Karma.resx +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Sorry {0}, but you can't give yourself karma - - - Sorry {0}, but you have to wait {1} before you can give karma again... - - - Gained Karma - - - By - - - Amount - - - Current - - - Sorry {0}, but you can't lower your own karma - - - Karma lowered - - - Neutral Karma - - - Sorry {0}, but you can't give yourself neutral karma - - \ No newline at end of file diff --git a/src/Core/Localization/Quote.Designer.cs b/src/Core/Localization/Quote.Designer.cs deleted file mode 100644 index 9146971..0000000 --- a/src/Core/Localization/Quote.Designer.cs +++ /dev/null @@ -1,159 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Geekbot.Core.Localization { - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Quote { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public Quote() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Core.Localization.Quote", typeof(Quote).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to You can't save quotes by a bot.... - /// - public static string CannotQuoteBots { - get { - return ResourceManager.GetString("CannotQuoteBots", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You can't save your own quotes.... - /// - public static string CannotSaveOwnQuotes { - get { - return ResourceManager.GetString("CannotSaveOwnQuotes", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Most quoted person. - /// - public static string MostQuotesPerson { - get { - return ResourceManager.GetString("MostQuotesPerson", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This server doesn't seem to have any quotes yet. You can add a quote with `!quote save @user` or `!quote save <messageId>`. - /// - public static string NoQuotesFound { - get { - return ResourceManager.GetString("NoQuotesFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to That is not a valid message link. - /// - public static string NotAValidMessageLink { - get { - return ResourceManager.GetString("NotAValidMessageLink", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to I couldn't find a quote with that ID :disappointed:. - /// - public static string NotFoundWithId { - get { - return ResourceManager.GetString("NotFoundWithId", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You can only quote messages from the same server. - /// - public static string OnlyQuoteFromSameServer { - get { - return ResourceManager.GetString("OnlyQuoteFromSameServer", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to **Quote Added**. - /// - public static string QuoteAdded { - get { - return ResourceManager.GetString("QuoteAdded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Quote Stats. - /// - public static string QuoteStats { - get { - return ResourceManager.GetString("QuoteStats", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to **Removed #{0}**. - /// - public static string Removed { - get { - return ResourceManager.GetString("Removed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Total. - /// - public static string TotalQuotes { - get { - return ResourceManager.GetString("TotalQuotes", resourceCulture); - } - } - } -} diff --git a/src/Core/Localization/Quote.de-ch.resx b/src/Core/Localization/Quote.de-ch.resx deleted file mode 100644 index 99fd959..0000000 --- a/src/Core/Localization/Quote.de-ch.resx +++ /dev/null @@ -1,47 +0,0 @@ - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Dä server het no kei quotes. Du chasch quotes hinzuefüege mit `!quote save @user` oder `!quote save <messageId>` - - - Du chasch kei quotes vo dir selber speichere... - - - Du chasch kei quotes vomne bot speichere... - - - **Quote hinzugfüegt** - - - **#{0} glöscht** - - - Ich chan kei quote finde mit därri ID :disappointed: - - - Quote statistike - - - Total - - - Meist quoteti person - - - Das isch kei korrete nachrichtelink - - - Du chasch numme nachrichte vom gliche server quote - - \ No newline at end of file diff --git a/src/Core/Localization/Quote.resx b/src/Core/Localization/Quote.resx deleted file mode 100644 index b51d79c..0000000 --- a/src/Core/Localization/Quote.resx +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - This server doesn't seem to have any quotes yet. You can add a quote with `!quote save @user` or `!quote save <messageId>` - - - You can't save your own quotes... - - - You can't save quotes by a bot... - - - **Quote Added** - - - **Removed #{0}** - - - I couldn't find a quote with that ID :disappointed: - - - Quote Stats - - - Total - - - Most quoted person - - - That is not a valid message link - - - You can only quote messages from the same server - - \ No newline at end of file diff --git a/src/Core/Localization/Rank.Designer.cs b/src/Core/Localization/Rank.Designer.cs deleted file mode 100644 index 1439a8c..0000000 --- a/src/Core/Localization/Rank.Designer.cs +++ /dev/null @@ -1,105 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Geekbot.Core.Localization { - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Rank { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public Rank() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Core.Localization.Rank", typeof(Rank).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to :warning: I couldn't find all usernames. Maybe they left the server?. - /// - public static string FailedToResolveAllUsernames { - get { - return ResourceManager.GetString("FailedToResolveAllUsernames", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to :bar_chart: **{0} Highscore for {1}**. - /// - public static string HighscoresFor { - get { - return ResourceManager.GetString("HighscoresFor", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Valid types are '`messages`' '`karma`', '`rolls`', '`cookies`', '`seasons`' and '`quotes`'. - /// - public static string InvalidType { - get { - return ResourceManager.GetString("InvalidType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to :warning: Limiting to 20. - /// - public static string LimitingTo20Warning { - get { - return ResourceManager.GetString("LimitingTo20Warning", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No {0} found on this server. - /// - public static string NoTypeFoundForServer { - get { - return ResourceManager.GetString("NoTypeFoundForServer", resourceCulture); - } - } - } -} diff --git a/src/Core/Localization/Rank.de-ch.resx b/src/Core/Localization/Rank.de-ch.resx deleted file mode 100644 index 743b8cd..0000000 --- a/src/Core/Localization/Rank.de-ch.resx +++ /dev/null @@ -1,29 +0,0 @@ - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - :warning: Limitiert uf 20 - - - Kei {0} gfunde für dä server - - - :warning: Ich han nid alli benutzername gfunde. villiicht hend sie de server verlah? - - - :bar_chart: **{0} Highscore für {1}** - - - Gültigi paramenter sind '`messages`' '`karma`', '`rolls`', '`cookies`', '`seasons`' und '`quotes`' - - \ No newline at end of file diff --git a/src/Core/Localization/Rank.resx b/src/Core/Localization/Rank.resx deleted file mode 100644 index 606a34e..0000000 --- a/src/Core/Localization/Rank.resx +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Valid types are '`messages`' '`karma`', '`rolls`', '`cookies`', '`seasons`' and '`quotes`' - - - :warning: Limiting to 20 - - - No {0} found on this server - - - :warning: I couldn't find all usernames. Maybe they left the server? - - - :bar_chart: **{0} Highscore for {1}** - - \ No newline at end of file diff --git a/src/Core/Localization/Role.Designer.cs b/src/Core/Localization/Role.Designer.cs deleted file mode 100644 index fc48852..0000000 --- a/src/Core/Localization/Role.Designer.cs +++ /dev/null @@ -1,150 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Geekbot.Core.Localization { - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Role { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public Role() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Core.Localization.Role", typeof(Role).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Added {0} to the whitelist. - /// - public static string AddedRoleToWhitelist { - get { - return ResourceManager.GetString("AddedRoleToWhitelist", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Added you to {0}. - /// - public static string AddedUserFromRole { - get { - return ResourceManager.GetString("AddedUserFromRole", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You cannot add that role to self service because it contains one or more dangerous permissions. - /// - public static string CannotAddDangerousRole { - get { - return ResourceManager.GetString("CannotAddDangerousRole", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You can't add a role that is managed by discord. - /// - public static string CannotAddManagedRole { - get { - return ResourceManager.GetString("CannotAddManagedRole", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to **Self Service Roles on {0}**. - /// - public static string ListHeader { - get { - return ResourceManager.GetString("ListHeader", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to To get a role, use `!role [name]`. - /// - public static string ListInstruction { - get { - return ResourceManager.GetString("ListInstruction", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to There are no roles configured for this server. - /// - public static string NoRolesConfigured { - get { - return ResourceManager.GetString("NoRolesConfigured", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Removed {0} from the whitelist. - /// - public static string RemovedRoleFromWhitelist { - get { - return ResourceManager.GetString("RemovedRoleFromWhitelist", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Removed you from {0}. - /// - public static string RemovedUserFromRole { - get { - return ResourceManager.GetString("RemovedUserFromRole", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to That role doesn't exist or is not on the whitelist. - /// - public static string RoleNotFound { - get { - return ResourceManager.GetString("RoleNotFound", resourceCulture); - } - } - } -} diff --git a/src/Core/Localization/Role.de-ch.resx b/src/Core/Localization/Role.de-ch.resx deleted file mode 100644 index b0b3259..0000000 --- a/src/Core/Localization/Role.de-ch.resx +++ /dev/null @@ -1,44 +0,0 @@ - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Es sind kei rolle für dä server konfiguriert - - - **Self Service Rollene uf {0}** - - - Zum ä rolle becho, schriib `!role [name]` - - - Die rolle gids nid or isch nid uf dr whitelist - - - Han di entfernt vo {0} - - - Han di hinzue gfüegt zu {0} - - - Du chasch kei rolle hinzuefüge wo verwalted wird vo discord - - - Du chasch die rolle nid hinzuefüge will er ein oder mehreri gföhrlichi berechtigunge het - - - {0} isch zur whitelist hinzuegfüegt - - - {0} isch vo dr whitelist glöscht - - \ No newline at end of file diff --git a/src/Core/Localization/Role.resx b/src/Core/Localization/Role.resx deleted file mode 100644 index 63b70d0..0000000 --- a/src/Core/Localization/Role.resx +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - There are no roles configured for this server - - - **Self Service Roles on {0}** - - - To get a role, use `!role [name]` - - - That role doesn't exist or is not on the whitelist - - - Removed you from {0} - - - Added you to {0} - - - You can't add a role that is managed by discord - - - You cannot add that role to self service because it contains one or more dangerous permissions - - - Added {0} to the whitelist - - - Removed {0} from the whitelist - - \ No newline at end of file diff --git a/src/Core/Localization/Roll.Designer.cs b/src/Core/Localization/Roll.Designer.cs deleted file mode 100644 index bceb55d..0000000 --- a/src/Core/Localization/Roll.Designer.cs +++ /dev/null @@ -1,96 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Geekbot.Core.Localization { - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Roll { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public Roll() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Core.Localization.Roll", typeof(Roll).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Congratulations {0}, your guess was correct!. - /// - public static string Gratz { - get { - return ResourceManager.GetString("Gratz", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to :red_circle: {0}, you can't guess the same number again, guess another number or wait {1}. - /// - public static string NoPrevGuess { - get { - return ResourceManager.GetString("NoPrevGuess", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0}, you rolled {1}, your guess was {2}. - /// - public static string Rolled { - get { - return ResourceManager.GetString("Rolled", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0}, you rolled {1}. - /// - public static string RolledNoGuess { - get { - return ResourceManager.GetString("RolledNoGuess", resourceCulture); - } - } - } -} diff --git a/src/Core/Localization/Roll.de-ch.resx b/src/Core/Localization/Roll.de-ch.resx deleted file mode 100644 index ba73316..0000000 --- a/src/Core/Localization/Roll.de-ch.resx +++ /dev/null @@ -1,26 +0,0 @@ - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - {0}, du hesch {1} grollt und hesch {2} grate - - - Gratuliere {0}, du hesch richtig grate! - - - {0}, du hesch {1} grollt - - - :red_circle: {0}, du chasch nid nomol es gliche rate, rate öppis anders oder warte {1} - - \ No newline at end of file diff --git a/src/Core/Localization/Roll.resx b/src/Core/Localization/Roll.resx deleted file mode 100644 index 822abb6..0000000 --- a/src/Core/Localization/Roll.resx +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - {0}, you rolled {1}, your guess was {2} - - - Congratulations {0}, your guess was correct! - - - {0}, you rolled {1} - - - :red_circle: {0}, you can't guess the same number again, guess another number or wait {1} - - \ No newline at end of file diff --git a/src/Core/Localization/Ship.Designer.cs b/src/Core/Localization/Ship.Designer.cs deleted file mode 100644 index 2d917b6..0000000 --- a/src/Core/Localization/Ship.Designer.cs +++ /dev/null @@ -1,114 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Geekbot.Core.Localization { - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Ship { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public Ship() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Core.Localization.Ship", typeof(Ship).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Almost a match. - /// - public static string CouldWork { - get { - return ResourceManager.GetString("CouldWork", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to It's a match. - /// - public static string ItsAMatch { - get { - return ResourceManager.GetString("ItsAMatch", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matchmaking. - /// - public static string Matchmaking { - get { - return ResourceManager.GetString("Matchmaking", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Not going happen. - /// - public static string NotGoingToHappen { - get { - return ResourceManager.GetString("NotGoingToHappen", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Not such a good idea. - /// - public static string NotSuchAGoodIdea { - get { - return ResourceManager.GetString("NotSuchAGoodIdea", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to There might be a chance. - /// - public static string ThereMightBeAChance { - get { - return ResourceManager.GetString("ThereMightBeAChance", resourceCulture); - } - } - } -} diff --git a/src/Core/Localization/Ship.de-ch.resx b/src/Core/Localization/Ship.de-ch.resx deleted file mode 100644 index ec2880b..0000000 --- a/src/Core/Localization/Ship.de-ch.resx +++ /dev/null @@ -1,32 +0,0 @@ - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Verkupple - - - Wird nöd klappe - - - Nöd so ä gueti idee - - - Es gid eventuel ä chance - - - Fasch en match - - - Es isch es traumpaar - - \ No newline at end of file diff --git a/src/Core/Localization/Ship.resx b/src/Core/Localization/Ship.resx deleted file mode 100644 index 611040f..0000000 --- a/src/Core/Localization/Ship.resx +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Matchmaking - - - Not going happen - - - Not such a good idea - - - There might be a chance - - - Almost a match - - - It's a match - - \ No newline at end of file diff --git a/src/Core/Localization/Stats.Designer.cs b/src/Core/Localization/Stats.Designer.cs deleted file mode 100644 index 5f9b96c..0000000 --- a/src/Core/Localization/Stats.Designer.cs +++ /dev/null @@ -1,150 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Geekbot.Core.Localization { - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Stats { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public Stats() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Core.Localization.Stats", typeof(Stats).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Cookies. - /// - public static string Cookies { - get { - return ResourceManager.GetString("Cookies", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Days. - /// - public static string Days { - get { - return ResourceManager.GetString("Days", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Guessed Rolls. - /// - public static string GuessedRolls { - get { - return ResourceManager.GetString("GuessedRolls", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Joined Server. - /// - public static string JoinedServer { - get { - return ResourceManager.GetString("JoinedServer", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Karma. - /// - public static string Karma { - get { - return ResourceManager.GetString("Karma", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Level. - /// - public static string Level { - get { - return ResourceManager.GetString("Level", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Messages Sent. - /// - public static string MessagesSent { - get { - return ResourceManager.GetString("MessagesSent", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to On Discord Since. - /// - public static string OnDiscordSince { - get { - return ResourceManager.GetString("OnDiscordSince", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Quotes. - /// - public static string Quotes { - get { - return ResourceManager.GetString("Quotes", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Server Total. - /// - public static string ServerTotal { - get { - return ResourceManager.GetString("ServerTotal", resourceCulture); - } - } - } -} diff --git a/src/Core/Localization/Stats.de-ch.resx b/src/Core/Localization/Stats.de-ch.resx deleted file mode 100644 index 0af0477..0000000 --- a/src/Core/Localization/Stats.de-ch.resx +++ /dev/null @@ -1,44 +0,0 @@ - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Server Total - - - Uf Discord siit - - - Nachrichte versendet - - - Level - - - Karma - - - Server Bitrette - - - Grateni Rolls - - - Guetzli - - - Täg - - - Quotes - - \ No newline at end of file diff --git a/src/Core/Localization/Stats.resx b/src/Core/Localization/Stats.resx deleted file mode 100644 index 6eb3a92..0000000 --- a/src/Core/Localization/Stats.resx +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - On Discord Since - - - Joined Server - - - Karma - - - Level - - - Messages Sent - - - Server Total - - - Guessed Rolls - - - Cookies - - - Days - - - Quotes - - \ No newline at end of file diff --git a/src/Core/Logger/Adapters/DiscordLogger.cs b/src/Core/Logger/Adapters/DiscordLogger.cs deleted file mode 100644 index e9bb02e..0000000 --- a/src/Core/Logger/Adapters/DiscordLogger.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Threading.Tasks; -using Discord; - -namespace Geekbot.Core.Logger.Adapters -{ - public class DiscordLogger : IDiscordLogger - { - private readonly GeekbotLogger _logger; - - public DiscordLogger(GeekbotLogger logger) - { - _logger = logger; - } - - public Task Log(LogMessage message) - { - LogSource source; - try - { - source = Enum.Parse(message.Source); - } - catch - { - source = LogSource.Discord; - _logger.Warning(LogSource.Geekbot, $"Could not parse {message.Source} to a LogSource Enum"); - } - - var logMessage = $"[{message.Source}] {message.Message}"; - switch (message.Severity) - { - case LogSeverity.Verbose: - _logger.Trace(source, message.Message); - break; - case LogSeverity.Debug: - _logger.Debug(source, message.Message); - break; - case LogSeverity.Info: - _logger.Information(source, message.Message); - break; - case LogSeverity.Critical: - case LogSeverity.Error: - case LogSeverity.Warning: - if (logMessage.Contains("VOICE_STATE_UPDATE")) break; - _logger.Error(source, message.Message, message.Exception); - break; - default: - _logger.Information(source, $"{logMessage} --- {message.Severity}"); - break; - } - return Task.CompletedTask; - } - } -} \ No newline at end of file diff --git a/src/Core/Logger/Adapters/ILoggerAdapter.cs b/src/Core/Logger/Adapters/ILoggerAdapter.cs deleted file mode 100644 index 90e7bf3..0000000 --- a/src/Core/Logger/Adapters/ILoggerAdapter.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using Microsoft.Extensions.Logging; - -namespace Geekbot.Core.Logger.Adapters; - -public class ILoggerAdapter : ILogger -{ - private readonly string _categoryName; - private readonly LogSource _logSource; - private readonly IGeekbotLogger _geekbotLogger; - public ILoggerAdapter(string categoryName, LogSource logSource, IGeekbotLogger geekbotLogger) - { - _categoryName = categoryName; - _logSource = logSource; - _geekbotLogger = geekbotLogger; - } - - public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter) - { - switch (logLevel) - { - case LogLevel.Trace: - _geekbotLogger.Trace(_logSource, $"{eventId.Id} - {_categoryName} - {state}"); - break; - case LogLevel.Debug: - _geekbotLogger.Debug(_logSource, $"{eventId.Id} - {_categoryName} - {state}"); - break; - case LogLevel.Information: - _geekbotLogger.Information(_logSource, $"{eventId.Id} - {_categoryName} - {state}"); - break; - case LogLevel.Warning: - _geekbotLogger.Warning(_logSource, $"{eventId.Id} - {_categoryName} - {state}", exception); - break; - case LogLevel.Error: - case LogLevel.Critical: - _geekbotLogger.Error(_logSource, $"{eventId.Id} - {_categoryName} - {state}", exception); - break; - case LogLevel.None: - break; - default: - throw new ArgumentOutOfRangeException(nameof(logLevel)); - } - } - - public bool IsEnabled(LogLevel logLevel) - { - return _geekbotLogger.GetNLogger().IsEnabled(ToGeekbotLogLevel(logLevel)); - // return !_geekbotLogger.LogAsJson() && _geekbotLogger.GetNLogger().IsEnabled(ToGeekbotLogLevel(logLevel)); - } - - public IDisposable BeginScope(TState state) - { - return null; - } - - private static NLog.LogLevel ToGeekbotLogLevel(LogLevel level) - { - return level switch - { - LogLevel.Trace => NLog.LogLevel.Trace, - LogLevel.Debug => NLog.LogLevel.Debug, - LogLevel.Information => NLog.LogLevel.Info, - LogLevel.Warning => NLog.LogLevel.Warn, - LogLevel.Error => NLog.LogLevel.Error, - LogLevel.Critical => NLog.LogLevel.Fatal, - LogLevel.None => NLog.LogLevel.Off, - _ => throw new ArgumentOutOfRangeException(nameof(level)) - }; - } -} \ No newline at end of file diff --git a/src/Core/Logger/Adapters/ILoggerProviderProvider.cs b/src/Core/Logger/Adapters/ILoggerProviderProvider.cs deleted file mode 100644 index bc31a24..0000000 --- a/src/Core/Logger/Adapters/ILoggerProviderProvider.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Collections.Concurrent; -using Microsoft.Extensions.Logging; - -namespace Geekbot.Core.Logger.Adapters; - -public class ILoggerProviderProvider : ILoggerProvider, ILoggerFactory -{ - private readonly IGeekbotLogger _geekbotLogger; - private readonly LogSource _logSource; - - private readonly ConcurrentDictionary _loggers = new(); - - public ILoggerProviderProvider(IGeekbotLogger geekbotLogger, LogSource logSource) - { - _geekbotLogger = geekbotLogger; - _logSource = logSource; - } - - public void Dispose() - { - _loggers.Clear(); - } - - public ILogger CreateLogger(string categoryName) - { - return _loggers.GetOrAdd(categoryName, name => new ILoggerAdapter(categoryName, _logSource, _geekbotLogger)); - } - - public void AddProvider(ILoggerProvider provider) - { - throw new System.NotImplementedException(); - } -} \ No newline at end of file diff --git a/src/Core/Logger/ExceptionDto.cs b/src/Core/Logger/ExceptionDto.cs deleted file mode 100644 index bd67d90..0000000 --- a/src/Core/Logger/ExceptionDto.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Geekbot.Core.Logger; - -public struct ExceptionDto -{ - public string Message { get; init; } - - public string InnerException { get; init; } - - public string Source { get; init; } - - public ExceptionDto(Exception exception) - { - Message = exception.Message; - InnerException = string.IsNullOrEmpty(exception?.InnerException?.ToString()) ? exception?.StackTrace : exception?.InnerException?.ToString(); - Source = exception.Source; - } -}; \ No newline at end of file diff --git a/src/Core/Logger/GeekbotLogger.cs b/src/Core/Logger/GeekbotLogger.cs deleted file mode 100644 index 83a6d49..0000000 --- a/src/Core/Logger/GeekbotLogger.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Geekbot.Core.Logger -{ - public class GeekbotLogger : IGeekbotLogger - { - private readonly bool _logAsJson; - private readonly NLog.Logger _logger; - private readonly JsonSerializerOptions _serializerSettings; - - public GeekbotLogger(RunParameters runParameters) - { - _logAsJson = !string.IsNullOrEmpty(runParameters.SumologicEndpoint) || runParameters.LogJson; - _logger = LoggerFactory.CreateNLog(runParameters); - _serializerSettings = new JsonSerializerOptions - { - ReferenceHandler = ReferenceHandler.IgnoreCycles, - DefaultIgnoreCondition = JsonIgnoreCondition.Never, - }; - Information(LogSource.Geekbot, "Using GeekbotLogger"); - } - - public void Trace(LogSource source, string message, object extra = null) - => _logger.Trace(CreateLogString("Trace", source, message, null, extra)); - - public void Debug(LogSource source, string message, object extra = null) - => _logger.Debug(CreateLogString("Debug", source, message, null, extra)); - - public void Information(LogSource source, string message, object extra = null) - => _logger.Info(CreateLogString("Information", source, message, null, extra)); - - public void Warning(LogSource source, string message, Exception stackTrace = null, object extra = null) - => _logger.Warn(CreateLogString("Warning", source, message, stackTrace, extra)); - - public void Error(LogSource source, string message, Exception stackTrace, object extra = null) - => _logger.Error(stackTrace, CreateLogString("Error", source, message, stackTrace, extra)); - - public NLog.Logger GetNLogger() => _logger; - - public bool LogAsJson() => _logAsJson; - - private string CreateLogString(string type, LogSource source, string message, Exception exception = null, object extra = null) - { - if (_logAsJson) - { - var logObject = new GeekbotLoggerObject - { - Timestamp = DateTime.Now, - Type = type, - Source = source, - Message = message, - StackTrace = exception != null ? new ExceptionDto(exception) : null, - Extra = extra - }; - return JsonSerializer.Serialize(logObject, _serializerSettings); - } - - if (source != LogSource.Message) return $"[{source}] - {message}"; - - var m = (MessageDto) extra; - return $"[{source}] - [{m?.Guild.Name} - {m?.Channel.Name}] {m?.User.Name}: {m?.Message.Content}"; - } - } -} \ No newline at end of file diff --git a/src/Core/Logger/IDiscordLogger.cs b/src/Core/Logger/IDiscordLogger.cs deleted file mode 100644 index c127e0c..0000000 --- a/src/Core/Logger/IDiscordLogger.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Threading.Tasks; -using Discord; - -namespace Geekbot.Core.Logger -{ - public interface IDiscordLogger - { - Task Log(LogMessage message); - } -} \ No newline at end of file diff --git a/src/Core/Logger/IGeekbotLogger.cs b/src/Core/Logger/IGeekbotLogger.cs deleted file mode 100644 index 1363629..0000000 --- a/src/Core/Logger/IGeekbotLogger.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Geekbot.Core.Logger -{ - public interface IGeekbotLogger - { - void Trace(LogSource source, string message, object extra = null); - void Debug(LogSource source, string message, object extra = null); - void Information(LogSource source, string message, object extra = null); - void Warning(LogSource source, string message, Exception stackTrace = null, object extra = null); - void Error(LogSource source, string message, Exception stackTrace, object extra = null); - NLog.Logger GetNLogger(); - bool LogAsJson(); - } -} \ No newline at end of file diff --git a/src/Core/Logger/LogDto.cs b/src/Core/Logger/LogDto.cs deleted file mode 100644 index ee6a3e5..0000000 --- a/src/Core/Logger/LogDto.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Text.Json.Serialization; - -namespace Geekbot.Core.Logger; - -public struct GeekbotLoggerObject -{ - public DateTime Timestamp { get; set; } - - public string Type { get; set; } - - public LogSource Source { get; set; } - - public string Message { get; set; } - - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ExceptionDto? StackTrace { get; set; } - - public object Extra { get; set; } -} diff --git a/src/Core/Logger/LogSource.cs b/src/Core/Logger/LogSource.cs deleted file mode 100644 index d2baff5..0000000 --- a/src/Core/Logger/LogSource.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Core.Logger -{ - [JsonConverter(typeof(JsonStringEnumConverter))] - public enum LogSource - { - Geekbot, - Rest, - Gateway, - Discord, - Database, - Message, - UserRepository, - Command, - Api, - Migration, - HighscoreManager, - Interaction, - Other - } -} \ No newline at end of file diff --git a/src/Core/Logger/LoggerFactory.cs b/src/Core/Logger/LoggerFactory.cs deleted file mode 100644 index bf3d926..0000000 --- a/src/Core/Logger/LoggerFactory.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Text; -using NLog; -using NLog.Config; -using NLog.Targets; -using SumoLogic.Logging.NLog; - -namespace Geekbot.Core.Logger -{ - public class LoggerFactory - { - public static NLog.Logger CreateNLog(RunParameters runParameters) - { - var config = new LoggingConfiguration(); - var minLevel = runParameters.Verbose ? LogLevel.Trace : LogLevel.Info; - - if (!string.IsNullOrEmpty(runParameters.SumologicEndpoint)) - { - Console.WriteLine("Logging Geekbot Logs to Sumologic"); - config.LoggingRules.Add( - new LoggingRule("*", minLevel, LogLevel.Fatal, - new SumoLogicTarget() - { - Url = runParameters.SumologicEndpoint, - SourceName = "GeekbotLogger", - Layout = "${message}", - UseConsoleLog = false, - OptimizeBufferReuse = true, - Name = "Geekbot" - }) - ); - } - else if (runParameters.LogJson) - { - config.LoggingRules.Add( - new LoggingRule("*", minLevel, LogLevel.Fatal, - new ConsoleTarget - { - Name = "Console", - Encoding = Encoding.UTF8, - Layout = "${message}" - } - ) - ); - } - else - { - config.LoggingRules.Add( - new LoggingRule("*", minLevel, LogLevel.Fatal, - new ColoredConsoleTarget - { - Name = "Console", - Encoding = Encoding.UTF8, - Layout = "[${longdate} ${level:format=FirstCharacter}] ${message} ${exception:format=toString}" - } - ) - ); - } - - var loggerConfig = new LogFactory {Configuration = config}; - return loggerConfig.GetCurrentClassLogger(); - } - } -} \ No newline at end of file diff --git a/src/Core/Logger/MessageDto.cs b/src/Core/Logger/MessageDto.cs deleted file mode 100644 index 039024e..0000000 --- a/src/Core/Logger/MessageDto.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace Geekbot.Core.Logger -{ - public class MessageDto - { - public MessageContent Message { get; set; } - public IdAndName User { get; set; } - public IdAndName Guild { get; set; } - public IdAndName Channel { get; set; } - - public class MessageContent - { - public string Content { get; set; } - public string Id { get; set; } - public int Attachments { get; set; } - public int ChannelMentions { get; set; } - public int UserMentions { get; set; } - public int RoleMentions { get; set; } - } - - public class IdAndName - { - public string Id { get; set; } - public string Name { get; set; } - } - } -} \ No newline at end of file diff --git a/src/Core/Logger/SimpleConextConverter.cs b/src/Core/Logger/SimpleConextConverter.cs deleted file mode 100644 index 23cee40..0000000 --- a/src/Core/Logger/SimpleConextConverter.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Discord.Commands; -using Discord.WebSocket; - -namespace Geekbot.Core.Logger -{ - public class SimpleConextConverter - { - public static MessageDto ConvertContext(ICommandContext context) - { - return new MessageDto - { - Message = new MessageDto.MessageContent - { - Content = context.Message.Content, // Only when an error occurs, including for diagnostic reason - Id = context.Message.Id.ToString(), - Attachments = context.Message.Attachments.Count, - ChannelMentions = context.Message.MentionedChannelIds.Count, - UserMentions = context.Message.MentionedUserIds.Count, - RoleMentions = context.Message.MentionedRoleIds.Count - }, - User = new MessageDto.IdAndName - { - Id = context.User.Id.ToString(), - Name = $"{context.User.Username}#{context.User.Discriminator}" - }, - Guild = new MessageDto.IdAndName - { - Id = context.Guild?.Id.ToString(), - Name = context.Guild?.Name - }, - Channel = new MessageDto.IdAndName - { - Id = context.Channel?.Id.ToString() ?? context.User.Id.ToString(), - Name = context.Channel?.Name ?? "DM-Channel" - } - }; - } - public static MessageDto ConvertSocketMessage(SocketMessage message, bool isPrivate = false) - { - var channel = isPrivate ? null : (SocketGuildChannel) message.Channel; - return new MessageDto - { - Message = new MessageDto.MessageContent - { - Id = message.Id.ToString(), - Attachments = message.Attachments.Count, - ChannelMentions = message.MentionedChannels.Count, - UserMentions = message.MentionedUsers.Count, - RoleMentions = message.MentionedRoles.Count - }, - User = new MessageDto.IdAndName - { - Id = message.Author.Id.ToString(), - Name = $"{message.Author.Username}#{message.Author.Discriminator}" - }, - Guild = new MessageDto.IdAndName - { - Id = channel?.Guild?.Id.ToString(), - Name = channel?.Guild?.Name - }, - Channel = new MessageDto.IdAndName - { - Id = channel?.Id.ToString() ?? message.Author.Id.ToString(), - Name = channel?.Name ?? "DM-Channel" - } - }; - } - - } -} \ No newline at end of file diff --git a/src/Core/Media/FortunesProvider.cs b/src/Core/Media/FortunesProvider.cs deleted file mode 100644 index 1b0d87a..0000000 --- a/src/Core/Media/FortunesProvider.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.IO; -using Geekbot.Core.Logger; - -namespace Geekbot.Core.Media -{ - public class FortunesProvider : IFortunesProvider - { - private readonly string[] _fortuneArray; - private readonly int _totalFortunes; - - public FortunesProvider(IGeekbotLogger logger) - { - var path = Path.GetFullPath("./Storage/fortunes"); - if (File.Exists(path)) - { - var rawFortunes = File.ReadAllText(path); - _fortuneArray = rawFortunes.Split("%"); - _totalFortunes = _fortuneArray.Length; - logger.Trace(LogSource.Geekbot, $"Loaded {_totalFortunes} Fortunes"); - } - else - { - logger.Information(LogSource.Geekbot, $"Fortunes File not found at {path}"); - } - } - - public string GetRandomFortune() - { - return _fortuneArray[new Random().Next(0, _totalFortunes)]; - } - } -} \ No newline at end of file diff --git a/src/Core/Media/IFortunesProvider.cs b/src/Core/Media/IFortunesProvider.cs deleted file mode 100644 index a4ef0d9..0000000 --- a/src/Core/Media/IFortunesProvider.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Geekbot.Core.Media -{ - public interface IFortunesProvider - { - string GetRandomFortune(); - } -} \ No newline at end of file diff --git a/src/Core/Media/IMediaProvider.cs b/src/Core/Media/IMediaProvider.cs deleted file mode 100644 index 03e32cf..0000000 --- a/src/Core/Media/IMediaProvider.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Geekbot.Core.Media -{ - public interface IMediaProvider - { - string GetMedia(MediaType type); - } -} \ No newline at end of file diff --git a/src/Core/Media/MediaProvider.cs b/src/Core/Media/MediaProvider.cs deleted file mode 100644 index 4c72ee0..0000000 --- a/src/Core/Media/MediaProvider.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.IO; -using Geekbot.Core.Logger; -using Geekbot.Core.RandomNumberGenerator; - -namespace Geekbot.Core.Media -{ - public class MediaProvider : IMediaProvider - { - private readonly IRandomNumberGenerator _random; - private readonly IGeekbotLogger _logger; - private readonly string[] _pandaImages; - private readonly string[] _croissantImages; - private readonly string[] _squirrelImages; - private readonly string[] _pumpkinImages; - private readonly string[] _turtlesImages; - private readonly string[] _penguinImages; - private readonly string[] _foxImages; - private readonly string[] _dabImages; - - public MediaProvider(IGeekbotLogger logger, IRandomNumberGenerator random) - { - _random = random; - _logger = logger; - - logger.Information(LogSource.Geekbot, "Loading Media Files"); - LoadMedia("./Storage/pandas", ref _pandaImages); - LoadMedia("./Storage/croissant", ref _croissantImages); - LoadMedia("./Storage/squirrel", ref _squirrelImages); - LoadMedia("./Storage/pumpkin", ref _pumpkinImages); - LoadMedia("./Storage/turtles", ref _turtlesImages); - LoadMedia("./Storage/penguins", ref _penguinImages); - LoadMedia("./Storage/foxes", ref _foxImages); - LoadMedia("./Storage/dab", ref _dabImages); - } - - private void LoadMedia(string path, ref string[] storage) - { - var rawLinks = File.ReadAllText(Path.GetFullPath(path)); - storage = rawLinks.Split("\n"); - _logger.Trace(LogSource.Geekbot, $"Loaded {storage.Length} Images from ${path}"); - } - - public string GetMedia(MediaType type) - { - var collection = type switch - { - MediaType.Panda => _pandaImages, - MediaType.Croissant => _croissantImages, - MediaType.Squirrel => _squirrelImages, - MediaType.Pumpkin => _pumpkinImages, - MediaType.Turtle => _turtlesImages, - MediaType.Penguin => _penguinImages, - MediaType.Fox => _foxImages, - MediaType.Dab => _dabImages, - _ => new string[0] - }; - - return collection[_random.Next(0, collection.Length)]; - } - } -} \ No newline at end of file diff --git a/src/Core/Media/MediaType.cs b/src/Core/Media/MediaType.cs deleted file mode 100644 index fa30164..0000000 --- a/src/Core/Media/MediaType.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Geekbot.Core.Media -{ - public enum MediaType - { - Panda, - Croissant, - Squirrel, - Pumpkin, - Turtle, - Penguin, - Fox, - Dab - } -} \ No newline at end of file diff --git a/src/Core/Polyfills/UserPolyfillDto.cs b/src/Core/Polyfills/UserPolyfillDto.cs deleted file mode 100644 index 3907e05..0000000 --- a/src/Core/Polyfills/UserPolyfillDto.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Threading.Tasks; -using Discord; - -namespace Geekbot.Core.Polyfills -{ - public class UserPolyfillDto : IUser - { - public ulong Id { get; set; } - public DateTimeOffset CreatedAt { get; set; } - public string Mention { get; set; } - public IActivity Activity { get; } - public UserStatus Status { get; set; } - IReadOnlyCollection IPresence.ActiveClients => ActiveClients; - - IReadOnlyCollection IPresence.Activities => Activities; - - public IImmutableSet ActiveClients { get; } - public IImmutableList Activities { get; } - public Task CreateDMChannelAsync(RequestOptions options = null) - { - throw new NotImplementedException(); - } - - public string AvatarId { get; set; } - public string AvatarUrl { get; set; } - public string Discriminator { get; set; } - public ushort DiscriminatorValue { get; set; } - public bool IsBot { get; set; } - public bool IsWebhook { get; set; } - public string Username { get; set; } - public UserProperties? PublicFlags { get; } - - public string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128) - { - return AvatarUrl ?? "https://discordapp.com/assets/6debd47ed13483642cf09e832ed0bc1b.png"; - } - - public string GetDefaultAvatarUrl() - { - throw new NotImplementedException(); - } - - public Task GetOrCreateDMChannelAsync(RequestOptions options = null) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/src/Core/RandomNumberGenerator/IRandomNumberGenerator.cs b/src/Core/RandomNumberGenerator/IRandomNumberGenerator.cs deleted file mode 100644 index f817248..0000000 --- a/src/Core/RandomNumberGenerator/IRandomNumberGenerator.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Geekbot.Core.RandomNumberGenerator -{ - public interface IRandomNumberGenerator - { - int Next(int minValue, int maxExclusiveValue); - } -} \ No newline at end of file diff --git a/src/Core/RandomNumberGenerator/RandomNumberGenerator.cs b/src/Core/RandomNumberGenerator/RandomNumberGenerator.cs deleted file mode 100644 index 7460677..0000000 --- a/src/Core/RandomNumberGenerator/RandomNumberGenerator.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; - -namespace Geekbot.Core.RandomNumberGenerator -{ - public class RandomNumberGenerator : IRandomNumberGenerator - { - private readonly System.Security.Cryptography.RandomNumberGenerator rng; - - public RandomNumberGenerator() - { - rng = System.Security.Cryptography.RandomNumberGenerator.Create(); - } - - public int Next(int minValue, int maxInclusiveValue) - { - if (minValue == maxInclusiveValue) - { - return maxInclusiveValue; - } - - if (minValue >= maxInclusiveValue) - { - throw new ArgumentOutOfRangeException("minValue", "must be lower than maxExclusiveValue"); - } - - return GetFromCrypto(minValue, maxInclusiveValue); - } - - private int GetFromCrypto(int minValue, int maxInclusiveValue) - { - var maxExclusiveValue = maxInclusiveValue + 1; - - var diff = (long) maxExclusiveValue - minValue; - var upperBound = uint.MaxValue / diff * diff; - - uint ui; - do - { - ui = GetRandomUInt(); - } while (ui >= upperBound); - - return (int) (minValue + (ui % diff)); - } - - private uint GetRandomUInt() - { - var randomBytes = GenerateRandomBytes(sizeof(uint)); - return BitConverter.ToUInt32(randomBytes, 0); - } - - private byte[] GenerateRandomBytes(int bytesNumber) - { - var buffer = new byte[bytesNumber]; - rng.GetBytes(buffer); - return buffer; - } - } -} \ No newline at end of file diff --git a/src/Core/ReactionListener/IReactionListener.cs b/src/Core/ReactionListener/IReactionListener.cs deleted file mode 100644 index c22d792..0000000 --- a/src/Core/ReactionListener/IReactionListener.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Threading.Tasks; -using Discord; -using Discord.WebSocket; - -namespace Geekbot.Core.ReactionListener -{ - public interface IReactionListener - { - bool IsListener(ulong id); - Task AddRoleToListener(ulong messageId, ulong guildId, string emoji, IRole role); - void RemoveRole(IMessageChannel channel, SocketReaction reaction); - void GiveRole(IMessageChannel message, SocketReaction reaction); - IEmote ConvertStringToEmote(string emoji); - } -} \ No newline at end of file diff --git a/src/Core/ReactionListener/ReactionListener.cs b/src/Core/ReactionListener/ReactionListener.cs deleted file mode 100644 index dcb0d5b..0000000 --- a/src/Core/ReactionListener/ReactionListener.cs +++ /dev/null @@ -1,134 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Discord; -using Discord.WebSocket; -using Geekbot.Core.Database; -using Geekbot.Core.Database.Models; -using Geekbot.Core.Extensions; -using Geekbot.Core.Logger; -using Sentry; - -namespace Geekbot.Core.ReactionListener -{ - public class ReactionListener : IReactionListener - { - private readonly DatabaseContext _database; - - private readonly IGeekbotLogger _logger; - - // - private Dictionary> _listener; - - public ReactionListener(DatabaseContext database, IGeekbotLogger logger) - { - _database = database; - _logger = logger; - LoadListeners(); - } - - private void LoadListeners() - { - _listener = new Dictionary>(); - foreach (var row in _database.ReactionListeners) - { - var messageId = row.MessageId.AsUlong(); - if (!_listener.ContainsKey(messageId)) - { - _listener.Add(messageId, new Dictionary()); - } - - _listener[messageId].Add(ConvertStringToEmote(row.Reaction), row.RoleId.AsUlong()); - } - } - - public bool IsListener(ulong id) - { - return _listener.ContainsKey(id); - } - - public async Task AddRoleToListener(ulong messageId, ulong guildId, string emoji, IRole role) - { - var emote = ConvertStringToEmote(emoji); - - await _database.ReactionListeners.AddAsync(new ReactionListenerModel() - { - GuildId = guildId.AsLong(), - MessageId = messageId.AsLong(), - RoleId = role.Id.AsLong(), - Reaction = emoji - }); - await _database.SaveChangesAsync(); - - if (!_listener.ContainsKey(messageId)) - { - _listener.Add(messageId, new Dictionary()); - } - _listener[messageId].Add(emote, role.Id); - } - - public async void RemoveRole(IMessageChannel channel, SocketReaction reaction) - { - _listener.TryGetValue(reaction.MessageId, out var registeredReactions); - if (registeredReactions == null) return; - if (!registeredReactions.ContainsKey(reaction.Emote)) return; - var roleId = registeredReactions[reaction.Emote]; - var guild = (SocketGuildChannel) channel; - - try - { - var role = guild.Guild.GetRole(roleId); - await ((IGuildUser) reaction.User.Value).RemoveRoleAsync(role); - } - catch (Exception error) - { - HandleDeletedRole(error, guild, reaction, roleId); - } - } - - public async void GiveRole(IMessageChannel channel, SocketReaction reaction) - { - _listener.TryGetValue(reaction.MessageId, out var registeredReactions); - if (registeredReactions == null) return; - if (!registeredReactions.ContainsKey(reaction.Emote)) return; - var roleId = registeredReactions[reaction.Emote]; - var guild = (SocketGuildChannel) channel; - - try - { - - var role = guild.Guild.GetRole(roleId); - await ((IGuildUser) reaction.User.Value).AddRoleAsync(role); - } - catch (Exception error) - { - HandleDeletedRole(error, guild, reaction, roleId); - } - } - - private void HandleDeletedRole(Exception error, SocketGuildChannel guild, SocketReaction reaction, ulong roleId) - { - _logger.Warning(LogSource.Interaction, "Failed to get or assign role in reaction listener", error); - - if (!SentrySdk.IsEnabled) return; - var sentryEvent = new SentryEvent(error) - { - Message = "Failed to get or assign role in reaction listener" - }; - sentryEvent.SetTag("discord_server", guild.Id.ToString()); - sentryEvent.SetExtra("Message", reaction.MessageId.ToString()); - sentryEvent.SetExtra("User", roleId.ToString()); - - SentrySdk.CaptureEvent(sentryEvent); - } - - public IEmote ConvertStringToEmote(string emoji) - { - if (!emoji.StartsWith('<')) - { - return new Emoji(emoji); - } - return Emote.Parse(emoji); - } - } -} \ No newline at end of file diff --git a/src/Core/RunParameters.cs b/src/Core/RunParameters.cs deleted file mode 100644 index a886a98..0000000 --- a/src/Core/RunParameters.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using CommandLine; - -namespace Geekbot.Core -{ - public class RunParameters - { - /************************************ - * General * - ************************************/ - - [Option("token", HelpText = "Set a new bot token. By default it will use your previous bot token which was stored in the database (default: null) (env: TOKEN)")] - public string Token { get; set; } = ParamFallback("TOKEN"); - - [Option('V', "verbose", HelpText = "Logs everything. (default: false) (env: LOG_VERBOSE)")] - public bool Verbose { get; set; } = ParamFallback("LOG_VERBOSE", false); - - [Option('j', "log-json", HelpText = "Logger outputs json (default: false ) (env: LOG_JSON)")] - public bool LogJson { get; set; } = ParamFallback("LOG_JSON", false); - - [Option('e', "expose-errors", HelpText = "Shows internal errors in the chat (default: false) (env: EXPOSE_ERRORS)")] - public bool ExposeErrors { get; set; } = ParamFallback("EXPOSE_ERRORS", false); - - [Option("disable-gateway", HelpText = "Disables the Discord Gateway (default: false) (env: GATEWAY_DISABLE)")] - public bool DisableGateway { get; set; } = ParamFallback("GATEWAY_DISABLE", false); - - /************************************ - * Database * - ************************************/ - - [Option("in-memory", HelpText = "Uses the in-memory database instead of postgresql (default: false) (env: DB_INMEMORY)")] - public bool InMemory { get; set; } = ParamFallback("DB_INMEMORY", false); - - // Postresql connection - [Option("database", HelpText = "Select a postgresql database (default: geekbot) (env: DB_DATABASE)")] - public string DbDatabase { get; set; } = ParamFallback("DB_DATABASE", "geekbot"); - - [Option("db-host", HelpText = "Set a postgresql host (default: localhost) (env: DB_HOST)")] - public string DbHost { get; set; } = ParamFallback("DB_HOST", "localhost"); - - [Option("db-port", HelpText = "Set a postgresql host (default: 5432) (env: DB_PORT)")] - public string DbPort { get; set; } = ParamFallback("DB_PORT", "5432"); - - [Option("db-user", HelpText = "Set a postgresql user (default: geekbot) (env: DB_USER)")] - public string DbUser { get; set; } = ParamFallback("DB_USER", "geekbot"); - - [Option("db-password", HelpText = "Set a posgresql password (default: empty) (env: DB_PASSWORD)")] - public string DbPassword { get; set; } = ParamFallback("DB_PASSWORD", ""); - - [Option("db-require-ssl", HelpText = "Require SSL to connect to the database (default: false) (env: DB_REQUIRE_SSL)")] - public bool DbSsl { get; set; } = ParamFallback("DB_REQUIRE_SSL", false); - - [Option("db-trust-cert", HelpText = "Trust the database certificate, regardless if it is valid (default: false) (env: DB_TRUST_CERT)")] - public bool DbTrustCert { get; set; } = ParamFallback("DB_TRUST_CERT", false); - - [Option("db-redshift-compat", HelpText = "Enable compatibility for AWS Redshift and DigitalOcean Managed Database (default: false) (env: DB_REDSHIFT_COMPAT)")] - public bool DbRedshiftCompatibility { get; set; } = ParamFallback("DB_REDSHIFT_COMPAT", false); - - // Logging - [Option("db-logging", HelpText = "Enable database logging (default: false) (env: DB_LOGGING)")] - public bool DbLogging { get; set; } = ParamFallback("DB_LOGGING", false); - - /************************************ - * WebApi * - ************************************/ - - [Option('a', "disable-api", HelpText = "Disables the WebApi (default: false) (env: API_DISABLE)")] - public bool DisableApi { get; set; } = ParamFallback("API_DISABLE", false); - - [Option("api-host", HelpText = "Host on which the WebApi listens (default: localhost) (env: API_HOST)")] - public string ApiHost { get; set; } = ParamFallback("API_HOST", "localhost"); - - [Option("api-port", HelpText = "Port on which the WebApi listens (default: 12995) (env: API_PORT)")] - public string ApiPort { get; set; } = ParamFallback("API_PORT", "12995"); - - /************************************ - * Intergrations * - ************************************/ - - [Option("sumologic", HelpText = "Sumologic endpoint for logging (default: null) (env: SUMOLOGIC)")] - public string SumologicEndpoint { get; set; } = ParamFallback("SUMOLOGIC"); - - [Option("sentry", HelpText = "Sentry endpoint for error reporting (default: null) (env: SENTRY)")] - public string SentryEndpoint { get; set; } = ParamFallback("SENTRY"); - - /************************************ - * Helper Functions * - ************************************/ - - private static string ParamFallback(string key, string defaultValue = null) - { - var envVar = GetEnvironmentVariable(key); - return !string.IsNullOrEmpty(envVar) ? envVar : defaultValue; - } - - private static bool ParamFallback(string key, bool defaultValue) - { - var envVar = GetEnvironmentVariable(key); - if (!string.IsNullOrEmpty(envVar)) - { - return envVar.ToLower() switch - { - "true" => true, - "1" => true, - "false" => false, - "0" => false, - _ => defaultValue - }; - } - - return defaultValue; - } - - private static string GetEnvironmentVariable(string name) - { - return Environment.GetEnvironmentVariable($"GEEKBOT_{name}"); - } - } -} \ No newline at end of file diff --git a/src/Core/TransactionModuleBase.cs b/src/Core/TransactionModuleBase.cs deleted file mode 100644 index cbe5206..0000000 --- a/src/Core/TransactionModuleBase.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Sentry; - -namespace Geekbot.Core -{ - public class TransactionModuleBase : ModuleBase - { - protected ITransaction Transaction; - - protected override void BeforeExecute(CommandInfo command) - { - base.BeforeExecute(command); - - // Transaction Setup - Transaction = SentrySdk.StartTransaction(new Transaction(command.Name, "Exec")); - Transaction.SetTags(new [] - { - new KeyValuePair("Guild", Context.Guild.Name), - }); - Transaction.User = new User() - { - Id = Context.User.Id.ToString(), - Username = Context.User.Username, - }; - Transaction.Status = SpanStatus.Ok; - } - - protected override void AfterExecute(CommandInfo command) - { - base.AfterExecute(command); - Transaction.Finish(); - } - - protected Task ReplyAsync(string message = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null) - { - var replySpan = Transaction.StartChild("Reply"); - var msg = base.ReplyAsync(message, isTTS, embed, options, allowedMentions, messageReference); - replySpan.Finish(); - return msg; - } - } -} \ No newline at end of file diff --git a/src/Core/UserRepository/IUserRepository.cs b/src/Core/UserRepository/IUserRepository.cs deleted file mode 100644 index 32598f6..0000000 --- a/src/Core/UserRepository/IUserRepository.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Threading.Tasks; -using Discord.WebSocket; -using Geekbot.Core.Database.Models; - -namespace Geekbot.Core.UserRepository -{ - public interface IUserRepository - { - Task Update(SocketUser user); - UserModel Get(ulong userId); - } -} \ No newline at end of file diff --git a/src/Core/UserRepository/UserRepository.cs b/src/Core/UserRepository/UserRepository.cs deleted file mode 100644 index 6b436b1..0000000 --- a/src/Core/UserRepository/UserRepository.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Discord.WebSocket; -using Geekbot.Core.Database; -using Geekbot.Core.Database.Models; -using Geekbot.Core.Extensions; -using Geekbot.Core.Logger; - -namespace Geekbot.Core.UserRepository -{ - public class UserRepository : IUserRepository - { - private readonly DatabaseContext _database; - private readonly IGeekbotLogger _logger; - public UserRepository(DatabaseContext database, IGeekbotLogger logger) - { - _database = database; - _logger = logger; - } - - public async Task Update(SocketUser user) - { - try - { - var savedUser = Get(user.Id); - var isNew = false; - if (savedUser == null) - { - savedUser = new UserModel(); - isNew = true; - } - savedUser.UserId = user.Id.AsLong(); - savedUser.Username = user.Username; - savedUser.Discriminator = user.Discriminator; - savedUser.AvatarUrl = user.GetAvatarUrl() ?? ""; - savedUser.IsBot = user.IsBot; - savedUser.Joined = user.CreatedAt.ToUniversalTime(); - - if (isNew) - { - await _database.Users.AddAsync(savedUser); - } - else - { - _database.Users.Update(savedUser); - } - - await _database.SaveChangesAsync(); - - _logger.Debug(LogSource.UserRepository, "Updated User", savedUser); - await Task.Delay(500); - return true; - } - catch (Exception e) - { - _logger.Warning(LogSource.UserRepository, $"Failed to update user: {user.Username}#{user.Discriminator} ({user.Id})", e); - return false; - } - } - - public UserModel Get(ulong userId) - { - try - { - return _database.Users.FirstOrDefault(u => u.UserId.Equals(userId.AsLong())); - } - catch (Exception e) - { - _logger.Warning(LogSource.UserRepository, $"Failed to get {userId} from repository", e); - return null; - } - } - } -} \ No newline at end of file diff --git a/src/Core/WikipediaClient/IWikipediaClient.cs b/src/Core/WikipediaClient/IWikipediaClient.cs deleted file mode 100644 index fdb1ae1..0000000 --- a/src/Core/WikipediaClient/IWikipediaClient.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Threading.Tasks; -using Geekbot.Core.WikipediaClient.Page; - -namespace Geekbot.Core.WikipediaClient -{ - public interface IWikipediaClient - { - Task GetPreview(string pageName, string language = "en"); - } -} \ No newline at end of file diff --git a/src/Core/WikipediaClient/Page/PageApiUrls.cs b/src/Core/WikipediaClient/Page/PageApiUrls.cs deleted file mode 100644 index 59d3258..0000000 --- a/src/Core/WikipediaClient/Page/PageApiUrls.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Text.Json.Serialization; - -namespace Geekbot.Core.WikipediaClient.Page -{ - public class PageApiUrls - { - [JsonPropertyName("summary")] - public Uri Summary { get; set; } - - [JsonPropertyName("metadata")] - public Uri Metadata { get; set; } - - [JsonPropertyName("references")] - public Uri References { get; set; } - - [JsonPropertyName("media")] - public Uri Media { get; set; } - - [JsonPropertyName("edit_html")] - public Uri EditHtml { get; set; } - - [JsonPropertyName("talk_page_html")] - public Uri TalkPageHtml { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/WikipediaClient/Page/PageContentUrlCollection.cs b/src/Core/WikipediaClient/Page/PageContentUrlCollection.cs deleted file mode 100644 index 39bbc0c..0000000 --- a/src/Core/WikipediaClient/Page/PageContentUrlCollection.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Core.WikipediaClient.Page -{ - public class PageContentUrlCollection - { - [JsonPropertyName("desktop")] - public PageContentUrls Desktop { get; set; } - - [JsonPropertyName("mobile")] - public PageContentUrls Mobile { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/WikipediaClient/Page/PageContentUrls.cs b/src/Core/WikipediaClient/Page/PageContentUrls.cs deleted file mode 100644 index 8da17c4..0000000 --- a/src/Core/WikipediaClient/Page/PageContentUrls.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Text.Json.Serialization; - -namespace Geekbot.Core.WikipediaClient.Page -{ - public class PageContentUrls - { - [JsonPropertyName("page")] - public Uri Page { get; set; } - - [JsonPropertyName("revisions")] - public Uri Revisions { get; set; } - - [JsonPropertyName("edit")] - public Uri Edit { get; set; } - - [JsonPropertyName("talk")] - public Uri Talk { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/WikipediaClient/Page/PageCoordinates.cs b/src/Core/WikipediaClient/Page/PageCoordinates.cs deleted file mode 100644 index 8537325..0000000 --- a/src/Core/WikipediaClient/Page/PageCoordinates.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Core.WikipediaClient.Page -{ - public class PageCoordinates - { - [JsonPropertyName("lat")] - public float Lat { get; set; } - - [JsonPropertyName("lon")] - public float Lon { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/WikipediaClient/Page/PageImage.cs b/src/Core/WikipediaClient/Page/PageImage.cs deleted file mode 100644 index 0d0429a..0000000 --- a/src/Core/WikipediaClient/Page/PageImage.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Text.Json.Serialization; - -namespace Geekbot.Core.WikipediaClient.Page -{ - public class PageImage - { - [JsonPropertyName("source")] - public Uri Source { get; set; } - - [JsonPropertyName("width")] - public int Width { get; set; } - - [JsonPropertyName("height")] - public int Height { get; set; } - - } -} \ No newline at end of file diff --git a/src/Core/WikipediaClient/Page/PageNamespace.cs b/src/Core/WikipediaClient/Page/PageNamespace.cs deleted file mode 100644 index 29eaba8..0000000 --- a/src/Core/WikipediaClient/Page/PageNamespace.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Core.WikipediaClient.Page -{ - public class PageNamespace - { - [JsonPropertyName("id")] - public ulong Id { get; set; } - - [JsonPropertyName("text")] - public string Text { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/WikipediaClient/Page/PagePreview.cs b/src/Core/WikipediaClient/Page/PagePreview.cs deleted file mode 100644 index b87a05e..0000000 --- a/src/Core/WikipediaClient/Page/PagePreview.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Text.Json.Serialization; - -namespace Geekbot.Core.WikipediaClient.Page -{ - public class PagePreview - { - [JsonPropertyName("type")] - public PageTypes Type { get; set; } - - [JsonPropertyName("title")] - public string Title { get; set; } - - [JsonPropertyName("displaytitle")] - public string Displaytitle { get; set; } - - [JsonPropertyName("namespace")] - public PageNamespace Namespace { get; set; } - - [JsonPropertyName("titles")] - public PageTitles Titles { get; set; } - - [JsonPropertyName("pageid")] - public ulong Pageid { get; set; } - - [JsonPropertyName("thumbnail")] - public PageImage Thumbnail { get; set; } - - [JsonPropertyName("originalimage")] - public PageImage Originalimage { get; set; } - - [JsonPropertyName("lang")] - public string Lang { get; set; } - - [JsonPropertyName("dir")] - public string Dir { get; set; } - - [JsonPropertyName("revision")] - public string Revision { get; set; } - - [JsonPropertyName("tid")] - public string Tid { get; set; } - - [JsonPropertyName("timestamp")] - public DateTimeOffset Timestamp { get; set; } - - [JsonPropertyName("description")] - public string Description { get; set; } - - [JsonPropertyName("coordinates")] - public PageCoordinates Coordinates { get; set; } - - [JsonPropertyName("content_urls")] - public PageContentUrlCollection ContentUrls { get; set; } - - [JsonPropertyName("api_urls")] - public PageApiUrls ApiUrls { get; set; } - - [JsonPropertyName("extract")] - public string Extract { get; set; } - - [JsonPropertyName("extract_html")] - public string ExtractHtml { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/WikipediaClient/Page/PageTitles.cs b/src/Core/WikipediaClient/Page/PageTitles.cs deleted file mode 100644 index f550c38..0000000 --- a/src/Core/WikipediaClient/Page/PageTitles.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Core.WikipediaClient.Page -{ - public class PageTitles - { - [JsonPropertyName("Canonical")] - public string Canonical { get; set; } - - [JsonPropertyName("Normalized")] - public string Normalized { get; set; } - - [JsonPropertyName("Display")] - public string Display { get; set; } - } -} \ No newline at end of file diff --git a/src/Core/WikipediaClient/Page/PageTypes.cs b/src/Core/WikipediaClient/Page/PageTypes.cs deleted file mode 100644 index 9ad748a..0000000 --- a/src/Core/WikipediaClient/Page/PageTypes.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; - -namespace Geekbot.Core.WikipediaClient.Page -{ - [JsonConverter(typeof(JsonStringEnumConverter))] - public enum PageTypes - { - [EnumMember(Value = "standard")] - Standard, - - [EnumMember(Value = "disambiguation")] - Disambiguation, - - [EnumMember(Value = "mainpage")] - MainPage, - - [EnumMember(Value = "no-extract")] - NoExtract - } -} \ No newline at end of file diff --git a/src/Core/WikipediaClient/WikipediaClient.cs b/src/Core/WikipediaClient/WikipediaClient.cs deleted file mode 100644 index cf13277..0000000 --- a/src/Core/WikipediaClient/WikipediaClient.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Net.Http; -using System.Text.Json; -using System.Threading.Tasks; -using Geekbot.Core.WikipediaClient.Page; - -namespace Geekbot.Core.WikipediaClient -{ - public class WikipediaClient : IWikipediaClient - { - private readonly HttpClient _httpClient; - public WikipediaClient() - { - _httpClient = new HttpClient(); - } - - public async Task GetPreview(string pageName, string language = "en") - { - var response = await _httpClient.GetAsync($"https://{language}.wikipedia.org/api/rest_v1/page/summary/{pageName}"); - response.EnsureSuccessStatusCode(); - - var stringResponse = await response.Content.ReadAsStringAsync(); - return JsonSerializer.Deserialize(stringResponse); - } - } -} \ No newline at end of file diff --git a/src/Interactions/ApplicationCommand/Command.cs b/src/Interactions/ApplicationCommand/Command.cs deleted file mode 100644 index 37a0ffd..0000000 --- a/src/Interactions/ApplicationCommand/Command.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Geekbot.Interactions.ApplicationCommand -{ - /// - public record Command - { - /// - /// unique id of the command - /// - [JsonPropertyName("id")] - public string? Id { get; set; } - - /// - /// the type of command, defaults 1 if not set - /// - [JsonPropertyName("type")] - public CommandType Type { get; set; } - - /// - /// unique id of the parent application - /// - [JsonPropertyName("application_id")] - public string? ApplicationId { get; set; } - - /// - /// guild id of the command, if not global - /// - [JsonPropertyName("guild_id")] - public string? GuildId { get; set; } - - /// - /// 1-32 character name - /// - /// - /// CHAT_INPUT command names and command option names must match the following regex ^[\w-]{1,32}$ with the unicode flag set. If there is a lowercase variant of any letters used, you must use those. - /// Characters with no lowercase variants and/or uncased letters are still allowed. USER and MESSAGE commands may be mixed case and can include spaces. - /// - [JsonPropertyName("name")] - public string Name { get; set; } - - /// - /// 1-100 character description for CHAT_INPUT commands, empty string for USER and MESSAGE commands - /// - /// - /// Exclusive: CHAT_INPUT - /// - [JsonPropertyName("description")] - public string? Description { get; set; } - - /// - /// the parameters for the command, max 25 - /// - /// - /// Exclusive: CHAT_INPUT - /// - [JsonPropertyName("options")] - public List