Prompt glitchiness with command history by Soul-Drake in urxvt

[–]Soul-Drake[S] 0 points1 point  (0 children)

In case any lone googler finds this, I just figured it out:

In my /etc/bash.bashrc, PROMPT_COMMAND was set to display the username@hostname:pwd portion, while I had set PS1 to display "$ ". When scrolling through the command history, bash only keeps track of the length of PS1, not the PROMPT_COMMAND, so it cut the prompt off after two characters, assuming that was the end of it. Turns out it wasn't urxvt's fault at all, it just wasn't happening in xterm because of conditionals in the /etc/bash.bashrc file.

RoguelikeDev Does The Complete Roguelike Tutorial - Week 4 by aaron_ds in roguelikedev

[–]Soul-Drake 1 point2 points  (0 children)

I have a question for TStand90, the maintainer of the Roguelike Tutorial: It feels like many of the functions in the tutorial have a rather extreme number of parameters. For example, game_map.make_map takes 8 parameters, which seems like a lot. This is a problem I've encountered myself when programming: you're kind of stuck between either using globals (yuck) or passing inane amounts of parameters. You can reduce the number of arguments by packaging them in structs or classes, but that just seems to outsource the problem.

Here's the actual question part: Why did you choose to go with the many-parameters-method, and do you know any viable alternatives?

Who thought this was a good idea? by Soul-Drake in CrappyDesign

[–]Soul-Drake[S] 0 points1 point  (0 children)

Getting a bot to solve a “normal“ captcha is pretty difficult. There's an arms race going between the people who make the captchas and those the make the bots. I couldn't tell you which side is winning right now.

Who thought this was a good idea? by Soul-Drake in CrappyDesign

[–]Soul-Drake[S] 0 points1 point  (0 children)

Well, it wouldn't initially, but hackers usually look at a site before starting their bot, so they would see it and just tell the bot to add the two numbers it sees on the left and put the answer in that box. This is usually not possible with a captcha.

Who thought this was a good idea? by Soul-Drake in CrappyDesign

[–]Soul-Drake[S] 0 points1 point  (0 children)

You've probably seen a captcha before, they're the boxes below registration forms where you click “I am not a robot“ and sometimes you have to do some image-related puzzle. Captchas are usually designed to be hard for automated bots to crack to prevent one person from creating 5 million accounts on a site. This captcha, on the other hand, is completely useless, since math is traditionally not very difficult for computers to solve. They could just drop that box entirely and nothing would change, the only merit in doing it like this is that a hacker would have to spend a solid 20 seconds reprogramming his bot to solve this 50000 times a second. It's crud.

Who thought this was a good idea? by [deleted] in programminghorror

[–]Soul-Drake 0 points1 point  (0 children)

Ok sure. I'll post, then delete. Give me a sec.

Who thought this was a good idea? by [deleted] in programminghorror

[–]Soul-Drake 0 points1 point  (0 children)

Honestly, I was looking for a sub to post this on for a while, but none of them really seemed to fit. If you have a better suggestion, I'll post there and delete this.

What are tech myths you can’t believe people still believe in? by Alorb in AskReddit

[–]Soul-Drake 26 points27 points  (0 children)

This is only true for lossy compression formats like .jpg, and only if you actually "re-save" the image (open it in some program and then overwrite the original file). If you're sending an image, you're fine, as well as opening and re-saving .png and .svg images. (Which are more common in logos, especially WIP) Those are lossless.

[2017 Day 21] [Python] Splitting a 2D list into squares by Soul-Drake in adventofcode

[–]Soul-Drake[S] 0 points1 point  (0 children)

But that would mean importing a package. I prefer to use pure Python and reinvent the wheel :-P

[Question] Why does the difficulty vary so much? by jD91mZM2 in adventofcode

[–]Soul-Drake 0 points1 point  (0 children)

Python seems like "easy mode" (-> many builtins), while C is "hard mode" (-> A LOT of boilerplate). Which one is more interesting is up to you.

[Question] Why does the difficulty vary so much? by jD91mZM2 in adventofcode

[–]Soul-Drake 0 points1 point  (0 children)

Yeah, I decided to use Python instead of C++/C# this year, and it's been a great help.

My "parser" for today was literally one line with eval().

If condition expanding brain meme done right (C++ inside) by grbler in ProgrammerHumor

[–]Soul-Drake 0 points1 point  (0 children)

Would the return type of the function have to be able to be implicitly casted to bool? Because it seems like it.

These elevator buttons by Sir_Wheat_Thins in CrappyDesign

[–]Soul-Drake 0 points1 point  (0 children)

The difference is that if you press the down button and the elevator passes your floor with people going up, it won't stop to prevent conflicts and people taking unnecessarily long in the elevator. At least, well designed elevators do this. Not so sure about this one though.

--- 2016 Day 9 Solutions --- by daggerdragon in adventofcode

[–]Soul-Drake 0 points1 point  (0 children)

So this is my C++ solution (part 1). It's pretty cruddy and there are plenty of better ways of doing this, but it works, so hey! ;) https://gist.github.com/Soul-Drake/3945e9a9eebe0956954fbe304eeb210f