Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
User Journal

Journal Journal: Circular dependencies in three languages 1

Here are six files for ya, showing a problem in 3 different scripting languages. What will they do?
--------- test1.php:
<?php
require 'test2.php';

define('SOMECONSTANT','hello world');

function foo() {
                return SOMECONSTANT;
}

echo foo(); echo "\n";

--------- test2.php:
<?php
require_once 'test1.php';

echo foo(); echo "\n";
--------- test1.py:
#!/usr/bin/python
import test2

SOMECONSTANT='hello world'

def foo():
                return SOMECONSTANT

print foo()
--------- test2.py:
#!/usr/bin/python
import test1

print test1.foo()
--------- test1.rb:
#!/usr/bin/ruby
require 'test2.rb'

SOMECONSTANT='hello world'

def foo
                SOMECONSTANT
end

puts foo()
--------- test2.rb:
#!/usr/bin/ruby
require 'test1.rb'

puts foo()
---------
Ok, scriptfiends, predict the output of these three commands:
php -q -f test1.php
python test1.py
ruby test1.rb

and then do some pasting and try it out. Match your predictions?

The PHP one bit me pretty hard today.

User Journal

Journal Journal: One Too Many 2

I have a password written on a post-it note underneath my keyboard. Decades went by without this ever having happened, but now I have one of these. [rationalize]And I'm keeping the post-it, because it'll probably be months or years before I ever need that password again, so there's just no chance I'll be able to remember it (it's actually a pretty well-made password).[/rationalize] OTOH, I suppose I could just throw it away and then the next time I need it, ask someone for it again. [truth]But no, it amuses me that I've entered the ranks of people with passwords on post-its at their desks, so I'm keeping it, for that reason if nothing else.[/truth]

United States

Journal Journal: Koster/Larsen Debate 2

Many people, including myself, were disappointed that the Koster campaign chose to not participate in the KCTS 9 debate last Thursday.* But the next day, the pair debated and TVW has the video online.

If most voters watch this debate it's hard to see how Larsen could be re-elected, for one simple reason: everything Larsen said was about increasing the size, scope, power, and influence of the federal government. For every problem, Larsen sees the federal government as the solution. Even when Larsen correctly identifies mistakes Bush and the Republicans made in the last decade, Larsen indicts himself and his fellow Democrats because they want to do the same things the Republicans did, except more and bigger. Koster wants to go in the other direction: forward to liberty and smaller government instead of the monster debt that the Democrats and Republicans gave us last decade.

* I personally disagree with the Koster campaign decision to not participate on Thursday. Their stated reason was that Herald reporter and columnist Jerry Cornfield was one of the panelists, and the Koster campaign deemed him unacceptable because he's on the left, and they didn't believe he'd be fair. My take is that Koster could have handled Cornfield just fine, and that there's far less-fair journalists out there that Koster will run into if he's elected, and that he should have done the debate ... especially since, as this debate shows, the more Koster can put himself out there, side-by-side to Larsen, the better he looks: and that's something no journalist can take away, no matter how unfair they are.

Cross-posted on <pudge/*>.

United States

Journal Journal: Larsen and Koster on KCTS 9 9

Last night KCTS 9 had nice profiles on both John Koster (R) and Rick Larsen (D-inc.), the candidates for Washington's Second Congressional District (whom we collectively interviewed recently here on Sound Politics). The KCTS piece uncritically showed Larsen's dishonest ad falsely accusing Koster of wanting to privatize social security, and referred to an "anti-incumbent" wave that is generally understood to be anti-establishment, not anti-incumbent, but otherwise it was a pretty good piece.

The discussion afterward, however, was fairly awful. All of the pundits -- including former state GOP chair Chris Vance -- said the only thing Koster has going for him is the "wave" in favor of Republican candidates. Joni Balter said Koster is "rigid" and "inflexible," while Larsen has "been there" for his constituents (as if Koster hasn't been). Perhaps she missed the memo that most voters in the Second CD want government to "be there" for us by being a lot less "flexible" on government spending.

Next Thursday, October 21, at 7 p.m., KCTS 9 will host a debate between Larsen and Koster. Tune in!

Also check out this non-endorsement endorsement of Koster by the Seattle Times. They call Larsen out for his dishonesty, his lack of fiscal responsibility, and his desire to increase taxes. They praise Koster for his fiscal prudence, his experience, his responsible record, and says he would benefit Congress. But they say they don't endorse him because he agrees too much with his own constituents: he is anti-abortion, anti-gay marriage, and is (as every scientist and responsible politician is required by the rules of logic to be) skeptical of anthropogenic global warming.*

The Seattle Times says they endorse Larsen, but at the same time, they demonstrate that Koster would better represent his constituents. Draw your own conclusions.

* If you're a liberal, you're supposed to be skeptical of religion, skeptical of politicians, skeptical of authority and media of every kind, but not skeptical of anthropogenic global warming. Even the IPCC leaves open the door that AGW may not be true; how could any lay person think there's no room for that? To decry skepticism in the face of uncertainty is to be anti-intellectual, and it is incumbent upon every policymaker and scientist to remain open-minded on all such issues.

Cross-posted on <pudge/*>.

User Journal

Journal Journal: What a socialist is 9

Anyone who defines what a socialist IS and states that therefore someone is NOT a socialist doesn't understand the word "socialist" or the English language very well.

The fact is, "socialist" has many meanings. In both French and English, for around 150 years, "socialist" has had a definition -- which has been very commonly used, even to today -- of, simply, massive social control by government for the purpose of taking from some people to give to others. As Bastiat said, for example:

Now, legal plunder can be committed in an infinite number of ways. Thus we have an infinite number of plans for organizing it: tariffs, protection, benefits, subsidies, encouragements, progressive taxation, public schools, guaranteed jobs, guaranteed profits, minimum wages, a right to relief, a right to the tools of labor, free credit, and so on, and so on. All these plans as a whole -- with their common aim of legal plunder -- constitute socialism.

Socialism does not just regard the ownership of the means of production. It's never only meant that, not in our lifetimes. Obama does favor controlling society through "an infinite number of ways" in order to take from some people to give to others. This is a perfectly reasonable, correct, and valid use of the word "socialism" ... and it's not a matter of "human dignity," but a matter of whether government should be the instrument of providing that "dignity." I contend that destroying liberty to give "dignity" to someone else is itself taking away the dignity of all.

Or, in other words of Bastiat:

Mr. de Lamartine once wrote to me thusly: "Your doctrine is only the half of my program. You have stopped at liberty; I go on to fraternity." I answered him: "The second half of your program will destroy the first."

United States

Journal Journal: Murray Pretends There Is No Deficit

Several times in tonight's debate, Senator Patty Murray said that keeping taxes at their current level would make it impossible to fund critical federal programs. But the Democratic Congress, with Murray's votes, has shown no restraint in spending caused by a lack of revenue, racking up deficits of trillions of dollars.

On what planet does anyone believe that the Murray, or the Democratic Congress, is restrained by a lack of revenue?

Cross-posted on <pudge/*>.

User Journal

Journal Journal: From Cloud back to the CLI

It is hard to remember the early days of Linux. A time when the greatest struggle was finding applications that did what we could do in Windows, applications like Office, AutoCAD, Outlook, etc...

I remember, with fondness, looking at very powerful tools like SIAG or PINE, that could do what I wanted to. While easy enough for a novice like me, the learning curve was long. But it was long because it had such depth and power, at each step the skills I learned seemed to make my mind sharper and my processes simpler. But there were still some very easy tasks I wanted to do that were out of my reach. How do I collaborate? Do they need learn what I've learned just to work with me in these tools? How do I just do (said task) by clicking on this?

Sure, OpenOffice came around and back then it was StarOffice, an app that was so phobic of the X interface that it encapsulated itself within its own desktop. Its gotten much better since then, but at some point I abandoned it for TexMacs, which produced cleaner and more beautiful results that, once again, worked into very simple processes to be productive. TexMacs can hook into many scientific programs that I found very useful, and it published within structured templates that I expected when I wanted to write something (for the most part).

Then an amazing thing happened. I could say it was just Google, but really it was the cloud. Google was just one of the first that realized that if they could get everyone to use their servers, they could collaborate with each other much more easily. The world if ease expanded with RSS feeds, labels which allowed a multidimensional way of categorizing emails beyond the folders I was used to. Its search function was so efficient that I found I didn't need to even categorize and organize most of what I had. Amazon and Ebay seemed to catch on to the same trick, if everyone used their servers they could provide each other's products in ways which were much more convenient for sellers to find. Amazon soon packaged up the proprietary data center management as the Cloud so others could have the same results. It was, in essence collaboration in a simple and easy to use maner. It was social networking, facilitated through central computers who seemed to know everyone and everything around them.

And as far as those applications go, the Cloud is still an exciting and glorious place. In fact the Cloud can be seen as the necessary infrastructure to enable the advent as smart-phones. I see smart phones as nothing more than handy personal interfaces to the vastness of the Cloud.

Perhaps now that I have satisfied the need collaborate, with all the vast sums of knowledge it keeps me connected to with a screen I can fit into my pocket, I'm finding that for personal productivity nothing beats the command line. I'm giving up on using Google and web interfaces to do the things I need to do, and going back to the power of the command line.

Case in point, Personal Finance Software. Its a killer app that I've never found anything that I was satisfied with. I've tried Cloud, Linux and Windows list of usual suspects. I've observed that there are many contenders for simplified finance managers based on many different paradigms (like YNAB). But in the end, I've found "Ledger" and I'm quite happy with the ability to use VI or Emacs, or even sed, to keep my ledger in my own way as a simple text file, while the 'ledger' command line program understands it and simply gives me stats and reports. I've even found ofx.py, a little script to download my banking information which ledger also understands. Now I finally feel like I have a long learning curve again. And once again I have that feeling of conquest, that at every step of the way I'm getting sharper, smarter, and more able to handle and process more information in successively easier ways.

But that isn't all. Since smart phones have all the graphical and UI candy I might ever need, I found myself pairing back my laptop's desktop. I've found myself drawn to the philosophy of a site called "suckless.org", which offers very simple tools to do very simple tasks. Only I divert from their tools in two instances, I use EvilWM and UZBL instead of their very fine alternatives. But that is neither here nor there.

The real jewel that expresses the new ease of desktop management through the CLI is 'dmenu', which is a cross between beagle and a dock but is usable in so many more situations. For instance, UZBL uses it to do URL completion based on what is in your browser history. Sure, my laptop has power to spare to run Beagle, Cairo-Dock, and such. But dmenu's simplicity is really its value, and especially how many times I find myself needing to use it for things like Ledger to do automated completion of all the accounts I use -- within vi. Cairo-Dock in particular does its job well, but dmenu has a certain simplicty to it which makes it useful to do the same job in so many different instances.

And that, right there, is probably the best way I can describe why I'm trending towards the CLI in my life. Because after some time in the field, I get it. I get why it works. And it is all about personal productivity, or if you will, process productivity.

United States

Journal Journal: State Liquor Status Quo "Economically ... Doesn't Make Sense" 1

Am I the only one who noticed that in Robert Mak's piece on the liquor privatization initiatives on KING 5, a supporter of the status quo said that the status quo doesn't make economic sense?

John Guadnola, Executive Director of the Washington Beer and Wine Wholesalers Association -- which opposes both I-1100 and I-1105 -- said that if I-1100 passes, "[Safeway] won't have nearly the variety [as it has now] because economically, it just doesn't make sense for them."

But if it doesn't make economic sense for Safeway to have that variety, then why do we do it? If carrying a certain number of bottles in a local Safeway doesn't make economic sense, scaling up as we do now can't fix that problem. So Guadnola is basically admitting that -- in a time of severe recession, no less -- he and his group are backing a system that wastes money.

Of course, the truth is that wide variety will continue to exist. I've lived in several other states, all of which allowed retailers to buy with volume discounts and decide what they wanted to carry, and all of which had a wide variety of liquor widely available. We have one of the only states with this sort of a system, and all you have to do is look at the other states and see that almost every criticism of I-1100 is based on fantasy. The only true criticisms I've seen of I-1100 are that it would give us more access to the products we want to buy, which is, as best I can figure, a good thing.

(Oh, and I should also mention that the criticism that this takes money from schools is necessarily false. Any revenues lost by the schools -- if required to make "ample provision" for education -- must be made up by taking it from other programs, or increasing other taxes. Our Constitution requires it. For I-1100 to significantly hurt schools, our state government would have to violate the Constitution.)

Another truth is that the people most ardently defending the status quo, as well as the people behind I-1105, are no less influenced by their bottom lines than the backers of I-1100 ... and probably moreso. There are many people -- like me -- who don't consume liquor or are not in the liquor business, but value the freedom I-1100 provides.

But all of the people I've seen backing I-1105 or the status quo are in businesses that do, or would, profit from the government protection of their business interests, such as Guadnola's organization, whose members control about 95 percent of all beer and wine distribution in the state ... a virtual monopoly that is jeopardized by privatization. Of course, I have no problem with any of the companies represented by the WBWWA. They are probably all fine businesses doing fine work. I do have a problem with government being used to protect their interests, at the expense of the other interests of other companies and individuals.

My two cents? Vote Yes on I-1100, and No on I-1105 and other forms of government control.

Cross-posted on <pudge/*>.

United States

Journal Journal: Candy Tax

In order to avoid the new Candy Tax in Washington State, I am carefully selecting what candies to buy for Halloween. Candy is legally defined as not having any flour, so I am buying up Twix, Kit Kat, Twizzlers, and -- my favorite of all -- Nestle Crunch. Mmmmmm.

The funny thing is that I've found that flour products actually make me gain weight more than products more heavily based on sugar. I don't think Michelle Obama would approve of Christine Gregoire encouraging me to gain weight. And certainly, no one sane would approve of the government encouragement to punish the makers of certain candies over others just because it lists "flour" on the ingredients. But I must comply! Christine knows best!

Do your part by helping me and Christine punish the makers of candy without flour: make your Halloween a no-flour-free zone!

Cross-posted on <pudge/*>.

United States

Journal Journal: Koster vs. Larsen: Your Turn 3

The two campaigns for Washington's Second Congressional District, for incumbent Rick Larsen (D) and challenger John Koster (R), have agreed to answer questions posted by you, the readers and voters. This is going to be a close race, and perhaps one of the most-watched in the nation.

So here's how this works: you guys ask the questions, posting them in this Sound Politics discussion. I pick good ones and submit them to the candidates. They send their answers back to me, and I post them. I don't censor, edit, or modify their answers in any way (though as "interviewer," I may ask for clarifications, giving them a chance to revise their answers).

It's no secret that I want John Koster to win this election. But I'll do my best to pick good questions, and since everyone can see all the questions being asked by the commenters, everyone can decide for themselves if I did a reasonable job.

I'll close the questioning at the end of this week. Everyone -- from libertarian to liberal -- is welcome to submit questions here, but not to engage in discussions about the questions or candidates, or to be abusive. Ask questions: don't answer them or fight about them.

Have at it.

Cross-posted on <pudge/*>.

United States

Journal Journal: Koster Winning, Berkey Losing

There are some surprising twists in our interminable Washington election.

Republican John Koster has come from behind to take the lead in the Second Congressional District race by 160 votes, and is likely to end up beating incumbent Rick Larsen. The good news for Larsen is that the total Democrat vote is over 50 percent; the good news for Koster is that independents who didn't vote in the primary will likely swing his way in the general.

Of course, Koster won the primary in 2000, too: but Larsen ended up winning the general. But it was an open seat in 2000, and that the incumbent might finish second in the primary is really bad for Larsen.

Similarly, incumbent Democratic Senator Jean Berkey (38th LD) is coming in third in her primary, and is likely to be eliminated from the general election ballot. At 32.24% of the vote, she's falling behing Conservative candidate Rod Rieger at 32.63%, and fellow Democratic candidate Nick Harper at 35.13%.

According to Jerry Cornfield at The Herald, she'd be the only incumbent for the state legislature to fail to get to the general election this year. More incumbents, like Sound Politics troll Geoff Simpson, are likely to lose in the general, though.

Cross-posted on <pudge/*>.

United States

Journal Journal: Best Email of the Day

From the Democratic Party: "The only thing Boehner seems serious about is raising campaign cash. After the speech, he told reporters that he's prepared to help Republicans spend $50 million to win back Congress. ... Democrats have a different plan. We're asking supporters like you to make a contribution to the By the People Fund."

How dare Boehner say he's trying to raise money! We're different: we want to raise money!

Cross-posted on <pudge/*>.

United States

Journal Journal: Larsen's Hypocrisy

As I mentioned yesterday, Rick Larsen criticized John Koster for saying good things about the Tea Party, even though Larsen himself has recently gone to a Tea Party candidate forum to try to get their votes.

And Larsen has twice criticized Koster over oil -- once saying Sarah Palin's endorsement of Koster would bring in money from oil companies, and then attacking Koster for wanting to drill more -- even though Larsen's the only candidate in the race to receive money from an oil company: BP.

And this morning I noticed that, despite attacking a display of flags from our nation's history that included the Confederate flag (which, last I checked, is part of our nation's history), Rick Larsen was at a presentation of those exact flags last summer. He's sitting next to the presenter, 38th LD candidate Hugh Fleet, in the fourth image in the slideshow.

Did Larsen tell the veterans in attendance of his disdain for showing the Confederate flag in a historical context? Probably not, just like he didn't tell the Tea Party members of his disdain for them, nor tell BP how much he hated oil companies when he took their money.

OK, actually, I am being too hard on Rick: he certainly, as a smart and rational person, does not hate Tea Party members or oil companies, nor does he have any problem with showing the Confederate flag in a historical context. He just dishonestly implies otherwise when it comes time to attacking his opponent.

Cross-posted on <pudge/*>.

Slashdot Top Deals

Serving coffee on aircraft causes turbulence.

Working...