{"id":1567,"date":"2013-01-17T15:42:42","date_gmt":"2013-01-17T13:42:42","guid":{"rendered":"http:\/\/9v.lt\/blog\/?p=1567"},"modified":"2022-01-19T08:34:41","modified_gmt":"2022-01-19T06:34:41","slug":"evilfortune","status":"publish","type":"post","link":"https:\/\/9v.lt\/blog\/evilfortune\/","title":{"rendered":"EvilFortune"},"content":{"rendered":"<p>Greetings all.<br \/>\nThis is my latest C++ project&#8230; made it purely for learning purposes, but it is kinda cool, I guess.<\/p>\n<p>It is a windows port of Unix program <a href=\"http:\/\/en.wikipedia.org\/wiki\/Fortune_%28Unix%29\" target=\"_blank\" rel=\"noopener\">Fortune<\/a>.<br \/>\nThe original implementation used files. My version uses SQLite with all the original quotes and fortunes, plus most posts from Evilzone irc quote thread :P<br \/>\n<!--more--><br \/>\nThe usage is simple, just run the program to get a random entry. Output can be controlled with program args:<\/p>\n<pre>EvilFortune.exe [-h] [-l [-n]] [-s [-n]] [-w]\r\n   -h  -- Print this help screen\r\n   -l  -- Use only quotations longer than the length specified with -n,\r\n        or 160 characters if -n is not used\r\n   -s  -- Use only quotations shorter than the length specified with -n,\r\n        or 160 characters if -n is not used\r\n   -n  -- Override the length used by -l and -s to determine\r\n        \"long\" and \"short\" messages (default 160 characters)\r\n   -w  -- Wait for a user input before terminating<\/pre>\n<p>Now be careful limiting number of chars with -n switch. If you give too few or too many, then the program will be stuck in an infinite loop. This is <b>not<\/b> a bug in the code.<br \/>\nBest to just leave -n switch out.<\/p>\n<p>Code: <a href=\"http:\/\/9v.lt\/projects\/C\/EvilFortune\/EvilFortune.cpp\" target=\"_blank\" rel=\"noopener\">EvilFortune.cpp<\/a><br \/>\nCompiled exe (with the SQLite DB, extract somewhere and run in cmd): <a href=\"http:\/\/9v.lt\/projects\/C\/EvilFortune\/EvilFortune.zip\" target=\"_blank\" rel=\"noopener\">EvilFortune.zip<\/a><br \/>\nWhole project (done with Embarcadero RAD studio): <a href=\"http:\/\/9v.lt\/projects\/C\/EvilFortune\/EvilFortuneProject.zip\" target=\"_blank\" rel=\"noopener\">EvilFortuneProject.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Greetings all. This is my latest C++ project&#8230; made it purely for learning purposes, but<\/p>\n","protected":false},"author":2,"featured_media":1645,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,750],"tags":[849,850,851,104],"class_list":["post-1567","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects","category-software-projects","tag-evilfortune","tag-fortune","tag-port","tag-windows"],"_links":{"self":[{"href":"https:\/\/9v.lt\/blog\/wp-json\/wp\/v2\/posts\/1567","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/9v.lt\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/9v.lt\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/9v.lt\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/9v.lt\/blog\/wp-json\/wp\/v2\/comments?post=1567"}],"version-history":[{"count":0,"href":"https:\/\/9v.lt\/blog\/wp-json\/wp\/v2\/posts\/1567\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/9v.lt\/blog\/wp-json\/wp\/v2\/media\/1645"}],"wp:attachment":[{"href":"https:\/\/9v.lt\/blog\/wp-json\/wp\/v2\/media?parent=1567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/9v.lt\/blog\/wp-json\/wp\/v2\/categories?post=1567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/9v.lt\/blog\/wp-json\/wp\/v2\/tags?post=1567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}