Daily Archives

Articles indexed Wednesday December 29 2010

Page 17/33 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Mozilla divulgue accidentellement les mots de passe de 44 000 comptes liés à son catalogue d'extensions

    La fondation Mozilla divulgue accidentellement les mots de passe de 44 000 comptes Liés à son catalogue d'extensions La fondation Mozilla a malencontreusement exposé les mots de passe d'environ 44 000 comptes utilisateurs de son catalogue d'extensions en laissant une sauvegarde d'une base de donnée dans un espace web publique. La fondation assure avoir pris depuis les précautions nécessaires pour que cet accident ne puisse pas avoir d'effet néfaste. Seuls des comptes créés avant le 9 avril 2009 sont touchés. Les mots de passe étaient jusqu'à cette date chiffrés avec l'algorithme de hachage MD5. Depuis, ces comptes ont été désactivés et leurs mots de passe effacés de...

    Read the article

  • Temporary Post Used For Theme Detection (be923fa6-3c12-49cc-ae55-c5fc02e681cb – 3bfe001a-32de-4114-a6b4-4005b770f6d7)

    - by Kavitha
    This is a temporary post that was not deleted. Please delete this manually. (19a474df-a007-467b-96e1-46716e6fae03 – 3bfe001a-32de-4114-a6b4-4005b770f6d7) This article titled,Temporary Post Used For Theme Detection (be923fa6-3c12-49cc-ae55-c5fc02e681cb – 3bfe001a-32de-4114-a6b4-4005b770f6d7), was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • Adsense alternative for a "Sex Education" website?

    - by WhatIsOpenID
    I am creating a nice and niche "Sex Education" website. No porn, nothing offensive and no scams. I would love to place Google Adsense but they do not allow ads on adult sites. I would like to know what advertising and link-exchange like should I place on my site. My sole objective is to cover the server costs and salary of one or two persons. (In this way, it is different from Best alternative to Adsense for a small website?).

    Read the article

  • Detect bugs in this asp.net VB master page , default.aspx and detail.aspx page codes. [closed]

    - by ITGURU2011
    please help me in detecting some bugs, cosmetic issues, information design issues, programming issues in the Below code of master page and default.aspx page and detail.aspx page. also suggest me some way to make it work better. i seprated all the three pages with the names. Master Page <%@ Master Language="VB" CodeFile="Limo.master.vb" Inherits="Limo" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> <asp:ContentPlaceHolder id="ContentPlaceHolder2" runat="server"> </asp:ContentPlaceHolder> <link href="StyleSheet.css" rel="stylesheet" type="text/css" /> <style type="text/css"> .style3 { color: #0000CC; font-family: Constantia; font-size: xx-large; font-weight: normal; } </style> </head> <body> <form id="form1" runat="server"> <div class="ExternalDiv"> <div class="HeaderDiv"> <h1 class="style3"> Limousines</h1> <p class="style3"> &nbsp;</p> <div class="MenuDiv"> </div> <div class="ContentDiv"> <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> </div> </div> </form> </body> </html> default.aspx page <%@ Page Language="VB" MasterPageFile="~/Limo.master" AutoEventWireup="false" CodeFile="default.aspx.vb" Inherits="list" title="List" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <div style="height: 1343px; width: 727px"> <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource2" style="top: 134px; left: 12px; position: absolute; height: 1337px; width: 531px"> <Columns> <asp:BoundField DataField="Limo_Types" HeaderText="Limo_Types" SortExpression="Limo_Types" /> <asp:HyperLinkField DataNavigateUrlFields="Limo_Types" DataNavigateUrlFormatString="Details.aspx?tag={0}" DataTextField="Limo_Types" HeaderText="Click for Detail" /> <asp:ImageField DataImageUrlField="Images" DataImageUrlFormatString="images/{0}" HeaderImageUrl="~/images/6.jpg" HeaderText="Thumbnail"> <ControlStyle Height="200px" Width="200px" /> <HeaderStyle Height="200px" Width="200px" /> <ItemStyle Height="200px" Width="200px" /> </asp:ImageField> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString5 %>" ProviderName="<%$ ConnectionStrings:ConnectionString5.ProviderName %>" SelectCommand="SELECT [Limo_Types], [Images] FROM [tag]"> </asp:SqlDataSource> </div> </asp:Content> details.aspx page <%@ Page Language="VB" MasterPageFile="~/Limo.master" AutoEventWireup="false" CodeFile="Details.aspx.vb" Inherits="Details" title="Details Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" AllowSorting="True" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" GridLines="Vertical"> <Columns> <asp:BoundField DataField="Limo_Types" HeaderText="Limo_Types" SortExpression="Limo_Types" /> <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /> <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" /> <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /> <asp:BoundField DataField="Color" HeaderText="Color" SortExpression="Color" /> <asp:ImageField DataImageUrlField="Image" DataImageUrlFormatString="images/{0}" HeaderImageUrl="~/App_Data/images/1.jpg" HeaderText="Image" AccessibleHeaderText="Image" AlternateText="Image"> <ControlStyle Height="300px" Width="300px" /> </asp:ImageField> </Columns> <FooterStyle BackColor="#CCCCCC" /> <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="#CCCCCC" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT [Limo_Types], [Name], [Price], [Image], [Description], [Color] FROM [Query1] WHERE ([Limo_Types] = ?)"> <SelectParameters> <asp:QueryStringParameter Name="Limo_Types" QueryStringField="tag" Type="String" /> </SelectParameters> </asp:SqlDataSource> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"> </asp:Content>

    Read the article

  • Python interpreter invocation with "-c" and indentation issues

    - by alexander
    I'm trying to invoke Python using the "-c" argument to allow me to run some arbitrary python code easily, like this: python.exe -c "for idx in range(10): print idx" Now this code works fine, from within my batch file, however, I'm running into problems when I want to do anything more than this. Consider the following Python code: foo = 'bar' for idx in range(10): print idx this would then give you 0-9 on the stdout. However, if I collapse this into a single line, using semicolons as delimiters, to get the following: foo = 'bar';for idx in range(10): print idx and try to run it using python.exe -c it get a SyntaxError raised: C:\Python>python.exe -c "foo = 'bar';for idx in range(10): print idx" File "<string>", line 1 foo = 'bar';for idx in range(10): print idx ^ SyntaxError: invalid syntax Anyone know how I can actually use this without switching to a separate .py file?

    Read the article

  • memory issue iPad 4.2 crashes

    - by Manoj Kumar
    I am developing a application which receives 600-700 KB of XML data from the server. I have to do some manipulations in that data so once received the data the memory increases to 600 KB to 2 M.B. Already view occupied 4 M.B of memory in the application. So while processing the XML data i m doing some manipulation(pre-parsing) and the memory increases to 600 K.B to 2 M.B and finally decreases to 600 K.B. due to increase in memory, application gives the memory warning. While getting memory warning i m releasing all the views in the navigation controller but it releases only 1 M.B of memory. Even though I release all the views the application is crashing. Please help me out in this issue. It happens in iPad 4.2. Thanks in advance

    Read the article

  • .NET RegEx - First N chars of First M lines

    - by George
    Hello! I want 4 general RegEx expressions for the following 4 basic cases: Up to A chars starting after B chars from start of line on up to C lines starting after D lines from start of file Up to A chars starting after B chars from start of line on up to C lines occurring before D lines from end of file Up to A chars starting before B chars from end of line on up to C lines starting after D lines from start of file Up to A chars starting before B chars from end of line on up to C lines starting before D lines from end of file These would allow to select arbitrary text blocks anywhere in the file. So far I have managed to come up with cases that only work for lines and chars separately: (?<=(?m:^[^\r]{N}))[^\r]{1,M} = UP TO M chars OF EVERY LINE, AFTER FIRST N chars [^\r]{1,M}(?=(?m:.{N}\r$)) = UP TO M chars OF EVERY LINE, BEFORE LAST N chars The above 2 expressions are for chars, and they return MANY matches (one for each line). (?<=(\A([^\r]*\r\n){N}))(?m:\n*[^\r]*\r$){1,M} = UP TO M lines AFTER FIRST N lines (((?=\r?)\n[^\r]*\r)|((?=\r?)\n[^\r]+\r?)){1,M}(?=((\n[^\r]*\r)|(\n[^\r]+\r?)){N}\Z) = UP TO M lines BEFORE LAST N lines from end These 2 expressions are equivalents for the lines, but they always return just ONE match. The task is to combine these expressions to allow for scenarios 1-4. Anyone can help? Note that the case in the title of the question, is just a subclass of scenario #1, where both B = 0 and D = 0. EXAMPLE: SOURCE: line1 blah 1 line2 blah 2 line3 blah 3 line4 blah 4 line5 blah 5 line6 blah 6 DESIRED RESULT: Characters 3-6 of lines 3-5: A total of 3 matches: <match>ne3 </match> <match>ne4 </match> <match>ne5 </match>

    Read the article

  • AIX Package Install Issues

    - by user513983
    Hi All, I want to install gettext but i cannot because my AIX says that gettext is dependent on glib and when i try to install glib it says that I cannot because glib is in turn dependent on gettext. Please let me know how I could get past this situation? root [rover]% rpm -i gettext-0.17-1.aix5.1.ppc.rpm error: failed dependencies: libglib-2.0.a(libglib-2.0.so.0) is needed by gettext-0.17-1 libxlsmp.a(smprt.o) is needed by gettext-0.17-1 root [rover]% rpm -i glib2-2.22.5-2.aix5.1.ppc.rpm error: failed dependencies: gettext is needed by glib2-2.22.5-2 Regards, Anurag

    Read the article

  • Request size limitation when using MultipartHttpServletRequest of Spring 3.0

    - by Spiderman
    I'd like to know what is the size limitation if I upload list of files in one client's form submition using HTTP multipart content type. On the server side I am using Spring's MultipartHttpServletRequest to handle the request. mM questions: Is there should be different file size limitation and total request size limitation or file size is the only limitation and the request is capable of uploading 100s of files as lonng as they are not too large. Doest the Spring request wrapper read the complete request and store it in the JAVA heap memory or it store temporaray files of it to be able to use big quota. Is the use of reading the httpservlet request in streaming would change the size limitation than using complete http request read at-once by the application server. What is the bottleneck of this process - Java heap size, the quota of the filesystem on which my web-server runs, the maximum allowed BLOB size that the DataBase in which I am gonna save the file alows? or Spring internal limitations? Related threads that still don't have exact answer to this: does-spring-framework-support-streaming-mode-in-mutlipart-requests is-there-a-way-to-get-raw-http-request-stream-from-java-servlet-handler how-to- drop-body-of-a-request-after-checking-headers-in-servlet apache-commons-fileupload-throws-malformedstreamexception

    Read the article

  • Why is parsing a jSON response to a jQUERY ajax request not working

    - by Ankur
    I know there are several similar questions on SO, I have used some of them to get this far. I am trying to list a set of urls that match my input values. I have a servlet which takes some input e.g. "aus" in the example below and returns some output using out.print() e.g. the two urls I have shown below. EXAMPLE Input: "aus" Output: [{"url":"http://dbpedia.org/resource/Stifel_Nicolaus"},{"url":"http://sempedia.org/ontology/object/Australia"}] Which is exactly what I want. I have seen that firebug doesn't seem to have anything in the response section despite having called out.print(jsonString); and it seems that out.print(jsonString); is working as expected which suggests that the variable 'jsonString' contains the expected values. However I am not exactly sure what is wrong. -------- The jQuery --------- $(document).ready(function() { $("#input").keyup(function() { var input = $("#input").val(); //$("#output").html(input); ajaxCall(input); }); }); function ajaxCall(input) { // alert(input); $.ajax({ url: "InstantSearchServlet", data: "property="+input, beforeSend: function(x) { if(x && x.overrideMimeType) { x.overrideMimeType("application/j-son;charset=UTF-8"); } }, dataType: "json", success: function(data) { for (var i = 0, len = datalength; i < len; ++i) { var urlData = data[i]; $("#output").html(urlData.url); } } }); } ------ The Servlet that calls the DAO class - and returns the results ------- public class InstantSearchServlet extends HttpServlet{ private static final long serialVersionUID = 1L; public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { System.out.println("You called?"); response.setContentType("application/json"); PrintWriter out = response.getWriter(); InstantSearch is = new InstantSearch(); String input = (String)request.getParameter("property"); System.out.println(input); try { ArrayList<String> urllist; urllist = is.getUrls(input); String jsonString = convertToJSON(urllist); out.print(jsonString); System.out.println(jsonString); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } private String convertToJSON(ArrayList<String> urllist) { Iterator<String> itr = urllist.iterator(); JSONArray jArray = new JSONArray(); int i = 0; while (itr.hasNext()) { i++; JSONObject json = new JSONObject(); String url = itr.next(); try { json.put("url",url); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } jArray.put(json); } String results = jArray.toString(); return results; } }

    Read the article

  • Jscrollpane causese text to disappear on internet explorer

    - by Crippletoe
    Hello all, in my current site, i am using the new Jscrollpane in order to generate a scrollbar for a menu (not my descision but the designer's descision so i dont wanna get into how 90's that all looks like..). my menu is based on a <UL> the <li> elements inside it have the attribute "text-align: right;". my problem that on IE alone the menu text doesnt show when i apply the ScrollPane to the menu. when i delete the ScrollPane function from my code- the menu re-appears. i checked the page with "microsoft Expression" DOM inspector in order to examine how IE sees my code and i can see the <li> elements there, only the text inside them is missing. when i disable the "text-align: right;" for the <li> in my CSS, the text shows again. i suspect this has something to do with the jScrollPane's containing which is relatively aligned but i cannot be sure.. can anyone suggest some fix for this problem? a link to a page where you can see the problem is here: http://kaplanoland.com/index.php?option=com_content&view=article&id=2&Itemid=12 the problematic menu is on the right side of the page. on every browser but IE you can see the text. only on IE not. my CSS code for that menu (not including the jScrollPane CSS) is here: div#menu2{ position: absolute; top: 123px; right: 36px; width: 330px; height: 150px; } div#menu2_scroll{ /*the actual scroller*/ height: 150px; } div#menu2 div#menu2_contain{ } div#menu2 li{ text-align: right; } div#menu2 li span{ line-height: 18px; } div#menu2 a:link, div#menu2 a:visited{ color: #808285 ; font-family: Arial, Helvetica, sans-serif ; font-size: 12px ; } div#menu2 a:hover, div#menu2 li#current a{ color: #000000 ; font-family: Arial, Helvetica, sans-serif ; font-size: 12px ; } div#menu2 span.separator{ display: block; padding-top: 12px; padding-bottom: 40px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #000000; } div#menu2 span.separator span { padding-top: 12px; border-top-width: 1px; border-top-style: solid; border-top-color: #808285; } thank you all so much.

    Read the article

  • Multiple mod rewrites in .htaccess

    - by Bob
    I want the following rules but I don't seem to get the right setup. <domain>/training-courses/ both with or without the slash at the end it should go to: <domain>/?index.php?page=training-courses and for each variable extra after this I want it to behave like this: <domain>/training-courses/success/another-value/and-yet-another/ to <domain>/?index.php?page=training-courses&val1=success&val2=another-value&val3=and-yet-another-value If it's not possible to have the option for unlimited leading variables, i'd like to have at least 2 variables after the page variable Is this possible? and how do I get this sorted out? I have this so far: RewriteEngine On RewriteRule ^test/([^/]*)/$ /test/index.php?pagina=$1&val1=$2 RewriteRule ^test/([^/]*)$ /test/index.php?pagina=$1&val1=$2 RewriteRule ^test/([^/]*)/([^/]*)/$ /test/index.php?pagina=$1&val1=$2 RewriteRule ^test/([^/]*)/([^/]*)$ /test/index.php?pagina=$1&val1=$2 RewriteRule ^test/([^/]*)/([^/]*)/([^/]*)/$ /test/index.php?pagina=$1&val1=$2&val2=$3 RewriteRule ^test/([^/]*)/([^/]*)/([^/]*)$ /test/index.php?pagina=$1&val1=$2&val2=$3

    Read the article

  • LINQ Expression help with Func TEntity,TType

    - by Chris Conway
    I have a repository method that accepts an order by parameter in the form: public IEnumerable<TEntity> Get<TEntity>(Expression<Func<TEntity,string>> orderBy) Now that works fine when trying to sort by a property of type string, var entities = rep.Get(x => x.Name); but what if i want to sort by double or int or any other type. Doing something like var entities = rep.Get(x => x.Price); obviously throws a compile error saying I can't convert double to string. How can I make this more generic so I can sort by any property in my entity, or at least the properties where the type implements IComparable or something similar?

    Read the article

  • Configuring log4j at runtime

    - by Neil
    I'm using org.apache.tools.ant.listener.Log4jListener to manage logging with my ant script. The ant script is highly configurable and designed to be run different ways with different parameters and therefore I need to be able to log to files specified at runtime. I have a log4j.properties which specifies a log file to be build.log, and despite my attempts to launch ant redefining properties defined in log4j.properties have been unsuccessful. The build ignores them and continues to write to build.log. I haven't found much support regarding writing to custom files unless it's in Java with their Logger class. Perhaps I'm thinking this through wrong. log4j.properties isn't treated in the same way as a property file in an ant script (hence overrideable from the command line)? Is there a way I can do this intelligently without writing a custom task or something?

    Read the article

  • Simplifying and reducing the cost of an anti-join query

    - by Savitha
    Hi, Could you please help me in simplifying and reducing the cost of the below query? I tried making it a co-related subquery with NOT EXISTS but it didn't give me any output. Please note that the table in both main and inner query is the same 'table_1". SELECT * FROM Table_1 A WHERE A.Col1 = 'abcd' AND (A.Col2, A.Col3) NOT IN (SELECT Col2, Col3 FROM Table_1 B WHERE (B.Col4 IN (1,2,3) And B.Col5 In ('x','y')) OR (B.Col4 = 1 AND B.Col5 = 'z' AND B.Col6 = 'f') )) Thanks in advance, Savitha

    Read the article

  • SQL 2000 Multiple IF Statements

    - by Spidermain50
    I get a error when I try to use multiple IF statements. This is the error... "Msg 156, Level 15, State 1, Procedure fnTNAccidentIndicator, Line 81 Incorrect syntax near the keyword 'END'." This is the structure of my code... USE SS_TNRecords_Accident SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION dbo.fnTNAccidentIndicator ( @inAccidentNumber nvarchar, @inIndicatorMode int ) RETURNS nvarchar AS BEGIN DECLARE @AlcoholInd nvarchar DECLARE @DrugInd nvarchar DECLARE @SpeedInd nvarchar DECLARE @ReturnValue nvarchar SET @AlcoholInd = '1' SET @DrugInd = '2' SET @SpeedInd = '3' SET @ReturnValue = 'N' IF (@inIndicatorMode = @AlcoholInd) BEGIN --select statment IF (@@ROWCOUNT > 0) BEGIN @ReturnValue = 'Y' END END IF (@inIndicatorMode = @DrugInd) BEGIN --select statment IF (@@ROWCOUNT > 0) BEGIN @ReturnValue = 'Y' END END IF (@inIndicatorMode = @SpeedInd) BEGIN --select statment IF (@@ROWCOUNT > 0) BEGIN @ReturnValue = 'Y' END END Return @ReturnValue END GO

    Read the article

  • Doubt in Conditional inclusion

    - by Philando Gullible
    This is actually extracted from my module (Pre-processor in C) The conditional expression could contain any C operator except for the assignment operators,increment, and decrement operators. I am not sure if I am getting this statement or not since I tried using this and it worked.Also for other manipulation a probable work around would be to simply declare macro or function inside the conditional expression,something like this to be precise. Also I don't understand what is the rationale behind this rule. Could somebody explain? Thanks

    Read the article

  • Last Grid Column Not Auto Resizing With Grid

    - by photo_tom
    I'm having a problem with my TextBoxs not "Auto" resizing. I'm trying to create a form that behaves and looks like the Properties Editor in Visual Studio. What appears to be happening is that the third column is not expanding to fill all of the available remaining space in the grid. Image below is how my form looks on startup. The width of the textboxs is determined by the MinWidth setting on the third ColumnDefinition statement. Also, the Width is set to "*". With any other setting, the resizing done with the GridSplitter doesn't work correctly. <StackPanel Orientation="Vertical" VerticalAlignment="Top" x:Name="Stacker" Grid.IsSharedSizeScope="True"> <Expander x:Name="Expand" IsExpanded="True" Header="This is a test of a Second Panel" Width="{Binding Width, ElementName=Stacker}"> <Grid x:Name="EditGrid1" Margin="3" > <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" MinWidth="50" SharedSizeGroup="SharedSize1" /> <ColumnDefinition Width="Auto" SharedSizeGroup="SharedSize2" /> <ColumnDefinition Width="*" MinWidth="50" x:Name="ValueCol" /> </Grid.ColumnDefinitions> <GridSplitter Grid.Column="1" x:Name="ToolBoxSplitter1" Grid.Row="1" Grid.RowSpan="6" Panel.ZIndex="1" HorizontalAlignment="Stretch" ResizeBehavior="PreviousAndNext" Width="3"/> <TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="1" Text="{x:Static lex:DoSomeThingView.Name}" /> <TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="2" Text="{x:Static lex:DoSomeThingView.Address}" /> <TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="3" Text="{x:Static lex:DoSomeThingView.Zip}" /> <TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="4" Text="{x:Static lex:DoSomeThingView.NumberOfDoors}" TextTrimming="CharacterEllipsis" Grid.IsSharedSizeScope="True" /> <TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="5" Text="{x:Static lex:DoSomeThingView.DoubleNumber}" /> <TextBox Grid.Column="2" Grid.Row="1" x:Name="UserName1" MaxHeight="50" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" SpellCheck.IsEnabled="True" /> <TextBox Grid.Column="2" Grid.Row="2" x:Name="Address1" /> <TextBox Grid.Column="2" Grid.Row="3" x:Name="Zip1" /> <TextBox Grid.Column="2" Grid.Row="4" x:Name="NumberOfDoors1" /> <TextBox Grid.Column="2" Grid.Row="5" x:Name="DoubleNumber1" /> </Grid> </Expander> </StackPanel> Any suggestions on how to correct this?

    Read the article

  • if i call an interface method will it get the method body from implementation class and execute ?

    - by sij
    please forgive me if i am wrong: I have an interface Interface1 I have its implementation Imple implements Interface (all methods hav been implemented :) ) now consider a third class CheckCall can I do a call in the class CheckCall like I mention below Interface1 interface1; interface1.method(); all necessary imports have been done. Please tell me is it possible or not , if not then ok and if yes then tell me what will happen if i have more than one impl classes for the same interface and i am doing the same call.

    Read the article

  • Is it possible to add two nodes at a time dynamically to a treeview

    - by Dorababu
    I am having a tree-view on my main form with initially some nodes as follows ACH |-> some.txt |->FileHeader |->BatchHeader Now at this point i will have to add 2 child nodes at a time to BatchHeader. This nodes i will pass as strings from child forms My sample code that i added some nodes is as follows public void loadingDatafrom(string filename, bool str) { if (Append.oldbatchcontrol != filename) { if (tvwACH.SelectedNode.Text == "FileHeader") { tvwACH.SelectedNode.Nodes.Add(filename); } if (tvwACH.SelectedNode.Text == "BatchHeader" && filecontrolvariables.m_gridclick == false) { tvwACH.SelectedNode.Nodes.Add(filename); **I got this idea tvwach.SelectedNode.Lastnode.Nodes.Add("Node");** } } } Can any one give an idea to add 2 nodes as child to the existing node ..

    Read the article

  • Repeated host lookups failing in urllib2

    - by reve_etrange
    I have code which issues many HTTP GET requests using Python's urllib2, in several threads, writing the responses into files (one per thread). During execution, it looks like many of the host lookups fail (causing a name or service unknown error, see appended error log for an example). Is this due to a flaky DNS service? Is it bad practice to rely on DNS caching, if the host name isn't changing? I.e. should a single lookup's result be passed into the urlopen? Exception in thread Thread-16: Traceback (most recent call last): File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner self.run() File "/home/da/local/bin/ThreadedDownloader.py", line 61, in run page = urllib2.urlopen(url) # get the page File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen return _opener.open(url, data, timeout) File "/usr/lib/python2.6/urllib2.py", line 391, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 409, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1170, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1145, in do_open raise URLError(err) URLError: <urlopen error [Errno -2] Name or service not known>

    Read the article

  • Ajax jquery async return value

    - by Sonny
    Hi, how can i make this code to don't pause the browser but still return value. You can rewrite this with new method of course. function get_char_val(merk) { var returnValue = null; $.ajax({ type: "POST", async: false, url: "char_info2.php", data: { name: merk }, dataType: "html", success: function(data) { returnValue = data; } }); return returnValue; } var px= get_char_val('x'); var py= get_char_val('y');

    Read the article

  • To ref or not to ref

    - by nmarun
    So the question is what is the point of passing a reference type along with the ref keyword? I have an Employee class as below: 1: public class Employee 2: { 3: public string FirstName { get; set; } 4: public string LastName { get; set; } 5:  6: public override string ToString() 7: { 8: return string.Format("{0}-{1}", FirstName, LastName); 9: } 10: } In my calling class, I say: 1: class Program 2: { 3: static void Main() 4: { 5: Employee employee = new Employee 6: { 7: FirstName = "John", 8: LastName = "Doe" 9: }; 10: Console.WriteLine(employee); 11: CallSomeMethod(employee); 12: Console.WriteLine(employee); 13: } 14:  15: private static void CallSomeMethod(Employee employee) 16: { 17: employee.FirstName = "Smith"; 18: employee.LastName = "Doe"; 19: } 20: }   After having a look at the code, you’ll probably say, Well, an instance of a class gets passed as a reference, so any changes to the instance inside the CallSomeMethod, actually modifies the original object. Hence the output will be ‘John-Doe’ on the first call and ‘Smith-Doe’ on the second. And you’re right: So the question is what’s the use of passing this Employee parameter as a ref? 1: class Program 2: { 3: static void Main() 4: { 5: Employee employee = new Employee 6: { 7: FirstName = "John", 8: LastName = "Doe" 9: }; 10: Console.WriteLine(employee); 11: CallSomeMethod(ref employee); 12: Console.WriteLine(employee); 13: } 14:  15: private static void CallSomeMethod(ref Employee employee) 16: { 17: employee.FirstName = "Smith"; 18: employee.LastName = "Doe"; 19: } 20: } The output is still the same: Ok, so is there really a need to pass a reference type using the ref keyword? I’ll remove the ‘ref’ keyword and make one more change to the CallSomeMethod method. 1: class Program 2: { 3: static void Main() 4: { 5: Employee employee = new Employee 6: { 7: FirstName = "John", 8: LastName = "Doe" 9: }; 10: Console.WriteLine(employee); 11: CallSomeMethod(employee); 12: Console.WriteLine(employee); 13: } 14:  15: private static void CallSomeMethod(Employee employee) 16: { 17: employee = new Employee 18: { 19: FirstName = "Smith", 20: LastName = "John" 21: }; 22: } 23: } In line 17 you’ll see I’ve ‘new’d up the incoming Employee parameter and then set its properties to new values. The output tells me that the original instance of the Employee class does not change. Huh? But an instance of a class gets passed by reference, so why did the values not change on the original instance or how do I keep the two instances in-sync all the times? Aah, now here’s the answer. In order to keep the objects in sync, you pass them using the ‘ref’ keyword. 1: class Program 2: { 3: static void Main() 4: { 5: Employee employee = new Employee 6: { 7: FirstName = "John", 8: LastName = "Doe" 9: }; 10: Console.WriteLine(employee); 11: CallSomeMethod(ref employee); 12: Console.WriteLine(employee); 13: } 14:  15: private static void CallSomeMethod(ref Employee employee) 16: { 17: employee = new Employee 18: { 19: FirstName = "Smith", 20: LastName = "John" 21: }; 22: } 23: } Viola! Now, to prove it beyond doubt, I said, let me try with another reference type: string. 1: class Program 2: { 3: static void Main() 4: { 5: string name = "abc"; 6: Console.WriteLine(name); 7: CallSomeMethod(ref name); 8: Console.WriteLine(name); 9: } 10:  11: private static void CallSomeMethod(ref string name) 12: { 13: name = "def"; 14: } 15: } The output was as expected, first ‘abc’ and then ‘def’ - proves the 'ref' keyword works here as well. Now, what if I remove the ‘ref’ keyword? The output should still be the same as the above right, since string is a reference type? 1: class Program 2: { 3: static void Main() 4: { 5: string name = "abc"; 6: Console.WriteLine(name); 7: CallSomeMethod(name); 8: Console.WriteLine(name); 9: } 10:  11: private static void CallSomeMethod(string name) 12: { 13: name = "def"; 14: } 15: } Wrong, the output shows ‘abc’ printed twice. Wait a minute… now how could this be? This is because string is an immutable type. This means that any time you modify an instance of string, new memory address is allocated to the instance. The effect is similar to ‘new’ing up the Employee instance inside the CallSomeMethod in the absence of the ‘ref’ keyword. Verdict: ref key came to the rescue and saved the planet… again!

    Read the article

  • Enabling Http caching and compression in IIS 7 for asp.net websites

    - by anil.kasalanati
    Caching – There are 2 ways to set Http caching 1-      Use Max age property 2-      Expires header. Doing the changes via IIS Console – 1.       Select the website for which you want to enable caching and then select Http Responses in the features tab       2.       Select the Expires webcontent and on changing the After setting you can generate the max age property for the cache control    3.       Following is the screenshot of the headers   Then you can use some tool like fiddler and see 302 response coming from the server. Doing it web.config way – We can add static content section in the system.webserver section <system.webServer>   <staticContent>             <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />   </staticContent> Compression - By default static compression is enabled on IIS 7.0 but the only thing which falls under that category is CSS but this is not enough for most of the websites using lots of javascript.  If you just thought by enabling dynamic compression would fix this then you are wrong so please follow following steps –   In some machines the dynamic compression is not enabled and following are the steps to enable it – Open server manager Roles > Web Server (IIS) Role Services (scroll down) > Add Role Services Add desired role (Web Server > Performance > Dynamic Content Compression) Next, Install, Wait…Done!   ?  Roles > Web Server (IIS) ?  Role Services (scroll down) > Add Role Services     Add desired role (Web Server > Performance > Dynamic Content Compression)     Next, Install, Wait…Done!     Enable  - ?  Open server manager ?  Roles > Web Server (IIS) > Internet Information Services (IIS) Manager   Next pane: Sites > Default Web Site > Your Web Site Main pane: IIS > Compression         Then comes the custom configuration for encrypting javascript resources. The problem is that the compression in IIS 7 completely works on the mime types and by default there is a mismatch in the mime types Go to following location C:\Windows\System32\inetsrv\config Open applicationHost.config The mimemap is as follows  <mimeMap fileExtension=".js" mimeType="application/javascript" />   So the section in the staticTypes should be changed          <add mimeType="application/javascript" enabled="true" />     Doing the web.config way –   We can add following section in the system.webserver section <system.webServer> <urlCompression doDynamicCompression="false"  doStaticCompression="true"/> More Information/References – ·         http://weblogs.asp.net/owscott/archive/2009/02/22/iis-7-compression-good-bad-how-much.aspx ·         http://www.west-wind.com/weblog/posts/98538.aspx  

    Read the article

  • Implementing History Support using jQuery for AJAX websites built on asp.net AJAX

    - by anil.kasalanati
    Problem Statement: Most modern day website use AJAX for page navigation and gone are the days of complete HTTP redirection so it is imperative that we support back and forward buttons on the browser so that end users navigation is not broken. In this article we discuss about solutions which are already available and problems with them. Microsoft History Support: Post .Net 3.5 sp1 Microsoft’s Script manager supports history for websites using Update panels. This is achieved by enabling the ENABLE HISTORY property for the script manager and then the event “Page_Browser_Navigate” needs to be handled. So whenever the browser buttons are clicked the event is fired and the application can write code to do the navigation. The following articles provide good tutorials on how to do that http://www.asp.net/aspnet-in-net-35-sp1/videos/introduction-to-aspnet-ajax-history http://www.codeproject.com/KB/aspnet/ajaxhistorymanagement.aspx And Microsoft api internally creates an IFrame and changes the bookmark of the url. Unfortunately this has a bug and it does not work in Ie6 and 7 which are the major browsers but it works in ie8 and Firefox. And Microsoft has apparently fixed this bug in .Net 4.0. Following is the blog http://weblogs.asp.net/joshclose/archive/2008/11/11/asp-net-ajax-addhistorypoint-bug.aspx For solutions which are still running on .net 3.5 sp1 there is no solution which Microsoft offers so there is  are two way to solve this o   Disable the back button. o   Develop custom solution.   Disable back button Even though this might look like a very simple thing to do there are issues around doing this  because there is no event which can be manipulated from the javascript. The browser does not provide an api to do this. So most of the technical solution on internet offer work arounds like doing a history.forward(1) so that even if the user clicks a back button the destination page redirects the user to the original page. This is not a good customer experience and does not work for asp.net website where there are different views in the same page. There are other ways around detecting the window unload events and writing code there. So there are 2 events onbeforeUnload and onUnload and we can write code to show a confirmation message to the user. If we write code in onUnLoad then we can only show a message but it is too late to stop the navigation. And if we write on onBeforeUnLoad we can stop the navigation if the user clicks cancel but this event would be triggered for all AJAX calls and hyperlinks where the href is anything other than #. We can do this but the website has to be checked properly to ensure there are no links where href is not # otherwise the user would see a popup message saying “you are leaving the website”. Believe me after doing a lot of research on the back button disable I found it easier to support it rather than disabling the button. So I am going to discuss a solution which work  using jQuery with some tweaking. Custom Solution JQuery already provides an api to manage the history of a AJAX website - http://plugins.jquery.com/project/history We need to integrate this with Microsoft Page request manager so that both of them work in tandem. The page state is maintained in the cookie so that it can be passed to the server and I used jQuery cookie plug in for that – http://plugins.jquery.com/node/1386/release Firstly when the page loads there is a need to hook up all the events on the page which needs to cause browser history and following is the code to that. jQuery(document).ready(function() {             // Initialize history plugin.             // The callback is called at once by present location.hash.             jQuery.history.init(pageload);               // set onlick event for buttons             jQuery("a[@rel='history']").click(function() {                 //                 var hash = this.page;                 hash = hash.replace(/^.*#/, '');                 isAsyncPostBack = true;                 // moves to a new page.                 // pageload is called at once.                 jQuery.history.load(hash);                 return true;             });         }); The above scripts basically gets all the DOM objects which have the attribute rel=”history” and add the event. In our test page we have the link button  which has the attribute rel set to history. <asp:LinkButton ID="Previous" rel="history" runat="server" onclick="PreviousOnClick">Previous</asp:LinkButton> <asp:LinkButton ID="AsyncPostBack" rel="history" runat="server" onclick="NextOnClick">Next</asp:LinkButton> <asp:LinkButton ID="HistoryLinkButton" runat="server" style="display:none" onclick="HistoryOnClick"></asp:LinkButton>   And you can see that there is an hidden HistoryLinkButton which used to send a sever side postback in case of browser back or previous buttons. And note that we need to use display:none and not visible= false because asp.net AJAX would disallow any post backs if visible=false. And in general the pageload event get executed on the client side when a back or forward is pressed and the function is shown below function pageload(hash) {                   if (hash) {                         if (!isAsyncPostBack) {                           jQuery.cookie("page", hash);                     __doPostBack("HistoryLinkButton", "");                 }                isAsyncPostBack = false;                             } else {                 // start page             jQuery("#load").empty();             }         }   As you can see in case there is an hash in the url we are basically do an asp.net AJAX post back using the following statement __doPostBack("HistoryLinkButton", ""); So whenever the user clicks back or forward the post back happens using the event statement we provide and Previous event code is invoked in the code behind.  We need to have the code to use the pageId present in the url to change the page content. And there is an important thing to note – because the hash is worked out using the pageId’s there is a need to recalculate the hash after every AJAX post back so following code is plugged in function ReWorkHash() {             jQuery("a[@rel='history']").unbind("click");             jQuery("a[@rel='history']").click(function() {                 //                 var hash = jQuery(this).attr("page");                 hash = hash.replace(/^.*#/, '');                 jQuery.cookie("page", hash);                 isAsyncPostBack = true;                                   // moves to a new page.                 // pageload is called at once.                 jQuery.history.load(hash);                 return true;             });        }   This code is executed from the code behind using ScriptManager RegisterClientScriptBlock as shown below –       ScriptManager.RegisterClientScriptBlock(this, typeof(_Default), "Recalculater", "ReWorkHash();", true);   A sample application is available to be downloaded at the following location – http://techconsulting.vpscustomer.com/Source/HistoryTest.zip And a working sample is available at – http://techconsulting.vpscustomer.com/Samples/Default.aspx

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >