Showing 16 items after Monday, 20-May-13 11:00:00 CEST


CodeSOD: The Truth of the Matter

From The Daily WTF on Monday, 20-May-13 12:00:00 CEST (clear older than this)

When Ben found this block of code, he had some questions: who wrote it, and what was it supposed to do?

if (showOptionsButton == true)
   showOptionsButton = false;
if (showOptionsButton == false)
   showOptionsButton = true;

The genius responsible was Jim, one of the senior developers. On paper, Jim was Ben’s mentor. What was the code supposed to do?

“Well,” said Jim, “I want to toggle the state of showOptionsButton. If it’s true, it should be false, if it’s false, it should be true.”

“Except,” Ben said, “this will just always set the value to true.”

“No it won’t.”

“Yes, it will,” Ben said.

“No it won’t.”

They executed that loop a few times before Ben attempted to break out. “It will. You need an else clause.”

“If I use an else, it’ll run both clauses. I only want it to run one.”

Ben gave up on trying to correct Jim’s logic. "You could just do, showOptionsButton = !showOptionsButton.

“I’m trying to change the value,” Jim said, “not compare them. I’d love to explain the basics to you, but I really need to get this feature finished.”

Ben let his mentor get back to work.

Remy will be wandering the halls as an attendee at Tech Ed, 6/3-6/6. He'll have a stack of stickers and buttons, if you can find him. Think of it as a scavenger hunt.

[Advertisement] Make your team a DevOps team with BuildMaster. Pairing an easy-to-use web UI with a free base platform, BuildMaster gets you started in minutes. See how and others use BuildMaster to automate their software delivery.

Irreal: A Fast Open for init.el

From Planet Emacsen on Monday, 20-May-13 12:39:48 CEST (clear older than this)

Like me, Bozhidar Batsov is always fiddling with his init.el file. As a result, he’s devised a way to open it quickly. He wrote a bit of Elisp to load it and bound the Elisp to the simple key sequence 【Ctrl+c I】. That’s a pretty nice solution and one that Irreal readers might expect me to adopt.

I, however, have a different strategy. I have 4 or 5 files that I use all the time. I have them bookmarked so I can load them easily but I don’t need to do that very often because I just keep them loaded. I use desktop-save-mode so they stay loaded even across Emacs invocations. Then when I want to examine, say, init.el it’s just a matter of 【Ctrl+x bin or maybe just 【Ctrl+x bi depending on what ido has in its cache at the moment. That’s not as fast as Batsov’s 【Ctrl+c I】 but it’s fast enough1.

One of the commenters to Batsov’s post suggests using the bookmark facility with a label of, say, i for init.el. Then you can open init.el with 【Ctrl+x r b i】. That gives us at least 3 ways of solving the problem, which is really the point. With Emacs you can solve problems in a way that’s comfortable for you. How do you solve the problem of opening frequently accessed files?


1 Basov’s solution opens init.el in another window so his solution is faster still if you have that requirement. If I needed that, I’d use 【Ctrl+x 2】 first. If I always wanted a separate window, I’d probably adopt Batsov’s solution.

NWS Announces Big Computer Upgrade

From Slashdot on Monday, 20-May-13 14:04:00 CEST (clear older than this)

riverat1 writes "After being embarrassed when the Europeans did a better job forecasting Sandy than the National Weather Service Congress allocated $25 million ($23.7 after sequestration) in the Sandy relief bill for upgrades to forecasting and supercomputer resources. The NWS announced that their main forecasting computer will be upgraded from the current 213 TeraFlops to 2,600 TFlops by fiscal year 2015, over a twelve-fold increase. The upgrade is expected to increase the horizontal grid scale by a factor of 3 allowing more precise forecasting of local features of weather. The some of the allocated funds will also be used to hire some contract scientists to improve the forecast model physics and enhance the collection and assimilation of data."

Share on Google+

Read more of this story at Slashdot.

Open Source Projects For Beginners

From Slashdot on Monday, 20-May-13 14:49:00 CEST (clear older than this)

itwbennett writes "Whoever said 'everyone has to start somewhere' has clearly never tried contributing to an open source project — the Linux Kernel development team in particular is known for its savagery. But if you're determined to donate your time and talents, there are some things you can do to get off on the right foot. Of course you should pick something you're interested in and that you use. Check, and double check. You should also research the project, learn about the process for contributing, and do your utmost to avoid asking questions that you can find the answers to. But beyond that there are some hallmarks of beginner-friendly open source projects like Drupal, Python, and LibreOffice — namely, a friendly and active community, training and mentorship programs, and a low barrier to entry."

Share on Google+

Read more of this story at Slashdot.

UK Hackerspace builds mobile spaceship disaster simulator

From Hack a Day on Monday, 20-May-13 15:01:40 CEST (clear older than this)


A spaceship simulator sounds fun. But a spaceship disaster simulator is pure win. Members of the LHS Bikeshed hackerspace over in the United Kingdom poured their hearts and souls into this build. Now they’re taking the show on the road, letting attendees of Maker Faires all over the UK try their hand at beating the Kobayashi Maru disaster simulation.… Read the rest