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
L

LimitedAtonement

@LimitedAtonement
About
Posts
65
Topics
17
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Ambiguous
    L LimitedAtonement

    I have the problem, too.

    In Christ, Aaron Laws http://ProCure.com

    C# graphics game-dev question learning

  • Techno Song
    L LimitedAtonement

    What's the difference between Eurodance crap and good electronic music? Is it because it has vocals, a recognizable melody (that is rather long so it can't be repeated 100 times in the song), a standard "song" form (chorus, chorus, bridge, chorus or something) rather than being pure electronic, more focused on large formal design, and small developments of sound?

    In Christ, Aaron Laws http://ProCure.com

    The Lounge com question

  • Techno Song
    L LimitedAtonement

    Yes, I just got it back from a prospective purchaser. Would you like to buy it? It's on hornplayer.net[^] (that's my daughter, how cute!!).

    In Christ, Aaron Laws http://ProCure.com

    The Lounge com question

  • Techno Song
    L LimitedAtonement

    Wow, you're much more "critical" than any audience I've played horn for! Why were you hoping Ms. Rehm was a skank? So I guess you haven't heard the song. It's available on Youtube...http://www.youtube.com/watch?v=dto268KcE28[^]

    In Christ, Aaron Laws http://ProCure.com

    The Lounge com question

  • Techno Song
    L LimitedAtonement

    No Thesis at Indiana University, just two recitals ;)

    In Christ, Aaron Laws http://ProCure.com

    The Lounge com question

  • Techno Song
    L LimitedAtonement

    Dear Sirs, I just heard a song recently that took my fancy quite a bit. I'm a classically trained Horn player (got my Masters in it), but now I'm a professional Programmer. I normally listen to opera or solo lute or harsichord or whatever, but for some reason, I asked my friend if he had techno, he said yes, and I've been listening to it. The song I found is Face 2 Face by Future Trance United (Sung by Verena Rehm). Have any of you heard of it? I'm trying to figure out why I like it so much. Every year or two, a song comes a long and I get infatuated with it, this song is it now. Does anyone else experience this? Any comments?

    In Christ, Aaron Laws http://ProCure.com

    The Lounge com question

  • .NET 4 Rocks!
    L LimitedAtonement

    Kevin McFarlane wrote:

    I've worked in both C++ and .NET and I've not seen any greater dev ability in C++ compared to C#.

    I don't think he was saying that C++ code devs write better code, but good code costs more than bad code. The original statement was

    Nagy Vilmos

    2. Developers are cheaper for modern managed languages over older unmanaged platforms.

    Which Chris Losigner is saying is incorrect. Chris says, as I understand it, "If you want the job done right, you won't pay less." If it's the case that developers are cheaper for modern managed languages, it may be because there are lots of worse developers in the modern languages, whereas C++ has a natural weed-out procedure, namely, learning templates, not using intellisense, understanding indirection, learning about memory management enough to use those smart pointer classes, etc. Any little monkey can write a program in C# or VB, but it takes a good programmer to write a good multi-threaded C# server, equally good as it would take to write a C++ one, even though perhaps the C# one would run 10% slower, and would take 60% the development time. Right, anyway, just defending Chris who I don't think was saying anything about C++ dev superiority.

    In Christ, Aaron Laws http://ProCure.com

    The Lounge csharp css performance lounge

  • c# datetime timezone issues
    L LimitedAtonement

    Dear Sirs, I've looked and looked and can't seem to come up with the perfect solution. So, since CodeProject is perfect, this will cure my problem. I'm getting System.String datetimes from a server (Microsoft CRM if you care). They're in SQL format ("2010-07-23T17:14:40-04:00"). I want to read that in as a .net System.DateTime type with the timezone information preserved, then convert it to local time. This process happens in various timezones, and I'm having trouble staying in synch. Basically, I get lots of CRM records from CRM server (which seems to stamp all the timezones with this Brazilian time (-4)), and I want to write down in my config file the latest one I saw (so I don't go back and pick up values that I already have). I would like to write it down in local time, though. Here's a distillation I want to take the string "2010-07-23T17:14:40-04:00" and, run some code System.Datetime Get_Local_DT(string val); that will return "2010-07-23 15:14:40" in Central time (-6) and "2010-07-23 16:14:40" in Eastern Time (-5). Let me know what you think.

    In Christ, Aaron Laws http://ProCure.com

    C# csharp database com sysadmin help

  • Seriously silly sockets - please assist
    L LimitedAtonement

    I'm guessing that you have an outstanding call to BeginReceive and calling Close on the Socket. This is probably where you need to research. I'm also guessing that the reason you're using BeginReceive instead of Receive is because you're running a GUI from this thread and you need to continue to pump messages, right? I've never done this, so I'm not sure what to say. I always try to separate 'View' coding from my 'implementation' coding, so I handle the multithreading like so:

    namespace App_Domain
    {
    class Program
    {
    static void Main(string[] args)
    {
    System.Net.Sockets.Socket rec_socket = blah, blah,
    send_socket = blah,blah;

            System.Threading.Thread rec\_pumper = new System.Threading.Thread(
                new System.Threading.ParameterizedThreadStart(Pump\_Messages));
            rec\_pumper.Name = "Receive data socket handler";
            rec\_pumper.Start(rec\_socket);
            //go on about your GUI, and when you're ready to quit,
            //set Keep\_Running to false.
        }
        public static bool Keep\_Running  = true;
        private const int DATA\_LENGTH = 256;
        public readonly static Queue \_messages = new System.Collections.Generic.Queue();
        private static void Pump\_Messages(object param)
        {
            System.Net.Sockets.Socket connected\_socket = param as System.Net.Sockets.Socket;
            if (connected\_socket == null)
                throw new System.ArgumentNullException("You must pass a System.Net.Sockets.Socket to me");
            byte\[\] buffer;
            //establish connection
            while (Keep\_Running)
            {
                if (!connected\_socket.Connected)
                {
                    break;
                }
                if (connected\_socket.Available >= DATA\_LENGTH)
                {
                    buffer = new byte\[DATA\_LENGTH\];
                    connected\_socket.Receive(buffer);
                    \_messages.Enqueue(buffer);
                    buffer = null;
                }
                System.Threading.Thread.Sleep(300);
            }
            if (connected\_socket.Connected)
            {
                connected\_socket.Close();
            }
            if (Keep\_Running)
            {
                //if we're here, we have abnormal termination.
                //log it.
                System.Console.WriteLine("C
    
    C# csharp question help learning

  • Only in Release config, SetWindowsHookEx throws error 80004005
    L LimitedAtonement

    Dear Sirs, I'm having a problem with SetWindowsHookEx. In Debug mode, no problem, in release, it throws. Here's the code:

    namespace barcode
    {
    public static class program
    {
    static void Main(string[] args)
    {
    _keyboard_delegate = Keyboard_Msg_Pump;
    _keyboard_hook_handle = SetWindowsHookEx(
    WH_KEYBOARD_LL,
    _keyboard_delegate,
    System.Runtime.InteropServices.Marshal.GetHINSTANCE(
    System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0]),
    0);
    if (_keyboard_hook_handle == 0)
    {//this is failure...
    int errorCode = System.Runtime.InteropServices.Marshal.GetLastWin32Error();
    throw new System.ComponentModel.Win32Exception(errorCode);
    }
    }

        private static int Keyboard\_Msg\_Pump(int nCode, System.Int32 wParam, System.IntPtr lParam)
        {
            return 12;
        }
    
        private static int \_keyboard\_hook\_handle;
        private static HOOKPROC \_keyboard\_delegate;
        private delegate int HOOKPROC(int nCode, int wParam, System.IntPtr lParam);
    
        private const int WH\_KEYBOARD\_LL = 13;
        \[System.Runtime.InteropServices.DllImport("user32.dll",
            CharSet=System.Runtime.InteropServices.CharSet.Auto, 
            CallingConvention=System.Runtime.InteropServices.CallingConvention.StdCall, 
            SetLastError=true)\]
        private static extern int SetWindowsHookEx(
            int idHook,
            HOOKPROC lpfn,
            System.IntPtr hMod,
            int dwThreadId);
    }
    

    }

    If you get to line sixteen (right after the if statement in the Main proc), you have an error. Try stepping through this example and tell me if it works for you. If I'm in debug mode, it works for me, but if I'm in release (even with optimize code off, which I thought would make it just like DEBUG), it fails with inconsistent errors, sometimes it says "Operation completed successfully" sometimes it says "Access denied" and other things. Let me know if you can run it in Release, and how. If not, tell me what error you get. JUST NOW, as I was writing this, I decided that it might be the setting, "Enable the VSHost" process. If it's off, it works. If it's on, no good. Does the VSHost run under lower authority than the user?? Let me know what you think.

    In Christ, Aaron Laws http://ProCure.com

    C# help com debugging tutorial question

  • I thought singletons were "Evil"? [modified]
    L LimitedAtonement

    I was thinking that would be the one case (obfuscation) of good justification for too many globals.

    In Christ, Aaron Laws http://ProCure.com

    C# learning game-dev question

  • Threading Question
    L LimitedAtonement

    Mr. Pattyn, My experience thus far has been that the main method only sets the initial thread's apartment model, not the default for future threads.

    In Christ, Aaron Laws http://ProCure.com

    C# database question winforms com design

  • Threading Question
    L LimitedAtonement

    Dear Mr. Grunwald, Thanks for the explanation. That's right, I was thinking of it as a program setting, not a thread setting. So, one thing interests me (to hijack my own thread...heh), that is, ``calls are marshaled to that thread..." This confuses me. So, perhaps a thread coming into COM looking to get something done (open a OpenFile Dialog or something) comes in, COM looks at him and decides he's STA. So, does COM hijack that thread or create a new thread? How can COM marshal calls on a thread that it doesn't own? Or, is this always done in a message pump? Perhaps you could point me to an article on this. Your answer is excellent, rating 5. Thanks.

    In Christ, Aaron Laws http://ProCure.com

    C# database question winforms com design

  • Threading Question
    L LimitedAtonement

    Dear Mr. Aptroot, This is correct. I'll have to profile it that way later (when I get some clients). But I would hate to develop the application, then figure out I'm only getting one thread later and have to restructure!! That's why I wanted to know now.

    In Christ, Aaron Laws http://ProCure.com

    C# database question winforms com design

  • Threading Question
    L LimitedAtonement

    Dear Mr. Pattyn, I hope you're right, and I'll assume you are. I'm not so sure the example really proves the point, though, because there could be some scheduling or something that causes the example to look multi-threaded when in fact, the one thread's slice is actually being sliced up more or something like that. As you can probably see from my comments, it's all a mystery to me, but I'll keep the STAThreadAttribute up and contact you when it messes up. ;-)

    In Christ, Aaron Laws http://ProCure.com

    C# database question winforms com design

  • Threading Question
    L LimitedAtonement

    Dear Mr. Simmons, Thanks for the response. I'm not really multi-threading in a GUI, but my multi-threaded application uses a GUI. The UI is the last thing to be initialized. It's not much of a difference if any, but I thought I would point that out. Beyond that, I'm just trying to make sure that my program in fact uses the .Net Free-Threading (right?) model, not a scheduled single-thread when I use the STAThreadAttribute. Thanks again.

    In Christ, Aaron Laws http://ProCure.com

    C# database question winforms com design

  • Threading Question
    L LimitedAtonement

    Dear Sirs, I've read google, MSDN and this site quite a bit and can't quite come up with the answer. I've created a program (server) that is multi-threaded. Here are some descriptions: Listener thread: This thread sits and listens for TCP connections. When it gets one, it creates a thread for that connection which gets data from that connection and interacts with the database, spawns processes, whatever the client asks for. Scheduler thread: Certain tasks are scheduled to occur on the server, this thread sits tight and when the appropriate time (specified in config file) comes, it executes the tasks that need to happen one at a time (which then probably connect via the listener). I would also like a GUI to monitor progress from the clients. I currently have the following main method:

    //[System.STAThread]
    public static void Main(string[] args)
    {
    _con = new DW_DB_Connection();//establishes connection with SQL database in ctor for use by clients.
    Start_Threads(); //starts listener and scheduler
    //System.Windows.Forms.Application.Run(new UI());
    }

    If I use a GUI, I need STA Thread, right? My question is this: does STAThreadAttribute diminish the power of my application to multi-thread aggressively (and allow it to scale quite large)? From what I've read, it might be the case that STA only has an effect when the application uses COM (here). The scheduler and listener do not...I think, but Windows Forms certainly does. But other sources say it changes the apartment state of the current thread to be single threaded. Let me know what you think.

    In Christ, Aaron Laws http://ProCure.com

    C# database question winforms com design

  • Command line not working when large
    L LimitedAtonement

    Dear Mr. MacCutchan, Good catch. This doesn't exactly explain the fact that I was able to get 2,075 characters into the command line. Well, either way, I still have a limit, even if it's not the 2048 limit, that I'm hitting. Thanks for your comment.

    In Christ, Aaron Laws http://ProCure.com

    C# help com linux tutorial question

  • Command line not working when large
    L LimitedAtonement

    Dear Mr. aspdotnetdev, Thanks for your suggestion. I'd hate to have to modify that menu.... I was hoping for a stand-alone app that didn't require a setup of any sort. Maybe I can make an alternate version... oh well.

    In Christ, Aaron Laws http://ProCure.com

    C# help com linux tutorial question

  • Command line not working when large
    L LimitedAtonement

    Dear Mr. Pattyn, Thanks! I'm anonymizing.

    In Christ, Aaron Laws http://ProCure.com

    C# help com linux tutorial 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