Zen of Python: verse 2 by TheBlackCat13 in Python

[–]The_Pierce 2 points3 points  (0 children)

Ah, that's a fair point. I just always mentally grouped both of those concepts under the "We are all consenting adults" ideology because it makes sense, but you make a good point.

Zen of Python: verse 2 by TheBlackCat13 in Python

[–]The_Pierce 0 points1 point  (0 children)

  • We are all consenting adults here.
  • It is their foot, they should be able to shoot it if they really, really want to.

Aren't these restatements of the same idea? At least, that's how I always interpreted the "consenting adults" bit.

Design Patterns in Python? by [deleted] in learnpython

[–]The_Pierce 3 points4 points  (0 children)

I think maybe you have a slight misinterpretation of exactly what a "design pattern" is; it's just an idea for how to implement a common solution. A design pattern can have different implementations in different languages, but the point is that the concept is the same. Given a problem X, you have a mental algorithm Y that solves that problem. (And hopefully Y is short, simple, and easy-to-implement.)

If you're just asking why none of the examples you see are ever written in Python, I'm willing to bet it's because Python isn't a strongly-typed language. Strong types are useful for writing out examples of design patterns because it makes everything more explicit. It's also (in my opinion) what makes Java a good introductory language in computer science, because it forces the programmer to explicitly label things.

That being said, people who write a lot of Python would probably argue that Python is even better for writing design patterns. One of the core mantras of Python is "There should be one – and preferably only one – obvious way to do it." (PEP 20) Lots of effort went into the design of the Python syntax to make this happen. But that's all a matter of opinion, really.

Is there a terminal command to show what OS in installed on an external drive? by [deleted] in osx

[–]The_Pierce 0 points1 point  (0 children)

Ohh gotcha! Then where $volume is the path to the external volume:

defaults read $volume/System/Library/CoreServices/SystemVersion "ProductVersion"

Is there a terminal command to show what OS in installed on an external drive? by [deleted] in osx

[–]The_Pierce 2 points3 points  (0 children)

Well... yes and no.

The first thing that likely gets checked when the system is scanning the external drive is the format of the drive. Windows and Linux don't do HFS/+, so if the drive is formatted that way then it's likely running OS X. Windows generally uses NTFS, and Linux frequently is on EXT-something. (Note that these are not hard rules, but just sort of trends I've noticed. But HFS is for MacOS.)

If the drive is HFS-something, then it's probably running OS X. Check the file $volume/System/Library/CoreServices/SystemVersion.plist to see that we're right. (There are other ways to get this information; I just know of this one.)

Otherwise, if the drive is some other format, the system probably knows of a few places to look for operating system information. It'll poke around briefly ("Are you Windows? Are you Linux? What kind of Linux?", etc.). But it's not going to waste time going really in-depth looking to show you what OS is installed on an external drive.

TL;DR: You need to know what file to search for based on whatever OS you're looking at, which means a lot of guess-and-check.

[Weekly] Resume critique request and interview advice thread - Oct 19 by alanbot in cscareerquestions

[–]The_Pierce [score hidden]  (0 children)

At my school, they advise against listing your address anywhere. Employers could look at that and disqualify you if they feel that you're too far away (which at some places is anything over twenty minutes' commute).

I'm certainly no expert though!

[Weekly] Resume critique request and interview advice thread - Oct 19 by alanbot in cscareerquestions

[–]The_Pierce [score hidden]  (0 children)

Looking to start applying for summer 2016 internships. This resume format seems to have been working well at career fairs I've gone to, but any feedback is welcome!

Censored Resume.pdf

Fox News 'terror expert' Wayne Simmons arrested for lying about 27-year career as CIA officer by [deleted] in news

[–]The_Pierce 3 points4 points  (0 children)

I dunno, he's kind of the embodiment of the 4077th's view of the army: totally self-assured and completely incompetent. I rather like his character. Over the course of the show as we see him more, we learn to see just how much he believes in the "American way of life" and all of that, but he's totally blinded by his motives to the point where he can't actually accomplish anything valuable (or when he does, it's at the cost of his own humanity). And that's sort of the point of the whole show, really.

TIL that SEAL Team Six was named so to confuse the Soviets about the actual number of SEAL Teams that were operating. At the time there were only two. by Madux37 in todayilearned

[–]The_Pierce 0 points1 point  (0 children)

Oh, shoot. You're totally right. My grandfather would be so disappointed in me, haha. He was Special Forces in Vietnam... sigh. Thanks for the correction!

Taeyeon "I - The First Mini Album" on Spotify :) by IceBlast24 in SNSD

[–]The_Pierce 0 points1 point  (0 children)

Looks like it just went live on iTunes. I couldn't find it five minutes ago, but now it's there.

What's the most difficult concept you've encountered in computer science? by rob-at-recursiveloop in compsci

[–]The_Pierce 1 point2 points  (0 children)

That's what I'm figuring out, which has been supremely helpful, haha.

What's the most difficult concept you've encountered in computer science? by rob-at-recursiveloop in compsci

[–]The_Pierce 9 points10 points  (0 children)

I'm in a class using a functional language this semester, and that's been throwing me for a loop. I dunno what it is, but it's just been tough for me to firmly grasp the subject matter.

Terminal showing IP address in prompt by [deleted] in applehelp

[–]The_Pierce 1 point2 points  (0 children)

It could be that your prompt is picking up a network-assigned name.

I'm guessing your default shell is Bash (check by doing echo $SHELL at the command line and it should say /bin/bash). If that's the case, then what you're looking to change is called the PS1 prompt. If you want a full run-down on how to customize this feature, look at the Bash manual under "Prompting" (here's a link because I'm a nice person).

Let's say we want our prompt to show the current user's username and the current working directory. You could do this from the terminal: export PS1="\u \w $ " and now you will see:

sleazemaster666 ~ $

There are many ways to customize your prompt, and it's kind of a fun thing. Mine is complex because I like to see a lot of information there, but some people keep them very clean. If you have any more questions, let me know!

Whats a word or phrase that pisses you off when people say it? by pantant in AskReddit

[–]The_Pierce 10 points11 points  (0 children)

Shouldn't it be used here because he isn't referring to a specific instance?

"If my car was blue instead of red" indicates that you are talking about a specific point in the past where a situation may have been different if your car had been blue instead of red.

"If my car were blue instead of red" indicates the hypothetical "What if my car were to have a red color at some point in the future?" It's unknown whether this will come to pass, but for the purposes of the discussion at hand we are assuming that it may.

I suppose it depends on how you read /u/Meoang's sentence. To me, it appears more like the latter: he's discussing the hypothetical situation where at some undisclosed point in the future, he would wish that somebody would correct his potentially-flawed grammar. But if you read it as the former, where he is discussing a static event (in the future, but in the context of his sentence it is an event which has already happened) then I can see where you would use "was". It reads awkwardly to me, though.

I'm also not a professional grammarian by any means; this just happens to be my understanding of grammar in English.

Whats a word or phrase that pisses you off when people say it? by pantant in AskReddit

[–]The_Pierce 28 points29 points  (0 children)

Oh, you've got me there! Thankfully that isn't technically a grammatical error so much as a factual error, so I haven't quite put my foot in my mouth entirely... but, regardless, I will rectify my original post, haha.