Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
User Journal

Journal Journal: Systemd - Efficiency and Pike's Rules of Programming 4

(DISCLAIMER: These are my notes and might be wrong.)

Lennart Poettering has never heard of Rob Pike's rules of programming. Let's examine why:

He said, "On my system the scripts in /etc/init.d call grep at least 77 times.... that has to be incredibly slow...., and should be rewritten in C."

You can time it yourself, with this command:

time for i in {1..77}; do grep user /etc/passwd > /dev/null; done

On my machine it takes 0.229 seconds.

Lennart didn't get the speed increase he wanted. From his benchmark report, "booting up with Upstart takes 27s, with systemd we reach 24s." This result isn't too bad: when I've made a similar mistake of writing code before timing anything, ignoring Pike's rules for programming, once I actually slowed the system down.

If you don't measure, you can't optimize.

For entertainment and enlightenment, here is a quote by Ken Thompson talking vaguely about Pike's rules for programming:

Early Unix programmers became good at modularity because they had to be. An OS is one of the most complicated pieces of code around. If it is not well structured, it will fall apart. There were a couple of early failures at building Unix that were scrapped. One can blame the early (structureless) C for this, but basically it was because the OS was too complicated to write. We needed both refinements in tools (like C structures) and good practice in using them (like Rob Pike's rules for programming) before we could tame that complexity.

User Journal

Journal Journal: SystemD: The Beginning 7

DISCLAIMER: THIS CODE REVIEW IS A LONG WORK IN PROGRESS, I COULD BE COMPLETELY WRONG IN ANYTHING I SAY.

To do a proper code review, you need to understand the purpose of the code, what all the stakeholders want. From my own perspective, init scripts work fine, but since Unix companies keep trying to create new init systems, they must have different needs than I do.

Here's a list of the stakeholders. I need to figure out what their goals are.
1) System admins.
2) Desktop users.
3) Distro builders.
5) Android (if systemd turns out to be good enough).
4) Programmers

My suspicion is that systemd has taken over because it makes things easier for 3.

At its core, Unix is a system for programmers. What other system comes with a compiler and multiple interpreters by default? Bash is so much more useable than DOS, or even powershell (yeah, go ahead and flame me but I'm right, Powershell doesn't even have < working). Unix was designed by programmers and for programmers.

The reason I'm talking about it is the traditional init process is incredibly discoverable. All you have to do is look in the /etc/rc directories, and you can figure out how your system boots. You can see it all. For a programmer it's easy. Poking around in the system to understand it is one thing that makes Unix great (and what I like about Slackware: the whole thing is lovingly crafted).

So that describes the approach I am taking to code review, and to the init process. Hopefully Systemd is an improvement.

User Journal

Journal Journal: success!

after ages of playing it low-key, i've managed to take my first karma hit ever by punching my abrasive style to the maxxxx! awesome. i hate this fucking place. too bad you guys can't kick me out. :) :) :) :)

User Journal

Journal Journal: Economics in Brief (Internet Flotsam)

Here's some internet flotsam attributed to a graduation speech by Thomas Sargent (without digging into whether this speech really happened: the content is interesting).

Economics is organized common sense. Here is a short list of valuable lessons that our beautiful subject teaches.

1. Many things that are desirable are not feasible.

2. Individuals and communities face trade-offs.

3. Other people have more information about their abilities, their efforts,
and their preferences than you do.

4. Everyone responds to incentives, including people you want to help. That
is why social safety nets don't always end up working as intended.

5. There are tradeoffs between equality and efficiency.

6. In an equilibrium of a game or an economy, people are satisfied with their
choices. That is why it is difficult for well meaning outsiders to change
things for better or worse.

7. In the future, you too will respond to incentives. That is why there are
some promises that you'd like to make but can't. No one will believe those
promises because they know that later it will not be in your interest to
deliver. The lesson here is this: before you make a promise, think about
whether you will want to keep it if and when your circumstances change.
This is how you earn a reputation.

8. Governments and voters respond to incentives too. That is why governments sometimes default on loans and other promises that they have made.

9. It is feasible for one generation to shift costs to subsequent ones. That is
what national government debts and the U.S. social security system do
(but not the social security system of Singapore).

10. When a government spends, its citizens eventually pay, either today or
tomorrow, either through explicit taxes or implicit ones like inflation.

11. Most people want other people to pay for public goods and government
transfers (especially transfers to themselves).

12. Because market prices aggregate traders' information, it is difficult to forecast stock prices and interest rates and exchange rates.

User Journal

Journal Journal: overrated again. 1

Wow.. took a break from slashdot for a while and already the mass down mods are happening again. Its no wonder why almost every story has posts with people crying about how slashdot has turned to shit. I guess it is a sign of how desperate someone's position is when they have to downmod with overrated just to stop an opinion they disagree with from being seen.

What's that saying about reality is everything that remains when you close you eyes and stop choosing to believe in something? I guess the same is true with the downmods. Just because they attempt to hide the comment doesn't mean the statement stops being true, it only means it stops being seen as easily. I can imagine a group of idiots sitting around plotting and planning thier down mod adventures in a comic book esq setting with them laughing about how they will win the war of whatever they deemed important at the minute, by not letting others speak or letting their speech be seen/heard. Then they stop to pop their zits and return to the plotting while declaring that if they are the only ones heard, they would always win,.

Of course the reality is probably much simpler and less sinister. It is more likely someone got but hurt by a comment made and while sitting in their mom's basement reassessing the pathetic life they live, decide to take their anger and frustrations out by mass downmodding someone they disagree with. They might pause for a minute to wipe the tears from their eyes, but are set to teach someone a lesson about having opinions contrary to their own.

User Journal

Journal Journal: good evening sodless godomites! 1

maximizing the experiential entropy, in the limit of large N, characterizes the geom(1/2) distribution.

rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat. rape my cat.

User Journal

Journal Journal: Geothermal vs Solar Power 1

Here are the basic numbers on aailable geothermal vs solar power (since this has come up in discussion more than once).

The surface area of the Earth is about 5.1 x 10^14 m^2. The cross sectional area is about 1.3 x 10^14 m^2 (one quarter of the surface area, of course).

Per this paper found as a cite on wikipedia, the total heat flow out from the Earth's interior is 4.42 x 10^13 W, or 0.0867 W/m^2. Of course, the available power is much less because it's only the subsurface-surface temperature difference that's available.

Total solar irradience is 1361 W/m^2 by NASA's latest estimate (so about 1.7 x 10^17 W across the entire cross section), or about 1000 W/m^2 on the surface at noon on a cloudless day. Averaged over the day-night cycle (surface area vs cross-section, so 250 W/m^2), and taking clouds into account that's about 180 W/m^2 (I can't find a solid source on that yet, but it looks close).

So, total solar power flow is about 4000 times as large as total geothermal flow. I'm not quite sure how to estimate the (ideal) available power as a percentage of the total geothermal power flow, but if we use a WAG of 50%, then the available power from solar is also about 4000 times per square meter more than geothermal - significantly more if we average solar power only across populated latitudes.

User Journal

Journal Journal: wtf 2

here i am, modding up trolls; aspiring gadflys; inarticulate racists; and even the occasional goatse link... and i'm still getting an average of 15 mod points a week!

User Journal

Journal Journal: Twin?

Just saw your nic and your sig, remarkably similar to mine. ;)

User Journal

Journal Journal: Slashdot trolled by Fox News

A recent Slashdot story claims that

"Some voters in Las Vegas have noticed that Democrat Harry Reid's name is checked by default on their electronic voting machines. By way of explanation, the Clark County Registrar says that when voters choose English instead of Spanish, Reid's Republican opponent, Sharron Angle, has her name checked by default."

Using a story from a local Fox news affiliate as a source.

Interestingly the current version of the Fox5Vegas story (marked "UPDATED: 6:39 pm PDT October 26, 2010") contains no mention of "default options" or "Spanish". It does contain a statement from Larry Lomax, the Clark county Registrar of Voters:

Clark County Registrar of Voters Larry Lomax said there is no voter fraud, although the issues do come up because the touch-screens are sensitive. For that reason, a person may not want to have their fingers linger too long on the screen after they make a selection at any time.

"Especially in a community with elderly citizens (they have) difficulty in (casting their) ballot," Lomax said. "Team leaders said there were complaints (and the) race filled in."

Has Slashdot been trolled by Fox news?

User Journal

Journal Journal: I have a list... (Climate scientists who don't believe in AGW). 2

I plaintively asked for a list of climate scientists who didn't believe in AGW and the estimable (arg!)Styopa came up with http://slashdot.org/comments.pl?sid=1715502&cid=32912336

Well, part of the problem is that the whole postulation of Global Warming (oh wait, it's merely Climate Change now, isn't it?) is such a hash of assumptions and begged questions. If an argument has 100 failed component parts, where do you begin in listing who's "opposed" to it?

That said here's a partial list of climate-specific scientists who have publicly critiqued one or more aspects of the general premise "The globe is generally warming and humans are a significant cause."

Richard Lindzen, Alfred P. Sloan Professor of Atmospheric Science at the Massachusetts Institute of Technology and member of the National Academy of Sciences

Garth Paltridge, Visiting Fellow ANU and retired Chief Research Scientist, CSIRO Division of Atmospheric Research and retired Director of the Institute of the Antarctic Cooperative Research Centre.

Hendrik Tennekes, retired Director of Research, Royal Netherlands Meteorological Institute:

Antonino Zichichi, emeritus professor of nuclear physics at the University of Bologna and president of the World Federation of Scientists

Chris de Freitas, Associate Professor, School of Geography, Geology and Environmental Science, University of Auckland

William M. Gray, Professor Emeritus and head of The Tropical Meteorology Project, Department of Atmospheric Science, Colorado State University

William Kininmonth, meteorologist, former Australian delegate to World Meteorological Organization Commission for Climatology

David Legates, associate professor of geography and director of the Center for Climatic Research, University of Delaware

Tad Murty, oceanographer; adjunct professor, Departments of Civil Engineering and Earth Sciences, University of Ottawa

Fred Singer, Professor emeritus of Environmental Sciences at the University of Virginia

Jan Veizer, environmental geochemist, Professor Emeritus from University of Ottawa

Tim Patterson, paleoclimatologist and Professor of Geology at Carleton University in Canada

Syun-Ichi Akasofu, retired professor of geophysics and Founding Director of the International Arctic Research Center of the University of Alaska Fairbanks

John Christy, professor of atmospheric science and director of the Earth System Science Center at the University of Alabama in Huntsville, contributor to several IPCC reports

Craig D. Idso, faculty researcher, Office of Climatology, Arizona State University and founder of the Center for the Study of Carbon Dioxide and Global Change

Patrick Michaels, Senior Fellow at the Cato Institute and retired research professor of environmental science at the University of Virginia

August H. "Augie" Auer Jr. New Zealand MetService Meteorologist, past professor of atmospheric science at the University of Wyoming

Reid Bryson, Emeritus Professor of Atmospheric and Oceanic Sciences, University of Wisconsin-Madison

Marcel Leroux Professor of Climatology, Université Jean Moulin

Frederick Seitz, solid-state physicist, former president of the National Academy of Sciences

Does that list seem trivial to you?
--
-Styopa

Which doesn't sound trivial at all. But who are these people?

Slashdot Top Deals

Kleeneness is next to Godelness.

Working...