Search Results

Search found 24804 results on 993 pages for 'output parameter'.

Page 1/993 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Group method parameter or individual parameter?

    - by Nassign
    I would like to ask on method parameters design consideration. I am usually deciding between using individual variables as parameters versus grouping them to a class or dictionary as one parameter. Is there such a rule when you should use individual parameter against using a class or a dictionary to group the parameter? Individual parameter - Straight forward, strongly typed Dictionary parameter - Very extensible, like HTTP request but cannot be strongly typed. Class parameter - Extensible by adding member to the class parameter, strongly typed. I am looking for a design reference on when to use which? Note: I am not sure if this question is valid in programmers but I definitely think it would be closed in stackoverflow, If it is still not valid, please point me to the proper page.

    Read the article

  • How to associate jquery validation when only one button if there are many??

    - by Eyla
    Greetings, In my current project, I have gridview, search button, text box for search, text box, and submit button. -I should input string in the search box then click search button. -when click search button, it will retrieve all matches records then bind them to the view grid. -then when I click a record in the gridview, it should bound a field to the second text box. finally I should submit the page by clicking in submit button. where is the problem: -the problme that I'm using jquery validation plugin that will make second text box is required. -when I click search button will not allow postback until I write some thing in second text box. How can I make scond text box only do validation for required field only when click asp.net submit button. here is my code: <%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="IMAM_APPLICATION.WebForm1" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <script src="js/jquery-1.4.1-vsdoc.js" type="text/javascript"></script> <script src="js/jquery.validate.js" type="text/javascript"></script> <script src="js/js.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $("#aspnetForm").validate({ // debug: true, rules: { "<%=txtFirstName.UniqueID %>": { required: true } }, errorElement: "mydiv", wrapper: "mydiv", // a wrapper around the error message errorPlacement: function(error, element) { offset = element.offset(); error.insertBefore(element) error.addClass('message'); // add a class to the wrapper error.css('position', 'absolute'); error.css('left', offset.left + element.outerWidth()); error.css('top', offset.top - (element.height() / 2)); } }); }) </script> <div id="mydiv"> <asp:GridView ID="GridView1" runat="server" style="position:absolute; top: 280px; left: 30px; height: 240px; width: 915px;" PageSize="5" onselectedindexchanged="GridView1_SelectedIndexChanged" AutoGenerateColumns="False" DataKeyNames="idcontact_info"> <Columns> <asp:CommandField ShowSelectButton="True" InsertVisible="False" ShowCancelButton="False" /> <asp:BoundField DataField="First_Name" HeaderText="First Name" /> <asp:BoundField AccessibleHeaderText="Midle Name" DataField="Midle_Name" /> <asp:BoundField DataField="Last_Name" HeaderText="Last Name" /> <asp:BoundField DataField="Phone_home" HeaderText="Phone Home" /> <asp:BoundField DataField="cell_home" HeaderText="Mobile Home" /> <asp:BoundField DataField="phone_work" HeaderText="Phone Work" /> <asp:BoundField DataField="cell_Work" HeaderText="Mobile Work" /> <asp:BoundField DataField="Email_Home" HeaderText="Personal Home" /> <asp:BoundField DataField="Email_work" HeaderText="Work Email" /> </Columns> </asp:GridView> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="IMAM_APPLICATION.DSContactTableAdapters.contact_infoTableAdapter" UpdateMethod="Update"> <DeleteParameters> <asp:Parameter Name="Original_idcontact_info" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="Title" Type="String" /> <asp:Parameter Name="First_Name" Type="String" /> <asp:Parameter Name="Midle_Name" Type="String" /> <asp:Parameter Name="Last_Name" Type="String" /> <asp:Parameter Name="Address1_Home" Type="String" /> <asp:Parameter Name="Address2_Home" Type="String" /> <asp:Parameter Name="City_Home" Type="String" /> <asp:Parameter Name="State_Home" Type="String" /> <asp:Parameter Name="Prov_Home" Type="String" /> <asp:Parameter Name="ZipCode_Home" Type="String" /> <asp:Parameter Name="Country_Home" Type="String" /> <asp:Parameter Name="Phone_home" Type="String" /> <asp:Parameter Name="Phone_Home_Ext" Type="String" /> <asp:Parameter Name="Cell_home" Type="String" /> <asp:Parameter Name="Fax_home" Type="String" /> <asp:Parameter Name="Email_Home" Type="String" /> <asp:Parameter Name="material_status" Type="String" /> <asp:Parameter Name="DateOfBrith" Type="String" /> <asp:Parameter Name="company" Type="String" /> <asp:Parameter Name="Work_Field" Type="String" /> <asp:Parameter Name="Occupation" Type="String" /> <asp:Parameter Name="sub_Occupation" Type="String" /> <asp:Parameter Name="Other" Type="String" /> <asp:Parameter Name="Address1_work" Type="String" /> <asp:Parameter Name="Address2_work" Type="String" /> <asp:Parameter Name="City_Work" Type="String" /> <asp:Parameter Name="State_Work" Type="String" /> <asp:Parameter Name="Prov_Work" Type="String" /> <asp:Parameter Name="ZipCode_Work" Type="String" /> <asp:Parameter Name="Country_Work" Type="String" /> <asp:Parameter Name="Phone_Work" Type="String" /> <asp:Parameter Name="Phone_Work_Ext" Type="String" /> <asp:Parameter Name="Cell_Work" Type="String" /> <asp:Parameter Name="Fax_Work" Type="String" /> <asp:Parameter Name="Email_work" Type="String" /> <asp:Parameter Name="WebSite" Type="String" /> <asp:Parameter Name="Note" Type="String" /> <asp:Parameter Name="Groups" Type="String" /> <asp:Parameter Name="InterPhoneHome" Type="Int32" /> <asp:Parameter Name="InterMobileHome" Type="Int32" /> <asp:Parameter Name="InterFaxHome" Type="Int32" /> <asp:Parameter Name="InterPhoneWork" Type="Int32" /> <asp:Parameter Name="InterMobileWork" Type="Int32" /> <asp:Parameter Name="InterFaxWork" Type="Int32" /> <asp:Parameter Name="rdoPhoneHome" Type="Int32" /> <asp:Parameter Name="rdoMobileHome" Type="Int32" /> <asp:Parameter Name="rdoEmailHome" Type="Int32" /> <asp:Parameter Name="rdoPhoneWork" Type="Int32" /> <asp:Parameter Name="rdoMobileWork" Type="Int32" /> <asp:Parameter Name="rdoEmailWork" Type="Int32" /> <asp:Parameter Name="locationHome" Type="Int32" /> <asp:Parameter Name="locationWork" Type="Int32" /> <asp:Parameter Name="Original_idcontact_info" Type="Int32" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="Title" Type="String" /> <asp:Parameter Name="First_Name" Type="String" /> <asp:Parameter Name="Midle_Name" Type="String" /> <asp:Parameter Name="Last_Name" Type="String" /> <asp:Parameter Name="Address1_Home" Type="String" /> <asp:Parameter Name="Address2_Home" Type="String" /> <asp:Parameter Name="City_Home" Type="String" /> <asp:Parameter Name="State_Home" Type="String" /> <asp:Parameter Name="Prov_Home" Type="String" /> <asp:Parameter Name="ZipCode_Home" Type="String" /> <asp:Parameter Name="Country_Home" Type="String" /> <asp:Parameter Name="Phone_home" Type="String" /> <asp:Parameter Name="Phone_Home_Ext" Type="String" /> <asp:Parameter Name="Cell_home" Type="String" /> <asp:Parameter Name="Fax_home" Type="String" /> <asp:Parameter Name="Email_Home" Type="String" /> <asp:Parameter Name="material_status" Type="String" /> <asp:Parameter Name="DateOfBrith" Type="String" /> <asp:Parameter Name="company" Type="String" /> <asp:Parameter Name="Work_Field" Type="String" /> <asp:Parameter Name="Occupation" Type="String" /> <asp:Parameter Name="sub_Occupation" Type="String" /> <asp:Parameter Name="Other" Type="String" /> <asp:Parameter Name="Address1_work" Type="String" /> <asp:Parameter Name="Address2_work" Type="String" /> <asp:Parameter Name="City_Work" Type="String" /> <asp:Parameter Name="State_Work" Type="String" /> <asp:Parameter Name="Prov_Work" Type="String" /> <asp:Parameter Name="ZipCode_Work" Type="String" /> <asp:Parameter Name="Country_Work" Type="String" /> <asp:Parameter Name="Phone_Work" Type="String" /> <asp:Parameter Name="Phone_Work_Ext" Type="String" /> <asp:Parameter Name="Cell_Work" Type="String" /> <asp:Parameter Name="Fax_Work" Type="String" /> <asp:Parameter Name="Email_work" Type="String" /> <asp:Parameter Name="WebSite" Type="String" /> <asp:Parameter Name="Note" Type="String" /> <asp:Parameter Name="Groups" Type="String" /> <asp:Parameter Name="InterPhoneHome" Type="Int32" /> <asp:Parameter Name="InterMobileHome" Type="Int32" /> <asp:Parameter Name="InterFaxHome" Type="Int32" /> <asp:Parameter Name="InterPhoneWork" Type="Int32" /> <asp:Parameter Name="InterMobileWork" Type="Int32" /> <asp:Parameter Name="InterFaxWork" Type="Int32" /> <asp:Parameter Name="rdoPhoneHome" Type="Int32" /> <asp:Parameter Name="rdoMobileHome" Type="Int32" /> <asp:Parameter Name="rdoEmailHome" Type="Int32" /> <asp:Parameter Name="rdoPhoneWork" Type="Int32" /> <asp:Parameter Name="rdoMobileWork" Type="Int32" /> <asp:Parameter Name="rdoEmailWork" Type="Int32" /> <asp:Parameter Name="locationHome" Type="Int32" /> <asp:Parameter Name="locationWork" Type="Int32" /> </InsertParameters> </asp:ObjectDataSource> <asp:TextBox ID="txtSearch" runat="server" style="position:absolute; top: 560px; left: 170px;" ></asp:TextBox> <asp:Button ID="btnSearch" runat="server" Text="Search" style="position:absolute; top: 555px; left: 375px;" CausesValidation="False" onclick="btnSearch_Click"/> <asp:Label ID="Label7" runat="server" Style="position: absolute; top: 630px; left: 85px;" Text="First Name"></asp:Label> <asp:TextBox ID="txtFirstName" runat="server" Style="top: 630px; left: 185px; position: absolute; height: 22px; width: 128px"></asp:TextBox> <asp:Button ID="submit" runat="server" Text="submit" /> </div> </asp:Content>

    Read the article

  • How to associate jquery validation with only one button if there are many?

    - by Eyla
    Greetings, In my current project, I have gridview, search button, text box for search, text box, and submit button. -I should input string in the search box then click search button. -when click search button, it will retrieve all matches records then bind them to the view grid. -then when I click a record in the gridview, it should bound a field to the second text box. finally I should submit the page by clicking in submit button. where is the problem: -the problme that I'm using jquery validation plugin that will make second text box is required. -when I click search button will not allow postback until I write some thing in second text box. How can I make scond text box only do validation for required field only when click asp.net submit button. here is my code: <%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="IMAM_APPLICATION.WebForm1" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <script src="js/jquery-1.4.1-vsdoc.js" type="text/javascript"></script> <script src="js/jquery.validate.js" type="text/javascript"></script> <script src="js/js.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $("#aspnetForm").validate({ // debug: true, rules: { "<%=txtFirstName.UniqueID %>": { required: true } }, errorElement: "mydiv", wrapper: "mydiv", // a wrapper around the error message errorPlacement: function(error, element) { offset = element.offset(); error.insertBefore(element) error.addClass('message'); // add a class to the wrapper error.css('position', 'absolute'); error.css('left', offset.left + element.outerWidth()); error.css('top', offset.top - (element.height() / 2)); } }); }) </script> <div id="mydiv"> <asp:GridView ID="GridView1" runat="server" style="position:absolute; top: 280px; left: 30px; height: 240px; width: 915px;" PageSize="5" onselectedindexchanged="GridView1_SelectedIndexChanged" AutoGenerateColumns="False" DataKeyNames="idcontact_info"> <Columns> <asp:CommandField ShowSelectButton="True" InsertVisible="False" ShowCancelButton="False" /> <asp:BoundField DataField="First_Name" HeaderText="First Name" /> <asp:BoundField AccessibleHeaderText="Midle Name" DataField="Midle_Name" /> <asp:BoundField DataField="Last_Name" HeaderText="Last Name" /> <asp:BoundField DataField="Phone_home" HeaderText="Phone Home" /> <asp:BoundField DataField="cell_home" HeaderText="Mobile Home" /> <asp:BoundField DataField="phone_work" HeaderText="Phone Work" /> <asp:BoundField DataField="cell_Work" HeaderText="Mobile Work" /> <asp:BoundField DataField="Email_Home" HeaderText="Personal Home" /> <asp:BoundField DataField="Email_work" HeaderText="Work Email" /> </Columns> </asp:GridView> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="IMAM_APPLICATION.DSContactTableAdapters.contact_infoTableAdapter" UpdateMethod="Update"> <DeleteParameters> <asp:Parameter Name="Original_idcontact_info" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="Title" Type="String" /> <asp:Parameter Name="First_Name" Type="String" /> <asp:Parameter Name="Midle_Name" Type="String" /> <asp:Parameter Name="Last_Name" Type="String" /> <asp:Parameter Name="Address1_Home" Type="String" /> <asp:Parameter Name="Address2_Home" Type="String" /> <asp:Parameter Name="City_Home" Type="String" /> <asp:Parameter Name="State_Home" Type="String" /> <asp:Parameter Name="Prov_Home" Type="String" /> <asp:Parameter Name="ZipCode_Home" Type="String" /> <asp:Parameter Name="Country_Home" Type="String" /> <asp:Parameter Name="Phone_home" Type="String" /> <asp:Parameter Name="Phone_Home_Ext" Type="String" /> <asp:Parameter Name="Cell_home" Type="String" /> <asp:Parameter Name="Fax_home" Type="String" /> <asp:Parameter Name="Email_Home" Type="String" /> <asp:Parameter Name="material_status" Type="String" /> <asp:Parameter Name="DateOfBrith" Type="String" /> <asp:Parameter Name="company" Type="String" /> <asp:Parameter Name="Work_Field" Type="String" /> <asp:Parameter Name="Occupation" Type="String" /> <asp:Parameter Name="sub_Occupation" Type="String" /> <asp:Parameter Name="Other" Type="String" /> <asp:Parameter Name="Address1_work" Type="String" /> <asp:Parameter Name="Address2_work" Type="String" /> <asp:Parameter Name="City_Work" Type="String" /> <asp:Parameter Name="State_Work" Type="String" /> <asp:Parameter Name="Prov_Work" Type="String" /> <asp:Parameter Name="ZipCode_Work" Type="String" /> <asp:Parameter Name="Country_Work" Type="String" /> <asp:Parameter Name="Phone_Work" Type="String" /> <asp:Parameter Name="Phone_Work_Ext" Type="String" /> <asp:Parameter Name="Cell_Work" Type="String" /> <asp:Parameter Name="Fax_Work" Type="String" /> <asp:Parameter Name="Email_work" Type="String" /> <asp:Parameter Name="WebSite" Type="String" /> <asp:Parameter Name="Note" Type="String" /> <asp:Parameter Name="Groups" Type="String" /> <asp:Parameter Name="InterPhoneHome" Type="Int32" /> <asp:Parameter Name="InterMobileHome" Type="Int32" /> <asp:Parameter Name="InterFaxHome" Type="Int32" /> <asp:Parameter Name="InterPhoneWork" Type="Int32" /> <asp:Parameter Name="InterMobileWork" Type="Int32" /> <asp:Parameter Name="InterFaxWork" Type="Int32" /> <asp:Parameter Name="rdoPhoneHome" Type="Int32" /> <asp:Parameter Name="rdoMobileHome" Type="Int32" /> <asp:Parameter Name="rdoEmailHome" Type="Int32" /> <asp:Parameter Name="rdoPhoneWork" Type="Int32" /> <asp:Parameter Name="rdoMobileWork" Type="Int32" /> <asp:Parameter Name="rdoEmailWork" Type="Int32" /> <asp:Parameter Name="locationHome" Type="Int32" /> <asp:Parameter Name="locationWork" Type="Int32" /> <asp:Parameter Name="Original_idcontact_info" Type="Int32" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="Title" Type="String" /> <asp:Parameter Name="First_Name" Type="String" /> <asp:Parameter Name="Midle_Name" Type="String" /> <asp:Parameter Name="Last_Name" Type="String" /> <asp:Parameter Name="Address1_Home" Type="String" /> <asp:Parameter Name="Address2_Home" Type="String" /> <asp:Parameter Name="City_Home" Type="String" /> <asp:Parameter Name="State_Home" Type="String" /> <asp:Parameter Name="Prov_Home" Type="String" /> <asp:Parameter Name="ZipCode_Home" Type="String" /> <asp:Parameter Name="Country_Home" Type="String" /> <asp:Parameter Name="Phone_home" Type="String" /> <asp:Parameter Name="Phone_Home_Ext" Type="String" /> <asp:Parameter Name="Cell_home" Type="String" /> <asp:Parameter Name="Fax_home" Type="String" /> <asp:Parameter Name="Email_Home" Type="String" /> <asp:Parameter Name="material_status" Type="String" /> <asp:Parameter Name="DateOfBrith" Type="String" /> <asp:Parameter Name="company" Type="String" /> <asp:Parameter Name="Work_Field" Type="String" /> <asp:Parameter Name="Occupation" Type="String" /> <asp:Parameter Name="sub_Occupation" Type="String" /> <asp:Parameter Name="Other" Type="String" /> <asp:Parameter Name="Address1_work" Type="String" /> <asp:Parameter Name="Address2_work" Type="String" /> <asp:Parameter Name="City_Work" Type="String" /> <asp:Parameter Name="State_Work" Type="String" /> <asp:Parameter Name="Prov_Work" Type="String" /> <asp:Parameter Name="ZipCode_Work" Type="String" /> <asp:Parameter Name="Country_Work" Type="String" /> <asp:Parameter Name="Phone_Work" Type="String" /> <asp:Parameter Name="Phone_Work_Ext" Type="String" /> <asp:Parameter Name="Cell_Work" Type="String" /> <asp:Parameter Name="Fax_Work" Type="String" /> <asp:Parameter Name="Email_work" Type="String" /> <asp:Parameter Name="WebSite" Type="String" /> <asp:Parameter Name="Note" Type="String" /> <asp:Parameter Name="Groups" Type="String" /> <asp:Parameter Name="InterPhoneHome" Type="Int32" /> <asp:Parameter Name="InterMobileHome" Type="Int32" /> <asp:Parameter Name="InterFaxHome" Type="Int32" /> <asp:Parameter Name="InterPhoneWork" Type="Int32" /> <asp:Parameter Name="InterMobileWork" Type="Int32" /> <asp:Parameter Name="InterFaxWork" Type="Int32" /> <asp:Parameter Name="rdoPhoneHome" Type="Int32" /> <asp:Parameter Name="rdoMobileHome" Type="Int32" /> <asp:Parameter Name="rdoEmailHome" Type="Int32" /> <asp:Parameter Name="rdoPhoneWork" Type="Int32" /> <asp:Parameter Name="rdoMobileWork" Type="Int32" /> <asp:Parameter Name="rdoEmailWork" Type="Int32" /> <asp:Parameter Name="locationHome" Type="Int32" /> <asp:Parameter Name="locationWork" Type="Int32" /> </InsertParameters> </asp:ObjectDataSource> <asp:TextBox ID="txtSearch" runat="server" style="position:absolute; top: 560px; left: 170px;" ></asp:TextBox> <asp:Button ID="btnSearch" runat="server" Text="Search" style="position:absolute; top: 555px; left: 375px;" CausesValidation="False" onclick="btnSearch_Click"/> <asp:Label ID="Label7" runat="server" Style="position: absolute; top: 630px; left: 85px;" Text="First Name"></asp:Label> <asp:TextBox ID="txtFirstName" runat="server" Style="top: 630px; left: 185px; position: absolute; height: 22px; width: 128px"></asp:TextBox> <asp:Button ID="submit" runat="server" Text="submit" /> </div> </asp:Content>

    Read the article

  • Accessing type-parameter of a type-parameter

    - by itemState
    i would like to access, in a trait, the type-parameter of a type-parameter of that trait. without adding this "second-order" type-parameter as another "first-order" parameter to the trait. the following illustrates this problem: sealed trait A; sealed trait A1 extends A; sealed trait A2 extends A trait B[ ASpecific <: A ] { type ASpec = ASpecific } trait D[ ASpecific <: A ] extends B[ ASpecific ] trait C[ +BSpecific <: B[ _ <: A ]] { def unaryOp : C[ D[ BSpecific#ASpec ]] } def test( c: C[ B[ A1 ]]) : C[ D[ A1 ]] = c.unaryOp the test fails to compile because apparently, the c.unaryOp has a result of type C[D[A]] and not C[D[A1]], indicating that ASpec is merely a shortcut for _ <: A and does not refer to the specific type parameter. the two-type-parameter solution is simple: sealed trait A; sealed trait A1 extends A; sealed trait A2 extends A trait B[ ASpecific <: A ] trait D[ ASpecific <: A ] extends B[ ASpecific ] trait C[ ASpecific <: A, +BSpecific <: B[ ASpecific ]] { def unaryOp : C[ ASpecific, D[ ASpecific ]] } def test( c: C[ A1, B[ A1 ]]) : C[ A1, D[ A1 ]] = c.unaryOp but i don't understand why i need to clutter my source with this second, obviously redundant, parameter. is there no way to retrieve it from trait B?

    Read the article

  • Capturing and Transforming ASP.NET Output with Response.Filter

    - by Rick Strahl
    During one of my Handlers and Modules session at DevConnections this week one of the attendees asked a question that I didn’t have an immediate answer for. Basically he wanted to capture response output completely and then apply some filtering to the output – effectively injecting some additional content into the page AFTER the page had completely rendered. Specifically the output should be captured from anywhere – not just a page and have this code injected into the page. Some time ago I posted some code that allows you to capture ASP.NET Page output by overriding the Render() method, capturing the HtmlTextWriter() and reading its content, modifying the rendered data as text then writing it back out. I’ve actually used this approach on a few occasions and it works fine for ASP.NET pages. But this obviously won’t work outside of the Page class environment and it’s not really generic – you have to create a custom page class in order to handle the output capture. [updated 11/16/2009 – updated ResponseFilterStream implementation and a few additional notes based on comments] Enter Response.Filter However, ASP.NET includes a Response.Filter which can be used – well to filter output. Basically Response.Filter is a stream through which the OutputStream is piped back to the Web Server (indirectly). As content is written into the Response object, the filter stream receives the appropriate Stream commands like Write, Flush and Close as well as read operations although for a Response.Filter that’s uncommon to be hit. The Response.Filter can be programmatically replaced at runtime which allows you to effectively intercept all output generation that runs through ASP.NET. A common Example: Dynamic GZip Encoding A rather common use of Response.Filter hooking up code based, dynamic  GZip compression for requests which is dead simple by applying a GZipStream (or DeflateStream) to Response.Filter. The following generic routines can be used very easily to detect GZip capability of the client and compress response output with a single line of code and a couple of library helper routines: WebUtils.GZipEncodePage(); which is handled with a few lines of reusable code and a couple of static helper methods: /// <summary> ///Sets up the current page or handler to use GZip through a Response.Filter ///IMPORTANT:  ///You have to call this method before any output is generated! /// </summary> public static void GZipEncodePage() {     HttpResponse Response = HttpContext.Current.Response;     if(IsGZipSupported())     {         stringAcceptEncoding = HttpContext.Current.Request.Headers["Accept-Encoding"];         if(AcceptEncoding.Contains("deflate"))         {             Response.Filter = newSystem.IO.Compression.DeflateStream(Response.Filter,                                        System.IO.Compression.CompressionMode.Compress);             Response.AppendHeader("Content-Encoding", "deflate");         }         else        {             Response.Filter = newSystem.IO.Compression.GZipStream(Response.Filter,                                       System.IO.Compression.CompressionMode.Compress);             Response.AppendHeader("Content-Encoding", "gzip");                            }     }     // Allow proxy servers to cache encoded and unencoded versions separately    Response.AppendHeader("Vary", "Content-Encoding"); } /// <summary> /// Determines if GZip is supported /// </summary> /// <returns></returns> public static bool IsGZipSupported() { string AcceptEncoding = HttpContext.Current.Request.Headers["Accept-Encoding"]; if (!string.IsNullOrEmpty(AcceptEncoding) && (AcceptEncoding.Contains("gzip") || AcceptEncoding.Contains("deflate"))) return true; return false; } GZipStream and DeflateStream are streams that are assigned to Response.Filter and by doing so apply the appropriate compression on the active Response. Response.Filter content is chunked So to implement a Response.Filter effectively requires only that you implement a custom stream and handle the Write() method to capture Response output as it’s written. At first blush this seems very simple – you capture the output in Write, transform it and write out the transformed content in one pass. And that indeed works for small amounts of content. But you see, the problem is that output is written in small buffer chunks (a little less than 16k it appears) rather than just a single Write() statement into the stream, which makes perfect sense for ASP.NET to stream data back to IIS in smaller chunks to minimize memory usage en route. Unfortunately this also makes it a more difficult to implement any filtering routines since you don’t directly get access to all of the response content which is problematic especially if those filtering routines require you to look at the ENTIRE response in order to transform or capture the output as is needed for the solution the gentleman in my session asked for. So in order to address this a slightly different approach is required that basically captures all the Write() buffers passed into a cached stream and then making the stream available only when it’s complete and ready to be flushed. As I was thinking about the implementation I also started thinking about the few instances when I’ve used Response.Filter implementations. Each time I had to create a new Stream subclass and create my custom functionality but in the end each implementation did the same thing – capturing output and transforming it. I thought there should be an easier way to do this by creating a re-usable Stream class that can handle stream transformations that are common to Response.Filter implementations. Creating a semi-generic Response Filter Stream Class What I ended up with is a ResponseFilterStream class that provides a handful of Events that allow you to capture and/or transform Response content. The class implements a subclass of Stream and then overrides Write() and Flush() to handle capturing and transformation operations. By exposing events it’s easy to hook up capture or transformation operations via single focused methods. ResponseFilterStream exposes the following events: CaptureStream, CaptureString Captures the output only and provides either a MemoryStream or String with the final page output. Capture is hooked to the Flush() operation of the stream. TransformStream, TransformString Allows you to transform the complete response output with events that receive a MemoryStream or String respectively and can you modify the output then return it back as a return value. The transformed output is then written back out in a single chunk to the response output stream. These events capture all output internally first then write the entire buffer into the response. TransformWrite, TransformWriteString Allows you to transform the Response data as it is written in its original chunk size in the Stream’s Write() method. Unlike TransformStream/TransformString which operate on the complete output, these events only see the current chunk of data written. This is more efficient as there’s no caching involved, but can cause problems due to searched content splitting over multiple chunks. Using this implementation, creating a custom Response.Filter transformation becomes as simple as the following code. To hook up the Response.Filter using the MemoryStream version event: ResponseFilterStream filter = new ResponseFilterStream(Response.Filter); filter.TransformStream += filter_TransformStream; Response.Filter = filter; and the event handler to do the transformation: MemoryStream filter_TransformStream(MemoryStream ms) { Encoding encoding = HttpContext.Current.Response.ContentEncoding; string output = encoding.GetString(ms.ToArray()); output = FixPaths(output); ms = new MemoryStream(output.Length); byte[] buffer = encoding.GetBytes(output); ms.Write(buffer,0,buffer.Length); return ms; } private string FixPaths(string output) { string path = HttpContext.Current.Request.ApplicationPath; // override root path wonkiness if (path == "/") path = ""; output = output.Replace("\"~/", "\"" + path + "/").Replace("'~/", "'" + path + "/"); return output; } The idea of the event handler is that you can do whatever you want to the stream and return back a stream – either the same one that’s been modified or a brand new one – which is then sent back to as the final response. The above code can be simplified even more by using the string version events which handle the stream to string conversions for you: ResponseFilterStream filter = new ResponseFilterStream(Response.Filter); filter.TransformString += filter_TransformString; Response.Filter = filter; and the event handler to do the transformation calling the same FixPaths method shown above: string filter_TransformString(string output) { return FixPaths(output); } The events for capturing output and capturing and transforming chunks work in a very similar way. By using events to handle the transformations ResponseFilterStream becomes a reusable component and we don’t have to create a new stream class or subclass an existing Stream based classed. By the way, the example used here is kind of a cool trick which transforms “~/” expressions inside of the final generated HTML output – even in plain HTML controls not HTML controls – and transforms them into the appropriate application relative path in the same way that ResolveUrl would do. So you can write plain old HTML like this: <a href=”~/default.aspx”>Home</a>  and have it turned into: <a href=”/myVirtual/default.aspx”>Home</a>  without having to use an ASP.NET control like Hyperlink or Image or having to constantly use: <img src=”<%= ResolveUrl(“~/images/home.gif”) %>” /> in MVC applications (which frankly is one of the most annoying things about MVC especially given the path hell that extension-less and endpoint-less URLs impose). I can’t take credit for this idea. While discussing the Response.Filter issues on Twitter a hint from Dylan Beattie who pointed me at one of his examples which does something similar. I thought the idea was cool enough to use an example for future demos of Response.Filter functionality in ASP.NET next I time I do the Modules and Handlers talk (which was great fun BTW). How practical this is is debatable however since there’s definitely some overhead to using a Response.Filter in general and especially on one that caches the output and the re-writes it later. Make sure to test for performance anytime you use Response.Filter hookup and make sure it' doesn’t end up killing perf on you. You’ve been warned :-}. How does ResponseFilterStream work? The big win of this implementation IMHO is that it’s a reusable  component – so for implementation there’s no new class, no subclassing – you simply attach to an event to implement an event handler method with a straight forward signature to retrieve the stream or string you’re interested in. The implementation is based on a subclass of Stream as is required in order to handle the Response.Filter requirements. What’s different than other implementations I’ve seen in various places is that it supports capturing output as a whole to allow retrieving the full response output for capture or modification. The exception are the TransformWrite and TransformWrite events which operate only active chunk of data written by the Response. For captured output, the Write() method captures output into an internal MemoryStream that is cached until writing is complete. So Write() is called when ASP.NET writes to the Response stream, but the filter doesn’t pass on the Write immediately to the filter’s internal stream. The data is cached and only when the Flush() method is called to finalize the Stream’s output do we actually send the cached stream off for transformation (if the events are hooked up) and THEN finally write out the returned content in one big chunk. Here’s the implementation of ResponseFilterStream: /// <summary> /// A semi-generic Stream implementation for Response.Filter with /// an event interface for handling Content transformations via /// Stream or String. /// <remarks> /// Use with care for large output as this implementation copies /// the output into a memory stream and so increases memory usage. /// </remarks> /// </summary> public class ResponseFilterStream : Stream { /// <summary> /// The original stream /// </summary> Stream _stream; /// <summary> /// Current position in the original stream /// </summary> long _position; /// <summary> /// Stream that original content is read into /// and then passed to TransformStream function /// </summary> MemoryStream _cacheStream = new MemoryStream(5000); /// <summary> /// Internal pointer that that keeps track of the size /// of the cacheStream /// </summary> int _cachePointer = 0; /// <summary> /// /// </summary> /// <param name="responseStream"></param> public ResponseFilterStream(Stream responseStream) { _stream = responseStream; } /// <summary> /// Determines whether the stream is captured /// </summary> private bool IsCaptured { get { if (CaptureStream != null || CaptureString != null || TransformStream != null || TransformString != null) return true; return false; } } /// <summary> /// Determines whether the Write method is outputting data immediately /// or delaying output until Flush() is fired. /// </summary> private bool IsOutputDelayed { get { if (TransformStream != null || TransformString != null) return true; return false; } } /// <summary> /// Event that captures Response output and makes it available /// as a MemoryStream instance. Output is captured but won't /// affect Response output. /// </summary> public event Action<MemoryStream> CaptureStream; /// <summary> /// Event that captures Response output and makes it available /// as a string. Output is captured but won't affect Response output. /// </summary> public event Action<string> CaptureString; /// <summary> /// Event that allows you transform the stream as each chunk of /// the output is written in the Write() operation of the stream. /// This means that that it's possible/likely that the input /// buffer will not contain the full response output but only /// one of potentially many chunks. /// /// This event is called as part of the filter stream's Write() /// operation. /// </summary> public event Func<byte[], byte[]> TransformWrite; /// <summary> /// Event that allows you to transform the response stream as /// each chunk of bytep[] output is written during the stream's write /// operation. This means it's possibly/likely that the string /// passed to the handler only contains a portion of the full /// output. Typical buffer chunks are around 16k a piece. /// /// This event is called as part of the stream's Write operation. /// </summary> public event Func<string, string> TransformWriteString; /// <summary> /// This event allows capturing and transformation of the entire /// output stream by caching all write operations and delaying final /// response output until Flush() is called on the stream. /// </summary> public event Func<MemoryStream, MemoryStream> TransformStream; /// <summary> /// Event that can be hooked up to handle Response.Filter /// Transformation. Passed a string that you can modify and /// return back as a return value. The modified content /// will become the final output. /// </summary> public event Func<string, string> TransformString; protected virtual void OnCaptureStream(MemoryStream ms) { if (CaptureStream != null) CaptureStream(ms); } private void OnCaptureStringInternal(MemoryStream ms) { if (CaptureString != null) { string content = HttpContext.Current.Response.ContentEncoding.GetString(ms.ToArray()); OnCaptureString(content); } } protected virtual void OnCaptureString(string output) { if (CaptureString != null) CaptureString(output); } protected virtual byte[] OnTransformWrite(byte[] buffer) { if (TransformWrite != null) return TransformWrite(buffer); return buffer; } private byte[] OnTransformWriteStringInternal(byte[] buffer) { Encoding encoding = HttpContext.Current.Response.ContentEncoding; string output = OnTransformWriteString(encoding.GetString(buffer)); return encoding.GetBytes(output); } private string OnTransformWriteString(string value) { if (TransformWriteString != null) return TransformWriteString(value); return value; } protected virtual MemoryStream OnTransformCompleteStream(MemoryStream ms) { if (TransformStream != null) return TransformStream(ms); return ms; } /// <summary> /// Allows transforming of strings /// /// Note this handler is internal and not meant to be overridden /// as the TransformString Event has to be hooked up in order /// for this handler to even fire to avoid the overhead of string /// conversion on every pass through. /// </summary> /// <param name="responseText"></param> /// <returns></returns> private string OnTransformCompleteString(string responseText) { if (TransformString != null) TransformString(responseText); return responseText; } /// <summary> /// Wrapper method form OnTransformString that handles /// stream to string and vice versa conversions /// </summary> /// <param name="ms"></param> /// <returns></returns> internal MemoryStream OnTransformCompleteStringInternal(MemoryStream ms) { if (TransformString == null) return ms; //string content = ms.GetAsString(); string content = HttpContext.Current.Response.ContentEncoding.GetString(ms.ToArray()); content = TransformString(content); byte[] buffer = HttpContext.Current.Response.ContentEncoding.GetBytes(content); ms = new MemoryStream(); ms.Write(buffer, 0, buffer.Length); //ms.WriteString(content); return ms; } /// <summary> /// /// </summary> public override bool CanRead { get { return true; } } public override bool CanSeek { get { return true; } } /// <summary> /// /// </summary> public override bool CanWrite { get { return true; } } /// <summary> /// /// </summary> public override long Length { get { return 0; } } /// <summary> /// /// </summary> public override long Position { get { return _position; } set { _position = value; } } /// <summary> /// /// </summary> /// <param name="offset"></param> /// <param name="direction"></param> /// <returns></returns> public override long Seek(long offset, System.IO.SeekOrigin direction) { return _stream.Seek(offset, direction); } /// <summary> /// /// </summary> /// <param name="length"></param> public override void SetLength(long length) { _stream.SetLength(length); } /// <summary> /// /// </summary> public override void Close() { _stream.Close(); } /// <summary> /// Override flush by writing out the cached stream data /// </summary> public override void Flush() { if (IsCaptured && _cacheStream.Length > 0) { // Check for transform implementations _cacheStream = OnTransformCompleteStream(_cacheStream); _cacheStream = OnTransformCompleteStringInternal(_cacheStream); OnCaptureStream(_cacheStream); OnCaptureStringInternal(_cacheStream); // write the stream back out if output was delayed if (IsOutputDelayed) _stream.Write(_cacheStream.ToArray(), 0, (int)_cacheStream.Length); // Clear the cache once we've written it out _cacheStream.SetLength(0); } // default flush behavior _stream.Flush(); } /// <summary> /// /// </summary> /// <param name="buffer"></param> /// <param name="offset"></param> /// <param name="count"></param> /// <returns></returns> public override int Read(byte[] buffer, int offset, int count) { return _stream.Read(buffer, offset, count); } /// <summary> /// Overriden to capture output written by ASP.NET and captured /// into a cached stream that is written out later when Flush() /// is called. /// </summary> /// <param name="buffer"></param> /// <param name="offset"></param> /// <param name="count"></param> public override void Write(byte[] buffer, int offset, int count) { if ( IsCaptured ) { // copy to holding buffer only - we'll write out later _cacheStream.Write(buffer, 0, count); _cachePointer += count; } // just transform this buffer if (TransformWrite != null) buffer = OnTransformWrite(buffer); if (TransformWriteString != null) buffer = OnTransformWriteStringInternal(buffer); if (!IsOutputDelayed) _stream.Write(buffer, offset, buffer.Length); } } The key features are the events and corresponding OnXXX methods that handle the event hookups, and the Write() and Flush() methods of the stream implementation. All the rest of the members tend to be plain jane passthrough stream implementation code without much consequence. I do love the way Action<t> and Func<T> make it so easy to create the event signatures for the various events – sweet. A few Things to consider Performance Response.Filter is not great for performance in general as it adds another layer of indirection to the ASP.NET output pipeline, and this implementation in particular adds a memory hit as it basically duplicates the response output into the cached memory stream which is necessary since you may have to look at the entire response. If you have large pages in particular this can cause potentially serious memory pressure in your server application. So be careful of wholesale adoption of this (or other) Response.Filters. Make sure to do some performance testing to ensure it’s not killing your app’s performance. Response.Filter works everywhere A few questions came up in comments and discussion as to capturing ALL output hitting the site and – yes you can definitely do that by assigning a Response.Filter inside of a module. If you do this however you’ll want to be very careful and decide which content you actually want to capture especially in IIS 7 which passes ALL content – including static images/CSS etc. through the ASP.NET pipeline. So it is important to filter only on what you’re looking for – like the page extension or maybe more effectively the Response.ContentType. Response.Filter Chaining Originally I thought that filter chaining doesn’t work at all due to a bug in the stream implementation code. But it’s quite possible to assign multiple filters to the Response.Filter property. So the following actually works to both compress the output and apply the transformed content: WebUtils.GZipEncodePage(); ResponseFilterStream filter = new ResponseFilterStream(Response.Filter); filter.TransformString += filter_TransformString; Response.Filter = filter; However the following does not work resulting in invalid content encoding errors: ResponseFilterStream filter = new ResponseFilterStream(Response.Filter); filter.TransformString += filter_TransformString; Response.Filter = filter; WebUtils.GZipEncodePage(); In other words multiple Response filters can work together but it depends entirely on the implementation whether they can be chained or in which order they can be chained. In this case running the GZip/Deflate stream filters apparently relies on the original content length of the output and chokes when the content is modified. But if attaching the compression first it works fine as unintuitive as that may seem. Resources Download example code Capture Output from ASP.NET Pages © Rick Strahl, West Wind Technologies, 2005-2010Posted in ASP.NET  

    Read the article

  • Choose an output audio device different from the default on WMP 11

    - by GetFree
    I like to play my music through a Hi-Fi audio equipment and everything else (like windows sounds, web videos and such) through my default PC speakers. On WIndows XP I had WMP 9 and I could do that with no problems since I can choose what audio device (which sound card) to use, and that selection is for WMP only, which can be different from Windows' default audio device. But now that I have Windows Vista and WMP 11 I cannot longer choose an audio device just for WMP, or at least I can't find a way to do it (the control in the options dialog is no longer there). Was this useful feature really removed from WMP 11? or there is some other way to do it?

    Read the article

  • Redirect output to file

    - by Algorist
    Hi, I have a shell script which is currently running and was running from past 8 hours. It will complete only by tomorrow evening. At the end of the program, it will print 2 million words to standard output. I am running the program on the screen. I forgot to redirect the output to a file. I know I won't be able to copy the data from the window. Is there a way to output the command to a file. I don't want to restart the program. Any thoughts?? Thank you. Bala

    Read the article

  • System.Diagnostics.Process to run processes, send parameters and get output

    - by Lily
    Hi, I am trying to call a process using System.Diagnostics.Process, send it a parameter, just for the sake of trying it out i am sending "-h" which should generate a list of help options and I need the output. So far I have tried, ProcessStartInfo startInfo = new ProcessStartInfo("C:\\agfl\\agfl.exe"); startInfo.WindowStyle = ProcessWindowStyle.Normal; startInfo.CreateNoWindow = false; startInfo.Arguments = "-h"; Process.Start(startInfo); Any help please? Thanks :)

    Read the article

  • sudo & redirect output

    - by Khaled
    I have a small question regarding using sudo with output redirect >. To enable IP forwrding, someone can use the command: $ echo 1 > /proc/sys/net/ipv4/ip_forward Executing this command will give permission denied as it requires root privileges. However, executing the same command with sudo gives also permission denied error! It seems that output redirect > does not inherit the permissions of the preceding command echo. Is this right? As a workaround I do: $ echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward Is this the best way to do it? Am I missing something? Please, note that this is an example and it applies to all commands that use output redirect.

    Read the article

  • Shortcut to switch between Analog Stereo output & HDMI audio output

    - by iJeeves
    To switch to HDMI audio output (of monitor) and back to normal audio output from system audio jack (for headphones, as my monitor doesn't have audio out), I find myself opening up sound preferences and selecting the right channel everytime. Is there any way I can create a toggle button in the panel or assign some shortcut key to toggle since I do the switching so often. :aplay -l **** List of PLAYBACK Hardware Devices **** card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: Intel [HDA Intel], device 3: HDMI 0 [HDMI 0] Subdevices: 0/1 Subdevice #0: subdevice #0 card 0: Intel [HDA Intel], device 7: STAC92xx Digital [STAC92xx Digital] Subdevices: 1/1 Subdevice #0: subdevice #0

    Read the article

  • Oracle parameter array binding from c# executed parallel and serial on different servers

    - by redir_dev_nut
    I have two Oracle 9i 64 bit servers, dev and prod. Calling a procedure from a c# app with parameter array binding, prod executes the procedure simultaneously for each value in the parameter array, but dev executes for each value serially. So, if the sproc does: select count(*) into cnt from mytable where id = 123; if cnt = 0 then insert into mytable (id) values (123); end if; Assuming the table initially does not have an id = 123 row. Dev gets cnt = 0 for the first array parameter value, then 1 for each of the subsequent. Prod gets cnt = 0 for all array parameter values and inserts id 123 for each. Is this a configuration difference, an illusion due to speed difference, something else?

    Read the article

  • Bash: trim a parameter from both ends

    - by Andrey Kazak
    Greetings! This are well know Bash parameter expansion patterns: ${parameter#word}, ${parameter##word} and ${parameter%word}, ${parameter%%word} I need to chop one part from the beginning and anoter part from the trailing of the parameter. Could you advice something for me please?

    Read the article

  • How to change SMP affinity of an IRQ on Ubuntu domU inside Xen XCP?

    - by Alexander Gladysh
    I'd like to change IRQ SMP affinity for reasons, outlined in this question: CPU0 is swamped with eth1 interrupts But I can't — I see Input/output error when I try to write to /proc/irq/*/smp_affinity. Please point me to the HOWTO on the matter. (A formal reference on /proc/irq/*/ would be cool as well.) Gory details: Note that this is a VM inside an Ubuntu-based Xen XCP host. $ uname -a Linux MYHOST 2.6.38-15-virtual #59-Ubuntu SMP Fri Apr 27 16:40:18 UTC 2012 i686 i686 i386 GNU/Linux $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 11.04 Release: 11.04 Codename: natty $ sudo cat /proc/irq/*/smp_affinity 01 01 01 01 01 80 80 80 80 80 80 40 40 40 40 40 40 20 20 20 20 20 20 10 10 10 10 10 10 08 08 08 08 08 08 04 04 04 04 04 04 02 02 02 02 02 02 01 01 01 01 01 01 Update. The error details: $ N=$(grep -c processor /proc/cpuinfo) $ echo $N 8 $ printf %x $((2**N-1)) ff $ printf %x $((2**N-1)) | sudo tee /proc/irq/*/smp_affinity fftee: /proc/irq/288/smp_affinity: Input/output error tee: /proc/irq/289/smp_affinity: Input/output error tee: /proc/irq/290/smp_affinity: Input/output error tee: /proc/irq/291/smp_affinity: Input/output error tee: /proc/irq/292/smp_affinity: Input/output error tee: /proc/irq/293/smp_affinity: Input/output error tee: /proc/irq/294/smp_affinity: Input/output error tee: /proc/irq/295/smp_affinity: Input/output error tee: /proc/irq/296/smp_affinity: Input/output error tee: /proc/irq/297/smp_affinity: Input/output error tee: /proc/irq/298/smp_affinity: Input/output error tee: /proc/irq/299/smp_affinity: Input/output error tee: /proc/irq/300/smp_affinity: Input/output error tee: /proc/irq/301/smp_affinity: Input/output error tee: /proc/irq/302/smp_affinity: Input/output error tee: /proc/irq/303/smp_affinity: Input/output error tee: /proc/irq/304/smp_affinity: Input/output error tee: /proc/irq/305/smp_affinity: Input/output error tee: /proc/irq/306/smp_affinity: Input/output error tee: /proc/irq/307/smp_affinity: Input/output error tee: /proc/irq/308/smp_affinity: Input/output error tee: /proc/irq/309/smp_affinity: Input/output error tee: /proc/irq/310/smp_affinity: Input/output error tee: /proc/irq/311/smp_affinity: Input/output error tee: /proc/irq/312/smp_affinity: Input/output error tee: /proc/irq/313/smp_affinity: Input/output error tee: /proc/irq/314/smp_affinity: Input/output error tee: /proc/irq/315/smp_affinity: Input/output error tee: /proc/irq/316/smp_affinity: Input/output error tee: /proc/irq/317/smp_affinity: Input/output error tee: /proc/irq/318/smp_affinity: Input/output error tee: /proc/irq/319/smp_affinity: Input/output error tee: /proc/irq/320/smp_affinity: Input/output error tee: /proc/irq/321/smp_affinity: Input/output error tee: /proc/irq/322/smp_affinity: Input/output error tee: /proc/irq/323/smp_affinity: Input/output error tee: /proc/irq/324/smp_affinity: Input/output error tee: /proc/irq/325/smp_affinity: Input/output error tee: /proc/irq/326/smp_affinity: Input/output error tee: /proc/irq/327/smp_affinity: Input/output error tee: /proc/irq/328/smp_affinity: Input/output error tee: /proc/irq/329/smp_affinity: Input/output error tee: /proc/irq/330/smp_affinity: Input/output error tee: /proc/irq/331/smp_affinity: Input/output error tee: /proc/irq/332/smp_affinity: Input/output error tee: /proc/irq/333/smp_affinity: Input/output error tee: /proc/irq/334/smp_affinity: Input/output error tee: /proc/irq/335/smp_affinity: Input/output error Update. irqbalance is running: $ sudo service irqbalance status irqbalance start/running, process 560

    Read the article

  • input / output error, drives randomly refusing to read / write

    - by ILMV
    I have an issue with one of our servers running Ubuntu 10.04, it is running BackupPC and collects backups from various machines / servers around the building. On the 8th minute (12:08, 12:18, 12:28 etc) the backups are transferred to an external hard drive, we have three and rotate one drive for another everyday. The problem we are having is we are randomly experiencing input / output errors, when this happens you cannot read / write to the drive, it hasn't unmounted so I can cd to the mount point /media/backup1. The drives are not faulty as it's happening on all of them, so I'm at a loss as to what the problem could be, here is an example of the many errors we get: gzip: stdout: Input/output error /var/lib/backuppc/backuppc_offline: line 47: /media/backup1/Tue/offline.log: Input/output error ls: cannot access /media/backup1/Tue/incr_1083_host1.something.co.uk.tar.gz: Input/output error ls: cannot access /media/backup1/Tue/incr_1088_host1.something.co.uk.tar.gz: Input/output error ls: cannot access /media/backup1/Tue/incr_1089_host1.something.co.uk.tar.gz: Input/output error ls: cannot access /media/backup1/Tue/incr_1090_host1.something.co.uk.tar.gz: Input/output error /var/lib/backuppc/backuppc_offline: line 39: /media/backup1/Tue/offline.log: Input/output error /var/lib/backuppc/backuppc_offline: line 44: /media/backup1/Tue/offline.log: Input/output error /var/lib/backuppc/backuppc_offline: line 45: /media/backup1/Tue/incr_1090_host1.something.co.uk.tar.gz: Input/output error /var/lib/backuppc/backuppc_offline: line 47: /media/backup1/Tue/offline.log: Input/output error ls: cannot access /media/backup1/Tue/incr_591_tech2.something.co.uk.tar.gz: Input/output error /var/lib/backuppc/backuppc_offline: line 44: /media/backup1/Tue/offline.log: Input/output error /var/lib/backuppc/backuppc_offline: line 45: /media/backup1/Tue/incr_591_tech2.something.co.uk.tar.gz: Input/output error /var/lib/backuppc/backuppc_offline: line 47: /media/backup1/Tue/offline.log: Input/output error ls: cannot access /media/backup1/Tue/incr_592_tech3.something.co.uk.tar.gz: Input/output error ls: cannot access /media/backup1/Tue/incr_593_tech3.something.co.uk.tar.gz: Input/output error /var/lib/backuppc/backuppc_offline: line 44: /media/backup1/Tue/offline.log: Input/output error /var/lib/backuppc/backuppc_offline: line 45: /media/backup1/Tue/incr_593_tech3.something.co.uk.tar.gz: Input/output error /var/lib/backuppc/backuppc_offline: line 47: /media/backup1/Tue/offline.log: Input/output error EDIT » Resolved So it turns out Quamis was right, even though I didn't think it was possible it was actually a problem with the drive. You see we have three drives all formatted to ext2, on two of them we were getting I/O errors frequently, I cam back to Quamis' answer and discovered the fsck command, so ran it against the problems drives: fsck /dev/sdb1 This found and fixed a load of problems on the drive, most probably caused by power outages / unsafe removal of drives etc, as the drives are in the xt2 format they aren't journalled and thus aren't protected against such issues. Drives are now working beautifully, thanks all! :D

    Read the article

  • Set default system audio output port (for all accounts)

    - by Ludwik Trammer
    The default output audio port Ubuntu doesn't work on my system. It should be "Analog Mono Output/Amplifier", instead of "Analog Output/Amplifier". I can easily change that in sound preferences, just by choosing the right port in the "Output" tab. The problem is this would only apply to a single account, and I would like to change it system-wide, so it applies to all accounts on the system (I have more than 100 users...). I'm after 2 hours of Googling, so any help would be appreciated.

    Read the article

  • Can output from OutputDebugString be viewed in VisualStudio's output window

    - by wageoghe
    I am using C# and VS2010. When I use OutputDebugString to write debug information, should it show up in the output window? I can see the output from OutputDebugString in DebugView, but I thought I would see it in Visual Studio's Output window. I have looked under Tools-Options-Debugging-General and the output is NOT being redirected to the Immediate window. I have also looked under Tools-Options-Debugging-Output Window and all General Output Settings are set to "On". Finally, I have used the drop-down list in the Output window to specify that Debug messages should appear. If I change Tools-Options-Debugging-General to redirect the output to the Immediate window, the OutputDebugString messages do not appear in the immediate window. Here is my entire test program: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; using System.Diagnostics; namespace OutputDebugString { class Program { [DllImport("kernel32.dll", CharSet = CharSet.Auto)] public static extern void OutputDebugString(string message); static void Main(string[] args) { Console.WriteLine("Main - Enter - Console.WriteLine"); Debug.WriteLine("Main - Enter - Debug.WriteLine"); OutputDebugString("Main - Enter - OutputDebugString"); OutputDebugString("Main - Exit - OutputDebugString"); Debug.WriteLine("Main - Exit - Debug.WriteLine"); Console.WriteLine("Main - Exit - Console.WriteLine"); } } } If I run within the debugger, the Debug.WriteLine output does show up in the output window, but the OutputDebugString output does not. If I run from a console window, both Debug.WriteLine and OutputDebugString show up in DebugView. Why doesn't the OutputDebugString output ever show up in the output window? Ultimately, my intent is not to write a lot of debug output with OutputDebugString, rather I will use System.Diagnostics or NLog or something similar. I am just trying to find out, if I configure a logging platform to write to OutputDebugString, will the output be visible from within the debugger. Edit: I went back to my original program (not the simple test above) which uses TraceSources and TraceListeners configured via the app.config file. If I configure the trace sources to write to the System.Diagnostics.DefaultTraceListener (which is documented as writing to OutputDebugString), then the trace source output DOES go to the debug window. However, lines that write directly with OutputDebugString (such as in my simple example) DO NOT go to the debug window. Also, if I use a different TraceListener that writes to OutputDebugString (I got one from Ukadc.Diagnostics at codeplex), that output DOES NOT go to the debug window. Note that I have seen these questions but they did not provide a working solution: here and here

    Read the article

  • DVI to VGA adapter only working in one output

    - by Tom Jenkinson
    I have a AMD Radeon HD 6800 Series graphics card which has 2 DVI outputs. I tried to set it up with 2 monitors which both have vga connectors on the end and used 2 dvi to vga adapters like these. http://www.tvcables.co.uk/images/items/vga-to-dvi.jpg For some reason nothing would reach the monitor, it would remain in standby, if it was plugged into the second output. I tried all the different combinations of cables, adapters and the 2 monitors but whichever monitor that was plugged into the second output wouldn't work. I then randomly decided to plug a different monitor into the second output which has a dvi connector on the end so there was no need for an adapter and plugged it in and it worked! Does anyone know why the second output on the graphics card won't work with a dvi to vga adapter (and the first output will)? I'm really confused! Thanks

    Read the article

  • C#: No value given for one or more required parameter with FormView

    - by Vinzcent
    Hey, I am using a FormView and when I want to update something I have edited, I always get this error: No value given for one or more required parameters. I use a SQLDataSource in combination with a FormView This is the code of my SQLDataSource <asp:SqlDataSource ID="sqldsLokaalPrinters" runat="server" ConnectionString="<%$ ConnectionStrings:connRand2 %>" DeleteCommand="DELETE FROM [tblComputers] WHERE (([tblArtveldenr] = ?) OR ([tblArtveldenr] IS NULL AND ? IS NULL))" InsertCommand="INSERT INTO [tblComputers] ([tblArtveldenr], [tblNaam], [tblCLokaal_id], [tblPositie], [tblSerienr], [tblTCPIP], [tblFabrikant], [tblModel], [tblProcessor], [tblSnelheid], [tblKleur], [tblGeheugen], [tblHarddisk], [tblZip], [tblCD], [tblDVD], [tblNetwerk], [tblFirewire], [tblAanschafdatum], [tblCLeverabcierNr], [tblScherm], [tblLaptop]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ProviderName="<%$ ConnectionStrings:connRand2.ProviderName %>" SelectCommand="SELECT * FROM [tblComputers] WHERE ([tblCLokaal_id] = ?)" UpdateCommand="UPDATE [tblComputers] SET [tblNaam] = ?, [tblCLokaal_id] = ?, [tblPositie] = ?, [tblSerienr] = ?, [tblTCPIP] = ?, [tblFabrikant] = ?, [tblModel] = ?, [tblProcessor] = ?, [tblSnelheid] = ?, [tblKleur] = ?, [tblGeheugen] = ?, [tblHarddisk] = ?, [tblZip] = ?, [tblCD] = ?, [tblDVD] = ?, [tblNetwerk] = ?, [tblFirewire] = ?, [tblAanschafdatum] = ?, [tblCLeverabcierNr] = ?, [tblScherm] = ?, [tblLaptop] = ? WHERE (([tblArtveldenr] = ?) OR ([tblArtveldenr] IS NULL AND ? IS NULL))"> <SelectParameters> <asp:SessionParameter Name="tblCLokaal_id" SessionField="lokaalID" Type="Int16" /> </SelectParameters> <DeleteParameters> <asp:Parameter Name="tblArtveldenr" Type="String" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="tblNaam" Type="String" /> <asp:Parameter Name="tblCLokaal_id" Type="Int16" /> <asp:Parameter Name="tblPositie" Type="Int32" /> <asp:Parameter Name="tblSerienr" Type="String" /> <asp:Parameter Name="tblTCPIP" Type="String" /> <asp:Parameter Name="tblFabrikant" Type="String" /> <asp:Parameter Name="tblModel" Type="String" /> <asp:Parameter Name="tblProcessor" Type="String" /> <asp:Parameter Name="tblSnelheid" Type="Int32" /> <asp:Parameter Name="tblKleur" Type="String" /> <asp:Parameter Name="tblGeheugen" Type="Int32" /> <asp:Parameter Name="tblHarddisk" Type="Double" /> <asp:Parameter Name="tblZip" Type="String" /> <asp:Parameter Name="tblCD" Type="String" /> <asp:Parameter Name="tblDVD" Type="String" /> <asp:Parameter Name="tblNetwerk" Type="String" /> <asp:Parameter Name="tblFirewire" Type="Int32" /> <asp:Parameter Name="tblAanschafdatum" Type="DateTime" /> <asp:Parameter Name="tblCLeverabcierNr" Type="Int32" /> <asp:Parameter Name="tblScherm" Type="String" /> <asp:Parameter Name="tblLaptop" Type="Boolean" /> <asp:Parameter Name="tblArtveldenr" Type="String" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="tblArtveldenr" Type="String" /> <asp:Parameter Name="tblNaam" Type="String" /> <asp:Parameter Name="tblCLokaal_id" Type="Int16" /> <asp:Parameter Name="tblPositie" Type="Int32" /> <asp:Parameter Name="tblSerienr" Type="String" /> <asp:Parameter Name="tblTCPIP" Type="String" /> <asp:Parameter Name="tblFabrikant" Type="String" /> <asp:Parameter Name="tblModel" Type="String" /> <asp:Parameter Name="tblProcessor" Type="String" /> <asp:Parameter Name="tblSnelheid" Type="Int32" /> <asp:Parameter Name="tblKleur" Type="String" /> <asp:Parameter Name="tblGeheugen" Type="Int32" /> <asp:Parameter Name="tblHarddisk" Type="Double" /> <asp:Parameter Name="tblZip" Type="String" /> <asp:Parameter Name="tblCD" Type="String" /> <asp:Parameter Name="tblDVD" Type="String" /> <asp:Parameter Name="tblNetwerk" Type="String" /> <asp:Parameter Name="tblFirewire" Type="Int32" /> <asp:Parameter Name="tblAanschafdatum" Type="DateTime" /> <asp:Parameter Name="tblCLeverabcierNr" Type="Int32" /> <asp:Parameter Name="tblScherm" Type="String" /> <asp:Parameter Name="tblLaptop" Type="Boolean" /> </InsertParameters> </asp:SqlDataSource> This is the code of my FormView <asp:FormView ID="FormView1" runat="server" AllowPaging="True" DataKeyNames="tblArtveldenr" DataSourceID="sqldsLokaalPrinters"> <EditItemTemplate> tblPositie: <asp:TextBox ID="tblPositieTextBox" runat="server" Text='<%# Bind("tblPositie") %>' /> <br /> tblSerienr: <asp:TextBox ID="tblSerienrTextBox" runat="server" Text='<%# Bind("tblSerienr") %>' /> <br /> tblFabrikant: <asp:TextBox ID="tblFabrikantTextBox" runat="server" Text='<%# Bind("tblFabrikant") %>' /> <br /> tblModel: <asp:TextBox ID="tblModelTextBox" runat="server" Text='<%# Bind("tblModel") %>' /> <br /> tblSnelheid: <asp:TextBox ID="tblSnelheidTextBox" runat="server" Text='<%# Bind("tblSnelheid") %>' /> <br /> tblHarddisk: <asp:TextBox ID="tblHarddiskTextBox" runat="server" Text='<%# Bind("tblHarddisk") %>' /> <br /> tblCD: <asp:TextBox ID="tblCDTextBox" runat="server" Text='<%# Bind("tblCD") %>' /> <br /> tblDVD: <asp:TextBox ID="tblDVDTextBox" runat="server" Text='<%# Bind("tblDVD") %>' /> <br /> tblAanschafdatum: <asp:TextBox ID="tblAanschafdatumTextBox" runat="server" Text='<%# Bind("tblAanschafdatum") %>' /> <br /> <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" /> &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> </EditItemTemplate> <InsertItemTemplate> tblPositie: <asp:TextBox ID="tblPositieTextBox" runat="server" Text='<%# Bind("tblPositie") %>' /> <br /> tblSerienr: <asp:TextBox ID="tblSerienrTextBox" runat="server" Text='<%# Bind("tblSerienr") %>' /> <br /> tblFabrikant: <asp:TextBox ID="tblFabrikantTextBox" runat="server" Text='<%# Bind("tblFabrikant") %>' /> <br /> tblModel: <asp:TextBox ID="tblModelTextBox" runat="server" Text='<%# Bind("tblModel") %>' /> <br /> tblSnelheid: <asp:TextBox ID="tblSnelheidTextBox" runat="server" Text='<%# Bind("tblSnelheid") %>' /> <br /> tblHarddisk: <asp:TextBox ID="tblHarddiskTextBox" runat="server" Text='<%# Bind("tblHarddisk") %>' /> <br /> tblCD: <asp:TextBox ID="tblCDTextBox" runat="server" Text='<%# Bind("tblCD") %>' /> <br /> tblDVD: <asp:TextBox ID="tblDVDTextBox" runat="server" Text='<%# Bind("tblDVD") %>' /> <br /> tblAanschafdatum: <asp:TextBox ID="tblAanschafdatumTextBox" runat="server" Text='<%# Bind("tblAanschafdatum") %>' /> <br /> <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" /> &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> </InsertItemTemplate> <ItemTemplate> tblPositie: <asp:Label ID="tblPositieLabel" runat="server" Text='<%# Bind("tblPositie") %>' /> <br /> tblSerienr: <asp:Label ID="tblSerienrLabel" runat="server" Text='<%# Bind("tblSerienr") %>' /> <br /> tblFabrikant: <asp:Label ID="tblFabrikantLabel" runat="server" Text='<%# Bind("tblFabrikant") %>' /> <br /> tblModel: <asp:Label ID="tblModelLabel" runat="server" Text='<%# Bind("tblModel") %>' /> <br /> tblSnelheid: <asp:Label ID="tblSnelheidLabel" runat="server" Text='<%# Bind("tblSnelheid") %>' /> <br /> tblHarddisk: <asp:Label ID="tblHarddiskLabel" runat="server" Text='<%# Bind("tblHarddisk") %>' /> <br /> tblCD: <asp:Label ID="tblCDLabel" runat="server" Text='<%# Bind("tblCD") %>' /> <br /> tblDVD: <asp:Label ID="tblDVDLabel" runat="server" Text='<%# Bind("tblDVD") %>' /> <br /> tblAanschafdatum: <asp:Label ID="tblAanschafdatumLabel" runat="server" Text='<%# Bind("tblAanschafdatum") %>' /> <br /> <br /> <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" /> &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" /> &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New" Text="New" /> </ItemTemplate> </asp:FormView> I have no idea how to solve this error Thanks a lot Vincent

    Read the article

  • Mono 2.11 on nginx using fastcgi-mono-server4 will not work

    - by fuzzycow101
    I have mono 2.11 set up with my nginx 1.0.15 webserver running on centos 6.2. I built it from source and xps2, xps4 and fastcgi-mono-server2 work as expected. The problem is when I try and run fastcgi-mono-server4. When I run: fastcgi-mono-server4 /applications=site:/:/srv/www/html/ /socket=tcp:127.0.0.1:9000 /loglevels=Debug /printlog=true Here is what I get from fastcgi-mono-server2: [2012-06-06 23:51:07Z] Debug Record received. (Type: BeginRequest, ID: 1, Length: 8) [2012-06-06 23:51:07Z] Debug Record received. (Type: Params, ID: 1, Length: 801) [2012-06-06 23:51:07Z] Debug Record received. (Type: Params, ID: 1, Length: 0) [2012-06-06 23:51:07Z] Debug Read parameter. (QUERY_STRING = ) [2012-06-06 23:51:07Z] Debug Read parameter. (REQUEST_METHOD = GET) [2012-06-06 23:51:07Z] Debug Read parameter. (CONTENT_TYPE = ) [2012-06-06 23:51:07Z] Debug Read parameter. (CONTENT_LENGTH = ) [2012-06-06 23:51:07Z] Debug Read parameter. (SCRIPT_NAME = /) [2012-06-06 23:51:07Z] Debug Read parameter. (REQUEST_URI = /) [2012-06-06 23:51:07Z] Debug Read parameter. (DOCUMENT_URI = /) [2012-06-06 23:51:07Z] Debug Read parameter. (DOCUMENT_ROOT = /srv/www/html) [2012-06-06 23:51:07Z] Debug Read parameter. (SERVER_PROTOCOL = HTTP/1.1) [2012-06-06 23:51:07Z] Debug Read parameter. (GATEWAY_INTERFACE = CGI/1.1) [2012-06-06 23:51:07Z] Debug Read parameter. (SERVER_SOFTWARE = nginx/1.0.15) [2012-06-06 23:51:07Z] Debug Read parameter. (REMOTE_ADDR = 192.168.128.121) [2012-06-06 23:51:07Z] Debug Read parameter. (REMOTE_PORT = 62326) [2012-06-06 23:51:07Z] Debug Read parameter. (SERVER_ADDR = 192.168.128.125) [2012-06-06 23:51:07Z] Debug Read parameter. (SERVER_PORT = 80) [2012-06-06 23:51:07Z] Debug Read parameter. (SERVER_NAME = site) [2012-06-06 23:51:07Z] Debug Read parameter. (REDIRECT_STATUS = 200) [2012-06-06 23:51:07Z] Debug Read parameter. (PATH_INFO = ) [2012-06-06 23:51:07Z] Debug Read parameter. (SCRIPT_FILENAME = /srv/www/html/) [2012-06-06 23:51:07Z] Debug Read parameter. (HTTP_HOST = site) [2012-06-06 23:51:07Z] Debug Read parameter. (HTTP_USER_AGENT = Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0) [2012-06-06 23:51:07Z] Debug Read parameter. (HTTP_ACCEPT = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8) [2012-06-06 23:51:07Z] Debug Read parameter. (HTTP_ACCEPT_LANGUAGE = en-us,en;q=0.5) [2012-06-06 23:51:07Z] Debug Read parameter. (HTTP_ACCEPT_ENCODING = gzip, deflate) [2012-06-06 23:51:07Z] Debug Read parameter. (HTTP_CONNECTION = keep-alive) [2012-06-06 23:51:07Z] Debug Read parameter. (HTTP_COOKIE = ASP.NET_SessionId=0176BE8FC161E702439D3C91) [2012-06-06 23:51:07Z] Debug Record received. (Type: StandardInput, ID: 1, Length: 0) [2012-06-06 23:51:08Z] Debug Record sent. (Type: StandardOutput, ID: 1, Length: 196) [2012-06-06 23:51:08Z] Debug Record sent. (Type: StandardOutput, ID: 1, Length: 128) [2012-06-06 23:51:08Z] Debug Record sent. (Type: StandardOutput, ID: 1, Length: 0) [2012-06-06 23:51:08Z] Debug Record sent. (Type: EndRequest, ID: 1, Length: 8) And this is what I get from fastcgi-mono-server4: [2012-06-06 23:50:52Z] Debug Record received. (Type: BeginRequest, ID: 1, Length: 8) [2012-06-06 23:50:52Z] Debug Record received. (Type: Params, ID: 1, Length: 801) [2012-06-06 23:50:52Z] Debug Record received. (Type: Params, ID: 1, Length: 0) [2012-06-06 23:50:52Z] Debug Read parameter. (QUERY_STRING = ) [2012-06-06 23:50:52Z] Debug Read parameter. (REQUEST_METHOD = GET) [2012-06-06 23:50:52Z] Debug Read parameter. (CONTENT_TYPE = ) [2012-06-06 23:50:52Z] Debug Read parameter. (CONTENT_LENGTH = ) [2012-06-06 23:50:52Z] Debug Read parameter. (SCRIPT_NAME = /) [2012-06-06 23:50:52Z] Debug Read parameter. (REQUEST_URI = /) [2012-06-06 23:50:52Z] Debug Read parameter. (DOCUMENT_URI = /) [2012-06-06 23:50:52Z] Debug Read parameter. (DOCUMENT_ROOT = /srv/www/html) [2012-06-06 23:50:52Z] Debug Read parameter. (SERVER_PROTOCOL = HTTP/1.1) [2012-06-06 23:50:52Z] Debug Read parameter. (GATEWAY_INTERFACE = CGI/1.1) [2012-06-06 23:50:52Z] Debug Read parameter. (SERVER_SOFTWARE = nginx/1.0.15) [2012-06-06 23:50:52Z] Debug Read parameter. (REMOTE_ADDR = 192.168.128.121) [2012-06-06 23:50:52Z] Debug Read parameter. (REMOTE_PORT = 62326) [2012-06-06 23:50:52Z] Debug Read parameter. (SERVER_ADDR = 192.168.128.125) [2012-06-06 23:50:52Z] Debug Read parameter. (SERVER_PORT = 80) [2012-06-06 23:50:52Z] Debug Read parameter. (SERVER_NAME = site) [2012-06-06 23:50:52Z] Debug Read parameter. (REDIRECT_STATUS = 200) [2012-06-06 23:50:52Z] Debug Read parameter. (PATH_INFO = ) [2012-06-06 23:50:52Z] Debug Read parameter. (SCRIPT_FILENAME = /srv/www/html/) [2012-06-06 23:50:52Z] Debug Read parameter. (HTTP_HOST = site) [2012-06-06 23:50:52Z] Debug Read parameter. (HTTP_USER_AGENT = Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0) [2012-06-06 23:50:52Z] Debug Read parameter. (HTTP_ACCEPT = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8) [2012-06-06 23:50:52Z] Debug Read parameter. (HTTP_ACCEPT_LANGUAGE = en-us,en;q=0.5) [2012-06-06 23:50:52Z] Debug Read parameter. (HTTP_ACCEPT_ENCODING = gzip, deflate) [2012-06-06 23:50:52Z] Debug Read parameter. (HTTP_CONNECTION = keep-alive) [2012-06-06 23:50:52Z] Debug Read parameter. (HTTP_COOKIE = ASP.NET_SessionId=0176BE8FC161E702439D3C91) [2012-06-06 23:50:53Z] Debug Record received. (Type: StandardInput, ID: 1, Length: 0) [2012-06-06 23:50:53Z] Debug Record sent. (Type: EndRequest, ID: 1, Length: 8) I do not see what I am doing wrong. Any help would be great.

    Read the article

  • Save output and exit code of command to files on windows

    - by poncha
    I want to run a command and save its output and its exit code, in different files. Here's what i am doing: cmd.exe /C command 1> %TEMP%\output.log 2> %TEMP%\error.log && echo %ERRORLEVEL% > %TEMP%\status || echo %ERRORLEVEL% > %TEMP%\status If i don't do output redirection (into %TEMP%\output.log and/or %TEMP%\error.log), then exit code is saved just fine. However, when i run the line as shown above more than once (just get back to previous line in command prompt and rerun it), i get 0 in %TEMP%\status regardless of the real exit code. What am i missing? Or maybe there's a better way of doing this?

    Read the article

  • Dump output from REPL

    - by Ankit Soni
    I'm writing SML programs, and I'd like a way to quickly see the output from running a program in the REPL without actually running the REPL (to quickly see if a program has syntax errors - I plan to use this as a make program for .sml files in vim to view the output inside vim).. Currently, I have this: sml file.sml | echo -e "\004" So it runs the program, and then echoes Ctrl-D to exit the REPL. The problem is that its too quick to send the Ctrl-D key, so there is no output. I tried this too: sml file.sml | sleep 2 ; echo -e "\004" But that isn't doing it either. Any ideas on how I can get a dump of the output from the REPL?

    Read the article

  • Is it possible to save output from a command to a file after the command already has been executed?

    - by NES
    Does an elegant way exist to save the output of a command to a file after the command has been run, with the terminal window is open? I mean once the command has been executed in the terminal. The output is still there in terminal. Now i could copy & paste all the lines and save it to a file. But perhaps does a method exist to somehow write the output buffer of a terminal window to a file or even better the output of an already executed command?

    Read the article

  • Is it possible to save output from a command to a file subsequent the command already has been executed?

    - by NES
    Does an elegant way exists to save the output of a command subsequent to a file as long as the terminal window is open? I mean once the command has been executed in the terminal. The output is still there in terminal. Now i could copy & paste all the lines and save it to a file. But perhaps does a method exist to somehow write the output buffer of a terminal window to a file or even better the output of an already executed command?

    Read the article

  • Use a stored procedure parameter for unit parameter of DATE_SUB

    - by Mike
    I would like to know if it's possible to pass a parameter to a mysql stored procedure and use this parameter as the unit parameter of the DATE_SUB function. It seems that the unit parameter is a reserved word so I don't know if there's a type for unit. Exemple of what I'm trying to do : DELIMITER $$ DROP PROCEDURE IF EXISTS `test` $$ CREATE DEFINER=`root`@`%` PROCEDURE `test`(param1 unit) BEGIN select DATE_SUB(now(), INTERVAL 1 param1); END $$ DELIMITER ;

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >