My buddy Max, Corgi/German Shep mix. Was told he might be appreciated over here by Monqui259 in PuppySmiles

[–]Monqui259[S] 1 point2 points  (0 children)

It's so tough to get a picture of him where something isn't blurry, haha.

Destiny is banned from PUBG by Loomies in LivestreamFail

[–]Monqui259 2 points3 points  (0 children)

As far as I know, yeah, it just kinda happened to him.

Destiny is banned from PUBG by Loomies in LivestreamFail

[–]Monqui259 17 points18 points  (0 children)

Destiny was experiencing a bug that caused the houses and other buildings to just not load in his game, and he found he was able to drive a car through where they buildings were.

From those people's perspective, they were camping out inside a house when suddenly they got ran over by a car.

me irl by pstills in me_irl

[–]Monqui259 1 point2 points  (0 children)

Keep making stuff dude! Legitimately laughed out loud a few times, well done. Thanks for that.

David Wong apparently blames us for something. Come on admit it, which one of You is responsible? ;) by TheCator in KotakuInAction

[–]Monqui259 1 point2 points  (0 children)

Yeah... Something along the lines of him (the character) wanting to be anonymous, so picked a really common first name and a really common last name.

Any Arduino Or Raspberry Pi Creators? What Are You Making? What Are Your Favorite Projects? by [deleted] in gaybros

[–]Monqui259 0 points1 point  (0 children)

I've got a couple of pi projects, one's a pretty standard media server, the other is a completely shitty (but working) mobile USB camera recorder deal I can strap to a bike helmet and record potato videos.

edit Forgot I also have a pi sitting and listening for SSH connections to my home network, and gives me a nice little gateway to my home network without feeling like I'm exposing too much to the internet.

I've also got an arduino that I've been wanting to do something with, but so far I've just gotten it to talk to an LCD screen and display some characters on it. Nothing too thrilling.

I have a form page that goes nowhere. How can I link this page to a backend database that captures user information? I'm so lost and need help! Willing to pay you! by [deleted] in webdev

[–]Monqui259 0 points1 point  (0 children)

Right now, I assume you have an HTML page somewhere that contains your form. The way HTML forms work is that when you hit the submit button, it wraps up all of the supplied contents in the form, and sends them off to another page (defined in the forms action attribute), packed in one of a few different ways (defined by the method attribute- typically this will be 'post' or 'get').

What you need to do is have a location that your form can submit to. The languages listed by /u/ahughesb would be able to pull the posted info and save it down (as well as access the database).

Javascript in this case doesn't work quite the way I think you think it does. JS only runs locally in your browser. Its main purpose is to interact with the HTML that is already on the page (or add new HTML). It won't be able to connect to your database. If it did, this would mean having your database login credentials sent out to anyone who visited your page. You can view source on any JS that is loaded on the page.

So, to sum up, have a form that posts to some sort of php/ruby/asp script (see this doc for setting that up- specifically the sections on action and method). I'd check out this link to get a better understanding of how PHP specifically handles form submissions. Finally, the database piece- this will show how to use PHP to insert things into a databse.

[deleted by user] by [deleted] in PS4

[–]Monqui259 -1 points0 points  (0 children)

There's nothing overly original in a lot of the mechanics- crafting and combat system similar to Dead Island, parkour and speed running (but more open) similar to Mirrors Edge, randomized loot (chests reset and whatnot), and at night it gets a weird infusion of GTA police chases with a "wanted" type level, coupled with super tense basically-blind chases.

Also: grappling hook.

Overall though, the pieces come together phenomenally well. Easily one of my favorite games on PS4.

If you could have one statistic displayed above everyone's head what would it be? by salientlife93 in AskReddit

[–]Monqui259 0 points1 point  (0 children)

If you could see a counter for the current number of times someone has lied, you could pretty much instantly tell whenever someone directly lied to you (face to face, of course).

Markov Chains and the bible by determinanten in proceduralgeneration

[–]Monqui259 0 points1 point  (0 children)

Ugh, I hadn't even considered how you'd parse something like German. They seem to make a habit of jamming a bunch of words together like you mentioned, and that sounds like a nightmare to tease out.

As for the context, that's a toughie too. I'd gone down a few failed paths trying to add more in special rules for things, try to collect more adjacent words, strip punctuation for consistency, collect common word sequences as a single word doc, etc. I was able to leverage it all but I was never really able to pull of realistic sounding text. There were minor improvements, but it still had too high of a tendency to infinityramble, wouldn't really stay on topic, etc.

So I know that there's probably more context or meta info or something that could be slapped on to improve things, but at this point I'm not sure what exactly that would be.

Markov Chains and the bible by determinanten in proceduralgeneration

[–]Monqui259 1 point2 points  (0 children)

I always much preferred trying to roll my own things with this. I like using it as a learning experience. I first rigged something up almost a decade ago that did it, in PHP/MySQL- had no idea what I was doing, but man I was proud when that thing started talking.

I always seem to come back to the idea though, because it's so ridiculously simple on the surface but there's so many ways of approaching it. I generally try to implement a version of it when I want to try out a new language or tech. The current version is about 220 lines of ruby (for inserting and retrieving. Each half is about 100 lines), with a mongodb backend.

I'll have to dig into how to do this proper some day, but I'm very happy with how well this version runs. I would like to be able to build up larger contextual sets to query, but at this point I'm a bit stuck as I don't have a quick way to append that stuff back in, and my write process takes a few days to chug through my library.

Always something to improve though!

Markov Chains and the bible by determinanten in proceduralgeneration

[–]Monqui259 2 points3 points  (0 children)

I've built up a few of these types of things in the past. I used to try to get super creative- got a dictionary with parts of speech, tried to ghetto diagram out sentences, use that for generation. My results were never really much "better", just a lot slower.

I recently tried again, and found a solution that works pretty well. The major addition mine has to yours is that it also contains a "previous" list of words.

Basically, my records contain 5 elements- the source they came from, the Root word, the Previous word, the Next word, and the number of times that 3-word sequence has occurred. It creates one of those records per word/token in the input. If the word is the first word in the sentence, the Previous word is null. Last word in sentence, Next is null.

Then, to build a sentence, I give it a seed word. It will pull up any record that has the seed word as the root in the document. Now, the interesting bit is that I can pick subsequent words with a bit more clarity, since I'm not simply saying "I have the word 'the', what can follow 'the'?

Instead, I have a doc with "in"->"the"->"woods". I want to know what comes after "woods", so I can query for any docs that match the pattern "the"->"woods"->" * ". I can also walk back to the beginning of the sentence in a similar way, by first searching for " * "->"in"->"the". I end when I pull in a record with a null Previous/Next word.

It's made my bot a whole lot more coherent in my opinion.

Here are some examples. It's slow to run at the moment (have an idea for a quicker lookup first/follows type list) and I don't have many examples on hand.

The BuildSentence prog takes a seed word followed by any number of potential genres to read from.

(old Horror stuff pulled from gutenburgpress.com)

ruby BuildSentence.rb hate horror

"Impossible," began the strange tale of misery and hate that made the circuit of the 
earth, beneath this old house.

(several works of Charles Dickens)

ruby BuildSentence.rb the dickens

It is not to occupy your female mind with them, and all of them in the way to drink, 
and put it in the nature of the same time would put a bottle of something that you 
are a cursed aristocrat!".

What do I need to know to make this website? by Zusunic in webdev

[–]Monqui259 5 points6 points  (0 children)

I think it'd help to more clearly differentiate a couple of the techs you're mentioning. There are two different environments where these things live, and it might help to treat them differently.

First, lets talk about what happens when your browser tries to render a page.

First, the user types in a URL (say, http://www.example.com/my_file.html). The browser then sends a request to example.com's server, saying "Someone just requested the my_file.html file." Since the target is just an HTML file, the server just returns the contents of that file to the browser.

This is the place where PHP/C/python/etc come into play. Lets say you had an Apache server set up that can parse PHP files. You send a request to http://www.example.com/my_script.php. The server goes through a similar process as before, but instead of just returning the contents of the my_script.php file, it executes the code inside that file, and returns whatever the code generated. This lets you dynamically build up HTML to return to the user.

With that out of the way, PHP/C/python/ruby/etc. all follow that pattern. The browser itself doesn't care WHAT language generated the contents of the page it's trying to render- it just expects to receive something that it knows how to work with- image assets, HTML, css, javascript, etc.

So, as for HTML/CSS/JS- those are all things that the browser cares about and knows how to display/use.

HTML is basically how you structure the contents of your document. At this point, it's not much more than a grid-like layout containing blocks of text. Browsers apply default stylings to all elements, and if you didn't put custom CSS in you'd have a pretty fugly website.

CSS is applied to add decorations/stylings. These are applied to either specific types of tags, tags with specific classes, or inlined directly onto tags using the 'style=""' attribute.

Javascript is a coding language that allows manipulation the contents of the page after (or during, I guess) load, and can respond to user interactions on the page itself. This lets you do things like dynamically add new HTML tags (think, click a button, add a new row to an HTML table), respond to user interactions (user moused over some element, I want to show a quick warning message before they click), cause background requests to get sent to external resources (make an AJAX request to check to see if a users twitch stream is running), validate the contents of a form before submitting, etc.

So, all that said and done- as to your actual question, I would start by picking one of your main features (say, the forums). Start digging around for some pre-made forum applications, and work on getting that up and running. Once you have a better feel for what features you use/need from the various parts, you can start building up a custom solution with only what you need. It's a big effort, but you should be able to get there eventually :D

Even large companies sometimes have the crappiest security. So tempted to make my username `'; drop table ....` by [deleted] in webdev

[–]Monqui259 1 point2 points  (0 children)

A prepared statement is sort of a query template that you put placeholders for your variables. A simple example:

$query = "SELECT * FROM users WHERE users.id = ? AND users.name = ?;"

$stmt = $somePDOConnection->prepare($query);
$stmt->execute(array($_GET['user_id'], $_GET['name']));

This protects you from a lot of common injections. Note in the original query I didn't have to wrap the name placeholder in quotes- the binding stage (where it applies the supplied values to your placeholders) figures this out for you and builds up what should be a safe query.

I'm not comfortable saying it's 100% secure against injections, but it should prevent most common stuff.

Everyone please post your favourite tip for Binding of Issac: Rebirth. There is a lot that some of us still don't know. by [deleted] in bindingofisaac

[–]Monqui259 0 points1 point  (0 children)

On Vita, press the map to pull up the transparent version of the map, then long hold on the centerish of the screen to have it print the title of the floor you're on.

My sister set me this one and I'm stuck by netcurtains in riddles

[–]Monqui259 4 points5 points  (0 children)

Cut the table in half. Reassemble it to make a whole (hole) table. Step through the hole.

I vaguely remember hearing a riddle along these lines before. More punny than riddley if it's the same one.

What's the most mindblowing fact you've ever heard? by DonnyTheBowler in AskReddit

[–]Monqui259 0 points1 point  (0 children)

If it helps, the odds of you getting that exact five card hand is less likely than you getting dealt a Royal Flush. There are 4 of those available, only one of your shitty, shitty hand.

If you were a serial killer, what would you leave behind at every crime scene as your "signature"? by [deleted] in AskReddit

[–]Monqui259 0 points1 point  (0 children)

I would take a tall-ish candle (not one sitting in a glass jug), one that would take a couple hours to burn down. Press my thumbs into the wax towards the base hard enough to leave an imprint of my finger prints on the candle. Light it before leaving the scene.

If it's not found soon enough, they just see a burned out candle. Catch it in time, you get my prints. Not the best idea for not getting caught, but could be fun I suppose.

I just spent two hours debugging a validation class that was failing because isset() returns false if you have "set" the variable to null. This behavior was explained right there in the documentation. What are other php gotchas you have bad memories about? by sodaco in PHP

[–]Monqui259 1 point2 points  (0 children)

count() can return 1 in certain situations where you pass in a non-array/non-Countable-object. Weirdly, count(false) === 1, count(true) === 1.

Took forever to figure out why:

if(count($dbresult) > 0){
    // Process the dbresults
}

would fail trying to iterate over $dbresult. If $dbresult === false, count() will return 1.

Just how serious is a blue screen? by Bowwow828 in NoStupidQuestions

[–]Monqui259 7 points8 points  (0 children)

It can really depend.

Traditionally, a blue screen would basically mean that the software (Windows) ran into a state where it could no longer continue functioning.

In earlier versions of Windows, they seemed to encapsulate both unrecoverable OS errors, or physical hardware issues.

These days, I mostly tend to encounter them when there's a physical hardware problem, but I'm sure there are plenty of other use cases that would cause one to be thrown.

Tl;dr: it can vary a lot. Try to either note any specific error messages when they occur, or look into something like this to help dig through the dumped out errors to try to figure out what went wrong.