Learning a bit about some new technologies... any tips? - asp.net-mvc

OBJECTIVE: To learn a little more about some technologies I'm familiar with but not an expert in: Postgres, Compass/Sass, Google Maps API, Twitter API, and ASP.NET MVC 1.0, Flickr API
THE SITE: Just a fun little app with CRUD for addresses of my friends, then a page that kind of has a map of where they live, their last five tweets, and some of their flickr photos.
THE QUESTIONS:
I love LINQ. I mean I really love it. Probably unnaturally. How can I use LINQ and Postgres together with ASP.NET? Anyone have some experience with this? How about a good example? I mean mostly I'm just doing simple inserts and queries here, so I don't need a ton of features. I would like to make a db repository and have some IQueryables.
Compass docs seem woefully terse. Can someone point me to a nice set of examples...or is it really just that easy? Also, anyone have experience with it? Any snags - is it even worth it?
If I have, say, 50 friends and I want their last 5 tweets... Will I hit the API rate limit if I try to pull them all at once and update all of them at once, so that I don't run into network issues? Is it even worth it to do that?
Google are too smart for their own good. I don't really "get" the API docs. Can someone give me the 10 second overview? It's not a "mapplet" right?
Thanks in advance, you guys rock!
Edit - I'm also looking for general tips using any of those technologies!

There are several open source LINQ projects over on CodePlex.
DBLinq: http://dblinq.codeplex.com/
LINQ to Twitter: http://linqtotwitter.codeplex.com/
(disclaimer: I wrote LINQ to Twitter)
LINQ to Google: http://glinq.codeplex.com/
LINQ to Flickr: http://linqflickr.codeplex.com/

1) by "linq" I am assuming you mean the Linq2Sql orm. Unfortunately, it only supports SQL server, and probably will never get any other databases since it is no longer under active development. If you really want IQueryables from an ORM pointing at postgres, your best best is NHibernate.Linq http://codebetter.com/blogs/kyle.baley/archive/2008/04/07/trying-out-linq-for-nhibernate.aspx

another free alternative might be http://code2code.net/DB_Linq/index.html but this is not a very mature project

Related

Integration of Google Calendar into MVC

I don't normally ask for help on stack overflow, but when I do, it's usually after pulling out my hair for at least a few days!
That said, I'm having a heck of a time integrating Google Calendar in my MVC app. I need to be able to ask my users for their authorization and then do stuff with their calendar such as create events. I wouldn't say I'm having trouble getting the authorization from the user necessarily, but rather once I have it, how to go about using the refresh token. Or maybe I'm just not understanding the work flow.
Anyhow, Google's documentation on this is dismal at best. Searching for answers has been fruitless. The best solution I was able to find and actually make work is from here: nanovazquez/google-calendar-sample. Unfortunately that example is using a really early build and a lot had changed since.
So my question is this: does anyone know of, or have any working examples of an MVC project that uses the latest (or a more recent version) of the Google Calendar v3 api?
THANKS!
It seems that there's not going to be a lot of help in this area. I finally managed to figure things out for myself from what ever materials I was able to find. I suggest to start by creating a mock-up project to test things out. Once you have that working, you can port what you have over to an existing project. Be advised though, if it doesn't work there you'll probably end up doing a bit of sleuthing to chase down the problem that's not necessarily related to Google's API.

What is the easiest way to implement trivial forum in Umbraco?

I am building an Umbraco site, and there is a need for a really simple forum (e.g. one level of topics, a simple subject/body form for new entries and replies, that's about it)
What is the easiest way to implement this? I think nForum is an overkill. Should I go with Umbraco API for member management and content creation, of should I use my own prefixed db tables and custom backend implementation?
Thanks in advance
Themos
For small and limited requirements you can surely look at the UFORUM, it is time tested and pretty decent.
It supports membership out of the box...
http://our.umbraco.org/projects/collaboration/uforum-basics
Check it out Hope it helps.

Rails confusion with coding

I'm desperate. I've read and tried many things with rails. The problem isn't that "big", it is just that I'm still getting used to the convention over conf world. Lack of examples, too.
I just want to be able to have a site where you have roles (think admin, normal user, etc) and each of these can view,say, posts, articles. However, the admin obviously has access to update/delete posts,articles. Users only post, things like that.
I can create the authentications, sessions, and all. But I don't know how to present (or refactor) code. Where does the code for the admin go? views?, what about for users?
Would I need to create controllers specifically for admins, and users, others, in order to display the same model objects (articles, posts) that I'll be dealing with? including views?
Thanks
There's a free Railscast that may help you with this called "Authorization with CanCan".
If you feel like parting with some money, Rails 3 in Action also covers this sort of thing in Chapters 6 and 7.
First, watch this screencast: Where administration goes.
Second, watch this one: Restricting Access.
Then this one: Super Simple Authentication.
This should clear up your confusion and help you wrap your mind around "The Rails Way" of doing authentication and administration.
Once your immediate crisis is over, I would STRONGLY recommend you pick up a copy of "Beginning Rails 3". The kind of frustration you're experiencing is normal: when you come from the world of basic HTML plus scripting (javascript and php most likely) it's really hard to "get" the big idea that a framework imposes on your design.
Beginning Rails 3 takes about 2-3 days to work completely through, front to back. When you're done you'll TRULY understand Rails and your work will feel like FUN, not frustration. It's really, really, really, really worth it to take the time to read the book. 2-3 days with the book will save you 2-3 months of mediocre coding and learning by trial and error.
There are lots of examples available. One of the best sources of information is Railscasts. You will find many screencasts on authentication (including the most recent (#250), as chance would have it). You will also find them on authorization, which is the role-based mechanism you describe.
Here's a pretty thorough comparison of many authorization plugins: http://steffenbartsch.com/blog/2008/08/rails-authorization-plugins/
I would also look into cancan (railscast), which is newer than that list and highly regarded.

Best way to add full web search to my site?

I need to add full web search to my site. I need something like Google Custom Search but with no ads and it has to be free. Any recommendation of a web service or open source project that can index my site and allow me to search it will be helpful.
My site is made in ruby on rails, if that helps.
I'll make this question community-wiki so you can edit my bad English. I think many people can benefit from this question.
Check out Lucene. It's an open source search engine that will certainly be a fun learning experience to implement on your own site. It was originally designed by the Excite folks, I do believe.
Ferret is the Ruby port of Lucene. Check out the acts_as_ferret plugin.
Depends what you mean by full web search really. If you want to search the whole web then the answers above wont help you much as they are really for indexing and searching the content of your site. I would suggest using the Google ajax search (just a 'powered by google' needed, no ads) or Boss from yahoo (might require ads not sure).
http://code.google.com/apis/ajaxsearch/
http://developer.yahoo.com/search/boss/
People are going to acts_as_solr and thinking sphinx in the blogs i read:
http://acts-as-solr.rubyforge.org/
http://ts.freelancing-gods.com/
I've aslo been looking at tsearch in postgres, it looks very capable:
http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/
What do you mean by "full web search"?
The are good answers available for full-text search where a search engine indexes and queries the model objects stored in your database.
If you mean something that indexes and queries your rendered HTML, Nutch is a popular option with a web-crawler, parser, indexer, and query interface.
I recommend acts_as_xapian. It's very easy to implement, it's fast enough, and it's the got the features you'll normally need.

Best plugin for creating a "friends" system/social network for latest Rails?

I'm looking for a Rails plugin that eases the development of a "friends" system or social networking system for the latest versions of Ruby on Rails.
Before anyone says it...I know, I should probably create it myself, from scratch. And I am fully capable of this (I think). I'm just looking for a good plugin that can a.) make life a bit easier for me and b.) give me some ideas for reference.
I tried to make my own authentication system, and did what I thought was okay, but then I switched to restful_authentication and realized how poor my system was in comparison.
Thanks in advance...
U might wanna try Community Engine
from the website
CommunityEngine is a free, open-source
social network plugin for Ruby on
Rails applications. Drop it into your
new or existing application, and
you’ll instantly have all the features
of a basic community site.
it uses engines, easy to change layouts or do modifications
real world example - http://www.weebabystuff.com/
another option I know is Insoshi as Chuck posted
updated : look at this blogpost http://jimneath.org/2008/04/25/building-a-social-network-site-in-rails/
-- Ed :) --
You could look into http://lovdbyless.com/
This is a free open-source Rails social networking app which should give you plenty of ideas and pointers.
Ronald
You HAVE to see this railscasts video.
try acts_as_network plugin
The only one I know of is Insoshi. I haven't used it myself, but it sounds like that's what you're looking for.
I would recommend using OpenID library for rails to handle authentication.
On top of what others have said, there's also acts_as_network. The bonus of this one is that it's a pure plugin (doesn't require engines). Not having to worry about engines is a huge plus. The downside, of course, is that it's not a full fledged social network. It's just a friending plugin for models.
You might want to checkout the Amistad gem. It looks pretty simple and it supports both Mongoid and Active Record.
For avatars i would use avatar and try will-paginate for pagination. other then that i love can_serach to make it alot easier to search in the database.
You should also look at the other gems by technoweenie. There is alot of great stuff there that can help you
I've just been researching this myself and chosen to go with Bort & CommunityEngine
Bort because I am familiar with it already and it provides all you need in user authentication and basic application functionality. Community Engine because it is an Engines based plugin and some aspects of Engines are being merged into Rails 2.3 so I know what I learn will continue to be useful and because CommunityEngine seems more modular while lovedbyess and Insoshi seem more like complete applications and I suspect it would likely be more work to disentangle the features I want from the ones I don't. However, take that with a huge grain of salt since it is just based on high-level quick browse initial impressions.
If you just want an activity feed then there is the activity streams plugin

Resources