Sunday, December 31, 2006
Caution: May be harmful if understood!
This evening I ended up talking to a few people about my enjoyment of this book. One commented that I seem to be jumping a few years ahead of where I'm currently at considering that I have never really taken calculus. I really enjoyed the chapter about "fundamentals of congruences". See, I've been trying to learn more about cryptography and congruences and their notation are very important to understanding it.
The interesting thing I noted however was the attitude some other took with my reading material. There were two people at two different times that told me that the book should be burned. Those who know me would probably appreciate that I really like books and the thought of getting rid of any books, let alone destroying them, is one I don't entertain often. As an example I cite my copies of the Turbo C 1.0 and Borland C 4.0 programmers references I still have.
I find it most interesting that the response to unfamiliar information would be to destroy it. One person even called it a "Horrible book". Granted, it's not exactly light reading, but I found there was pressure to not find it enjoyable. It's an attitude I don't really understand. So many people that I know have a tendency to say "I would never be able to understand that" anytime something unfamiliar comes up. It's too bad... It's a very limiting way of dealing with the world.
My tendency to try and understand the things I come in contact with have lead me to where I am today. Jumping in with curiosity has made me a good programmer and sysadmin. Taking the attitude that unfamiliar things are chances to find new and interesting things is the direct reason why I'm even thinking about things that make number theory necessary to understand.
The other day I told my brother Byron that I like learning things that bend my mind. Learning lisp did that. Now, learning about cryptography and number theory is doing it. A mind has to bend to allow something new and different to fit into it.
Perhaps that's the trouble with people who spurn the idea of learning new things... They don't want to let their minds bend and change to allow for new thoughts. I suppose then that they are just trying to help me avoid the pain they associate with trying to understand new things.
Sunday, December 24, 2006
'Tis the season
Not only is their gas being siphoned, but the container they're putting the gas in has a hazmat sticker on it.
The primary question I my mind however is who steals gas out of a church's van just days before christmass? The kicker is that it's the First Baptist Church of Layton and this was taken in west jordan.
I guess it sure beats sugar in the tank...
Friday, December 22, 2006
Post 100 and a new version of blogger
To commemorate this occasion I present you with a video of a man receiving a gift toy horse...
Sunday, December 17, 2006
Deer mounting...
Wednesday, December 06, 2006
Where do you fit?
I found this on reddit recently. It's an attractiveness scale displaying physical and mental attractiveness on each axis. Now it just begs the question... Where are you on this scale?
Sunday, November 19, 2006
1 Year
Pumpkin Pi
Shindig!
Living in Fear
The Constitution (Use as directed)
The Great Divorce
War on Life!
Dating Moratorium Update (rant)
Political Standing
Professional Piracy
Sonnet
Haiku
Excitement...
Moratorium then a veto...
Big Red Button
Business Opportunities
The Amazing Lord Kentos (TALK)
Friday, November 17, 2006
DDR 2
Guess which one is the nice one...
DDR is alot of fun. It's even better when others can participate. Now just to get a nintendo emulator and figure out how to put it into "Track and Field" mode...
Saturday, November 11, 2006
They don't call me DDR for nothing
My pad is made by a company called Cobalt Flux. Their pads are awesome!
Thursday, November 09, 2006
PIC Projects
Hardware design is the one area of hacking I really want to work with. Probably because it involves more real engineering than programming does. My interest also has to do with the fact that software can never expand out of the bounds of the hardware it works with. Ergo, build more hardware.
PS: Yes, I do see that I put 18F688 in the IC socket. I just didn't feel like going back and correcting it.
Wednesday, November 08, 2006
Ashdown is a real american
The video may take a moment to finish converting on youtube.
Tuesday, November 07, 2006
10:40 update
I find it shameful.
Shameful that Orrin Hatch can still be winning after declining to debate and ignoring the voters.
Shameful that the voters let him get away with it.
Shameful that so many people are just as out of touch with their candidates as our candidates are out of touch with their constituents.
If we don't do something we are going to be in even more serious trouble in this country.
Bob just called. Pete looks like he's about to give a speech.
The party party!!! 9:00 update
Making my way through the crowd I ran into Rob Miller. He is sporting the latest fasion in head wear.
Tonight I'm watching with great interest. It's my hope that Pete Ashdown will win. Right now I'm sitting in Ashdown's room using the internet service he had all through his campaign. Good luck pete!
Monday, November 06, 2006
Carrie Dickson
Last spring Bob and I went convention hopping. We went to the county conventions for both the democratic and republican parties. We also went to the state democratic convention. We would have tried for the state republican convention had they been on the same day.
The reasoning? We may be voting for some of the republicans.
Bob took his video camera to the republican convention and took video of me asking Carrie Dickson some questions about the security of electronic voting machines.
The audio for my questions isn't that great. For what it's worth I didn't realize he was filming until part of the way into the conversation.
My first question was about what will be done to assure the security of the voting machines. My last question that is hard to hear is what could be done to make the electronic voting machines tamper evident.
I was not very impressed with her responses. Yes, there is an oath of office, but just because a politician promised not to do anything bad doesn't mean there aren't those that will disregard such promises. She also referenced that there was an agreement signed that clerks would not tamper with the machines. In my view this precludes security auditing that is part of the reasonable due diligence process I would hope every clerk is going to go through.
Finally she says that we must remember that the security of voting systems is "only as good as your officials word".
Right...
Saturday, November 04, 2006
My first microcontroller
Today I earnestly worked on my Pickit 1 until I got the lights on the board to light up based on what the dial on the board is set to.
I think I can best demonstrate what I mean with youtube.
Yeah, it's fun. My next step is to control a servo with it. If I keep working at it I may have that later tonight, or next week if I decide to get out of the apartment.
Friday, November 03, 2006
Best BBQ
As I consider the many places I've eaten and the things I have enjoyed, I think that Pat's has just earned a special place in my heart. It was all I hoped good BBQ could be.
You should try it sometime.
Thursday, November 02, 2006
Happy Birthday Sarahbellum!
Today I learned how to use the video feature of my Canon PowerShot SD450.
Today I learned how to use YouTube.
Huzzah!
Wednesday, November 01, 2006
Oops... That kind of hurt
Me: Hey, what's up?
Friend: What are you doing right now?
Me: Getting a little work done.
Friend: Could you give me a ride to the emergency room?
Me: Ok, where are you?
Apparently my friend had put a 16 penny nail into the side of his middle finger earlier this morning. Turns out that kind of hurts...
He's not alone in having damaged his left middle finger. One of the nurses had messed hers up, and I have even had a little trouble with mine.
I'm not sure what it is about that finger that makes it such a target...
As for me. 7 years ago I learned a valueable lesson; when working with small explosives a statement of "I've made one of these before" in no way means you are working with a sound design.
At least I have a good reason to tell kids not to mess with explosives...
Embedded work
It's pretty cool. The goal is to get an embedded erlang environment running on it.
It didn't take too long. Once I rememberd that you can only open /dev/console when /dev/console exists things really came together. It only took an evening to compile the kernel and get the other utilities in place.
It's hard to get much more basic than this when running linux.
This all reminds me of the days when I worked at Century Software. Embedded linux can be fun. I hope to have time to do more of it.
Lappy comes home
That said... Lappy is home safe. In fact, I'm using it right now. It's nice to get back to business as usual. It's also nice not to burn myself on the end of the power cable.
Tuesday, October 31, 2006
Strangelove!
Andy indicated that he thought strangelove had a power chair, but watching the related scenes did in fact show that he pushed it under his own power.
Tonight is the singles ward party. I should do quite nicely as Dr. Strangelove. Now just to work on acting like my right hand has a mind of its own...
Friday, October 27, 2006
Living in Officespace
I remember a day when I had an office (shared) with a door that could be closed. It was beautiful. I could close the door, listen to music, and concentrate.
Those were good days... Days where you wern't privy to adjacent telephone conversations. Days where serious thinking could get done.
Mind, that isn't to say I can't concentrate now. Just the other day I managed to concentrate on something for a full 10 minutes before being interrupted. Not by a direct question. No, it was just a near by distraction.
With a little hard work at night maybe I'll be able to get one of my KCS projects to a point where I can start charging for services. That would be a fine improvement over the multiple jobs I have.
Winning the war
The main thing that jumped out at me was this quote at the beginning:
"Absolutely, we're winning," Bush said. "As a matter of fact, my view is the only way we lose in Iraq is if we leave before the job is done."
Has it ever occurred to anyone that our president may not be using the same metrics we are to determine success?
If the goal is to make them free; every day we stay gets us farther from that.
If the goal is to put them under our control and keep them there even after we leave then if we leave now we lose.
It is impossible for a man who takes away so much freedom at home to provide freedom elsewhere.
Instead he gives the people of Iraq a myth. A myth because that's what's left of the freedom we had. We raise our flags and talk of freedom while we wait for our government to do what's best. We support our parties so that the other guys don't mess things up.
But, do we ask? Do we ask what parties have done for us? Do we ask how we can do things ourselves? De we ask why it's so hard for good people to win when running for office? Do we ask how a candidate will vote instead of how much money he has raised? Do we vote for the one who will do a good job or do we hop on the bandwagon of someone who can "win it for the party"?
Bush may be winning his war, but sometimes I wonder who his war is against.
Wednesday, October 25, 2006
Pumpkin Pi
It was of course the Pumpkin Pi.
Bob tells me he's going to be carving more this weekend in preparation for a ward Halloween party. I may have to refrain from making a Pi out of one of them if he calls me for help.
Shaun
Monday, October 23, 2006
Mr. Lappy goes to Texas
One horse town (if that)
Wednesday, October 18, 2006
QC Movie of the day: Goonies
Lappy shows its age...
You can't see it in this picture, but the solder connection on the little power board has gone bad.
I got out the soldering iron and tried to fix it, but it doesn't look like the metal wants to bond with the solder.On the upside this is aparently a known issue with Averatec 3200 series laptops and they will still fix it for free on machines that are out of warranty. The downside is that they won't just send you the part so you can fix it yourself.
I'm going to have to say goodbye to my old friend the lappy for a little while so it can get fixed. It's going to have to be soon. The RMA number is only good for 30 days.
Shaun
Tuesday, October 17, 2006
I Win!!!
Then Rob Miller picked it up.
I may not be one of a kind, but I sure am close!
HowManyOfMe.com | ||
|
Friday, October 13, 2006
Blog Profile Photo
Tuesday, October 10, 2006
New projects need new stuff
It probably doesn't sound too bad, but when you type as much as I do and you find yourself correcting errors every couple of minutes in things that you know you typed correctly it gets old. This isn't a new problem. It's been a little funny for a couple of years, it's just that I haven't worried about it. I didn't use my Linux box that much.
Yesterday, I was having trouble with the Enter key. That's just not cool.
While I was out for lunch I stopped by CompUSA and picked up a new HP multimedia keyboard.
It was surprisingly hard to find this. All I really want is a classic 105-key keyboard. With the home, insert, delete, etc... buttons in the right place. I really don't like those ergonomic keyboards. Don't even get me started on remapping the function keys with the F-Lock.
I've been using computers long enough to remember my family getting a 386DX with 4MB of ram and thinking that was a great upgrade. I know what I like. With any luck vendors will continue to produce it.
Shaun
PS: Before the 386 we had the IBM AT. That was fun...
Erlang DNS Proxy
Packet: {58634,
33152,
1,
1,
2,
2,
[{<<"shaunkruger.com.">>, -- Domain name to resolve
1,
1,
<<192,12,0,1,0,1,0,0,115,20,0,4,64,20,38,170,192,12,0,2,0,1 ,0,3,22,20,0,6,3,110,115,50 ,192,12,192,12,0,2,0,1,0,3,22 ,20,0,5,2,110,115,192,12,192 ,79,0,1,0,1,0,3,22,20,0,4,64 ,20,38,170,192,61,0,1,0,1,0,3 ,22,20,0,4,63,246,10,45>>}],
[{1,
1,
29460,
4,
{64,20,38,170}, -- Internet address for shaunkruger.com is here
<<192,12,0,2,0,1,0,3,22,20,0,6,3,110,115,50,192,12,192,12,0 ,2,0,1,0,3,22,20,0,5,2,110,115 ,192,12,192,79,0,1,0,1,0,3,22 ,20,0,4,64,20,38,170,192,61,0 ,1,0,1,0,3,22,20,0,4,63,246,10 ,45>>}],
[{2,
1,
202260,
5,
10443014156,
<<192,79,0,1,0,1,0,3,22,20,0,4,64,20,38,170,192,61,0,1,0,1,0 ,3,22,20,0,4,63,246,10,45>>},
{2,
1,
202260,
6,
3772913991692,
<<192,12,0,2,0,1,0,3,22,20,0,5,2,110,115,192,12,192,79,0,1,0 ,1,0,3,22,20,0,4,64,20,38,170 ,192,61,0,1,0,1,0,3,22,20,0,4 ,63,246,10,45>>}],
[{1,1,202260,4,{63,246,10,45},<<"">>},
{1,
1,
202260,
4,
{64,20,38,170},
<<192,61,0,1,0,1,0,3,22,20,0,4,63,246,10,45>>}]}
Last time I wrote this in C I had to spend time doing thread synchronization, writing queue abstractions, and making the datatypes I pass around agree somewhat.
It's good to be writing this in erlang. I'm not sure I would be able to do it as well in Lisp. I could possibly do it in C#, but then there is the problem of binary manipulation for parsing the packets. That's never been fun in C#.
For anyone who isn't so into my technical posts, I'm having a fondu party on thursday. I'm pretty sure I'll have something interesting enough to write about from that.
Shaun
Saturday, October 07, 2006
Erlang = Awesome
As for what I intend to build... A few years ago I wrote an internet filtering daemon for a small company. It was a DNS proxy. Basically it would catch a request for name resolution (to find the real internet address of something like blogger.com for instance), pass that request to a real name server and check its records to see if the request should be granted. If it is supposed to block the site it would change the internet address returned when the DNS packet is sent back to the requesting client.
It took a bit more C code than I would have liked. The thing that has me writing this in erlang is that many of the things I tried to do with difficulty in C exist as easy to use language features in erlang. Binary parsing , concurrent processing, and error handling are the first to come to mind. One bad pointer reference and a C program crashes (Illegal Operation in windows speak) while erlang programs can be more easily written to catch such crashes and respawn whatever parts have died.
In server programming high availability is key. Erlang seems to be a tool that can help me design for it.
Shaun
Wednesday, October 04, 2006
FHE Hoedown
I took social dance in high school and enjoyed it. I can still swing dance well enough to be convincing. Since then however I have lost interest.
Though, rumor has it that Bob can dance...
Here we have Ben. He's new in the ward and practices just the right sort of nonsense. He was also at last Friday's shindig.
I have a few more pictures, but I'm still figuring out the proper use of this camera so none of them really look very good. I'm working with a Canon Digital Elph that I just got from my local Kentos...
For those of you who weren't around last January, Kentos is my insane friend who kicked a crocodile in central america. Yeah, he really is nuts.
(Kentos stock photo provided by unerased memory card in recently obtained camera)
Shaun
Tuesday, October 03, 2006
Treason
October 3rd, 2006
by Tom Harper @ 7:55 amDo you know the whereabouts of any of these senators? TheyÂre all traitors and they must be brought to justice and dealt with accordingly:
Alexander (R-TN), Allard (R-CO), Allen (R-VA), Bennett (R-UT), Bond (R-MO), Brownback (R-KS), Bunning (R-KY), Burns (R-MT), Burr (R-NC), Carper (D-DE), Chambliss (R-GA), Coburn (R-OK), Cochran (R-MS), Coleman (R-MN), Collins (R-ME), Cornyn (R-TX), Craig (R-ID), Crapo (R-ID), DeMint (R-SC), DeWine (R-OH), Dole (R-NC), Domenici (R-NM), Ensign (R-NV), Enzi (R-WY), Frist (R-TN), Graham (R-SC), Grassley (R-IA), Gregg (R-NH), Hagel (R-NE), Hatch (R-UT), Hutchison (R-TX), Inhofe (R-OK), Isakson (R-GA), Johnson (D-SD), Kyl (R-AZ), Landrieu (D-LA), Lautenberg (D-NJ), Lieberman (D-CT), Lott (R-MS), Lugar (R-IN), Martinez (R-FL), McCain (R-AZ), McConnell (R-KY), Menendez (D-NJ), Murkowski (R-AK), Nelson (D-FL), Nelson (D-NE), Pryor (D-AR), Roberts (R-KS), Rockefeller (D-WV), Salazar (D-CO), Santorum (R-PA), Sessions (R-AL), Shelby (R-AL), Smith (R-OR), Specter (R-PA), Stabenow (D-MI), Stevens (R-AK), Sununu (R-NH), Talent (R-MO), Thomas (R-WY), Thune (R-SD), Vitter (R-LA), Voinovich (R-OH), Warner (R-VA).
Each one of those senators voted for the Torturers Protection Act (S. 3930) last Thursday. They have thereby violated their Oath of Office:
ÂI do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against ALL enemies, foreign AND DOMESTIC; that I will bear true faith and allegiance to the same; that I take this obligation freely, without any mental reservation or purpose of evasion; and that I will well and faithfully discharge the duties of the office on which I am about to enter: So help me God.ÂBecause of the new law they voted for, these traitors, if caught, can be held without trial and tortured until they confess. CouldnÂt happen to nicer people.
This post was inspired by Kvatch at Blognonymous. HeÂs doing a series of posts on traitors in the Senate. We should all be doing this.
I am very sad to see both of my senators on that list.
I have had to come to grips with the fact that I am no longer free. My government is running away and abusing power. If we read and understand how the Weimar republic turned into Nazi Germany we will see we are on the same path.
If you or someone you know becomes labeled as an enemy combatant I wish you luck.
Irony 451
Read it in the Houston Community Newspaper.
If someone reads Fahrenheit 451 and only comes away with dirty language complaints then they have thoroughly missed the point. I never read it until I was well out of high school and I consider it to be a very good book with some highly valid warnings.
Besides, I'm mighty partial to books.
Shaun
Saturday, September 30, 2006
Shindig!
Either way, once a few people showed up everyone started showing up. We played DDR in the living room. Then we moved one of the couches outside and got guitar hero set up on a TV on the front lawn. Finally, I pulled out a pumpkin and Missy and Hannah carved me playing DDR on it.
I will have you know it was awesome.
Andy handed his camera phone to someone and had them get a picture of us. This is Todd, Andy, Myself, Levi, Honey, and Cody. Yes, Todd is holding a video game guitar. And yes, Cody is enjoying his vodka.
Fun times. We should do it again some time.
Sunday, September 24, 2006
Simple pleasures
- Advanced nonsense
- Kite flying
- Blowing bubbles
- Thinking of ways to cause trouble using items found at Toys R Us
- Sledding on a couch with skis on it.
Shaun
Friday, September 22, 2006
Hardware design = time sink
Last month I wrote about wanting to learn erlang. I still plan on doing that, but I've run into something else I started learning...
Hardware.
A few weeks ago I was talking to my brother and he is starting into a class where they will be working with robots. I thought that sounded cool so I pulled out my old hardware manuals, bought more books, and started preparing to write some PIC assembly. I even dusted off my educational version of Eagle layout editor. After spending my first $150 I'm ready to start designing something that will cost me another $100+ to get the board etched and populated with parts.
Hardware is fun. Soon I hope to be able to post some pictures of what I'm working on.
Shaun
PS. In addition to falling behind with this blog, I have also fallen behind with google reader. Almost 90 unread items... For shame...
Friday, September 01, 2006
Next Language
My programming style will never be the same.
The new language I want to learn is erlang. The funny thing about erlang is that it's kind of like lisp. Not that it's a lisp dialect, but that it's a language that makes people wonder what I'm thinking.
I have a friend who really doesn't see why it is that I would choose Lisp for my current project. However, Lisp gives me great flexibility and freedom in how I write my code and how I think about my code's abstractions. I am able to write more reusable code faster in Lisp than I ever managed to in C#.
Now, why erlang? Seeing as it's more likely to get me more funny looks than dinner party invitations it just doesn't add up. Perhaps its history will help show why I want to learn it.
Erlang was developed by Ericsson for use in designing fault tolerant systems. Since its release in 1998 erlang has been used in telecom equipment built by multiple vendors. What's so great about it? It's a language that allows you to spend more time expressing your particular programming problem and less time handling the details of memory management. In C if you allocate something and forget to free it when you're done you have a memory leak and that memory space will not be useful again until the program is closed and restarted; this becomes a problem when you do it in a loop that runs 5,000 times. In Lisp and Erlang when you associate a value with a variable it adds a reference to the value. When all variables that reference a value go away it's reference count drops to 0 and the value is marked for garbage collection. All you had to do was use it while you wanted it and it goes away when you have no more need for it.
Erlang has other advantages. I hear it's good for concurrent programming. Something that is going to be getting bigger as we start seeing more cores going into processors.
Is it the end all of programming? Probably not.
All the same, I'd rather learn it. Learning a new language can introduce you to design patterns that will help you write better code in whatever language you use most.
Shaun
Tuesday, August 29, 2006
Yes, when was that?
Thursday, August 24, 2006
Small Business
Recently however, I decided I want to get into the phone systems for small businesses market. This should be exciting. I'll keep you posted.
Shaun
Friday, August 18, 2006
Who do they think the terrorists are?
Pilots who believe they should not be banned from taking liquids and gels, including contact lens solution and toothpaste, into the cockpit have now joined the calls for the security measures to be re-examined.That's right, they are already flying the plane. But, security is afraid they might try to make a bomb... Or something... I guess...
I think if the pilots wanted to kill everyone the easiest thing to do would be to crash the plane.
Shaun
Thursday, August 17, 2006
Living in fear
As he said, "Believe me, I'm a finance major".
The premise of the argument is that having your debit card misused can be more financially damaging than having your credit card misused. It follows then that you shouldn't use your debit card for the bulk of your transactions.
There are then 2 points I wish to raise.
1. Even if you are using your credit card for most transactions it does not protect you from misplacing your debit card and having it abused.
2. If you are using your debit card on a regular basis would you not notice its loss sooner?
In my case I realized my loss less than 24 hours after it occurred. Why? Because I use it that often.
Now, to get to the real point...
The thing I found most irksome last night was that the reasons given for using a credit card instead of a debit card all centered around what COULD happen, what someone MIGHT do. How HARD it would be to get charges reversed on a checking account instead of a credit account.
Ever get the feeling someone is trying to make you afraid of something? I did... Fear is a very effective way of controlling behavior. I'm not much for being controlled, especially by fear.
Let's look at another example of this.
We are told to be afraid of terrorists. Yes, they are bad people who want to hurt us. The only trouble with terrorists is that there aren't enough of them to go around. If you think about it on 9/11 roughly 2700 people were killed. There are 8.1 million people who live in new York city. That means (through dubious math) that there was a 1 in 3000 chance of being one of those people (not counting commuters). Those aren't good odds. When is the last time you made a 1 in 3000 bet hoping to win? The odds get even worse when you consider the population of the united states. That puts it up to 1 in 109000 chance of being killed.
Yep, sure is scary.
When looking at it like this it really helps explain the unreasonable search and seizure going on by government employees every day. If security doesn't make you dump out everything except baby formula you could end up being that one person in 109000 that dies! Now, if you consider that those deaths happened on one particular day then we must also consider the odds of being killed on one certain day.
Lets take today for instance.
It has been 5 years since the last major terrorist event. That means we have had roughly 1825 days since then. If you had a 1 in 109000 chance of death the day of the last terrorist event then the odds have been getting worse by 109000 ever since. That means that today you have a 1 in 198 million chance of being killed. These terrorists really need to step up their efforts if they are going to give us a reason to be afraid.
I don't know about you, but my life is way too valuable to waste on being afraid of odds that would make even the most compulsive gambler think twice.
Shaun
Thursday, August 10, 2006
Anonymous comments
Shaun
PS. I keep telling spell check to learn my name... I wonder when it will?
Monday, July 31, 2006
Conversations on the Constitution
I hope you will take some time to look at the site. It should be interesting once things really get underway.
www.convocon.com
Shaun
Saturday, July 29, 2006
Democratic family reunion
One issue still on my mind is that I still want to sue the state of utah over their selection of diebold voting machines. It's hard to have confidence that your vote is going to count if the systems involved are known to have vulnerabilites. It's just too bad that the people in charge of selecting the equipment were more interested in listening to their vendors than to the citizens. Last year there was a meeting for people to give public input on the matter. I didn't hear anyone speak in support of Diebold who wasn't on their payrol. It makes me sad that vendors have the ability to wine and dine our officials to the point of ignoring public input.
These days it seems that if you care enough to say something you are labeled an extreemist. Pretty dangerous since we're soon going to see a day where extreemist=terrorist. That's right, people are likely to be terrorists just for questioning their government.
I can only imagine that some day in a bout of irony we'll submit the declaration of independance to the US Government as they turn into the same opressors that the British were in 1776.
Shaun
Thursday, July 27, 2006
Shindig!
Now the only thing we need is more women at these parties. I think it's because there are too many ward things getting in the way.
Shaun
Tuesday, July 25, 2006
New: Bi Weekly Posts!
At my job I'm leaving I'm getting hylafax setup to do serious incoming fax serving. It's a nice piece of software. At my other job I was able to order LispWorks. Lisp is officially my favorite language. Every day I learn more about it and it just keeps getting better.
I also spent time with iTunes again. I got some more music from The Hush Sound, We Are Scientists, The Strokes, and Arctic Monkeys. I love the "People who bought this also bought these..." part of iTunes. I never knew who the hush sound and we are scientists were until the other day.
I think I'll grow a beard.
I never thought I would start to neglect my blog because I started getting more of a life. Heck, I may even do some more dating! Now just to ask out women I can have conversations with. It would help if I had more to talk about.
Last weekend I went to the Spiritual Summit my singles ward was having. I drove up with this girl I had gone to highschool with. There wasn't much conversation. Granted, I was guilty of not having much to say. I have what I like to call my DDS (droning defense system). It kicks in right after I say that work is going well and that I like it. I've developed it to save the people I talk to from hearing too much about how great lisp is and how nice it is compared to things they know nothing about. Once I get that out of the conversational options I'm left with my political views. Goodness knows that's something else that doesn't make me any friends...
Last week I told someone that I believe that our nation is going to crumble just like the nephite nation did before christ's coming in the book of mormon. I also cited the sources of why I believed this. I'm starting to think that latter day saints are looking for the signs of christ's return and all the mormons are sitting around saying all is well in Zion.
Now, I've gone and said something unpopular. I'll run with it. I've got plenty of unpopular things I believe. I was commenting on Al Gore's "An inconvenient truth" one day. I called it "An even more inconvenient truth". Global warming is part of the signs of upheaval that are to come before christ comes. We'll have famine, pestilence, plague, and murder. Most of all, christ is going to come back before global warming has a chance to kill us off.
For those of you still reading... I have the most unpopular thought of all. We have departed from the lord's ways in our country. The constitution was set up to keep the government out of as much stuff as possible. The Lord's plan is that of agency and free choice. The proper place of government is that of maintaining order and providing for the common defense of people. Our government is running away from us. Now our government wants to watch us and make sure it's safe from the very people it ostensibly is there to protect. If a government ever has to worry about its own citizens trying to remove it then it is no longer worthy of its stewardship over those people. Today's invasive security for our protection is too similar to Lucifer's plan. Lucifer states, "I will redeem all mankind, that one soul shall not be lost". How is his plan accomplished? By watching everyone and making sure they behave. The Gestapo and stasi followed this tradition. Now homeland security is in the same position. Will they behave and be constrained by the rule of law? Or will they become the new oppressors? Any bets on whether I'm working my way onto their watch lists by making these comments?
I see the country so many have sacrificed for dying and it's taboo to say so. I see people ignoring prophecy as in the days of noah. Our fiction is full of people struggling through dark times, yet we ignore the ominous clouds of our real world we live in. May we see how much our situation is like that of those that have gone before us.
Shaun
Monday, July 03, 2006
The Constitution (use as directed)
How many issues could be resolved if the congress stayed within its bounds?
I will suggest a list of things that the congress did not have authority to setup or do. In question is not whether or not they are good things. In question is whether or not the congress had authority.
For each of these I ask you to find an entry in Article I Section 8 of the constitution that grants the authority to the congress to make such a law or create such a department.
1. Department of education
I consider legislation like No Child Left Behind to be a mistake. However, that is beside the point. Dealing with education was not mentioned in the powers of congress.
2. War in Iraq
I heard congressmen Ron Paul of Texas speak a few years ago. He put forward and amendment to the Iraq war funding bill. This amendment would have made the bill a formal declaration of war in addition to being a budget allocation. It was voted down. Only the congress has authority to declare war. As such the president is acting outside of the bounds of the constitution.
Note: I have heard the argument that voting for funding was an implicit declaration of war. This is a very dangerous line of thinking. It's one that allows the president to attack another nation without holding the congress accountable for declaring said war.
3. Social security
I talked to Pete Ashdown on Saturday. He stated his disagreement with many constitutionalists about social programs. Presently they are not constitutional. Quite simply, the congress was not given authority to appropriate money for social/welfare programs.
4. FCC, FAA, and other regulatory bodies.
While regulatory bodies to have a place in the operation of our nation at this time I still do not believe that the congress had authority to create them. If a regulation is to be enforced as if it were law then it has to be voted on by the congress and enforced by the executive. There is not authority given to delegate the legislative power of creating law, or the executive power of enforcing law in the Constitution. Lets take for an example the FAA. The Federal Aviation Regulations (FAR's) are a body of regulations that are not directly voted on by the congress. These regulations still have requirements and penalties just as real as any law voted into existence by the congress. This means we now have laws that are created by people we did not vote into office. This removes all accountability. Are regulators afraid of not having a job next election cycle if people didn't like the regulations they came up with?
Remember, the problem with these four programs and bodies is that there is not authority granted to the federal government to handle things the way they are being handled. In talking to Pete on Saturday he suggested that the constitution wasn't able to cover all cases so a liberal interpretation is needed.
Mr. Ashdown, you are wrong. The constitution is designed to be able to meet any of these needs. As proof I submit to you Article V.
All four of these things I have mentioned can be made constitutional simply by through the amendment process. Granted, that does involve admitting that the congress had been acting unconstitutionally previously by voting them into existence. It also means they will have some changes to make if amendments don't pass. The congress can't just continue letting programs exist once they have admitted they needed constitutional support.
Pete's example that he used to support a liberal reading of the constitution was the existence of the Air Force. It was not listed in the original constitution because manned flight was still over 100 years away. However, the Airforce can be organized under the Army, the Navy, or an amendment to add a clause to Article I Section 8 can be put forward thus allowing it to be its own branch of the military.
Yes, the writers of the constitution knew that things would change. They knew it wouldn't cover everything. That is why they made it amendable.
This being said. I hope all the good democrats and good replublicans I know can forgive me for not supporting their entire platforms. I love my country and see bad things happening to it. My one wish is that every person who waves the flag would also read the constitution. Many of us will be having parties tomorrow, but how many will think about the great minds that produced the constitution and the sacrifices made to really become independent of the British?
Shaun Kruger
Saturday, July 01, 2006
Always another way...
I decided to do a quick test. One using mapcar and one using loop. The goal was to turn numeric values from 1-6 into string values containing the numbers 1-6.
'(1 2 3 4 5 6)
into
'("1" "2" "3" "4" "5" "6")
I first tried with mapcar:
(mapcar (lambda (x) (format nil "~a" x)) '(1 2 3 4 5 6))
Then with loop:
(loop for i in '(1 2 3 4 5 6) collect (format nil "~a" i))
Both get the exact same thing done, but there is a difference. Mapcar doesn't expand with macroexpand-1. However, when you try to expand the loop you get this:
(MACROLET ((LOOP-FINISH NIL (SYSTEM::LOOP-FINISH-ERROR)))
(BLOCK NIL
(LET ((#:G13088 '(1 2 3 4 5 6)))
(PROGN
(LET ((I NIL))
(LET ((#:ACCULIST-VAR-13089 NIL))
(MACROLET ((LOOP-FINISH NIL '(GO SYSTEM::END-LOOP)))
(TAGBODY SYSTEM::BEGIN-LOOP (WHEN (ENDP #:G13088) (LOOP-FINISH))
(SETQ I (CAR #:G13088))
(PROGN
(SETQ #:ACCULIST-VAR-13089
(CONS (FORMAT NIL "~a" I) #:ACCULIST-VAR-13089)))
(PSETQ #:G13088 (CDR #:G13088)) (GO SYSTEM::BEGIN-LOOP)
SYSTEM::END-LOOP
(MACROLET
((LOOP-FINISH NIL (SYSTEM::LOOP-FINISH-WARN) '(GO SYSTEM::END-LOOP)))
(RETURN-FROM NIL
(SYSTEM::LIST-NREVERSE #:ACCULIST-VAR-13089))))))))))) ;
Loop may be easier to read, but mapcar probably executes less code to get it done. One other difference is that loop doesn't need to use a lambda. I'll have to think about that next time I just want to iterate through a list.
Shaun
Saturday, June 17, 2006
Softball
It's a lot of fun, I'll have to do more of it.
Shaun
Friday, June 16, 2006
Relay for life!
I'm thinking about pulling out my DDR pad and getting Step Mania going. There's nothing like an all night shindig.
More later if anything comes to mind.
Shaun
Thursday, June 15, 2006
For Shame... (with lisp rant)
Some exciting things have been happening. I'm trying to use cells-gtk for a serious project at work and the only thing slowing me down is the cffi-gtk stuff. The thing that strikes me about using cells-gtk is that there are just so many ways of doing the same thing in lisp. Sure, I've seen GTK, Qt, MFC, WTL, etc... in C and C++, but they all work in really similar ways. Hitting a new library in Lisp seems to involve changing the way you think about the problem at hand.
In most languages writing a library involves bending your problem domain to the language. Lisp seems to let you change the language to suit the problem. The only trouble is that you have to really know your problem.
I think I'm going to be ready to get going when I can get cells-gtk to work after doing a (saveinitmem). I think it has to do with not explicitly remembering the location of the libgtk... I'm sure I'll figure it out. It's part of the learning curve of a new language. It will be worth it if I can get it working on MacOS X too.
If only I could stop this error from coming up on loading from .fas files. It doesn't happen the first time it loads...
FFI::FOREIGN-LIBRARY-FUNCTION: no dynamic object named "g_free" in library :DEFAULT
If I can resolve this I can start developing seriously... In a real language... With source control...
Sometimes I just feel too demanding. I'm sure someday I'll discover that I was wrong about wanting a subversion or CVS repository. Heck, I may even discover that notepad IS better than vim. Perhaps I may even find that Access is the best database front end design tool on the market... Somewhere right behind psql or some other command line database interface...
I digress, not that I had much of a point to begin with. Let's just hope that next time I have something more useful to say.
Shaun
PS. Huzzah for 50 posts!
Tuesday, May 23, 2006
The concept of macros (LAP)
I think I would like the Lisp part of the code generator to take the following form...
(jdeftype jstring "String")
(jdeftype jbool "bool")
(jfunc myfunc "private void" "MyJsFunction" ((jstring strarg) (jbool boolarg))
(...commands that evaluate to JavaScript code...))
When it comes to passing arguments in I think a script tag may look like this...
script type="text/javascript" src="/lisp-bin/lispgen.lisp?genfunc=funcname&arg=value"
I think this would be useful for generating a table type object (think .net DataGrid) that I can create base types for through generated JavaScript. If I make it configurable enough I can define all of its behavior through src="..." arguments. I would then be able to invoke the object and use its methods and operators as defined by the Lisp output.
Once I manage to get an application stable I could generate the JavaScript and save it to a static file. At that point I could change all of the references of the generated lisp to the static JavaScript files. This may involve more interesting code...
I don't know if this will work. I don't know if it's even sensible. I do know it is something I should at least try.
Debug a general code generator that has many useful base object types and you should be able to build with those objects fairly quickly.
Shaun
Saturday, May 20, 2006
The Great Divorce
There was someone who kept talking about how they never asked anyone for anything and took care of themselves. They said "I'm not asking for anybody's bleeding charity." To which the response came, "Then do. At once. Ask for the Bleeding Charity. Everything is here for the asking and nothing can be bought."
This makes me think of Isaiah 55:1: "Ho, every one that thirsteth, come ye to the waters, and he that hath no money; come ye, buy, and eat; yea, come, buy wine and milk without money and without price."
Another line I took note of was, "I am not trying to make any point, I am telling you to repent and believe." This was said to someone who was resisting the truth. Not just the relativistic "my truth may not be your truth" type of thing, but THE actual truth about the nature of the universe.
How many of us resist understanding things as they are? It is an uncomfortable thought for many people that there might actually be one authoritative truth. That would mean someone is going to have to be wrong.
We see the indication that there really is an authoritative truth when we read in Philippians 2:10-11: "That at the name of Jesus every knee should bow, of things in heaven, and things in the earth, and things under the earth; And that every tongue should confess that Jesus Christ is Lord, to the glory of God the Father."
(Variations of this appear in Isaiah 45:23, Romans 14:11-12,Mosiah 27:31, and D&C 76:110 and 88:104)
There is nothing better than when something gets you thinking about the world around you. I think a lot of things about the world that I just can't share with others right now. However, that's more based on the fact that What You Can't Say can speak volumes about what things may need to be examined.
Shaun
Wednesday, May 17, 2006
America: Freedom to Fascism
What I came to after tonight was that we are in serious trouble in our country. We are now living in a police state. Just last week I was searched by government security that had no probable cause. When I asked how it was constitutional they said I had agreed to it by entering the place I was in. That sounds bad until I mention I was at the airport trying to get to my plane. Suddenly it's ok that security patted me down and that I had waived my right (not by choice) to no longer be safe from unreasonable search and seizure.
Now for a message to Pete Ashdown... Pete, I am going to support you because I am trusting that you will go into the senate and uphold the Constitution. If you do that you will be a rare man indeed. You will be a real representative of the people of Utah. Orrin Hatch is no such representative.
I would just like to finish by saying that no matter what our political affiliation is we need to stop being divided by the apparent differences between the two major parties and start focusing on what it takes to be real Americans. That is pay attention and be careful who you are paying attention to. Check facts and find people who will disagree with you using arguments that are better formed than "I don't believe that".
We must all do our part if we are to be free. What are you doing?
Shaun
Update:
Last night there was an announcement for someone who would be speaking about secret combinations. The speaker saturday night is a decendant of the Rothschild family.
Saturday May 20, 7-10 PM
SLCC Larry H. Miller Campus
9750 S. 300 W. Sandy
Free Enterprise Building, room 101
Sunday, May 14, 2006
One man show
Working alone can become a problem. I don't have anyone who is going to challenge my assumptions (bad thing). I don't have anyone suggesting better ways of doing things (bad thing). I follow what best practices I know, but there are probably others I don't know that I should follow (bad thing).
What I'm trying to say is I can't do everything alone. I don't want to try. I want to work with others to make something great. That said... Anyone looking for a hacker? I do Windows/Linux administration and programming.
And no, I don't want to be the only one in your IT department.
Shaun
Saturday, May 13, 2006
Greetings from the Democratic Convention!
I wish I could do more to support the Ashdown campaign, but as it stands I don't have enough money and things keep taking my time. Though, for what it's worth I will always suggest that supporting Pete Ashdown is a good move.
More later when I get a chance.
Shaun
Friday, May 12, 2006
Gone too long
As trips go it was nice. I was going to go camping last weekend to get out for a while. The goal was to get out of town. I think Seattle was a nice step up from that. It was really nice to spend some time doing something different. At least similar things in a different place.
Since my last post I've made more enhancements to my condorcet vote counter. I also got a DDR pad and an adapter to use it with Step mania. Playing it is a fine way to realize just how out of shape you are.
I think that about covers everything since my last post. Hopefully I'll have some new interesting code to write about soon. That part is always fun.
Shaun
Monday, May 01, 2006
Condorcet Voting
If you've been reading you may have noticed I've been learning lisp recently. This means I've spent more time figuring out something pretty simple and my coding style may leave somewhat to be desired. That said, on to the code...
Please forgive the indentation. If anyone knows how to get blogger to accept the HTML to do code listings please tell me. The obvious ones don't seem to work.
(setf elections '(:ab (:a 0 :b 0 :label :ab) :ac (:a 0 :c 0 :label :ac)
:bc (:b 0 :c 0 :label :bc)))
(defmacro election-pair-label (elec var1 var2)
`(getf (car (remove-if-not
(lambda (x)
(and (not (atom x))
(not (eq (getf x ,var1) nil))
(not (eq (getf x ,var2) nil )))) ,elec)) :label))
(defun incvote (list winner loser)
(let ((lbl (election-pair-label list winner loser)))
(setf (getf (getf list lbl) winner) (1+ (getf (getf list lbl) winner)))))
The first thing to look at is the elections list. This is where my style must be called into question. I don't know how to use remove-if-not such that it returns a setf-able place in the main struct.
The macro and function are pretty straight forward. I use the macro to get the label (:ab, :ac, or :bc). I then reference by the label to get a setf-able place in the elections list for doing the setf on the vote count.
It's a good first step. Presently I can just do (incvote elections :[winner] :[loser]) and it will increment the vote count for the winner candidate.
My next step will be to take a list in the form of (:b :c :a) and apply the votes to the pairwise elections in the elections list by way of Condorcet counting.
Stay tuned for more fun.
Shaun
Monday, April 24, 2006
Voting machines
Today I spent some time on google and found out that what I was thinking of has become known as the Harri Hursti hack. Now in reading about this I saw that it was for optical scan voting machines. However, I still find myself uneasy that any product from the vendor of our voting machines would have such vulnerabilities.
One test of robustness in a piece of software is how it detects handles invalid data. If we are to have confidence in a voting system it must be able to take a stream of data from /dev/random, return an appropriate error, and keep running or end in a controlled manner. Also, if the XBox 360 can only execute signed code then I think we should expect the same of a voting machine.
We talk about cryptographically signing for copyright protection and for secure banking transactions. Yet we loose sight of such security for the simple act of casting votes. Something's wrong here. I just know I think I want to vote absentee and not use these machines.
Shaun
Sunday, April 23, 2006
Dvorak
Shaun
Wednesday, April 19, 2006
Lazy
I guess this is where I get off my blog and start writing some more code. I'd hate for this to be just another thing I do instead of writing lisp.
Shaun
Sunday, April 16, 2006
War on life!
If we're going to go down this road then I say lets declare a war on life. As age increases the mortality rate of being alive approaches 100%. I think we can solve this whole mortality rate of life thing by just not producing any more. Just think about it. Every person that is not born doesn't have to die! We'll get planned parenthood onboard with this. It'll be great! If everyone stops reproducing it will also take care of this overpopulation thing I keep hearing about too. That solves even more problems. No birth means no death, and once we all finish this business of dying alone in our old age (no kids to take care of us) the environment will be able to go back to taking care of itself.
Now for the hard part... This requires a very passionate celibacy for all! Now, doesn't that sound exciting?
Now seriously, wars on things don't work. They just get funding. For some reason we equate a war with getting something done. Never mind if what you're doing is just hurting people by limiting their choices or by much more painful things like sending them to jail for doing something foolish in the first place. *cough* smoking pot *cough*.
My point? Lets let people mess up their own lives if they want to.
Shaun
Monday, April 10, 2006
I'm weak
I just can't leave it alone now. I keep wanting to play with lisp code. Then I want to start writing programs in Lisp. Sure I've got the REPL figured out, but that's not enough. I even started writing an IDE that provides multiple tabbed edit windows and a CLisp REPL on the bottom. I'm writing software to make learning lisp easier.
It doesn't help that this is the way I learned C. Playing a little here and there. Editing example programs. Suddenly I just was able to write programs as I thought of them. Now I'm expecting the same thing to happen with lisp.
I guess what I'm trying to say is... My name is Shaun, and I am a Lispaholic.
Shaun
Thursday, April 06, 2006
Real RAID
I took swift action and thought about it for a month. I then ordered a 3ware RAID card and 2 120GB IDE drives and I will live in the happy land of RAID 1 Mirroring. This means that if one of my drives decides to go paperweight on me I'll still have my data.
The disk that I'm worried about has my CVS archive of all my interesting work I've done in the past. I don't know if I'll ever reuse the code, but I would like the option... It begs the question: How much do you care about your data?
Shaun
Monday, April 03, 2006
Dating moratorium update (rant)
There's a part of me that wishes everyone could just grow up. I mean this also for the other guys in the world that have trained the women I know to avoid the problem of not being interested. They become distant rather than just saying they're not interested. It would work if both parties could move on at that point. Our (everyone involved) inability to move on in the face of a declaration of non-interest is highly dysfunctional.
So, why is it that I really don't go on dates? It's not like I'm lacking the money; I just dropped more than I should have on RAID hardware for my personal server. I even have time for dates. There is something to be said about me being a goofball and an acquired taste. Some people just can't take undiluted doses of shaun.
I think I'm on to something with that last statement. There are many people I know who I will never be able to share a laugh with. There is usually a small courtesy laugh when they catch on that I'm trying to be funny, but they don't see what really is funny about what I'm saying. They will never appreciate that the nerdy shaun that they are acquainted with is part of a package that includes much more than odd quips and fits of giggling. Something that doesn't help is the fact that I meet many people when I'm on my goofball "A" game. They see me participating in advanced nonsense and don't ever see more than that.
I guess it comes down to me liking being liked. Though I'm not afraid to invoke the words of Cartman, "Screw you guys, I'm going home!". I still prefer to surround myself with people who welcome weird, nerdy, dorky, goofy shaun.
How does this relate to my dating problem? When I find friends who accept me I hate to risk creating a void between myself and them by inviting them to go on a date. This relates to a pre-existing difficulty in relating to people in general.
What I'm saying here is that if I had a way to find out interest without loosing the friends I enjoy I would be trying more. I've tried going the route of asking a lot of the women I know out and letting the odd gap form. I found myself alone and unhappy.
Here I am, no longer willing to risk enjoyable friendships with the possibility of enjoying more fulfilling relationships. The real kicker is that I know my current non-risking status is the WRONG answer. It's just that I value the people in my life so much that I hate to see them leave.
Shaun
Saturday, April 01, 2006
Finishing things up
- Using database triggers/functions in PostgreSQL
- Finding what I need in Microsoft documentation
- The proper use of transactions
I consider this to be somewhat of a professional milestone. Back when I was at century software I knew a little bit about writing code, but I wasn't nearly as good as the others I worked with. I pretty much learned how much of a programmer I wasn't. A couple of years later I was writing an internet filtering program for someone. I was able to get good portions of the code done, but ran into a problem when feature creep headed in the direction of advanced windows programming. I still have the DNS proxy/packet mangling code I wrote for that.
Now I stand at the end of a project for the first time. I can look back and enjoy seeing what I have made. What's even better is that I have developed into the kind of programmer that can just sit down and hack a utility together. If used properly that could be a pretty good metric for capability. What can you throw together with only a moments notice? Isn't that what coding contests are about?
Lets hope I can do more of these in the future. Though, I think working on a team would be nice. The later portions of my project really benefited from what I learned in the earlier parts. Being in a team would have helped me have access to people who could suggest different ways of doing things. In some cases I didn't figure out how to use some features until I stumbled across them in the docs while looking for something else. Using collections and lists comes to mind...
So what's the point? Coding is fun, realizing you're good enough to finish things is even better.
Shaun
Saturday, March 25, 2006
Political Standing
The first key, is that my political party is not my religion. This moots the term "Conversion". I switched because I had 2 options. One party that has a platform I agree with, but doesn't follow it to the extent that I disagree with the actions of its members. Or, a party that I may disagree with sometimes that actually sticks to its platform. I also believe I am in a better position to be heard and to be able to do things to get meaningfully involved in a smaller party.
I guess the moral of what I have learned is that if fewer people made their party their religion we would have better competition. Besides, the democrats aren't exactly perfect. They nominated John Kerry of all people when they had a fully operational Howard Dean sitting around.
I would like to say one final thing about confusing politics and religion. It happened in Germany. Having a leader that claims to be a Christian, but who does not act like a Christian is very dangerous. Continuing to vote for them, even more so. People ignore too many things that are wrong when they believe someone is a Christian. Lets take warrantless wiretaps. It's pretty easy to establish that they happened. The trouble is that we have to follow the rule of law. Let this slide and it won't be such a big deal that other laws are broken. I can't stand TV shows and movies about what the president does because those often show the president as being above the law. Bad move...
So here I am, Shaun the democrat. Lets just hope that whoever I back I don't become Shaun the oppressed. I see it coming plain as day so lets stop voting for people who abuse power in any level of government.
Shaun
Tuesday, March 21, 2006
Lambda Epiphany in C
#include <stdio.h>
int main(void){
int val = 4;
int lambfunc(int innerval){
return innerval+val;
}
int i = 2;
printf("lambfunc(%i) = %i\n",i,lambfunc(i));
return 0;
}
It gave the following result:
lambfunc(2) = 6
The significance of this is that I was able to write a function in a function that made use of variables in the scope of the function. What was really cool is when I added the nestlamb() function:
#include
int nestlamb(int fn(int)){
int value = 6;
return fn(value);
}
int main(void){
int val = 4;
int lambfunc(int innerval){
return innerval+val;
}
int i = 2;
printf("lambfunc(%i) = %i\n",i,lambfunc(i));
for(val = 0;val < 5; val++)
printf("nestlamb(lambfunc) = %i\n",nestlamb(lambfunc));
return 0;
}
What's really cool about this is that I have a function (main) that has a function in it (lambfunc) that uses variables in the local scope. When I go through the loop calling nestlamb() passing lambfunc I call it 5 times with val ranging from 0-4. nestlamb(lambfunc) returns values 6-10. This means that nestlamb uses the changing values in the scope of main. I managed to do this by passing the pointer to lambfunc instead of passing the return value from calling lambfunc(). This passed the pointer to the instance of lambfunc() that exists on the stack. Subtle difference with a powerful result.
Some things to remember when doing this:
- lambfunc() must only be passed to other functions. Never return it!
- C has static typing. This still isn't going to be as flexible as things like using (map (lambda) ...) in lisp.
- You can't declare a lambda and use it in one expression. First you define it, then you use it.
All things considered, this is really cool. I'll be writing some very interesting code in the future. The ability to declare a function on the stack is very interesting to me.
Shaun