u/svipbo - 122 Archived Voat Posts in v/programming
u/svipbo
  • home
  • search

u/svipbo

81 posts · 41 comments · 122 total

Active in: v/programming (122)

  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • 2
  • ›
  • ››
  • ›››
In Memoriam of Charles "Chuck" Peddle
1 0 comments 23 Dec 2019 17:17 u/svipbo (..) in v/programming
John Carmack to work on artificial general intelligence
1 0 comments 23 Nov 2019 21:27 u/svipbo (..) in v/programming
Core Debian developer summarily banned from project for referring to a transgender person with a non-approved pronoun
216 153 comments 03 Feb 2019 12:37 u/svipbo (..) in v/programming
Which Unicode character should represent the English apostrophe? (And why the Unicode committee is very wrong.)
2 0 comments 01 Feb 2019 18:03 u/svipbo (..) in v/programming
C Portability Lessons from Weird Machines
1 0 comments 01 Dec 2018 20:36 u/svipbo (..) in v/programming
Comment on: Weird Python Integers

I honestly don't know but I am guessing it is because integers are Python objects, so when an integer constant appears in the source code the interpreter has to get a data structure representing this integer. This would allow methods to be called on the object.

0 12 Sep 2017 18:20 u/svipbo in v/programming
Weird Python Integers
2 1 comment 10 Sep 2017 10:59 u/svipbo (..) in v/programming
"Holy Grail" Bugs in Emulation, Part 1
1 0 comments 27 Aug 2017 18:02 u/svipbo (..) in v/programming
The world in which IPv6 was a good design
13 0 comments 11 Aug 2017 18:08 u/svipbo (..) in v/programming
Multics Simulator released
2 0 comments 09 Jul 2017 20:07 u/svipbo (..) in v/programming
Two Commits That Wrecked the User Experience of Git
3 0 comments 09 Jul 2017 10:50 u/svipbo (..) in v/programming
Roland McGrath bows out as glibc maintainer
2 0 comments 09 Jul 2017 10:46 u/svipbo (..) in v/programming
Making Python faster [LWN.net]
1 0 comments 24 Jun 2017 20:36 u/svipbo (..) in v/programming
Reverse engineering the 76477 "Space Invaders" sound effect chip from die photos
4 0 comments 21 Jun 2017 18:32 u/svipbo (..) in v/programming
The Horror in the Standard Library
1 0 comments 21 Jun 2017 17:21 u/svipbo (..) in v/programming
Comment on: Only 36% of Indian engineers can write compilable code: study

Miscegenation with low-caste Dravidians.

0 14 May 2017 11:44 u/svipbo in v/programming
Comment on: Nasa runs competition to help make old Fortran code faster

A straight rewrite in a language other than Fortran will very likely make it slower. What language did you have in mind?

0 14 May 2017 10:34 u/svipbo in v/programming
How to not invent kernel interfaces (2007) [PDF]
6 0 comments 14 May 2017 10:21 u/svipbo (..) in v/programming
A Commodore 64 demo in 256 bytes
2 1 comment 22 Apr 2017 11:07 u/svipbo (..) in v/programming
Engineering Integrity vs. Workplace Marxism
2 0 comments 20 Apr 2017 17:08 u/svipbo (..) in v/programming
Why don't you just rewrite it in X?
5 1 comment 17 Apr 2017 07:08 u/svipbo (..) in v/programming
Why some NES games have artifacts at the edge of the screen
11 2 comments 08 Mar 2017 18:07 u/svipbo (..) in v/programming
Comment on: BASIC v2.0 / Commodore programming help. C128/64 hobby refinement

A very thorough look at the C64. https://www.youtube.com/watch?v=ZsRRCnque2E

2 01 Mar 2017 21:26 u/svipbo in v/programming
Comment on: Nigerian "software engineer" handed written test at New York airport to prove he really is one

I'd like to see a film of this.

6 01 Mar 2017 21:10 u/svipbo in v/programming
Nigerian "software engineer" handed written test at New York airport to prove he really is one
5 2 comments 01 Mar 2017 20:56 u/svipbo (..) in v/programming
Why Emulated Games Have Poor Latency
3 0 comments 27 Feb 2017 18:54 u/svipbo (..) in v/programming
Oracle euthanizes Solaris 12, expunging it from roadmap
1 1 comment 19 Jan 2017 20:37 u/svipbo (..) in v/programming
Comment on: Do you expect computers to move to a 128-bit architecture during your lifetime?

This is why the x32 ABI was created for Linux. https://en.wikipedia.org/wiki/X32_ABI

0 03 Dec 2016 09:37 u/svipbo in v/programming
How many x86 instructions are there?
1 1 comment 26 Aug 2016 06:44 u/svipbo (..) in v/programming
Comment on: xmake: The Automatic Cross-platform Build Tool is released

Because writing a new build system appears easier than learning how to use the existing ones.

0 21 Jun 2016 20:00 u/svipbo in v/programming
Comment on: Bored? Go over this text-based RPG I'm making. Tell me exactly how awful my coding is.

Here's one thing:

https://bitbucket.org/weanoob/whorehouse/src/8a9fba4083af2e1397563db509cd7077889b6902/scenes.py?at=master#scenes.py-123

Self-explanatory, really. In other words, it would be easier to understand if you stored this logic in a data structure instead of using "print" statements. But's that's really a very minor point: it's easy to understand as it is.

https://bitbucket.org/weanoob/whorehouse/src/8a9fba4083af2e1397563db509cd7077889b6902/scenes.py?at=master#scenes.py-39

A bit confusing here. You use a global variable to store a list of the scenes, but then you also have a parameter to say which list to use:

https://bitbucket.org/weanoob/whorehouse/src/8a9fba4083af2e1397563db509cd7077889b6902/scenes.py?at=master#scenes.py-205

If you can't create a scene that isn't in the global list, then one wonders what the point of the parameter is.

Generally I don't see global variables as that bad. You'll know that they are bad when you start to get confused by the code.

https://bitbucket.org/weanoob/whorehouse/src/8a9fba4083af2e1397563db509cd7077889b6902/combat.py?at=master#combat.py-13

With global variables like these, one thing you can do to make the code easier to understand is to comment extensively about (a) where the variable is set, and (b) where the variable is read. This way, when you see a function accessing it, you will have a better idea what code set the value of the variable.

https://bitbucket.org/weanoob/whorehouse/src/8a9fba4083af2e1397563db509cd7077889b6902/combat.py?at=master#combat.py-73

Seems a bit strange to use exception handling to know whether the command is recognized or not.

One question is how to read the code. So I see there is an exception here called KeyError. What throws this exception? Is it caught elsewhere? I thought I could look through this file for this KeyError but it only appears twice in the file and neither place gives me a clue. This shows a basic principle of what makes code easy to understand: put stuff near each other in the source code so you don't have to look across many locations in the source code to understand the logic, and when this isn't the case, comments help.

https://bitbucket.org/weanoob/whorehouse/src/8a9fba4083af2e1397563db509cd7077889b6902/combat.py?at=master#combat.py-70

stuff and stuff_split are bad variable names. Maybe input_line and input_arguments or something?

https://bitbucket.org/weanoob/whorehouse/src/8a9fba4083af2e1397563db509cd7077889b6902/combat.py?at=master#combat.py-8

So you have the all_spells variable which you access in a few places in this file. I looked at the spells.py file where the all_spells variable is initialized. But I wasn't sure if spells were added elsewhere as well. I think it would be hard to tell without looking through the rest of the source code.

1 25 Apr 2016 20:33 u/svipbo in v/programming
Comment on: Old School Color Cycling with HTML5

Probably some information in the links on this page https://news.ycombinator.com/item?id=11506431 that I got the submission from. I don't tend to watch videos though so couldn't say what was in them.

0 18 Apr 2016 21:46 u/svipbo in v/programming
Old School Color Cycling with HTML5
12 2 comments 16 Apr 2016 21:01 u/svipbo (..) in v/programming
Comment on: We need more programming challenges. We should start off small: First non-repeating character of a string. Any language you like.

I thought something like that, but tooth is supposed to be h. It isn't t, because t appears twice, even though the two t's aren't next to each other. I think it means the first character that doesn't appear in the string twice.

1 16 Apr 2016 15:26 u/svipbo in v/programming
Comment on: We need more programming challenges. We should start off small: First non-repeating character of a string. Any language you like.

C version fails for input aba. The code here prints a even though a is a duplicate.

For aabbc, it thinks the answer is b.

2 16 Apr 2016 13:54 u/svipbo in v/programming
Comment on: We need more programming challenges. We should start off small: First non-repeating character of a string. Any language you like.

Here's my shitty C:

char
first_non_repeating (char *s)
{
        char *p;
        int dup;
           characters with '0'. */
        for (; *s; s++) {
                if (*s == '0') {
                        continue;
                }
                dup = 0; 
                for (p = s + 1; *p; p++) {
                        if (*p == *s) {
                                *p = '0';
                                dup = 1;
                        }
                }
                if (!dup) {
                        return *s;
                }
        }
        return 0;
}
int
main ()
{
        char strings[] = "yellow\0tooth";
        char *s;
        for (s = strings; s < strings + sizeof (strings);
             s += strlen (s), s++) {
                printf ("%s ", s);
                printf ("%c\n", first_non_repeating (s));
        }
}
1 16 Apr 2016 13:32 u/svipbo in v/programming
Serious Sam's Serious Engine source code released under GPL
2 0 comments 12 Mar 2016 19:17 u/svipbo (..) in v/programming
Comment on: Another bigot joining Github. Inclusiveness doesn't include white men.

This guy? OMG. He was responsible for this: https://github.com/opal/opal/issues/941. Makes my blood boil.

0 27 Feb 2016 17:46 u/svipbo in v/programming
Comment on: Usborne 1980s computer books, free to download for personal use

I love these, I had one when younger, and still have it!

2 10 Feb 2016 20:16 u/svipbo in v/programming
Results of the 2015 Underhanded C Contest
9 0 comments 04 Feb 2016 08:41 u/svipbo (..) in v/programming
OpenSSH and the dangers of unused code
22 10 comments 28 Jan 2016 19:27 u/svipbo (..) in v/programming
Comment on: A computer has beaten a human professional for the first time at Go, the ancient board game

Just found a link to full paper: https://storage.googleapis.com/deepmind-data/assets/papers/deepmind-mastering-go.pdf

1 28 Jan 2016 19:05 u/svipbo in v/programming
Comment on: A computer has beaten a human professional for the first time at Go, the ancient board game

Yes, but can a computer ride a unicycle? Checkmate, atheists.

0 28 Jan 2016 19:01 u/svipbo in v/programming
The 1986 ACM Conference on the History of Personal Workstations (links to videos included)
7 1 comment 28 Jan 2016 08:15 u/svipbo (..) in v/programming
Comment on: Echo in 879 bytes (Assembly)
   je _removenl    ;If they are equal remove the newline
    jmp _main
_removenl:

could jne _main instead.

    jmp _main
_main:

jmp unnecessary.

1 27 Jan 2016 21:53 u/svipbo in v/programming
Marvin Minsky, father of artificial intelligence, dies at 88
13 1 comment 27 Jan 2016 21:15 u/svipbo (..) in v/programming
A computer has beaten a human professional for the first time at Go, the ancient board game
18 8 comments 27 Jan 2016 21:12 u/svipbo (..) in v/programming
Comment on: Reflections on difficulties using object-oriented design methodology

Here's an article that discusses different meanings of class inheritance: Go and Rust - objects without class.

1 21 Jan 2016 08:11 u/svipbo in v/programming
Reflections on difficulties using object-oriented design methodology
12 5 comments 20 Jan 2016 21:45 u/svipbo (..) in v/programming
libcurl developer blamed for Instagram hack by luser because his licence notice was present
13 2 comments 20 Jan 2016 21:20 u/svipbo (..) in v/programming
Comment on: Learn to Code. It's a LOT Harder Than You Think

Dunning-Kruger effect? If someone says they know C++, they likely know less of it than someone who says they partially know C++ but they're worried they don't understand some of the darker areas.

2 20 Jan 2016 19:13 u/svipbo in v/programming
Elementary Human Interface Guidelines - Advice on UI and software design
6 3 comments 14 Jan 2016 10:07 u/svipbo (..) in v/programming
T_PAAMAYIM_NEKUDOTAYIM v Sanity (2013)
4 2 comments 09 Jan 2016 22:30 u/svipbo (..) in v/programming
Comment on: Best Html5 Courses

83 submissions to ReportSpammers

Great work!

0 09 Jan 2016 11:37 u/svipbo in v/programming
I wondered how long people have been using the "modern" prefix to revitalise programming languages . . .
1 0 comments 09 Jan 2016 11:13 u/svipbo (..) in v/programming
Comment on: How to C (as of 2016)

I know, you want a number, just use an int. I mean, int32_t is more visually complicated - how does using that communicate your intentions any better, either to another person or to the computer?

If you pedantically claim that you should use the largest integer type to avoid the risk of integer overflow, I'll pedantically retort that you should use a bignum library for all of your "int"s.

Who's going to remember what intptr_t actually means? Not me.

0 09 Jan 2016 10:12 u/svipbo in v/programming
Comment on: How to C (as of 2016)

I always use -O0 because I got sick of getting value optimized out in gdb.

edit: most of this article is fascist garbage, I'd take it all with a pinch of salt

2 08 Jan 2016 21:16 u/svipbo in v/programming
Peter Naur Dies Aged 87
17 1 comment 04 Jan 2016 19:02 u/svipbo (..) in v/programming
Comment on: The Website Obesity Crisis

Use an AdBlock software and turn off JavaScript for all but a few chosen websites and you'll have a better experience.

2 02 Jan 2016 17:40 u/svipbo in v/programming
Comment on: In Memoriam: Ian Murdock (founder of Debian)

His last posts on Twitter before he died. Holy crap!

7 31 Dec 2015 10:07 u/svipbo in v/programming
In Memoriam: Ian Murdock (founder of Debian)
44 7 comments 31 Dec 2015 09:43 u/svipbo (..) in v/programming
DomTerm is a combined terminal emulator and REPL console using web technologies
1 1 comment 28 Dec 2015 16:45 u/svipbo (..) in v/programming
Reverse Engineering for Beginners
37 3 comments 28 Dec 2015 16:01 u/svipbo (..) in v/programming
Comment on: Optimization of Computer Programs in C

A word of warning: this article is quite old (1999), but most of it appears to be still valid.

0 28 Dec 2015 11:10 u/svipbo in v/programming
Optimization of Computer Programs in C
19 3 comments 28 Dec 2015 11:09 u/svipbo (..) in v/programming
The Awesome Power of Theory - Explorations in the Untyped Lambda Calculus
3 0 comments 28 Dec 2015 11:07 u/svipbo (..) in v/programming
Comment on: The Fall and Rise of SVG

LOL well spotted.

0 16 Dec 2015 20:11 u/svipbo in v/programming
Screenshots from developers: 2002 vs. 2015
37 6 comments 12 Dec 2015 21:44 u/svipbo (..) in v/programming
It Probably Works - Probabilistic Algorithms are All Around Us
20 3 comments 12 Dec 2015 21:39 u/svipbo (..) in v/programming
The Fall and Rise of SVG
10 4 comments 07 Dec 2015 10:52 u/svipbo (..) in v/programming
why GNU grep is fast
15 1 comment 07 Dec 2015 00:51 u/svipbo (..) in v/programming
Cap'n Proto: A serialization protocol
1 0 comments 04 Dec 2015 11:42 u/svipbo (..) in v/programming
The sRGB Learning Curve
11 0 comments 02 Dec 2015 14:24 u/svipbo (..) in v/programming
Refactoring a 300-line if
4 0 comments 01 Dec 2015 23:11 u/svipbo (..) in v/programming
Interview with founders of Freeciv
11 0 comments 16 Nov 2015 11:46 u/svipbo (..) in v/programming
A scheme for chess move representation
6 0 comments 11 Nov 2015 23:22 u/svipbo (..) in v/programming
Anrdei Alexandrescu (co-creator of D) on D, Go and Rust
6 0 comments 10 Nov 2015 22:22 u/svipbo (..) in v/programming
Comment on: What's new in TeX

Part 2 here: https://lwn.net/Articles/662053/.

0 08 Nov 2015 14:42 u/svipbo in v/programming
What's new in TeX
1 1 comment 08 Nov 2015 14:42 u/svipbo (..) in v/programming
Comment on: xkcd comic: Git

I thought that comic was an exaggeration! The point is it's wasteful of network bandwidth to be downloading an entire repository because something broke. Of course it's possible to fix it, it's just reading the manpages to find out how, which would be difficult, depressing and time-consuming.

1 02 Nov 2015 11:52 u/svipbo in v/programming
Comment on: golang code of conduct proposal

By restricting the discussion Of this proposal to 1:1 conversations between myself and members of the Community, I hope to better hear everyone’s specific concerns without generating unnecessary noise

Good idea.

An explicit goal of this proposal is to promote cultural diversity within our community and make it more welcoming and inclusive.

Who cares?

Diversity is critical to the project; for Go to become a success, it needs contributors and users from all backgrounds. (See Go, Open Source, Community.)

Uh, no it doesn't. Not really. What it needs is competent people.

If someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize.

I knew that would be in there somewhere.

You know, all this stuff is a good idea:

Be friendly and welcoming Be patient Remember that people have varying communication styles, and that not everyone speaks English fluently. Be respectful In particular, respect differences of opinion. Be charitable Interpret the arguments of others in good faith, do not seek to disagree. When we do disagree, try to understand why.

But you know it's a foil for suppression of free speech and affirmative action.

Go was created by Rob Pike and Ken Thompson, wasn't it? Why can't they be dictators of the project? Instead we have this:

Reporting issues

The Code of Conduct Working Group are a group of people that represent the Go community. They are responsible for handling code-related issues. They are:

And a committee of people who'll decide if what you said was inappropriate.

If you encounter a Code of Conduct-related issue, you should report it to the Code of Conduct Working Group using the process described below. Do not post about the issue publicly or try to rally sentiment against a particular individual or group.

This I can agree with. Too often complaints about harassment turn into harassment themselves.

Furthermore, if your conduct outside the Go community is against our values (below), it may affect your ability to participate within our community.

This is a fucking disgrace. It means someone could be excluded from the Go community for voting for the wrong political party, for example!

J responds to D by asking them to "butt out". S emails J privately, noting that J's reaction was uncalled-for, and suggests that J apologize to D.

I might do this myself, although probably wouldn't suggest an apology, I'd just say it was inappropriate. Again keeping this private is the best idea.

Go’s type system is so simple even my grandma could understand it.

Well, it's true that most people's grandmas aren't interested in computer programming.

All in all I don't think that people being rude to each other is that much of a problem in free software or open source. I read a lot of email threads as well and don't see it.

7 01 Nov 2015 20:50 u/svipbo in v/programming
Inside The Programming Evolution of GPU Computing
8 1 comment 30 Oct 2015 10:46 u/svipbo (..) in v/programming
xkcd comic: Git
80 25 comments 30 Oct 2015 09:44 u/svipbo (..) in v/programming
Permissive licenses, community, and copyleft
6 0 comments 22 Oct 2015 17:10 u/svipbo (..) in v/programming
Getting a full PDF from a DRM-encumbered online textbook
24 3 comments 22 Oct 2015 13:08 u/svipbo (..) in v/programming
strscpy and the hazards of improved interfaces
1 1 comment 17 Oct 2015 15:23 u/svipbo (..) in v/programming
The Verge's web sucks
13 2 comments 16 Oct 2015 00:20 u/svipbo (..) in v/programming
Comment on: "Tomato" versus "#FF6347" - the tragicomic history of CSS color names

Truth be told I'd never realised that these were obsolete.

1 15 Oct 2015 23:50 u/svipbo in v/programming
"Tomato" versus "#FF6347" - the tragicomic history of CSS color names
22 3 comments 15 Oct 2015 22:07 u/svipbo (..) in v/programming
Interview with Bjarne Stroustrup on the 30th anniversary of the first C++ compiler
11 0 comments 15 Oct 2015 14:54 u/svipbo (..) in v/programming
Comment on: Encryption with Console Application in C#

Please just fuck off.

0 15 Oct 2015 14:47 u/svipbo in v/programming
Structural and Semantic Deficiencies in the systemd Architecture
1 0 comments 11 Oct 2015 21:52 u/svipbo (..) in v/programming
Why Intel added cache partitioning in Broadwell, and how it can increase performance by 1.3x to 3x
1 0 comments 06 Oct 2015 00:36 u/svipbo (..) in v/programming
Fuzzing with american fuzzy lop
17 0 comments 04 Oct 2015 14:22 u/svipbo (..) in v/programming
wisp: a parenthesis-free syntax for Lisp s-expressions, remiscent of Python
2 0 comments 03 Oct 2015 17:29 u/svipbo (..) in v/programming
Comment on: The Rust Code of Conduct contains this

If I had a code of conduct for my project, it would be "All are welcome to contribute. Keep conversation technical, and please avoid any political garbage. Anyone trying to harass a contributor for their activities outside of the project, or because they allegedly said something offensive, will be taken out and shot with a hollow-point bullet."

0 03 Oct 2015 12:23 u/svipbo in v/programming
Comment on: 'goto' in Python by re-writing the bytecode

That's just a loop, right?

Even worse:

if (condition) {
  goto do_it;
}
if (condition2) {
  thing1();
  if (condition3) {
    thing2();
do_it:
    thing3();
  }
}
1 30 Sep 2015 19:24 u/svipbo in v/programming
Comment on: 'goto' in Python by re-writing the bytecode

In case that wasn't a rhetorical question, constructs using goto can be equivalent to a tail-recursive function call, and can also be used to simulate a return from a function, and even a return from multiple functions, as with setjmp or exception handling. Usually you wouldn't need this, but it can be useful in a language without coroutines, where you maintain what would be a separate call stack as an explicit data structure. It's also useful in languages without continuations for implementing backtracking algorithms, where you want your program to, in a sense, go back in time. If you're interested in exploring this subject, read Donald Knuth's paper "Structured Programming with Goto Statements", and look into.the Lambda Papers by Steele and Sussman, for example "Lambda the Ultimate GOTO".

1 22 Sep 2015 20:13 u/svipbo in v/programming
Comment on: 'goto' in Python by re-writing the bytecode

Surely all you need is a call stack to implement functions that can be called more than once at a single time?

invariably end up looking like spaghetti to the untrained eye

IIRC the function call procedure in the machine language used by Donald Knuth in his Art of Computer Programming books (MIX) modified the jump instruction at the end of the function to jump back to the function call site.

I guess early compilers for FORTRAN that didn't allow recursion must have done something similar.

0 21 Sep 2015 15:28 u/svipbo in v/programming
'goto' in Python by re-writing the bytecode
13 13 comments 21 Sep 2015 11:03 u/svipbo (..) in v/programming
  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • 2
  • ›
  • ››
  • ›››

archive has 9,592 posts and 65,719 comments. source code.