r/shittyprogramming • • Aug 10 '16

super approved Revolutionary image compression technique?

280 Upvotes

Now that neural networks can identify elements of pictures, I've invented a new image compression technique. Here is an example.

INPUT: This picture, in standard JPG format (80.6 KB)

OUTPUT: "Husky walks on large shallow lake and it's cool because you can see its reflection, also there's some spooky trees in the background" (0.132 KB!!!)

To decompress, run the neural net in reverse. Obviously this loses some data, but lossy compression is OK for images. Plus you can tune the compression level like

HIGH COMPRESSION: "Husky on lake"

LOW COMPRESSION: "Stoic but mysterious husky walks ... [et cetera] ... also everything but the dog is blue"

Thoughts?


r/shittyprogramming • • May 12 '16

Are programmers called propounders in countries that don't use the metric system?

279 Upvotes

r/shittyprogramming • • Jan 10 '16

Sometimes I start to believe the compiler ignores all my comments.

279 Upvotes

r/shittyprogramming • • Jan 12 '23

Amazon ? Hello ?

Post image
278 Upvotes

r/shittyprogramming • • Dec 08 '19

Simple and lightweight JSON parser in Python.

Post image
278 Upvotes

r/shittyprogramming • • Sep 05 '18

Why don't countries just use an int data type for their national debt so their debt goes to -$2,147,483,648 once they spend more than $2,147,483,647?

278 Upvotes

r/shittyprogramming • • Feb 17 '17

Who owns the trademark "’", and how much do they make in royalties from buggy websites?

278 Upvotes

r/shittyprogramming • • Nov 05 '17

Is C++ 'unsafe' because it has so many std's?

277 Upvotes

r/shittyprogramming • • Apr 12 '16

Easy JavaScript game loop

Post image
277 Upvotes

r/shittyprogramming • • Jul 09 '14

generating a 512-bit int

Post image
277 Upvotes

r/shittyprogramming • • Mar 05 '21

The worst shower thought I ever had NSFW

276 Upvotes

The C preprocessor can be invoked on any file with the standalone executable "cpp", so there is nothing stopping me from using the C preprocessor with any programming language which uses '#' as a comment tag. I tried a proof of concept with python.

In greeter.py:

def greet(name):
  print("Hello, " + name + "!")

In main.py:

#include "greeter.py"

greet("spocino")

and the output of the command cpp main.py is:

# 1 "main.py"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "main.py"
# 1 "greeter.py" 1
def greet(name):
  print("Hello, " + name + "!")
# 2 "main.py" 2

greet ("spocino")

LGTM. Push to production.

$ cpp main.py > out.py
$ python out.py
Hello, spocino!
$

It works. I will end this here for my own sanity.


r/shittyprogramming • • Jan 06 '18

A valuable lesson we can all learn from Meltdown

Post image
276 Upvotes

r/shittyprogramming • • Dec 25 '17

How do I uninstall Adobe After Effects?

Thumbnail
imgur.com
276 Upvotes

r/shittyprogramming • • Sep 03 '17

`if`, `else`, `for`, `switch`, `case`, and `default` are unnecessary keywords.

276 Upvotes

A common trend in modern programming languages (such as Go) is to have a very simple core language. So why then are so many languages cluttered with unnecessary keywords? if, else, for, switch, case, default, and do can all be expressed using while.

    // if
    while (some_condition) { do_thing(); break; }
    // else
    while (!some_condition) { do_other_thing(); break; }
    // for
    int i = 0; while (i < 10) { do_a_tenth_of_a_thing(); ++i; }
    // switch/case/default
    while (a == 0) { do_thing_0(); break; }
    while (a == 1) { do_thing_1(); break; }
    while ((a != 0) && (a != 1)) { do_default_thing(); break; }
    // do/while
    do_stuff(); while (some_condition) { do_stuff(); }

r/shittyprogramming • • Apr 13 '22

Fick dich! *germanizes your whole tech stack*

Post image
275 Upvotes

r/shittyprogramming • • Mar 20 '20

Of course you didn’t test it

Post image
274 Upvotes

r/shittyprogramming • • Aug 14 '17

Pro tip: make a new branch for every commit, that way your git gui looks really busy and people think you're a better developer

274 Upvotes

r/shittyprogramming • • Jun 04 '13

This how you can find the source code to <b>ANY</b> program in 3 easy steps.

Thumbnail
imgur.com
274 Upvotes

r/shittyprogramming • • Nov 05 '18

<wrong_sub>this</wrong_sup> You had one job

Post image
273 Upvotes

r/shittyprogramming • • May 18 '16

Why people are so excited with Oculus Rift, if since late 90's we already Java Virtual Machine?

273 Upvotes

Not to mention VMWare.

EDIT:

--already

++already have

Sorry, I have lysdxeia.


r/shittyprogramming • • Oct 15 '18

Exclusive screenshot of Elite Fighter gamecode!

Post image
271 Upvotes

r/shittyprogramming • • Aug 14 '18

Insertion Sort at its finest.

Post image
271 Upvotes

r/shittyprogramming • • Jul 27 '22

I wrote a discord web browser (more info in comments)

Post image
270 Upvotes

r/shittyprogramming • • Aug 02 '18

XNOR the best

Post image
270 Upvotes