News for hackers. Stuff that matters.
Re:Idiomatic Python [video] by rodly on Wednesday March 13, 2013 @03:51PM (#5370719)
I wish C++ had a isMember method for its containers or a keyword like Python's "in". The most succinct way to do this currently (with vector for instance)

vector<string> naughtyList {"Bob", "Tom", "Rod", "God"}; string member = "Jerry"; for (string & each : naughtyList) if (member == each) // do stuff

/rant

Re:Idiomatic Python [video] by benhoyt on Wednesday March 13, 2013 @04:14PM (#5370837)
I'm not sure why "find" or "contains" isn't a member function of STL container types, but there is the std::find() function:

   bool xIsMember = std::find(v.begin(), v.end(), x) != v.end();
Edit: I admit this is terrible API design. When you want the v.begin()/v.end() combination 90% of the time, why not at least have a std::find() overload that does that for you? Or simply add "std::contains(v, x) -> bool"? You can write your own version of that, of course, but... my take-home point: API design is very important.
Re:Idiomatic Python [video] by awnird on Wednesday March 13, 2013 @04:46PM (#5371013)
Providing container operations as functions in <algorithm> operating on iterators means that someone implementing a new container with iterators immediately has a wealth of functionality available with no extra effort.

Also, containers that are most well suited to membership searches (std::set and std::multiset) do include find(Key const& key) as a member.

Re:Idiomatic Python [video] by ljos on Wednesday March 13, 2013 @05:05PM (#5371111)
I was just wondering, shouldn't it be python3 and not python2 when talking about idiomatic python now adays?
Re:Idiomatic Python [video] by famousactress on Wednesday March 13, 2013 @05:17PM (#5371175)
That'll make sense just as soon as it's idiomatic to write python 3 :)
Re:Idiomatic Python [video] by pekk on Wednesday March 13, 2013 @07:26PM (#5371809)
Python 3 is not new, and it's not Perl 6.
Re:Idiomatic Python [video] by dfbrown on Wednesday March 13, 2013 @06:38PM (#5371594)
It would be nice if you resized your editor window to be as small as possible and cropped the video to that size. As it is the area of the video I actually care about is very small with lots of empty space around it.
Re:Idiomatic Python [video] by myko on Wednesday March 13, 2013 @03:09PM (#5370442)
Side note: the video player is really annoying, hitting the 'full screen' button uses the terrible full screen functionality of OS X rendering my second monitor useless.
Re:Idiomatic Python [video] by mortenlarsen on Wednesday March 13, 2013 @04:42PM (#5370997)
View source... download video.
Re:Idiomatic Python [video] by taude on Wednesday March 13, 2013 @04:41PM (#5370990)
Just upload to YouTube who's solved all these video hosting issues? And then I can click on the "Watch Later" button to add it to my queue...
Re:Idiomatic Python [video] by googletron on Wednesday March 13, 2013 @04:04PM (#5370797)
I will look into some options. I also find this troublesome. Especially when you are trying to work along side with the video.
Re:Idiomatic Python [video] by zozu on Wednesday March 13, 2013 @06:42PM (#5371606)
Yes, this. On Windows 7, switching from fullscreen to normal it resets the video and starts over again. Terrible player.
Re:Idiomatic Python [video] by danjessen on Wednesday March 13, 2013 @03:29PM (#5370560)
atleast it seams to load on your screen
Re:Idiomatic Python [video] by googletron on Wednesday March 13, 2013 @04:06PM (#5370803)
If you provide me with some information, I can definitely fix the issue for you.

What browser are you using? what version? What operating system are you using?

Re:Idiomatic Python [video] by japaget on Wednesday March 13, 2013 @04:20PM (#5370872)
Same problems here, get audio only:

Windows 7 Professional x64 SP1. No video on the following 3 browsers: Firefox 19.0.2, Chrome 25.0.1.1364.172, and Cyberfox 19.0.2 (a 64-bit build of Firefox). I get video, but the audio is choppy on IE 9.

It seems to work on my iPhone with Safari (iOS 6.1.2) but the bandwidth required is too great for my 4G connection.

Re:Idiomatic Python [video] by q_revert on Wednesday March 13, 2013 @04:34PM (#5370962)
audio only here too, Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20100101 Firefox/19.0
Re:Idiomatic Python [video] by 727374 on Wednesday March 13, 2013 @04:20PM (#5370871)
not working for me on Chrome Version 25.0.1364.152 m on Win7
Re:Idiomatic Python [video] by alienreborn on Wednesday March 13, 2013 @05:14PM (#5371158)
Re:Idiomatic Python [video] by tmrhmd on Wednesday March 13, 2013 @05:21PM (#5371194)
I liked your website and was going to sign up. However, your catalog of screen casts is too short to sign up for at the moment. On the other hand, does anyone know other python screen cast websites like this with more topics/videos?
Re:Idiomatic Python [video] by googletron on Wednesday March 13, 2013 @08:57PM (#5372390)
I am creating new content every week. I am also going to be creating content at a rate faster than one per week, to combat this exact complaint.

So see ya in 4 months?

Re:Idiomatic Python [video] by tmrhmd on Thursday March 14, 2013 @02:17PM (#5376698)
I'm in!
Re:Idiomatic Python [video] by hrayr on Wednesday March 13, 2013 @07:46PM (#5371960)
Off Topic: Looks like he's using tmux in the terminal, but does anyone know how he made the bottom panels look so awesome?
Re:Idiomatic Python [video] by influx on Wednesday March 13, 2013 @08:01PM (#5372058)
Looks like: https://github.com/erikw/tmux-powerline

See also:

https://github.com/Lokaltog/vim-powerline and *-powerline for shells, etc.

[deleted]
Re:Idiomatic Python [video] by jochu on Wednesday March 13, 2013 @04:25PM (#5370906)
I believe it's not emacs, it's Sublime Text 2