Jan 24 2010

Sieve (of Eratosthenes) algorithm for generating prime numbers

Category: SoftwareDmitry @ 10:06 pm

A prime number is divisible by 1 or by itself. To generate prime numbers to 20 we’ll use Sieve (of Eratosthenes) algorithm, which is really simple to explain:

Strike out all multiples of 2’s:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Strike out all multiples of 3’s:

2 3 5 7 9 11 13 15 17 19

And so on. Here is a C# code that does exactly that:

private static void PrintPrimesTo(int num) {
            var primes = new bool[num + 1];

            // init candidates
            for (int i = 2; i <= num; i++) { primes[i] = true; }

            // cross-out 2's:
            //   2, 4, 6, 8, 10...
            // cross-out 3's:
            //   9, 12, 15...
            for (int i = 2; (i * i) <= num; i++ ) {
                Console.WriteLine("Crossing out {0}'s to {1}:", i, num);

                for (int j = i * i; j <= num; j = j + i) {
                    Console.WriteLine(" * crossing-out: {0}", j);
                    primes[j] = false;
                }
            }

            Console.WriteLine("Results: prime numbers between 2 and {0}:", num);
            for (int i = 2; i <= num; i++) {
                if (primes[i]) Console.WriteLine(" * {0} ", i);
            }
        }

Read the rest of “Sieve (of Eratosthenes) algorithm for generating prime numbers” …


Dec 16 2009

Thirteen Virtues of Benjamin Franklin

Category: PersonalDmitry @ 5:42 am

As I was studying, I came across this list of virtues that Benjamin Franklin tried to arrive at. He would focus on one each week.

  1. TEMPERANCE. Eat not to dullness; drink not to elevation.”
  2. SILENCE. Speak not but what may benefit others or yourself; avoid trifling conversation.”
  3. ORDER. Let all your things have their places; let each part of your business have its time.”
  4. RESOLUTION. Resolve to perform what you ought; perform without fail what you resolve.”
  5. FRUGALITY. Make no expense but to do good to others or yourself; i.e., waste nothing.”
  6. INDUSTRY. Lose no time; be always employ’d in something useful; cut off all unnecessary actions.”
  7. SINCERITY. Use no hurtful deceit; think innocently and justly, and, if you speak, speak accordingly.”
  8. JUSTICE. Wrong none by doing injuries, or omitting the benefits that are your duty.”
  9. MODERATION. Avoid extremes; forbear resenting injuries so much as you think they deserve.”
  10. CLEANLINESS. Tolerate no uncleanliness in body, cloaths, or habitation.”
  11. TRANQUILITY. Be not disturbed at trifles, or at accidents common or unavoidable.”
  12. CHASTITY. Rarely use venery but for health or offspring, never to dullness, weakness, or the injury of your own or another’s peace or reputation.”
  13. HUMILITY. Imitate Jesus and Socrates.”

Franklin wrote: “… [it is a ] bold and arduous Project of arriving at moral Perfection”.


Dec 05 2009

How to display song lyrics on iPhone/iPod

Category: SoftwareDmitry @ 9:11 pm

Did you know your iPhone/iPod software can display lyrics for songs?

Adding lyrics to your songs

You just need to make sure your mp3 files have “lyrics property” populated.

On your computer, open iTunes, right click on a song and choose “Get Info”. You should see this dialog:


Now click on “Lyrics” tab and add your text.

You can copy and paste lyrics text from websites, such as:

(Also, if you look around you’ll find software that will automatically add lyrics to all of your songs)

How to view lyrics on iPhone:

Once you’ve added lyrics to your songs and synced your phone, here is how you view it: when the song is playing, simply tab the screen once and it will overlay lyrics over album art!



Nov 22 2009

Stone Gardens — Seattle Bouldering Challenge 2009

Category: ClimbingDmitry @ 8:15 pm

People are patiently waiting to watch the open finals…

Read the rest of “Stone Gardens — Seattle Bouldering Challenge 2009″ …


Nov 13 2009

Heart over mind

Category: PersonalDmitry @ 10:55 pm

Never forget that people are emotional beings. All of our reasoning, and even most technical facts and logic stems from emotions. People have a never-ending desire for significance, a feeling of importance.

The desire for significance can be manifested in so many different ways:

  • You’re trying to switch lanes in traffic, but another person speeds up (by being in front of you, they forced you to acknowledge their presence).
  • It is the fuel behind any career. (Ambition, desire to be great fulfills this need for significance).
  • It is also why people become pastors, missionaries and other types of religious workers. (they get this feeling of significance through serving God and people).
  • It is also why we bother to document human history! (Historians were typically employed by wealthy people that wanted to be remembered).
  • It’s the reason for crime. (By taking something valuable away from you by force, I make you acknowledge my significance in your life).

The desire to feel significant, important, to be connected to others, to be a part of something … is the drive behind reason.

People can channel this desire in a positive or negative way … but they will certainly channel it!

For example, you’re at the DMV.

Read the rest of “Heart over mind” …


Oct 15 2009

Ducati Monster

Category: FunDmitry @ 12:50 am

Super light, tons of torque, handles like a mountain bike!

It has a much lower seat height compared to my Triumph:

Nice and crisp, love the color scheme:


Sep 22 2009

Leavenworth, September 2009

Category: ClimbingDmitry @ 5:43 am


Jul 20 2009

Mt. Rainier, camp Muir — Jonna, Jamie, Dmitry

Category: FunDmitry @ 4:43 am

Mt. Rainier, camp Muir — Jonna, Jamie, and Dmitry:


Jun 27 2009

CB550 Cafe Racer Project

Category: FunDmitry @ 6:44 am

I am excited to start building a CB550 “cafe racer” style bike.

I’ll show you guys a couple of bikes it is highly inspired by…

Read the rest of “CB550 Cafe Racer Project” …


Apr 14 2009

Asking Questions

Category: PersonalDmitry @ 2:30 am

There are no bad answers … there are only bad questions

The Quality of your questions literally creates your World. It determines the state of all areas of your life: Spiritual, Mental, Emotional, Intellectual, Physical, Relationships, Work, Fun and so on.

We experience the World with our thoughts. Our perception of Reality it skewed by many things. We never see things as they really are. I’ll go so far as to say nothing in the World even comes into existence until you observe it.

Thinking is nothing more than a process of asking a question and coming up with an answer. Questions are interesting because they impose a frame within which you attempt to answer them. Questions are like railroads tracks — they have presuppositions. Questions guide our awareness and thinking process.

Read the rest of “Asking Questions” …


Apr 08 2009

Best Life

Category: PersonalDmitry @ 3:13 am

Intro

Let me backtrack a bit a give you an overview of what this post is all about. My whole life I’ve been asking myself questions like:

  • what is success?
  • what makes people successful?
  • what is my purpose here?
  • how can I go after things I desire and at the same time bring good to others?
  • what is the very best thing I can do with my life and my time?
  • and so forth.

I realized that questions themselves define the frame. By frame I mean your mindstate, the frame of mind through which you look at the word. Just by asking questions you essentially placing your mind in a box, a “framework” within which you’re attempting to answer them. Most important questions are outside of reason and logic. I’ll type this really fast, in one shot, so bare with me if you find typos :).

Read the rest of “Best Life” …


Feb 16 2009

Dancing at LO_FI, Seattle

Category: FunDmitry @ 10:08 pm

Check out this vid of my friends and me dancing in lo fi:


Feb 16 2009

BBoy Free “Beggin” Video (Circle of Fire Crew)

Category: FunDmitry @ 7:45 am

Check out my friend Fredo’s video:


Jan 11 2009

Driver Skills Day at Bremerton Motorsports Park

Category: FunDmitry @ 10:36 pm

Today was so much fun! My friend Kevin and I drove to Bremerton Motorsports Park for a full track day with Porsche Club to practice slalom, skidpad, accident avoidance, figure 8, autocross and open events.

Getting ready for autocross event.


Safety first

Kevin’s white Carrera 4, and my Evolution MR.


It started to rain! AWD is so much fun on a slippery road.

Read the rest of “Driver Skills Day at Bremerton Motorsports Park” …


Jan 04 2009

Morihei Ueshiba: True Victory is Self-victory. Right here, Right Now!

Category: PersonalDmitry @ 9:12 pm

Masakatsu, “True Victory”.

Agatsu, “Self-Victory”.

Katsuhayabi “Victory right here, right now”.

“If your thoughts are antagonistic toward the cosmos, those thoughts will destroy you and wreck havoc on the environment. I know not how to defeat others I only know how to win over myself!” (Morihei Ueshiba, Creator of Aikido)

“Finally, brothers, whatever is true, whatever is noble, whatever is right, whatever is pure, whatever is lovely, whatever is admirable—if anything is excellent or praiseworthy—think about such things.” (Philippians 4:8).

Morihei maintained that the real and most dangerous opponents we face are fear, anger, confusion, doubt, and despair. If we overcome those enemies that attack us from within we can attain a “True Victory”.

“Get rid of all bitterness, rage and anger, brawling and slander, along with every form of malice. Be kind and compassionate to one another, forgiving each other, just as in Christ God forgave you.” (Ephesians 4:31)


Jan 04 2009

Tempu Nakamura

Category: PersonalDmitry @ 8:29 pm

“The most important thing for a human being is not what is between his or her ears; it is what is in his or her heart. If the spirit is strong, one can accomplish anything.

 You only live once. Keep yourself in the present. The past is gone, and the future is unknown.

 Do not try to cut off all your passions. Passions give birth to heroic activity. Fulfill your passion and that will bring bliss.

 Do not think of work — any work — as duty. If it is a duty, it will become a burden. How do you turn a burden into a pleasure? Live respectfully, correctly, positively, and boldly.

 When you rise in the morning, greet the day with vigor. During the day, refrain from thinking or saying “I am confused”, “I’m weak”, “I’m sad”, “I need help”. At night before you sleep, release all thoughts of sadness, anger or irritation. Think of pleasant things.

     
 

Do not overwork yourself.

Reflect constantly on your state of mind.

Approach others in a positive bright manner.

Always be grateful, honest, kind, and pleasant.

Speak truly and honestly.

Body and mind form a single entity; life follows basic natural laws that should not be violated.

Your attitude towards life determines its outcome.

The best attitude is based on respect, boldness, truthfulness, and purity.

Foster the life force by being healthy, courageous, decisive, resolute, and vigorous.”

-Tempu Nakamura


Dec 01 2008

Thanksgiving was awesome!!!

Category: PersonalDmitry @ 2:30 am


Nov 25 2008

Stone Gardens — Seattle Bouldering Challenge 2008

Category: ClimbingDmitry @ 6:02 am

As usual this was a great comp: lots of awesome problems and strong competitors!


Nov 05 2008

Olympia Bouldering Comp 2008

Category: ClimbingDmitry @ 3:14 am

I went to Olympia bouldering comp with my friends and we rocked the house!


Oct 11 2008

Gymnastic Rings Training Clips

Category: ClimbingDmitry @ 2:10 am


Sep 23 2008

Aikido: Ki in Daily Life quotes

Category: PersonalDmitry @ 8:14 am

I am (re)reading a book on Aikido called “KI In Daily Life” by Koichi Tohei.  Aikido has a very deep personal meaning to me and it has definitely shaped the way I go through life and interact with others.

This is a great book on some of the basic principles, such as mind and body coordination, strong will, and power of “positive thinking” (this phrase doesn’t translate well).

Here are some interesting quotes from this book: “The brain is always working while you are alive, you cannot eliminate the waves of the mind. It is impossible not to think anything. The waves of the brain, however, can be calmed down by half infinitely.

When the waves are calmed down infinitely toward zero, it is called concentration. “Think nothing” means concentration or calmness. It is a state of mind like a clear water surface which reflects, clearly and without error, everything and every phenomenon of the world.

In this complicated modern age, it must be valuable to learn how to acquire calmness of the mind which can distinguish right from wrong clearly.” -Koichi Tohei


Sep 22 2008

Dyno from Junior Climbing Nationals (2005)

Category: ClimbingDmitry @ 5:18 pm

Found this video as I was looking through my old pictures. In 2005 I was coaching Melissa Main for US Junior Nationals. Melissa places 2nd! Made it into US Junior National team and went on to compete in China in World’s Cup a month later!!!

This is the womens finals route … I decided to play on it and see how many holds I can :)

Melissa won and gave me her Prana hat:

Its pretty sweet, very *very* limited edition :) It was made for the 2005 US National Climbing team to compete in Beijing, China (World Cup).


Aug 14 2008

Breakdancing with friends at LO-FI

Category: FunDmitry @ 12:17 am

Dancing with Free and Orbitron (Circle of Fire crew), and other local bboys at club “LO_FI” (Seattle):

Orbitron is freestyling on the second half of the video.

Listen to 4:23

“… great to see release – my man goes
Dmitry is in the circle — he spins and let goes
with the palm on a hand over jacket

grant stand I can grand slam when I got here
Tip the beat, rock and nod, spot the block, till I get off to my forehead
Ya’ll know where its at, ya’ll spin on a hat …”


My ankle is feeling much better! I can finally start dancing again!!!


Aug 10 2008

Klimb Movie Project: Random Footage!

Category: ClimbingDmitry @ 8:37 am

As you might know, I am in the process of making a movie with my friend Johnny Goicoechea.

Climbing is a great passion in our lives! We are fortunate to be able to climb during a week and to escape from the city outside on weekends. There is a very strong local crew of boulderers and a great climbing community. It’s a beautiful thing. I want to capture it all on camera … our everyday life, climbing, training and other things that we do. It’s a movie about bouldering in the North West and it is also a movie about our lives.

Training on gymnastic rings at Stone Gardens (Seattle):

Here is some unedited footage:

And some more (random) footage:

Video from Tumtum (Spokane, WA):

Dancing with friends (at club LO_FI, Seattle):

More on our friends: Orbitron and Free (we didn’t shoot this video):

Music from the first two clips: Orbitron, “BBoy Universal” album.

Stay tuned for more clips and actual trailers :)


Aug 10 2008

Found a video of me on youtube

Category: FunDmitry @ 8:30 am

I was uploading our climbing movie project and found this video of me on youtube. I think it was shot by UW students for studying dynos?


Aug 08 2008

Time goes by faster the older you get?

Category: PersonalDmitry @ 2:48 am

After having a discussion earlier today about this, as I was driving home … I realized something about this saying – its just not true.

Any kind of excitement and anticipation make it feel like time is sloooowing down. Think about it. Lets say you’re so excited to do something with your friends on Friday. You have these huge plans. The whole week is going to feel like a month, because you just can’t wait for it to be that day!

Read the rest of “Time goes by faster the older you get?” …


Aug 04 2008

Evolution: Keep the wing or go wingless?

Category: FunDmitry @ 2:44 am

What do you guys think? Should I keep the stock wing, take it off, or get a little “trunk lip” for my car?

Stock Wing

So, here is a picture of my car (first pic). I think the stock wing is kinda big and silly, but it is functional … if I am taking 90-degree corners at 160 mph.

This car isn’t meant to be “pretty” — its all purely functional. But I think taking a wing off might make it look more subtle.
Read the rest of “Evolution: Keep the wing or go wingless?” …

Tags: , , , , , , , , , , ,


Jul 20 2008

Campusing Training Videos (Climbing without feet)

Category: ClimbingDmitry @ 7:45 am

Johnny Goicoechea Campusing

Campusing is a climbing exercise or “move” depending on your style :-) where you climb up the wall without using your feet. You don’t have to be able to do this in order to climb — There are plenty of climbers who can climb very hard but can’t even come close to doing what you’re about to see in these videos.

Climbing is not all about power and strength, but it is sure nice to have endless supplies of it!

Todd Meyers’ Campusing Workout: We recorded these videos at Wild Walls (Climbing Gym in Spokane) a few years ago. I just found these videos, so I am sharing them.

Warmup Set: Doing one-arms on a campus board, while skipping every other rung

Set 2: Doing one arms on very small (Metolius) rungs, skipping ever other one!

Read the rest of “Campusing Training Videos (Climbing without feet)” …

Tags: , , , , , , ,


Jul 17 2008

Finding a balance in Life

Category: PersonalDmitry @ 2:31 am

Dmitry KalashnikovI am going to share some of my very personal ideas on being balanced and staying on top of things. These things I figured out on my own a while back and I have been perfecting them every day. Being a software developer, I constantly trying to find an improved “algorithm” for … well, Living. I can’t give it all away because it’s too personal but here are a few practical tips and ideas:

Read the rest of “Finding a balance in Life” …

Tags: , , , , , , , ,


Jul 16 2008

New Climbing Movie Project!

Category: ClimbingDmitry @ 12:53 am

Highball at GoldbarAs many of you already know my friend Johnny Goicoechea and I are making a climbing movie. We have been going climbing every weekend in areas around Seattle (and further) and capturing the best climbs we can find.

It’s all being shot using a very nice hi-def camera, so 10 years from now when everything is in HD, we’ll look back at it and be glad we did :) The plot of the movie is about us, and is about our training for climbing, using gymnastic rings, campusing and other methods. After showing different exercises, we are showing how they apply in real-world situations.

Read the rest of “New Climbing Movie Project!” …


Jul 13 2008

Jackie Chan and Mitsubishi

Category: FunDmitry @ 6:59 am

Jackie Chan has the same car as meJackie Chan loves EVOs (Mitsubishi Evolution) and owns all generations of them (which is 1 through 10). Most of his movies have an Evo chase seen – watch “Who am I”, “Thunderbolt”). As you know, he does his own stunts and most of he is also a great driver.

Read the rest of “Jackie Chan and Mitsubishi” …

Tags: , , , , ,


Jul 12 2008

Foods to get you ripped

Category: ClimbingDmitry @ 7:40 am

Foods to get you rippedPeople are always wondering what I eat, or if I do any other training besides climbing. I do lots of other stuff, like martial arts, dancing, gymnastic rings, etc. But as far as foods, I actually do have a system that balances my energy.

Read the rest of “Foods to get you ripped” …

Tags: , , ,


Nov 20 2007

Hagakure

Category: PersonalDmitry @ 10:53 pm

Hagakure, The Code of the Samurai

Hagakure is a very interesting book I picked up — it has a lot of historical value since it describes life during ancient japan, when the shogun and samurai ruled the country. I’ve been a student of Aikido and other martial arts for some time now, so this is very interesting to me. Some of the stuff in this book is too wild and gruesome to mention but I thought these quotes were great.

Read the rest of “Hagakure” …


Nov 10 2007

Sprained Ankle

Category: ClimbingDmitry @ 3:43 am

Bummer! I injured my ankle while climbing at Stone Gardens. They just got done upgrading the floor at the gym – now it has a padded floor. No more rocks. As I came off the wall, my foot got stuck in-between pads and my body pivoted around it. I’ll be on crutches for a week and wear an ancle splint for a month.

Read the rest of “Sprained Ankle” …


Nov 06 2007

The best climbing day of the year

Category: ClimbingDmitry @ 12:54 am

This weekend went to Leavenworth again and I’ve had a really good day of climbing. It was one of those perfect temperature zero-gravity days. I warmed up by ripping a hold off the problem that everyone was trying. Haha. Felt kinda bad about it, since we were all going to do it. Then we went up the hill and I ended up flashing some v8 and also flashing the harder, direct version of it!

Read the rest of “The best climbing day of the year” …


Dec 15 2006

Regex Notes

Category: SoftwareDmitry @ 8:29 pm

Regular expressions (regex) let you search for a particular pattern. Regex consist of literal characters, and special characters, also called meta characters. Regex syntax has 2 modes, one inside of character classes, which is inside [ ] and one outsided of character classes. Read the rest of “Regex Notes” …


Dec 08 2006

B-Boy Performance at Big Easy for Red Bull “Flight Club” party!

Category: FunDmitry @ 7:41 am

Flovolution CrewToday was one of those memorable days I’ll always remember! My bboy crew, “Flovolution” performed at Big Easy for the RedBull “Flight Club” theme party. We shared the stage with breakers from Tri-Cities, and the “Circle Of Fire” (Seattle). Crazy Legs was there too, but he didn’t perform. Everyone was pretty sore from his workshop a day before. The Red Bull and Big Easy kindly provided us with Davenport hotel rooms, hats …

Read the rest of “B-Boy Performance at Big Easy for Red Bull “Flight Club” party!” …


Nov 28 2006

Crazy Legs of Rock Steady Crew will be at our studio

Category: FunDmitry @ 8:59 am

I got to teach a hip hop / footwork class tonight because my buddy Shanner was gone. Heard some great news … “Crazy Legs” of the Rock Steady Crew is going to be teaching a workshop at our dance studio (Simply Dance). I am pretty psyched about it. This guy pretty much invented breaking, windmills … etc.

Read the rest of “Crazy Legs of Rock Steady Crew will be at our studio” …

Tags: , , ,


Nov 24 2006

Making of Klimb, Rock Climbing Training Software

Category: Climbing, SoftwareDmitry @ 2:52 am

Klimb ScreenshotWhen I was in college, I had two computer classes in which we had to do a major final project. One of them was on relational databases and another on Java/Swing GUI programming. I also needed some kind of journaling software to keep track of my climbing and training. I wanted something that helped me visualize my progress and help me train more efficiently. So, I made Klimb, the very first Rock Climbing Training software. It helped me pass my classes, train smarter for comps and make some cash on the side!

Read the rest of “Making of Klimb, Rock Climbing Training Software” …


Nov 19 2006

Breakdance Performance

Category: FunDmitry @ 11:08 am

This weekend we did a breakdance performance at Simply Dance Studio (Spokane). The studio did a show on every type of dance they teach … salsa, swing, belly dancing and hustle.

Tags: , , ,