Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
User Journal

Journal Journal: How To Adapt To Climate Change

I keep seeing people, mostly out of fear of change, deep in climate denial.

But it doesn't have to be that way.

Is it hard to become energy efficient and reduce emissions while growing the GDP at twice the national rate? Sure. But we in the West have already done that. Just ask WA OR ID CA NV.

How? It's pretty simple. End fossil fuel subsidies. Not just the obvious ones, but end all the grandfather exemptions that allow old power plants to keep operating when they should either be retrofitted or retired.

Require 20-50 percent of all new energy built in a state to be non-fossil-fuel renewables. Currently, the cheapest are solar and wind. But look at a mix of energy, even for the West. It shows solar a small fraction compared to wind.

Why? Because we don't require solar as part of new building construction. Wait, Will, are you saying we have to put solar panels on every building? No. I'm saying use the most cost effective solar there is. Passive solar. Triple pane windows, curtains or blinds or polarized screens so you don't use energy cooling in the summer, but use solar in the day in the winter (and then close blinds). Using LED lights that turn off after an hour of no motion on a floor.

But no solar panels? No. Build new construction so it can support the weight of solar panels where it makes sense (south facing walls, or in valleys east or west walls) and be easily maintained. Cut regulations that drive solar panel costs to $7000 per panel (residential installation) so that it runs $300 per panel on NEW construction, so that the grid is designed to handle it. Make an earthquake interrupt switch so the solar kicks in to power critical systems if the grid drops for more than an hour. Wire in electric cars for storage.

It's not hard. We just have to think 21st Century, not 18th Century.

User Journal

Journal Journal: Chronicle: A little kayaking

On Sunday, i wanted to go kayaking at Kensington Metropark, which i've done in the past. I aimed to leave at 3 with a friend for the 20 minute drive, but we got there after 5. Regardless, they weren't renting boats due to high winds. So, off we went to Heavner Canoe & Kayak Rental, instead, which was on the way, and he had wanted to go to anyway. Specifically, Heavner is a route, we you go and come back or can be picked up. Kensington's Kent lake is just that, a lake.

We got there just after 6 and waited in line for a a few minutes. While that was going on, we reviewed prices and i used the outhouse for a moment. Unlike Kensington which has regular restrooms, Heavner has what seemed to be a plywood shack housing a toilet covering a hole in the ground. Nothing like the good outdoors. There was a man outside waiting for his son, making me comment "oh, there's a line," to which he responded, "there's always a line." At which point his son came out and they both left. After a minute or so, someone else tried the locked door and kept banging. I told him just a moment, and when i came out he apologized. I don't understand people.

Sticker shock then hit. At Kensington, it's $8/hour for a kayak, or $9 for a 2 person. At Heavner, all boats were $24/hour. We had about 45 minutes, so we took a 2 person kayak, knowing full well it'd be hard.

We must've pushed off at about 6:15, though in my mind it was still 6. We took a short oar and i long oar, i took front, as he is better than me, so him seeing me seemed better. It was a disaster. We splashed ourselves, we hit oars, we switched oars, we kept drifting and were unable to control it properly. The short oar was a really bad idea. We tried this and that, and finally got to the overpass. Ahead of us some people were swimming, and although it may have been fun, i decided to turn around. The time was 6:30, so in my mind, about a half hour, and i didn't want to perform so poorly with so many onlookers. We turned around and made it back at 6:45.

He was soaked, though not from me. I was wet, but not as much as he was. He made a comment to the person pulling us in how he couldn't get any wetter, or the like. To which he responded something between "oh yeah?" and "wanna see?". It was half funny. Anyway, we returned the oars and life jackets, came up front to pay. Another guy was there, who looked at the paper and expressed surprise over us only being out for 15 minutes. I told him it was more like a half hour, this wasn't our original destination, and i had to leave at 7. Although they do not charge for half hours, they do it anyway, but he was confused and asked me if he just charge the full hour anyway. I said sure, i paid and we left. On the way home, the usual 7:55 meeting was canceled. Whatever.

Some people there talked about having a coupon, and i saw there was some restrictions. A search finds them, but there is warning of knowing what it actually covers.

Overall, i had fun, even if it was for just a few minutes. I'm still debating whether it's worth paying 3 times as much to have a path to follow. But 2 kayaks next time. Definitely, 2 kayaks.

User Journal

Journal Journal: Belonging to a different era 1

Feeling a little nostalgic at the moment, but also beginning to sense a serious part of why I feel like a dunce today when it comes to computing when once I felt like a genius.

Quick wall of text on the Nostalgia bit

That article on Vector Graphics the other day reminded me a little of the S-100 bus, and the whole move to the PC ISA that came just before I really got into computing. The first computer I really touched was our school's RM 380Z, which was a proprietary CP/M based system, but exposure to that at school was mostly a "You can book 15 minutes to use it at lunchtime but otherwise the school maths teacher will use it to demonstrate things now and then." So the first computer I learned anything from was a friend's VIC 20. I then used a variety of cheap single-board-computers until my Amiga 500+, the most powerful of which was a Sinclair QL.

So... I never touched S-100. And I didn't really touch the PC until there was literally no other choice that was viable. S-100 was never an option for two major reasons: it was expensive, and it was crap. I mean, seriously, awful. S-100 survived because the home computing establishment's equivalent of the Very Serious People decreed it was Serious, and it was Serious because it was "standard".

A typical S-100 system consisted of the S-100 box itself - a dumb motherboard (very dumb, the only components on it were the edge connectors and a few capacitors and resistors to do all that magic EE specialists understand and I could never get my head around) enclosed in a card cage, plus a CPU card, a completely separate memory card or three, a completely separate disk controller, and a completely separate serial I/O card. The disk controller would be hooked up to a disk drive it was designed to control (yes, proprietary), which would be unlike around 90% of other disk drives out there - that is, if you were lucky. And the I/O card would be hooked up to a terminal that frequently was more powerful than the S-100 computer it was hooked up to..

Each combination of I/O and disk controller cards required a custom BIOS so you could run CP/M with it.

The bus itself was essentially the pins of an 8080 turned into a 100 line bus. So you were essentially wiring each card to an 8080, or something pretending to be an 8080, in parallel. This required quite a bit of hardware in each bus to make sure each didn't conflict with other S-100 cards.

Now, technically, you could get graphics (and maybe sound) cards, but that was unusual. Likewise, you could get more exotic CPUs - though getting software for them was a problem. But the typical S-100 system was text only with a Z80, and the typical S-100 system owner spent rather a lot of time trying to figure out how to order a "standard" CP/M application in a form that would run on their "standard" S-100 system, taking into account their disk drive that only 10% of the market used and their terminal that used VT-52 codes rather than VT-101 codes or (insert one of the other popular terminals here.)

Did I mention this is expensive? While the original Altair 8800 was $500 or so, it came with nothing but the card cage and motherboard, the CPU card, and a little bit of memory. And even on this, the makers barely broke even, expecting to make the profits on after sales. Useful memory, a terminal, an I/O card, a disk controller, and a disk drive, pushed up the prices considerably. Realistically, typical "useful" S-100 systems cost somewhere around $4,000.

Given all of that, it's not really surprising it got supplanted by the PC. Much is made of the fact IBM was taken more seriously by people outside of the personal computer industry in 1981, and that undoubtedly helped, but I can't help but feel that S-100 couldn't have survived for much longer regardless. You could buy a complete system from Commodore or Apple that was more capable for a third of the price even in 1981. The PC didn't need to be cheap, it had IBM's name behind it, but it was obviously more capable than S-100, and it was obvious that if the architecture was adopted by the industry, machines based upon it would be more standardized.

The "Feeling like a dunce" bit

So anyway, that was my train of thought. And it occurred to me that the fact I even have opinions on this suggests my mindset is still stuck there. Back then, even when you programmed in BASIC, you were exerting almost direct control over the hardware. You had a broad idea of what the machine did, what memory locations were mapped onto what functions, and every command you typed affected the computer in a predictable way. The computers themselves were (mostly) predictable too.

As time wore on, especially with the advent of multitasking (which I welcomed, don't get me wrong) you learned to understand your software would be only one party to how the computer behaved, but you understood that if you followed the rules, and the other programmers did too, you could kinda get your head around what was happening to it.

And you felt like a genius if you understood this. And I say "if", because it was possible.

At some point that stopped being possible. Part of it was the PC ISA, the fact an architecture from 1981 was still in use in the mid-nineties by which time it was long in the tooth and needed serious work. Its deficiencies were addressed in software and hardware. Intel essentially replaced the CPU, leaving a compatible stub there to start older applications, and the industry - after a few false starts - threw out most of the PC design and replaced it with the PCI architecture, again, like Intel leaving compatible stubs here and there to ensure older stuff would work. And Microsoft worked on making Windows the real interface software would use to access the hardware.

After a while, there were so many abstractions between your software and the underlying system, it really became hard to determine what was going on underneath. If I program, I now know there are rules I can follow that will reduce the chance of my application being a problem... today. But I don't know if that's the case for the next version of Windows, and all I know is how to reduce the chances, not how to eliminate them. I don't know if the Java I'm writing will generate a webpage that contains Javascript that will contain a memory leak that'll cause the part of the process managing the tab its in to bloat up an additional 100M or so. I can hope it won't, and use mitigation strategies to avoid things that might cause problems, but there are so many things outside of my control I have to trust now, it's just not practical.

Logically the right thing to do under the circumstances is to take back control, to use lower level APIs and simpler sets of rules, but in practice that's just not practical, and doing so means that my tools no longer fit inside the ecosystem with everyone else's. So it's not the right thing - it's actually the worst thing I can do, and if I tried to do it, I'd be shunned as a developer.

I was a genius once because I (mostly) understood the computers I was programming. I feel like a dunce today because that's just not possible any more.

User Journal

Journal Journal: FizzBuzz in Swift

The following is my prepared answer for anyone who asks me this stupid fucking question in any interview in the future.

extension Int
{
  func modBool(modulus: Int) -> Bool
  {
  return (self % modulus).boolValue
  }
}
 
for x in 1...100
{
  print((x.modBool(3) ? "" : "Fuck ") +
    (x.modBool(5) ? "" : "You") +
    ((x.modBool(3) && x.modBool(5)) ? "\(x)" : ""))
}

-jcr

User Journal

Journal Journal: GreaseMonkey scripts 6

I've been making use of GreaseMonkey for some time now. I found some scripts that i lie, namely Allow Password Remembering, Block youtube users, and Google Hit Hider by Domain. I've added a few of my own, Displaying Monk Levels and Checking Saint in our Book for ties, both for PerlMonks and now, Amazon Star percent to number.

I love Amazon Reviews, and those stars mean a lot to me. However, Amazon, in their great wisdom, decided to replace the useful numbers with useless percentages. Well, not useless, but compared to actual numbers, percents mean next to nothing. Who cares if 100% 5-star it, if that's only one person. I'd rather purchase a product with 80% 5-stars, but by a few hundred people. Sure, the number is on top, but who wants to do the math all the time?

To grab the number, the reviews page would have to be loaded for each star. So, i just did multiplication, which will be close enough. I guess the reviews page can get the actual number as opposed to multiplying, but this is good enough, and since it can be the same as the main product page which i did first, i'm not interested in putting in the effort to change it for the reviews page.

User Journal

Journal Journal: Chronicle: Had a problem conceptualizing recusion in Java

I'm reading Java: A Beginner's Guide by Herbert Schildt. Schildt really is good. The lessons are smooth, with small complete examples of everything, explanations, and learning in steps, that is, each chapter builds on what was learned in the past. It's not just a bunch of concepts thrown together.. Here's one case where the O'reilly book just didn't do the job. It was good, but not for learning (reviewing, perhaps.)

I'm typing in every example, skipping the comments though. Also, changing names when they use plurals. An array should be named num, not nums, because each member is an instance of a num. It acts as a collections of nums, but it is not what it is. It's the J/P thing again. In databases, which is J territory, it should clearly be singular. Each record is an instance of the singular object (table.) And, people who think of tables in the plural often come up with terrible deigns and write horrible queries. Their using the database to support a specific process (which always changes, anyway) and not to hold data. They never learn. But i digress. Programs are about getting something done, so, it is more likely it should be named in the plural. I guess i'm in the wrong here. Though, as my code is for me (as opposed to if i was on a team), i'm going to follow my own preference.

In the Self Test for Chapter 6, question 6 is: Write a recursive method that displays the contents of a string backwards. I hit a mental block with that yesterday and just couldn't get it right. I was amazed (read: horrified) that such a small thing could be so hard. I ought to be able to (know what i need to do to) write that in seconds. After some fumbling over char vs String, it was time to go home. Today i approached the code and fixed it in just a few minutes.

class test06
{
  static String backward(String a)
  {
    if(a.length() == 1) return a;

    return a.substring(a.length() - 1) + backward(a.substring(0, a.length() - 1));
  }

  public static void main(String arg[])
  {
    System.out.println(backward("abcdef"));
  }
}

When i first got the question, i misunderstood it. I saw his answer and realized i misread it, so i tried this. Compared to his answer, he cheats. He used .charAt() to print out one char at a time from within the method. Granted, the book does that at this point, but this one is truer. And, i need something to be proud about.

But why did it take me so long? At first, i assumed its because i'm not used to Java, recursion is silly in this case, and i don't usually do recursion. But that's not true. I had a problem conceptualizing it, its effective, and i do it occasionally in SQL. But there's the answer. I do it in SQL.

Recursive CTEs are a pain. While more versatile than Oracle's hierarchical queries (which have a number of their own benefits), they are also confusing to learn. At some point it clicks though, and then its just a matter of keeping things straight in your head. However, in SQL's recursion the inner most level is also the final level. Outside of SQL, the opposite is true.

It's convenient to have blame it on SQL, though i know it's not true. Embarrassing as it is, i hit a mental block on the concept. Nonetheless, SQL likely had something to do with my confusion. I love these "easy" tests.

User Journal

Journal Journal: Strange SQL Server 2014 behavior 7

I have a Select Statement that returns 4 rows. When used in a stored procedure as input to an Insert Into, though, it was returning five rows. I commented out SET NOCOUNT ON; which is added by the SQL 2014 template. It then returned 4 rows. To test that was what was really going on, I uncommented out SET NOCOUNT ON; and it is now returning 4 rows properly.

I made no other changes.

Anybody else ever run into anything like this??

User Journal

Journal Journal: Rant: Why i hate Java (simple, old debate) 4

Why do i hate Java? (And C too.) retardedNames, case sensitivity, offsets treated like indexes. These are examples of where programmers had good ideas but then unfortunately designed them into a language.

0 is not a number. A number represents a quantity and 0 is not a quantity. You don't declare an array less one because 0 is a number. However, it is treated as a number for convenience. Why then refer to an index in an array with 0 first? Okay, okay, i know. It's because the variable is just a pointer, and the index is really an offset. So then why use an offset to index an array? Seriously. In how many cases do you treat the offset as an index. And in how many do you treat it like an offset? I thought so.

Then there's the whole = vs ==. Debate over whether = should set or compare is understandable. Personally, i would never have used = to set, because most people use it to demonstrate equality. Not to test it, but to demonstrate it. As in any math equation we teach children. With that in mind, i would think it was more likely to be used to test equality rather than set it. Furthermore, pick the odd operator out: =, +=, -=, *=, /=. ^=. Yeah, yeah, those are for convenience. But how many times have you mistaken the double-character operator for anything else. Yes, but they have another operator that makes it obvious. Exactly. Isn't == obviously setting without an operation. x += y adds y to x then sets. x -= y subtracts y from x then sets. So, x == y should equal y to x then set. Slightly bumpy because it sets x to y and not vice versa, but its really easy to understand. And, earlier languages did it with :=. Same thing.

BASIC used = for both. Noone used LET outside of teaching. Regardless, context defined it anyway. Context is not available in Java because it allows you do do nifty things like increment an array offset while setting it. So, no context. Of course, this leads to bugs and the niftiness is often considered bad practice, but isn't it cool that we can do it?

I've seen absolute morons coding in BASIC. But never once had i seen them use = to do what they didn't intend. You know why? Because its impossible! Context rules. On the same note, i've read about talented programmers who made the mistake in C(++).

Prefix and postfix ++ and -- are a little different. They are not obvious (until you know what they do), and other than errors in logic, they are used as intended. They break context, per se, but that is what they are designed to do. Applying this to the poor = sign is just plain ridiculous.

Seriously, why are these things done when they are counterintuitive, prone to bugs, and bad practice? Were the designers brain dead, or just 31337 h4x0rz that hadn't grown up yet? Or, is everyone so blind to this because they never made this mistake.

Okay, the languages weren't designed inasmuch as they just ended up being used. But why? Was it because the pros outweighed the cons? Or was it because programmers actually like this nonsense?

User Journal

Journal Journal: Slashdot could recover top spot from Reddit

So Reddit - where most veteran Slashdotters have been hanging out these days - is melting down, and for good reason.

I've been coming back here more lately.

But man, there's things that Reddit does better. No limit on mod points, for one. A better story queue mechanism for another.

There is a window here, if Slashdot admins have the balls to try. Implement Reddit's up vote system and subreddits. Maybe limit the latter to departments more traditional for Slashdot, but allow all users to submit stories in the Reddit manner. Hell, just clone the thing! You'd get a huge amount of your readership back.

Maybe the Slashdot front page is curated a la /r/bestof to get that moderator filtered quality for the front page, but subslashes should be open season.

Is the spirit of Rob Malda still alive in /. HQ? Can a tiger team code this in a hurry? You should.

Ah, nobody will ever read this....

User Journal

Journal Journal: Thanks, Obama! 37

Talking to a Caribbean-based business acquaintance this week reminded me that, no matter my feelings for the Obama administration, I will be eternally grateful that he's taken Cuba off the table. Because in the pantheon of stupid american wedge issues, the Cuban embargo is near-lock for the title IMO.

Bonus conspiracy fun: The lifting of the embargo, and its timing could be seen as a nice little spoiler for the only 2 GOP candidates who have any shot at beating Hillary next year, Bush and Rubio. Most of the other candidates can choose a wide range of answers when presented with questions on the topic, whereas the Floridians actually have serious history and ties on this, making finessing the issue that much harder.

Oh, and before someone thinks they're clever by telling me that President Perry or whoever would just go back to the status quo faster than you can say "fuck you liberals!", good luck with that. The GOP only cared that it reliably delivered Florida's electoral votes, and it stopped doing that a good couple of cycles ago. It's dead, Jim.

"What people have been reduced to are mere 3-D representations of their own data." -- Arthur Miller

Working...