LITTLEBLACKDOG.COM Forum Index LITTLEBLACKDOG.COM

 
LWD LWD   FAQ FAQ   Memberlist Memberlist   Usergroups Usergroups   Active Topics Active Topics   Register Register  
  Profile Profile   Log in to check your private messages Log in to check your private messages   Log in Log in  
  Who is Online Who is Online   Image Gallery Image Gallery   Chat Chat   Search Search  
  LWDGear       LBDGear  

View next topic
View previous topic
Post new topic     Reply to topic   LITTLEBLACKDOG.COM Forum Index » Code Warriors
Author Message
CMTG
Leg Humper
Leg Humper


Joined: 23 Feb 2002
Posts: 4823
Location: On average, Cheltenham.

Post Posted: Fri Mar 21, 2008 11:52 am   Post subject: Chicks hate n factorial time algorithms. Reply with quote Back to top  

Quote:
"What's declarative programming?" she asked sweetly.

"Well," he began, moving closer to her, "declarative programming is when you tell the computer what you want, and then the computer figures out how to get it. Pretty sweet, huh?"

"What kinds of things can you tell the computer you want?" she asked, her cheeks beginning to flush.

He thought for a moment, and began stroking her hair gently. "All kinds of things. There's a language called prolog you can use to ask about logical expressions. In SQL you can ask about relationships between data. With a program like bison you can use declarative programming to describe a language, letting bison generate something that recognizes it."

"Oh," she said breathlessly, leaning her head on his shoulder, "so I don't have to worry about choosing an algorithm--the computer will pick one for me?"

He silently began caressing her breasts.

She took this as an affirmation. "That's so cool that it just does it--it must be really smart to pick the right algorithm!" she enthused.

"Well..." he trailed off, still gently fondling her breasts.

"What?" She asked, suddenly nervous.

"Um..." he said, "it's not quite like that." His hand stopped moving.

She sensed he was backpedaling. "Well?" She demanded.

He laughed awkwardly. "Heh... You see, most declarative programming systems only know about one algori--"

"It must be a great algorithm!" She interrupted, with renewed intellectual arousal. "What is it?"

He hesitated for as long as he could... "Brute force search," he said, guiltily.

"What the fuck!?!?" She yelled, straightening and yanking his hand from her breast.

"Wait, baby, it's not so bad!" He begged.

"I'm listening." She said, looking him in the eye.

"Well, if you're careful and you program in an idiomatic way, you ca--"

A venomous glare silenced him mid-sentence. She stood suddenly, grabbing his hat from the night stand and moving towards an open window.

"My Stetson!" He shrieked, standing quickly. The spurs on his cowboy boots jangled feebly. "But baby, didn't that bison parser generator thing sound cool?" He pleaded.

She stopped. "Well... yeah, that was pretty neat..." she begrudgingly acknowledged, softening for a moment.

"And that doesn't use a brute force algorithm. It builds an automata for you, an LR parser," he said.

She smiled to herself, seeming to relent momentarily. He could see that she was touched by the idea of a program that could understand other programs.

"See, declarative programming isn't all bad..." he cajoled, slowly walking towards her, palms outstretched.

She started, as if waking from a dream. She looked at him. "But what about in the case of an ambiguous grammar, for which an LR parser won't suffice?"

"Don't worry," he said, smiling, "bison can use a technique called generalized LR parsing, which allows it to follow all possible parses simultaneously, eventually finding a successful parse."

She thought for a moment. "But if we're following all possible paths simultaneously and discarding the ones which don't lead to successful parses, isn't that just brute force search?!?" She asked, her voice suddenly ringing with betrayal.

Her words were damming. Nothing he could say would placate her. He stood in embarrassed silence, eyeing his cowboy hat nervously.

She turned away from him, her emotions halfway between pity and rage. He moved towards her, reaching for her hands, but it was too late. She had already hurled his hat from the window, as hard as she could. They watched silently as it flew through the night, lofted on the cool air as if by the breath of angels.

_________________
Pie. I wish I could
constrain my hungry greed but...
Sadly, defeated.


So I'm cruising in my '91 Daihatsu blasting Vanessa Carlton's rockin' smash hit "A Thousand Miles," when it suddenly occurs to me:
"Am I
too gangsta? Am I too hardcore and menacing for this world?" I just might be.
- Tatsuya Ishida
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic     Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
phpBB SEO
All times are GMT - 8 Hours

Help us keep advertisements off this site. Donate today!