|
ive built a random starwars name generator, but the problem is text looks a bit boring. would like to spice this up by making generating a procedurally generated face to go along with the name. does anyone have a guide on making simple 2d procgen faces? is it just a matter of having separate methods for drawing parts of the face and then randomizing certain elements to it? any help would be great.
|
# ? Jul 6, 2016 22:42 |
|
|
# ? May 31, 2024 08:03 |
|
Strong Sauce posted:ive built a random starwars name generator, but the problem is text looks a bit boring. would like to spice this up by making generating a procedurally generated face to go along with the name. comedy answer: Chernoff Faces
|
# ? Jul 6, 2016 22:44 |
|
Not really programming specifically, but I can't find a more relevant thread. Say I film a real-life scene with both a 30fps camera and a 60fps camera. So I have two very similar uncompressed video files, but one has exactly twice as many frames. Now I encode them both to MPEG or whatever with the exact same settings. Will the 60fps file be almost exactly twice as big as the 30fps file? Or will it be less than twice as big, because there is less information contained in the way the image changes over 1/60 of a second, than in the way it changes over 1/30 of a second? If that makes sense.
|
# ? Jul 7, 2016 01:58 |
|
Winty posted:Will the 60fps file be almost exactly twice as big as the 30fps file? I'm not an expert on these matters, but no, it won't be, because the full frames aren't encoded raw into the file -- as you surmised, the file is compressed so that it doesn't need to store everything. If you were to download the raw form of one of those 24-hour-long YouTube "videos" that's just a blank screen with the Enterprise engine noise on repeat, you'd get a single frame of video and the audio track and that's it.
|
# ? Jul 7, 2016 02:14 |
|
TooMuchAbstraction posted:I'm not an expert on these matters, but no, it won't be, because the full frames aren't encoded raw into the file -- as you surmised, the file is compressed so that it doesn't need to store everything. If you were to download the raw form of one of those 24-hour-long YouTube "videos" that's just a blank screen with the Enterprise engine noise on repeat, you'd get a single frame of video and the audio track and that's it. Not quite, it won't just be 1 single frame, (also not an expert) most modern video encoding uses a combination of keyframes (which effectively perfectly represents a frame, compressed) and b-frames (which contain delta information from the last keyframe). This is why you'll sometimes see video go all strange, and keep getting worse, until it snaps back to being perfect. Keyframe intervals can vary based on your encoding settings, so for your 24 hour example, it's likely there will be keyframes every few seconds.
|
# ? Jul 7, 2016 02:28 |
|
TooMuchAbstraction posted:I'm not an expert on these matters, but no, it won't be, because the full frames aren't encoded raw into the file -- as you surmised, the file is compressed so that it doesn't need to store everything. If you were to download the raw form of one of those 24-hour-long YouTube "videos" that's just a blank screen with the Enterprise engine noise on repeat, you'd get a single frame of video and the audio track and that's it. Edit: Oops, beaten by like 15 minutes. Skandranon posted:most modern video encoding uses a combination of keyframes (which effectively perfectly represents a frame, compressed) and b-frames (which contain delta information from the last keyframe) mystes fucked around with this message at 03:09 on Jul 7, 2016 |
# ? Jul 7, 2016 02:43 |
|
It doesn't help with the static image case, but h264's Recovery Point SEI makes it possible to produce streams which can be seeked in without having any keyframes. Instead there's non-keyframe points that you can seek to and start decoding from, and after X frames (where X is a value recorded in the stream) the image will have converged to the correct one and no more frames will reference things from before the recovery point.
|
# ? Jul 7, 2016 05:40 |
|
here's a dumb git question: when I commit from my vps, the commits are listed as being from the username (root) instead of being under my GitHub username I tried using git config --global user.name "timothyjimothy" and git config --global user.email $my_email_address but it still commits as root. any ideas why? EDIT: I was able to user my GitHub credentials by using git config --global --unset-all user.name and git config --global --unset-all user.email, then my test commit worked, so hopefully it stays that way FAT32 SHAMER fucked around with this message at 08:15 on Jul 7, 2016 |
# ? Jul 7, 2016 08:01 |
Why are you working as root
|
|
# ? Jul 7, 2016 08:58 |
|
nielsm posted:Why are you working as root its what ovh sent me when i got my cheapo vps from them and I have very little idea what i'm doing other than ssh'ing into it and hosting a script from it in fact it's the only way they really tell you how to log into your vps: https://www.ovh.com/us/g1260.how_to_log_in_to_your_vps FAT32 SHAMER fucked around with this message at 09:41 on Jul 7, 2016 |
# ? Jul 7, 2016 09:38 |
|
git config --global will put the configuration in ~/.gitconfig for whatever user you're logged in as at the time. That means /root/.gitconfig if you do that command while you're the root user. For non-root users, it'll be in /home/username/.gitconfig (on Linux) or /Users/username/.gitconfig (on OS X) or in some crazy location (on Windows). The configuration does not follow the repository, it does not affect commits made on remote machines, commits made while logged in as another user, etc.
|
# ? Jul 8, 2016 02:21 |
|
This is not worth its own thread but is involved, my coding skill level is basically zero, but my overall computer knowledge is fairly ok. I've managed to bang together a website, I self host a wordpress site, I run mybb forums, doku wiki, and soon rocket chat on this site. Right now I have wordpress doing my auth for the site. I have mybbsync plugin inside wordpress so when you go to login on mybb wordpress pushes the info into the mybb sqldb. question is how do I make it so they just sign into the website and click on the forums and have them auto login? This can also be asked of dokuwiki I have the wordpress auth plug for dokuwiki, I would like a SSO just don't know how to go about that. pretty sure I am making no sense at 3am but i am stumped.
|
# ? Jul 8, 2016 07:54 |
|
wargames posted:This is not worth its own thread but is involved, my coding skill level is basically zero, but my overall computer knowledge is fairly ok. I've managed to bang together a website, I self host a wordpress site, I run mybb forums, doku wiki, and soon rocket chat on this site. Right now I have wordpress doing my auth for the site. I have mybbsync plugin inside wordpress so when you go to login on mybb wordpress pushes the info into the mybb sqldb. question is how do I make it so they just sign into the website and click on the forums and have them auto login? This can also be asked of dokuwiki I have the wordpress auth plug for dokuwiki, I would like a SSO just don't know how to go about that. pretty sure I am making no sense at 3am but i am stumped. Ideally, if the sites only store a session ID in their cookies, and have some sort of session database is just a simple mapping of session ID to user ID, then you would just need to change the functions that check the session and that get the username to use the equivalent from wordpress. This way there wouldn't even be a separate login process. Being logged into wordpress would mean being logged into the other software as well. However, there are going to be lots of annoying details in terms of synchronizing user databases (the different programs will probably have their own database schemas for user information, etc., and you might have to translate user numbers if the programs pass them around internally) and it's probably going to be a pain to get everything working perfectly. mystes fucked around with this message at 13:04 on Jul 8, 2016 |
# ? Jul 8, 2016 12:53 |
|
Winty posted:Not really programming specifically, but I can't find a more relevant thread. I'm reading this article right now and it covers some of that stuff https://bengarney.com/2016/06/25/video-conference-part-1-these-things-suck/
|
# ? Jul 8, 2016 13:55 |
|
wargames posted:This is not worth its own thread but is involved, my coding skill level is basically zero, but my overall computer knowledge is fairly ok. I've managed to bang together a website, I self host a wordpress site, I run mybb forums, doku wiki, and soon rocket chat on this site. Right now I have wordpress doing my auth for the site. I have mybbsync plugin inside wordpress so when you go to login on mybb wordpress pushes the info into the mybb sqldb. question is how do I make it so they just sign into the website and click on the forums and have them auto login? This can also be asked of dokuwiki I have the wordpress auth plug for dokuwiki, I would like a SSO just don't know how to go about that. pretty sure I am making no sense at 3am but i am stumped. It might be easier in the end to rebuild the entire world around what you want. Namely, find new websites/chat/whatever that already has Google/Facebook/whatever SSO built in. Especially if you are not a coder as you will likely do a terrible job of trying to rewrite the authentication for all those tools.
|
# ? Jul 8, 2016 16:21 |
|
Thought up a better solution, delete the registration button on the forums, if the nerds want to register for the site they can do that on the front page and sign in like the peasants they are because sso seems beyond my talents.
|
# ? Jul 8, 2016 17:06 |
|
What is the easiest way to get the r's, g's, and b's of a region of the screen? Where is the information that each jet uses to decide whether to be on or off stored?
|
# ? Jul 9, 2016 15:26 |
|
Can anyone recommend a book or tutorial on data trees? I'm looking at writing a basic 'Scrabble Word Solver' that will tell you what words you can create with a random input of characters. It looks like the DAWG algorithm is great for this problem but I'm pretty lost as I read about it. Maybe getting a base understanding of data trees will help?
|
# ? Jul 9, 2016 21:21 |
|
Hughmoris posted:Can anyone recommend a book or tutorial on data trees? I'm looking at writing a basic 'Scrabble Word Solver' that will tell you what words you can create with a random input of characters. It looks like the DAWG algorithm is great for this problem but I'm pretty lost as I read about it. Maybe getting a base understanding of data trees will help? Skiena is literally an algorithm cook book, but I can't remember whether it specifically has one for dictionaries.
|
# ? Jul 9, 2016 21:45 |
|
it is posted:What is the easiest way to get the r's, g's, and b's of a region of the screen? What OS? What language? For what purpose? Are you trying to capture part of the desktop, or video, or a running game, or...? quote:Where is the information that each jet uses to decide whether to be on or off stored? Jet? ufarn posted:Maybe Bloom Filter or Trie; those are at least the go-to's for general dictionaries. I can't which one has false positives, but that should be available somewhere. Bloom filters are the ones with the false positives (and also aren't trees or dictionaries; they're a compact way of representing sets).
|
# ? Jul 9, 2016 22:19 |
|
ToxicFrog posted:What OS? What language? For what purpose? Are you trying to capture part of the desktop, or video, or a running game, or...? I'm on Windows, writing it in Perl to use from the command line. Essentially pass the script up to 7 characters, and it will return all the words that can be made from those characters. I really don't have any exposure to trees and am trying to get a basic understanding of them to help write this script.
|
# ? Jul 9, 2016 22:27 |
|
I made a really weird way of solving a scrabble game under a weird environment and I'm wondering if this is a completely nuts approach or if this is a fairly common one with a name? The gist is, I hash every dictionary word with a hash that works in any order (in this case, literally just "word.Aggregate(1, (acc, x) => acc * (int)x)", ie multiply 1 by the int value of every letter in the word, and store them in a map with the key being their hash. There's multiple words that give the same score (ie dog and god) but there's no objectively better one so I just toss them out except the first that gets added; you could use a map with List<string> being the key instead if you wanted. So you give it a word, and it just gets every Combination of the letters, which, unlike permutations, order doesn't matter; so just every unique combination of letters, ie if you pass in "apple" it checks "a", "ap", "apl", ..., "ple", "le", "e". For each of those combinations, it hashes them, and adds whatever is in the hash dict to a "best words" list. At the end, it just grabs the word with the highest score from that small list. Theoretically at this point you could instead, if you store every matching word in the dictionary; check the highest scoring words to see if they fit into an actual board anywhere, but I'm not interested in that. Either way, this approach is nearly instant on a huge word list and I'm wondering if it has a name!
|
# ? Jul 9, 2016 23:11 |
|
Hughmoris posted:I'm on Windows, writing it in Perl to use from the command line. Essentially pass the script up to 7 characters, and it will return all the words that can be made from those characters. I really don't have any exposure to trees and am trying to get a basic understanding of them to help write this script. There are <6000 possible ways to arrange 7 letters into a word. I'm having a hard time thinking of a way you could do this that would not be fast enough for interactive use, so just do whatever seems convenient.
|
# ? Jul 9, 2016 23:39 |
|
Jewel posted:I made a really weird way of solving a scrabble game under a weird environment and I'm wondering if this is a completely nuts approach or if this is a fairly common one with a name? This is a fairly standard approach, though you've made it a fair bit more complicated than it needs to be. Instead of multiplying the letters by ASCII values, just sort the word alphabetically (call => acll) and hash that.
|
# ? Jul 9, 2016 23:52 |
|
Nippashish posted:There are <6000 possible ways to arrange 7 letters into a word. I'm having a hard time thinking of a way you could do this that would not be fast enough for interactive use, so just do whatever seems convenient. 26^7 = 8031810176
|
# ? Jul 9, 2016 23:55 |
|
There could be fewer than 6000 valid Scrabble words.
|
# ? Jul 9, 2016 23:59 |
|
TooMuchAbstraction posted:26^7 = 8031810176 Hughmoris posted:Essentially pass the script up to 7 characters, and it will return all the words that can be made from those characters. The identities of the characters are fixed, so you only need to check permutations of them. 7! + 6! + 5! + 4! + 3! + 2! = 5912, or just under 6000.
|
# ? Jul 10, 2016 00:21 |
|
ultrafilter posted:There could be fewer than 6000 valid Scrabble words. code:
EDIT: quote:The identities of the characters are fixed, so you only need to check permutations of them. 7! + 6! + 5! + 4! + 3! + 2! = 5912, or just under 6000. This however does make more sense. If you're handed a set of 7 letters then there's a much more limited number of ways to arrange them.
|
# ? Jul 10, 2016 00:22 |
|
TooMuchAbstraction posted:26^7 = 8031810176 There's 26^7 possible combinations of letters, but only 7! possible permutations of the 7 specific letters you have on your rack, which is what Nippashish meant. This doesn't take into account shorter words though, which bumps things up by a factor of almost e (funnily enough, it comes out to exactly ⌊7!×e⌋). The two blank tiles increase this even more and duplicate tiles lower it, but the combinatorics escape me at this point. Anyways, worst case search space is somewhere in the millions. EDIT: Nippashish posted:The identities of the characters are fixed, so you only need to check permutations of them. 7! + 6! + 5! + 4! + 3! + 2! = 5912, or just under 6000. The number of 6-permutations of 7 tiles (assuming all tiles are unique) is actually 7!. The Laplace Demon fucked around with this message at 00:33 on Jul 10, 2016 |
# ? Jul 10, 2016 00:28 |
|
The Laplace Demon posted:There's 26^7 possible combinations of letters, but only 7! possible permutations of the 7 specific letters you have on your rack, which is what Nippashish meant. This doesn't take into account shorter words though, which bumps things up by a factor of almost e (funnily enough, it comes out to exactly ⌊7!×e⌋). The two blank tiles increase this even more and duplicate tiles lower it, but the combinatorics escape me at this point. Anyways, worst case search space is somewhere in the millions. It has been a while since I've played scrabble, but aren't you really looking at 8+ tiles? You have use at least one tile already on the board when creating a new word, don't you? So, you probably want an algorithm A to look for words of up to 8 tiles, and then some sort of controller algorithm, B, to loop over all the letters on the board and call A on the set of a player's tiles plus the current board tile. And, of course, you need to account for places where you can use more than one tile on the board.
|
# ? Jul 10, 2016 00:35 |
|
Peristalsis posted:It has been a while since I've played scrabble, but aren't you really looking at 8+ tiles? You have use at least one tile already on the board when creating a new word, don't you? So, you probably want an algorithm A to look for words of up to 8 tiles, and then some sort of controller algorithm, B, to loop over all the letters on the board and call A on the set of a player's tiles plus the current board tile. And, of course, you need to account for places where you can use more than one tile on the board. Yup, all this analysis only applies to the first move. Writing an optimal Scrabble AI is a fun problem. Often, the highest scoring move isn't perpendicular to existing words, but instead is parallel. The word and letter score bonuses add a lot to the game.
|
# ? Jul 10, 2016 00:39 |
|
Jewel posted:The gist is, I hash every dictionary word with a hash that works in any order (in this case, literally just "word.Aggregate(1, (acc, x) => acc * (int)x)", ie multiply 1 by the int value of every letter in the word, and store them in a map with the key being their hash. Well, since the numbers aren't prime, you will get collisions. It will probably work in most cases, but yes, that's a very simple hash function.
|
# ? Jul 10, 2016 00:40 |
|
The Laplace Demon posted:Writing an optimal Scrabble AI is a fun problem. Surely, someone has started a contest for scrabble playing programs to face off. It might be even more fun to write the program that runs the tournament. You'd have to model the board's state, dispense the tiles each turn, etc.
|
# ? Jul 10, 2016 05:33 |
|
The fun part of creating a Scrabble AI isn't efficiently generating the legal moves, it's in creating an AI that plays strategically because just playing the highest scoring move available each turn is not enough to beat even the best human opponents. The approach I used for finding all legal moves for my own Scrabble solver is outlined here, using a DAWG (Directed Acyclic Word Graph) to store the words. There's a faster way to store them called a GADDAG but it's a bit more complex to implement.
|
# ? Jul 10, 2016 09:46 |
|
Is there a programming language that uses =< and => instead of <= and >=?
|
# ? Jul 10, 2016 16:36 |
|
a few DRUNK BONERS posted:Is there a programming language that uses =< and => instead of <= and >=? I don't think so? I think putting the <> part first makes parsing a lot easier.
|
# ? Jul 10, 2016 16:48 |
|
=> is used for things in a few languages as well
|
# ? Jul 10, 2016 22:00 |
|
-> is the "pointer" operator and => is the "big pointer" operator for when you're working with 64 bit types
|
# ? Jul 10, 2016 22:10 |
|
ToxicFrog posted:What OS? What language? For what purpose? Are you trying to capture part of the desktop, or video, or a running game, or...? Windows. I'm trying to make an AI that can press keyboard keys in relation to graphical input. I don't really care about the language, since it mostly involves shuffling arrays around, which isn't hard in any language. I guess I'm just asking how to take like 60 screenshots a second, and it's weird that you can't just snoop on whatever is telling my monitor what colors to show me.
|
# ? Jul 10, 2016 23:13 |
|
|
# ? May 31, 2024 08:03 |
|
a few DRUNK BONERS posted:Is there a programming language that uses =< and => instead of <= and >=? Erlang uses =< and >= I think they're inherited from prolog. (I use neither of these languages so someone's free to tell me how wrong I am.)
|
# ? Jul 10, 2016 23:38 |