Become a fan of Slashdot on Facebook


Forgot your password?

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).


Comment: Re:STL (Score 1) 757

by Arkh89 (#49229695) Attached to: Was Linus Torvalds Right About C++ Being So Wrong?

1. Check whether a string s ends with a suffix t.

What about :
!s.empty() && s.back()=='t'
Or, before C++11 :
!s.empty() && (*s.rbegin())=='t'

2. Check whether a collection c contains an element e.

For this one, the C++ implementation makes more sense than the other too : you can immediately store, test and work on the iterator and not wasting your time checking if the element is in the container, then find it again to work on it. If you don't need to use it, you can use std::count (because your container might contain it multiple times) as :
std::count(myContainer.begin(), myContainer.end(), theValue)>0
Or if you know that the element can only be present once, you should be using a std::set as container which already has a count function which only returns 0 or 1.

Split a string s into tokens based on whitespace.

std::string is still not very high level. Good parsing almost requires regexp methods which C++ did not have until recently (in the standard).
Otherwise, the first solution given in your link is verbose but does the job.

Do you have any other good examples?

+ - Russian opposition leader Boris Nemtsov shot dead in Moscow.

Submitted by Anonymous Coward
An anonymous reader writes "BBC News Reports

An unidentified attacker shot Mr Nemtsov four times in central Moscow, a source in the law enforcement bodies told Russia's Interfax news agency. He was shot near the Kremlin while walking with a woman, according to Russian-language news website Meduza. "Several people" had got out of a car and shot him, it added. Mr Nemtsov, 55, served as first deputy prime minister under the late President Boris Yeltsin in the 1990s.

Meanwhile, various sources report a massive gathering of protestors at the site of the shooting."

+ - Google's DeepMind developing artificial intelligent video game players->

Submitted by misosoup7
misosoup7 (1673306) writes "Smart programs have been beating humans are various games since the early 90's. The problem is that these programs are specialized and can only do one thing. The Deep Blue chess computer can only play chess, not even tic-tac-toe. The Google DeepMind team now has made a breakthrough against this "narrow" intelligence problem by creating an AI that can perform well across a variety of games. Published in Nature, the team describes their new algorithm. And you can watch the program play Space Invaders and Breakout at the bottom in the attached videos."
Link to Original Source

+ - NVIDIA Re-Enables GeForce 900M Overclocking

Submitted by jones_supa
jones_supa (887896) writes "One week after NVIDIA disabled overclocking on their GeForce 900M mobility lineup, a representative of the company has reported that NVIDIA will be bringing back the disabled feature for their overclocking enthusiasts on the mobility front. On the GeForce Forums he writes: "We heard from many of you that you would like this feature enabled again. So, we will again be enabling overclocking in our upcoming driver release next month for those affected notebooks. If you are eager to regain this capability right away, you can also revert back to 344.75.""

+ - Wayland 1.7.0 Marks an Important Release->

Submitted by jones_supa
jones_supa (887896) writes "The 1.7 release of Wayland is now available for download. The project thanks all who have contributed, and especially the desktop environments and client applications that now converse using Wayland. In an official announcement from Bryce Harrington of Samsung, he says that the Wayland protocol may be considered "done" but that doesn't mean there's not work to be done. A bigger importance is now given to testing, documentation and bugfixing. As Wayland is maturing, we are also getting closer to the point where the big Linux distros will eventually start integrating it to their operating system."
Link to Original Source

+ - Microsoft Open Sources CoreCLR, the .NET Execution Engine->

Submitted by Anonymous Coward
An anonymous reader writes "As par of Microsoft's continuing project to open source the .NET framework, the company today announced that CoreCLR, the execution engine for .NET Core, is now available on GitHub. CoreCLR handles things like garbage collection, compilation to machine code, and IL byte code loading. The .NET team said, "We have released the complete and up-to-date CoreCLR implementation, which includes RyuJIT, the .NET GC, native interop and many other .NET runtime components. ... We will be adding Linux and Mac implementations of platform-specific components over the next few months. We already have some Linux-specific code in .NET Core, but we’re really just getting started on our ports. We wanted to open up the code first, so that we could all enjoy the cross-platform journey from the outset.""
Link to Original Source

+ - Inkscape Version 0.91 is Released!->

Submitted by Bryce
Bryce (1842) writes ""Four years since the last major Inkscape release, now news is out about version 0.91 of this powerful vector drawing and painting tool. The main reason for the multi-year delay is that they've switched from their old custom rendering engine to using Cairo now, improving their support for open source standards. This release also adds symbol libraries and support for Visio stencils, cross platform WMF and EMF import and export, a native Windows 64-bit build, scads of bug fixes, and much, much more. Check out the full release notes for more information about what has changed, or just jump right to downloading your package for Windows, Linux, or Mac OS X.""
Link to Original Source

+ - Computer chess created in 487 bytes, breaks 32-year-old record->

Submitted by Anonymous Coward
An anonymous reader writes "The record for smallest computer implementation of chess on any platform was held by 1K ZX Chess, which saw a release back in 1983 for the Sinclair ZX81. It uses just 672 bytes of memory, and includes most chess rules as well as a computer component to play against.

The record held by 1K ZX Chess for the past 32 years has just been beaten this week by the demoscene group Red Sector Inc. They have implemented a fully-playable version of chess called BootChess in just 487 bytes."

Link to Original Source

Comment: Re:But then don't some have to go FASTER than ligh (Score 1) 139

by Arkh89 (#48886223) Attached to: Scientists Slow the Speed of Light

May be, but only for a very short period of time, otherwise the average speed would be increasing or decreasing. So in average they might all move at c/n (in medium of index n) but on a very short time scale they might go slightly faster, or slightly slower, just not always faster or slower...

Never underestimate the bandwidth of a station wagon full of tapes. -- Dr. Warren Jackson, Director, UTCS