Search Results

Search found 53463 results on 2139 pages for 'net generics'.

Page 73/2139 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • What is the problem with this Java code dealing with Generics?

    - by devoured elysium
    interface Addable<E> { public E add(E x); public E sub(E y); public E zero(); } class SumSet<E extends Addable> implements Set<E> { private E element; public SumSet(E element) { this.element = element; } public E getSum() { return element.add(element.zero()); } } It seems that element.add() doesn't return an E extends Addable but rather an Object. Why is that? Has it anything to do with Java not knowing at run-time what the object types really are, so it just assumes them to be Objects(thus requiring a cast)? Thanks

    Read the article

  • urlrewriter.net page not executed

    - by peter
    Hello, I'm having some problems with the module urlrewriter.net for ASP.NET. I have a multilingual site with a URL like this; ~/home.aspx To support languages I use this rewrite rule; <rewrite url="~/de-DE/(.*)" to="~/$1"></rewrite> Then in my code I get the de-DE part and set the right culture for the current thread. All of this works well. After I login on the website I get a message "Hello, user x" to show i'm logged in. When navigating to another page, it doesn't display this message anymore and it seems like the page comes from the cache or something with the old (not logged in) data. Also, when I attach the debugger, nothing is executed for this request. If I visit the page like ~/home.aspx instead of ~/de-DE/home.aspx, does problem does not occur. What could be the problem here? Thanks

    Read the article

  • .NET --- Textbox control - wait till user is done typing

    - by Cj Anderson
    Greetings all, Is there a built in way to know when a user is done typing into a textbox? (Before hitting tab, Or moving the mouse) I have a database query that occurs on the textchanged event and everything works perfectly. However, I noticed that there is a bit of lag of course because if a user is quickly typing into the textbox the program is busy doing a query for each character. So what I was hoping for was a way to see if the user has finished typing. So if they type "a" and stop then an event fires. However, if they type "all the way" the event fires after the y keyup. I have some ideas floating around my head but I'm sure they aren't the most efficient. Like measuring the time since the last textchange event and if it was than a certain value then it would proceed to run the rest of my procedures. let me know what you think. Language: VB.NET Framework: .Net 2.0 --Edited to clarify "done typing"

    Read the article

  • msbuild for .NET 3.5 issue with csla and System.Linq

    - by Sash
    This is a weird problem. I am trying to build a .NET 3.5 solution with msbuild. I generally write custom build scripts for this, and when I tried this time to build a simple .NET assembly which internally uses CSLA, it started giving me Linq errors. However, if I build the proj file via msbuild (command line), it seems to build just fine. No issues at all. Anyone else encounter this issue...and if yes, how do i fix this? Thanks, Sashidhar Kokku

    Read the article

  • How to store account-specific information in ASP.NET MVC 2

    - by PR_
    I have an ASP.NET MVC 2 web application. There are two tables like "FIRST_KIND_OF_USERS" and "SECOND_KIND_OF_USERS". Both are mapped to the default aspnet_users table via UserId column. Each of them has it's own integer primary key column like "FirstKindOfUsersId". When a user is trying to add some data to the database, for instance, "Create a new Task" I would like to add a new row in Tasks table with "FirstKindOfUsersId" value. Where should I store or get this value? At the moment I have these possible solutions: Get "FirstKindOfUsersId" value by User.Identity.Name each time; Use SESSION[] for storing these values (Where and when should I save these ones?) Use FormsAuthenticationTicket and create own custom IIdentity class. (http://stackoverflow.com/questions/1064271/asp-net-mvc-set-custom-iidentity-or-iprincipal) Which approach is better? And if I pick the 3rd one, how to save the necessary data property and at which stage?

    Read the article

  • Add / Remove the default documents of IIS7 using vb.net 2.0 windows application

    - by Senthil S R
    Hai, I wrote the coding for add / remove the default documents of IIS7 in vb.net 2.0 windows application using Microsoft.Web.Administration.dll. The coding is working fine. After adding a new document, the messagebox showing that newly added document name. Simillarly if I remove any document, the messagebox not showing that document name. So that I am saying, the coding is working fine. Now the problem is, I can't see the newly added document name in II7 Manager GUI. The next proplem is, my website not access that newly added document. Please can any body suggest for these problems. What the mistake I did the vb.net 2.0 windows application coding and what are the modifications I need to do? Thanks in advance.

    Read the article

  • Assigning a MVC Controller property from Asp.Net page

    - by JasonMHirst
    I don't know if I've understanding MVC correctly if my question makes no sense, but I'm trying to understand the following: I have some code on a controller that returns JSON data. The JSON data is populated based on a choice from a dropdown box on an Asp.Net page. I thought (incorrectly) that Session variables would be shared between the Asp.Net project and the MVC Project. What I'd like to do therefore (if this is possible), is to call a Sub on the MVC that sets a variable before the JSON query is run. I have the following: Sub SetCountryID(ByVal CountryID As Integer) Me.pCountrySelectedID = CountryID End Sub Which I can call by the following: Response.Write("http://localhost:7970/Home/SetCountryID/?CountryID=44") But this then results in a blank page - again obviouslly totally incorrect! Am I going about MVC the wrong way or do I still have a hell of a lot more learning to do? Is this even possible to do?

    Read the article

  • Ways to improve Java Generics and dont say get rid of wildcards and reification.

    - by mP
    Sometimes i like to write up template classes and use type parameters to make the abstract methods more type safe. Template<X> { abstract void doStuff( X ); // NOT public } While type safety is great etc, the problem remains that even though X is not visible to outside code, one must still include the type to avoid warnings. My solution in this case would be to make it possible to define a scope for type parameters (now they are always public). Would other original features besides the obvious would you like.

    Read the article

  • How to query data from a password protected https website using C# .NET

    - by Addie
    I'd like my application to query a csv file from a secure website. I have no experience with web programming so I'd appreciate detailed instructions. Currently I have the user login to the site, manually query the csv, and have my application load the file locally. I'd like to automate this by having the user enter his login information, authenticating him on the website, and querying the data. The application is written in C# .NET. The url of the site is: https://www2.emidas.com/default.asp. I've tested the following code already and am able to access the file once the user has already authenticated himself and created a manual query. System.Net.WebClient Client = new WebClient(); Stream strm = Client.OpenRead("https://www3.emidas.com/users/<username>/file.csv");

    Read the article

  • Error in my OO Generics design. How do I workaround it?

    - by John
    I get "E2511 Type parameter 'T' must be a class type" on the third class. type TSomeClass=class end; ParentParentClass<T>=class end; ParentClass<T: class> = class(ParentParentClass<T>) end; ChildClass<T: TSomeClass> = class(ParentClass<T>) end; I'm trying to write a lite Generic Array wrapper for any data type(ParentParentClass) ,but because I'm unable to free type idenitifiers( if T is TObject then Tobject(T).Free) , I created the second class, which is useful for class types, so I can free the objects. The third class is where I use my wrapper, but the compiler throws that error. How do I make it compile?

    Read the article

  • Oracle XE + ODP.NET ANNOYING VIEW ERROR

    - by Alex
    Sup guys, heres my view: CREATE OR REPLACE VIEW SISTEMA.VWTELA AS SELECT TEL_DLTELA AS Tela, TEL_DLDESCRICAO As Descricao, TEL_DLTABELA As Tabela, CASE WHEN to_char(TEL_STATIVO) = to_char(1) THEN to_char('Yes') ELSE to_char('No') END as Ativo, TEL_IDTELA AS IDTEL FROM SISTEMA.TEL_TELA; When i do a SELECT * FROM SISTEMA.VWTELA it works fine from PL/SQL Developer but when i launch the query from my VB.NET application it throws me a super annoying error ORA-01722. Any ideas? The Application code works perfecty with any query so its not application code error but prolly some "super cool feature" from ODP.NET. Already tried to_number, to_whatever and same error always happens.

    Read the article

  • ASP.Net Architecture Specific to Shared/Static functions

    - by Maxim Gershkovich
    Hello All, Could someone please advise in the context of a ASP.Net application is a shared/static function common to all users? If for example you have a function Public shared function GetStockByID(StockID as Guid) as Stock Is that function common to all current users of your application? Or is the shared function only specific to the current user and shared in the context of ONLY that current user? So more specifically my question is this, besides database concurrency issues such as table locking do I need to concern myself with threading issues in shared functions in an ASP.Net application? In my head; let’s say my application namespace is MyTestApplicationNamespace. Everytime a new user connects to my site a new instance of the MyTestApplicationNamespace is created and therefore all shared functions are common to that instance and user but NOT common across multiple users. Is this correct?

    Read the article

  • .NET Deployment of Interface/Classes for Command Pattern Question

    - by Jonno
    In theory I would like to produce 2 projects: 1) Asp.net (Sever A) 2) DAL running (Server B) I would like to utilise command objects to comunicate with the DAL. ASP.net instantiates a command class e.g. CmdGetAllUsers which impliments IMyCommand interface and sends it to the DAL (using ASMX or WCF). My question is: Would the class definition of CmdGetAllUsers need to exist on the DAL server? Or would having the interface definition be enough? My goal is to reduce the need to redeploy the DAL code, and have it as a fairly simple pass-through layer. Many thanks for your time.

    Read the article

  • C#: Non-constructed generics as properties (eg. List<T>)

    - by Dav
    The Problem It's something I came across a while back and was able to work around it somehow. But now it came back, feeding on my curiosity - and I'd love to have a definite answer. Basically, I have a generic dgv BaseGridView<T> : DataGridView where T : class. Constructed types based on the BaseGridView (such as InvoiceGridView : BaseGridView<Invoice>) are later used in the application to display different business objects using the shared functionality provided by BaseGridView (like virtual mode, buttons, etc.). It now became necessary to create a user control that references those constructed types to control some of the shared functionality (eg. filtering) from BaseGridView. I was therefore hoping to create a public property on the user control that would enable me to attach it to any BaseGridView in Designer/code: public BaseGridView<T> MyGridView { get; set; }. The trouble is, it doesn't work :-) When compiled, I get the following message: The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?) Solutions? I realise I could extract the shared functionality to an interface, mark BaseGridView as implementing that interface, and then refer to the created interface in my uesr control. But I'm curious if there exists some arcane C# command/syntax that would help me achieve what I want - without polluting my solution with an interface I don't really need :-)

    Read the article

  • How to avoid Eclipse warnings when using legacy code without generics?

    - by Paul Crowley
    I'm using JSON.simple to generate JSON output from Java. But every time I call jsonobj.put("this", "that"), I see a warning in Eclipse: Type safety: The method put(Object, Object) belongs to the raw type HashMap. References to generic type HashMap should be parameterized The clean fix would be if JSONObject were genericized, but since it isn't, I can't add any generic type parameters to fix this. I'd like to switch off as few warnings as possible, so adding "@SuppressWarnings("unchecked")" to lots of methods is unappealing, but do I have any other option besides putting up with the warnings?

    Read the article

  • Exposing some live data on a website - New to ASP.NET, need guidelines

    - by Carlos
    I have a large .NET based system running within the company intranet, which allows winforms users to see some live calculated numbers and a custom winforms control drawn live (but not real-time). The Forms users can also affect the operation of the system. I would like to just show the live numbers on a website, along with the custom control. Nothing needs to come back from the web user, as the web app is meant to be just for monitoring. All the numbers can be calculated at the server. It's been a long time since I touched ASP.NET, and I need to know how to proceed. What are the steps in building and deploying such a website? Any caveats I need to look out for?

    Read the article

  • Is is possible to do an end-run around generics covariance in C# < 4 in this hypothetical situation?

    - by John Feminella
    Suppose I have a small inheritance hierarchy of Animals: public interface IAnimal { string Speak(); } public class Animal : IAnimal { public Animal() {} public string Speak() { return "[Animal] Growl!"; } } public class Ape : IAnimal { public string Speak() { return "[Ape] Rawrrrrrrr!"; } } public class Bat : IAnimal { public string Speak() { return "[Bat] Screeeeeee!"; } } Next, here's an interface offering a way to turn strings into IAnimals. public interface ITransmogrifier<T> where T : IAnimal { T Transmogrify(string s); } And finally, here's one strategy for doing that: public class Transmogrifier<T> : ITransmogrifier<T> where T : IAnimal, new() { public T Transmogrify(string s) { T t = default(T); if (typeof(T).Name == s) t = new T(); return t; } } Now, the question. Is it possible to replace the sections marked [1], [2], and [3] such that this program will compile and run correctly? If you can't do it without touching parts other than [1], [2], and [3], can you still get an IAnimal out of each instance of a Transmogrifier in a collection containing arbitrary implementations of an IAnimal? Can you even form such a collection to begin with? static void Main(string[] args) { var t = new Transmogrifier<Ape>(); Ape a = t.Transmogrify("Ape"); Console.WriteLine(a.Speak()); // Works! // But can we make an arbitrary collection of such animals? var list = new List<Transmogrifier< [1] >>() { // [2] }; // And how about we call Transmogrify() on each one? foreach (/* [3] */ transmogrifier in list) { IAnimal ia = transmogrifier.Transmogrify("Bat"); } } }

    Read the article

  • .NET make a copy of an embedded file resource to the local drive

    - by Matt H.
    Hi, i'm new to the realm to working with Files in .NET I'm creating a WPF application in VB.NET with the 3.5 Framework. (If you provide an example in C#, that's perfectly fine.) In my project I have a Template for an MS Access database. My desired behavior is that when the users clicks File--New, they can create a new copy of this template, give it a filename, and save it to their local directory. The database already has the tables and some starting data needed to interface with my application (a user-friendly data editor) I'm thinking the approach is to include this "template.accdb" file as a resource in the project, and write it to a file somehow at runtime? Any guidance will be very, very appreciated. Thanks!

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >