[16:50:19] cold_sauce how are those brickhack numbers? [17:58:28] they're all right vishwin_ but the more the better always! [17:58:40] we've been accepting people today [18:00:16] haha yeah saw mine [18:00:28] and that completes my hackathon schedule this semester. [18:01:30] I'm tryna get some more staters to come up, it's the weekend we leave for spring break so people may be more receptive [18:05:34] whooo!! [18:05:40] that would be awesome! [18:05:53] if you know they are going to be coming, let me know their names [18:05:59] I'll get my roommate to accept them too [18:06:16] we're pretty much only accepting people we are pretty sure will come [18:06:48] also if any of you got rejected (waitlist probably) and are going to come for sure, let me know and we will accept you [18:56:48] if your social security number was your age, how old would you be? [18:59:12] @iangcarroll, why cant you just use the requestarray? [18:59:23] wot [18:59:55] for your php thing? [19:00:09] why cant you just shuffle the array, and not have two arrays [19:00:35] the `shuffle` function in PHP uses a questionable source of entropy [19:00:53] the use of PHP is questionable :P [19:00:55] jk [19:00:57] fite me [19:00:59] use PHP if you want [19:01:14] not something you could exploit as a candidate, but not a bad idea to fix (imo) [19:01:16] it's not awful [19:01:59] is there a decent random number gen? [19:02:10] yes, which is what I used :p [19:02:16] if so, just use fischer yates [19:02:18] PHP 7 ships with a CSPRNG [19:02:27] then use fisher yates [19:02:56] that appears to be what I've done [19:02:57] need int i,j obj item, and array items [19:03:10] is pasties still the latest code? [19:03:15] no [19:03:42] https://github.com/wearehx/voting/blob/iangcarroll-patch-2/app/Http/Controllers/VoteController.php#L67 [19:03:43] Title: voting/VoteController.php at iangcarroll-patch-2 · wearehx/voting · GitHub [19:10:39] heh, the php doc page mentions shuffling cards as a use case for random_int [19:10:46] guess they accept shuffle() is not fully random [19:12:03] okay, i added a comment https://github.com/wearehx/voting/commit/df6fd1192a847e3376b5d735d6ecdcac54d86de8 [19:12:04] Title: Shuffle candidates with a CSPRNG and other minor improvements. · wearehx/voting@df6fd11 · GitHub [19:12:58] er [19:13:05] why is a seed being passed to random_int? [19:13:13] it takes min and max values, not a seed [19:14:21] rip, you can delete that line, and you dont need to pass it in the function [19:15:19] updated the code in the comment [19:16:21] well [19:16:37] idk why $j is random_int(0, $i) [19:16:49] oh, no, I do [19:17:35] but idk why `$items[$i] = $items[$j];` is there [19:18:25] this looks like the same thing as my function though [19:18:33] except for passing by reference, which is a better idea [19:18:50] this is proper fisher yates, unbiased [19:19:00] you swap the items in the arrays [19:20:31] ah, I think I'm doing the same thing but with a $result array [19:20:43] yeah, yours will take more memory [19:21:03] 10kb and 10.1kb are the same thing here :p [19:21:05] also, mine should also be a bit quicker, [19:21:10] =P [19:23:43] sorry, i just prefer my version because I know it's unbiased [19:24:01] It's your code, though. Do what ever you think is best [19:24:19] i'm adding it atm [19:24:24] <3 [19:24:27] i like the passing by reference more than anything :p [19:24:32] ;) [19:24:44] swapping two elements in array does not have a function... that's annoying [19:24:57] you could write one... [19:25:06] well... does php have generic types? [19:25:26] not sure what that is [19:25:59] in C# you can use type "T" which just sets the type of the object to what ever the type of the parameter is [19:26:34] i guess, technically you dont need to know what type it is, anyway [19:29:04] is it templates or type erasure at runtime tho? [19:29:45] like java generics discards types when it compiles to jvm bytecode, re generics, so L"java/util/ArrayList" -> L"java/util/ArrayList" [19:30:39] vs c++ which instantiates it so you have __CXA_MANGLE(std::vector::size) for each T, etc etc [19:32:02] i dont know. I try not to disassembly anything, ever [19:32:26] SamCKelemen: your implementation won't randomize $candidates[0], would it? [19:32:38] it's less asm than compiler intermediate representation [19:32:39] s/would/wouldn't [19:32:39] iangcarroll probably meant: SamCKelemen: your implementation won't randomize $candidates[0], wouldn't it? [19:32:55] since vector::size() can be folded if the allocators are the same, for example [19:32:57] s/$candidates[0], wouldn't it?/$candidates[0] [19:32:57] iit shouldnt [19:32:57] iangcarroll: No previous message to operate on. [19:33:07] so the first candidate is always first?? [19:33:13] this seems flawed :p [19:33:20] hold on let me look at it [19:33:28] as in, &std::vector::size may ==&std::vector::size when A1==A2 [19:33:37] because $i > 0 will never let it hit 0 [19:35:08] well, it seems to randomize everything [19:35:13] though I have no idea why [19:35:20] lol it shouldnt [19:36:55] the first candidate is not always first, we first swap i and j [19:41:19] committed to the branch [19:41:23] <3 [19:41:24] https://github.com/wearehx/voting/blob/iangcarroll-patch-2/app/Http/Controllers/VoteController.php#L69 [19:41:24] Title: voting/VoteController.php at iangcarroll-patch-2 · wearehx/voting · GitHub [19:43:26] looks good iangcarroll [19:45:23] although, technically, its a "shuffled" array, and not a 'randomized' array [19:45:52] they were shuffled randomly, no? [19:46:08] hopefully [19:46:20] but random repeats values, and shuffling doesnt [19:46:21] thanks for the confidence [19:46:31] i guess [19:46:36] they're randomly distributed [19:46:46] can only randomize the candidates we have [19:46:48] i was refering to apple. their shuffle isnt random, [19:47:05] ah [19:47:10] they repeat songs more often, so it *seems* more random [19:47:38] but yeah, if you look at fisher yates analysis, its one of the least biased shuffles. [19:48:34] shuffling and sorting are my favorite. [19:51:01] why bother with random when you can do entropy-adjusted random and do repeated U(1,n) over progressively smaller subsets to make it feel more uniform? [19:51:31] what? [19:51:49] lolol [19:52:47] uniformly random? [19:53:27] are we talking about apple, or shuffling algorithms? [19:53:39] why not any of the above [19:53:45] in unspecified context [19:54:04] if you shuffle sub arrays, it's completely biased. [20:08:41] Kasich is in 2nd for Republicans | Hill-rod is in 2nd for Democrats [20:12:57] *** Joins: vishwin60 (~clc-mac@wikimedia/O) [21:42:51] spam inbound [21:42:53] !admin plugin list [21:42:54] woodruffw: Available plugins: ArtistInfo, BTC, Beedogs, BOFHExcuses, BookInfo, BotInfo, BotAdmin, Catch22, CBSG, ChannelAdmin, ChannelModerator, Cleverbot, Clickbait, CommandHelp, CodeEval, CSTopics, CTCPVersion, CustomTriggers, CuteFaces, Dinner, DuckDuckGoSearch, ExchangeRates, FlipText, Fortune, Genres, GitHubInfo, Giphy, GoogleSearch, HAL, Hastebin, IBIP, IsItUp, IPInfo, Jerkcity, LastSeen, LeetSpeak, LennartQuotes, LinkTitling, LinusQuotes, ... [21:42:54] ... LTC, LutherInsults, Magic8Ball, MerriamWebster, MorseCode, NowPlaying, OMDB, PhoneInfo, Ping, RainbowText, RegexReplace, Reminders, RMSQuotes, Rot13, ShakespeareanInsults, Slap, StockQuotes, TacoRecipes, TheoQuotes, TinyURL, UserIntros, UserQuotes, UserMail, UserPoints, UrbanDictionary, Weather, Wikipedia, WolframAlpha, WorldPopulation, XKCDComics, YouTubeSearch, Zalgo [23:01:09] !Zalgo [23:01:16] . [23:01:26] !help zalgo [23:01:26] m0shbear: !zalgo - Summon Zalgo with the given text. [23:01:37] !zalgo ____ [23:01:37] m0shbear: _҉_̕_̷͠_̛͟_