Open Side Menu Go to the Top

04-28-2013 , 06:16 PM
holy mother of god! how did i never know of this:

Code:
set -o vi
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
04-28-2013 , 07:08 PM
I have seen some issues with the data type in jQuery.ajax() be resolved by making sure the server sets the content type to application/json.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-28-2013 , 08:35 PM
Quote:
Originally Posted by Neil S
You're not a real programmer unless you program your computer with an interface of 9 switches and a pair of red LEDs.
Kids these days don't even know how to wire up a vacuum tube. They'll never make it far without the basic skills.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-28-2013 , 08:37 PM
Quote:
Originally Posted by ballin4life
I find that most things in programming aren't really based on how smart you are as much as how knowledgeable you are. If you have never worked with a piece of technology then when others talk about it it will sound like crazy technobabble. But it's not that they are super-geniuses, it's just that they know stuff you don't.

And I find that many times if you spend some time googling whatever they were talking about then it all will make at least a bit of sense.
This is how I felt listening to good2cu and The Usher discuss a hand of poker one time in a live SNG we were all playing in. I followed for a while then had no idea what they were talking about for the last half of it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 12:04 AM
Oh my god, you guys.

Try searching these forums for posts containing: @property
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 12:10 AM
Quote:
Originally Posted by mburke05
anecdotally, i've been told python is kind of c+ dummy ver., and that i should really be learning c+ if i want to get into programming. but from what i've seen so far python is so user friendly, i absolutely love it.
Common argument, not just in programming, but in a lot of walks of life:

"I'm doing X the tough way because I'm smart."

"If there is an easier way to do X, a smart person has better things to do than doing it the tougher way."

All my formal training in CS was in C. Not C++, C. I've never felt the desire to learn C++ in part because just about everything I see in C++ that I can't get in C looks like the kind of stuff I'd use a higher-level language for, but not as good (also, from a beginner perspective specifically, C++ has all kinds of kludges and redundancies that could throw you off, while if you came from C you could think of it as "stuff that changed from C" and have an easier time remembering what was what). I linked someone else's mega-rant earlier in this very thread but of course welcome dissenting opinions from the 3 or 4 C++ people that post here.

Now, having said all that, Python does have a reputation for slowness that AFAICT is well-deserved. And learning C can actually help you keep from writing Python code that's slower than it has to be. For instance, if you know how to implement a string in C, you know why "+" on strings in Python is generally bad. This is both due to general computing principles and because the canonical Python implementation is written in C (so if you know enough about data structures you can often roughly guess how Python stuff is implemented)

Quote:
Originally Posted by gaming_mouse
those who espouse it often do know how to program properly in high level languages like python, and thus do not fully appreciate their expressive power and conciseness, and hide this fact from themselves by dismissing them as newbie languages.
This got me thinking about something I read recently. The author was talking about Python classes, and advanced an interesting hypothesis why you might see someone write a class like this:

Code:
class Greeting:
    def __init__(self, greeting='hello'):
        self.greeting = greeting

    def greet(self, name):
        return '{}! {}'.format(self.greeting, name)
His guess is that you see this because many people learn OOP in languages like Java and C++, which don't have first-class functions. In such a language, he argued, you'd need a class if you wanted the above thing in some contexts like passing it as a function argument, but in Python, you could just make it a function and pass the function itself. So a Java programmer "learns" Python, but not well enough to realize the full implications of it and writes things like the above as a result.

Based on what I know about C and Lisp, it seems to make sense. I can sympathize with Guido's desire to remove lambda from Python 3 because so many uses of it appear to be FPS*. C converts often don't take full advantage of ways to iterate, like, say:

Code:
# straightforward Python way
for guy in thing:

# C programmer who is used to not being able to do the above
for i in range(len(thing)):
if they know Python for at all. OOP people sometimes advocate getters and setters for everything without any apparent knowledge of the existence of __ mangling or the @property decorator. I actually read somewhere that the Python ternary is different from most languages in part to keep converts from overusing it. Whether that's true or not, this is a thing:

Code:
from __future__ import braces
I'm not sure about the implications of all of the above, or if I'm just babbling. But it seems like an argument for learning several languages if for no other reason than to feel out the difference between things you need to do and things you're used to doing.


*I talked about "fancy for the sake of fancy" some time back; I've now decided I'm calling it "Fancy Pants Syndrome" because it's caused by the same attitude as "Fancy Play Syndrome" and I get to keep the acronym
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 12:37 AM
Quote:
Originally Posted by Xhad
Oh my god, you guys.

Try searching these forums for posts containing: @property
A couple things I've noticed since posting this:

-@foo returns that db error message for some things, but @title gives the actual search page

-These "@" searches appear not to be subject to the normal time limit

If it's a reasonable guess that some field named "title" exists, then the two above combined would suggest a possible dictionary attack to find out what the rest of the fields are, I think? I know nothing about dbs but this seems bad. I may report my own post to the moderators, lol.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 12:46 AM
Interesting post, Xhad. I was actually thinking about starting a thread (or writing a ranty blog post) on a similar topic.

One thing I've noticed on SO is that people come to Clojure from either Java or Ruby and they cannot conceive of a world functioning without everything being an object. It's not even general confusion, it is pure unwillingness to even try to write a program without an object. Even the simplest things have to devolve into using (get-class) or (atoms) to even write a simple iterator. Just amazing how confused people become when they are faced with something they aren't used to. I would have thought there'd be an open-mindedness, but it appears that the polar opposite happens, where the mind snaps off anything that challenges their notion of what a program is.

It's not even a thing where functional programming and OOP is so different that they don't equate. Sure, I'm not an OO master by any stretch, but I am perfectly capable of writing simple OO programs and the concepts aren't beyond my head. I really wonder how people get so set in their ways like this.

Yeah, lambda really shouldn't exist in Python, and hopefully that "future feature {}" never comes to fruition. People are way too emotional about their petty garbage.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 12:52 AM
Quote:
Originally Posted by daveT
Java or Ruby and they cannot conceive of a world functioning without everything being an object.
Ruby supports functional programming, functions are first-class objects, and functions can exist on their own apart from any other object. It's inaccurate to lump it in with Java as an example of a language which is overly zealous about objects.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 12:58 AM
Quote:
Originally Posted by Xhad
*I talked about "fancy for the sake of fancy" some time back; I've now decided I'm calling it "Fancy Pants Syndrome" because it's caused by the same attitude as "Fancy Play Syndrome" and I get to keep the acronym
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 05:29 AM
Quote:
Originally Posted by gaming_mouse
Ruby supports functional programming, functions are first-class objects, and functions can exist on their own apart from any other object. It's inaccurate to lump it in with Java as an example of a language which is overly zealous about objects.
I shouldn't have mentioned any particular languages. It wasn't meant to be a slight towards Ruby or Java. I just picked the two most common backgrounds.

I was going through that website I build back in Nov / Oct. I wish I had a time machine to slap my old self upside the head really hard. Well... what it lacks in elegance, it makes up for in determination and heart.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 08:53 AM
Every piece of code I've ever written, when viewed 4 months later, looks like total dog ****.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 09:01 AM
Quote:
Originally Posted by Nchabazam
Every piece of code I've ever written, when viewed 4 months later, looks like total dog ****.
lol, +1 to that.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 09:37 AM
Quote:
Originally Posted by gaming_mouse
holy mother of god! how did i never know of this:

Code:
set -o vi
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 10:00 AM
Quote:
Originally Posted by Neil S
I think a pretty good nerd t-shirt would be:
Code:
     set -o vi

And there was light....
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 11:57 AM
I use shell vi mode, but I get slightly irritated about how if you move the cursor to the left at all then you can't move it to the end of the line anymore unless you enter command mode and use the A command. Also is there a way to use custom vi bindings? I just want to bind ;; = <esc>. I've googled both of these several times but no luck.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 12:02 PM
fwiw i love vi and hate set -o vi (as does everyone i've ever worked with except a few dudes at one company).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 12:39 PM
Quote:
Originally Posted by tyler_cracker
fwiw i love vi and hate set -o vi (as does everyone i've ever worked with except a few dudes at one company).
and to think, i used to respect you so much....
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 01:01 PM
set -o vi changed my life.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 01:04 PM
Quote:
Originally Posted by ballin4life
I use shell vi mode, but I get slightly irritated about how if you move the cursor to the left at all then you can't move it to the end of the line anymore unless you enter command mode and use the A command. Also is there a way to use custom vi bindings? I just want to bind ;; = <esc>. I've googled both of these several times but no luck.
agree, that would be a nice feature
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 01:20 PM
I just use PCKeyboardHack to make the key labeled Caps Lock be my Escape key.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 01:20 PM
Any book recommendations for a relative noob? My experience consists almost solely of 6.00x and I'm looking to teach myself as much as possible before transferring to a 4-year CS program next year (they teach mostly in Java). Already saw those OOP programming books from earlier.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 02:18 PM
Quote:
Originally Posted by daveT
Yeah, lambda really shouldn't exist in Python, and hopefully that "future feature {}" never comes to fruition.
Try that import in a python shell sometime.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 03:36 PM
Quote:
Originally Posted by ballin4life
I use shell vi mode, but I get slightly irritated about how if you move the cursor to the left at all then you can't move it to the end of the line anymore unless you enter command mode and use the A command. Also is there a way to use custom vi bindings? I just want to bind ;; = <esc>. I've googled both of these several times but no luck.
ballin,

not sure if it's possible to map ";;" to esc, but turns out it's possible to map a single key or a key combo. i did:

Code:
bind "Control-Space":vi-movement-mode
And you can ofc put in .bashrc or .inputrc to apply it to all terminals.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-29-2013 , 04:26 PM
Quote:
Originally Posted by TheMetetrown
Any book recommendations for a relative noob? My experience consists almost solely of 6.00x and I'm looking to teach myself as much as possible before transferring to a 4-year CS program next year (they teach mostly in Java). Already saw those OOP programming books from earlier.
http://ocw.mit.edu/courses/electrica...s-spring-2005/

Watch the 1985 videos, read the book, do as many of the book exercises as you can muster.

** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m