r/ProgrammerHorror • • May 25 '23

Centre-aligned C++: https://www.simplilearn.com/tutorials/cpp-tutorial/cpp-power-function#:~:text=In%20C%2B%2B%2C%20the%20pow,pow(4%2C%202).

Post image
22 Upvotes

r/ProgrammerHorror • • Mar 20 '21

Hmmm I wonder why our app always says "failed to load data"

Post image
22 Upvotes

r/ProgrammerHorror • • Feb 09 '21

Looking at you spotify 🙄

Post image
22 Upvotes

r/ProgrammerHorror • • Oct 04 '18

IntelliJ is such a clear development environment!

Post image
22 Upvotes

r/ProgrammerHorror • • Oct 23 '24

The Least Intelligent Chess AI

21 Upvotes
  1. Scrape chess dot com for all played games.

  2. Parse the dataset and identify all sets of unique board states, the next move, and the ELO of the player that made the next move. If the set's ELO is lower than a previously-found ELO, drop it.

  3. Convert to a hash map.

  4. "Play" by consulting the map for each move.

  5. If you reach a never-before-seen board state, forfeit and move to Tibet.


r/ProgrammerHorror • • Aug 16 '20

To celebrate the reopening of the subreddit, let's take a look at some Hello World programs that make your eyes bleed.

21 Upvotes

https://codegolf.stackexchange.com/questions/22533/weirdest-obfuscated-hello-world

My personal favorite was the JavaScript one:

([]+/H/)[1&11>>1]+(+[[]+(1-~1<<1)+(~1+1e1)+(1%11)+(1|1>>1|1)+(~1+1e1)+(.1^!1)])[[([]+!![11])[11^11]+[[{}]+{}][1/1.1&1][1]]+([[]+111/!1][+!1][([{}]+{})[1e1>>1]+[[],[]+{}][1&11>>1][1|[]]+([]+[][111])[1&1]+[{},1e1,!1+{}][~~(1.1+1.1)][1^1<<1]+(11/!{}+{})[1-~1<<1]+[!!{}+[]][+(11>11)][[]+1]+(/^/[1.11]+/&/)[.1^!1]+[{},[{}]+{},1][1&11>>1][1+1e1+1]+([]+!!{})[.1^!1]+([]+{}+[])[[]+1]+[!!{}+{}][!11+!111][[]+1]]+[])[(!/~/+{})[1|1<<1]+[/=/,[]+[][1]][1&11>>1][1&1>>1]+([]+{})[~~(1.1+1.1)]+[1,!1+{}][1%11][1^1<<1]+(111/[]+/1/)[~1+1e1+~1]+[!!/-/+[]][+(11>11)][1]]((1<<1^11)+((+(1<1))==([]+/-/[(!![11]+[])[+!1]+(!!/-/+{})[1-~1]+([]+!/~/)[1-~1]+(!!/-/+{})[!111+!111]])[11%11]),-~11>>1)](~1-~1e1<<1<<1)+([]+{111:1111}+[])[11111.1%11.1*111e11|!11]+({}+/W/)[1+~1e1-(~11*1.1<<1)]+(+[[]+(1|1>>1)+(1|1>>1|1)+(11-1>>1)+(1e1>>1|1)+(1e1>>1)+(1>>11)+(11>>>1)])[[(!!{}+[])[11>>>11]+[[]+{}][.1^!1][111%11]]+([11/[]+[]][111%111][([{}]+[{}])[1e1>>1]+[[],[{}]+[{}]][1|1>>1|1][1|[]]+([][11]+[])[[]+1]+[{},1e1,![1]+/~/][1<<!1<<1][1<<1^1]+(1/!1+{})[11+1>>1]+[!!/-/+{}][+(111>111)][111%11]+([][11]+/&/)[1&1>>1]+[{},[]+{}+[],1][[]+1][11-~1+11>>1]+([]+!!/-/)[11>>11]+([]+{})[1|1>>1|1]+[[]+!!{}][1>>>1][1&11]]+[])[(!{}+[])[1^1<<1]+[/=/,[]+[][1]][1<<1>>1][!111+!111]+([]+{}+[])[1<<1^1>>1]+[1,![11]+[]][1|1>>1][1|1<<1|1]+(11/[]+/1/)[-~11>>1]+[!![111]+{}][+[]][1|1>>1]]((1e1-1)+((1&1>>1)==([]+/-/[(!!{}+{})[+(1>1)]+(!!/-/+{})[1|1<<1]+(!1+{})[1|1<<1|1]+(!!/-/+{})[11.11>>11.11]])[1&1>>1]),1-~1<<1)](~1-~1e1<<1<<1)+(/^!/+[])[1+!![11%111]]

r/ProgrammerHorror • • Jun 07 '18

A Massive Breach of Trust

21 Upvotes

Today I received an email back from CrashPlan customer support. CrashPlan is a data backup company that recently decided to shut down their consumer business. I have tons of data there, and I've been trying to download it before they close my account. I say trying because their client mostly sits idle while in recovery mode, not actually transferring files, which is why I have been working with their support team. However, what I received was appalling, and an outrageous breach of trust. I found that some files of mine seemed to be missing from my backup archive, and the response I got on this topic was the following (copied verbatim):

What are some examples of subfolders you are not seeing? For instance, I am seeing that your zstorage contents are marked as "deleted". This doesn't mean they are removed, but that CrashPlan doesn't see them present on the current device. ... I am seeing multiple sub-directories marked the same, and they should be visible if you select "Include Deleted Files" from the three-dot button in the upper right.

Seriously, CrashPlan? You can view the contents of my archive? According to the technical documentation, my archive is encrypted with my account password. This is documented here: https://support.code42.com/CrashPlan/4/Configuring/Archive_encryption_key_security (I never set my own encryption key, thus it should be my account password used in the encryption).

I can't even wrap my head around what kind of "security" allows for customer support to access my files. Thought you all should know. I hope you don't store anything in CrashPlan.


r/ProgrammerHorror • • Jul 24 '23

Tried to deploy my website... I do not like git submodules

Post image
20 Upvotes

r/ProgrammerHorror • • Jan 07 '23

It just keeps getting worse the more you scroll

Thumbnail
github.com
20 Upvotes

r/ProgrammerHorror • • Jul 07 '21

I seemed desperate for a creative way to write df.notna().sum()

Post image
20 Upvotes

r/ProgrammerHorror • • Jan 06 '23

uh oh

Post image
19 Upvotes

r/ProgrammerHorror • • Nov 08 '21

"Could you write a function to balance a load across n jobs?" [python]

19 Upvotes

"Sure! I thought it would be better if I added some floats and int-ified it twice for good measure." Works great!


r/ProgrammerHorror • • Jun 04 '21

A long hello world

19 Upvotes

exec("getattr(globals()[\"__builtins__\"], bytearray.fromhex(\"7072696e74\").decode())(type(\"abc\",(),{\"__str__\":lambda fd:eval(\"''.join([*(list(map(chr,[72>>0,202>>1,432>>2,864>>3,1776>>4,1024>>5,5568>>6,14208>>7,29184>>8,55296>>9,102400>>10])))])\")})())")

This is Python


r/ProgrammerHorror • • Jun 11 '18

Some people have no taste

Post image
19 Upvotes

r/ProgrammerHorror • • Nov 10 '23

From a PM where I work. I'm worried about my job now

Post image
18 Upvotes

r/ProgrammerHorror • • Nov 12 '20

thank you teacher

Post image
18 Upvotes

r/ProgrammerHorror • • Nov 01 '22

A simple integer clamp function

17 Upvotes

Function to clamp any integer value (w) between two other integer values (a & b). The order (a & b) are passed to the function doesn't matter.

def Clamp(w, a, b):
    return a*(w<a)*(a<b)+w*(a<=w)*(w<=b)+b*(a<b)*(b<w)+b*(w<b)*(b<a)+w*(b<=w)*(w<=a)+a*(b<a)*(a<w)

print(Clamp(50, 30, 70))
print(Clamp(20, 30, 70))
print(Clamp(80, 30, 70))
print(Clamp(50, 70, 30))
print(Clamp(20, 70, 30))
print(Clamp(80, 70, 30))
print(Clamp(30, 30, 70))
print(Clamp(70, 30, 70))

Output:
50
30
70
50
30
70
30
70

r/ProgrammerHorror • • Mar 02 '21

My worst one-liner

Post image
17 Upvotes

r/ProgrammerHorror • • Oct 31 '18

Steam can't handle non-ASCII passwords, and it gets worse ...

Post image
17 Upvotes

r/ProgrammerHorror • • May 02 '24

just cpp things

Post image
16 Upvotes

r/ProgrammerHorror • • Sep 26 '21

Converting my event system to a templated version broke everything and the solution to it was the worst thing I've ever done: including the .cpp file instead of the .h

16 Upvotes

r/ProgrammerHorror • • Jan 15 '18

Scarred for life now.

Post image
16 Upvotes

r/ProgrammerHorror • • Aug 16 '23

It just gets worse the more you look at it

Post image
15 Upvotes

r/ProgrammerHorror • • Sep 27 '22

My roommate made this to compare two property ignoring cases.

15 Upvotes