archive-ro.com » RO » A » ALEXPETA.RO

Total: 36

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Exporting a changeset in Team Foundation Server TFS using Team Foundation Power Tools TFPT
    the info centralized First of all note that this feature doesn t come out of the box with TFS 2010 we need an extension named Team Foundation Server Power Tools December 2011 release at the time I m writing this post Download and install the extension http visualstudiogallery msdn microsoft com c255a1e4 04ba 4f68 8f4e cd473d6b971f Open a CMD window and run tfpt exe and you will see all available options but we are just interested in GETCS It has the following syntax tfpt getcs changeset changesetnum force overwrite where changesetnum is the changeset it that we wish to export the other two directives in square brackets are optional Example If I wish to export changeset number 77 I would issue tfpt getcs changeset 77 Now if you would try to run this command directly you would probably get an error with the following message Unable to determine the workspace After searching a bit it seems that Team Foundation Power Tools need to be run via CMD in a directory that is Mapped as being under source control with TFS NOTE if you would run the command against the existing mapped folder lets say you have a MAIN branch folder somewhere on your hdd you will not see just the changes from the requested changeset because you will see all the existing solution Create a new folder open Team Explorer add a branch to your current solution and map it against your newly created folder When you will be prompted to download the solution click NO this way you will obtain a clean mapped folder but without any code in it Run the command in your clean new mapped folders and Voila this will bring you your changeset results UPDATE The info above works fine but what happens when you

    Original URL path: http://www.alexpeta.ro/blog/post/exporting-a-changeset-in-team-foundation-server-tfs-using-team-foundation-power-tools-tfpt (2016-05-01)
    Open archived version from archive


  • Unit Testing your ASP MVC HtmlHelper Methods
    object to query my entities for result sets and in order to unit test it I am providing the data access via an interface parameter IBlogRepository This interface is implemented both on my real data BlogRepository class and in my FakeRepository in memory class created specially for unit testing and I can switch between the two of them Setting up the Context In order to instantiate a new HtmlHelper class it s constructor expects 2 parameters a ViewContext and IViewDataContainer I am also creating a fake HttpContext for other future test scenarios public class FakeContext public class FakeHttpContext HttpContextBase public Dictionary object object dictionary new Dictionary object object public virtual System Collections IDictionary Item get return dictionary public class FakeIView IViewDataContainer private ViewDataDictionary viewdata new ViewDataDictionary public ViewDataDictionary ViewData get return viewdata set viewdata value Now let s write some tests namespace AlexPeta 2 Tests TestClass public class HelperMethodsTests private HttpContextBase httpContext null private IViewDataContainer IView null private ViewContext viewContext null private IBlogRepository repository TestInitialize public void SetupContext necessary for building the HTML Helpers httpContext new Models FakeContext FakeHttpContext IView new Models FakeContext FakeIView viewContext new ViewContext repository new FakeRepository TestCleanup public void CleanContext housekeeping httpContext null IView null viewContext null repository null TestMethod public void BlogStatisticsHelperIsNotNull Arrange HtmlHelper helper new HtmlHelper viewContext IView Act string helperHtmlResult AlexPeta 2 Helpers BlogHelpers BlogStatistics helper repository ToString Assert Assert IsNotNull helperHtmlResult TestMethod public void BlogStatisticsHelperReturnsExpectedHtmlWhenRepositoryIsEmpty Arrange HtmlHelper helper new HtmlHelper viewContext IView string expectedResult div class views div class mini counts 0 div div posts div div div class views div class mini counts 0 div div views div div div class views div class mini counts 0 div div comm div div Act string helperHtmlResult AlexPeta 2 Helpers BlogHelpers BlogStatistics helper repository ToString Assert Assert AreEqual expectedResult helperHtmlResult TestMethod public void BlogStatisticsHelperReturnsExpectedHtml Arrange repository new FakeRepository false Article newArticle new Article Title New Article Text Content Goes Here Views 1345 Comments null Published true Act repository AddArticle newArticle HtmlHelper helper new HtmlHelper viewContext IView string expectedResult div class views div class mini counts 1 div div posts div div div class views div class mini counts 1 3K div div views div div div class views div class mini counts 0 div div comm div div string helperHtmlResult AlexPeta 2 Helpers BlogHelpers BlogStatistics helper repository ToString Assert Assert AreEqual expectedResult helperHtmlResult TestMethod public void BlogStatisticsHelperReturnsOnlyPublishedArticles Arrange repository new FakeRepository false Article newArticle new Article Title New Article Text Content Goes Here Views 1345 Comments null Published false Article secondArticle new Article Title Second Article Text Content Goes Here Views 3342 Comments null Published false Act repository AddArticle newArticle HtmlHelper helper new HtmlHelper viewContext IView string expectedResult div class views div class mini counts 0 div div posts div div div class views div class mini counts 1 3K div div views div div div class views div class mini counts 0 div div comm div div string helperHtmlResult AlexPeta 2 Helpers BlogHelpers BlogStatistics helper repository ToString Assert Assert AreEqual expectedResult helperHtmlResult

    Original URL path: http://www.alexpeta.ro/blog/post/unit-testing-your-asp-mvc-htmlhelper-methods (2016-05-01)
    Open archived version from archive

  • Adding Watermark to an image using C# in ASP MVC
    method Lets begin I have created a folder named Images in my root ASP MVC project directory and added the image there I made sure read write permissions are available To process the image here is how my Home controller s Index method looks like using System using System Collections Generic using System Linq using System Web using System Web Helpers using System Web Mvc namespace WatermarkImages Controllers public class

    Original URL path: http://www.alexpeta.ro/blog/post/adding-watermark-to-an-image-using-c%23-in-asp-mvc (2016-05-01)
    Open archived version from archive

  • Presenting a ASP MVC user notification Widget at RONUA
    It all started with a post a wrote a while back about a User Notification helper which Andrei Ignat considered to be a viable topic to present and I personally thought it would be a good idea to start presenting although I had my doubts about the content its self in the sense that it s lacking substance and it should be more complex But I was very happy about

    Original URL path: http://www.alexpeta.ro/blog/post/presenting-a-asp-mvc-user-notification-widget-at-ronua (2016-05-01)
    Open archived version from archive

  • Archive
    Mattison Minden Pictures Leave your comfort zone Personal Posted by Alex Peta on July 09 2012 Recursive SQL in TSQL and Oracle PL SQL Oracle T SQL Posted by Alex Peta on June 24 2012 Building A User Notification Helper Javascript CSS HTML XHTML ASP MVC C Posted by Alex Peta on June 06 2012 Simple Thousands HtmlHelper for Big Numbers ASP MVC C Posted by Alex Peta on May

    Original URL path: http://www.alexpeta.ro/blog/archive/4 (2016-05-01)
    Open archived version from archive

  • Leave your comfort zone
    years as a technical consultant meaning writing PL SQL code in Oracle Application Express framework to build internal used applications The corporation mirage got me I felt back then that I had reached a peak and I have made it big time no need to be hungry anymore no need to explore experiment more and as time passed by I realized that the decision to settle and quiet down was no the best one for me I guess you already know the famous Steve Jobs quote from his Stanford speech about stay hungry stay foolish well I completely resonate with it now If after 1 year or two your job becomes routine as in the sense of nothing really new interesting nobody to push things and you to pass your limits then its just burned out wall clock time that you simply will not replace And this mirage is achieved so well with two corporate benefits working from home when you please to and non strict schedule Sure all these plus the guys at work who sure enough in 4 years some of them really become your friends add up to the don t settle for more this is the

    Original URL path: http://www.alexpeta.ro/blog/post/leave-your-comfort-zone (2016-05-01)
    Open archived version from archive

  • Recursive SQL in TSQL and Oracle
    stored procedure In a newbie at TSQL but I have experience with Oracle SQL so the thinking was in place I had to find out what syntax would help me achieve this GO SET ANSI NULLS ON GO SET QUOTED IDENTIFIER ON GO ALTER PROCEDURE dbo SubscribersByDay AS BEGIN SET NOCOUNT ON DECLARE sd DATETIME ed DATETIME first day of the first month of the first subscriber SELECT sd DATEADD DAY DAY mn minimum 1 mn minimum FROM SELECT MIN s CreatedDate minimum FROM dbo Subscriber s mn end date today SELECT ed GETDATE this is the recursive part and then left outer joining WITH cte AS SELECT cast floor cast sd as float as datetime as dt UNION ALL SELECT dt 1 FROM CTE WHERE dt 1 ed SELECT cte dt as CalendarDate ISNULL grp subscriber no 0 as SubscriberCount FROM cte LEFT OUTER JOIN SELECT count s email subscriber no cast floor cast s CreatedDate as float as datetime created FROM dbo Subscriber s GROUP BY cast floor cast s CreatedDate as float as datetime grp ON cte dt grp created ORDER BY dt DESC END I wanted to compare thee above code to what I would write in Oracle for the same problem just as a character typing syntax code fluidity example not anything performance wise here and using the built in connect by clause The Oracle way using connect by clause and transformations SELECT t1 d subscribed day NVL t2 subscriber no 0 nr FROM SELECT trunc sysdate level 1 d FROM dual CONNECT BY level SELECT trunc sysdate to date 01 to char min createddate MON YYYY DD MON YYYY 1 FROM Subscriber t1 LEFT OUTER JOIN SELECT count s email subscriber no trunc s CreatedDate d FROM Subscriber s GROUP BY trunc s CreatedDate

    Original URL path: http://www.alexpeta.ro/blog/post/recursive-sql-in-tsql-and-oracle (2016-05-01)
    Open archived version from archive

  • Building A User Notification Helper
    right auto Error alert error background color F2DEDE border color EED3D7 color B94A48 a close background none repeat scroll 0 0 transparent border 0 none cursor pointer padding 0 text decoration none close color 000000 float right font size 20px font weight bold line height 18px opacity 0 2 text shadow 0 1px 0 FFFFFF Success alert success background color DFF0D8 border color D6E9C6 color 468847 Info alert info background color D9EDF7 border color BCE8F1 color 3A87AD Just to be fair here I took the liberty of looking at the CSS code from Twitter Bootstrap notifications 2 The UserNotification class NotificationType enum public enum NotificationType Error 1 Success 2 Info 3 public class UserNotification public string Message get private set public string Scream get private set public string Type get private set public ushort AutoCloseTime get private set public ushort Width get private set public UserNotification string msg NotificationType msgType ushort autoClose 2200 ushort width 300 Message msg AutoClose autoClose switch msgType case NotificationType Error Scream Oh snap Type NotificationType Error ToString ToLower break case NotificationType Info Scream Heads up Type NotificationType Info ToString ToLower break case NotificationType Success Scream Well done Type NotificationType Success ToString ToLower break Width width Here is our UserNotification class which we will use to pass to our HtmlHelper method Its straight forward 3 Finally our HtmlHelper public static class DisplayHelpers public static MvcHtmlString UserNotification this HtmlHelper helper UserNotification notification StringBuilder sb new StringBuilder if notification null sb Append script function closeMsg try document getElementById msg container style display none catch err script sb Append string Format div class alert alert 0 id msg container style width 1 px a class close href javascript void 0 onclick closeMsg a strong 2 strong 3 div notification Type notification Width notification Scream notification Message sb Append script

    Original URL path: http://www.alexpeta.ro/blog/post/building-a-user-notification-helper (2016-05-01)
    Open archived version from archive



  •