Thursday, June 25, 2009
Tuesday, June 23, 2009
fluent helpers
Fluent C Sharp Language Extension Helpers - Part 1
So, I found myself doing a lot of for( int i = 0; i < n; i++ ){} stuff lately. So, I've decided to try something new. I've started a small collection of "Fluent Helpers" that alleviate a lot of the verbosity in C#.
About 28 characters (including spaces) for a simple for loop to do some constant iteration.
for( int i = 0; i < n, i++){
About 18 characters to do this (no pun intended):
Do.This( 5, () =>{
Here's an example:
Prints:
Hello World!
Hello World!
Hello World!
Hello World!
Hello World!
Now that feels much better on my hands, and looks much cleaner too, IMHO. Here's the simple implementation for Do.This:
I've already started a little library of these small syntax helpers I've collected. If you have any suggestions, please share! cool0003.gif
-Brian Chavez
So, I found myself doing a lot of for( int i = 0; i < n; i++ ){} stuff lately. So, I've decided to try something new. I've started a small collection of "Fluent Helpers" that alleviate a lot of the verbosity in C#.
About 28 characters (including spaces) for a simple for loop to do some constant iteration.
for( int i = 0; i < n, i++){
About 18 characters to do this (no pun intended):
Do.This( 5, () =>{
Here's an example:
Do.This( 5,() =>
{
Console.Write( "Hello " );
Console.WriteLine( "World!" );
}
);
Prints:
Hello World!
Hello World!
Hello World!
Hello World!
Hello World!
Now that feels much better on my hands, and looks much cleaner too, IMHO. Here's the simple implementation for Do.This:
public static class Do {
public static void This(int times, Action what)
{
for( int i = 0; i < times; i++ )
what();
}
}
I've already started a little library of these small syntax helpers I've collected. If you have any suggestions, please share! cool0003.gif
-Brian Chavez
Wednesday, May 27, 2009
recession blog comments
from Decorno
"I think most of the foreclosures from people biting off more than they could chew are gone. Now it's a second wave people who actually bought houses they could afford but lost jobs." :(
"I think most of the foreclosures from people biting off more than they could chew are gone. Now it's a second wave people who actually bought houses they could afford but lost jobs." :(
Tuesday, May 26, 2009
inspired by Eva: 3 or so things I'm grateful for today:
1. Partly walking with my neighbor to work today.
Today is one of the first days in over a week that I haven't left early to bike to Cafe Rustica to sit and have some morning coffee (black!) and read. I was annoyed at myself for wasting what would've otherwise been ~40mins to relax at the cafe, and instead mindlessly surfed the internet, which would also probably result in getting to work late. But when she remarked to me how it was a little cooler than expected, to which I wholly agreed being also fooled by the delicious rays of sun pouring into my room and presuming their warmth, I actually felt kind of lucky to be exactly where I was in that moment, sharing this deceptive summer morning together. We continued walking together and she said her son begged her to use the car to drive to school this morning and she was on her way to the bank, but since it was this cold, that she decided only to the bank, and then straight home. As we walked she saw someone drive past and waved him down, who I assumed to be her son as she ran over to the car. She abruptly stopped by the door and turned, waved at me and said, you, too, you want a ride? It was actually a friend she knew and not her son, although I changed my mind after seeing him up close anyways. So we, all three of us, drove to Porter Square together. He dropped us off at the intersection across from the T. I asked her if that was her son, and she said, no, just a friend, "from her country."
I asked her what country, but she was already walking toward the bank in the other direction. I think she was the woman who's kids I asked directions for how to get to the park a few blocks from my house, and myself already running late that day, all proceeded to ask me about a million questions about where I was going and what I was doing, so I stopped and talked with her kids, since I was already late, and the woman sitting on the porch smiled at my dilemma, even though I was pretty happy to bask in my kingdom of their wonder. I swear maybe she was that woman outside watching them. I really hope I see her again.
2. Bekah ordering 7 quarts of ice cream, hot fudge, caramel, and tons of toppings at work today, including chocolate covered espresso beans, in celebration of Memorial Day weekend.
3. Today being my first free night in over three weeks. I'm euphoric at the idea of really having time to myself.
okay, one more...
4. The afterglow. It gives me this intoxicating restless adrenaline and this feeling of connectedness. I swing my hips a little more. I look people in the eye. I wonder. It makes me tireless of the smallest and simplest things and connected to the beauty in them and around me.
umm, and another!
5. T-station musicians.
Today is one of the first days in over a week that I haven't left early to bike to Cafe Rustica to sit and have some morning coffee (black!) and read. I was annoyed at myself for wasting what would've otherwise been ~40mins to relax at the cafe, and instead mindlessly surfed the internet, which would also probably result in getting to work late. But when she remarked to me how it was a little cooler than expected, to which I wholly agreed being also fooled by the delicious rays of sun pouring into my room and presuming their warmth, I actually felt kind of lucky to be exactly where I was in that moment, sharing this deceptive summer morning together. We continued walking together and she said her son begged her to use the car to drive to school this morning and she was on her way to the bank, but since it was this cold, that she decided only to the bank, and then straight home. As we walked she saw someone drive past and waved him down, who I assumed to be her son as she ran over to the car. She abruptly stopped by the door and turned, waved at me and said, you, too, you want a ride? It was actually a friend she knew and not her son, although I changed my mind after seeing him up close anyways. So we, all three of us, drove to Porter Square together. He dropped us off at the intersection across from the T. I asked her if that was her son, and she said, no, just a friend, "from her country."
I asked her what country, but she was already walking toward the bank in the other direction. I think she was the woman who's kids I asked directions for how to get to the park a few blocks from my house, and myself already running late that day, all proceeded to ask me about a million questions about where I was going and what I was doing, so I stopped and talked with her kids, since I was already late, and the woman sitting on the porch smiled at my dilemma, even though I was pretty happy to bask in my kingdom of their wonder. I swear maybe she was that woman outside watching them. I really hope I see her again.
2. Bekah ordering 7 quarts of ice cream, hot fudge, caramel, and tons of toppings at work today, including chocolate covered espresso beans, in celebration of Memorial Day weekend.
3. Today being my first free night in over three weeks. I'm euphoric at the idea of really having time to myself.
okay, one more...
4. The afterglow. It gives me this intoxicating restless adrenaline and this feeling of connectedness. I swing my hips a little more. I look people in the eye. I wonder. It makes me tireless of the smallest and simplest things and connected to the beauty in them and around me.
umm, and another!
5. T-station musicians.
Thursday, April 9, 2009
explicitly stated usages of Google Maps APIs
I guess they felt they needed to...
"There are some uses of the API that we just don't want to see. For instance, we do not want to see maps that identify the places to buy illegal drugs in a city, or any similar illegal activity..."
"There are some uses of the API that we just don't want to see. For instance, we do not want to see maps that identify the places to buy illegal drugs in a city, or any similar illegal activity..."
Subscribe to:
Posts (Atom)