Daily Archives

Articles indexed Thursday May 27 2010

Page 5/122 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Multi-tenant ASP.NET MVC – Introduction

    - by zowens
    I’ve read a few different blogs that talk about multi-tenancy and how to resolve some of the issues surrounding multi-tenancy. What I’ve come to realize is that these implementations overcomplicate the issues and give only a muddy implementation! I’ve seen some really illogical code out there. I have recently been building a multi-tenancy framework for internal use at eagleenvision.net. Through this process, I’ve realized a few different techniques to make building multi-tenant applications actually quite easy. I will be posting a few different entries over the issue and my personal implementation. In this first post, I will discuss what multi-tenancy means and how my implementation will be structured.   So what’s the problem? Here’s the deal. Multi-tenancy is basically a technique of code-reuse of web application code. A multi-tenant application is an application that runs a single instance for multiple clients. Here the “client” is different URL bindings on IIS using ASP.NET MVC. The problem with different instances of the, essentially, same application is that you have to spin up different instances of ASP.NET. As the number of running instances of ASP.NET grows, so does the memory footprint of IIS. Stack Exchange shifted its architecture to multi-tenancy March. As the blog post explains, multi-tenancy saves cost in terms of memory utilization and physical disc storage. If you use the same code base for many applications, multi-tenancy just makes sense. You’ll reduce the amount of work it takes to synchronize the site implementations and you’ll thank your lucky stars later for choosing to use one application for multiple sites. Multi-tenancy allows the freedom of extensibility while relying on some pre-built code.   You’d think this would be simple. I have actually seen a real lack of reference material on the subject in terms of ASP.NET MVC. This is somewhat surprising given the number of users of ASP.NET MVC. However, I will certainly fill the void ;). Implementing a multi-tenant application takes a little thinking. It’s not straight-forward because the possibilities of implementation are endless. I have yet to see a great implementation of a multi-tenant MVC application. The only one that comes close to what I have in mind is Rob Ashton’s implementation (all the entries are listed on this page). There’s some really nasty code in there… something I’d really like to avoid. He has also written a library (MvcEx) that attempts to aid multi-tenant development. This code is even worse, in my honest opinion. Once I start seeing Reflection.Emit, I have to assume the worst :) In all seriousness, if his implementation makes sense to you, use it! It’s a fine implementation that should be given a look. At least look at the code. I will reference MvcEx going forward as a comparison to my implementation. I will explain why my approach differs from MvcEx and how it is better or worse (hopefully better).   Core Goals of my Multi-Tenant Implementation The first, and foremost, goal is to use Inversion of Control containers to my advantage. As you will see throughout this series, I pass around containers quite frequently and rely on their use heavily. I will be using StructureMap in my implementation. However, you could probably use your favorite IoC tool instead. <RANT> However, please don’t be stupid and abstract your IoC tool. Each IoC is powerful and by abstracting the capabilities, you’re doing yourself a real disservice. Who in the world swaps out IoC tools…? No one!</RANT> (It had to be said.) I will outline some of the goodness of StructureMap as we go along. This is really an invaluable tool in my tool belt and simple to use in my multi-tenant implementation. The second core goal is to represent a tenant as easily as possible. Just as a dependency container will be a first-class citizen, so will a tenant. This allows us to easily extend and use tenants. This will also allow different ways of “plugging in” tenants into your application. In my implementation, there will be a single dependency container for a single tenant. This will enable isolation of the dependencies of the tenant. The third goal is to use composition as a means to delegate “core” functions out to the tenant. More on this later.   Features In MvcExt, “Modules” are a code element of the infrastructure. I have simplified this concept and have named this “Features”. A feature is a simple element of an application. Controllers can be specified to have a feature and actions can have “sub features”. Each tenant can select features it needs and the other features will be hidden to the tenant’s users. My implementation doesn’t require something to be a feature. A controller can be common to all tenants. For example, (as you will see) I have a “Content” controller that will return the CSS, Javascript and Images for a tenant. This is common logic to all tenants and shouldn’t be hidden or considered a “feature”; Content is a core component.   Up next My next post will be all about the code. I will reveal some of the foundation to the way I do multi-tenancy. I will have posts dedicated to Foundation, Controllers, Views, Caching, Content and how to setup the tenants. Each post will be in-depth about the issues and implementation details, while adhering to my core goals outlined in this post. As always, comment with questions of DM me on twitter or send me an email.

    Read the article

  • Multi-monitor Usage

    - by logan2
    How many different applications do you use with a 2, 3, 4, 5 or more monitor setup? What's the most sophisticated multi-monitor setup you've seen? To be more specific, I would like to know exactly how you use your multi-monitor setup and how can I make better use of my own. How does someone take full advantage of a multi-monitor setup? And does having more monitors help your productivity?

    Read the article

  • rewrite not a member of LiftRules

    - by José Leal
    Hi guys, I was following http://www.assembla.com/wiki/show/liftweb/URL_Rewriting tutorial for url rewritting in liftweb.. but I get this error: error: value rewrite is not a member of object net.liftweb.http.LiftRules .. it is really odd.. and the documentation says that it exists. I'm using idea IDE, and I've done everything from scratch, using the lift maven blank archifact. Some more info: [INFO] ------------------------------------------------------------------------ [INFO] Building Joseph3 [INFO] task-segment: [tomcat:run] [INFO] ------------------------------------------------------------------------ [INFO] Preparing tomcat:run [INFO] [resources:resources {execution: default-resources}] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 0 resource [INFO] [yuicompressor:compress {execution: default}] [INFO] nb warnings: 0, nb errors: 0 [INFO] artifact org.mortbay.jetty:jetty: checking for updates from scala-tools.org [INFO] artifact org.mortbay.jetty:jetty: checking for updates from central [INFO] [compiler:compile {execution: default-compile}] [INFO] Nothing to compile - all classes are up to date [INFO] [scala:compile {execution: default}] [INFO] Checking for multiple versions of scala [INFO] /home/dpz/Scala/Doit/Joseph3/src/main/scala:-1: info: compiling [INFO] Compiling 2 source files to /home/dpz/Scala/Doit/Joseph3/target/classes at 1274922123910 [ERROR] /home/dpz/Scala/Doit/Joseph3/src/main/scala/bootstrap/liftweb/Boot.scala:16: error: value rewrite is not a member of object net.liftweb.http.LiftRules [INFO] LiftRules.rewrite.prepend(NamedPF("ProductExampleRewrite") { [INFO] ^ [ERROR] one error found [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1(Exit value: 1) [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 19 seconds [INFO] Finished at: Thu May 27 03:02:07 CEST 2010 [INFO] Final Memory: 20M/175M [INFO] ------------------------------------------------------------------------ Process finished with exit code 1 enter code here

    Read the article

  • Creating a variable-speed slideshow based on USB input on OSX.

    - by Dave A
    I have a friend who is trying to put together a geeky little contraption for a wedding, where people can view a slideshow. Neither of us use Macs, nor have programmed for one, but for various reasons it has to run on a Mac. There will be a USB ammeter hooked up to a bike dynamo. What we want is for a slideshow to be run, and advance at a speed relative to how fast someone is pedaling on a stationary bike. After much googling, it seems like we could load an iPhoto slideshow up via applescript. Is it possible to pause the slideshow and advance it with keypress commands? The applescript commands would be run via a bash script or similar that would monitor the value returned by the USB ammeter's command-line app and issue the keypress events accordingly. Is there some other app that could be likewise scripted to display photos?Hoping someone has some hints to get us started in the right direction! Thanks!

    Read the article

  • PHP string parsing

    - by tmatthews
    I am trying to parse a list of operating system instances with their unique identifiers. I am looking for a solution to parse a text string, and pass the values into two variables. The string to be parsed is as followed: "Ubuntu 9.10" {40f2324d-a6b2-44e4-90c3-0c5fa82c987d}

    Read the article

  • Mac OS : creating a background periodic simple script

    - by Julien
    Hi folks ! I have a friend who wants something quite easy : he has a mac, and he would like a very simple script/app that runs in the background. The goal is to replace a file every 5 minutes with one downloaded from the internet. I would also like a menu on the top bar (like the clock on Mac Os, the wifi, the sound, Dropbox,...) What would be the easiest way to do that ? Objective C ? AppleScript ? Do you guys have any inspiration for that ? Thanks a lot Julien

    Read the article

  • JQuery datepicker defaultdate from another datepicker

    - by Paul
    Hi, I have several jquery datepickers on my asp page and I want to set the defaultdate of date picker to be the same as the previous datepicker. I am currently using defaultDate: document.getElementById('<%=txtFirstDate.ClientID%>').value This works okay, but obviously errors if firstDate is null. Should I be using OnSelect function instead? Appreciate any help

    Read the article

  • MonoRail - Select parent category from one dropdown, show child category dropdown

    - by Justin
    Hey, I'm new to MonoRail and am trying to figure out how to have it so that I can select a parent category in a dropdown then have it show a second dropdown with the categories that are children of the parent. If I were using what I'm used to, ASP.NET MVC, I would have a javascript function that would be called onchange of the first dropdown and would make an ajax call to a controller method (passing in the selected parent category id) that would grab all child categories of that parent category and return them in JSON. Then in the callback javascript function I would eval the JSON and populate the second dropdown with the child categories. How would I do this using MonoRail/jQuery? Here's the code I have so far: $FormHelper.Select("business.category.id", $categories, "%{value='id', text='name', firstoption='Select a Category'}") $FormHelper.Select("business.category.id", $childCategories, "%{value='id', text='name', firstoption='Select a Sub-Category'}") Then in BusinessController.cs: private void AddDataToModels() { PropertyBag["categories"] = CategoryRepository.GetParentCategories(); PropertyBag["childCategories"] = CategoryRepository.GetChildCategories(1); } Thanks for any input on how to approach this! Justin

    Read the article

  • OLEDB connection to Access database using DSN

    - by somu
    Hai i want oledb connection using Dsn. I used the following code 'Dsn Create dbRegBase.RegisterDatabase("GEMINI", "Microsoft Access Driver (*.mdb)", True,DBQ=D:\Gemini\GEMINI\database\paints_01_2008-2009.mdb Description=Greenchip Technologies ODBC Database File Path OemToAnsi=No UID=admin PWD=XXXXXX conection code Provider=Microsoft.Jet.OLEDB.4.0;DBQ ='GEMINI';Persist Security Info=False;Jet OleDB:Database Password = XXXXXX But Error come error name is "Could not find installable ISAM" what i do . please tell me.

    Read the article

  • Why doesn't TextBlock databinding call ToString() on a property whose compile-time type is an interf

    - by Jay
    This started with weird behaviour that I thought was tied to my implementation of ToString(), and I asked this question: http://stackoverflow.com/questions/2916068/why-wont-wpf-databindings-show-text-when-tostring-has-a-collaborating-object It turns out to have nothing to do with collaborators and is reproducible. When I bind Label.Content to a property of the DataContext that is declared as an interface type, ToString() is called on the runtime object and the label displays the result. When I bind TextBlock.Text to the same property, ToString() is never called and nothing is displayed. But, if I change the declared property to a concrete implementation of the interface, it works as expected. Is this somehow by design? If so, any idea why? To reproduce: Create a new WPF Application (.NET 3.5 SP1) Add the following classes: public interface IFoo { string foo_part1 { get; set; } string foo_part2 { get; set; } } public class Foo : IFoo { public string foo_part1 { get; set; } public string foo_part2 { get; set; } public override string ToString() { return foo_part1 + " - " + foo_part2; } } public class Bar { public IFoo foo { get { return new Foo {foo_part1 = "first", foo_part2 = "second"}; } } } Set the XAML of Window1 to: <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <StackPanel> <Label Content="{Binding foo, Mode=Default}"/> <TextBlock Text="{Binding foo, Mode=Default}"/> </StackPanel> </Window> in Window1.xaml.cs: public partial class Window1 : Window { public Window1() { InitializeComponent(); DataContext = new Bar(); } } When you run this application, you'll see the text only once (at the top, in the label). If you change the type of foo property on Bar class to Foo (instead of IFoo) and run the application again, you'll see the text in both controls.

    Read the article

  • Hibernate cascade debug options

    - by Chris
    I have run into various StackOverflowErrors which occur during cascading. These have been extremely time consuming in debugging because I don't know which properties are being cascaded to cause this recursive behavior. Does anyone know of a log setting or some other form of debugging which could tell me specifically what properties are being cascaded?

    Read the article

  • JQuery never reaches success or fail on aspx returning json.

    - by David
    Basicaly I have my aspx page doing <% Response.Clear(); Response.Write("{\"Success\": \"true\" }"); Response.End(); %> My JQuery code is function DoSubmit(r) { if (r == null || r.length == 0 || formdata == null || formdata.length == 0) return; for (i = 0; i < formdata.length; i++) { var fd = formdata[i]; r[fd.Name] = fd.Value; } r["ModSeq"] = tblDef.ModSeq; jQuery.ajax({ url: "NashcoUpdate.aspx" , succsess: doRow , error: DoSubmitError , complete: DoSubmitComplete , dataType: "json" , cache: false , data: r , type: "post" }) } When I call the DoSubmit() function every thing works but the doRow or DoSubmitError functions never get called only the DoSubmitComplete function. When I look at the response text in teh DoSubmitComple function it is {"Success": "true" } Every JSON tester I have tried says that this is valied JSON. What am I doing wrong here?

    Read the article

  • What is Google Docs' SLA?

    - by Walter White
    Hi all, I am evaluating online storage and for me, that means either Amazon S3 or Google Docs. Amazon very clearly posts there reliability and SLA: http://aws.amazon.com/s3/#protecting Their rates are obviously higher than Google's, but it is really hard to compare without having an SLA. Does anyone know what Google's commitment is for reliability? Is it 99.99% for data, is there anyway to make that more durable? I have to ask too, wouldn't google docs at least be inheritently more reliable than a hard drive? Thanks, Walter

    Read the article

  • Rails/SQl query help: Find all by created_at in past 7 days per each day?

    - by Senthil
    I'm unable to get SQL and Rails to play properly when trying to find Categories that are created each day, the past 7 days. So basically I want to find each Category sorted by the day they were created for the past 7 days. I found this on stackoverflow, but it isn't finding a Category that I just created: Category.all(:conditions => ["created_at > ? AND created_at < ?", t.at_beginning_of_day, t.tomorrow.at_beginning_of_day]) Any help?

    Read the article

  • how do simple SQLAlchemy relationships work?

    - by Carson Myers
    I'm no database expert -- I just know the basics, really. I've picked up SQLAlchemy for a small project, and I'm using the declarative base configuration rather than the "normal" way. This way seems a lot simpler. However, while setting up my database schema, I realized I don't understand some database relationship concepts. If I had a many-to-one relationship before, for example, articles by authors (where each article could be written by only a single author), I would put an author_id field in my articles column. But SQLAlchemy has this ForeignKey object, and a relationship function with a backref kwarg, and I have no idea what any of it MEANS. I'm scared to find out what a many-to-many relationship with an intermediate table looks like (when I need additional data about each relationship). Can someone demystify this for me? Right now I'm setting up to allow openID auth for my application. So I've got this: from __init__ import Base from sqlalchemy.schema import Column from sqlalchemy.types import Integer, String class Users(Base): __tablename__ = 'users' id = Column(Integer, primary_key=True) username = Column(String, unique=True) email = Column(String) password = Column(String) salt = Column(String) class OpenID(Base): __tablename__ = 'openid' url = Column(String, primary_key=True) user_id = #? I think the ? should be replaced by Column(Integer, ForeignKey('users.id')), but I'm not sure -- and do I need to put openids = relationship("OpenID", backref="users") in the Users class? Why? What does it do? What is a backref?

    Read the article

  • TFS 2010 and SSL Configuration: Part 1 Certificates in Place

    - by Enrique Lima
    What is needed?  For starters, an understanding on the how to properly configure a certificate in IIS. Many people have found challenges in working with certificates in IIS 7 First thing is to get your certificate created, and then proceed to add it to IIS 7 By clicking on Server Certificates, we will get to this And we will be able to see the certificate or certificates installed. What options do we have to get certificates? They can be generated “in-house” or purchase them from certification authorities.  If it is “in-house”, you will those options in the Server Certificates area of IIS Manager.

    Read the article

  • Easiest way to get an NSDate representation of "the next 7am that will occur" in Cocoa?

    - by Drarok
    I figure I can achieve what I want by using NSCalendar and NSDateComponents, but that would run something like the following: Get "now" Create an NSDateComponents from "now". If "now" is pre-7am, then use today's date. If "now" is post-7am, use tomorrow's date. If today is the last day of the month, increase month, set day to 1. If it was December, increase year by 1 also. Set hour, minute, second. Create a new NSDate. It all seems very long-winded, but that appears to be what other answers on here suggest, and the documentation doesn't offer any clues. I'm going back and forth between all the date and calendar classes I can find. Is there a simple way to ask for the "next occurring 7am" ? Thanks.

    Read the article

  • VS2010 Build Definitions - Creating a MSBuild task for JS/CSS Minification

    - by RPM1984
    Hi guys, We've recently upgraded from VS2008 - VS2010 (and hence upgrading from Web Deployment Project to proper deployment templates). Alas - my Workflow skills arent quite up to scratch. Previously, we used a MSBuild task to execute the Yahoo YUI Javascript/CSS compression module to minify/compress javascript and css files. Anyone manage to accomplish this task with Visual Studio 2010 / TFS 2010 ?

    Read the article

  • Coffeeshop limits Internet connection to 30 minutes -- how does it recognize me if I delete my cooki

    - by Andrew
    I was connected to the Internet in a coffeeshop earlier today, but I was only allowed 30 minutes of access. I tried deleting my cookies after my time was up (though admittedly I didn't delete my Flash cookies -- would that have solved the problem?), but the connection still recognized that I'd already used 30 minutes, so I couldn't connect again. How did the connection recognize me still? The wireless was unprotected (no code or password), it just had a portal you had to pass through upon the initial connection. I'm not terribly familiar with web development or computer networks, so just trying to get a better idea of what's happening (and possibly to know what to do next time I use up my minutes =)).

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >