Texas Curriculum Standards
First off: Dwip, damn you for posting about this Now, on to the meat of this oh so interesting story. The Texas State Board of Education has gone and done something rather stupid. It's a rather long, boring, and mostly dry account that someone apparently blogged "live" while observing the debate over what changes to make in the curriculum standards for the Texas school system. Usually these things aren't a major concern, but a couple of things have shown up in here that I just can't let go.
Right up front, I want this out of the way. That site above bills itself as "A Mainstream Voice to Counter the Religious Right". Do keep this in mind, because that has all the hallmarks of code for "we're crazy lefties trying to hide our agenda".
#1: The board members have voted to remove Thomas Jefferson from the world history standards. Yes, that's right, you can read the site for yourself. Apparently the old buzzard isn't important enough for them to mention anymore. Nevermind that Jefferson is one of the most influential founders of our nation. Forget about the fact that his writings include the Declaration of Independence and a substantial portion of the Constitution. My gut is telling me this isn't the result of right-wing politics gone awry. I don't know about anyone else, but as a self-proclaimed right-winger I consider Thomas Jefferson among our most important founders and cannot fathom any reason to drop him from the study of US, if not world, history.
No, he's not just that weirdo on the $2 bill or the 5 cent piece! His writings inspired a great deal of political upheaval and outright revolutions in Europe as well. Only progressives/liberals have any interest in obscuring the history of our great nation like this. The so-called religious right has no real motivation to do so.
#2: The board wants to remove language from their economic study standards that mentions capitalism. The reported reason? "The board’s far-right members have repeatedly complained (absurd) that “capitalism” is a negative term". Ok, I'm having an awfully hard time swallowing that the "far-right" would care one way or the other about using the term capitalism. That's what it is. Most folks I know, left, right, or otherwise, use the terms capitalism and free enterprise interchangeably. Removing the term capitalism from the standards is just crazy. I don't know a single Republican or Conservative who would ever think that capitalism is a negative term. Just watch Glenn Beck for a few minutes and he'll probably use the word without thinking about it. I'm sure a lot of people would consider him far-right.
So again, something isn't quite passing the smell test for me about who these board members really are. Regardless of that, it's still crazy talk to call capitalism a negative term. Unless of course you happen to be a socialist or a communist.
#3: One of the other board members, Mavis Knight, offered up another amendment for the standards. This one covering the 1st Amendment and the protection of religious freedoms. "Knight points out that students should understand that the Founders believed religious freedom was so important that they insisted on separation of church and state." Sounds good, right? The next chunk in the minutes has this: "Board member Cynthia Dunbar argues that the Founders didn’t intend for separation of church and state in America." Guess what? Cynthia Dunbar is exactly right. The founding fathers did not intend for there to be the so-called separation of church and state. Their entire philosophy of government was based on having God involved. Go over their writings, and it's unmistakeably clear that this is so. The separation only came during the 1960s with a series of Supreme Court rulings that shattered the moral underpinnings of our nation.
Pretty sorry stuff, right? Well, again, I'm calling BS, based entirely on this chunk:
12:35 – Knight’s amendment fails on a straight party-line vote, 5-10. Republicans vote no, Democrats vote yes.
So wait. These guys spent an entire web page whining and complaining about how the far-right faction on the board is ramming things down everyone's throats.... yet the Democrats have the overwhelming majority on this board? Yes, it all starts to make much more sense now. Bizarre vote to drop Jefferson's writings, bizarre vote to strike capitalism as a negative term, bizarre vote to claim the founders intended for there to be a separation of church and state. I'm sure those far-right Democrats are just nasty horrible evil people, aren't they.
Pi Day
So I popped over to Google to do a search for something when I noticed their special logo. Apparently since today is March 14, it's Pi Day. Yes, that π, the one from your math classes so many years ago. That really interesting number that goes on and on after the decimal place and never stops. Pi has apparently been calculated out to about 1 trillion digits now, and still even in all that has never repeated itself anywhere. You'd have figured after that many digits it must have, but they say no. The best I can do from memory: 3.141592653589
Personally I always found it fascinating that π is so tightly bound to the characteristics of circles. It's used to find the surface area of a flat circle, the volume of a sphere, the volume of a cylinder, and probably a bunch of other round things I can't think of at this hour. It makes me wonder, if we can never get a truly exact value for it, do we ever know the truly exact areas of circles or volumes of spheres? It's not like a square where you just go Area = AxB and you're done. πr2 doesn't yield an exact value since you have to settle on an approximated value. Most math courses settle on 3.14.
So, in honor of randomness, π, and just because I'm feeling rather bored and needed the laugh, I hereby dedicate this post to Pi Day and forward-date it to 3/14 1:59am. Har har har
Toyota's Downfall
Sitting in the living room eating my dinner when the news comes back from commercial. Another story of a Prius owner whose accelerator got stuck and took him on a wild ride. James Sikes was out on Inerstate 8 in San Diego County, minding his own business when he moved to pass a slower vehicle. That's when it all started. The accelerator in the Prius he was driving became stuck and he soon realized he was in real trouble.
James dialed 911 and informed CHP dispatch that he was unable to regain control of the vehicle and needed help. The operators tried to talk him through how to disengage the stuck accelerator but he ended up having to put the phone aside because he could no longer maintain control with one hand. The car was refusing to comply with the brake and James was flying down the freeway at around 90mph when CHP finally showed up.
The CHP officer who gave his statement to channel 9 reporters said himself that he could smell the smoking remains of the car's braking system, and could visibly see that Mr. Sikes was doing all he could to try and bring the car to a halt. CHP managed to get Sikes to engage the emergency brake and then shut the engine off once the car got down below 55 mph. Once the engine was off, the car coasted to a stop on the side of the freeway without further incident.
When reporters spoke to Sikes, he indicated to them that he'd already had the car in to the dealer for the recall notice and they supposedly fixed the issue. Needless to say, he'll be back to give them a piece of his mind in the morning. Who could blame him! Toyota has said they are dispatching a specialist to inspect the car. Hopefully they do a better job this time than they did before.
This isn't the only major incident like this recently either. I can't find any links to it online, but a couple of weeks ago the KFI talk show host on the air at the time was talking to a woman who had a similar incident to Mr. Sikes.
She was driving on one of our freeways and her accelerator became stuck. After an equally useless effort to mash the brakes to make it stop, she used her emergency brake and nothing happened. She got even more desperate and pushed the transmission into neutral, thinking that would stop the car eventually even if it blew the engine. Unfortunately this did not happen. Much to her surprise, the car continued to accelerate. By this time she was in excess of 100mph and decided to try one more thing that should have ended it. She threw the gearshift into reverse.
Conventional wisdom says at this point the transmission should have been shattered from the sudden reversal and the car would eventually come to a halt. This was not the case. Instead, the car rapidly slowed and then accelerated - in reverse. So now picture driving backward down a busy California freeway at insane speeds of almost 100mph in a Prius. The woman figured she was about to die and had called her husband on the car's built in phone to say her good byes. Somewhere along the way, she slammed the car into the center divider of the freeway and the force of the impact was enough to disengage the transmission and bring the car to a stop.
Her husband arrived shortly after, and a tow truck pulled up a bit later to remove the wreckage. In the process of loading the car onto the flatbed, the tow operator asked the husband to put the car into neutral so he could pull it up. Not thinking about it, he did, and the car's engine tried to start back up and caused it to jump! The woman now has signed affidavits from both her husband and the tow truck driver that the incident happened exactly as she described.
Toyota has commented in both cases that the scenario is impossible. They insist the car's circuitry will not allow these situations to happen. The only problem is, Mr. Sikes has a CHP report to back up his claims, along with news footage of part of it. The other woman may not have that, but she certainly has the tow truck operator's statement and a wrecked car to show for it. Digging a bit further, Google reveals that there have been 56 reported deaths all attributed to accelerator problems in the Prius and other models over the last FIVE years.
So I have to ask. Is this the downfall of Toyota? After the recall over the braking systems and stuck accelerators they are still having issues, and there's plenty of buzz about other problems as well. Toyota used to make great cars and you'd have been hard pressed to find better other than Honda. This issue will haunt this company for years, if not decades to come.
Using GDB to Diagnose a Crash
This is a repost of an article I wrote ages ago. I'm posting it here now just for posterity.
Ok. So you're fiddling around one day with the latest and greatest nifty new feature for your MUD. You've labored for hours adding the code, playing with it to get things just right. You've compiled it, and GCC didn't raise any complaints. You're home free.... except... wait? What the hell does it mean "Segmentation fault (core dumped)" and why won't the MUD boot!
Chances are at some point in your coding career you'll be greeted with this dreadful scenario. All of us have been there at one time or another. All of us know what it feels like to scratch your head wondering what happened.
My background in coding is primarily with Smaug muds, and specifically with the AFKMud project. I've had my fair share of things go wrong over the years and I'm no stranger to core dumps. I also find it's best to cover these things with real examples, so I'll share one I just caused in my own code today. In order for GDB to provide you with meaningful information, you need to make sure your MUD has been compiled to provide debug information. This is generally done with the -g parameter. I tend to stick with -g2 or better. This will usually be found on one of the flag lines in your Makefile.
We're in the process of moving AFKMud to use C++ code, and some of you may be aware of pitfalls involved. I just got done making descriptors into a class and am still shaking things down. Lo and behold, I reboot, run a command, and am greeted with:
[samson@boralis: ~/Alsherok/src] Segmentation fault (core dumped)
Uh oh, looks like I fubared something. The first thing you need to do when a core dump happens is determine where your core file is. With Smaug, the core file will usually end up in your area directory. So you'll need to go there. Change into your area directory, and you should type something like:
gdb -c core ../src/smaug
In my case, AFKMud moves the core to the same directory as the source code, so I would do this:
[samson@boralis: ~/Alsherok/src] gdb -c core afkmud
Upon doing so, I am greeted by a whole bunch of output:
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh) Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type \"show copying\" to see the conditions. There is absolutely no warranty for GDB. Type \"show warranty\" for details. This GDB was configured as \"i386-redhat-linux-gnu\"... Core was generated by `../src/afkmud 9500'. Program terminated with signal 11, Segmentation fault. Reading symbols from /lib/libcrypt.so.1...done. Loaded symbols for /lib/libcrypt.so.1 Reading symbols from /usr/lib/libz.so.1...done. Loaded symbols for /usr/lib/libz.so.1 Reading symbols from /lib/libdl.so.2...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /usr/lib/libstdc++.so.5...done. Loaded symbols for /usr/lib/libstdc++.so.5 Reading symbols from /lib/tls/libm.so.6...done. Loaded symbols for /lib/tls/libm.so.6 Reading symbols from /lib/libgcc_s.so.1...done. Loaded symbols for /lib/libgcc_s.so.1 Reading symbols from /lib/tls/libc.so.6...done. Loaded symbols for /lib/tls/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /lib/libnss_files.so.2...done. Loaded symbols for /lib/libnss_files.so.2 Reading symbols from /lib/libnss_nisplus.so.2...done. Loaded symbols for /lib/libnss_nisplus.so.2 Reading symbols from /lib/libnsl.so.1...done. Loaded symbols for /lib/libnsl.so.1 Reading symbols from /lib/libnss_dns.so.2...done. Loaded symbols for /lib/libnss_dns.so.2 Reading symbols from /lib/libresolv.so.2...done. Loaded symbols for /lib/libresolv.so.2 #0 0x080fafa5 in descriptor_data::compressEnd() (this=0x8a5a2f0) at features.c:158 158 if( !mccp->out_compress )
Wow. Ok. So it's basically told me it loaded all of the symbols for everything the MUD uses. What does all that mean? Generally not a great deal. Everything above where it says #0 is system libraries you won't need to worry about. It's the stuff after that you need to pay attention to.
So now you have a general idea of what caused the problem. Something in the compressEnd() function did something it wasn't supposed to do. This however is generally not enough information to go on. You probably want to know what led up to this problem. So with that in mind, you'll want to trace the history of what caused this. Fortunately GDB makes that easy with the bt, or backtrace
command.
(gdb) bt #0 0x080fafa5 in descriptor_data::compressEnd() (this=0x8a5a2f0) at features.c:158 #1 0x080f2634 in ~descriptor_data (this=0x8a5a2f0) at descriptor.c:136 #2 0x0814ece7 in rent_adjust_pfile(char*) (argument=0x8a573df \"******\") at rent.c:1542 #3 0x0814fcc9 in rent_update() () at rent.c:2108 #4 0x0814530f in do_pfiles (ch=0x8a0b570, argument=0xbfffbf8c \"tar -cf ../player/pfiles.tar ../player/*\") at pfiles.c:550 #5 0x08113e61 in interpret(char_data*, char*) (ch=0x8a0b570, argument=0xbfffd9f6 \"\") at interp.c:907 #6 0x080dc9e9 in game_loop() () at comm.c:785 #7 0x080dd651 in main (argc=2, argv=0x8a0bcf8) at comm.c:1233 #8 0x40154758 in __libc_start_main () from /lib/tls/libc.so.6 Current language: auto; currently c++
The backtrace will be listed in reverse, starting with the first function the MUD called, and ending with the last one it was in when it crashed. In this case, it began in main() and ended in compressEnd(). So why did it do this? You find that out by entering the stack "frames", or functions, and asking it what certain things were at the time. So in this case, we'll check frame 1,
which is in descriptor.c on line 136:
(gdb) frame 1 #1 0x080f2634 in ~descriptor_data (this=0x8a5a2f0) at descriptor.c:136 136 compressEnd( );
You see here the call to compressEnd(), ok, that's not enough info yet.
Lets look at the call that killed it, in frame 0:
(gdb) frame 0 #0 0x080fafa5 in descriptor_data::compressEnd() (this=0x8a5a2f0) at features.c:158 158 if( !mccp->out_compress )
Aha, this is a hint - something in features.c on line 158 is amiss. Start checking this line methodically. Begin by asking it what "mccp" was equal to at the time:
(gdb) print mccp $1 = (mccp_data *) 0x0
This tells you that the "mccp" portion of the call was NULL, 0x0 stands for NULL, basically the absence of any data. Nothing, zero, zilch, etc. In this particular case, telling us that the structure which holds the data for this person's mccp_data is empty. It hasn't been initialized. Attempting to access NULL data in any way will result in a crash, which is what happened.
Now that you know what happened, lets exit GDB.
(gdb) quit
You should return to a shell prompt. It's time to go fix your bug and try again.
Hopefully this article has proven useful. There are more advanced things you can do with GDB, but this should cover the basics of investigating a crash after the fact.
In reference, this is the code which crashed:
descriptor_data::~descriptor_data()
{
close( descriptor );
DISPOSE( host );
delete [] outbuf;
DISPOSE( pagebuf );
STRFREE( client );
compressEnd( );
DISPOSE( mccp );
}
And this is what fixes it:
descriptor_data::~descriptor_data()
{
close( descriptor );
DISPOSE( host );
delete [] outbuf;
DISPOSE( pagebuf );
STRFREE( client );
if( mccp != NULL )
compressEnd( );
DISPOSE( mccp );
}
Noting in the second version that we verify mccp isn't NULL before ending compression.
Lost Time
If your biological clock is off by a slight amount, you're not imagining things. The massive 8.8 magnitude earthquake in Chile did more than just kill people, damage property, and send killer waves into the ocean. It also knocked the earth off its access a bit and has shortened the length of the day. Now before anyone goes into a mass panic and runs for the hills because the end is near, it's not quite as dramatic as that. As it turns out, we've only lost 1.26 microseconds off of each day. That's one millionth of a second. Earth's axis was also tilted by about 3 inches. It's been described more or less as the same principle as a figure skater pulling their arms in and spinning faster.
It's not the first time this has happened either. Remember the 9.1 earthquake in Indonesia that spawned the tsunami that killed 250,000 people? That quake also shifted the Earth's axis and shortened our days by 6.8 microseconds. The awesome power of a single event like this is pretty staggering. That's a lot of rock that needs to get moved around for the rotational axis of the planet to shift.
Looking back through some of the bigger quakes on record, Chile suffered a 9.5 back in 1960. The maps indicate it was along the same fault line, but I can't find anything floating around out there to suggest whether it shifted the axis or shortened our days at all. Logically speaking it should have though.
Anonymous
Search
Recent Comments
Blogroll
Blog Categories