posts - 81, comments - 262, trackbacks - 0

Web Programming

Migrating an MVC site to Orchard Project 2 (Part 2)

I've started migrating my application into the module. The major consideration has been handling the use of LINQ to SQL and the Entity Framework together. My MVC application uses LINQ to SQL. I had to regenerate the data context with sqlmetal to resolve some odd errors when working with NHibernate. In particular my data context was generated by an old version of sqlmetal – it just needed an updated generation. I found it useful to create a BAT file to regenerate the context for me. call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\VsDevCmd.bat" sqlmetal /server:MACHINENAME /database:DBNAME /code:DataContext.cs /language:csharp /views /functions...

posted @ Sunday, December 2, 2012 2:55 PM | Feedback (13) | Filed Under [ Web Programming ]

Migrating an MVC site to Orchard Project (Part 1)

I have been moving an asp.net MVC web site of mine to the Orchard Project. As a developer I love working with MVC, however, I had not found a nice solution for content management. All of the solutions were too intrusive, tainting the MVC flavor of the site, or rather young projects I didn't want to invest in. A recent survey of Content Management System (CMS) solutions found me looking right at the Orchard Project. The project is not 'light', but it is very elegant. The project uses the 'MS Web Stack of love' which...

posted @ Sunday, November 11, 2012 4:51 PM | Feedback (2) | Filed Under [ Web Programming ]

Simple method to constrain stored procedures by a collection

Passing a collection of ID's to filter a SQL query within a stored procedure is not natively supported. Consider this article which discusses methods for passing arrays into a stored procedure. Constraining a stored procedure's query has a simple work around, however. Passing the ID collection as a comma deliminated string allows the query to use LIKE to constrain the results. Note that the preceding and trailing commas are necessary. An example demonstrates how to do this easily.  DECLARE @Ids varchar(max); set @Ids = ',1,2,3,4,5,'; Select * from [TableName]     WHERE @Ids LIKE ('%,' + cast(TableID as varchar(50)) + ',%')

posted @ Saturday, April 7, 2012 4:12 PM | Feedback (2) | Filed Under [ Web Programming ]

Update Summer 2011

I have been lax in updating posts on the blog.  Mostly this is because I have been transitioning from web development to my Ph.D. research work in Aerospace Engineering over the last two or so years.  The topic of the blog thus far has been mostly web development related, with less significant posts on the topic recently. I’ve decided to transition the blog into my current focus, research, as my personal focus has also shifted (it is a personal blog after all).  As part of this I have updated the blog engine itself (subtext).  Many thanks to those at...

posted @ Monday, June 20, 2011 3:18 PM | Feedback (6) | Filed Under [ Web Programming School ]

Skype an IIS Gotcha

 I was getting the following error after installing IIS and starting a new Web Site in Windows 7  --------------------------- Internet Information Services (IIS) Manager --------------------------- The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020) --------------------------- OK ---------------------------  And in the System Event Log:  The World Wide Web Publishing Service (WWW Service) did not register the URL prefix http://something.local:80/ for site 1. The site has been disabled. The data field contains the error number.  It turns out Skype automatically listens to port 80 and 443. Change this is the advanced settings of Skype to fix the issue.

posted @ Tuesday, January 18, 2011 9:22 PM | Feedback (2) | Filed Under [ Web Programming ]

Undo Within Selected

Today I was working on some code, nothing particularly different than any other day. I did something I have done thousands of times before, made some changes, and then needed to get previous code back. This was quickly done with undo several times, copy to clip board, redo several more and then paste. Then it hit me, why don't we have an undo within selected text? We have a search and replace within selection. Undo within selection complements the search and replace really well, and further, allows for quicker retrieval of code several edits ago....

posted @ Sunday, June 7, 2009 12:53 PM | Feedback (0) | Filed Under [ Web Programming ]

ASP NET MVC Version 1 Released

Version 1 of ASP.NET MVC has been released, presumably for MIX in Vegas. It's been a year following the project, and it's exciting to see MVC released after three years of development since March 16th 2007. http://www.microsoft.com/downloads/details.aspx?FamilyID=53289097-73ce-43bf-b6a6-35e00103cb4b&displaylang=en Overview ASP.NET MVC 1.0 provides a new Model-View-Controller (MVC) framework on top of the existing ASP.NET 3.5 runtime. This means that developers can take advantage of the MVC design patterns to create their Web Applications which includes the ability to achieve and maintain a clear separation of concerns (the UI or view from the business and application logic and backend data), as well as facilitate...

posted @ Wednesday, March 18, 2009 9:21 AM | Feedback (0) | Filed Under [ Web Programming ]

Unifico Load Tested with and without WCF Remoting

This is rather exciting to me; I just ran a few load tests on Unifico with and without remoting the services with WCF bindings. I knew the application could remote. The concern was how efficient. I created a quick web test that simply goes through the admin, lists the admin lists, performs a filter, edits and saves an item, then logs out. Roughly every action was hit (eh, it's a spike :)). I then setup the bindings and ran a load test remotely and locally (remotely being hosted on 127.0.0.1). I like to call the...

posted @ Sunday, January 11, 2009 1:32 AM | Feedback (0) | Filed Under [ Web Programming ]

Using a Recursive Expression to Create an Html Menu

I find recursive expression to be really useful. They are particularly handy when dealing with parent child relationships. As a demonstration, see a potential method for generating a site map below:     1 using System;     2 using System.Collections.Generic;     3 using System.Linq;     4 using System.Text;     5      6 namespace SiteMapDemo     7 {     8     class MenuItem     9     {    10         public Guid ID { get; set; }    11         public Guid? ParentID { get; set; }    12         public string Name { get; set; }    13         public string Path { get; set; }    14         public int Rank { get; set; }    15     }    16     class Program    17     {    18         static void Main(string[] args)    19         {    20             List<MenuItem> menu = new List<MenuItem>(new[]{    21        ...

posted @ Thursday, January 8, 2009 7:40 PM | Feedback (0) | Filed Under [ Web Programming ]

Paging with Filters and Sorts added to Unifico

Two new additions were added to Unifico: filtering on fields and sorting on fields with the help of Html Extension methods. A PagingSet class was defined to contain configuration options for the paging. In this way a View can still page on more than one list and maintain complete control over the Html rendered. Every string used in the Html Helpers is pulled from the configuration (A default is made available). Several extension methods were added to the Html Helper to make rendering the controls easier. The filtering html form can be rendered with <%= Html.FilterInput(Paging, "Go")...

posted @ Sunday, January 4, 2009 6:25 PM | Feedback (2) | Filed Under [ Web Programming ]

Unifico’s Account Component Gets an Admin

The Account Component in the Unifico Framework which is serving as a sample component now has an admin. Two supporting developments for the admin are also up: the paging HtmlHelper and overridable embedded views. Allowing for the embedded views to be overridden by placing new views in App.Web greatly eases development and should help in Component maintenance and versioning (new views can be made without rebuilding the component). I am also rather happy with the eas to which views are made overridable. The paging turned out quite well, a few changes to the PageResponse<T> to implement IPageable made...

posted @ Saturday, January 3, 2009 10:45 PM | Feedback (14) | Filed Under [ Web Programming ]

Allowing for Dynamic Embedded View Substitution with MVC

A while back I found an interesting post on embedding resources in MVC at "The Glass is Too Big" (http://www.wynia.org/wordpress/2008/12/05/aspnet-mvc-plugins/). Following the method was straightforward and allowed views to be embedded within a Component Class Library. Well, two extra items would be nice. It would be nice to not have to write that large plug-in path, and if a view was defined in the views folder it would be returned in lieu of the embedded view. Adding this support required two modifications. First the AssemblyResourceProvider was modified to check for the view's existence by adding...

posted @ Friday, January 2, 2009 10:18 PM | Feedback (27) | Filed Under [ Web Programming ]

Paging Helpers in Unifico, Filtered and Sorted Paging

Unifico has a few paging helpers to make service methods easily paged from a client. Essentially the framework makes consuming a page request object as simple as calling .ToList() on an IQueryable source. The object, the PageRequest, has two collections, Filters and Sorts with several constructors to make instantiation easy. The collections are rather straight forward, providing filtering and sorting ability on a paging source. The uniqueness comes from the ability to request multiple filters and sorts together, along with a paging request. This request is then execute on the IQueryable source, so if DLINQ...

posted @ Wednesday, December 31, 2008 8:59 PM | Feedback (9) | Filed Under [ Web Programming ]

The Unifico Framework’s Organization

One major aspect to Unifico is its organization through assemblies and namespacing. Assemblies are 'cut' by component to allow for component plug-ability. One major goal of the project is to allow for a component to be easily added to an existing site without conflicting with other equally significant components. With a few modifications (to come) Unifico allows for a whole component to be dropped in as a dll without recompilation by virtue of Structure Map. Currently, each component's assembly has to be added to structure map in a common class, the 'bootstrapper'. Within each component...

posted @ Wednesday, December 31, 2008 7:16 PM | Feedback (2) | Filed Under [ Web Programming ]

Introducing the Unifico Framework (UF)

First let me say that the code is in early state and publishing it is intended to gauge interest and recruit developers. What is the Unifico Framework (UF)? It's an architecture that has evolved while addressing various concerns in several real world projects. Currently it's nothing more than an example, and at that an example implementation of a simple example. In this example however many issues are addressed such as scalability, dependency injection, test driven development, and plug-in ability. Written in C# against MVC Beta and ASP.NET 3.5.1 the code currently recreates the account 'component' of the...

posted @ Wednesday, December 31, 2008 6:33 PM | Feedback (4) | Filed Under [ Web Programming ]

Pulling Web Content with C#

A simple way to perform a 'wget' on a url with c#. This method will return the 'html source' of a webpage. static string GetContent(string url){ WebClient client = new WebClient(); client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); Stream data = client.OpenRead(url); StreamReader reader = new StreamReader(data); string s = reader.ReadToEnd(); data.Close(); reader.Close(); return s;}

posted @ Saturday, November 15, 2008 1:05 PM | Feedback (2) | Filed Under [ Web Programming ]

Recover Database Schema with DBML (SqlMetal)

I upgraded SQL on my laptop and during the process managed to 'lose' my database…. Total n00b move. I couldn't recover the database file (it was over a gig and was quickly written over). Determined not to recreate the work since the last backup, I kept searching for a solution. Then it hit me; pull the database from the data context (dbml) I created with SQLMETAL. Simply call CreateDatabase(), and 'bam' database recovered. Whew!!!

posted @ Friday, October 17, 2008 3:52 PM | Feedback (0) | Filed Under [ Web Programming ]

LINQ to SQL Debug Visualizer

If you use LINQ, check this out, it's definitely worth the time. You can execute LINQ statements at the break point. http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx "One of the nice development features that LINQ to SQL supports is the ability to use a "debug visualizer" to hover over a LINQ expression while in the VS 2008 debugger and inspect the raw SQL that the ORM will ultimately execute at runtime when evaluating the LINQ query expression."

posted @ Monday, October 13, 2008 7:16 AM | Feedback (2) | Filed Under [ Web Programming ]

Visual Studio 2010 and .NET Framework 4.0 Overview

An overview of Visual Studio 2010 and .NET 4.0 was posted on MSDN. Now, where to apply for the beta… Visual Studio 2010 and .NET Framework 4.0 Overviewhttp://msdn.microsoft.com/en-us/vstudio/products/cc948977.aspx

posted @ Tuesday, October 7, 2008 8:11 AM | Feedback (6) | Filed Under [ Web Programming ]

Regular Expressions in MS SQL Server with CLR

 I found a great post on how to add Regular Expression functions to SQL Server through CLR functions and extended the methods slightly. The functions allow queries such as the one below to be performed. I was concerned with performance initially, but a few tests and I am blown away by the speed. The original post can be found here, http://anastasiosyal.com/archive/2008/07/05/regular-expressions-in-ms-sql-server-using-clr.aspx, and my modified code below.  select dbo.RegExReturnMatch(UserName, '(\w+\d+)') match from aspnet_Users where dbo.RegExMatch(UserName, '(\w+\d+)') > 0order by match  The query above will return usernames from the aspnet_users table that start with words and are followed by numbers (Such as ccook123, but not...

posted @ Saturday, October 4, 2008 2:05 PM | Feedback (1) | Filed Under [ Web Programming ]

Sculpture – Model Your Life

A coworker referenced me to the Sculpture project. The project looks to be a huge time saver for Enterprise Application development. It removes the work of doing things such as the CRUDS through the use of models. "Model your life" or "Get your life back". :)  http://www.codeplex.com/Sculpture  What is Sculpture? Sculpture is a .NET open source Model-Driven Development code generation framework ideal for creating and managing .NET Enterprise Applications. With Sculpture you can model your application components, and then transform this model to deployable components for your favorite technology. Sculpture comes with a host of ready-made Molds (The word "Molds" come from Molding) like (DAAB, NHibernate,...

posted @ Tuesday, September 30, 2008 11:51 AM | Feedback (10) | Filed Under [ Web Programming ]

XSD 2 DB

I have used XSD.exe countless times to create a class or dataset from an XSD or XML file. It's easy enough to obtain an XSD from a SQL Query, but what about the other direction? What about creating a database FROM an XSD? I found an interesting (old) app that does just that (and quite well). Check it out. http://xsd2db.sourceforge.net/ Note the example usage is missing the type in the flag. If you are creating sql just set the type to SQL ("-t SQL").  Not sure if this was a good idea on Authorize.NET though…

posted @ Tuesday, September 30, 2008 11:37 AM | Feedback (0) | Filed Under [ Web Programming ]

MVC Charting

And for a record short post: http://www.carlosag.net/Tools/WebChart The charting works in MVC

posted @ Thursday, September 25, 2008 8:55 PM | Feedback (5) | Filed Under [ Web Programming ]

CSSFriendly

If you have to use the 'Wizards' from ASP.NET, CSS Friendly is an absolute must for CSS styling. The tables that are emitted by the wizards are replaced with DIVs which can be styled.  Project Description The CSS Friendly Control Adapters kit (for ASP.Net 2.0) provides pre-built control adapters that you can easily use to generate CSS-friendly markup from some of the more commonly used ASP.NET controls. Goals The goal of the CSS Friendly project is to transform as many of the traditional ASP.Net web controls to provide CSS-friendly, browser-compatible markup. The project will be released as a single DLL...

posted @ Saturday, September 20, 2008 2:10 PM | Feedback (0) | Filed Under [ Web Programming ]

SQL Server 2008 Database Projects

To create SQL 2008 Database Projects install the CTP from here:  http://blogs.msdn.com/gertd/archive/2008/08/20/vstsdb-2008-gdr-ctp16-is-here.aspx  I expected this after SP1 for VS08, but apparently the Database Edition is on a different timeline?

posted @ Friday, September 19, 2008 10:19 PM | Feedback (3) | Filed Under [ Web Programming ]

Google’s Chrome

 I have a new favorite browser. Rather than recap it from a developer's point of view I will just point to an excellent comic created by Google which introduces the new features: http://www.google.com/googlebooks/chrome/index.html#size=small&page=1 Some of my favorite features: Drag a tab out of the browser window, enabled by process separation. Resizing form fields (text area)! Minimalistic user interface. Everything else they added.  One oddity, Chrome is not added to the application path during installation. To get around this I just created a shortcut and put it in a common location which I have in my application path (the environment variable). You could...

posted @ Saturday, September 6, 2008 10:35 PM | Feedback (2) | Filed Under [ Web Programming ]

Randomizing LINQ Queries

I've been using LINQ (with SqlMetal) a lot lately with MVC. I needed to grab a random single record. To my surprise there didn't appear to be a way to do this. I found an interesting post that confirms this and provides a workaround.  http://weblogs.asp.net/fmarguerie/archive/2008/01/10/randomizing-linq-to-sql-queries.aspx  The workaround is to create a function which returns a newid. As the function can be mapped by SqlMetal the function will be available for sorting server side. Interesting… just a shame the function NEWID() isn't part of DLINQ.

posted @ Friday, August 29, 2008 10:37 PM | Feedback (7) | Filed Under [ Web Programming ]

MVC Preview 4 Account Controller and StructureMap Registry

I decided to use the MVC Preview 4 Account Controller with my MVC application. The application has been following the StoreFront sample application which is using StructureMaps. The trick in getting the two to work together is the following in configure()  ForRequestedType<IFormsAuthentication>() .TheDefaultIsConcreteType<FormsAuthenticationWrapper>();  ForRequestedType<MembershipProvider>() .TheDefaultIs(Membership.Provider);  In this way the web.config values are used for the provider. Without passing Membership.Provider (say by passing a new SQL provider) the configurations will be defaulted.

posted @ Saturday, August 23, 2008 6:04 PM | Feedback (4) | Filed Under [ Web Programming ]

Visual Studio – Expand All Regions and RockScroll

Scott Hanselman recently made RockScroll available to the public here, http://www.hanselman.com/blog/IntroducingRockScroll.aspx. The add-on, if you haven't tried it, is great. One of its most useful features is highlighting in red a selected keyword both inline and in the scroll bar. It allows you to quickly, and visually find all instances of a term. The add-on has a minor bug though, it doesn't account for collapsed regions. So if regions are collapsed the scrolling will not line up with the code. David Yack posted, http://weblogs.asp.net/mrdave/archive/2004/09/17/230732.aspx, a list of some shortcuts which are particularly handy for...

posted @ Friday, August 22, 2008 9:46 PM | Feedback (2) | Filed Under [ Web Programming Technical Computing ]

C# Extension Methods for ASP.NET Query String Operations

Over the years, all the way back to the ASP 2.0 days, elegantly handling the Query String parameters between gets has been a challenge. With Web Forms for ASP.NET View State put this issue on the backburner, but with MVC on the rise and restful applications becoming hot, Query String parameters have come back to the forefront. For an example of where the Query String parameters can get cumbersome, consider a web page which lists products. At the least the page would have paging support, most sites with paging by query string parameters (something like "?page=1"). ...

posted @ Wednesday, July 23, 2008 2:37 PM | Feedback (35) | Filed Under [ Web Programming ]

Setting Up a Blog or Personal Website on a Home Computer with Vista

Windows Vista has been taking a lot of heat, and many ask why go to Vista when XP works so well. One of the most compelling reasons to move to Vista for myself is Internet Information Services (IIS) 7. With Service Pack 1 for Vista the same kernel is used as that for Windows Server 2008. So with Vista you have IIS 7 running under the same kernel as Server 2008. The only limitation to IIS 7 running under Vista is that it will only return a finite number of simultaneous requests (3 for the basic...

posted @ Wednesday, July 16, 2008 5:49 PM | Feedback (2) | Filed Under [ Web Programming ]

When to Scale Out Windows Server 2003

The windows server 2003 performance advisor, http://www.microsoft.com/downloads/details.aspx?familyid=09115420-8c9d-46b9-a9a5-9bffcd237da2&displaylang=en, was recently (7/3/2008) updated. It's a great tool for analyzing servers and determining when you might need to scale it out. It can track major counters over time and provide recommendations relating to performance. If you have thresholds for your web applications this will give you a great idea when to scale out.  Overview Microsoft ® Windows Server ™ 2003 Performance Advisor is the latest version of Server Performance Advisor, which is a simple but robust tool that helps you diagnose the root causes of performance problems in a Microsoft Windows Server 2003...

posted @ Saturday, July 12, 2008 6:19 PM | Feedback (0) | Filed Under [ Web Programming ]

SQL Server 2005 Scaling

I came across a great article on MSDN discussing various scaling options for SQL Server 2005, http://msdn.microsoft.com/en-us/library/aa479364.aspx. The article does a great job at relating data types and how they relate to scaling choices. The take away is that scaling choice is highly dependent on how the data is used by the application. For more information regarding the Peer-to-Peer scheme, this article is also a great reference for some design considerations http://technet.microsoft.com/en-us/magazine/cc160974(TechNet.10).aspx.  Table 1. Factors influencing the selection of scaleout solutions   Update FrequencyAbility to Change ApplicationData PartitionabilityData CouplingScalable Shared DatabasesRead Only.Little or no change required.No requirement.No requirement.Peer-to-Peer ReplicationRead mostly, no conflicts.Little...

posted @ Saturday, July 12, 2008 10:42 AM | Feedback (7) | Filed Under [ Web Programming Technical Computing ]

LINQ, SQLMetal, MVC, CS1579

LINQ, SQLMetal, and MVC seem to complement each other extremely well. Together, the three lead to some very elegant and fast development. SQLMetal generates the database context for LINQ, which so happens to work as a great data layer/Model. The data context, complements of SQLMetal, can be place into the Model tier of MVC for convenient access by the Controllers. Using LINQ the data can be easily sent to the Views through the View Data. Very elegant. Getting going using MVC and SQLMetal was fairly straight forward. The key was running the following from Visual Studio Command...

posted @ Saturday, June 7, 2008 11:06 PM | Feedback (5) | Filed Under [ Web Programming ]

Property Owner is not available for Database

  TITLE: Microsoft SQL Server Management Studio ------------------------------ Cannot show requested dialog. ------------------------------ ADDITIONAL INFORMATION: Cannot show requested dialog. (SqlMgmt) ------------------------------ Property Owner is not available for Database '[dbname]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights. (Microsoft.SqlServer.Smo) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.PropertyCannotBeRetrievedExceptionText&EvtID=Owner&LinkId=20476 ------------------------------ BUTTONS: OK ------------------------------     To fix simply change the owner, for example: use dbname exec sp_changedbowner 'sa'        

posted @ Friday, June 6, 2008 1:42 PM | Feedback (1) | Filed Under [ Web Programming ]

Seam Carving for Resizing using SEAMonster

I first saw seam carving, http://www.seamcarving.com/, about a year ago when it was so hot that just downloading the white paper was a challenge (see post). I immediately dug for code with no luck. A few months later I noted some python code, thought of translating that but the time just wasn't available. I did another check for seam carving code lately and found SEAMonster. The code runs well as is, though the algorithm was a bit slower than I had hoped. Resizing a 400x300 jpg image on my core2 laptop took a few seconds....

posted @ Thursday, June 5, 2008 9:06 PM | Feedback (1) | Filed Under [ Web Programming ]

Easily Injecting HTML into RadEditor

This is a demonstration on how easily client side content can be injected at runtime. One does not have to architect posts or recreate content and repost. The easiest way to do this that I know of is with a firefox plugin called Chickenfoot, http://groups.csail.mit.edu/uid/chickenfoot/install.html. With it you can script navigation, user interaction, changes to DOM, etc. On to the demo at hand. For this I have taken an instance of RadEditor, a WYSIWYG html editor and disabled almost everything. So if the client side restrictions were 'strong' the user wouldn't be able to do anything but insert plain text...

posted @ Saturday, May 17, 2008 8:13 PM | Feedback (7) | Filed Under [ Web Programming ]

Authoring Easy XSDs from XML

Visual Studio ships with a powerful tool, xsd.exe, which can easy and quickly generate XSD's and typed datasets from references. I found this to be particularly useful when I need to utilize a typed data set. I can write a sample of the xml I would like to generate, and then create the XSD and class off of that. For example, create cats.xml like so: <cats>     <cat>Cat 1</cat>     <cat>Cat 2</cat> </cats>   Start visual studio command prompt and navigate to the directory. Then issue: xsd cats.xml xsd cats.xsd /c   Two files have now been created, cats.xsd and cats.cs. the XSD can...

posted @ Saturday, May 17, 2008 5:02 PM | Feedback (1) | Filed Under [ Web Programming ]

Simple Email Test Form

A simple and contained email test form   <script runat="server" language="c#"> private void Send(object sender, EventArgs e) { System.Web.Mail.MailMessage mail = new System.Web.Mail.MailMessage(); mail.Subject="test"; mail.From="youraddress@domain.com"; mail.Body="test"; mail.To=txtTo.Text; System.Web.Mail.SmtpMail.SmtpServer = txtServer.Text; System.Web.Mail.SmtpMail.Send(mail); } </script> <html> <head> </head> <body> <form id="Form1" runat="server"> Server : <asp:TextBox runat="server" ID="txtServer" /> <br /> To : <asp:TextBox runat="server" ID="txtTo" /> <br /> <asp:Button runat="server" Text="Send" ID="send" OnClick="Send" /></form> </body> </html>

posted @ Saturday, May 10, 2008 4:56 PM | Feedback (0) | Filed Under [ Web Programming ]

Table Row Reordering

This small bit javascript reorders a table's rows in groups.   function moveRow(table, pos1, pos2) {     var multiplicity = 5;         var obj = table.children(0);     if (obj.children.length > ((pos1+1)*multiplicity-1) && obj.children.length > ((pos2+1)*multiplicity-1)         && pos1 >= 0 && pos2 >=0 && pos1 != pos2)     {         for (var i = 0; i < multiplicity; i ++)         {             var node1 = obj.children(pos1*multiplicity + i);             var node2 = obj.children(pos2*multiplicity + i);             node1.swapNode(node2);         }     } }

posted @ Saturday, May 10, 2008 4:52 PM | Feedback (1) | Filed Under [ Web Programming ]

Web Based Shell

A few years back I made a web app which would allow a user to interact with a shell over the web. The trick was to leave a hanging web request to allow the shell output to be redirect to the browser in an open stream. When the browser receives a whole script block it executes it then, so you can push updates to the browser before the response is ended. The input from the user is sent to the server by posts with javascript where the server then sends the input to the shell in the other response while...

posted @ Saturday, May 10, 2008 4:48 PM | Feedback (0) | Filed Under [ Web Programming ]

Web Based CVS Tool

We have migrated from CVS to SVN, but this was a nice tool for managing working copies of CVS repositories over the web. The actual CVS work is done through the CVS executable through process handling, and has two requirements. 1) Execute ability 2) Write permissions. It is also set to use the sserver protocal by default (ideal for transporting versions between varying hosts).  

posted @ Saturday, May 10, 2008 4:39 PM | Feedback (2) | Filed Under [ Web Programming ]

3-Tiered Model

This is an older tiered model I was wodrking on. A bit dated, but included as a personal reference.

posted @ Saturday, May 10, 2008 4:36 PM | Feedback (8) | Filed Under [ Web Programming ]

XML Serialization and Tiered Architecture

     In .NET XML can be used to serialize objects of almost any type. Even better, objects can be serialized (and de-serialized) to XML while using an XSD schema definition.  This is great for interoperability with outside applications, but, add XSD.exe to the picture and you can do something pretty cool with Typed Data Sets.        Visual Studio will create a strongly typed Data Set off of the XSD, this is no secret.  What if however, you don't want to carry the Data Set inheritance across the layers? Is there a way to have a designer or a tool create...

posted @ Saturday, May 10, 2008 4:28 PM | Feedback (3) | Filed Under [ Web Programming ]

SecurityException: Partially trusted callers

Most hosts have sites running at a Medium Trust level as Microsoft recommends. When a referenced dll requires full trust callers, you will be greated by:  Security Exception Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.  The particular assembly of interest was from a third party. My initial idea was to simply dissassemble it with reflector and recompile it with the changes...

posted @ Saturday, May 10, 2008 1:54 PM | Feedback (1) | Filed Under [ Web Programming ]

Powered by:
Powered By Subtext Powered By ASP.NET