diff --git a/LaDOSE.Src/LaDOSE.Api/Controllers/BotEventController.cs b/LaDOSE.Src/LaDOSE.Api/Controllers/BotEventController.cs new file mode 100644 index 0000000..926fa47 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.Api/Controllers/BotEventController.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AutoMapper; +using LaDOSE.Business.Interface; +using LaDOSE.DTO; +using LaDOSE.Entity; +using LaDOSE.Entity.BotEvent; +using LaDOSE.Entity.Wordpress; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace LaDOSE.Api.Controllers +{ + [AllowAnonymous] + //[Authorize] + [Produces("application/json")] + [Route("api/[controller]")] + public class BotEventController : GenericControllerDTO + { + + public BotEventController(IMapper mapper,IBotEventService service) : base(mapper,service) + { + + } + + [Route("CreateBotEvent/{eventName}")] + public bool CreateBotEvent(String eventName) + { + return this._service.CreateEvent(eventName); + } + [HttpPost] + [Route("ResultBotEvent/")] + public bool ResultBotEvent([FromBody] BotEventSendDTO result) + { + return this._service.SetResult(result.DiscordId,result.DiscordName,result.Present); + + } + + [Route("GetLastBotEvent/")] + public BotEventDTO GetLastBotEvent() + { + return this._mapper.Map(this._service.GetLastEvent()); + } + } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.Api/Startup.cs b/LaDOSE.Src/LaDOSE.Api/Startup.cs index 84a6698..3846d4d 100644 --- a/LaDOSE.Src/LaDOSE.Api/Startup.cs +++ b/LaDOSE.Src/LaDOSE.Api/Startup.cs @@ -31,6 +31,7 @@ using LaDOSE.Business.Provider.SmashProvider; using LaDOSE.Entity.Challonge; using LaDOSE.Entity.Wordpress; using Result = LaDOSE.Entity.Challonge.Result; +using LaDOSE.Entity.BotEvent; namespace LaDOSE.Api { @@ -123,6 +124,8 @@ namespace LaDOSE.Api cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); @@ -150,6 +153,7 @@ namespace LaDOSE.Api services.AddScoped(); services.AddScoped(); services.AddScoped(); + services.AddScoped(); services.AddScoped(); services.AddTransient(p => new ChallongeProvider( p.GetRequiredService(), diff --git a/LaDOSE.Src/LaDOSE.DTO/BotEventDTO.cs b/LaDOSE.Src/LaDOSE.DTO/BotEventDTO.cs new file mode 100644 index 0000000..1666060 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DTO/BotEventDTO.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +namespace LaDOSE.DTO +{ + public class BotEventSendDTO + { + public string DiscordId { get; set; } + public string DiscordName { get; set; } + public bool Present { get; set; } + } + public class BotEventDTO + { + public int Id { get; set; } + public string Name { get; set; } + public DateTime Date { get; set; } + public List Results { get; set; } + + } +} + diff --git a/LaDOSE.Src/LaDOSE.DTO/BotEventResultDTO.cs b/LaDOSE.Src/LaDOSE.DTO/BotEventResultDTO.cs new file mode 100644 index 0000000..a674770 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DTO/BotEventResultDTO.cs @@ -0,0 +1,10 @@ +namespace LaDOSE.DTO +{ + public class BotEventResultDTO + { + public int Id { get; set; } + public string Name { get; set; } + public string DiscordId { get; set; } + public bool Result { get; set; } + } +} diff --git a/LaDOSE.Src/LaDOSE.DiscordBot/Command/EventStaff.cs b/LaDOSE.Src/LaDOSE.DiscordBot/Command/EventStaff.cs new file mode 100644 index 0000000..a34f25a --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DiscordBot/Command/EventStaff.cs @@ -0,0 +1,58 @@ +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using DSharpPlus.CommandsNext; +using DSharpPlus.CommandsNext.Attributes; +using LaDOSE.DTO; + +namespace LaDOSE.DiscordBot.Command +{ + public class BotEvent + { + private readonly Dependencies dep; + + public BotEvent(Dependencies d) + { + dep = d; + } + + [RequireRolesAttribute("Staff")] + [Command("newevent")] + public async Task NewEventAsync(CommandContext ctx, string command) + { + + await ctx.RespondAsync(dep.WebService.RestService.CreateBotEvent(command).ToString()); + } + [RequireRolesAttribute("Staff")] + [Command("staffs")] + public async Task StaffAsync(CommandContext ctx) + { + BotEventDTO currentEvent = dep.WebService.RestService.GetLastBotEvent(); + StringBuilder stringBuilder = new StringBuilder(); + + var present = currentEvent.Results.Where(x => x.Result).ToList(); + var absent = currentEvent.Results.Where(x => !x.Result).ToList(); + + stringBuilder.AppendLine($"Pour {currentEvent.Name} : "); + present.ForEach(x => stringBuilder.AppendLine($":white_check_mark: {x.Name}")); + absent.ForEach(x => stringBuilder.AppendLine($":x: {x.Name}")); + + await ctx.RespondAsync(stringBuilder.ToString()); + + } + [RequireRolesAttribute("Staff")] + [Command("present")] + public async Task PresentAsync(CommandContext ctx) + { + await ctx.RespondAsync(dep.WebService.RestService.ResultBotEvent(new DTO.BotEventSendDTO() { DiscordId = ctx.Member.Id.ToString(), DiscordName = ctx.Member.DisplayName, Present = true }).ToString()); + + + } + [RequireRolesAttribute("Staff")] + [Command("absent")] + public async Task AbsentAsync(CommandContext ctx) + { + await ctx.RespondAsync(dep.WebService.RestService.ResultBotEvent(new DTO.BotEventSendDTO() { DiscordId = ctx.Member.Id.ToString(), DiscordName = ctx.Member.DisplayName, Present = false }).ToString()); + } + } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DiscordBot/Command/Hokuto.cs b/LaDOSE.Src/LaDOSE.DiscordBot/Command/Hokuto.cs index c3ae104..baa5c28 100644 --- a/LaDOSE.Src/LaDOSE.DiscordBot/Command/Hokuto.cs +++ b/LaDOSE.Src/LaDOSE.DiscordBot/Command/Hokuto.cs @@ -20,14 +20,6 @@ namespace LaDOSE.DiscordBot.Command } - //[Command("hokuto")] - //public async Task HokutoAsync(CommandContext ctx) - //{ - - // var i = r.Next(0, 3); - // await ctx.RespondAsync(ctx.User?.Mention + " : " + Games[i].ToString()); - //} - [Command("hokuto")] public async Task HokutoUserAsync(CommandContext ctx, params DiscordMember[] user) { diff --git a/LaDOSE.Src/LaDOSE.DiscordBot/Command/Public.cs b/LaDOSE.Src/LaDOSE.DiscordBot/Command/Public.cs new file mode 100644 index 0000000..5f7a887 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DiscordBot/Command/Public.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using DSharpPlus.CommandsNext; +using DSharpPlus.CommandsNext.Attributes; + +namespace LaDOSE.DiscordBot.Command +{ + public class Public + { + private readonly Dependencies dep; + private List Quotes { get; set; } + private Random rnd { get; set; } + public Public(Dependencies d) + { + dep = d; + rnd = new Random(DateTime.Now.Millisecond); + } + + [Command("twitch")] + public async Task TwitchAsync(CommandContext ctx) + { + await ctx.RespondAsync("https://www.twitch.tv/LaDOSETV"); + } + + [Command("Quote")] + public async Task QuotesAsync(CommandContext ctx) + { + + if (Quotes == null) + LoadQuote(); + + await ctx.RespondAsync("```"+ Quotes[rnd.Next(Quotes.Count-1)] + "```"); + } + + private void LoadQuote() + { + Quotes = new List(); + string[] fileQuotes = File.ReadAllLines("quotes.txt"); + string currentQuote = string.Empty; + for(int i = 0; i < fileQuotes.Length; i++) + { + if(String.IsNullOrEmpty(fileQuotes[i])) + { + Quotes.Add(currentQuote); + currentQuote = string.Empty; + } + + currentQuote += fileQuotes[i] + (!String.IsNullOrEmpty(currentQuote) ? "\r\n" : ""); + } + + } + } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DiscordBot/Command/Result.cs b/LaDOSE.Src/LaDOSE.DiscordBot/Command/Result.cs index e031b32..ab99ee8 100644 --- a/LaDOSE.Src/LaDOSE.DiscordBot/Command/Result.cs +++ b/LaDOSE.Src/LaDOSE.DiscordBot/Command/Result.cs @@ -14,29 +14,21 @@ namespace LaDOSE.DiscordBot.Command } - //[RequireRolesAttribute("Staff")] - //[Command("update")] - //public async Task UpdateAsync(CommandContext ctx) + //[Command("last")] + //public async Task LastAsync(CommandContext ctx) //{ - // //var tournament = await dep.ChallongeService.GetLastTournament(); - // //await ctx.RespondAsync($"Mise à jour effectuée"); + // var lastTournamentMessage = dep.WebService.GetLastChallonge(); + // await ctx.RespondAsync(lastTournamentMessage); //} - [Command("last")] - public async Task LastAsync(CommandContext ctx) - { - var lastTournamentMessage = dep.WebService.GetLastChallonge(); - await ctx.RespondAsync(lastTournamentMessage); - } - - [RequireRolesAttribute("Staff")] - [Command("inscriptions")] - public async Task InscriptionsAsync(CommandContext ctx) - { - await ctx.TriggerTypingAsync(); - var inscrits = dep.WebService.GetInscrits(); - await ctx.RespondAsync(inscrits); - } + //[RequireRolesAttribute("Staff")] + //[Command("inscriptions")] + //public async Task InscriptionsAsync(CommandContext ctx) + //{ + // await ctx.TriggerTypingAsync(); + // var inscrits = dep.WebService.GetInscrits(); + // await ctx.RespondAsync(inscrits); + //} [RequireRolesAttribute("Staff")] [Command("UpdateDb")] diff --git a/LaDOSE.Src/LaDOSE.DiscordBot/Command/Todo.cs b/LaDOSE.Src/LaDOSE.DiscordBot/Command/Todo.cs index fb291da..2a50876 100644 --- a/LaDOSE.Src/LaDOSE.DiscordBot/Command/Todo.cs +++ b/LaDOSE.Src/LaDOSE.DiscordBot/Command/Todo.cs @@ -1,143 +1,143 @@ -using System; -using System.Text; -using System.Threading.Tasks; -using DSharpPlus.CommandsNext; -using DSharpPlus.CommandsNext.Attributes; -using DSharpPlus.Interactivity; -using LaDOSE.DTO; +//using System; +//using System.Text; +//using System.Threading.Tasks; +//using DSharpPlus.CommandsNext; +//using DSharpPlus.CommandsNext.Attributes; +//using DSharpPlus.Interactivity; +//using LaDOSE.DTO; -namespace LaDOSE.DiscordBot.Command -{ - public class Todo - { - private readonly Dependencies dep; +//namespace LaDOSE.DiscordBot.Command +//{ +// public class Todo +// { +// private readonly Dependencies dep; - public Todo(Dependencies d) - { - dep = d; - } +// public Todo(Dependencies d) +// { +// dep = d; +// } - [Command("todo"),Description("Todo List")] +// [Command("todo"),Description("Todo List")] - public async Task TodoAsync(CommandContext ctx, string command,params string[] todo) - { - await ctx.TriggerTypingAsync(); - string args = string.Join(" ",todo); - switch (command.ToUpperInvariant()) - { - case "ADD": +// public async Task TodoAsync(CommandContext ctx, string command,params string[] todo) +// { +// await ctx.TriggerTypingAsync(); +// string args = string.Join(" ",todo); +// switch (command.ToUpperInvariant()) +// { +// case "ADD": - var todoDto = new TodoDTO - { - Created = DateTime.Now, - Done = false, - Deleted = null, - Task = args, - User = ctx.User.Username, - }; - dep.WebService.RestService.UpdateTodo(todoDto); - //dep.WebService.RestService.UpdateGame(); - break; - case "LIST": - var todoDtos = dep.WebService.RestService.GetTodos(); - StringBuilder sb = new StringBuilder(); - sb.AppendLine("Todos: "); - if (todoDtos!=null && todoDtos.Count>0) - { - foreach (var task in todoDtos) - { - string taskStatus = task.Done ? ":white_check_mark:" : ":negative_squared_cross_mark:"; - sb.AppendLine($"{task.Id} | {taskStatus} | {task.User} | {task.Task}"); - } - } - else - { - sb.AppendLine("None."); - } - await ctx.RespondAsync(sb.ToString()); - break; - case "DEL": - try - { - int id = int.Parse(todo[0]); - await ctx.RespondAsync(dep.WebService.RestService.DeleteTodo(id) ? $"Deleted" : $"Error"); - } - catch (Exception e) - { - await ctx.RespondAsync($"Error {e.Message}"); - return; - } - break; - case "V": - try - { - int id = int.Parse(todo[0]); - var todoById = dep.WebService.RestService.GetTodoById(id); - todoById.Done = true; - dep.WebService.RestService.UpdateTodo(todoById); - await ctx.RespondAsync($"Done : {todoById.Id} - {todoById.Task}"); - } - catch (Exception e) - { - await ctx.RespondAsync($"Error {e.Message}"); - return; - } - break; - case "X": - try - { - int id = int.Parse(todo[0]); - var todoById = dep.WebService.RestService.GetTodoById(id); - todoById.Done = false; - dep.WebService.RestService.UpdateTodo(todoById); - await ctx.RespondAsync($"Undone : {todoById.Id} - {todoById.Task}"); - } - catch (Exception e) - { - await ctx.RespondAsync($"Erreur {e.Message}"); - return; - } - break; - case "TRUNC": - try - { +// var todoDto = new TodoDTO +// { +// Created = DateTime.Now, +// Done = false, +// Deleted = null, +// Task = args, +// User = ctx.User.Username, +// }; +// dep.WebService.RestService.UpdateTodo(todoDto); +// //dep.WebService.RestService.UpdateGame(); +// break; +// case "LIST": +// var todoDtos = dep.WebService.RestService.GetTodos(); +// StringBuilder sb = new StringBuilder(); +// sb.AppendLine("Todos: "); +// if (todoDtos!=null && todoDtos.Count>0) +// { +// foreach (var task in todoDtos) +// { +// string taskStatus = task.Done ? ":white_check_mark:" : ":negative_squared_cross_mark:"; +// sb.AppendLine($"{task.Id} | {taskStatus} | {task.User} | {task.Task}"); +// } +// } +// else +// { +// sb.AppendLine("None."); +// } +// await ctx.RespondAsync(sb.ToString()); +// break; +// case "DEL": +// try +// { +// int id = int.Parse(todo[0]); +// await ctx.RespondAsync(dep.WebService.RestService.DeleteTodo(id) ? $"Deleted" : $"Error"); +// } +// catch (Exception e) +// { +// await ctx.RespondAsync($"Error {e.Message}"); +// return; +// } +// break; +// case "V": +// try +// { +// int id = int.Parse(todo[0]); +// var todoById = dep.WebService.RestService.GetTodoById(id); +// todoById.Done = true; +// dep.WebService.RestService.UpdateTodo(todoById); +// await ctx.RespondAsync($"Done : {todoById.Id} - {todoById.Task}"); +// } +// catch (Exception e) +// { +// await ctx.RespondAsync($"Error {e.Message}"); +// return; +// } +// break; +// case "X": +// try +// { +// int id = int.Parse(todo[0]); +// var todoById = dep.WebService.RestService.GetTodoById(id); +// todoById.Done = false; +// dep.WebService.RestService.UpdateTodo(todoById); +// await ctx.RespondAsync($"Undone : {todoById.Id} - {todoById.Task}"); +// } +// catch (Exception e) +// { +// await ctx.RespondAsync($"Erreur {e.Message}"); +// return; +// } +// break; +// case "TRUNC": +// try +// { - var todos = dep.WebService.RestService.GetTodos(); - await ctx.RespondAsync($"Sure ? (Y/N)"); - var interactivity = ctx.Client.GetInteractivityModule(); - var waitForMessageAsync = await interactivity.WaitForMessageAsync(xm => xm.Content.Contains("Y")||xm.Content.Contains("N"), TimeSpan.FromSeconds(10)); - if (waitForMessageAsync!= null) - { - if (waitForMessageAsync.Message.Content == "Y") - { - foreach (var task in todos) - { - dep.WebService.RestService.DeleteTodo(task.Id); - await ctx.RespondAsync($"Deleted - {task.Id}"); - } - } - } - } - catch (Exception e) - { - await ctx.RespondAsync($"Erreur {e.Message}"); - return; - } - break; - case "HELP": +// var todos = dep.WebService.RestService.GetTodos(); +// await ctx.RespondAsync($"Sure ? (Y/N)"); +// var interactivity = ctx.Client.GetInteractivityModule(); +// var waitForMessageAsync = await interactivity.WaitForMessageAsync(xm => xm.Content.Contains("Y")||xm.Content.Contains("N"), TimeSpan.FromSeconds(10)); +// if (waitForMessageAsync!= null) +// { +// if (waitForMessageAsync.Message.Content == "Y") +// { +// foreach (var task in todos) +// { +// dep.WebService.RestService.DeleteTodo(task.Id); +// await ctx.RespondAsync($"Deleted - {task.Id}"); +// } +// } +// } +// } +// catch (Exception e) +// { +// await ctx.RespondAsync($"Erreur {e.Message}"); +// return; +// } +// break; +// case "HELP": - await ctx.RespondAsync($"Todo:\n" + - $"-Add : Add todo\n" + - $"-Del : Delete todo\n" + - $"-V : check todo\n" + - $"-X : uncheck todo\n"); - break; - default: - await ctx.RespondAsync($"Need some help ? !todo help"); - break; - } - //await ctx.RespondAsync($"command : {command}, todo: {todo} "); - } - } -} \ No newline at end of file +// await ctx.RespondAsync($"Todo:\n" + +// $"-Add : Add todo\n" + +// $"-Del : Delete todo\n" + +// $"-V : check todo\n" + +// $"-X : uncheck todo\n"); +// break; +// default: +// await ctx.RespondAsync($"Need some help ? !todo help"); +// break; +// } +// //await ctx.RespondAsync($"command : {command}, todo: {todo} "); +// } +// } +//} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DiscordBot/Command/Twitch.cs b/LaDOSE.Src/LaDOSE.DiscordBot/Command/Twitch.cs deleted file mode 100644 index 1076738..0000000 --- a/LaDOSE.Src/LaDOSE.DiscordBot/Command/Twitch.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Threading.Tasks; -using DSharpPlus.CommandsNext; -using DSharpPlus.CommandsNext.Attributes; - -namespace LaDOSE.DiscordBot.Command -{ - public class Twitch - { - private readonly Dependencies dep; - - public Twitch(Dependencies d) - { - dep = d; - } - - [Command("twitch")] - public async Task TwitchAsync(CommandContext ctx) - { - await ctx.RespondAsync("https://www.twitch.tv/LaDOSETV"); - } - } -} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DiscordBot/LaDOSE.DiscordBot.csproj b/LaDOSE.Src/LaDOSE.DiscordBot/LaDOSE.DiscordBot.csproj index 10cd81d..0a9a8ba 100644 --- a/LaDOSE.Src/LaDOSE.DiscordBot/LaDOSE.DiscordBot.csproj +++ b/LaDOSE.Src/LaDOSE.DiscordBot/LaDOSE.DiscordBot.csproj @@ -25,6 +25,9 @@ + + PreserveNewest + PreserveNewest diff --git a/LaDOSE.Src/LaDOSE.DiscordBot/Program.cs b/LaDOSE.Src/LaDOSE.DiscordBot/Program.cs index 74c73e1..b55b529 100644 --- a/LaDOSE.Src/LaDOSE.DiscordBot/Program.cs +++ b/LaDOSE.Src/LaDOSE.DiscordBot/Program.cs @@ -84,10 +84,11 @@ namespace LaDOSE.DiscordBot }); _cnext.RegisterCommands(); - _cnext.RegisterCommands(); + _cnext.RegisterCommands(); _cnext.RegisterCommands(); - _cnext.RegisterCommands(); + //_cnext.RegisterCommands(); _cnext.RegisterCommands(); + _cnext.RegisterCommands(); //discord.MessageCreated += async e => diff --git a/LaDOSE.Src/LaDOSE.DiscordBot/Quotes.txt b/LaDOSE.Src/LaDOSE.DiscordBot/Quotes.txt new file mode 100644 index 0000000..d6022e7 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DiscordBot/Quotes.txt @@ -0,0 +1,2405 @@ +Don't worry about what anybody else is going to do. The best way to +predict the future is to invent it. +-- Alan Kay + +Premature optimization is the root of all evil (or at least most of it) +in programming. +-- Donald Knuth + +Lisp has jokingly been called "the most intelligent way to misuse a +computer". I think that description is a great compliment because it +transmits the full flavor of liberation: it has assisted a number of our +most gifted fellow humans in thinking previously impossible thoughts. +-- Edsger Dijkstra, CACM, 15:10 + +Keep away from people who try to belittle your ambitions. Small people +always do that, but the really great make you feel that you, too, can +become great. +-- Mark Twain + +What Paul does, and does very well, is to take ideas and concepts that +are beautiful in the abstract, and brings them down to a real world +level. That's a rare talent to find in writing these days. +-- Jeff "hemos" Bates, Director, OSDN; Co-evolver, Slashdot + +Since programmers create programs out of nothing, imagination is our +only limitation. Thus, in the world of programming, the hero is the one +who has great vision. Paul Graham is one of our contemporary heroes. He +has the ability to embrace the vision, and to express it plainly. His +works are my favorites, especially the ones describing language design. +He explains secrets of programming, languages, and human nature that can +only be learned from the hacker experience. This book shows you his +great vision, and tells you the truth about the nature of hacking. +-- Yukihiro "Matz" Matsumoto, creator of Ruby + +To follow the path: + look to the master, + follow the master, + walk with the master, + see through the master, + become the master. +-- Modern zen Poem + +No problem should ever have to be solved twice. +-- Eric S. Raymond, How to become a hacker + +Attitude is no substitute for competence. +-- Eric S. Raymond, How to become a hacker + +It is said that the real winner is the one who lives in today but able +to see tomorrow. +-- Juan Meng, Reviewing "The future of ideas" by Lawrence Lessig + +Fools ignore complexity. Pragmatists suffer it. Some can avoid it. +Geniuses remove it. +-- Alan J. Perlis (Epigrams in programming) + +A year spent in artificial intelligence is enough to make one believe in +God. +-- Alan J. Perlis (Epigrams in programming) + +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. +-- Alan J. Perlis (Epigrams in programmi ng) + +Within a computer natural language is unnatural. +-- Alan J. Perlis (Epigrams in programming) + +You think you know when you learn, are more sure when you can write, +even more when you can teach, but certain when you can program. +-- Alan J. Perlis (Epigrams in programming) + +Adapting old programs to fit new machines usually means adapting new +machines to behave like old ones. +-- Alan J. Perlis (Epigrams in programming) + +A little learning is a dangerous thing. +-- Alexander Pope + +Computer science education cannot make anybody an expert programmer any +more than studying brushes and pigment can make somebody an expert +painter. +-- Eric Raymond + +Einstein argued that there must be simplified explanations of nature, +because God is not capricious or arbitrary. +-- Frederick P. Brooks, No Sliver Bullet. + +Students should be evaluated on how well they can achieve the goals they +strived to achieve within a realistic context. Students need to learn to +do things, not know things. +-- Roger Schank, Engines for Education + +We remember what we learn when we care about performing better and when +we believe that what we have been asked to do is representative of +reality. +-- Roger Schank, Engines for Education + +There really is no learning without doing. +-- Roger Schank, Engines for Education + +We really have to get over the idea that some stuff is just worth +knowing even if you never do anything with it. Human memories happily +erase stuff that has no purpose, so why try to fill up children's heads +with such stuff? +-- Roger Schank, Engines for Education + +La tactique, c'est ce que vous faites quand il y a quelque chose à +faire; la stratégie, c'est ce que vous faites quand il n'y a rien à +faire. +-- Xavier Tartacover + +The only problems we can really solve in a satisfactory manner are those +that finally admit a nicely factored solution. +-- E. W. Dijkstra, The humble programmer + +The best way to learn to live with our limitations is to know them. +--E. W. Dijkstra, The humble programmer + +This challenge, viz. the confrontation with the programming task, is so +unique that this novel experience can teach us a lot about ourselves. It +should deepen our understanding of the processes of design and creation, +it should give us better control over the task of organizing our +thoughts. If it did not do so, to my taste we should no deserve the +computer at all! It has allready taught us a few lessons, and the one I +have chosen to stress in this talk is the following. We shall do a much +better programming job, provided that we approach the task with a full +appreciation of its tremenduous difficulty, provided that we stick to +modest and elegant programming languages, provided that we respect the +intrinsec limitations of the human mind and approach the task as Very +Humble Programmers. +-- E. W. Dijkstra, The humble programmer + +Ce n'est que par les relations qu'on entretient entre nos différentes +connaissances qu'elles nous restent accessibles. +-- Shnuup, sur l'hypertexte (SELFHTML -> Introduction -> Definitions sur l'hypertexte) + +We now come to the decisive step of mathematical abstraction: we forget +about what the symbols stand for. ...[The mathematician] need not be +idle; there are many operations which he may carry out with these +symbols, without ever having to look at the things they stand for. +-- Hermann Weyl, The Mathematical Way of Thinking + +An expert is, according to my working definition "someone who doesn't +need to look up answers to easy questions". +-- Eric Lippert. + +The programmer must seek both perfection of part and adequacy of +collection. +-- Alan J. Perlis + +Thus, programs must be written for people to read, and only incidentally +for machines to execute. +-- Alan J. Perlis + +We control complexity by building abstractions that hide details when +appropriate. We control complexity by establishing conventional +interfaces that enable us to construct systems by combining standard, +well-understood pieces in a ``mix and match'' way. We control complexity +by establishing new languages for describing a design, each of which +emphasizes particular aspects of the design and deemphasizes others. +-- Alan J. Perlis + +The acts of the mind, wherein it exerts its power over simple ideas, are +chiefly these three: 1. Combining several simple ideas into one compound +one, and thus all complex ideas are made. 2. The second is bringing two +ideas, whether simple or complex, together, and setting them by one +another so as to take a view of them at once, without uniting them into +one, by which it gets all its ideas of relations. 3. The third is +separating them from all other ideas that accompany them in their real +existence: this is called abstraction, and thus all its general ideas +are made. +-- John Locke, An Essay Concerning Human Understanding (1690) + +Lisp programmers know the value of everything but the cost of nothing. +-- Alan J. Perlis + +An interpreter raises the machine to the level of the user program; a +compiler lowers the user program to the level of the machine language. +-- SICP + +Everything should be made as simple as possible, but no simpler. +-- Albert Einstein + +The great dividing line between success and failure can be expressed in +five words: "I did not have time." +-- WestHost weekly newsletter 14 Feb 2003 + +When your enemy is making a very serious mistake, don't be impolite and +disturb him. +-- Napoleon Bonaparte (allegedly) + +A charlatan makes obscure what is clear; a thinker makes clear what is +obscure. +-- Hugh Kingsmill + +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 way +is to make it so complicated that there are no obvious deficiencies. The +first method is far more difficult. +-- C. A. R. Hoare + +And if you go too far up, abstraction-wise, you run out of oxygen. +Sometimes smart thinkers just don't know when to stop, and they create +these absurd, all-encompassing, high-level pictures of the universe that +are all good and fine, but don't actually mean anything at all. +-- Joel Spolsky + +The three chief virtues of a programmer are: Laziness, Impatience and +Hubris. +-- Larry Wall (Programming Perl) + +All non-trivial abstractions, to some degree, are leaky. +-- Joel Spolsky (The Law of Leaky Abstractions) + +XML wasn't designed to be edited by humans on a regular basis. +-- Guido van Rossum + +Premature abstraction is an equally grevious sin as premature +optimization. +-- Keith Devens + +You can have premature generalization as well as premature optimization. +-- Bjarne Stroustrup + +He causes his sun to rise on the evil and the good, and sends rain on +the righteous and the unrighteous. +-- Matthew 5:45 + +A language that doesn't affect the way you think about programming, is +not worth knowing. +-- Alan Perlis + +Je n'ai fait celle-ci plus longue que parce que je n'ai pas eu le loisir +de la faire plus courte. (I have made this letter so long only because I +did not have the leisure to make it shorter.) +-- Blaise Pascal (Lettres Provinciales) + +Men never do evil so completely and cheerfully as when they do it from +religious conviction. +-- Blaise Pascal (attributed) + +Everybody makes their own fun. If you don't make it yourself, it ain't +fun -- it's entertainment. +-- David Mamet (as relayed by Joss Whedon) + +If we wish to count lines of code, we should not regard them as *lines +produced* but as *lines spent*. +-- Edsger Dijkstra + +Sometimes a man with too broad a perspective reveals himself as having +no real perspective at all. A man who tries too hard to see every side +may be a man who is trying to avoid choosing any side. A man who tries +too hard to seek a deeper truth may be trying to hide from the truth he +already knows. That is not a sign of intellectual sophistication and +"great thinking". It is a demonstration of moral degeneracy and +cowardice. +-- Steven Den Beste + +Omit needless words. +-- William Strunk, Jr. (The Elements of Style) + +I have never met a man so ignorant that I couldn't learn something from +him. +-- Galileo Galilei + +A society that puts equality -- in the sense of equality of outcome -- +ahead of freedom will end up with neither equality nor freedom. The use +of force to achieve equality will destroy freedom, and the force, +introduced for good purposes, will end up in the hands of people who use +it to promote their own interests. +-- Milton Friedman (Thomas Sowell: A Conflict of Visions, p130) + +Philosophy: the finding of bad reasons for what one believes by +instinct. +-- Brave New World (paraphrased) + +Of all tyrannies a tyranny sincerely exercised for the good of its +victims may be the most oppressive. It may be better to live under +robber barons than under omnipotent moral busybodies, The robber baron's +cruelty may sometimes sleep, his cupidity may at some point be satiated; +but those who torment us for own good will torment us without end, for +they do so with the approval of their own conscience. +-- C.S. Lewis + +Fools! Don't they know that tears are a woman's most effective weapon? +-- Catwoman (The Batman TV Series, episode 83) + +It's like a condom; I'd rather have it and not need it than need it and +not have it. +-- some chick in Alien vs. Predator, when asked why she +always carries a gun + +C++ is history repeated as tragedy. Java is history repeated as farce. +-- Scott McKay + +Simplicity takes effort-- genius, even. +-- Paul Graham + +Show, don't tell. +-- unknown + +In God I trust; I will not be afraid. What can mortal man do to me? +-- David (Psalm 56:4) + +Linux is only free if your time has no value. +-- Jamie Zawinski + +Code is poetry. +-- wordpress.org + +If you choose not to decide, you still have made a choice. +-- Rush (Freewill) + +Civilization advances by extending the number of important operations +which we can perform without thinking about them. +-- Alfred North Whitehead (Introduction to Mathematics) + +The function of wisdom is to discriminate between good and evil. +-- Cicero + +The reason to do animation is caricature. Good caricature picks out the +essense of the statement and removes everything else. It's not simply +about reproducing reality; It's about bumping it up. +-- Brad Bird, writer and director, The Incredibles + +Mistakes were made. +-- Ronald Reagan + +I would rather be an optimist and be wrong than a pessimist who proves +to be right. The former sometimes wins, but never the latter. +-- "Hoots" + +What is truth? +-- Pontius Pilate + +Life moves pretty fast. If you don't stop and look around once in a +while, you could miss it. +-- Ferris Bueller + +Lisp is worth learning for the profound enlightenment experience you +will have when you finally get it; that experience will make you a +better programmer for the rest of your days, even if you never actually +use Lisp itself a lot. +-- Eric S. Raymond + +Any sufficiently complicated C or Fortran program contains an ad hoc, +informally specified, bug-ridden, slow implementation of half of Common +Lisp. +-- Philip Greenspun (Greenspun's Tenth Rule) + +I was talking recently to a friend who teaches at MIT. His field is hot +now and every year he is inundated by applications from would-be +graduate students. "A lot of them seem smart," he said. "What I can't +tell is whether they have any kind of taste." +-- Paul Graham + +The direct pursuit of happiness is a recipe for an unhappy life. +-- Donald Campbell + +It's no trick for talented people to be interesting, but it's a gift to +be interested. We want an organization filled with interested people. +-- Randy S. Nelson (dean of Pixar University) + +Why teach drawing to accountants? Because drawing class doesn't just +teach people to draw. It teaches them to be more observant. There's no +company on earth that wouldn't benefit from having people become more +observant. +-- Randy S. Nelson (dean of Pixar University) + +All problems in computer science can be solved by another level of +indirection. +-- Butler Lampson + +A designer knows he has arrived at perfection not when there is no +longuer anything to add, but when there is no longuer anything to take +away. +-- Antoine de St Exupery. + +For the things we have to learn before we can do them, we learn by doing +them. +-- Aristotle. + +There are many ways to avoid success in life, but the most sure-fire +just might be procrastination. +-- Hara Estroff Marano. + +PI seconds is a nanocentury. +-- [fact] + +A non negative binary integer value x is a power of 2 iff (x & (x-1)) is +0 using 2's complement arithmetic. +-- [fact] + +While I’ve always appreciated beautiful code, I share Jonathan’s concern +about studying it too much. I think studying beauty in music and +painting has led us to modern classical music and painting that the +majority of us just don’t get. Beauty can be seen when it emerges, but +isn’t something to strive for in isolation of a larger context. In the +software world, the larger context would be the utility of the software +to the end user. +-- [A comment on a blog] + +Dont give users the opportunity to lock themselves. +-- unknown + +Any fool can make the simple complex, only a smart person can make the +complex simple. +-- unknown + +To do something well you have to love it. So to the extent you can +preserve hacking as something you love, you're likely to do it well. Try +to keep the sense of wonder you had about programming at age 14. If +you're worried that your current job is rotting your brain, it probably +is. +-- Paul Graham. + +- If you give him a penny for his thoughts, you'd get change. +- Not the sharpest knife in the drawer. +- A prime candidate for natural deselection. +-- [Ideas for flamewars] + +What I didn't understand was that the value of some new acquisition +wasn't the difference between its retail price and what I paid for it. +It was the value I derived from it. Stuff is an extremely illiquid +asset. Unless you have some plan for selling that valuable thing you got +so cheaply, what difference does it make what it's "worth?" The only way +you're ever going to extract any value from it is to use it. And if you +don't have any immediate use for it, you probably never will. +-- Paul Graham + +Only bad designers blame their failings on the users. +-- unknown + +Humans aren't rational -- they rationalize. And I don't just mean "some +of them" or "other people". I'm talking about everyone. We have a "logic +engine" in our brains, but for the most part, it's not the one in the +driver's seat -- instead it operates after the fact, generating +rationalizations and excuses for our behavior. +-- Paul Buchheit + +What do Americans look for in a car? I've heard many answers when I've +asked this question. The answers include excellent safety ratings, great +gas mileage, handling, and cornering ability, among others. I don't +believe any of these. That's because the first principle of the Culture +Code is that the only effective way to understand what people truly mean +is to ignore what they say. This is not to suggest that people +intentionally lie or misrepresent themselves. What it means is that, +when asked direct questions about their interests and preferences, +people tend to give answers they believe the questioner wants to hear. +Again, this is not because they intend to mislead. It is because people +respond to these questions with their cortexes, the parts of their +brains that control intelligence rather than emotion or instinct. They +ponder a question, they process a question, and when they deliver an +answer, it is the product of deliberation. They believe they are telling +the truth. A lie detector would confirm this. In most cases, however, +they aren't saying what they mean. +-- The culture code. + +When all you have is a hammer, everything looks like a nail. +-- unknown + +Good coders code, great reuse. +-- http://www.catonmat.net + +The lesson of the story might appear to be that self-interested and +ambitious people in power are often the cause of wastefulness in +developing countries. But self-interested and ambitious people are in +positions of power, great and small, all over the world. In many places, +they are restrained by the law, the press, and democratic opposition. +Cameroon's tragedy is that there is nothing to hold self-interest in +check. +-- Tim Harford + +To solve your problems you must learn new skills, adapt new thought +patterns, and become a different person than you were before that +problem. God has crafted you for success. In the middle of every +adversity lie your best opportunities. Discover it, build upon it and +move forward in your journey to live an extraordinary life. You owe it +to yourself to live a great life. Don’t let negative thoughts pull you +down. Be grateful and open to learn and grow. +-- http://secretsofstudying.com/ + +If there is a will, there is a way. +-- unknown + +Having large case statements in an object-oriented language is a sure +sign your design is flawed. +-- [Fixing architecture flaws in Rails' ORM] + +Being a programmer is the same way. The only way to be a good programmer +is to write code. When you realize you haven't been writing much code +lately, and it seems like all you do is brag about code you wrote in the +past, and people start looking at you funny while you're shooting your +mouth off, realize it's because they know. They might not even know they +know, but they know. So, yes, doing what you love brings success, and by +all means, throw yourself a nice big party, buy yourself a nice car, +soak up the adulation of an adoring crowd. Then shut the fuck up and get +back to work. +-- Sincerity Theory + +Another feature about this guy is his low threshold of boredom. He'll +pick up on a task and work frantically at it, accomplishing wonders in a +short time and then get bored and drop it before its properly finished. +He'll do nothing but strum his guitar and lie around in bed for several +days after. Thats also part of the pattern too; periods of frenetic +activity followed by periods of melancholia, withdrawal and inactivity. +This is a bipolar personality. +-- The bipolar lisp programmer + +My dream is that people adopt it on its own merits. We're not trying to +bend Ruby on Rails to fit the enterprise, we're encouraging enterprises +to bend to Ruby on Rails. Come if you like it, stay away if you don't. +We're not going head over heels to accommodate the enterprise or to lure +them away from Java. That's how you end up with Java, if you start +bending to special interest groups. +-- David Heinemeier Hansson (Ruby On Rails' creator) + +New eyes have X-ray vision. [someone that hasn't written it is more +likely to spot the bug. "someone" can be you after a break] +-- William S. Annis + +So - what are the most important problems in software engineering? I’d +answer “dealing with complexity”. +-- Mark Chu-Carroll + +So the mere constraint of staying in regular contact with us will push +you to make things happen, because otherwise you'll be embarrassed to +tell us that you haven't done anything new since the last time we +talked. +-- Paul Graham (a talk at Y Combinator, for startup creators). + +The choice of the university is mostly important for the piece of paper +you get at the end. The education you get depends on you. +-- Andreas Zwinkau + +Remember that you are humans in the first place and only after that +programmers. +-- Alexandru Vancea + +Humans differ from animals to the degree that they are not merely an end +result of their conditioning, but are able to reflect on their +experiences and strategies, and apply insight to make changes in the way +they live to modify the outcome. +-- SlideTrombone (comment on "Programming can ruin your life") + +As builders and creators finding the perfect solution should not be our +main goal. We should find the perfect problem. +-- Isaac (blog comment) + +Just like carpentry, measure twice cut once. +-- Super-sizing YouTube with Python (Mike Solomon, mike@youtube.com) + +The good thing about reinventing the wheel is that you get a round one. +-- Douglas Crockford (Author of JSON and JsLint) + +I feel it is everybodies obligation to reach for the best in themselves +and use that for the interest of mankind. +-- Corneluis (comment on 'Are you going to change the world? (Really?)') + +Abstraction is a form of data compression: absolutely necessary, because +human short-term memory is so small, but the critically important aspect +of abstraction is the algorithm that gets you from the name back to the +"uncompressed" details. +-- Bruce Wilder (blog post comment) + +Have you ever noticed that when you sit down to write something, half +the ideas that end up in it are ones you thought of while writing it? +The same thing happens with software. Working to implement one idea +gives you more ideas. +-- Paul Graham, The other road ahead. + +In general, we can think of data as defined by some collection of +selectors and constructors, together with specified conditions that +these procedures must fulfill in order to be a valid representation. +-- SICP, What is meant by data? + +Resume writing is just like dating, or applying for a bank loan, in that +nobody wants you if you're desperate. +-- Steve Yegge. + +Mastering isn’t a survival instinct; it’s an urge to excel. Mastering is +one of the experiences that delineates us from animals. It is striving +to be more tomorrow than we are today; to perfectly pitch the ball over +home plate; to craft the perfect sentence in an article; to open the +oven and feel the warm, richly-scented cloud telling you dinner is going +to be absolutely extraordinary. We humans crave perfection, to be +masters of our domain, to distinguish ourselves by sheer skill and +prowess. +-- Joesgoals.com + +It(mastering)’s knowing what you are doing. +-- Joesgoals.com + +Well then. How could you possibly live without automated refactoring +tools? How else could you coordinate the caterpillar-like motions of all +Java’s identical tiny legs, its thousands of similar parts? +I’ll tell you how: +Ruby is a butterfly. +-- Stevey, Refactoring Trilogy, Part 1. + +You will never become a Great Programmer until you acknowledge that you +will always be a Terrible Programmer. +You will remain a Great Programmer for only as long as you acknowledge +that you are still a Terrible Programmer. +-- Marc (http://kickin-the-darkness.blogspot.com/) + +If I tell you I'm good, you would probably think I'm boasting. If I tell +you I'm no good, you know I'm lying. +-- Bruce Lee + +Let me try to get this straight: Lisp is a language for describing +algorithms. This was JohnMcCarthy's original purpose, anyway: to build +something more convenient than a Turing machine. Lisp is not about file, +socket or GUI programming - Lisp is about expressive power. (For +example, you can design multiple object systems for Lisp, in Lisp. Or +implement the now-fashionable AOP. Or do arbitrary transformations on +parsed source code.) If you don't value expressive power, Lisp ain't for +you. I, personally, would prefer Lisp to not become mainstream: this +would necessarily involve a dumbing down. +-- VladimirSlepnev + +Je ne vous impose aucune contrainte, aucune limite. Surprenez-moi, +étonnez-moi, défiez-moi, défiez-vous vous-même. Vous avez le choix: vous +pouvez rester dans l'ombre ou en sortir en étant parmis les trop rares +exceptions à avoir réussi. L'heure est venue d'aller bien au delà de +votre potentiel. L'heure est venue maintenant de descendre vraiment en +vous. L'heure est venue de démontrer pourquoi vous êtes l'élite, les +quelques élus, les rares lueurs qui offrent à cette compagnie son +caractère exceptionnel, sa luminescence. +-- Le PDG de NURV, dans "Anti-trust". + +If something isn’t working, you need to look back and figure out what +got you excited in the first place. +-- David Gorman (ImThere.com) + +Opportunities that present themselves to you are the consequence -- at +least partially -- of being in the right place at the right time. They +tend to present themselves when you're not expecting it -- and often +when you are engaged in other activities that would seem to preclude you +from pursuing them. And they come and go quickly -- if you don't jump +all over an opportunity, someone else generally will and it will vanish. +-- Marc Andreessen (http://blog.pmarca.com/) + +Pay attention to opportunity cost at all times. Doing one thing means +not doing other things. This is a form of risk that is very easy to +ignore, to your detriment. +-- Marc Andreessen (http://blog.pmarca.com/) + +Seize any opportunity, or anything that looks like opportunity. They are +rare, much rarer than you think... +-- Nassim Nicholas Taleb, "The Black Swan". + +I think that a lot of programmers are ignoring an important point when +people talk about reducing code repetition on large projects. +Part of the idea is that large projects are intrinsically *wrong*. That +you should be looking at making a number of smaller projects that are +composable, even if you never end up reusing one of those smaller +projects elsewhere. +-- Dan Nugent + +We tend to seek easy, single-factor explanations of success. For most +important things, though, success actually requires avoiding many +separate causes of failure. +-- Jared Diamond + +Things which matter most must never be at the mercy of things which +matter least. +-- Johann Wolfgang Von Goethe (1749-1832) + +I think the root of your mistake is saying that macros don't scale to +larger groups. The real truth is that macros don't scale to stupider +groups. +-- Paul Graham, on the Lightweight Languages mailing list. + +Argue with idiots, and you become an idiot. +If you compete with slaves you become a slave. +-- Paul Graham and Norbert Weiner, respectively + +Always dive down into a problem and get your hands on the deepest issue +behind the problem. All other considerations are to dismissed as +"engineering details"; they can be sorted out after the basic problem +has been solved. +-- Chris Crawford + +Don't have good ideas if you aren't willing to be responsible for them. +-- Alan Perlis + +It is impossible to sharpen a pencil with a blunt axe. It is equally +vain to try to do it with ten blunt axes instead. +-- Edsger Dijkstra + +If we wish to count lines of code, we should not regard them as lines +produced but as lines spent. +-- Edsger Dijkstra + +The most damaging phrase in the language is, It's always been done that +way. +-- Rear Admiral Grace Hopper + +Getting back to failing early, I've learned it's important to completely +fail. Get fired. Shoot the project, then burn its corpse. Melt the CVS +repository and microwave the backup CDs. When things go wrong, I've +often tried to play the hero from start to finish. Guess what? Some +projects are doomed no matter what. Some need skills I don't possess. +And some need a fresh face. +-- Reginald Braithwaite + +The only thing a man should ever be 100% convinced of is his own +ignorance. +-- DJ MacLean + +The best people and organizations have the attitude of wisdom: The +courage to act on what they know right now and the humility to change +course when they find better evidence. +The quest for management magic and breakthrough ideas is overrated; +being a master of the obvious is underrated. +Jim Maloney is right: Work is an overrated activity +-- Bob Sutton + +In theory, there’s no difference between theory and practice. But in +practice, there is. +-- Albert Einstein + +Act from reason, and failure makes you rethink and study harder. +Act from faith, and failure makes you blame someone and push harder. +-- Erik Naggum + +Measure everything you can about the product, and you'll start seeing +patterns. +-- Max Levchin, PayPal founder, Talk at StartupSchool2007 + +Something Confusing about "Hard": +It's tempting to think that if it's hard, then it's valuable. +Most valuable things are hard. +Most hard things are completely useless -- (picture of someone smashing +their head through concrete blocks kung-fu style). +Hard DOES NOT EQUATE TO BEING valuable. +Remember Friendster back in the day? +You'd sign in, invite friends, have 25 friends, go to their profile, and +then it'd show how you were connected to each one. +That's an impressive [some geeky CS jargon] Cone traversal of a tree - +100 million string comparisons per page -- it won't scale. +Used to take a minute per page to load, and Friendster died a painful +death. +MySpace -- not interested in solving problems +They use the shortcut of "Miss Fitzpatrick is in your extended network" +(i.e. even when you're not even signed up for MySpace) +They didn't solve the hard problem. But they make the more relevant +assumption that you want to be connected to hot women. [LOL] +Shows Alexa graph showing that in early 2005 Myspace took off, and +quickly bypassed Friendster and never looked back. +-- Max Levchin, PayPal founder, Talk at StartupSchool2007 + +Quality of the people is better than the quality of the business idea. +Crappy people can screw up the best idea in the world. +-- Hadi Partovi & Ali Partovi (iLike.com), Talk at StartupSchool2007 + +The only constant in the world of hi-tech is change. +-- Mark Ward + +Write it properly first. It's easier to make a correct program fast, +than to make a fast program correct. +-- http://www.cpax.org.uk/prg/ + +J'ai toujours préféré la folie des passions à la sagesse de +l'indifférence. +-- Anatole France + +You can’t get to version 500 if you don’t start with a version 1. +-- BetterExplained.com + +The wonderful and frustrating thing about understanding yourself is that +nobody can do it for you. +-- BetterExplained.com + +When you have eliminated the impossible, whatever remains, however +improbable, must be the truth. +-- Sherlock Holmes + +In order to understand what another person is saying, you must assume +that it is true and try to find out what it could be true of. +-- George Miller + +A journey of a thousand miles must begin with a single step. +-- Lao­Tzu + +C’s great for what it’s great for. +-- Ben Hoyts (micropledge) + +There is one meaning [for static in C]: a global variable that is +invisible outside the current scope, be it a function or a file. +-- Paolo Bonzini + +Processors don't get better so that they can have more free time. +Processors get better so _you_ can have more free time. +-- LeCamarade (freeshells.ch) + +The venerable master Qc Na was walking with his student, Anton. Hoping to +prompt the master into a discussion, Anton said "Master, I have heard that +objects are a very good thing - is this true?" Qc Na looked pityingly at +his student and replied, "Foolish pupil - objects are merely a poor man's +closures." + Chastised, Anton took his leave from his master and returned to his cell, +intent on studying closures. He carefully read the entire "Lambda: The +Ultimate..." series of papers and its cousins, and implemented a small +Scheme interpreter with a closure-based object system. He learned much, and +looked forward to informing his master of his progress. + On his next walk with Qc Na, Anton attempted to impress his master by +saying "Master, I have diligently studied the matter, and now understand +that objects are truly a poor man's closures." Qc Na responded by hitting +Anton with his stick, saying "When will you learn? Closures are a poor man's +object." At that moment, Anton became enlightened. +-- Anton van Straaten (Na = Norman Adams, Qa = Christian Queinnec) + +Understanding why C++ is the way it is helps a programmer use it well. A deep +understanding of a tool is essential for an expert craftsman. +-- Bjarne Stroustrap + +No art, however minor, demands less than total dedication if you want to +excel in it. +-- Alberti + +The minute you put the blame on someone else you’ve switch things from +being a problem you can control to a problem outside of your control. +-- engtech (internetducttape.com) + +State is the root of all evil. In particular functions with side effects +should be avoided. +-- OO Sucks (bluetail.com) + +Ils ne sont pas forts parce qu'ils sont forts. Ils sont forts parce que +nous sommes faibles. +-- Ragala Khalid + +It is better to be quiet and thought a fool than to open your mouth and +remove all doubt. +-- WikiHow + +A tail call allows a function to return the result of another function +without leaving an entry on the stack. Tail recursion is a specific case +of tail calling. +-- ASPN : Python Cookbook : Explicit Tail Call + +Simplicity means the achievement of maximum effect with minimum means. +-- Dr. Koichi Kawana + +Normality is the route to nowhere. +-- Ridderstrale & Nordstorm, Funky Business + +The problem is that Microsoft just has no taste. And I don't mean that +in a small way, I mean that in a big way. +-- Steve Jobs + +Do you want to sell sugared water all your life or do you want to change +the world? +-- Steve Jobs, to John Sculley (former Pepsi executive) + +1 - Creativity and innovation always build on the past. +2 - The past always tries to control the creativity that builds on it. +3 - Free societies enable the future by limiting the past. +4 - Ours is less and less a free society. +-- Lawrence Lessig, Free Culture. + +Good work is no done by ‘humble’ men. +-- H. Hardy, A mathematician's apology. + +Simplicity and pragmatism beat complexity and theory any day. +-- Dennis (blog comment) + +The proof is by reductio ad absurdum, and reductio ad absurdum, which +Euclid loved so much, is one of a mathematician’s finest weapons. It is +a far finer gambit than any chess gambit: a chess player may offer the +sacrifice of a pawn or even a piece, but a mathematician offers the +game. +-- G. H. Hardy + +Remember, always be yourself ... unless you suck! +-- Joss Whedon + +All great things require great dedication. +-- Chuck Norris(?) + +I'm always happy to trade performance for readability as long as the +former isn't already scarce. +-- Crayz (Commentor on blog.raganwald.com) + +You have to write for your audience. I would never write (1..5).map +&'*2' in Java when I could write +ListFactoryFactory.getListFactoryFromResource( + new ResourceName('com.javax.magnitudes.integers'). +setLowerBound(1).setUpperBound(5).setStep(1).applyFunctor( + new Functor () { public void eval (x) { return x * 2; } })) +I'm simplifying, of course, I've left out the security and logging +wrappers. +-- Reginald Braithwait + +The definition of insanity is doing the same thing over and over again +and expecting different results. +-- Benjamin Franklin + +A no uttered from the deepest conviction is better than a yes merely +uttered to please or what is worse, to avoid trouble. +-- Mahatma Gandhi + +I think it is wise, and only honest, to warn you that my goal is +immodest. It is not my purpose to "transfer knowledge" to you that, +subsequently, you can forget again. My purpose is no less than to +effectuate in each of you a noticeable, irreversable change. I want you +to gain, for the rest of your lives, the insight that beautiful proofs +are not "found" by trial anf error but are the result of a consciously +applied design discipline. I want you to raise your quality standards. I +mean, if 10 years from now, when you are doing something quick and +dirty, you suddenly visualize that I am looking over your shoulders and +say to yourself "Dijkstra would not have liked this", well, that would +be enough immortality for me. +-- E. W. Dijkstra + +The general principle for complexity design is this: Think locally, act +locally. +-- Richard P. Gabriel & Ron Goldman, Mob Software: The Erotic Life of Code + +Programming is the art of figuring out what you want so precisely that +even a machine can do it. +-- Some guy who isn't famous + +Hence my urgent advice to all of you to reject the morals of the +bestseller society and to find, to start with, your reward in your own +fun. This is quite feasible, for the challenge of simplification is so +fascinating that, if we do our job properly, we shall have the greatest +fun in the world. +-- E. W. Dijkstra, On the nature of computing science. + +Remember: you are alone. Every time you can get help from someone, +it is an opportunity: you should eagerly size it. But then, promptly +return to normal mode: you are alone and you must be prepared to solve +every problem yourself. +-- Eric KEDJI + +Making All Software Into Tools Reduces Risk. +-- smoothspan.com + +Some may say Ruby is a bad rip-off of Lisp or Smalltalk, and I admit +that. But it is nicer to ordinary people. +-- Matz, LL2 + +C and Lisp stand at opposite ends of the spectrum; they're each great at +what the other one sucks at. +-- Steve Yegge, Tour de Babel. + +Two people should stay together if together they are better people than +they would be individually. +-- ? + +To the optimist, the glass is half full. To the pessimist, the glass is +half empty. To the engineer, the glass is twice as big as it needs to +be. +-- author unknown (quoted in `Robust Systems', Gerald Jay Suseman) + +It is practically impossible to teach good programming to students that +have had a prior exposure to BASIC: as potential programmers they are +mentally mutilated beyond hope of regeneration. +-- Edsger Dijkstra + +Whatever is worth doing at all, is worth doing well. +-- Earl of Chesterfield + +Rules of Optimization: +Rule 1: Don’t do it. +Rule 2 (for experts only): Don’t do it yet. +-- M.A. Jackson + +More computing sins are committed in the name of efficiency (without +necessarily achieving it) than for any other single reason - including +blind stupidity. +-- W.A. Wulf + +We should forget about small efficiencies, say about 97% of the time: +premature optimization is the root of all evil. +-- Donald Knuth + +The best is the enemy of the good. +-- Voltaire + +The job of a leader today is not to create followers. It’s to create +more leaders. +-- Ralph Nader + +The president was visiting NASA headquarters and stopped to talk to a +man who was holding a mop. “And what do you do?” he asked. The man, a +janitor, replied, “I’m helping to put a man on the moon, sir.” +-- The little book of leadership + +Only make new mistakes. +-- Phil Dourado + +You can recognize truth by its beauty and simplicity. When you get it +right, it is obvious that it is right. +-- Richard Feynman + +Talkers are no good doers. +-- William Shakespeare, "Henry VI" + +Photography is painting with light. +-- Eric Hamilton + +Good artists copy. Great artists steal. +-- Pablo Picasso + +A guideline in the process of stepwise refinement should be the +principle to decompose decisions as much as possible, to untangle +aspects which are only seemingly interdependent, and to defer those +decisions which concern details of representation as long as possible. +-- Niklaus Wirth + +Vigorous writing is concise. A sentence should contain no unnecessary +words, a paragraph no unnecessary sentences, for the same reason that a +drawing should have no unnecessary lines and a machine no unnecessary +parts. This requires not that the writer make all sentences short or +avoid all detail and treat subjects only in outline, but that every word +tell. +-- William Strunk, Jr. (The Elements of Style) + +The problem is that small examples fail to convince, and large examples +are too big to follow. +-- Steve Yegge. + +We are the sum of our behaviours; excellence therefore is not an act but +a habit. +-- Aristotle. + +The purpose of abstraction is not to be vague, but to create a new +semantic level in which one can be absolutely precise. +-- Edsger Dijkstra + +Every man prefers belief to the exercise of judgment. +-- Seneca + +It’s hard to grasp abstractions if you don’t understand what they’re +abstracting away from. +-- Nathan Weizenbaum + +That is one of the most distinctive differences between school and the +real world: there is no reward for putting in a good effort. In fact, +the whole concept of a "good effort" is a fake idea adults invented to +encourage kids. It is not found in nature. +-- Paul Graham + +I find that the harder I work, the more luck I seem to have. +-- Thomas Jefferson + +Don't stay in bed, unless you can make money in bed. +-- George Burns + +If everything seems under control, you're not going fast enough. +-- Mario Andretti + +Chance favors the prepared mind. +-- Louis Pasteur + +Controlling complexity is the essence of computer programming. +-- Brian Kernigan + +The function of good software is to make the complex appear to be +simple. +-- Grady Booch + +Programmers are in a race with the Universe to create bigger and better +idiot-proof programs, while the Universe is trying to create bigger and +better idiots. So far the Universe is winning. +-- Rich Cook + +A hacker on a roll may be able to produce–in a period of a few +months–something that a small development group (say, 7-8 people) would +have a hard time getting together over a year. IBM used to report that +certain programmers might be as much as 100 times as productive as other +workers, or more. +-- Peter Seebach + +The best programmers are not marginally better than merely good ones. +They are an order-of-magnitude better, measured by whatever standard: +conceptual creativity, speed, ingenuity of design, or problem-solving +ability. +-- Randall E. Stross + +A great lathe operator commands several times the wage of an average +lathe operator, but a great writer of software code is worth 10,000 +times the price of an average software writer. +-- Bill Gates + +Measuring programming progress by lines of code is like measuring +aircraft building progress by weight. +-- Bill Gates + +First learn computer science and all the theory. Next develop a +programming style. Then forget all that and just hack. +-- George Carrette + +To iterate is human, to recurse divine. +-- L. Peter Deutsch + +The best thing about a boolean is even if you are wrong, you are only +off by a bit. +-- Anonymous + +Should array indices start at 0 or 1? My compromise of 0.5 was rejected +without, I thought, proper consideration. +-- Stan Kelly-Bootle + +The use of COBOL cripples the mind; its teaching should therefore be +regarded as a criminal offense. +-- E.W. Dijkstra + +It is practically impossible to teach good programming style to students +that have had prior exposure to BASIC. As potential programmers, they +are mentally mutilated beyond hope of regeneration. +-- E. W. Dijkstra + +One of the main causes of the fall of the Roman Empire was that–lacking +zero–they had no way to indicate successful termination of their C +programs. +-- Robert Firth + +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 + +If Java had true garbage collection, most programs would delete +themselves upon execution. +-- Robert Sewell + +Software is like sex: It’s better when it’s free. +-- Linus Torvalds + +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 + +Good programmers use their brains, but good guidelines save us having to +think out every case. +-- Francis Glassborow + +Considering the current sad state of our computer programs, software +development is clearly still a black art, and cannot yet be called an +engineering discipline. +-- Bill Clinton + +If debugging is the process of removing bugs, then programming must be +the process of putting them in. +-- Edsger W. Dijkstra + +Always code as if the guy who ends up maintaining your code will be a +violent psychopath who knows where you live. +-- Martin Golding + +Everything that can be invented has been invented. +-- Charles H. Duell, Commissioner, U.S. Office of Patents, 1899 + +I think there’s a world market for about 5 computers. +-- Thomas J. Watson, Chairman of the Board, IBM, circa 1948 + +It would appear that we have reached the limits of what it is possible +to achieve with computer technology, although one should be careful with +such statements, as they tend to sound pretty silly in 5 years. +-- John Von Neumann, circa 1949 + +But what is it good for? +-- Engineer at the Advanced Computing Systems Division of IBM, +commenting on the microchip, 1968 + +There is no reason for any individual to have a computer in his home. +-- Ken Olson, President, Digital Equipment Corporation, 1977 + +640K ought to be enough for anybody. +-- Bill Gates, 1981 + +Windows NT addresses 2 Gigabytes of RAM, which is more than any +application will ever need. +-- Microsoft, on the development of Windows NT, 1992 + +We will never become a truly paper-less society until the Palm Pilot +folks come out with WipeMe 1.0. +-- Andy Pierson + +If it keeps up, man will atrophy all his limbs but the push-button +finger. +-- Frank Lloyd Wright + +Functional programming is like describing your problem to a +mathematician. Imperative programming is like giving instructions to +an idiot. +-- arcus, #scheme on Freenode + +Its a shame that the students of our generation grew up with windows and +mice because that tainted our mindset not to think in terms of powerful +tools. Some of us are just so tainted that we will never recover. +-- Jeffrey Mark Siskind in comp.lang.lisp + +Lisp is a programmable programming language. +-- John Foderaro + +I guess, when you're drunk, every woman looks beautiful and every +language looks (like) a Lisp :) +-- Lament, #scheme@freenode.net + +Many of life's failures are people who did not realize how close they +were to success when they gave up. +-- Thomas Edison + +You must always work not just within but below your means. If you can +handle three elements, handle only two. If you can handle ten, then +handle five. In that way the ones you do handle, you handle with more +ease, more mastery and you create a feeling of strength in reserve. +-- Pablo Picasso + +When you’ve got the code all ripped apart, it’s like a car that’s all +disassembled. You’ve got all the parts tying all over your garage and +you have to replace the broken part or the car will never run. It’s not +fun until the code gets back to the baseline again. +-- Gary Kildall (inventor of CP/M, one of the first OS for the micro). + + +Well, if you talk about programming to a group of programmers who use +the same language, they can become almost evangelistic about the +language. They form a tight-knit community, hold to certain beliefs, and +follow certain rules in their programming. It’s like a church with a +programming language for a Bible. +-- Gary Kildall (inventor of CP/M, one of the first OS for the micro). + +It’s a problem if the design doesn’t let you add features at a later +date. If you have to redo a program, the hours you spend can cause you +to lose your competitive edge. A flexible program demonstrates the +difference between a good designer and someone who is just getting a +piece of code out. +-- Gary Kildall (inventor of CP/M, one of the first OS for the micro). + +[How friendly will this machine be?] Well, I don’t think it’s a matter +of friendliness, because ultimately if the program is going to +accomplish anything of value, it will probably be relatively complex. +-- Gary Kildall (inventor of CP/M, one of the first OS for the micro). + +Some people suggest that machines would be friendlier if input could be +in a natural language. But natural language is probably the worst kind +of input because it can be quite ambiguous. The process of retrieving +information from the computer would be so time-consuming that you would +be better off spending that time getting the information directly from +an expert. +-- Gary Kildall (inventor of CP/M, one of the first OS for the micro). + +The only way of discovering the limits of the possible is to venture a +little way past them into the impossible. +-- Arthur C. Clarke + +Any sufficiently advanced technology is undistinguishable from magic. +-- Arthur C. Clarke + +That is the inevitable human response. We’re reluctant to believe that +great discoveries are in the air. We want to believe that great +discoveries are in our heads—and to each party in the multiple the +presence of the other party is invariably cause for suspicion. +-- Malcolm Gladwell, Who says big ideas are rare? + +Good ideas are out there for anyone with the wit and the will to find +them. +-- Malcolm Gladwell, Who says big ideas are rare? + +A person won't become proficient at something until he or she has done +it many times. In other words., if you want someone to be really good at +building a software system, he or she will have to have built 10 or more +systems of that type. +-- Philip Greenspun + +A person won't retain proficiency at a task unless he or she has at one +time learned to perform that task very rapidly. Learning research +demonstrates that the skills of people who become accurate but not fast +deteriorate much sooner than the skills of people who become both +accurate and fast. +-- Philip Greenspun + +Training research shows that if you get speed now you can get quality +later. But if you don't get speed you will never get quality in the long +run. +-- Philip Greenspun + +Beware of bugs in the above code; I have only proved it correct, not +tried it. +-- Donald Knuth + +Wear your best for your execution and stand dignified. Your last +recourse against randomness is how you act — if you can’t control +outcomes, you can control the elegance of your behaviour. You will +always have the last word. +-- Nassim Taleb + +The human brain starts working the moment you are born and never stops +until you stand up to speak in public. +-- Anonymous + +The trouble with the world is that the stupid are always cocksure and +the intelligent are always filled with doubt. +-- Bertrand Russell + +Simple, clear purpose and principles give rise to complex, intelligent +behavior. Complex rules and regulations give rise to simple, stupid +behavior. +-- Dee Hock, Birth of the Chaordic Age + +C++ is like teenage sex: Everybody is talking about it all the time, +only few are really doing it. +-- unknown + +Functional programming is to algorithms as the ubiquitous little black +dress is to women's fashion. +-- Mark Tarver (of "The bipolar Lisp programmer" fame) + +Java and C++ make you think that the new ideas are like the old ones. +Java is the most distressing thing to hit computing since MS-DOS. +-- Alan Kay + +For complex systems, the compiler and development environment need to be +in the same language that its supporting. It's the only way to grow +code. +-- Alan Kay + +Simple things should be simple. Complex things should be possible. +-- Alan Kay + +I invented the term Object-Oriented, and I can tell you I did not have +C++ in mind. +-- Alan Kay + +All creativity is an extended form of a joke. +-- Alan Kay + +If you don't fail at least 90 percent of the time, you're not aiming +high enough. +-- Alan Kay + +Revolutions come from standing on the shoulders of giants and facing in +a better direction. +-- Alan Kay + +Ce n’est que par les beaux sentiments qu’on parvient à la fortune ! +-- Charles Baudelaire, Conseils aux jeunes littérateurs. + +La haine est une liqueur précieuse, un poison plus cher que celui des +Borgia, - car il est fait avec notre sang, notre santé, notre sommeil, +et les deux tiers de notre amour! Il faut en être avare! +-- Charles Baudelaire, Conseils aux jeunes littérateurs. + +L’art qui satisfait le besoin le plus impérieux sera toujours le plus +honoré. +-- Charles Baudelaire, Conseils aux jeunes littérateurs. + +If it looks like a duck, walks like a duck, and quacks like a duck, it's +a duck. +-- Official definition of "duck typing" + +In OO, it's the data that is the "important" thing: you define the class +which contains member data, and only incidentally contains code for +manipulating the object. In FP, it's the code that's important: you +define a function which contains code for working with the data, and +only incidentally define what the data is. +-- almkgor, on reddit + +Des mots simples, quand ils sont bien utilisés, font faire à des gens +ordinaires des choses extraordinaires. +-- Khaled TANGAO + +It was Edison who said ‘1% inspiration, 99% perspiration’. That may have +been true a hundred years ago. These days it's ‘0.01% inspiration, +99.99% perspiration’, and the inspiration is the easy part. +-- Linux Torvalds + +The greatest challenge to any thinker is stating the problem in a way +that will allow a solution. +-- Bertrand Russell + +No matter how much you plan you’re likely to get half wrong anyway. So +don’t do the ‘paralysis through analysis’ thing. That only slows +progress and saps morale. +-- 37 Signal, Getting real + +[Innovation] comes from saying no to 1,000 things to make sure we don’t +get on the wrong track or try to do too much. We’re always thinking +about new markets we could enter, but it’s only by saying no that you +can concentrate on the things that are really important. +-- Steve Jobs + +The ability to simplify means to eliminate the unnecessary so that the +necessary may speak. +-- Hans Hofmann + +However beautiful the strategy, you should occasionally look at the +results. +-- Winston Churchill + +Genius is 1% inspiration and 99% perspiration. +-- Thomas Edison + +I’d rather write programs to write programs than write programs. +-- Richard Sites + +Heureux l'étudiant qui comme la Rivière peut suivre son cours sans +quitter son lit... +-- Sebastien, sur commentcamarche.net + +Side projects are less masturbatory than reading RSS, often more +useful than MobileMe, more educational than the comments on Reddit, +and usually more fun than listening to keynotes. +-- Chris Wanstrath + +:nunmap can also be used outside of a monastery. +-- Vim user manual + +I had to learn how to teach less, so that more could be learned. +-- Tim Gallwey, The inner game of work + +Workers of the world, the chains that bind you are not held in place by +a ruling class, a "superior" race, by society, the state, or a leader. +They are held in place by none other than yourself. Those who seek to +exploit are not themselves free, for they place no value in freedom. Who +is it that really employs you and commands you to pick up your daily +load? And who is it that you allow to pass judgment on the adequacy of +your toil? Who have you empowered to dangle the carrot before you and +threaten with disapproval? Who, when you wake each morning, sends you +off to what you call your work? +Is there an "I want to" behind all your "I have to," or have you been so +long forgotten to yourself that "I want" exists only as an idea in your +head? If you have disconnected from your soul's desire and are drowning +in an ocean of "have to," then rise up and overthrow your master. Begin +the journey toward emancipation. Work only in such a way that you are +truly self-employed. +-- Tim Gallwey, The inner game of work + +The Work Begins Anew, The Hope Rises Again, And The Dream Lives On. +-- Ted Kennedy + +The hardest part of design ... is keeping features out. +-- Donald Norman + +Before software can be reusable it first has to be usable. +-- Ralph Johnson + +The opposite of love is not hate, it is indifference. +-- Elie Wiesel + +- Gbi de fer +- Howa! +- On va en France +- Non, je vais pas! +- Pourquoi? +- Parce ki y a pas agouti là-bas! +-- Gbi de fer + +Ecoute, crois en ton projet... Implique toi à fond... Trouve des aspects +innovants pour te distinguer des autres. Tu verras que tu te feras +remarquer très facilement... +-- Khaled Tangao + +Perpetual optimism is a force multiplier. +-- Colin Powell + +Be the change you want to see in the world. +-- Mahatma Gandhi + +The art of getting someone else to do something you want done because he +wants to do it [Leadership]. +-- Dwight D. Enseinhover. + +No one is all evil. Everybody has a good side. If you keep waiting, it +will comme up. +-- Randy Pausch + +Experience is what you get when you don't get what you want. +-- Cited by Randy Pausch + +Luck is where preparation meets opportunity. +-- Randy Pausch + +Bonne bosse et reste le boss. +-- Darryl Amedon + +The greatest of all weaknesses is the fear of appearing weak. +-- J. B. Bossuet, Politics from Holy Writ, 1709 + +It's easier to ask forgiveness than it is to get permission. +-- Rear Admiral Dr. Grace Hopper + +An investment in knowledge always pays the best interest. +-- Benjamin Franklin + +Natives who beat drums to drive off evil spirits are objects of scorn to +smart Americans who blow horns to break up traffic jams. +-- Mary Ellen Kelly + +A CS professor once explained recursion as follows: +A child couldn't sleep, so her mother told her a story about a little frog, + who couldn't sleep, so the frog's mother told her a story about a little bear, + who couldn't sleep, so the bear's mother told her a story about a little weasel... + who fell asleep. + ...and the little bear fell asleep; + ...and the little frog fell asleep; +...and the child fell asleep. +-- everything2.com + +Never do the impossible. People will expect you to do it forever after. +-- pigsandfishes.com + +Hire people smarter than you. Work with people smarter than you. +Listen to them. Let them lead you. Take the blame for all failures, +give away the credit for all successes. +-- How to fail: 25 secrets learned through failure + +Give up control. You never really had it anyway. +-- How to fail: 25 secrets learned through failure + +Ne te mets pas de limite, la vie se chargera de la mettre a ta place. +-- Darryl AMEDON + +Only two things are infinite, the universe and human stupidity. And I'm not so +sure about the former. +-- Albert Einstein + +The important thing is not to stop questioning. +-- Albert Einstein + +Do not accept anything because it comes from the mouth of a respected person. +-- Buddha + +Work as intensely as you play and play as intensely as you work. +-- Eric S. Raymond, How To Be A Hacker + +A witty saying proves nothing +-- Voltaire + +Sound methodology can empower and liberate the creative mind; it cannot inflame +or inspire the drudge. +-- Frederick P. Brooks, No Sliver Bullet. + +La connaissance d'un défaut ne l'enlève pas, elle nous torture jusqu'à sa +correction. +-- Daniel Lovewin (Guillaume Kpotufe) + +Je crois au flooding. +-- Karim BAINA (en parlant du dailogue avec les administrations) + +Il y a très loin de la velléité à la volnt, de la volonté à la résolution, de la +résolution au choix des moyens, du choix ds moyens à lapplication. +-- Jean-François Paul de Gondi de Retz + +Do not spoil what you have by desiring what you have not; but remember that what +you now have was once among the things only hoped for. +-- Greek philosopher Epicurus + +Nobody can make you feel inferior without your consent. +-- Eleanor Roosevelt + +If you tell the truth, you don't have to remember anything. +-- Mark Twain + +You know you're in love when you can't fall asleep because reality is finally +better than your dreams. +-- Dr. Seuss + +The opposite of love is not hate, it's indifference. +-- Elie Wiesel + +Life is what happens to you while you're busy making other plans. +-- John Lennon + +Whenever you find yourself on the side of the majority, it is time to pause and +reflect. +-- Mark Twain + +To be yourself in a world that is constantly trying to make you something else +is the greatest accomplishment. +-- Ralph Waldo Emerson + +It is not a lack of love, but a lack of friendship that makes unhappy marriages. +-- Friedrich Nietzsche + +In terms of energy, it's better to make a wrong choice than none at all. +-- George Leonard, Mastery. + +Courage is grace under pressure. +-- Ernest Hemingway + +Actually, the essence of boredom is to be found in the obsessive search for +novelty. Satisfaction lies in mindful repetition, the discovery of endless +richness in subtle variations on familiar themes. +-- George Leonard, Mastery. + +Before enlightenment, chop wood and carry water. +After enlightenment, chop wood and carry water. +-- Ancient Eastern adage + +Acknowledging the negative doesn't mean sniveling [whining, complaining]; it +means facing the truth and then moving on. +-- George Leonard, Mastery. + +Whatever you can do, or dream you can, begin it. Boldness has genius, power, and +magic in it. +-- Goethe + +What we choose to fight is so tiny! +What fights us is so great! +... +When we win it's with small things, +and the triumph itself makes us small. +... +Winning does not tempt that man. +This is how he grows: by being defeated, decisively, +by constantly greater beings. +-- Rainer Maria Rilke, The Man Watching. + +We fail to realize that mastery is not about perfection. It's about a process, +a journey. The master is the one who stays on the path day after day, year after +year. The master is the one who is willing to try, and fail, and try again, for +as long as he or she lives. +-- George Leonard, Mastery. + +Are you willing to wear your white belt? +-- George Leonard, Mastery. + +Dogs have Owners, Cats have Staff. + +I do not fear computers. I fear lack of them. – Isaac Asimov + +A computer once beat me at chess, but it was no match for me at kick boxing. – Emo Philips + +Computer Science is no more about computers than astronomy is about telescopes. – Edsger W. Dijkstra + +The computer was born to solve problems that did not exist before. – Bill Gates + +Software is like entropy: It is difficult to grasp, weighs nothing, and obeys the Second Law of Thermodynamics; i.e., it always increases. – Norman Augustine + +Software is a gas; it expands to fill its container. – Nathan Myhrvold + +All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you. Therefore, if you can’t get them together again, there must be a reason. By all means, do not use a hammer. – IBM Manual, 1925 + +Standards are always out of date. That’s what makes them standards. – Alan Bennett + +Physics is the universe’s operating system. – Steven R Garman + +It’s hardware that makes a machine fast. It’s software that makes a fast machine slow. – Craig Bruce + +Imagination is more important than knowledge. For knowledge is limited, whereas imagination embraces the entire world, stimulating progress, giving birth to evolution. – Albert Einstein + +The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge. – Stephen Hawking + +The more you know, the more you realize you know nothing. – Socrates + +Tell me and I forget. Teach me and I remember. Involve me and I learn. – Benjamin Franklin + +Real knowledge is to know the extent of one’s ignorance. – Confucius + +If people never did silly things, nothing intelligent would ever get done. – Ludwig Wittgenstein + +Getting information off the Internet is like taking a drink from a fire hydrant.– Mitchell Kapor + +If you think your users are idiots, only idiots will use it.– Linus Torvalds + +From a programmer’s point of view, the user is a peripheral that types when you issue a read request. – P. Williams + +Where is the ‘any’ key? – Homer Simpson, in response to the message, Press any key + +Computers are good at following instructions, but not at reading your mind. – Donald Knuth + +There is only one problem with common sense; it’s not very common. – Milt Bryce + +Your most unhappy customers are your greatest source of learning. – Bill Gates + +Let us change our traditional attitude to the construction of programs: Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do. – Donald E. Knuth + +The Internet? We are not interested in it. – Bill Gates, 1993 + +The best way to get accurate information on Usenet is to post something wrong and wait for corrections. – Matthew Austern + +The most likely way for the world to be destroyed, most experts agree, is by accident. That’s where we come in; we’re computer professionals. We cause accidents. – Nathaniel Borenstein + +Pessimists, we’re told, look at a glass containing 50% air and 50% water and see it as half empty. Optimists, in contrast, see it as half full. Engineers, of course, understand the glass is twice as big as it needs to be.– Bob Lewis + +In a room full of top software designers, if two agree on the same thing, that’s a majority. – Bill Curtis + +It should be noted that no ethically-trained software engineer would ever consent to write a DestroyBaghdad procedure. Basic professional ethics would instead require him to write a DestroyCity procedure, to which Baghdad could be given as a parameter. – Nathaniel S. Borenstein + +Mostly, when you see programmers, they aren’t doing anything. One of the attractive things about programmers is that you cannot tell whether or not they are working simply by looking at them. Very often they’re sitting there seemingly drinking coffee and gossiping, or just staring into space. What the programmer is trying to do is get a handle on all the individual and unrelated ideas that are scampering around in his head. – Charles M. Strauss + +If you think you are worth what you know, you are very wrong. Your knowledge today does not have much value beyond a couple of years. Your value is what you can learn and how easily you can adapt to the changes this profession brings so often. – Jose M. Aguilar + +Programs must be written for people to read, and only incidentally for machines to execute.– Abelson and Sussman + +Commenting your code is like cleaning your bathroom : you never want to do it, but it really does create a more pleasant experience for you and your guests. – Ryan Campbell + +We have to stop optimizing for programmers and start optimizing for users. – Jeff Atwood + +Low-level programming is good for the programmer’s soul.– John Carmack + +It’s OK to figure out murder mysteries, but you shouldn’t need to figure out code. You should be able to read it. – Steve McConnell + +If we wish to count lines of code, we should not regard them as ‘lines produced’ but as ‘lines spent.’– Edsger Dijkstra + +Programming can be fun, so can cryptography; however they should not be combined.– Kreitzberg and Shneiderman + +Before software should be reusable, it should be usable.– Ralph Johnson + +If you automate a mess, you get an automated mess.– Rod Michael + +Looking at code you wrote more than two weeks ago is like looking at code you are seeing for the first time.– Dan Hurvitz + +It is easier to change the specification to fit the program than vice versa.– Alan Perlis + +Less than 10% of the code has to do with the ostensible purpose of the system; the rest deals with input-output, data validation, data structure maintenance, and other housekeeping.– Mary Shaw + +If you have a procedure with ten parameters, you probably missed some.– Alan Perlis + +How rare it is that maintaining someone else’s code is akin to entering a beautifully designed building, which you admire as you walk around and plan how to add a wing or do some redecorating. More often, maintaining someone else’s code is like being thrown headlong into a big pile of slimy, smelly garbage.– Bill Venners + +Code generation, like drinking alcohol, is good in moderation.– Alex Lowe + +Simplicity, carried to the extreme, becomes elegance.– Jon Franklin + +A program is never less than 90% complete, and never more than 95% complete.– Terry Baker + +When you are stuck in a traffic jam with a Porsche, all you do is burn more gas in idle. Scalability is about building wider roads, not about building faster cars.– Steve Swartz + +Everyone by now presumably knows about the danger of premature optimization. I think we should be just as worried about premature design — designing too early what a program should do.– Paul Graham + +Programming without an overall architecture or design in mind is like exploring a cave with only a flashlight: You don’t know where you’ve been, you don’t know where you’re going, and you don’t know quite where you are.– Danny Thorpe + +The best way to predict the future is to implement it.– David Heinemeier Hansson + +We need above all to know about changes; no one wants or needs to be reminded 16 hours a day that his shoes are on.– David Hubel + +On two occasions I have been asked, ‘If you put into the machine wrong figures, will the right answers come out?’ I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.– Charles Babbage + +Make everything as simple as possible, but not simpler.– Albert Einstein + +Today, most software exists, not to solve a problem, but to interface with other software.– IO Angell + +Good specifications will always improve programmer productivity far better than any programming tool or technique.– Milt Bryce + +The difference between theory and practice is that in theory, there is no difference between theory and practice.– Richard Moore + +Don’t document the problem, fix it.– Atli Björgvin Oddsson + +As a rule, software systems do not work well until they have been used, and have failed repeatedly, in real applications.– Dave Parnas + +If the code and the comments do not match, possibly both are incorrect.– Norm Schryer + +I think it’s a new feature. Don’t tell anyone it was an accident.– Larry Wall + +If you don’t handle [exceptions], we shut your application down. That dramatically increases the reliability of the system.– Anders Hejlsberg + +When debugging, novices insert corrective code; experts remove defective code.– Richard Pattis + +In a software project team of 10, there are probably 3 people who produce enough defects to make them net negative producers.– Gordon Schulmeyer + +I think it is inevitable that people program poorly. Training will not substantially help matters. We have to learn to live with it.– Alan Perlis + +Program testing can be a very effective way to show the presence of bugs, but is hopelessly inadequate for showing their absence.– Edsger Dijkstra + +Manually managing blocks of memory in C is like juggling bars of soap in a prison shower: It’s all fun and games until you forget about one of them.– anonymous Usenet user + +There’s no obfuscated Perl contest because it’s pointless.– Jeff Polk + +Java is the most distressing thing to hit computing since MS-DOS.– Alan Kay + +There are only two things wrong with C++: The initial concept and the implementation.– Bertrand Meyer + +It was a joke, okay? If we thought it would actually be used, we wouldn’t have written it!– Mark Andreesen, speaking of the HTML tag BLINK + +Web Services are like teenage sex. Everyone is talking about doing it, and those who are actually doing it are doing it badly.– Michelle Bustamante + +Perl: The only language that looks the same before and after RSA encryption.– Keith Bostic + +I didn’t work hard to make Ruby perfect for everyone, because you feel differently from me. No language can be perfect for everyone. I tried to make Ruby perfect for me, but maybe it’s not perfect for you. The perfect language for Guido van Rossum is probably Python.– Yukihiro Matsumoto, aka Matz, creator of Ruby + +XML is not a language in the sense of a programming language any more than sketches on a napkin are a language. – Charles Simonyi + +BASIC is to computer programming as QWERTY is to typing.– Seymour Papert + +It has been discovered that C++ provides a remarkable facility for concealing the trivial details of a program — such as where its bugs are.– David Keppel + +UNIX is simple. It just takes a genius to understand its simplicity.– Dennis Ritchie + +Some people, when confronted with a problem, think ‘I know, I’ll use regular expressions.’ Now they have two problems.– Jamie Zawinski + +I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We’ve created life in our own image.– Stephen Hawking + +The only truly secure system is one that is powered off, cast in a block of concrete and sealed in a lead-lined room with armed guards.– Gene Spafford + +Being able to break security doesn’t make you a hacker anymore than being able to hotwire cars makes you an automotive engineer.– Eric Raymond + +Companies spend millions of dollars on firewalls, encryption and secure access devices, and it’s money wasted, because none of these measures address the weakest link in the security chain.– Kevin Mitnick + +If you think technology can solve your security problems, then you don’t understand the problems and you don’t understand the technology.– Bruce Schneier + +Hoaxes use weaknesses in human behavior to ensure they are replicated and distributed. In other words, hoaxes prey on the Human Operating System.– Stewart Kirkpatrick + +Passwords are like underwear: you don’t let people see it, you should change it very often, and you shouldn’t share it with strangers.– Chris Pirillo + +I am not out to destroy Microsoft, that would be a completely unintended side effect.– Linus Torvalds + +Yes, we have a dress code. You have to dress.– Scott McNealy, co-founder of Sun Microsystems + +In an information economy, the most valuable company assets drive themselves home every night. If they are not treated well, they do not return the next morning.– Peter Chang + +It’s better to wait for a productive programmer to become available than it is to wait for the first available programmer to become productive.– Steve McConnell + +I’m not one of those who think Bill Gates is the devil. I simply suspect that if Microsoft ever met up with the devil, it wouldn’t need an interpreter.– Nicholas Petreley + +Two years from now, spam will be solved.– Bill Gates, 2004 + +The problem of viruses is temporary and will be solved in two years.– John McAfee, 1988 + +Computer viruses are an urban legend.– Peter Norton, 1988 + +In 2031, lawyers will be commonly a part of most development teams.– Grady Booch + +I don’t know what the language of the year 2000 will look like, but I know it will be called Fortran.– CA Hoare, 1982 + +In the future, computers may weigh no more than 1.5 tonnes.– Popular mechanics, 1949 + +I see little commercial potential for the Internet for at least ten years.– Bill Gates, 1994 + +Before man reaches the moon, mail will be delivered within hours from New York to California, to Britain, to India or Australia.– Arthur Summerfield, 1959, United States Post + +The best way to predict the future is to implement it. That is the spirit that has made computers and the internet what it is today. + +Computers are good at following instructions, but not at reading your mind."Hoaxes use weaknesses in human behavior to ensure they are replicated and distributed. In other words, hoaxes prey on the Human Operating System. + +in a room where people think similar – not much thinking is done… =)) + +It’s hardware that makes a machine fast. It’s software that makes a fast machine slow.– Craig Bruce + +Computers are useless. They can only give you answers.(Pablo Picasso) + +Computers are like bikinis. They save people a lot of guesswork.(Sam Ewing) + +They have computers, and they may have other weapons of mass destruction.(Janet Reno) + +That’s what’s cool about working with computers. They don’t argue, they remember everything, and they don’t drink all your beer.(Paul Leary) + +If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year, killing everyone inside.(Robert X. Cringely) + +Computers are getting smarter all the time. Scientists tell us that soon they will be able to talk to us. (And by ‘they’, I mean ‘computers’. I doubt scientists will ever be able to talk to us.)(Dave Barry) + +I’ve noticed lately that the paranoid fear of computers becoming intelligent and taking over the world has almost entirely disappeared from the common culture. Near as I can tell, this coincides with the release of MS-DOS.(Larry DeLuca) + +The question of whether computers can think is like the question of whether submarines can swim.(Edsger W. Dijkstra) + +It’s ridiculous to live 100 years and only be able to remember 30 million bytes. You know, less than a compact disc. The human condition is really becoming more obsolete every minute.(Marvin Minsky) + +The city’s central computer told you? R2D2, you know better than to trust a strange computer!(C3PO) + +Never trust a computer you can’t throw out a window.(Steve Wozniak) + +Hardware: The parts of a computer system that can be kicked.(Jeff Pesis) + +Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves.(Alan Kay) + +I’ve finally learned what ‘upward compatible’ means. It means we get to keep all our old mistakes.(Dennie van Tassel) + +There are two major products that come out of Berkeley: LSD and UNIX. We don’t believe this to be a coincidence.(Jeremy S. Anderson) + +19 Jan 2038 at 3:14:07 AM(End of the word according to Unix–2^32 seconds after January 1, 1970) + +Every operating system out there is about equal… We all suck.(Microsoft senior vice president Brian Valentine describing the state of the art in OS security, 2003) + +Microsoft has a new version out, Windows XP, which according to everybody is the ‘most reliable Windows ever.‘ To me, this is like saying that asparagus is ‘the most articulate vegetable ever.‘ (Dave Barry) + +The Internet? Is that thing still around? (Homer Simpson) + +The Web is like a dominatrix. Everywhere I turn, I see little buttons ordering me to Submit.(Nytwind) + +Come to think of it, there are already a million monkeys on a million typewriters, and Usenet is nothing like Shakespeare.(Blair Houghton) + +The most amazing achievement of the computer software industry is its continuing cancellation of the steady and staggering gains made by the computer hardware industry.(Henry Petroski) + +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) + +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 is not about bits, bytes and protocols, but profits, losses and margins.(Lou Gerstner) + +We are Microsoft. Resistance Is Futile. You Will Be Assimilated.(Bumper sticker) + +No matter how slick the demo is in rehearsal, when you do it in front of a live audience, the probability of a flawless presentation is inversely proportional to the number of people watching, raised to the power of the amount of money involved.(Mark Gibbs) + +The bulk of all patents are crap. Spending time reading them is stupid. It’s up to the patent owner to do so, and to enforce them.Linus Torvalds) + +Controlling complexity is the essence of computer programming.(Brian Kernigan) + +Complexity kills. It sucks the life out of developers, it makes products difficult to plan, build and test, it introduces security challenges, and it causes end-user and administrator frustration.(Ray Ozzie) + +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 way is to make it so complicated that there are no obvious deficiencies.(C.A.R. Hoare) + +The function of good software is to make the complex appear to be simple.(Grady Booch) + +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) + +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) + +There’s an old story about the person who wished his computer were as easy to use as his telephone. That wish has come true, since I no longer know how to use my telephone.(Bjarne Stroustrup) + +Any fool can use a computer. Many do.(Ted Nelson) + +There are only two industries that refer to their customers as ‘users’.(Edward Tufte) + +Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.(Rich Cook) + +Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris.(Larry Wall) + +The trouble with programmers is that you can never tell what a programmer is doing until it’s too late.(Seymour Cray) + +That’s the thing about people who think they hate computers. What they really hate is lousy programmers.(Larry Niven) + +For a long time it puzzled me how something so expensive, so leading edge, could be so useless. And then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match.(Bill Bryson) + +Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter.(Eric Raymond) + +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) + +A hacker on a roll may be able to produce–in a period of a few months–something that a small development group (say, 7-8 people) would have a hard time getting together over a year. IBM used to report that certain programmers might be as much as 100 times as productive as other workers, or more.(Peter Seebach) + +The best programmers are not marginally better than merely good ones. They are an order-of-magnitude better, measured by whatever standard: conceptual creativity, speed, ingenuity of design, or problem-solving ability.(Randall E. Stross) + +A great lathe operator commands several times the wage of an average lathe operator, but a great writer of software code is worth 10,000 times the price of an average software writer.(Bill Gates) + +Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.(Mosher’s Law of Software Engineering) + +Measuring programming progress by lines of code is like measuring aircraft building progress by weight.(Bill Gates) + +Writing code has a place in the human hierarchy worth somewhere above grave robbing and beneath managing.(Gerald Weinberg) + +First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack.(George Carrette) + +First, solve the problem. Then, write the code.(John Johnson) + +Optimism is an occupational hazard of programming; feedback is the treatment.(Kent Beck) + +To iterate is human, to recurse divine.(L. Peter Deutsch) + +The best thing about a boolean is even if you are wrong, you are only off by a bit.(Anonymous) + +Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration.(Stan Kelly-Bootle) + +There are only two kinds of programming languages: those people always bitch about and those nobody uses.(Bjarne Stroustrup) + +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) + +The use of COBOL cripples the mind; its teaching should therefore be regarded as a criminal offense.(E.W. Dijkstra) + +It is practically impossible to teach good programming style to students that have had prior exposure to BASIC. As potential programmers, they are mentally mutilated beyond hope of regeneration.(E. W. Dijkstra) + +I think Microsoft named .Net so it wouldn’t show up in a Unix directory listing.(Oktal) + +There is no programming language–no matter how structured–that will prevent programmers from making bad programs.(Larry Flon) + +Computer language design is just like a stroll in the park. Jurassic Park, that is.(Larry Wall) + +Fifty years of programming language research, and we end up with C++?(Richard A. O’Keefe) + +Writing in C or C++ is like running a chain saw with all the safety guards removed.(Bob Gray) + +In C++ it’s harder to shoot yourself in the foot, but when you do, you blow off your whole leg.(Bjarne Stroustrup) + +C++ : Where friends have access to your private members.(Gavin Russell Baker) + +One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.(Robert Firth) + +Java is, in many ways, C++–.(Michael Feldman) + +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) + +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) + +If Java had true garbage collection, most programs would delete themselves upon execution.(Robert Sewell) + +Software is like sex: It’s better when it’s free.(Linus Torvalds) + +The only people who have anything to fear from free software are those whose products are worth even less.(David Emery) + +Good code is its own best documentation.(Steve McConnell) + +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) + +The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.(Tom Cargill) + +Good programmers use their brains, but good guidelines save us having to think out every case.(Francis Glassborow) + +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) + +Considering the current sad state of our computer programs, software development is clearly still a black art, and cannot yet be called an engineering discipline.(Bill Clinton) + +You can’t have great software without a great team, and most software teams behave like dysfunctional families.(Jim McCarthy) + +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) + +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) + +If debugging is the process of removing bugs, then programming must be the process of putting them in.(Edsger W. Dijkstra) + +I don’t care if it works on your machine! We are not shipping your machine!(Vidiu Platon) + +Programming is like sex: one mistake and you’re providing support for a lifetime.(Michael Sinz) + +There are two ways to write error-free programs; only the third one works.(Alan J. Perlis) + +You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time.(Bertrand Meyer) + +If McDonalds were run like a software company, one out of every hundred Big Macs would give you food poisoning, and the response would be, ‘We’re sorry, here’s a coupon for two more.’ (Mark Minasi) + +Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.(Martin Golding) + +To err is human, but to really foul things up you need a computer.(Paul Ehrlich) + +A computer lets you make more mistakes faster than any invention in human history–with the possible exceptions of handguns and tequila.(Mitch Radcliffe) + +Everything that can be invented has been invented. (Charles H. Duell, Commissioner, U.S. Office of Patents, 1899) + +I think there’s a world market for about 5 computers. (Thomas J. Watson, Chairman of the Board, IBM, circa 1948) + +It would appear that we have reached the limits of what it is possible to achieve with computer technology, although one should be careful with such statements, as they tend to sound pretty silly in 5 years. (John Von Neumann, circa 1949) + +But what is it good for? (Engineer at the Advanced Computing Systems Division of IBM, commenting on the microchip, 1968) + +There is no reason for any individual to have a computer in his home. (Ken Olson, President, Digital Equipment Corporation, 1977) + +640K ought to be enough for anybody. (Bill Gates, 1981) + +Windows NT addresses 2 Gigabytes of RAM, which is more than any application will ever need. (Microsoft, on the development of Windows NT, 1992) + +We will never become a truly paper-less society until the Palm Pilot folks come out with WipeMe 1.0. (Andy Pierson) + +If it keeps up, man will atrophy all his limbs but the push-button finger.(Frank Lloyd Wright) + +There are so many men who can figure costs, and so few who can measure values. ~Author Unknown + +A corporation is a living organism; it has to continue to shed its skin. Methods have to change. Focus has to change. Values have to change. The sum total of those changes is transformation. ~Andrew Grove + +The most dangerous kind of waste is the waste we do not recognize. ~Shigeo Shingo + +Your lean process should be a lean process. ~Author Unknown + +There is nothing so useless as doing efficiently that which should not be done at all. ~Peter F. Drucker + +Continuous improvement is not about the things you do well - that's work. Continuous improvement is about removing the things that get in the way of your work. The headaches, the things that slow you down, that’s what continuous improvement is all about. ~Bruce Hamilton + +If you need a new process and don't install it, you pay for it without getting it. ~Ken Stork + +Everything can be improved. ~Clarence W. Barron + +Willful waste brings woeful want. ~Thomas Fuller + +There are many experts on how things have been done up to now. If you think something could use a little improvement, you are the expert. ~Robert Brault, www.robertbrault.com + +Amateurs work until they get it right. Professionals work until they can't get it wrong. ~Author Unknown + +It is not the employer who pays the wages. He only handles the money. It is the product that pays the wages. ~Henry Ford, 1922, also sometimes quoted as "It is the customer that pays the wages" + +Nature does constant value stream mapping - it's called evolution. ~Carrie Latet + +Don't waste time learning the "tricks of the trade." Instead, learn the trade. ~James Charlton + +Time waste differs from material waste in that there can be no salvage. The easiest of all wastes and the hardest to correct is the waste of time, because wasted time does not litter the floor like wasted material. ~Henry Ford + +Waste is a tax on the whole people. ~Albert W. Atwood + +When solving problems, dig at the roots instead of just hacking at the leaves. ~Anthony J. D'Angelo, The College Blue Book + +A bad system will beat a good person every time. ~W. Edwards Deming + +It is an immutable law in business that words are words, explanations are explanations, promises are promises but only performance is reality. ~Harold Geneen + +We are too busy mopping the floor to turn off the faucet. ~Author Unknown + +Watch the little things; a small leak will sink a great ship. ~Benjamin Franklin + +Waste is worse than loss. The time is coming when every person who lays claim to ability will keep the question of waste before him constantly. The scope of thrift is limitless. ~Thomas A. Edison + +It is more than probable that the average man could, with no injury to his health, increase his efficiency fifty percent. ~Walter Scott + +The essential question is not, "How busy are you?" but "What are you busy at?" ~Oprah Winfrey + +A relentless barrage of "why’s" is the best way to à your mind to pierce the clouded veil of thinking caused by the status quo. Use it often. ~Shigeo Shingo + +The first rule of any technology used in a business is that automation applied to an efficient operation will magnify the efficiency. The second is that automation applied to an inefficient operation will magnify the inefficiency. ~Bill Gates + +The world we have created is a product of our thinking; it cannot be changed without changing our thinking. ~Albert Einstein + +If you don't know where you are going, you will probably end up somewhere else. ~Lawrence J. Peter + +Improvement usually means doing something that we have never done before. ~Shigeo Shingo + +Work expands so as to fill the time available for its completion. ~C. Northcote Parkinson, 1958 + +On the bathing-tub of King T'ang the following words were engraved: "If you would one day renovate yourself, do so from day to day. Yea, let there be daily renovation." ~Confucian Analects + +An environment where people have to think brings with it wisdom, and this wisdom brings with it kaizen [continuous improvement]. ~Teruyuki Minoura + +The impossible is often the untried. ~Jim Goodwin + +The man who will use his skill and constructive imagination to see how much he can give for a dollar, instead of how little he can give for a dollar, is bound to succeed. ~Henry Ford + +If you don't have time to do it right you must have time to do it over. ~Author Unknown + +Ford's success has startled the country, almost the world, financially, industrially, mechanically. It exhibits in higher degree than most persons would have thought possible the seemingly contradictory requirements of true efficiency, which are: constant increase of quality, great increase of pay to the workers, repeated reduction in cost to the consumer. And with these appears, as at once cause and effect, an absolutely incredible enlargement of output reaching something like one hundredfold in less than ten years, and an enormous profit to the manufacturer. ~Charles Buxton Going + +Great ideas need landing gear as well as wings. ~C.D. Jackson + +Different isn't always better, but better is always different. ~Author Unknown + +He who rejects change is the architect of decay. The only human institution which rejects progress is the cemetery. ~Harold Wilson + +Invest a few moments in thinking. It will pay good interest. ~Author Unknown + +Don't water your weeds. ~Harvey MacKay + +You must have long-range goals to keep you from being frustrated by short-range failures. ~Charles C. Noble + +I don't like a man to be too efficient. He's likely to be not human enough. ~Felix Frankfurter + +If all efficiency experts were laid end to end - I'd be in favor of it. ~Al Diamond + +One half of knowing what you want is knowing what you must give up before you get it. ~Sidney Howard + +I shall try to correct errors when shown to be errors, and I shall adopt new views so fast as they appear to be true views. ~Abraham Lincoln + +It is better to stir up a question without deciding it, than to decide it without stirring it up. ~Joseph Joubert + +"Quality is everyone's responsibility. W. Edwards Deming + +It is not enough to do your best; you must know what to do, and then do your best. W. Edwards Deming + +Profit in business comes from repeat customers, customers that boast about your project or service, and that bring friends with them. W. Edwards Deming + +If you can't describe what you are doing as a process, you don't know what you're doing.W. Edwards Deming + +"You can not inspect quality into the product; it is already there. W. Edwards Deming + +"It does not happen all at once. There is no instant pudding. W. Edwards Deming + +If you stay in this world, you will never learn another one. W. Edwards Deming + +Does experience help? NO! Not if we are doing the wrong things. W. Edwards Deming + +The result of long-term relationships is better and better quality, and lower and lower costs.W. Edwards Deming + +We are here to make another world. W. Edwards Deming + +Don’t be afraid to make mistakes. Sakichi Toyoda (Osono et al 2008, 67) + +If you’re 60 percent sure, take action. (Osono et al 2008, 86) + +"Before you say you can’t do something, try it. Sakichi Toyoda (Osono et al 2008, 86) + +I have seen more failures than successes. Sakichi Toyoda (Osono et al 2008, 87) + +"Endure a hundred times, strengthen yourself a thousand times, and you will complete you tasks in short order. A phrase that hung in Sakichi Toyoda’s home, quoted by Matsubara (Osono et al 2008, 127) + +To do what you believe is right, to do what you believe is good, and doing these things right then and in that way is a calling from on high. Thus, do it boldly, do as you believe, do as you are. Eiji Toyoda quoted by Matsubara (Osono et al 2008, 127) + +At Toyota, we expect every assembly line worker to direct their wisdom toward originating ideas for improving base costs, quality, and safety. Here the job of the line manager is to create an environment in which line workers can easily make suggestions and are supported to implement those suggestions. Matsubara (Osono et al 2008, 131) + +Each person thoroughly fulfilling their duties generates great power that, gathered together in a chain, creates a ring of power. Kiichiro Toyoda (Osono et al 2008, 134) + +Since it’s the customer that pays our salary, our responsibility is to make the product they want, when they want it, and deliver quality that satisfies them. Retired factory worker, Kiyoshi Tsutsumi (Osono et al 2008, 136) + +Unless we visit genba [the place where the action is], we cannot develop a good plan. Katsuyoshi Tabata (Osono et al 2008, 141) + +In the [Toyota] vernacular these information processing skills are called, ‘not listening to what you are told,’ Funo of Toyota Motor Sales, U.S.A. (Osono et al 2008, 153) + +the head of an abundant rice plant hangs down old Japanese Adage, describing the humility of senior executives of Toyota and the Toyoda family members (Osono et al 2008, 167) + +If your boss refuses you something that you really want to do, don’t give up, he said, try pitching it two or three times. By the third time, the boss will realise, ‘Hey, this guy is serious.’ Toyota President Katsuaki Watanabe (Osono et al 2008, 182) + +We have to waste resources by trying many things when we are unsure of which are best. Toyota Chairman Fujio Cho (Osono et al 2008, 207) + +There’s got to be a better way Top Toyota Executives (Osono et al 2008, 15) + +Reform business when business is good. Former Toyota Chairman and President Hiroshi Okuda (Osono et al 2008, 15) + +No change is bad Toyota President Katsuaki Watanabe (Osono et al 2008, 15) + +always optimizing Toyota Value (Osono et al 2008, 45) + +Action at the Source Suzuki (Osono et al 2008, 53) + +Let’s give it a try. Sakichi Toyoda, President of Toyoda Automatic Loom Works (parent company to Toyota) (Osono et al 2008, 67) + +Don’t be afraid to make mistakes. Sakichi Toyoda (Osono et al 2008, 67) + +Simplicity is the ultimate sophistication- Leonardo da Vinci + +Simplicity does not precede complexity, but follows it - Alan Perlis + +Productivity is being able to do things that you were never able to do before - Franz Kafka + +~ Innovation is the process of turning ideas into manufacturable and marketable form. ~Watts Humprey + +~ Creativity is thinking up new things. Innovation is doing new things. ~Theodore Levitt + +~ Never before in history has innovation offered promise of so much to so many in so short a time. ~Bill Gates + +~ Great innovations should not be forced on slender majorities. ~Thomas Jefferson + +~ Innovation by definition will not be accepted at first. It takes repeated attempts, endless demonstrations, monotonous rehearsals before innovation can be accepted and internalized by an organization. This requires 'courageous patience'. ~Warren Bennis + +~ Fashion is something barbarous, for it produces innovation without reason and imitation without benefit. ~George Santayana + +~ You have all the reason in the world to achieve your grandest dreams. Imagination plus innovation equals realization. ~Denis Waitley + +~ Entrepreneurs innovate. Innovation is the specific instrument of entrepreneurship. It is the act that endows resources with a new capacity to create wealth. ~Peter F. Drucker + +~ The world leaders in innovation and creativity will also be world leaders in everything else. ~ Harold R. McAlindon + +~ Innovation is not the product of logical thought, although the result is tied to logical structure. ~ Albert Einstein + +"On n'innove jamais seul dans son coin" Areva Innovation Motto + +Shoot for the moon. Even if you miss, you'll land among the stars. + +"L’innovation systématique requiert la volonté de considérer le changement comme une opportunité.rPeter Drucker + +"Life would be so much easier if we only had the source code." + +"Men are from Mars. Women are from Venus. Computers are from hell." + +"Computer are like air conditioners: they stop working when you open windows." + +"Like car accidents, most hardware problems are due to driver error." + +"If you put fences around people, you get sheep. Give people the room they need." William L. McKnight, McKnight Foundation founder and former 3M CEO + +"Be a yardstick of quality. Some people aren't used to an environment where excellence is expected." Steve Jobs + +"Design is not just what it looks like and feels like. Design is how it works."Steve Jobs + +"I want to put a ding in the universe. " Steve Jobs + +"Innovation distinguishes between a leader and a follower." Steve Jobs + +"Sometimes when you innovate, you make mistakes. It is best to admit them quickly, and get on with improving your other innovations. " Steve Jobs + +"You can't just ask customers what they want and then try to give that to them. By the time you get it built, they'll want something new. " Steve Jobs + +"Stay Hungry. Stay Foolish." - Steve Jobs ( famous Standford speech ) + +"Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma - which is living with the results of other people's thinking. Don't let the noise of others' opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary." Steve Jobs + +"On a toujours le choix. On est même la somme de ses choix. Joseph O’Connor – + +Ceux qui ont des idées mais ne savent pas les présenter sont, peu à peu, exclus des débats. Bernard Werber + +"Le prix Nobel, c’est une bouée de sauvetage lancée à un nageur qui a déjà atteint la rive." George Bernard Shaw – + +"Soyez insatiables, soyez fous. C’est vrai que ça n’est pas dans le status quo qu’on se préparera un avenir meilleur. Ni la frilosité et les certitudes qui nous permettront d’avancer." Steve Jovs + +"I didn't know it was impossible when I did it" - anomynous + +"He who moves not forward, goes backward." Johann Wolfgang von Goethe + +"All that is human must retrograde if it does not advance." Edward Gibbon + +"No snowflake in an avalanche ever feels responsible." Voltaire + +"I try. I fail. I try again. I fail better." Samuel Beckett + +"Experience is not what happens to a man; it is what a man does with what happens to him." Aldous Huxley + +"Take care of the large problems and the small ones will tend not to bother you." anonymous + +"Computers are useless. They can only give you answers." - Pablo Picasso + +"Nobody is perfect, but a team can be" - Meredith Belbin + +"Necessity is the mother of invention" - Plato + +"Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning." - Albert Einstein + +"We cannot solve our problems with the same thinking we used when we created them." Albert Einstein + +"If you can't explain it simply, you don't understand it well enough." Albert Einstein + +"Anyone who has never made a mistake has never tried anything new." Albert Einstein + +"The only source of knowledge is experience." Albert Einstein + +"Make everything as simple as possible, but not simpler." Albert Einstein + +"Information is not knowledge." Albert Einstein + +"I have not failed. I've just found 10,000 ways that won't work." Thomas A. Edison + +"Genius is one percent inspiration and ninety-nine percent perspiration." Thomas A. Edison + +Algorithmic complexity for structured programmers: All algorithms are O(f(n)), where f is someone else’s responsibility. – Peter Cooper + +Fact: 48% of IE7 usage comes from developers checking that their site works in IE7. – @iamdevloper + +Programmers don’t burn out on hard work, they burn out on change-with-the-wind directives and not ‘shipping’. – Mark Berry + +I’ve known people who have not mastered their tools who are good programmers, but not a tool master who remained a mediocre programmer. – Kent Beck + +There are two types of people in this world: those who understand recursion and those who don’t understand that there are two types of people in this world. + +Daddy, how is software made? Well, when a programmer loves an idea very much they stay up all night and then push to github the next day. – Sam Kottler + +Software developers like to solve problems. If there are no problems handily available, they will create their own problems. + +The problem with quick and dirty, is that the dirty remains long after the quick has been forgotten – Steve C. McConnell + +Prolific developers don’t always write a lot of code, instead they solve a lot of problems. The two things are not the same. – J. Chambers + +A programmer’s wife tells him: go to store. pick up a loaf of bread. If they have eggs, get a dozen. The programmer returns with 12 loaves. + +Bad programmers have all the answers. Good testers have all the questions. – Gil Zilberfeld + +Our job is to tell you your baby is ugly! – Software Testers + +The best TDD can do, is assure that code does what the programmer thinks it should do. That is pretty good BTW. – James Grenning + +The bitterness of poor quality remains long after the sweetness of meeting the schedule has been forgotten. – Anonymous + +One bad programmer can easily create two new jobs a year. – David Parnas + +Don’t document bad code — rewrite it. – Kernighan and Plauger + +3 Errors walk into a bar. The barman says, normally I’d Throw you all out, but tonight I’ll make an Exception. – @iamdevloper + +Weeks of programming can save you hours of planning. - Anonymous + +If you think it’s expensive to hire a professional, wait until you hire an amateur. + +Programming can be fun, so can cryptography; however they should not be combined. -Kreitzberg and Shneiderman + +The proper use of comments is to compensate for our failure to express ourself in code. – Uncle Bob Martin + +My definition of an expert in any field is a person who knows enough about what’s really going on to be scared. – P. J. Plauger + +First, solve the problem. Then, write the code. – John Johnson + +Programming is not a zero-sum game. Teaching something to a fellow programmer doesn’t take it away from you. – John Carmack + +One of my most productive days was throwing away 1000 lines of code — Ken Thompson + +When in doubt, use brute force. — Ken Thompson + +Deleted code is debugged code. — Jeff Sickel + +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 W. Kernighan and P. J. Plauger in The Elements of Programming Style. + +The most effective debugging tool is still careful thought, coupled with judiciously placed print statements. — Brian W. Kernighan, in the paper Unix for Beginners (1979) + +Controlling complexity is the essence of computer programming. — Brian Kernighan + +Beauty is more important in computing than anywhere else in technology because software is so complicated. Beauty is the ultimate defence against complexity. — David Gelernter + +UNIX was not designed to stop its users from doing stupid things, as that would also stop them from doing clever things. — Doug Gwyn + +Life is too short to run proprietary software. — Bdale Garbee + +The central enemy of reliability is complexity. — Geer et al. + +Simplicity is prerequisite for reliability. — Edsger W. Dijkstra + +Simplicity is the ultimate sophistication. — Leonardo da Vinci + +The unavoidable price of reliability is simplicity. — C.A.R. Hoare + +You can’t trust code that you did not totally create yourself. — Ken Thompson + +Compatibility means deliberately repeating other people’s mistakes. — David Wheeler + +Debugging time increases as a square of the program’s size. — Chris Wenham + +Before software can be reusable it first has to be usable. + +The best code is no code at all. + +No code is faster than no code. — merb motto + +Program testing can be a very effective way to show the presence of bugs, but is hopelessly inadequate for showing their absence. — Edsger W. Dijkstra + +Parkinson’s Law Work expands so as to fill the time available for its completion. + +Code never lies, comments sometimes do. — Ron Jeffries + +If we’d asked the customers what they wanted, they would have said faster horses — Henry Ford + +With diligence it is possible to make anything run slowly.— Tom Duff + +Software obeys the law of gaseous expansion – it continues to grow until memory is completely filled. — Larry Gleason + +A distributed system is one in which the failure of a computer you didn’t even know existed can render your own computer unusable. — Leslie Lamport + +The proper use of comments is to compensate for our failure to express ourself in code. — Robert C. MartinClean Code + +Incorrect documentation is often worse than no documentation. — Bertrand Meyer + +Security is a state of mind. — NSA Security Manua + +And don’t EVER make the mistake that you can design something better than what you get from ruthless massively parallel trial-and-error with a feedback cycle. That’s giving your intelligence much too much credit — Linus diff --git a/LaDOSE.Src/LaDOSE.Entity/BotEvent/BotEvent.cs b/LaDOSE.Src/LaDOSE.Entity/BotEvent/BotEvent.cs new file mode 100644 index 0000000..dd50e00 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.Entity/BotEvent/BotEvent.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace LaDOSE.Entity.BotEvent +{ + public class BotEvent : Context.Entity + { + public string Name { get; set; } + public DateTime Date { get; set; } + public virtual ICollection Results { get; set; } + + } + public class BotEventResult : Context.Entity + { + public int BotEventId { get; set; } + public BotEvent BotEvent { get; set; } + + public string Name { get; set; } + public string DiscordId { get; set; } + public bool Result { get; set; } + } +} diff --git a/LaDOSE.Src/LaDOSE.Entity/Context/LaDOSEDbContext.cs b/LaDOSE.Src/LaDOSE.Entity/Context/LaDOSEDbContext.cs index fdf2402..34dbe0d 100644 --- a/LaDOSE.Src/LaDOSE.Entity/Context/LaDOSEDbContext.cs +++ b/LaDOSE.Src/LaDOSE.Entity/Context/LaDOSEDbContext.cs @@ -1,6 +1,6 @@ using LaDOSE.Entity.Challonge; - using LaDOSE.Entity.Wordpress; +using LaDOSE.Entity.BotEvent; using Microsoft.EntityFrameworkCore; namespace LaDOSE.Entity.Context @@ -32,6 +32,10 @@ namespace LaDOSE.Entity.Context public DbSet ChallongeParticipent { get; set; } public DbSet ChallongeTournament { get; set; } + #region BotEvents + public DbSet BotEvent { get; set; } + public DbSet BotEventResult { get; set; } + #endregion public LaDOSEDbContext(DbContextOptions options) : base(options) { } @@ -69,7 +73,12 @@ namespace LaDOSE.Entity.Context .HasOne(e => e.Tournament) .WithMany(e => e.Results) .HasForeignKey(pt => pt.TournamentId); - + + modelBuilder.Entity() + .HasOne(e => e.BotEvent) + .WithMany(e => e.Results) + .HasForeignKey(pt => pt.BotEventId); + //modelBuilder.Entity() diff --git a/LaDOSE.Src/LaDOSE.REST/RestService.cs b/LaDOSE.Src/LaDOSE.REST/RestService.cs index 1030d9d..e64e5e7 100644 --- a/LaDOSE.Src/LaDOSE.REST/RestService.cs +++ b/LaDOSE.Src/LaDOSE.REST/RestService.cs @@ -297,7 +297,7 @@ namespace LaDOSE.REST return Post, bool>("Api/Tournament/ParseChallonge", ids); } #endregion - + #region Tournamenet Event / Player public List GetAllEvents() { CheckToken(); @@ -313,5 +313,33 @@ namespace LaDOSE.REST var restResponse = Client.Get>(restRequest); return restResponse.Data; } + #endregion + + + #region Bot Command + + public bool CreateBotEvent(string eventName) + { + CheckToken(); + var restRequest = new RestRequest($"/api/BotEvent/CreateBotEvent/{eventName}", Method.GET); + var restResponse = Client.Get(restRequest); + return restResponse.Data; + } + + public BotEventDTO GetLastBotEvent() + { + CheckToken(); + var restRequest = new RestRequest($"/api/BotEvent/GetLastBotEvent/", Method.GET); + var restResponse = Client.Post(restRequest); + return restResponse.Data; + } + + public bool ResultBotEvent(BotEventSendDTO result) + { + CheckToken(); + return Post("/api/BotEvent/ResultBotEvent", result); + } + + #endregion } } \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.Service/Interface/IBotEventService.cs b/LaDOSE.Src/LaDOSE.Service/Interface/IBotEventService.cs new file mode 100644 index 0000000..5c6709b --- /dev/null +++ b/LaDOSE.Src/LaDOSE.Service/Interface/IBotEventService.cs @@ -0,0 +1,12 @@ +using LaDOSE.Entity.BotEvent; + +namespace LaDOSE.Business.Interface +{ + public interface IBotEventService : IBaseService + { + BotEvent GetLastEvent(); + + bool CreateEvent(string EventName); + bool SetResult(string discordId, string name, bool present); + } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.Service/Service/BotEventService.cs b/LaDOSE.Src/LaDOSE.Service/Service/BotEventService.cs new file mode 100644 index 0000000..2e01cee --- /dev/null +++ b/LaDOSE.Src/LaDOSE.Service/Service/BotEventService.cs @@ -0,0 +1,55 @@ +using System; +using System.Linq; +using LaDOSE.Business.Interface; +using LaDOSE.Entity; +using LaDOSE.Entity.BotEvent; +using LaDOSE.Entity.Context; +using Microsoft.EntityFrameworkCore; + +namespace LaDOSE.Business.Service +{ + public class BotEventService : BaseService, IBotEventService + { + public BotEventService(LaDOSEDbContext context) : base(context) + { + this._context = context; + + } + + public bool CreateEvent(string EventName) + { + this._context.BotEvent.Add(new BotEvent { Name = EventName, Date = DateTime.Now }); + return this._context.SaveChanges()!=0; + } + + public BotEvent GetLastEvent() + { + return this._context.BotEvent.Include(e=>e.Results).FirstOrDefault(e => e.Date == this._context.BotEvent.Max(e => e.Date)); + } + + public bool SetResult(string discordId, string name, bool present) + { + if (string.IsNullOrEmpty(discordId)) + throw new Exception("DiscordId invalid."); + + BotEvent currentEvent = this.GetLastEvent(); + + if(currentEvent == null) + { + throw new Exception("Oups"); + } + BotEventResult res = currentEvent.Results.FirstOrDefault(e => e.DiscordId == discordId); + if (res != null) + { + res.Result = present; + _context.BotEventResult.Update(res); + _context.SaveChanges(); + return true; + } + + _context.BotEventResult.Add(new BotEventResult() { BotEventId = currentEvent.Id, DiscordId = discordId, Result = present, Name = name }); + return _context.SaveChanges()!=0; + + } + } +} \ No newline at end of file