Search Results

Search found 1610 results on 65 pages for 'pure ftpd'.

Page 12/65 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • How can I pass in a params of Expression<Func<T, object>> to a method?

    - by Pure.Krome
    Hi folks, I have the following two methods :- public static IQueryable<T> IncludeAssociations<T>(this IQueryable<T> source, params string[] associations) { ... } public static IQueryable<T> IncludeAssociations<T>(this IQueryable<T> source, params Expression<Func<T, object>>[] expressions) { ... } Now, when I try and pass in a params of Expression<Func<T, object>>[], it always calls the first method (the string[]' and of course, that value isNULL`) Eg. Expression<Func<Order, object>> x1 = x => x.User; Expression<Func<Order, object>> x2 = x => x.User.Passport; var foo = _orderRepo .Find() .IncludeAssociations(new {x1, x2} ) .ToList(); Can anyone see what I've done wrong? Why is it thinking my params are a string? Can I force the type, of the 2x variables?

    Read the article

  • Stuck trying to get Log4Net to work with Dependency Injection

    - by Pure.Krome
    I've got a simple winform test app i'm using to try some Log4Net Dependency Injection stuff. I've made a simple interface in my Services project :- public interface ILogging { void Debug(string message); // snip the other's. } Then my concrete type will be using Log4Net... public class Log4NetLogging : ILogging { private static ILog Log4Net { get { return LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); } } public void Debug(string message) { if (Log4Net.IsDebugEnabled) { Log4Net.Debug(message); } } } So far so good. Nothing too hard there. Now, in a different project (and therefore namesapce), I try and use this ... public partial class Form1 : Form { public Form1() { FileInfo fileInfo = new FileInfo("Log4Net.config"); log4net.Config.XmlConfigurator.Configure(fileInfo); } private void Foo() { // This would be handled with DI, but i've not set it up // (on the constructor, in this code example). ILogging logging = new Log4NetLogging(); logging.Debug("Test message"); } } Ok .. also pretty simple. I've hardcoded the ILogging instance but that is usually dependency injected via the constructor. Anyways, when i check this line of code... return LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); the DeclaringType type value is of the Service namespace, not the type of the Form (ie. X.Y.Z.Form1) which actually called the method. Without passing the type INTO method as another argument, is there anyway using reflection to figure out the real method that called it?

    Read the article

  • Is it possible to expose an API for my own WebSite ... but use oAuth for the api authentication?

    - by Pure.Krome
    Hi Folks, currently I expose an api for my website. Works great .. and i use Basic Authentication to authenticate users to get access to the data. eg. http://www.MyWebSite.com <-- main site. http://api.MyWebSite.com <-- my api website. sample api RESTful url http://user1:[email protected]/games?type=battlefield2 (yes yes i know browsers stop people from putting in user1:pass1 (Basic Auth) into the url directly .. cause of security . but it's to highlight that we're using Basic Auth)). So .. how can i do this with oAuth?

    Read the article

  • Is it possible to refactor this C# if(..) statement?

    - by Pure.Krome
    Hi folks, simple question :- i have the following simple if (..) statements :- if (foo == Animal.Cat || foo == Animal.Dog) { .. } if (baa == 1|| baa == 69) { .. } is it possible to refactor these into something like ... DISCLAIMER: I know this doesn't compile .. but this is sorta what i'm trying to get... if (foo == (Animal.Cat || Animal.Dog)) { .. } if (baa == (1 || 69)) { .. } Cheers :) EDIT I wonder if a lambda expression extension could do this? :P

    Read the article

  • How can I serialize this .NET Collection item?

    - by Pure.Krome
    Hi folks, I'm trying to xml serialize a POCO view data class into xml. It serializes, but incorrectly generates some xml. eg. (current result .. not the one I'm after) <ReviewListViewData> <reviews> <review>....</review> ... </reviews> </ReviewListViewData> I'm trying to get (notice how I've removed the bad root node?) ... <reviews> <review>....</review> ... </reviews> Class is defined as... public class ReviewListViewData { [XmlArray("reviews")] [XmlArrayItem("review")] public ReviewViewData[] Reviews { get; set; } } and here's a sample way it's called in an ASP.NET MVC ActionMethod :- var reviewListViewData = GetReviewListViewData(...); return XmlResult(reviewListViewData); // (XmlResult referenced from MVCContrib). anyone have any ideas, please?

    Read the article

  • Why are these two sql statements deadlocking? (Deadlock graph + details included).

    - by Pure.Krome
    Hi folks, I've got the following deadlock graph that describes two sql statements that are deadlocking each other. I'm just not sure how to analyse this and then fix up my sql code to prevent this from happening. Main deadlock graph Click here for a bigger image. Left side, details Click here for a bigger image. Right side, details Click here for a bigger image. What is the code doing? I'm reading in a number of files (eg. lets say 3, for this example). Each file contains different data BUT the same type of data. I then insert data into LogEntries table and then (if required) I insert or delete something from the ConnectedClients table. Here's my sql code. using (TransactionScope transactionScope = new TransactionScope()) { _logEntryRepository.InsertOrUpdate(logEntry); // Now, if this log entry was a NewConnection or an LostConnection, then we need to make sure we update the ConnectedClients. if (logEntry.EventType == EventType.NewConnection) { _connectedClientRepository.Insert(new ConnectedClient { LogEntryId = logEntry.LogEntryId }); } // A (PB) BanKick does _NOT_ register a lost connection .. so we need to make sure we handle those scenario's as a LostConnection. if (logEntry.EventType == EventType.LostConnection || logEntry.EventType == EventType.BanKick) { _connectedClientRepository.Delete(logEntry.ClientName, logEntry.ClientIpAndPort); } _unitOfWork.Commit(); transactionScope.Complete(); } Now each file has it's own UnitOfWork instance (which means it has it's own database connection, transaction and repository context). So i'm assuming this means there's 3 different connections to the db all happening at the same time. Finally, this is using Entity Framework as the repository, but please don't let that stop you from having a think about this problem. Using a profiling tool, the Isolation Level is Serializable. I've also tried ReadCommited and ReadUncommited, but they both error :- ReadCommited: same as above. Deadlock. ReadUncommited: different error. EF exception that says it expected some result back, but got nothing. I'm guessing this is the LogEntryId Identity (scope_identity) value that is expected but not retrieve because of the dirty read. Please help! PS. It's Sql Server 2008, btw.

    Read the article

  • How to use Visual Studio and IIS7 together?

    - by Pure.Krome
    Hi folks, i'm trying to use Visual Studio 2010 (but this also happens with VS2008) as my web server for all locahost development. When i go into the properties for my web application (sigh, it's a legacy web FORMS app) and check the Web tab .. then check the Use Local IIS Web Server option ... it only allows me to create a virtual directory against a website. Why?! this is not what I want :( I wanted to have my own IIS7 website (no virtual directory) and debug against that. Can anyone help me? As a side note, i tried to use the third option Use Custom Web Server .. which ends up pointing to my localhost iis7 server. Now, this works ... but when i wish to Start Debugging .. it errors :( (it's not sure how to attach to that process or something?) So - can anyone out there please help?

    Read the article

  • In ASP.NET, is it possible to output cache by host name? ie varybyhost or varbyhostheader?

    - by Pure.Krome
    Hi folks, I've got a website that has a number of host headers. Depending on the host header, the results are different - both visually (theme'd) and data. So lets imagine i have a website called 'Foo' - that returns search results (original, eh?). Now, the same code runs both sites. It is physically the same server/website (using Host Headers) :- www.foo.com www.foo.com.au Now, if i goto '.com', the site is theme'd in blue. if i goto the '.com.au' site, it's theme'd in red. And the data is different for the same search result, based on the host name (ie. us results for .com, au results for .com.au) SO .. if i wish to use OutputCaching .. can this be handled / differ by the host name? I don't want to have the first person goto the .com site .. grab the results ... and the a second person goto my .com.au .. same search data .. and get the theme and results for the .com site. Possible?

    Read the article

  • Which version of .NET 4.0 is needed for web site hosting? Client or Full?

    - by Pure.Krome
    Hi folks, Simple question - for dedicated website hosting, do i need to download and install the full ASP.NET 4.0 package, or just the client. I understand the client is required for end users who need the .NET framework for their windows form applications. But i'm not sure for a web hosting sceanrio. Also, don't worry about talking about x86 or x64 - i understand the differences with the packages, etc.

    Read the article

  • Why does Cache.Add return an object that represents the cached item?

    - by Pure.Krome
    From MSDN about the differences between Adding or Inserting an item the ASP.NET Cache: Note: The Add and Insert methods have the same signature, but there are subtle differences between them. First, calling the Add method returns an object that represents the cached item, while calling Insert does not. Second, their behavior is different if you call these methods and add an item to the Cache that is already stored there. The Insert method replaces the item, while the Add method fails. [emphasis mine] The second part is easy. No question about that. But with the first part, why would it want to return an object that represents the cached item? If I'm trying to Add an item to the cache, I already have/know what that item is? I don't get it. What is the reasoning behind this?

    Read the article

  • Need help mocking a ASP.NET Controller in RhinoMocks

    - by Pure.Krome
    Hi folks, I'm trying to mock up a fake ASP.NET Controller. I don't have any concrete controllers, so I was hoping to just mock a Controller and it will work. This is what I have, currently. _fakeRequestBase = MockRepository.GenerateMock<HttpRequestBase>(); _fakeRequestBase.Stub(x => x.HttpMethod).Return("GET"); _fakeContextBase = MockRepository.GenerateMock<HttpContextBase>(); _fakeContextBase.Stub(x => x.Request).Return(_fakeRequestBase); var controllerContext = new ControllerContext(_fakeContextBase, new RouteData(), MockRepository.GenerateMock<ControllerBase>()); _fakeController = MockRepository.GenerateMock<Controller>(); _fakeController.Stub(x => x.ControllerContext).Return(controllerContext); Everything works except the last line, which throws a runtime error and is asking me for some Rhino.Mocks source code or something (which I don't have). See how I'm trying to mock up an abstract Controller - is that allowed? Can someone help me?

    Read the article

  • Question about ASP.NET MVC and static data (ie. images, scripts, etc)

    - by Pure.Krome
    Hi folks, If i have a request for a resource in my ASP.NET MVC1 (or 2) web app for a static resource, say ... an image or a javascript file or a css file ... does the .NET framework try and see if the request matches the route list ... and eventually can't find a controller for it? eg. Resource: /Content/Images/Foo.png Does this request go through my route list .. fails to match any controllers / actions to this request and then .. i donno ... attempt that path directly?

    Read the article

  • Can I split a single SQL 2008 DB Table into multiple filegroups, based on a discriminator column?

    - by Pure.Krome
    Hi folks, I've got a SQL Server 2008 R2 database which has a number of tables. Two of these tables contains a lot of large data .. mainly because one of them is VARBINARY(MAX) and the sister table is GEOGRAPHY. (Why two tables? Read Below if you're interested***) The data in these tables are geospatial shapes, such as zipcode boundaries. Now, the first 70K odd rows are for DataType = 1 the rest 5mil rows are for DataType = 2 Now, is it possible to split the table data into two files? so all rows that are for DataType != 2 goes into File_A and DataType = 2 goes into File_B? This way, when I backup the DB, I can skip adding File_B so my download is waaaaay smaller? Is this possible? I guessing you might be thinking - why not keep them as TWO extra tables? Mainly because in the code, the data is conceptually the same .. it's just happens that I want to split the storage of this model data. It really messes up my model if I now how two aggregates in my model, instead of one. ***Entity Framework doesn't like Tables with GEOGRAPHY, so i have to create a new table which transforms the GEOGRAPHY to VARBINARY, and then drop that into EF.

    Read the article

  • How should I do this (business logic) in Sql Server? A constraint?

    - by Pure.Krome
    Hi folks, I wish to add some type of business logic constraint to a table, but not sure how / where. I have a table with the following fields. ID INTEGER IDENTITY HubId INTEGER CategoryId INTEGER IsFeatured BIT Foo NVARCHAR(200) etc. So what i wish is that you can only have one featured thingy, per articleId + hubId. eg. 1, 1, 1, 1, 'blah' -- Ok. 2, 1, 2, 1, 'more blah' -- Also Ok 3, 1, 1, 1, 'aaa' -- constraint error 4, 1, 1, 0, 'asdasdad' -- Ok. 5, 1, 1, 0, 'bbbb' -- Ok. etc. so the third row to be inserterd would fail because that hub AND category already have a featured thingy. Is this possible?

    Read the article

  • Image.Save(..) throws a GDI+ exception because the memory stream is closed.

    - by Pure.Krome
    Hi folks, i've got some binary data which i want to save as an image. When i try to save the image, it throws an exception if the memory stream used to create the image, was closed before the save. The reason i do this is because i'm dynamically creating images and as such .. i need to use a memory stream. this is the code: [TestMethod] public void TestMethod1() { // Grab the binary data. byte[] data = File.ReadAllBytes("Chick.jpg"); // Read in the data but do not close, before using the stream. Stream originalBinaryDataStream = new MemoryStream(data); Bitmap image = new Bitmap(originalBinaryDataStream); image.Save(@"c:\test.jpg"); originalBinaryDataStream.Dispose(); // Now lets use a nice dispose, etc... Bitmap2 image2; using (Stream originalBinaryDataStream2 = new MemoryStream(data)) { image2 = new Bitmap(originalBinaryDataStream2); } image2.Save(@"C:\temp\pewpew.jpg"); // This throws the GDI+ exception. } Does anyone have any suggestions to how i could save an image with the stream closed? I cannot rely on the developers to remember to close the stream after the image is saved. In fact, the developer would have NO IDEA that the image was generated using a memory stream (because it happens in some other code, elsewhere). I'm really confused :(

    Read the article

  • How should I be using IoC in this winform piece of code?

    - by Pure.Krome
    Hi folks, I've got a winform app in visual studio 2010. My app does the following Get a list of files which I need to read the data then insert into a database. For each file, read data and insert into DB. So .. this is the code i have. var list = _repository.GetFileList(); if (list != null) { int i = 0; foreach(var file in list) { i++; var service = new MyService(i, _repository); service.ParseAndSave(); } } So i was hoping to have a new repository for each 'service' i create. Firstly, i'm not sure if I should be using IoC in this case. I believe I should be because then i don't need to tightly couple this winform to a repository. Secondly, I've tried using a Singleton repo, which I don't want and can confirm that it kills that code (crashes with an exception). Some other notes (which shouldn't impact this question) - Using Entity Framework for ASP.NET 4. - Using StructureMap for IoC Can someone help, please?

    Read the article

  • What tools do people use to make programming tutorial videos?

    - by Pure.Krome
    Hi folks, I'm wanting to make some yee-run-o-the-mill tutorial video's about some programming concepts and stuff i've been doing. Nothing special ... lots of peeps been doing it. What tools are people using to record and edit these videos? What resolutions / fonts / sizes do people generally use/set? The only tool I've had experience with is Camtasia - and i didn't mind it. But i've seen vid's (or live demo's) where people zoom in to code sections.. how do they do that? For final editing, do most people just do some simple power point presentation with some video snippets mashed in. cheers!

    Read the article

  • What license (eg. BSD, GPL, etc) can I use for an open source app that can be used commerically, for free?

    - by Pure.Krome
    Hi folks, I've got an application on Codeplex. It's based on some other free open source code which comes with a BSD license. As such, people keep asking if they can use my open source code/library in their commercial apps. I want them to be able to, provided they give credit to the source app (the project which i based my code, from .. and that has the BSD license) and also my code. They can take my code and do whatever (fork it, etc).. Just make sure they give credit, of course. So - what license could I use? Currently, I've set it to be GPL .. so is that ok? NOTE: Yes yes, I know that any answers are not from a lawyer and it's just all personal thoughts and I need to consult a special lawyer if I want some professional advice, etc. etc. I'm happy to take that risk, here.

    Read the article

  • I can't find the homepage for my ASP.NET MVC site :(

    - by Pure.Krome
    Hi folks, really simple question here. when I remove the default route, I returns an empty page to the browser :- routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); Now before everyone starts shouting "that's because that's the default route to access all action methods, etc.." .. i know that. My question is - what code / routes does the default framework try and call .. which makes that Default Route get used/kick in? Why? I don't wish to make that my default route regex (don't ask why - this is some R&D) but I still need the main home page .. ie. Home/Index . If i try and just add that route, it doesn't get called and an empty page is returned. So -- what does the framework try and call when a user doesn't provide any urls? It's like there's some secret default document stuff set up? Cheers :)

    Read the article

  • Creating Entity as an aggregation

    - by Jamie Dixon
    I recently asked about how to separate entities from their behaviour and the main answer linked to this article: http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/ The ultimate concept written about here is that of: OBJECT AS A PURE AGGREGATION. I'm wondering how I might go about creating game entities as pure aggregation using C#. I've not quite grasped the concept of how this might work yet. (Perhaps the entity is an array of objects implementing a certain interface or base type?) My current thinking still involves having a concrete class for each entity type that then implements the relevant interfaces (IMoveable, ICollectable, ISpeakable etc). How can I go about creating an entity purely as an aggregation without having any concrete type for that entity?

    Read the article

  • How to change Ubuntu Studio from XFCE to Gnome?

    - by Starx
    I have 12.04 Ubuntu Studio Installed at the moment. On removing a application called Terminal Emulator, I accidentally removed xfce too. As I am not very fond of xfce, I am OK with it as I can change the session to gnome 3 upon login. But session runs with occasional glitches. My question is how to remove xfce completely and turn it into pure gnome system. I am aware of the way to do apt-get install ubuntu-desktop But, this is going to change the ubuntu studio, I dont want that. I just want to change my ubuntu studio to pure gnome without uninstalling ubuntu-desktop. i.e. Something like ubuntustudio-12.04-gnome build. I've looked at this Q&A: How to remove xubuntu? The accepted answer removes some vital software from Ubuntu Studio such as Gimp, including ubuntustudio-desktop at the end.

    Read the article

  • Is it possible to update the livetile in XNA WP7 game?

    - by Jaakko Lipsanen
    ( I'm not sure if this question belongs here, but since it is related to game development and I have no idea where else I should post this, I will post this here ) As the title says, what I am basically asking is if it is possible to update the livetile of an pure XNA game ( not SL + XNA hybrid )? I've been thinking something like that whenever user launches the game, I would create an texture dynamically and then update the livetile to show that texture. Even better would be if I could schedule this code to run for example once a day, without requiring user to even launch the game. Is this possible in WP7 or in WP8 ( is the WP8 SDK even publicly released yet? ) in pure XNA game? What about in XNA + SL hybrid?

    Read the article

  • Math major as a viable degree

    - by Zak O'Keefe
    While I realize there are many topics about CS vs software engineering vs game school programs, I haven't found anything relating to whether pure math degrees (with CS minor and electives) would also be a viable program. By this I mean: Would having a math major, CS minor put one at competitive disadvantage as compared to a pure CS program? This relates specifically to game engine programming, more on the graphics side. Background (for those who care): Currently a math major, CS minor at school and looking to land a career doing graphics engine programming. Admittedly, I love math and if at all possible would like to stay my current program as long as it doesn't put me at a competitive disadvantage trying to land a job post-graduation. That being said, I'm strong in the traditional C/C++ languages, strong concurrent programming skills, and currently produce self-made games for iOS. As an employer, how badly is the math major hurting me? Just want to get some advice from people already in the field!

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >