Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

buchstaben

@buchstaben
About
Posts
95
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Is there a way to run nunit Test class 50 times in a loop ?
    B buchstaben

    you're right. haven't seen the n in "nunit".. nevertheless using (nearly empty) datasource is a way to achieve multiple testruns -> should work with nunit as well.

    C# tutorial question

  • Is there a way to run nunit Test class 50 times in a loop ?
    B buchstaben

    You could try Microsoft.VisualStudio.TestTools.UnitTesting.DataSourceAttribute. I use it to run my test with different testdata:

    [DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML",
    "|DataDirectory|\\MyDataSource.xml",
    "Row",
    DataAccessMethod.Sequential)]

    C# tutorial question

  • XmlSerializer doesn't write the namespace
    B buchstaben

    That works, thank you. However, I did not expect to need to change the generated code.

    C# wcf xml json tutorial question

  • XmlSerializer doesn't write the namespace
    B buchstaben

    Thanks, I've already noticed XmlSerializerNamespaces, but this way, I need to code which namespace belongs to which object. But that's exactly what the [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://myNamespace/")]-attribute says. So how to tell the serializer to have a look for these attributes? I expected that as a default..

    C# wcf xml json tutorial question

  • XmlSerializer doesn't write the namespace
    B buchstaben

    Hi there, I'm currently trying to serialize a wsdl.exe generated object

    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://myNamespace/")]
    public partial class marketDataEventV1 { //...

    using the following lines of code:

    marketDataEventV1 mdEvent = CreateMarketDataEventV1();
    XmlSerializer ser = new XmlSerializer(typeof(marketDataEventV1));

    StringBuilder sb = new StringBuilder();
    ser.Serialize(new StringWriter(sb), mdEvent);

    Now, having a look to sb.ToString() shows, that the result (string) does not contain the namespace declaration. I wonder now, how to get the serializer taking account for the namespace?! Thanks in advance!

    C# wcf xml json tutorial question

  • Simple Cache shared in multiple application instances
    B buchstaben

    Would be possible, but the application is quite useless until the cache is ready. Nevertheless, I'll invest some more thoughts in this approach. There are 5 flat tables, which each are loaded in a collection. Maybe I should try to parallelise these 5 requests. PS: the cache is used for filter criterions (and the application's main feature is searching/filtering data)

    C# question csharp winforms tutorial learning

  • Simple Cache shared in multiple application instances
    B buchstaben

    Yep, lazy-loading was implemented in former version of the application but didn't satisfy the users due to slow runtime performane.

    C# question csharp winforms tutorial learning

  • Simple Cache shared in multiple application instances
    B buchstaben

    My goal is to reduce the application's time of initialisation. Today, every instance creates its own cache, which takes about 30-60 seconds (depending on database's resources). I thought about reducing the time of initialisations to < 5s (for all except the first application's start).

    C# question csharp winforms tutorial learning

  • Simple Cache shared in multiple application instances
    B buchstaben

    Thanks for your answers. What about moving the static collection (cache) to a small library-dll which is referenced from my application. this way, the library-dll would get loaded only one, wouldn't?

    C# question csharp winforms tutorial learning

  • Simple Cache shared in multiple application instances
    B buchstaben

    Hi, I've implemented a very simple cache in a winforms-application using a static Colletion of objects. This collection, of course, is initialized at its first use. As the cache does not need to get updated through the whole application lifetime, that's all I need. My question now is: How to share this static collection through multiple instances of my application? I don't need an extra cache for each instance.. Thanks in adavance.

    C# question csharp winforms tutorial learning

  • log4net doesn't log in myProcess.OutputDataReceived
    B buchstaben

    Hi, my app logs correctly while code is beeing executed within my method DoIt. But it doesn't log in the Process.OutputDataReceived's EventHandler even if p_OutputDataReceived is called. Is there anything I need to look at while using Process?

        private void DoIt(string arguments)
        {
            \_log.Fatal("TEST"); // DOES LOG
            Process p = new Process();
            p.StartInfo.FileName = @"D:\\vssTOOLS\\NetJobs\\UpdateDealArchiveInstrSeq\\UpdateCaller\\bin\\Debug\\UpdateDealArchiveInstrSeq.exe";
            p.StartInfo.RedirectStandardError = true;
            p.StartInfo.RedirectStandardOutput = true;
            p.OutputDataReceived += new DataReceivedEventHandler(p\_OutputDataReceived);
            p.ErrorDataReceived += new DataReceivedEventHandler(p\_ErrorDataReceived);
            p.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(typeof(Caller)).Location);
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.Arguments = arguments;
            p.Start();
    
            p.BeginOutputReadLine();
            p.BeginErrorReadLine();
    
            p.WaitForExit();
    
            //Synchronisieren
            do
            {
                System.Threading.Thread.Sleep(100);
            } while (!p.HasExited);
    
            if (p.ExitCode != 0)
            {
                // DOES LOG
                for (int i = 0; i < procOut.ToString().Length; i += 2000)
                    \_log.Info(procOut.ToString().Length > i + 2000 ? procOut.ToString().Substring(i, 2000) : procOut.ToString().Substring(i));
                for (int i = 0; i < procErr.ToString().Length; i += 2000)
                    \_log.Error(procErr.ToString().Length > i + 2000 ? procErr.ToString().Substring(i, 2000) : procErr.ToString().Substring(i));
                throw new ApplicationException("Es ist ein Fehler aufgetreten: " + procErr.ToString());
            }
        }
    
        StringBuilder procOut = new StringBuilder();
        StringBuilder procErr = new StringBuilder();
        void p\_ErrorDataReceived(object sender, DataReceivedEventArgs e)
        {
            procErr.AppendLine(e.Data);
            \_log.Error(e.Data); // DOES NOT LOG
        }
    
        void p\_OutputDataReceived(object sender, DataReceivedEventArgs e)
        {
            procOut.AppendLine(e.Data);
            \_log.Info(e.Data); // DOES NOT LOG
        }
    
    C# debugging help question

  • NHibernate: getting the available row count while using maxResults
    B buchstaben

    I've found the solution:

    criteria.SetProjection(Projections.RowCount());
    int totalRecordsFound = (int)criteria.UniqueResult();

    C# question java oracle

  • NHibernate: getting the available row count while using maxResults
    B buchstaben

    Hi, I've done some hibernate work querying data from oracle. Since the return might be a very huge list of objects, I use the SetMaxResults() method.

    int maxDS = 1000;
    ISession session = //..
    ICriteria criteria = session.CreateCriteria(typeof(Trade));
    criteria.SetMaxResults(maxDS);
    AddCriterions(criteria); // I add some criterions in this method
    IList<Trade> trades = criteria.List<Trade>();

    How can I get the number of totally available objects (for my criterions) without disposing maxDS and loading them all? Thanks in advance.

    C# question java oracle

  • Where does Settings.Default.MySetting come from?
    B buchstaben

    Simon Stevens wrote:

    The default value is hard coded as an attribute on the property

    Thanks, that's what I've been looking for.

    C# question

  • Where does Settings.Default.MySetting come from?
    B buchstaben

    Hi, I'm wondering where a setting's value comes from, if it is not configured in MyApplication.exe.config. Didn't find an answer at msdn yet, so could anyone explain please?

    C# question

  • what is java's Logger.getRootLogger() in log4net?
    B buchstaben

    Hi, can anyone tell me the c# way to get the log4net root logger? background: there's a dll wich executes any code specified via xml (dest. assembly path, dest. method, etc.). within this dll, log4net is correctly configured and works fine. now i want to use the same logger from any of my dest. dlls. calling LogManager.GetRepository() and navigating through some public and private fields via visual studio tells that both appenders (configured in base dll) are available. But how to access them?

    C# csharp question java visual-studio xml

  • nunit-console doesnt stop after test summary output
    B buchstaben

    using the /nothread option helped, but i still don't know why :/

    C# data-structures debugging question

  • Merge to xml-files by C#
    B buchstaben

    guess it depends on how the merge should work. if you only need to append one file to another, cmd.exe will do the job. xslt is fine, but you'll need something that starts the transformation process automatically.

    C# xml csharp help question

  • nunit-console doesnt stop after test summary output
    B buchstaben

    Hi, anyone famliar with nunit-console.exe? running tests of a dll works fine, but after the test summary is printed, I don't come back to the cmd, except by typing ctrl+c. This behaviour always occurs , ignoring test results. Any idea?

    ...................................
    Tests run: 75, Failures: 1, Not run: 0, Time: 236.123 seconds

    Failures:

    1. #failure info#
      #stack trace#

    ^C
    D:\Profiles\myname>

    thanks in advance.

    C# data-structures debugging question

  • My computer can't do basic arithmetic (or I'm doing something stupid)
    B buchstaben

    try

    float aspectRatio = 1280f / 500f;

    what you're doing is calculating with integers and assigning the result to float. you need to calculate with floats.

    C# question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups