Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

pavone pavone
  • I work in an internal IT Dept. Is Channel 9 not for me?

    , PerfectPhase wrote

    If the video's here aren't your sort of thing I highly recommend http://pluralsight.com/training

    Seconded. Pluralsight is the best video store for MS stack devs, I cannot stop going back to it. Clear concise explanations, that cover nearly everything you need to know to go from newbie to pro.  

  • Oh look, I'm on video

    Nice video. Good to see a MS expert helping out and sharing the knowledge in this board. Thanks.

  • The beggining of the end of DirectX?

     It's nice to see MS is supporting WebGL, we've seen some amazing things being done with it. Mind you, I fail to see the connection of support of WebGL to the end of DirectX.. 

    It would be nice to see better support for OpenGL in Windows, but DirectX is pretty much proven technology, I don't see it going anywhere. 

  • ASP.NET MVC does not play nice with IE

    Thanks PopeDai, your search query led me to the right solution. Turned out to be my DivX plug-in for IE, same plug-in in other browsers (Chrome, FF) works fine though. 

  • ASP.NET MVC does not play nice with IE

    Both IE9 and IE10. Haven't tested IE8 but doesn't it use the same javascript engine.. I figure there's some configuration or flag in VS2012 (using MVC 4.0 btw) I need to set. Note that this is the default template, I have not added a single line of code.  

  • ASP.NET MVC does not play nice with IE

    So whenever I try to run the default Internet application from ASP.NET MVC with IE, it throws an exception:

    And the offending piece of code at which it breaks:

    // HACK : override appendChild, replaceChild, insertBefore for IE, since it doesn't support DOM events
        if (isInternetExplorer)
        {
            var appendChildOriginal = doc.body.appendChild;
            doc.body.appendChild = function(element)
            {
                appendChildOriginal(element);
                var tag = element.tagName.toLowerCase();
                
                if ("video" == tag)
                {
                    ProcessVideoElement(element);
                }
            }
    
           ....
    }

    I can simply continue but it's very annoying. So is there way to disable this error? 

  • ASP.NET and Network Drives Help

    Hey guys,

    So I have another problem. I need to check out a file from PVCS from an ASP.NET webpage. In order to do so I spawn a process that calls a batch file which sets some environment variables and then calls the pvcs command get.exe to get the file. This all works great when I run it on my local machine, but as soon as I deploy to the server all hell breaks lose. The website impersonates the main user, this happens in the web.config (still not sure if relevant). 

    After trial and error, I narrowed down the problem to communication with shared drives. PVCS drive is mapped in the server. So I made a small batch script that only does a cd to a directory on this shared drive and it failed. Code is simply "cd Z:/work/".

    Google gave some answers and more questions still. Apparently impersonation and shared drives simply do not work. But I'm not certain if that pertains to spawned process using C# Process class. Though, given that the webpage works perfectly in my machine without impersonation, this might have something to do with it. C# spawned processes have limited permissions, but I don't think this is the problem since my code is failing in doing a simple cd Z:\work\. 

    So I created a console app which does the check out (same code as the webpage) and it worked in the web server without a problem. The problem only occurs when I spawned the process from the webpage in the webserver. I made some dummy code to test.

    I even tried to call the console app from the website, but that still doesn't work. 

     

    public partial class _Default : System.Web.UI.Page
        {
            
            protected void Page_Load(object sender, EventArgs e)
            {
                
    
            }
    
            protected void btnCheckout_Click(object sender, EventArgs e)
            {
                Command cmd = new Command(@"cmd", @"/c testpath.bat");
                cmd.execute();
              
                lblError.Text = cmd.stderr;
                lblOutput.Text = cmd.stdout;
            }
        }
    
    
    public class Command
        {
            // Private members
            private Process process;
            private int timeout;
    
            // Public members
            public string stderr { get; private set; }
            public string stdout { get; private set; }
            public string exception { get; private set; }
            public bool done { get; private set; }
            public int exitLevel { get; private set; }
    
    
            /// <summary>
            /// Construct a Command object that will be executed in a Windows environment.
            /// </summary>
            /// <param name="args">the command to execute in command prompt</param>
            /// <param name="timeout">This is optional and consists of the time in milliseconds to wait for the command to finish. Default is 10 seconds.</param>
            public Command(string exec, string args, string workingDir="", int timeout = 5000)
            {
                this.timeout = timeout;
                this.exception = "";
                process = new Process();
                if (!string.IsNullOrEmpty(workingDir))
                    process.StartInfo.WorkingDirectory = workingDir;
                process.StartInfo.FileName = exec;
                process.StartInfo.Arguments = args;
                process.StartInfo.UseShellExecute = false;
                process.StartInfo.CreateNoWindow = true;
                process.StartInfo.RedirectStandardError = true;
                process.StartInfo.RedirectStandardOutput = true;
                process.OutputDataReceived += process_OutputDataReceived;
            }
    
            void process_OutputDataReceived(object sender, DataReceivedEventArgs e)
            {
                if (!string.IsNullOrEmpty(e.Data))
                {
                    stdout = e.Data;
                }
            }
    
            public void execute()
            {
                try
                {
                    process.Start();
                    process.BeginOutputReadLine();                  // Note that the following three lines in any 
                    stderr = process.StandardError.ReadToEnd();     // other order will deadlock. 
                    process.WaitForExit(timeout);
                }
                catch (Exception e)
                {
                    exception = e.Message;
                    Debug.WriteLine(e.Message + "\n" + e.StackTrace);
                }
                Thread.Sleep(1000);
            }
    
           
        }

     

    Does anybody have any clue what my problem is?

  • Next XBOX specs - MS going conservative

    @evildictaitor: XNA has been the beginning of many big titles in Xbox Live, titles that have sold over a million like Fez and Super Meat boy. It certainly gave the MS indie space a big boost, but it would be unfair to expect the same gains when compared to fully budgeted games back-up by big publishers. 

  • MPI Programming

     Yay, I figured out the problem. I'll leave it up for any curious coders that want to spot the error, if you're able to spot it, treat yourself to a cookie. 

  • MPI Programming

     Hi niners, I have a different query today, this relates to my master's work rather than my job. Not sure if anyone here is familiar with MPI but here it goes, I have this:

    MPI_Init(&argc, &argv);
      MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
      MPI_Comm_size(MPI_COMM_WORLD, &comm_sz);
    
      if(my_rank == 0) {
        for(i=1; i<=n;++i)
          a[i-1] = i-1;
    
        // Distribute                                                                                                        
        MPI_Send(a, n, MPI_INT, my_rank+1, n, MPI_COMM_WORLD);
    
      } else {
        // Receive and distribute initial values                                                                             
        MPI_Recv(a, n, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
        k = status.MPI_TAG/2;
        if(k!=0) {
          MPI_Send(a+1, k, MPI_INT, my_rank+1, k, MPI_COMM_WORLD); //pass sub-array [1..k]                                   
          MPI_Send(a+k+1, k, MPI_INT, k+my_rank+1, k, MPI_COMM_WORLD); //pass sub-array [k+1..2k+1]                          
        }
        partial = a[0];
        printf("rank: %d\tvalue: %d\n", my_rank, partial);
    
        // Carry out Prefix Sum algorithm : for 1 to log2(n)   - THIS IS WHERE IT FAILS                                                          
        j = (int)(log((float)n+1)/log((float)2));
        //printf("Log(n) = %d\n", j);                                                                                        
        for(i=0; i<j; ++i) {
          k = (int)(pow((float)2,(float)i));
          printf("**rank: %d, k=%d\n", my_rank, k);
          if(my_rank+k<=n) MPI_Send(&partial, 1, MPI_INT, my_rank+k, 0, MPI_COMM_WORLD/*, &request*/);
          if(my_rank-k>=1) {
            MPI_Recv(&value, 1 , MPI_INT, my_rank-k, 0, MPI_COMM_WORLD, &status);
            partial += value;
          }
        }
        printf("rank: %d\tpartial: %d\n", my_rank, partial);
      }
    
      MPI_Finalize();
    

    And it's deadlocking. It works about 80% of the time and the other time, it fails. I've noticed that when it fails, a process usually sends messages, ends before its receiver has received yet. Does anyone know if an MPI process can send message and finalize before message is received?

    I can't see why it's deadlocking, any ideas?