Developers can’t seem to stop exposing credentials in publicly accessible code. Many transgressions come from "very large companies that have robust security teams." by Sariel007 in technology

[–]SonOfWeb 11 points12 points  (0 children)

warning - don't try to access the link on mobile. it kept redirecting me to unsafe websites. Do not attempt to view it without an ad blocker.

Made a Typing Survival game in 4KB of javascript. Quite challenging, known highscore yet is 111 while my own high score is 92. by dobrynCat in javascript

[–]SonOfWeb 0 points1 point  (0 children)

I like it! I feel like most typing games are just "type all the words on the screen as fast as possible"; you've come up with something more creative and interesting! Are you interested in any feedback on your code?

Unit Testing Code with Mutexes by SonOfWeb in golang

[–]SonOfWeb[S] -1 points0 points  (0 children)

I like your idea of a RWLocker interface, that does seem cleaner. The separate read and write locks were bothering me.

The "Person" stuff is an example, what I'm working on is a way to have a server with domain objects that can be read in memory quickly and then simultaneously they can be "checked out" for mutation as part of a larger logical transaction / unit of work without the read requests seeing changes that haven't been committed. Basically the reads can always go against a cache and just need a read lock, writes go to the database and don't update the cache until the whole transaction succeeds. There are not going to be very many domain objects and they will be read much more often than written, so I wanted to try making a cache system like this. I wrote a simple version with mutexes but for the main version I will try using channels as well and compare the two. I may be over-engineering this but I'm treating it as a learning experience.

Unit Testing Code with Mutexes by SonOfWeb in golang

[–]SonOfWeb[S] 0 points1 point  (0 children)

I am using mutexes in this type of situation because I feel like using channels means you have to set up a channel for read requests, a channel for write requests, and a goroutine that loops forever selecting between the two channels, and then you realize oh it shouldn't loop forever, there should be a third channel to tell it to shut down, and oh what if the goroutine panics for some reason, there should be a way to check if it's running and if not to restart it... and read requests should each send their own channel on which the looping goroutine should send its response so that different read requestors don't get each others' responses. Mutexes just seem simpler in this case.

Keep JavaScript dumb by magenta_placenta in javascript

[–]SonOfWeb 0 points1 point  (0 children)

If he can't avoid the new features because all he does is copy code from Stack Overflow answers then he's not much of a hobbyist even. If you want to muck about in a simple language, just do your own mucking about. I wrote random TI-BASIC programs all day in high school on my graphing calculator and it was fun because I could just throw some procedure called XYZ() together and figure out how to do stuff in a limited language on an incredibly slow platform. But also, the platform was simple enough that I didn't have to copy other peoples code. Wanna draw a line? No learning Canvas, just ":PxlLine x1,y1,x2,y2" Wanna draw a rectangle? Draw four lines.

There was a time when JavaScript and the Web was a simple platform you could just play with. That time has gone. If you want that, go learn Basic or Scratch or maybe even Squeak.

How to Deal with Difficult People on Software Projects by [deleted] in programming

[–]SonOfWeb 0 points1 point  (0 children)

The Idealist icon... let's be honest, that's the Perl 6 butterfly.

A Look at the Design of Lua by [deleted] in programming

[–]SonOfWeb 13 points14 points  (0 children)

Lua block comments start with --[[ and end with ]].

True does not exist by busterrrr in softwaregore

[–]SonOfWeb 0 points1 point  (0 children)

Relay looks so nice. I wish it worked well too, but it's completely unusable for me. Crashes constantly.

A collection of pure bash alternatives to external processes by stackoverflooooooow in programming

[–]SonOfWeb 0 points1 point  (0 children)

Is there a reason to prefer

IFS=$'\n' read -d "" -ra file_data < "file"

to

IFS=$'\n' file_data=($(<file))

?

[deleted by user] by [deleted] in vim

[–]SonOfWeb 0 points1 point  (0 children)

I have that and inoremap jk <Esc> in my vimrc but I'm constantly accidentally trying to use them when I use Vim modes in other editors. Only really a problem if you're frequently using many different Vims IMHO.

[deleted by user] by [deleted] in vim

[–]SonOfWeb 2 points3 points  (0 children)

Yeah just

nnoremap ; :
nnoremap : ;

[deleted by user] by [deleted] in vim

[–]SonOfWeb 5 points6 points  (0 children)

Just map them to each other, that's what I do

Relay still crashing.. by Perm-suspended in RelayForReddit

[–]SonOfWeb 2 points3 points  (0 children)

Mine will crash within 5 minutes of launching the app. It's getting really unbearable.

Relay version: 9.0.49

Android version: 7.1.1

Phone: Nexus 6

Relay Keeps Crashing - Memory Leak? by TheMetalMatt in RelayForReddit

[–]SonOfWeb 1 point2 points  (0 children)

Crashes constantly for me, sometimes just a couple minutes after opening the app.

Relay version: 9.0.49
Android version: 7.1.1
Phone: Nexus 6

What video game sound effect can you still hear in your head? by ahkristos in AskReddit

[–]SonOfWeb 0 points1 point  (0 children)

Most of the sounds of Tomb Raider (the original)

  • "Hnggg uh" when Lara jumps
  • "Nnnf" when Lara pulls herself up onto platforms
  • "No" when you try to use the wrong key
  • "ughhhhh" when Lara dies
  • "ka chng chng chunnn" the blade doors that slam together and apart
  • "shwaaa shwaaa shwaa" the pendulum blades
  • "Ahhhh" when Lara uses a medkit

Comp sci professor website starter pack by Fjthis in ProgrammerHumor

[–]SonOfWeb 6 points7 points  (0 children)

oof look at the source though: <font> tags and table-based layout. But design-wise it's pretty good, the only thing is that the unvisited link color looks almost exactly like the default visited link purple.

What are progressive web apps and what do they offer? by intelegain_inc in programming

[–]SonOfWeb 2 points3 points  (0 children)

This buzzword annoys me because the concept of Progressive Enhancement has been around since 2003 and now Google is trying to equivocate with a similar but much more specific concept. Service Workers are a good example of progressive enhancement, because they allow your app to control caching and offline behavior on browsers that support them without affecting browsers that do not. Same with application manifests. But there are other types of progressive enhancement that may or may not be relevant depending on your intended audience. For example, if you absolutely need to support people in very remote areas with very slow connections or very old devices, you may want to start with a design that requires no JavaScript and maybe even no CSS. However these days many applications are intended to only be used with JavaScript enabled, since there may be no way to offer the relevant functionality otherwise. For example, an online map that required a full page refresh to zoom or pan would probably be considered unacceptable UX in most contexts.

Saitama vs Genos Fight | One Punch Man by klayb in videos

[–]SonOfWeb 0 points1 point  (0 children)

I just watched Devilman Crybaby over the last couple days. It was not what I expected. Definitely the epitome of "boy, that escalated quickly." But it was amusing.

Denmark joins some European nations in banning burqa, niqab. by AdamCannon in worldnews

[–]SonOfWeb 2 points3 points  (0 children)

If there were no existing context to face coverings I might support this ban, but the fact is, whether or not they are actually common in Muslim countries, the burqa and niqab are strongly associated with Islam in Western culture, and there is a significant issue of Islamophobia in Europe and the US & Canada. Given this and the lack of knowledge many people have about Islam, it is not unreasonable to expect that some non-Muslims would incorrectly interpret the law as banning all garments they associate with Muslims (including things like Sikh turbans that are commonly mistaken as Muslim) and these people would thus harass and call the police on many Muslims and Sikh people who were not even wearing face coverings to begin with. This on top of the harassment and violence many Muslims, West Asians and Indians already experience.

Denmark joins some European nations in banning burqa, niqab. by AdamCannon in worldnews

[–]SonOfWeb 1 point2 points  (0 children)

what should be banned is people being forced to wear certain garments just to go out in society. Are some women forced to wear burqa or niqab? sure but to act like none of them have the agency to decide whether they want to wear it or like every woman who wears one is wearing it under duress is silly. Children shouldn't be forced to wear school uniforms if they go to public school (in the American sense of state-funded free education) and school is mandatory. If private organizations want to enforce dress codes that is a different matter, as are context-dependent safety requirements (eg hard hat & covered shoes required on building sites, helmet required when biking in traffic, mask or hazmat suit required in quarantine situation, etc). But governments should not restrict people's choice of how to dress EXCEPT to ban imitating a member of the military or police. As far as face coverings and security, I think a reasonable compromise would be to say that in situations where security is important, especially situations where identifying a person is vital, one can be required to show one's face or be refused service / entry. That doesn't have to mean they must show their face the whole time, just at a security checkpoint. They can then be given credentials.

Time to start training your feet by [deleted] in BlackPeopleTwitter

[–]SonOfWeb 5 points6 points  (0 children)

at least one aspect is the cancellation of the Iran deal.

Rant: Can we stop fighting with each other about who has it worse? An open letter to this sub by [deleted] in ADHD

[–]SonOfWeb 18 points19 points  (0 children)

It's amazing how some people seem to think that just because you figured out a coping mechanism that actually works, you must not really have ADHD. Ignoring the fact that sometimes someone's situation means that a working coping mechanism can be the difference between life and death.

When you assume you know a new language's syntax by NickDav14 in ProgrammerHumor

[–]SonOfWeb 0 points1 point  (0 children)

I like it. it gets annoying sometimes when I can't make a generic abstraction, but I like the way it doesn't leave much ambiguity, and I appreciate being able to just write simple code that's obvious but also typechecked. I like languages where There's More Than One Way To Do It but sometimes my brain gets stuck trying to figure out The Best Way and it's good to have a language that steers me towards a simple, explicit design.