Search Results

Search found 6357 results on 255 pages for 'generic relations'.

Page 158/255 | < Previous Page | 154 155 156 157 158 159 160 161 162 163 164 165  | Next Page >

  • Get a class name with generics information

    - by Damien
    Hello, In a java serialization problem, I want to save some classes name and I have some problems with generic classes. For example : - If I have ArrayList<String> listToDump = new ArrayList<String>(); - If I take the name : listToDump.getName(); or listToDump.getCanonicalName(); - I will have java.util.ArrayList or ArrayList - And I want to have java.util.ArrayList<String> or ArrayList<String> Any ideas on how I can do this? Damien.

    Read the article

  • XmlSerializer throws exception when serializing dynamically loaded type

    - by Dr. Sbaitso
    Hi I'm trying to use the System.Xml.Serialization.XmlSerializer to serialize a dynamically loaded (and compiled class). If I build the class in question into the main assembly, everything works as expected. But if I compile and load the class from an dynamically loaded assembly, the XmlSerializer throws an exception. What am I doing wrong? I've created the following .NET 3.5 C# application to reproduce the issue: using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.Reflection; using System.CodeDom.Compiler; using Microsoft.CSharp; public class StaticallyBuiltClass { public class Item { public string Name { get; set; } public int Value { get; set; } } private List<Item> values = new List<Item>(); public List<Item> Values { get { return values; } set { values = value; } } } static class Program { static void Main() { RunStaticTest(); RunDynamicTest(); } static void RunStaticTest() { Console.WriteLine("-------------------------------------"); Console.WriteLine(" Serializing StaticallyBuiltClass..."); Console.WriteLine("-------------------------------------"); var stat = new StaticallyBuiltClass(); Serialize(stat.GetType(), stat); Console.WriteLine(); } static void RunDynamicTest() { Console.WriteLine("-------------------------------------"); Console.WriteLine(" Serializing DynamicallyBuiltClass..."); Console.WriteLine("-------------------------------------"); CSharpCodeProvider csProvider = new CSharpCodeProvider(new Dictionary<string, string> { { "CompilerVersion", "v3.5" } }); CompilerParameters csParams = new System.CodeDom.Compiler.CompilerParameters(); csParams.GenerateInMemory = true; csParams.GenerateExecutable = false; csParams.ReferencedAssemblies.Add("System.dll"); csParams.CompilerOptions = "/target:library"; StringBuilder classDef = new StringBuilder(); classDef.AppendLine("using System;"); classDef.AppendLine("using System.Collections.Generic;"); classDef.AppendLine(""); classDef.AppendLine("public class DynamicallyBuiltClass"); classDef.AppendLine("{"); classDef.AppendLine(" public class Item"); classDef.AppendLine(" {"); classDef.AppendLine(" public string Name { get; set; }"); classDef.AppendLine(" public int Value { get; set; }"); classDef.AppendLine(" }"); classDef.AppendLine(" private List<Item> values = new List<Item>();"); classDef.AppendLine(" public List<Item> Values { get { return values; } set { values = value; } }"); classDef.AppendLine("}"); CompilerResults res = csProvider.CompileAssemblyFromSource(csParams, new string[] { classDef.ToString() }); foreach (var line in res.Output) { Console.WriteLine(line); } Assembly asm = res.CompiledAssembly; if (asm != null) { Type t = asm.GetType("DynamicallyBuiltClass"); object o = t.InvokeMember("", BindingFlags.CreateInstance, null, null, null); Serialize(t, o); } Console.WriteLine(); } static void Serialize(Type type, object o) { var serializer = new XmlSerializer(type); try { serializer.Serialize(Console.Out, o); } catch(Exception ex) { Console.WriteLine("Exception caught while serializing " + type.ToString()); Exception e = ex; while (e != null) { Console.WriteLine(e.Message); e = e.InnerException; Console.Write("Inner: "); } Console.WriteLine("null"); Console.WriteLine(); Console.WriteLine("Stack trace:"); Console.WriteLine(ex.StackTrace); } } } which generates the following output: ------------------------------------- Serializing StaticallyBuiltClass... ------------------------------------- <?xml version="1.0" encoding="IBM437"?> <StaticallyBuiltClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Values /> </StaticallyBuiltClass> ------------------------------------- Serializing DynamicallyBuiltClass... ------------------------------------- Exception caught while serializing DynamicallyBuiltClass There was an error generating the XML document. Inner: The type initializer for 'Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterDynamicallyBuiltClass' threw an exception. Inner: Object reference not set to an instance of an object. Inner: null Stack trace: at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o, XmlSerializerNamespaces namespaces) at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o) at Program.Serialize(Type type, Object o) in c:\dev\SerTest\SerTest\Program.cs:line 100 Edit: Removed some extraneous referenced assemblies

    Read the article

  • Socksifying a Java ServerSocket - how to approach

    - by Thorbjørn Ravn Andersen
    I would like to have a Java program running on network A have a ServerSocket living on another network B through a proxy. I have played with a SOCKS5 proxy (which works) but it appears that all the proxy facilities in Java only work with client connections, not with ServerSockets (no constructor taking a Proxy argument). Asking Google gives much hay and few needles. What is the approach I should take to get this running? If a specific client is better than a generic SOCKS or web proxy then fine, but it needs to be Java (that leaves sshd out). Target JVM is preferrably Java 5, and then Java 6.

    Read the article

  • How to debug unreleased COM references from managed code?

    - by Marek
    I have been searching for a tool to debug unreleased COM references, that usually cause e.g. Word/Outlook processes to hang in memory in case the code does not call Marshal.ReleaseCOMObject on all COM instances correctly. (Outlook 2007 partially fixes this for outlook addins, but this is a generic question). Is there a tool that would display at least a list of COM references (by type) held by managed code? Ideally, it would also display memory profiler-style object trees helping to debug where the reference increment occured. Debugging at runtime is not that important as being able to attach to a hung process - because the problem typically occurs when the code is done with the COM interface and someone forgot to release something - the application (e.g. winword) hangs in memory even after the calling managed application quits. If such tool does not exist, what is the (technical?) reason? It would be very useful for debugging a lot of otherwise very hard to find problems when working with COM interop.

    Read the article

  • Is that a RESTFUL MVC Web Service?

    - by vsj
    I am aware of Web Services and WCF but I have generic question with services.I have a ASP.NET MVC Application which does some basic functionality. I just have a controller in which I am passing it the records and serializing the information to XML using XML Serializer. Then I return this information to the browser and it displays me the XML i got from the Controller Action. So I get the XML representation of my Class(Database Object) in XML and I am to give the URL of this application to the client and access and pull the information. Is this a Service then? I mean in the end all the Clients need is the Xml representation through services also right? I am not that experienced and probably being very silly but please help me out...if I provide xml this way to the client is that a Service ? Or is there something I need to undersatand here?.

    Read the article

  • c# login Screen Error

    - by Kumu
    The type or namespace name 'Login' could not be found (are you missing a using directive or an assembly reference?) This error displays according to the MainMenu of my system. The following code describes the MainMenu source code of my system. Login login; is the error place which system shows, using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace FootballLeague { public partial class MainMenu : Form { FootballLeagueDatabase footballLeagueDatabase; Game game; Team team; **Login login;** public MainMenu() { InitializeComponent(); changePanel(1); } public MainMenu(FootballLeagueDatabase footballLeagueDatabaseIn) { InitializeComponent(); footballLeagueDatabase = footballLeagueDatabaseIn; } //FootballLeagueDatabase footballLeagueDatabase = new FootballLeagueDatabase(); private void Form_Loaded(object sender, EventArgs e) { } private void gameButton_Click(object sender, EventArgs e) { int option = 0; changePanel(option); } private void scoreboardButton_Click(object sender, EventArgs e) { int option = 1; changePanel(option); } private void changePanel(int optionIn) { gamePanel.Hide(); scoreboardPanel.Hide(); string title = "Football League System"; switch (optionIn) { case 0: gamePanel.Show(); this.Text = title + " - Game Menu"; break; case 1: scoreboardPanel.Show(); this.Text = title + " - Display Menu"; break; } } private void logoutButton_Click(object sender, EventArgs e) { login = new Login(); login.Show(); this.Hide(); } and I have the Form class called Login.cs and the following code displays that class. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace FootballLeagueSystem { public partial class Login : Form { MainMenu menu; public Login() { InitializeComponent(); } private void administratorLoginButton_Click(object sender, EventArgs e) { string username1 = "08247739"; string password1 = "08247739"; if ((userNameTxt.Text.Length) == 0) MessageBox.Show("Please enter your username!"); else if ((passwordTxt.Text.Length) == 0) MessageBox.Show("Please enter your password!"); else if (userNameTxt.Text.Equals("") || passwordTxt.Text.Equals("")) MessageBox.Show("Invalid Username or Password!"); else { if (this.userNameTxt.Text == username1 && this.passwordTxt.Text == password1) MessageBox.Show("Welcome Administrator!", "Administrator Login"); menu = new MainMenu(); menu.Show(); this.Hide(); } } private void managerLoginButton_Click(object sender, EventArgs e) { { string username2 = "1111"; string password2 = "1111"; if ((userNameTxt.Text.Length) == 0) MessageBox.Show("Please enter your username!"); else if ((passwordTxt.Text.Length) == 0) MessageBox.Show("Please enter your password!"); else if (userNameTxt.Text.Equals("") && passwordTxt.Text.Equals("")) MessageBox.Show("Invalid Username or Password!"); //menu = new MainMenu(); //menu.Hide(); //this.Close(); else { if (this.userNameTxt.Text == username2 && this.passwordTxt.Text == password2) MessageBox.Show("Welcome Manager!", "Manager Login"); menu = new MainMenu(); menu.Show(); //menu.HideTab(); this.Hide(); } } } private void cancelButton_Click(object sender, EventArgs e) { this.Close(); } } } Please can you someone explain me where is the error is?

    Read the article

  • Script or utility to export from ScrewTurn Wiki into Confluence?

    - by jrummell
    Has anyone tried migrating from ScrewTurn to Confluence? I'm hoping that I can export the ScrewTurn database to xml and then use a utility to put it in a format that Confluence can understand - perhaps the format used by the Universal Wiki Converter. Has anyone used such a utility? Is there anything I should know before I try to write one myself? Update: I've installed the Confluence trial and I took a look at the backup. There's an entities.xml file that looks like the data store. The root tag is <hibernate-generic>, which leads me to believe that they use Hibernate. I'm not familiar with Hibernate, but this should be useful.

    Read the article

  • C# to Java: where T : new() Syntax

    - by Shiftbit
    I am porting some C# code over to Java. I am having trouble with the where Syntax, specifically new(). I understand that where is similar to Java's generic: T extends FOO. How I can replicate the new() argument in Java? "The new() Constraint lets the compiler know that any type argument supplied must have an accessible parameterless--or default-- constructor." - MSDN ie: public class BAR<T> : BAR where T : FOO, new() Right now I have: public class BAR<T extends FOO> extends ABSTRACTBAR { public HXIT(T t){ this.value = t; } .... }

    Read the article

  • Restart IIS7 webapp for debug in VS2008

    - by spender
    I'm developing an ASP.NET asyc generic handler which uses a static System.Threading.Timer instance to feed data to the response output stream while the context is in the asynchronous phase. I'm having issues at startup that I'd like to debug. Currently, because of the long-lived nature of the timer, I'm manually killing w3wp.exe in order to cause the application to restart. I'm aware that there are other ways to do this, but this is the best workflow I can find! Isn't there a way to force a cold start when I hit f5, instead of the standard VS approach of attaching to the existing IIS process?

    Read the article

  • Jquery Live Validation

    - by sico87
    Hello Everyone, After having a search around I could not find exactly what I want, I am looking to validate a form client side using the Jquery library and some form of validation plugin. I was hoping that some one could advise me on whether there are any validation plugins out there that do not use generic error messages, as my form is laid out with no room for these errors, and I also I want the validator to to for correct content as well. Basically I want to be able to check the field on each key press and blur and if the fields validates for it to gain a green border, and if it does not validate for it to gain a red border, any one know of a plugin that can do this? Thanks sico87

    Read the article

  • How to set up 3rd party developer portal

    - by Michael
    I am developing a web service and depend on 3rd party developers to write client applications for it. I need to set a developer portal, a web site where existing and potential developers would find documentation html pages doc files for download libraries downloads wiki forums support ticketing system. There should be a public part and a part protected by login. I want only logged in users to submit tickets, for example. I don't want to host it. I would prefer a generic design based on a sensible template, where I can add minimal customization, such as logo. I don't want to add code to get any of the above functionality. I will do all that if necessary, but I'd hope there would be an online service to do thing like that. What services would you guys recommend?

    Read the article

  • Problem using in GWT project classes from other project/source folders

    - by voipsecuritydigest.com
    My project contains 2 source folder, one is generic J2EE application another is smartCleintGWT, I want to use some already existing DTO classes from first source folder (src) Note that class used on client side and on server side of GWT project! When I do that I getting error [ERROR] Errors in 'file:/C:/..Projects/Admin/DMX/src_console/com/ho/nod/client/AdminRPC.java' [ERROR] Line 7: No source code is available for type com.dmx.synch.server.descriptors.DMXLicense; did you forget to inherit a required module? Source is available obviously; is there any way to import all that into GWT? PS In the future 2 source folder will be separated into 2 projects...I hope it wont be that complicated as well.

    Read the article

  • What to name this class?

    - by orlandu63
    (This is not an interface: I simply omitted the method bodies) class _ { protected $_data = array(); function __construct($data); function set($name, $value); function get($name); function __set($name, $value); function __get($name); //aliases for their respective non-magic methods. # and some other generic methods } Essentially it's a class that provides a magical object-oriented reusable access layer to some data. I've considered DataLayer, DataObject and some others; I'd like to hear some suggestions from someone who's more terminologically savvy.

    Read the article

  • how to configure Postfix to send more emails per hour than the default.

    - by dina-ak
    Hello; My postfix only let me send only 3600 email in an hour ( from which i conclude that there is 1s delay between each email ) while I want to send double that number .. I looked in the postfix configuration .Is there any parameters that i can change to send more than 3600 email in an hour ? this is the output of postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases bounce_queue_lifetime = 1d command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 default_destination_concurrency_limit = 5 default_destination_rate_delay = 0s html_directory = no inet_interfaces = all inet_protocols = ipv4 initial_destination_concurrency = 2 lmtp_destination_rate_delay = 0s local_destination_rate_delay = 0s mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man maximal_queue_lifetime = 1d mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mydomain = example.com myhostname = server01.example.com myorigin = $mydomain newaliases_path = /usr/bin/newaliases.postfix qmgr_message_recipient_limit = 10000 queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.5.6/README_FILES relay_destination_rate_delay = 0s sample_directory = /usr/share/doc/postfix-2.5.6/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtp_bind_address = xxx.xxx.xxx.xxx smtp_destination_rate_delay = 0s smtp_generic_maps = hash:/etc/postfix/generic smtpd_banner = $myhostname ESMTP $mail_name smtpd_client_restrictions = check_client_access hash:/etc/postfix/access unknown_local_recipient_reject_code = 550 virtual_alias_maps = hash:/etc/postfix/virtual virtual_destination_rate_delay = 0s

    Read the article

  • C# - Accesing to items for a collection inherited from List<string>

    - by Salvador
    I am trying to implement a new class inherited from List<string>, to load the contents from a text file to the items. using System.Collections.Generic; using System.IO; using System.Linq; public class ListExt: List<string> { string baseDirectory; public LoadFromFile(string FileName) { this._items = File.ReadAllLines(FileName).ToList();//does not work because _list is private } } but i dont knew how to load the lines into the _items property because is private. any suggestions?

    Read the article

  • java.lang.Void in C#?

    - by user313661
    Hi, I am currently working with .Net 2.0 and have an interface whose generic type is used to define a method's return type. Something like interface IExecutor<T> { T Execute() { ... } } My problem is that some classes that implement this interface do not really need to return anything. In Java you can use java.lang.Void for this purpose, but after quite a bit of searching I found no equivalent in C#. More generically, I also did not find a good way around this problem. I tried to find how people would do this with delegates, but found nothing either - which makes me believe that the problem is that I suck at searching :) So what's the best way to solve this? How would you do it? Thanks!

    Read the article

  • Visualizing read-only folders

    - by Paul-Jan
    My application displays a folder structure in a tree. The user can browse the contents in these folders, and drag content into the folders. However, some of these folders are readonly (meaning no content can be dragged into them). I'm looking for a clear way of depicting this to the user, so they are aware which folders they can drag to before actually having to try it, i.e. hover state. Something not too alarming or interrupting (no big red crosses overlayed on top of the folder icons, for instance), preferably a recognized standard. Specifically, we are talking about an Outlook add-in showing a SharePoint folder tree here, but I'd much rather get the answer from a generic viewpoint. From the top of my head, I simply don't seem to know any applications that visually mark readonly folders.

    Read the article

  • Why use multiple OpenGL context

    - by Luca
    For rendering I have a current GL context, associated to a window. In the case the application render multiple scenes (for example using accumulation or different viewports) I think it is ok to reuse the same context. My question, indeed, is: why should I use multiple GL context? I red on ARB_framebuffer_object extension spec that MakeCurrent call could be expansive, and in the case the ARB_framebuffer_object extension is present I can render on a generic buffer without using MakeCurrent. Apparently the only reason to use multiple GL context is to avoid to setup context state (pixel store, transfer, point size, polygon stipple...) or to have avaialable multiple render buffers configuration (one context with accumulation, another without). How to determine when is better an alternative context instead of setting context state? Thankyou all!

    Read the article

  • in free(): error: junk pointer, too high to make sense Segmentation fault: 11 (core dumped) gprof

    - by Mayank
    I am trying to profile my application. For this I compiled my code with -pg and -lc_p option, it compiled successfully During run time I am getting the following error. in free(): error: junk pointer, too high to make sense Segmentation fault: 11 (core dumped) Doing GDB gives error as. (gdb) b main Breakpoint 1 at 0x5124d4: (gdb) r warning: Unable to get location for thread creation breakpoint: generic error [New LWP 100085] cacheIp in free(): error: junk pointer, too high to make sense Program received signal SIGSEGV, Segmentation fault. [Switching to LWP 100085] 0x00000000006c3a1f in pthread_sigmask () My application is multi threaded and is a combination of C and C++ code. uname -a FreeBSD 6.3-RELEASE FreeBSD 6.3-RELEASE #0: Wed Jan 16 01:43:02 UTC 2008 [email protected]:/usr/obj/usr/src/sys/SMP amd64 Why is the code crashing. Am I missing something.

    Read the article

  • Highlighting in Solr 1.4 - requireFieldMatch

    - by Mark Redding
    I have an object Title : foo Summary : foo bar Body : this is a published story about a foo and a bar All three are set up as fields with stored=true. The user searches across my system for the word "foo" I would like to highlight foo in all three places. The user searches for the word foo in the title "title:foo" I only want to highlight foo within the title. When I added hl.requireFieldMatch=true and hl.usePhraseHighlighter=true as part of my query over to SOLR I am unable to get the highlighting in all three places when doing a generic non fielded search. Is there a way to get both scenarios to work? I had these two items turned off, but I am adding in some fielded portions of the query that the user does not see which only display Published items for instance. the problem is (foo AND status:published) is causing the word published in the body to highlight when the user only searched for the word "foo".

    Read the article

  • Debugging android application on HTC Hero

    - by w00tfest99
    Is it possible to connect the ADB with an HTC Hero? I tried following the instructions for the Win USB driver but when I try to install the driver I just get a generic message saying that there was a problem installing the driver. Looking at the supported devices, the HTC Hero isn't listed. Is this even possible? As a note, I've tried removing drivers and then re-adding using USBDeview and I've also tried adding in the line ";HTC Hero %USB\VID_0BB4&PID_0FFE.DeviceDescRelease%=androidusb.Dev, USB\Vid_0bb4&Pid_0ffe&Rev_0100" in the inf file for the driver.

    Read the article

  • WPF Standard Commands - Where's Exit?

    - by Andrew Shepherd
    I'm creating a standard menu in my WPF application. I know that I can create custom commands, but I know there are also a bunch of standard commands to bind to. For example, to open a file I should bind to ApplicationCommands.Open, to close a file I should bind to ApplicationCommands.Close. There's also a large number of EditCommands, ComponentCommands or NavigationCommands. There doesn't seem to be an "Exit" command. I would have expected there to be ApplicationCommands.Exit. What should I bind to the "Exit" menu item? To create a custom command for something this generic just seems wrong.

    Read the article

  • Passing complex objects to javascript via IScriptControl

    - by Jeff Dege
    I'm playing around with a asp.net page that's using the IScriptControl interface to pass data from the code-behind to the custom javascript object running on the browser. I'm passing a number of properties via IScriptControl.GetScriptDescriptors(), and they're all working fine, except for one. That one is a class derived from System.Collections.Generic.Dictionary<. And even that one has been working for me, so long as the elements in the collection were scalars - ints, doubles, and strings. But when I tried to pass a member of a class, it showed up as a null object in the javascript. The class in question is marked [Serializable]. I changed it to a struct, and got the same behavior. It looks as if the serializer used in IScriptControl does a shallow copy. I need a deep copy. Any ideas?

    Read the article

  • Is the redistributable ReportViewer 2010 RC available in other languages?

    - by pinkmuppet
    I need to deploy the language packs for the ReportViewer 2010 control (the english one is installed and working perfectly). Before, with ReportViewer 2008 and 2005, all the supported laguages were available on the MS downloads site. I can't seem to find them for the RC of 2010 -- are they available anywhere? From MSDN: To use the localized version of the ReportViewer control redistributable that comes with Visual Studio, do the following: 1.Run ReportViewer.exe. 2.Navigate to the folder that contains the language pack you want to use. Language pack folders are located at %PROGRAMFILES%\Microsoft SDKs\Windows\v7.0A\BootStrapper\Packages\ReportViewer\. 3.Run ReportViewerLP.exe. Is there a generic language pack for VS 2010 RC that would have the localized report viewers as well?

    Read the article

  • Interface Builder error: IBXMLDecoder: The value for key is too large to fit into a 32 bit integer

    - by stdout
    I'm working with Robert Payne's fork of PSMTabBarControl that works with IB 3.2 (thanks BTW Robert!): http://codaset.com/robertjpayne/psmtabbarcontrol/. The demo application works fine on 64-bit systems, but when I try to open the XIB file in Interface Builder on a 32-bit system I get: IBXMLDecoder: The value (4654500848) for key (myTrackingRectTag) is too large to fit into a 32 bit integer Building the app as 32 bit works, but then running it gives: PSMTabBarControlDemo[9073:80f] * -[NSKeyedUnarchiver decodeInt32ForKey:]: value (4654500848) for key (myTrackingRectTag) too large to fit in 32-bit integer Not sure if this is a generic IB issue that can occur when moving between 64 and 32 bit systems, or if this is a more specific issue with this code. Has anyone else run into this?

    Read the article

< Previous Page | 154 155 156 157 158 159 160 161 162 163 164 165  | Next Page >