Rob’s Mind Flow

Random thoughts. Many topics. Find something intersting to you.  

ASP.NET MVC to Ruby on Rails - a possible move?

I’ve been working in Ruby (on Rails) some for the last couple of weeks. I’ve enjoyed it immensely for the most part. I like the power of the command line. How quickly some things work. Some things – like setup and deployment on Ubuntu – have been a bit daunting for me, but once there and working it’s, well, there and working – and with a lot less resources than IIS7 and Windows Server.

It’s hard to describe the shift. Is Ruby better? Easier? More efficient? Quicker development?

Rob Connery said it this way: http://wekeroad.tumblr.com/post/814375320/when-code-isnt-enough

All in all, the app is the end result, not what language it was written in. As long as it works well, meets the needs, and can be maintained it doesn’t matter if it was written in C#, BASIC, Ruby, Java, Python, etc. The idea has to be the champion. The question is how quickly can the idea become reality. I think RoR has some power and advantage here. The tooling is a lot different than most C# developers will be used to, but once you get a handle on the tooling the power is evident.

So far the only ones who have really said that language matters is Apple in the iPhone developer agreement. And I still think they are wrong too. (I get they want you to use their API and more power to them for that, but naming the languages you have to code in is a bit extreme.)

Anyway, just a thought out there. I’m not giving up ASP.NET MVC and C# too much out there already and I do like the framework and love the C# language. I like the backing of the .NET Framework. But I am leaning more on Ruby on Rails now. You don’t have to abandon one to have the other.

Anybody else out there switched from ASP.NET MVC to RoR? Anyone switched from RoR to ASP.NET MVC?

Comments [0]

Direction, Not Perfection

I was reading through some old emails today and I came across one from October of 2009 from David Allen of Getting Things Done (GTD). He had a “food for thought” entitled “Direction, not perfection.”

While perfection is an ideal goal it is often very difficult – if not impossible – to achieve. Perfection would be nice with code, children, philosophy, behavior, LIFE, etc. But sometimes I give up if I know it won’t be perfect. I stop in my tracks when I hit that first bump and sometimes I stop because I’m just thinking about the bumps.

I remember in elementary school I ran hurdles for a while during the track and field section of PE. I remember enjoying it. Looking forward to it even. Then I fell on the next-to-last hurdle one day. I didn’t like the hurdles much after that. I didn’t run them with the same speed and lack of hesitation that I did before. I remembered how bad the fall felt. I didn’t want to risk it again. But I also wasn’t perfect anymore and that was a big reason I stopped. I can think of other things I’ve given up on when I lost the impression I was “perfect” (I’ve never really been perfect at anything, but you already knew that).

I’ve learned more about the familiar “get back on the horse” since elementary school, but I still haven’t made it to perfection. I’ve learned to learn from failures. To embrace and cherish successes (and learn from them too, of course).

But recently I’ve been thinking more about “moving” and “doing” instead of “thinking” “planning” and “deciding” and David’s thoughts encourage that.

Heck, if I were going for perfection I wouldn’t be writing this blog now would I? I’d have it designed first (not using the default template it is as of July 2, 2010). I’d have more thought through editorial (ha!) schedule and I’d probably proofread and review my writing more.  But I’m going in a direction.

I’m not going in half cocked and winging it. That’s not what I mean at all. I think it can be summed up like this: There are consequences to our actions, but there are also consequences to our inactions. There will be more on that later.

Comments [0]

USA World Cup

Sorry to see the US loose. Happy for Ghana as only the secord or third African nation to make it to the quarter finals.

Didn't see the game. Listened to the last 15 minutes on ESPN's iPhone app and reviewed the game timeline. Cool app with lots of levels of detail.

While listening I heard many scoring opportunities for the US but all fell short (or wide) and a few were blocked. Just made me think about how many opportunities I have missed in life. I'm very certain that more have been missed than blocked. So here's to not missing opportunities.

Sent from a device where I type using my thumbs.

Comments [0]

Creating Twitter, LinkedIn, Facebook, etc links to share content.

I'm sure you've been on a site and seen the "Share this content" headline above a group of social media icons. Click on those icons and it takes you to your account with some pre-populated content in your status message so all you have to do is click a button to spread the word to your friends, followers, associates, or the world.

Here's a quick overview of how to create some of those links on your site.

Share on Twitter

Base URL: http://twitter.com/home

Parameters:
status   The message you want them to tweet

Example: http://twitter.com/home?status=@roberocity+showed+me+how+to+pre-populate+Twitter+statuses.%20http%3A%2F%2Fmindflow.robsutherland.net%2F

Whatever you put after the "status=" is what will be pre-populated in the "what are you doing?" field. The tweeter can change that message and then share with their followers. You can use hash tags or anything else. See the note below about url escaping characters below.

When writing your message, write it like you were going to tweet it. You can use @usernames, #hashtags and the RT prefix if you want. You still can't go over the character limit. Keep it simple. This will be a tweet.

Share on Facebook

Base URL: http://www.facebook.com/sharer.php

Parameters:
u   the URL to link to
t   title of content;

Example:http://www.facebook.com/sharer.php?u=http%3A%2F%2Fmindflow.robsutherland.net%2F&t=Roberocity+showed+me+how+to+share+pre-populate+Facebook+status

Technical documentation from Facebook can be found here.

When writing the title be concise and meaningful.

Share on LinkedIn

Base URL: http://www.linkedin.com/shareArticle

Parameters:
mini   must be set to "true" (it is required yet only has one valid option, it might not make sense, but that's how life is sometimes).
url   The destination URL
title   The title of the article
source   The source of the article, name of publication, Web site, etc.
summary A short summary (no more than 256 characters) describing the article

Example: http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fmindflow.robsutherland.net%2F&title=Pre-populate+LinkedIn+share+article+form+fields&summary=Roberocity+shows+how+to+quickly+add+social+sharing+links+to+any+Web+page&source=Rob+Sutherland+(Roberocity)

LinkedIn provides opportunity to share more information so take advantage of it, but still make it meaningful.

Share via email

Base URL: mailto: (yep, that's it, just a simple mailto: protocol link with no to address)

Parameters:
subject   The subject line of the email
body   The body of the email

Example: mailto:?subject=FWD+Learn+how+to+create+social+media+sharing+links+&body=http%3A%2F%2Fmindflow.robsutherland.net%2F+has+some+techniques+on+creating+social+media+links+take+a+look

This will simply open up the users email client and pre-populate the subject line and the body of the message. They'll just ender the "to" addresses and click send.

The subject line should be appropriate for email. Avoid spammy words and phrased and keep it shorter than the above (bad) example. The body should be a starting point. Keep it simple and remember that this will be coming from someone else so don't make it too much your own. Keep the language short. Senders will reword and customize the email message anyway to make it more meaningful to the recipients—at least I hope they do.

Further Reading

There are many, many, many other social networking sites that use similar technology. I use these three in my daily life. I also use http://www.delicious.com/ but not so much as a social tool. So this is by no means an exhaustive live, just ones that I'm more familiar with and use most often.

http://www.addthis.com/bookmark.php Lists just about every social media, link sharing, or news site out there. You can take a look at the code used behind the scenes or just click on the network of your choice and see what the URL looks like and deduce for yourself how to create the links.

Implementing this into your content management system or blog engine would be fairly straightforward, but I'll leave that implementation detail up to you. For all I know you already have it available in your blog engine and you're reading this for the heck of it.

URL Encoding

You'll notice all the %20 and %xx strings. Those are escaped characters to keep the URL free of characters that may cause problems like space (%20 or +) and the # (%23) sign that has significance in normal URLs. Some social sites don't require the escaping, but all will accept it so it is a good practice to get into. Use this page to encode the strings for you and make your life easier.

Since you'll need to URL encode some text, here's a couple of handy tools: http://www.albionresearch.com/misc/urlencode.php, http://urlencodedecode.com/, http://meyerweb.com/eric/tools/dencoder/ They all do the same thing and none are pretty so just take your pick and smile.

If you're creating links using javascript just use encode('the text you want to encode') and you're good to go.

End

Let me know any comments or questions. Heck, even point out something I did wrong. I'll listen and answer—promise.

Comments [0]

Social Media + Gulf Oil Spill

Worked on this site – http://www.care4ourcoast.com/ with a client. We don’t agree politically, but on this issue we will agree. Take a look if you can, get behind it, show your support, volunteer, donate, buy a sticker and spread the word. I’m not a social media expert. I’ve added the Facebook, LinkedIn and Twitter icons before but I haven’t tracked them like I am on this site.

This site is only one page for now. We’re talking about adding another page, but that will be about it. It isn’t going to become a site. So I have limited stats to work with. But I’m tracking everything. Every click gets counted. We’re trying to measure the social response and see what we can generate and what happens with what we (or others, hint, hint) create.

I’ll post in the next few days some reports and analysis.

Comments [0]

Long Time No Post

Ok. So it's been months (a few days past 7 months to be exact). That doesn't
mean I've been that busy. Just means I haven't taken the time to post. I've
thought often of things to say - things that need to be said and should be
said. I've been trying to define who I am and what it is that I'm going to
say here and how I want to talk to the audience that I have - however few
and whoever you are. So I've made some of those decisions. Haven't nailed anything down, but you
can surely expect to see more posts coming and with greater frequency.
You'll also see a lot of varied topics and clarification of past topics. I'll be posting a lot more snippets just so I'll have to think about the
code I write (C#, Obj-C, JavaScript, CSS, HTML) before finishing it off and
also so I'll have a record of what I've learned and done.

As always, comments are welcome and I'll respond as much as possible.

Comments [0]

Email Newletters and what not to do

Ok, my email newsletter marketing tactics and copywriting skills may not be dead-on, but I know a thing or two and well, this made me click delete.

I also know that I'm not really the target of this newsletter. I'm not a 3D animator or invigorator. But when I open the email and see the big  unsubscribe link it really is temping. Especially when the first line of body copy is REALLY that good too.

I try hard to just not suck. And that keeps me busy.

Comments [0]

Linq to SQL and connection string in the web.config file

Maybe you've never run into this problem before but I have. And it's a pain in the butt when it happens. When you create your .dbml file in Visual Studio the connection string to the database is stored in a couple of different locations and none of them are in the web.config or app.config file.

You're ready to test or launch the site and want to change the connection string, but it isn't centralized and isn't really that easy to find.

Take a look here (http://goneale.com/2009/03/26/untie-linq-to-sql-connection-string-from-application-settings/) for instructions on how to use the app.config or web.config file to store the connection string

 

Filed under  //   .net   configuration   linq  

Comments [0]

See a need fill a need. MVC, Web Forms, SharePoint, Ruby, PHP and a cartoon

Robots is one of my kid's favorite movies. I like it too. "See a need. Fill a need." is the motto of the main character. He's a young inspiring inventor. It's a phrase he heard as a child from one of his role models, Big Weld, an older, successful inventor. I struggle with wanting to do things right. To provide the right solution at the right price and on the right schedule. And that's all well and good. Great goals. "Right" isn't always easy to quantify. Who gets to define "right" in this case?

Choose a platform, a language a framework. Define the specs and create and architecture. But dang, how do I know if it's "right?" It isn't when I say it's right. It's when the users say it's right. That's the key. Isn't it? If it doesn't fill a need - and provide a good experience - then it isn't right. Even if my architecture is perfect, my code pretty and I've got a green light on all my tests.

Yeah, I know, the "acceptance test" is the final test and of course if that doesn't pass it isn't right. But it is still possible to do something that is accepted, but still not right.

So, it doesn't matter if you use Ruby, PHP, ASP.NET (Web forms or MVC), mySQL, MSSQL, Oracle, Linux, Windows, Mono, Perl, TDD, BDD or any other software, tool, platform or framework. If you don't fill the need you don't win.

Filed under  //   general   Process  

Comments [1]

Nobody wants my Code...either

I love code. My Code anyway. I think code should work and be simple, clear, readable and maintainable. I think it should be pretty too. It shouldn't hurt your eyes or your brain to look at it on the screen. But in truth, I'm the only one who wants my code.

Bevan at nicheSoftware puts in better here:  http://www.nichesoftware.co.nz/content/nobody-wants-my-code

Filed under  //   general  

Comments [1]