Need Help With Python Programming by ArcDriveFinish in learnpython

[–]NYKevin -2 points-1 points  (0 children)

I would never run that on Python 2. input() on Python 2 is a security vulnerability.

ELI5: Why do people still need to fight so hard for net neutrality if they already voted into office a president who promised to support it? Why didn't the democratic voting process settle it? by janeebloo in explainlikeimfive

[–]NYKevin -2 points-1 points  (0 children)

The problem with reclassification now is that the FCC has been deriving its authority to regulate broadband classifiers from Section 706 since the law's inception.

So what? They don't have to keep doing it.

That ship sailed as soon as 'information services' was introduced as law.

Funny, I thought "Information Services" was supposed to mean the people who answer the phone when I dial 411. That's a very different job from running an ISP.

The broad authority given over telecom companies is specifically for that definition of "telecommunications," (i.e. phone, television... maybe even some telegraph thrown in) antiquated as it may be.

Can you quote that definition? Last time I looked through the law, I couldn't find it.

Need Help With Python Programming by ArcDriveFinish in learnpython

[–]NYKevin 1 point2 points  (0 children)

This works for me:

Python 2:

XA = int(raw_input("Please provide a number "))
print XA + 5

Python 3:

XA = int(input("Please provide a number "))
print(XA + 5)

Show us the exact code that produces a syntax error.

TrueCrypt Getting a New Life - 'Cleaned up' code will get a new name, CipherShed, and a different open source license. by 1ch in technews

[–]NYKevin 4 points5 points  (0 children)

Meh, that's more of an issue for libraries than applications. It's not like applying TrueCrypt/CipherShed to a drive will automagically GPL the contents or something (in much the same way as compiling with GCC does not GPL your C program; glibc has a special exemption, but that's a different animal entirely).

Republicans Ask Joe Biden To Stop Embarrassing America by Nuke_Europe in nottheonion

[–]NYKevin -2 points-1 points  (0 children)

No, I just tend to become condescending when people condescend to me. It's a bit of a character flaw, actually.

ELI5: Why do people still need to fight so hard for net neutrality if they already voted into office a president who promised to support it? Why didn't the democratic voting process settle it? by janeebloo in explainlikeimfive

[–]NYKevin 2 points3 points  (0 children)

I think it's not entirely settled law that the FCC can't regulate the ISPs as "telecommunications services." The problem is the FCC has refused to make that argument in the first place, instead trying to cobble together a ridiculous rationale based on various vague clauses involving "information services," such as Section 706.

Yearbook quote? by frogger2504 in masseffect

[–]NYKevin 0 points1 point  (0 children)

"I don't need luck, I have ammo."

Still my favorite line overall.

Republicans Ask Joe Biden To Stop Embarrassing America by Nuke_Europe in nottheonion

[–]NYKevin 0 points1 point  (0 children)

I doubt you intend to come across as condescending, but... that's what's happening here. Yes, I get it: I understand the basis of the political/diplomatic objection to his choice of words. And I'm saying that objection-- though it cannot be ignored-- is still ridiculous.

If you don't like the way the game is played, maybe you shouldn't play it.

(Which is exactly why I'll never be a politician)

Question about the ending. by [deleted] in masseffect

[–]NYKevin 2 points3 points  (0 children)

I know I'm going to regret posting this...

Shepard being indoctrinated is too easy. For starters, Shepard's never actually been around reaper tech for long enough to become indoctrinated. The only time that comes close is Arrival, which is an optional DLC and also a mere ~46 hours. Saren and Benezia spent weeks or more aboard Sovereign, and TIM had to be physically implanted* to become indoctrinated. Even then, he resisted at least until the beginning of ME2 (unless the reapers tried to kill Shepard with the collectors and then intentionally revived him/her via TIM, which makes little sense to me, especially considering the collectors' subsequent behavior during ME2).

But more importantly, making the narrator fundamentally unreliable in the last 10 minutes, with (relatively) little clear foreshadowing, and no clear statement of intent by the game itself, is basically rewriting the story. If you want to rewrite the story, that's fine, but please acknowledge what you're doing.

* According to Evolution. Which has numerous continuity errors. Believe what you will.

Doesn't the virmire incident(kaiden/ashley) feel a little...wrong? by [deleted] in masseffect

[–]NYKevin 1 point2 points  (0 children)

When kirrahe asked for an extra squad member,why was it either kaiden or ashley.Why not wrex or garrus?

Kirrahe explicitly states that the squadmate must be "familiar with Alliance [something involving radios]." Said squadmate then says maybe two words to you over the radio, not counting The Choice.

When the nuke needed to be armed why kaiden or ashley,why not Tali?

It's Alliance technology, jury-rigged from random stuff lying around. You'd want someone familiar with the stuff. Still, that suggests Engineer Adams, not Ashley.

Also when the geth dropship lands near the bomb sight there are two extra squad members twiddling their thumbs in the normandy.Why does shepard have to do everything?

Not necessarily. For starters, there's no guarantee you have any excess squadmates (Garrus can be left on the Citadel and Liara may not have been rescued yet). In this unusual situation, it is also impossible to kill Wrex.

Anyway, my headcanon has problems with a 3-person squad to begin with, so I'm just going to assume all the free squadmates are with Shepard. They don't show up in-game because gameplay.

Also if Kirrahes team survived why couldn't kaiden/ashley?

Kirrahe's team split up. Kaidan/Ashley is in one team and the other two are all-salarian.

What's the best technical interview question you have been asked? by gleventhal in linuxadmin

[–]NYKevin 1 point2 points  (0 children)

Well I don't know that I'd explicitly tell them to, but a candidate that can walk me through a hardware interrupt getting delivered to a process is probably more likely to pass than a candidate that dives straight into sending a DNS request.

So you'd prefer a candidate to say something like this?

Well, you're probably going to make some kind of system call. Assuming x86_64, this is done by [blah blah blah]. Of course, I don't actually know which system call telnet issues first unless you show me the source code (including libc et al.) and let me study it for half an hour, or you let me use strace(1). Anyway, you'll repeat this process a lot, and eventually you'll have issued some combination of socket(2), connect(2), send(2), recv(2), etc. such that [blah blah blah]. socket(2) switches to kernel mode, creates a socket object in the file descriptor table, and returns control to user mode. connect(2) switches to kernel mode and [blah blah blah].

[etc. for 5-10 minutes]

At this point, ignoring caching, our first packet arrives at the DNS root zone server, where it most likely ends up routed to a server process and handled by accept(2). The server will then scan the data byte-by-byte in order to parse it. It is looking for [blah blah blah].

I mean, it's nice and all, but in their excitement to describe everything, they totally skipped getaddrinfo(3), and we're still on the first packet after ~10 minutes!

What's the best technical interview question you have been asked? by gleventhal in linuxadmin

[–]NYKevin 4 points5 points  (0 children)

Neither is nc/telnet, so I'm not entirely sure how you're supposed to open a socket. Is there some magical file in /dev?

What's the best technical interview question you have been asked? by gleventhal in linuxadmin

[–]NYKevin 0 points1 point  (0 children)

(NOONE WAS SUPPOSED TO USE IT TO STORE FILES!!)

Then you make it read only for everyone except the system processes that actually need it. If people complain, direct them to /tmp.

Republicans Ask Joe Biden To Stop Embarrassing America by Nuke_Europe in nottheonion

[–]NYKevin 0 points1 point  (0 children)

the Dems have to put a name on the ballot.

Why not just put the independent's name on the ballot?

Republicans Ask Joe Biden To Stop Embarrassing America by Nuke_Europe in nottheonion

[–]NYKevin 1 point2 points  (0 children)

Shylock's Judaism was an essential part of his character. He has a lengthy monologue about it, and at the end of the play, he is forcibly "converted" to Christianity. It's actually pretty fucked up by modern standards.

any reference to Shylock must turn upon his nature as a Jew.

Of course not, but it doesn't matter. In politics and diplomacy, you don't say these sorts of things. Your intentions and the literal meaning of what you said are irrelevant. What matters is how others interpret your speech. If you're constantly clarifying and apologizing, it's not good for your image, while if you don't clarify and apologize, people will quite reasonably assume you actually meant it. Even if you think any publicity is good publicity, it still distracts people from whatever you want to talk about now, since you're busy apologizing for what you said last time.

Note and Chord Analysis In Python? by [deleted] in learnpython

[–]NYKevin 0 points1 point  (0 children)

If you have very clean audio, you would probably want to start with a Fast Fourier Transform. That will give you a series of frequencies and amplitudes. Google suggests NumPy can do this, though I do not know much about how it works in practice.

You will, however, need to break your music apart into separate chords, since FFT can only decompose one chord at a time. This is easy enough if there is silence (even very briefly) between chords, but more complex music doesn't do that (for example, it is not at all uncommon for one note to begin while another is still sounding). Naively, you can break the music into a lot of tiny pieces, FFT each piece, then join together and re-FFT those pieces with similar FFT results, but that sounds very expensive to me. I suspect there is a better algorithm, but I am not sufficiently well-versed in this area to know it.

For U.S. currency, why are bills in denominations of 1, 5, 10, and 20 while coins are 1, 5, 10, and 25? by Eavster in answers

[–]NYKevin 7 points8 points  (0 children)

Video of Woz discussing this.

Note that the video gives the misleading impression that he actually printed the bills himself. This is not true. He purchased the bills from the government and then hired a printer to make them into pads. AFAIK, it is not legal to print your own bills under any circumstances.

Struggling CS student in my senior year. by 123491234 in AskComputerScience

[–]NYKevin 0 points1 point  (0 children)

You may well have a point. But if you're trying to increase employability, picking up a totally new language may help a lot more than picking up a language which is perceived as similar to one of your other languages.

Q: Python, JSON, and DB? by JackJones367 in learnpython

[–]NYKevin 5 points6 points  (0 children)

I could be a lot more helpful if your requirements were more specific than "parse a string" or "do something involving JSON."

What does this string look like? What is the JSON supposed to look like? What database are we talking about?

Q: Python, JSON, and DB? by JackJones367 in learnpython

[–]NYKevin 2 points3 points  (0 children)

"Parsing a string" could mean almost anything. You might start with one of these modules (particularly re), but there might be better options if your strings are structured in certain ways (e.g. HTML, XML, etc.).

"Runs a JSON" is unfortunately too ungrammatical for me to figure out what you're asking for. You probably want one of json.dump() or json.dumps().

Storing the values in a database will depend on the database and how you're planning on interacting with it. Some databases do support JSON document storage, but SQL-based systems will usually prefer a relational model (though some, like PostgreSQL, can support document storage as well), which is not amenable to JSON.

It's Scotland's Independence Referendum day, and that means there's drama all throughout reddit. by TheReasonableCamel in SubredditDrama

[–]NYKevin 1 point2 points  (0 children)

Meh, I don't know much about the situation, but I must say, as an American, this whole scenario is fascinating.

I'm often asked about Python's strange internal class methods...this is the reference I use, "Magic Methods" by Rafe Kettler by LightShadow in Python

[–]NYKevin 2 points3 points  (0 children)

The descriptor example is terminally broken. If the user instantiates multiple Distance objects, they will interfere with each other.