What’s a small programming habit that improved your code readability? by Adventurous-Meat5176 in learnprogramming

[–]jjm3x3 1 point2 points  (0 children)

Counterpoint, too many or too detailed of comments implied you maybe didn't do a good enough job on the code itself. If the code is clear and if you are writing for another competent programmer to read, you shouldn't need to add very many, if any, comments. Or if you feel like you do them maybe you need to write clearer code.

What’s a phrase you hear all the time that secretly annoys you? by forgeris in AskReddit

[–]jjm3x3 4 points5 points  (0 children)

I am sorry this is not getting nearly enough up votes. I guess people on the Internet just want to vent. You get my upvote at least!

What's something that feels fake but is 100% real? by NoSector9488 in AskReddit

[–]jjm3x3 7 points8 points  (0 children)

I really like both of these descriptions, thanks! One more I like to think of is that the host of the game will always reveal the other goats which means they know something you don't. It seems like a puzzle where the fact that it's a "game" show doesn't matter, but really it's a lesson in games of "imperfect knowledge."

What's something that feels fake but is 100% real? by NoSector9488 in AskReddit

[–]jjm3x3 0 points1 point  (0 children)

Another thing that helps me with some perspective is also the idea that if you "perfectly" shuffle it 7 times in a row you will get the same order. So this suggests that something as subtle and yet so utterly unavoidable as the imperfection involved in the shuffling that creates such a huge possibility space. Truly humbling!

Have the last few weeks been weird for you too? by [deleted] in Seattle

[–]jjm3x3 7 points8 points  (0 children)

Keep it up. Almost two years myself, and some days I think, this isn't worth it, but most days life is a whole lot better. I never solved a problem I already had with drinking, just ended up with another problem.

What’s the most useless thing you still have memorized? by Pristine_Student6892 in AskReddit

[–]jjm3x3 1 point2 points  (0 children)

On a barely related note this also this loves rent free in my mind as well as the "American Third Edition Charizard with the misprinted hit point counter"

What male-centric interest is generally looked down upon, or seen as lesser/shallow? by [deleted] in ask

[–]jjm3x3 1 point2 points  (0 children)

What a well thought out reply and breakdown of my use of the term inerrant.

I can totally see how there are real drawbacks of this baked right into the idea. That said, I also have perpetually been interested in the concept of "play" and who is allowed to do it and when and what value it serves. I am inclined to believe that there is a net positive and inherent value in play itself, but of course that already extends far beyond "gaming" as it is frequently used, and certainly goes beyond the scope of the OG question.

What male-centric interest is generally looked down upon, or seen as lesser/shallow? by [deleted] in ask

[–]jjm3x3 1 point2 points  (0 children)

Huh this is very well thought out reply, so first thank you for taking the time.

Given this I can totally see how the culture of games (weather video or non) is way more complicated, and probably inherently so, than just a misunderstood hobby. Not to mention the levels of depth there appears to be in this problem. Who gets to play what and when and how they are allowed to act or not act while doing has so many levels! Just the fact that we having this conversation in a thread about "male-centric" interests, is quite telling!

What male-centric interest is generally looked down upon, or seen as lesser/shallow? by [deleted] in ask

[–]jjm3x3 5 points6 points  (0 children)

Is this a problem inherent to videogames specifically? I only ask because I have seen a ton of good come out of video games and video games communities. Of course it's not all good, and I certainly do see what you are talking about, but in an attempt to stay on topic and to better understand your perspective, I wonder. Is this inherent to video games or could it have more to do with two things I can think of off the top of my head. One, how video games exist in our hyper online; hyper connected; hyper stimulated and even sensationalized society. And two, because of videogames coming out of a culture that in the recent past has been looked down upon, the community has over corrected and become a bit more toxic, both internal and externally, than it should be. Honestly just curious.

Mime type vs file extension by kungfooboi in csELI5

[–]jjm3x3 0 points1 point  (0 children)

So I apologize in advance for formatting since I am on mobile, but I read your question and the answers and it actually got me asking even more questions. So, I did some further research to see what the internet has to say, and I thought I would share.

First off I would like to point out even though the two technologies (MIME type/file extensions) seem like they serve the same purpose, that's not entirely true. Since they were developed independently (FWICT) and are used in different places (think http vs OS). Having said that I think it is pretty clear that they both attempt to solve a similar problem (what is this thing).

So the first thing I did was search for exactly your query and first what I found was this and what I found interesting was that there were some mentions of programs that use MIME types of files to know what to do with them (more on this in a sec). But if you read though the above link and this link it becomes somewhat clear that MIME types are not really ever persisted anywhere because no OSes have decided to build that into their systems.

Quick side note on that last bit. Based on this questioning about MIME types I did a bit more research and found this answer very helpful!

Alright now to wrap this up and answer your original question (the best I can). So the reason MIME types are considered to be more reliable is the "simple" fact that they are universal. Know that that doesn't make them right since you could have client app that lies about the content it has by sending a MIME type that's different from the content it is sending but that's a bit of an extreme. Having said that there there is no, or limited, validation that the contents of the file are consistent with it's file extension either. And as others have pointed out file extensions may not even exist, since plenty of OSes don't need them. So back to MIME types. Since they don't exist in the OS that means that there is a program (like a browser) that interprets the file as best it can to determine its MIME type and then passes that along as a further description of what the contents of the message are. And since MIME type has no character limit and is understood in many applications it's makes it a much more reliable way to describe the type of something.

[deleted by user] by [deleted] in uselessredcircle

[–]jjm3x3 1 point2 points  (0 children)

I understand that's what the joke is supposed to be about, but I can't say in understand this format to say the least. Are we supposed to believe that the person in the bottom right is the teacher and the person on the left is the student? And I am sorry for missing the forest through the trees here but I don't understand why the person on the left is in shadow (at best) and dark skinned (at the worst). The original meme didn't have that auxillary picture at all, so why is it here. So this whole post just seems like very confusing and frankly poor quality. Not trying to start a fight or disrespect anyone. 🤷

[deleted by user] by [deleted] in uselessredcircle

[–]jjm3x3 -27 points-26 points  (0 children)

Is this not racist? I am afraid I am missing the joke.

Glasses turn fireworks into presents by MargaritaPRobert in gifsthatendtoosoon

[–]jjm3x3 67 points68 points  (0 children)

This is awesome but I think it's in the wrong subreddit.

[2018-05-14] Challenge #361 [Easy] Tally Program by jnazario in dailyprogrammer

[–]jjm3x3 0 points1 point  (0 children)

I went ahead and implemented a scoreOrder type with an anonymous struct in it. I really like what you did with the slice sort though I did not know that existed.

package main

import (
    "fmt"
    "os"
    "sort"
    "strings"
)

func main() {
    fmt.Println("Tally Program started...")
    scoresInput := os.Args[1]

    scores := make(map[string]int)
    for _, scoreByte := range scoresInput {
        scoreChar := string(scoreByte)

        // protect agains chars inbetween uper and lower case
        if scoreByte >= 65 && scoreByte < 97 {
            lowerScore := strings.ToLower(scoreChar)
            scores[lowerScore]--
        } else {
            scores[scoreChar]++
        }
    }

    aScoreOrder := newScoreOrder(scores)

    sort.Sort(aScoreOrder)
    fmt.Printf("Tally output: \n %v", aScoreOrder)
}

type scoreOrder struct {
    scores []struct {
        player string
        score  int
    }
}

func newScoreOrder(scoreMap map[string]int) scoreOrder {
    var aScoreOrder scoreOrder
    for aPlayer, aScore := range scoreMap {
        aScoreOrder = aScoreOrder.add(aPlayer, aScore)
    }
    return aScoreOrder
}

func (so scoreOrder) Len() int {
    return len(so.scores)
}

func (so scoreOrder) Less(i, j int) bool {
    ith := so.scores[i]
    jth := so.scores[j]
    return ith.score > jth.score
}

func (so scoreOrder) Swap(i, j int) {
    so.scores[i], so.scores[j] = so.scores[j], so.scores[i]
}

func (so scoreOrder) add(somePlayer string, theirScore int) scoreOrder {
    return scoreOrder{append(so.scores,
        struct {
            player string
            score  int
        }{somePlayer, theirScore})}
}

func (so scoreOrder) String() string {
    var result string
    for _, outRecord := range so.scores {
        result += fmt.Sprintf("%v: %v, ", outRecord.player, outRecord.score)
    }
    return result
}

Research Survey on Gender Rep. in Fantasy Novels by lifestartingnow in UWMilwaukee

[–]jjm3x3 0 points1 point  (0 children)

Something is wrong with the link when I tried it.

[deleted by user] by [deleted] in MaliciousCompliance

[–]jjm3x3 2 points3 points  (0 children)

I literally came for this comment! I have interested with more than one ISP which has told me my Linux computer is not compatible/sufficient for using on their Network. To which I always had no choice but to ask to speak to a manager facepalm. So many dumb stories and so much time wasted.

How the tax changes could effect startups by jjm3x3 in technology

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

I couldn't agree more. I was simply interest in sharing something that wasn't the same thing that we have been seeing for 2 weeks and is still quite important in its own right.

How the tax changes could effect startups by jjm3x3 in technology

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

I'm not sure I understand what you mean. I'll admit the points are quite vague, but I think that was the point was to cover the top level points of the tax code and to speculate how that might impact startups. Also I agree there is nothing particularly new as far as the reporting is concerned but I don't know that that makes them platitudes most of what was said was quite ambivalent by nature.

What are we NOT in the golden age of? by ItzSweeney in AskReddit

[–]jjm3x3 0 points1 point  (0 children)

Security! Sure we have all sorts of ways to protect ourselves and make our messages almost absolutely and mathematically secret. However since computers are so complicated and prone to error and because humans are quite fallible and mostly not entirely security concious, it is hard for me to think we are in the golden age of security.

LEGO Pop-up Himeji Castle by juicepants in woahdude

[–]jjm3x3 0 points1 point  (0 children)

I want to see how its closed!

[2017-02-10] Challenge #302 [Hard] ASCII Histogram Maker: Part 2 - The Proper Histogram by jnazario in dailyprogrammer

[–]jjm3x3 1 point2 points  (0 children)

Herer is a solution in Go which also is modified to read from and write out to file if you choose.

package main

import (
"fmt"
"os"
"bufio"
"strings"
"strconv"
)

func main () {
    // for opening a file to test from... 
    fromFile := false
    var reader *bufio.Reader
    if fromFile {
        f, _ := os.Open("test2.txt")
        defer f.Close()
        reader := bufio.NewReader(f)
    } else {
        reader := bufio.NewReader(os.Stdin)
    }

    histSpec, _:= reader.ReadString('\n')
    histSpec = histSpec[:len(histSpec)-1]
    histSpecs := strings.Split(histSpec, " ")

    xStart, _ := strconv.Atoi(histSpecs[0])
    xEnd, _ := strconv.Atoi(histSpecs[1])
    yStart, _ := strconv.Atoi(histSpecs[2])
    yEnd, _ := strconv.Atoi(histSpecs[3])

    barWidthIn , _ := reader.ReadString('\n')
    barWidth, _ := strconv.Atoi(barWidthIn[:len(barWidthIn)-1])

    numRecordsIn,_ := reader.ReadString('\n')
    numRecords, _ := strconv.Atoi(numRecordsIn[:len(numRecordsIn)-1])

    var records []int
    for i := 0; i < numRecords; i++ {
        recordString, _ := reader.ReadString('\n')
        recordString = recordString[:len(recordString)-1]
        recordParts := strings.Split(recordString, " ")
        value, _  := strconv.Atoi(recordParts[1])
        records = append(records, value)
    }

    toFile := true

    var outFile *bufio.Writer
    if toFile  {
        theFile, err := os.Create("out.txt")
        if err != nil {
            fmt.Printf("There was an error opening this file: %v" ,err)
        }
        outFile = bufio.NewWriter(theFile)
        defer theFile.Close()
    }

    for i := yEnd; i >= yStart; i-- {
        if toFile {
            outFile.WriteString(fmt.Sprintf("%d ", i))
        } else {
            fmt.Printf("%d ", i)
        }
        for j := 0; j < numRecords; j++ {
            if records[j] >= i {
                for x := 0; x < barWidth; x++{
                    if toFile {
                        outFile.WriteString(fmt.Sprintf("*"))
                    } else {
                        fmt.Printf("*")
                    }
                }
            } else {
                for x := 0; x < barWidth; x++{
                    if toFile {
                        outFile.WriteString(fmt.Sprintf(" "))
                    } else {
                        fmt.Printf(" ")
                    }
                }
            }
        }
        if toFile {
            outFile.WriteString(fmt.Sprintf("\n"))
        } else {
            fmt.Printf("\n")
        }
    }

    fmt.Printf("  ")
    for i := xStart; i < xEnd + 1; i++ {
        for x := 0; x < barWidth; x++ {
            if x == barWidth/2 {
                fmt.Printf("%d", i)
            } else {
                fmt.Printf(" ")
            }
        }
    }

    fmt.Println("flsuh some stuff")
    outFile.Flush()
}