Search Results

Search found 1739 results on 70 pages for 'sir mix'.

Page 9/70 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Calling WebMethods / WebService using jquery is blocking

    - by Sir Psycho
    Hi, I'm generating a file on the server which takes some time. For this, I have a hidden iframe which I then set the .src attribute to an aspx file i.e iframe.src = "/downloadFile.aspx" While this is taking place, I'd like to have a call to a web service return the progress. To do this, I thought I could use window.setInterval or window.setTimeout but Javascript seems to be blocked as soon as I set the iframe src attribute. Does anyone know how to get around this or perhaps try a different approach? I have also tried handlers, but the request never gets to the server so I'm assuming is a browser/javascript issue.

    Read the article

  • c# WebRequest class and headers

    - by Sir Psycho
    Hi, When I try to set the header properties on a WebRequest object, I get the following exception This header must be modified using the appropriate property I've tried modifying the .Headers propery and adding them that way like so webRequest.Headers.Add(HttpRequestHeader.Referer, "http://stackoverflow.com"); But still getting exceptions. I can get around this by casting the WebRequest object to a HttpWebRequest and setting the properties such as httpWebReq.Referer ="http://stackoverflow.com" But I'd like to know if there's a way to get a finer grained control over modifying headers with a request for a remote resource. Thanks

    Read the article

  • LINQ to XML Cloning

    - by Sir Psycho
    Can anyone explain why the original address XElement street node changes? It looks like customer1 holds a reference to the address XElement but customer2 and customer3 have taken copies. Why did the original address change? (LINQPad example) var address = new XElement ("address", new XElement ("street", "Lawley St"), new XElement ("town", "North Beach") ); var customer1 = new XElement ("customer1", address); var customer2 = new XElement ("customer2", address); var customer3 = new XElement ("customer3", address); customer1.Element ("address").Element ("street").Value = "Another St"; Console.WriteLine (customer2.Element ("address").Element ("street").Value); Console.WriteLine (); address.Dump(); Console.WriteLine (); customer1.Dump(); Console.WriteLine (); customer2.Dump(); Console.WriteLine (); customer3.Dump(); OUTPUT Lawley St <address> <street>Another St</street> <town>North Beach</town> </address> <customer1> <address> <street>Another St</street> <town>North Beach</town> </address> </customer1> <customer2> <address> <street>Lawley St</street> <town>North Beach</town> </address> </customer2> <customer3> <address> <street>Lawley St</street> <town>North Beach</town> </address> </customer3>

    Read the article

  • Can't contravariance be solved with interfaces?

    - by Sir Psycho
    Hi, I'm at the point where I'm starting to grasp contravariance, although I'm trying to work out what the advantage is when an interface can be used instead. Obviously I'm missing something. Here is the c#4 example class Dog : Animal { public Dog(string name) : base(name) { } } class Animal { string _name; public Animal(string name) { _name = name; } public void Walk() { Console.WriteLine(_name + " is walking"); } } Action<Animal> MakeItMove = (ani) => { ani.Walk(); }; Action<Dog> MakeItWalk = MakeItMove; MakeItWalk(new Dog("Sandy")); Same example which works in earlier versions on c# class Dog : Animal { public Dog(string name) : base(name) { } } class Animal : IAnimal { string _name; public Animal(string name) { _name = name; } public void Walk() { Console.WriteLine(_name + " is walking"); } } interface IAnimal { void Walk(); } Action<IAnimal> MakeItMove = (ani) => { ani.Walk(); }; Action<IAnimal> MakeItWalk = MakeItMove; MakeItWalk(new Dog("Sandy")); These may not be the best examples, but I still can't seem to 'get it'. Is the in keywork defined on the action delegate simply a short hand syntax way like lamda is to delegates?

    Read the article

  • Implicit typing of arrays that implement interfaces

    - by Sir Psycho
    Hi, I was under the impression that the C# compiler will implicitly type an array based off a type that they can all be implicitly converted to. The compiler generates No best type found for implicitly-typed array public interface ISomething {} public interface ISomething2 {} public interface ISomething3 {} public class Foo : ISomething { } public class Bar : ISomething, ISomething2 { } public class Car : ISomething, ISomething3 { } void Main() { var obj1 = new Foo(); var obj2 = new Bar(); var obj3 = new Car(); var objects= new [] { obj1, obj2, obj3 }; } I know that the way to correct this is to declare the type like: new ISomething [] { obj1, ...} But I'm after an under the covers type help here :-) Thanks

    Read the article

  • When to use AsyncOperation and AsyncOperationManager

    - by Sir Psycho
    Hi, I've spent many many hours tonight reading up on implementing the event-based asynchronous pattern Unfortunately, I haven't been able to find any articles at all on witting a class that only supports one Async invocation. Every example I've seen assumes that a method call will be called more than once and thus, should have a userState object passed into the MethodNameAsync You'll see that MS makes mention of this in the third bullet point on this article http://msdn.microsoft.com/en-us/library/ms228974(VS.80).aspx under the "Simultaneously Executing Operations" heading. But I'm confused. Should I be using AsyncOperation and AsyncOperationManager classes to have asynchronous functionality where a method can only be called by one thread at a time? A link would also be nice :) Thanks

    Read the article

  • php parsing xml result from ipb ssi tool

    - by Sir Troll
    Last week my code was running fine and now (without changing anything) it is no longer able to parse the elements out of the XML. The response from the ssi tool: <?xml version="1.0" encoding="ISO-8859-1"?> <ipbsource><topic id="32"> <title>Test topic</title> <lastposter id="1">Drake</lastposter> <starter id="18">Drake</starter> <forum id="3">Updates</forum> <date timestamp="1345600720">22 August 2012 - 03:58 AM</date> </topic> </ipbsource> enter code here Update: Switched to SimpleXML but I can't extract data from the xml: $xml = file_get_contents('http://site.com/forum/ssi.php?a=out&f=2&show=10&type=xml'); $xml = new SimpleXMLElement($xml); $item_array = array(); var_dump($xml); foreach($xml->topic as $el) { var_dump($el); echo 'Title: ' . $el->title; } The var_dump output: object(SimpleXMLElement)#1 (1) { [0]=> string(1) " " }

    Read the article

  • Java WebApp: Loading resource from .jar located in WEB-INF

    - by shaman.sir
    There are a lot of similar questions, but, probably, mine is a little bit different: What is the right way to load resource from inside of .jar file located in WEB-INF/lib folder (if I know the jar file name and the name of the class it resource belongs to), while Web Application is running? Should I use getServletContext().getResourceAsStream(?) for this purpose or the <name-of-known-class>.getResourseAsStream(?), and what path do I need to specify there? So, the structure is: /WEB-INF /classes /some/package/name ?.class #some Java code or Servlet that tries to read 'required-file.xml' /lib /<jar-with-known-name>.jar /another/package/with/known/name SomeKnownClass.class required-file.xml

    Read the article

  • How much more productive are three monitors than two?

    - by Sir Graystar
    I am mulling over whether to buy a new monitor, to go along side my current setup of two 24 (ish) inch monitors. What I want to know is whether this is worth the money (probably around £200)? I think most of us will agree that two monitors is much more productive than one when programming and developing (Jeff Atwood has said this many times on his blog, and I imagine that most of you are fans of his), but is three much more productive than two? What I'm worried about is that I will have so much space that one monitor will be used for things that are not related to the task (music, facebook etc.) and it will actually make me less productive.

    Read the article

  • Hotkeys no longer work in Visual C# 2010 Express

    - by Sir Graystar
    Suddenly none of hotkeys in C# Express work (like F5, F6 etc.). I don't know what I've done, but no doubt its something stupid. Does anyone know how to fixed this? I have tried the Keyboard settings in Options, but it won;t even let me add hotkeys for some reason, even once I've removed the old ones. So re-adding them does not work.

    Read the article

  • State machines in C#

    - by Sir Psycho
    Hi, I'm trying to work out what's going on with this code. I have two threads iterating over the range and I'm trying to understand what is happening when the second thread calls GetEnumerator(). This line in particular (T current = start;), seems to spawn a new 'instance' in this method by the second thread. Seeing that there is only one instance of the DateRange class, I'm trying to understand why this works. Thanks in advance. class Program { static void Main(string[] args) { var daterange = new DateRange(DateTime.Now, DateTime.Now.AddDays(10), new TimeSpan(24, 0, 0)); var ts1 = new ThreadStart(delegate { foreach (var date in daterange) { Console.WriteLine("Thread " + Thread.CurrentThread.ManagedThreadId + " " + date); } }); var ts2 = new ThreadStart(delegate { foreach (var date in daterange) { Console.WriteLine("Thread " + Thread.CurrentThread.ManagedThreadId + " " + date); } }); Thread t1 = new Thread(ts1); Thread t2 = new Thread(ts2); t1.Start(); Thread.Sleep(4000); t2.Start(); Console.Read(); } } public class DateRange : Range<DateTime> { public DateTime Start { get; private set; } public DateTime End { get; private set; } public TimeSpan SkipValue { get; private set; } public DateRange(DateTime start, DateTime end, TimeSpan skip) : base(start, end) { SkipValue = skip; } public override DateTime GetNextElement(DateTime current) { return current.Add(SkipValue); } } public abstract class Range<T> : IEnumerable<T> where T : IComparable<T> { readonly T start; readonly T end; public Range(T start, T end) { if (start.CompareTo(end) > 0) throw new ArgumentException("Start value greater than end value"); this.start = start; this.end = end; } public abstract T GetNextElement(T currentElement); public IEnumerator<T> GetEnumerator() { T current = start; do { Thread.Sleep(1000); yield return current; current = GetNextElement(current); } while (current.CompareTo(end) < 1); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return GetEnumerator(); } }

    Read the article

  • Why is this c# snippet legal?

    - by Sir Psycho
    Silly question, but why does the following line compile? int[] i = new int[] {1,}; As you can see, I haven't entered in the second element and left a comma there. Still compiles even though you would expect it not to.

    Read the article

  • Are delegates copied during assignment to an event?

    - by Sir Psycho
    Hi, The following code seems to execute the FileRetrieved event more than once. I thought delegates were a reference type. I was expecting this to execute once. I'm going to take a guess and say that the reference is being passed by value, therefore copied but I don't like guesswork :-) public delegate void DirListEvent<T>(T dirItem); void Main() { DirListEvent<string> printFilename = s => { Console.WriteLine (s); }; var obj = new DirectoryLister(); obj.FileRetrieved += printFilename; obj.FileRetrieved += printFilename; obj.GetDirListing(); } public class DirectoryLister { public event DirListEvent<string> FileRetrieved; public DirectoryLister() { FileRetrieved += delegate {}; } public void GetDirListing() { foreach (var file in Directory.GetFiles(@"C:\")) { FileRetrieved(file); } } }

    Read the article

  • Array.BinarySearch does not find item using IComparable

    - by Sir Psycho
    If a binary search requires an array to be sorted before hand, why does the following code work? string[] strings = new[] { "z", "a", "y", "e", "v", "u" }; int pos = Array.BinarySearch(strings, "Y", StringComparer.OrdinalIgnoreCase); Console.WriteLine(pos); And why does this code result return -1? public class Person : IComparable<Person> { public string Name { get; set; } public int Age { get; set; } public int CompareTo(Person other) { return this.Age.CompareTo(other.Age) + this.Name.CompareTo(other.Name); } } var people = new[] { new Person { Age=5,Name="Tom"}, new Person { Age=1,Name="Tom"}, new Person { Age=2,Name="Tom"}, new Person { Age=1,Name="John"}, new Person { Age=1,Name="Bob"}, }; var s = new Person { Age = 1, Name = "Tom" }; // returns -1 Console.WriteLine( Array.BinarySearch(people, s) );

    Read the article

  • ELMAH: Only sending specific exception type via mail

    - by Sir Code-A-Lot
    Hi, I have ELMAH set up for a webapp, logging exceptions to a SQL server. I wish to have ELMAH send me an email too, but only when a specific exception is thrown (ie. MySpecialException). ELMAH must still log all exceptions to SQL server. I know you can do it programmatically in global.asax, but I'd prefer to use web.config. So, how do I restrict ELMAH error mails to filter out everything but a specific exception type, using web.config?

    Read the article

  • How to force a DIV block to extend to the bottom of a page, even if it has no content?

    - by Sir Psycho
    Hi, I'm trying to get the content div to stretch all the way to the bottom of the page but so far, its only stretching if theres actual content to display. The reason I want to do this is so if there isn't much content to display, the vertical border still goes all the way down. Here is my code <body> <form id="form1"> <div id="header"> <a title="Home" href="index.html" /> </div> <div id="menuwrapper"> <div id="menu"> </div> </div> <div id="content"> </div> and my CSS body { font-family: Trebuchet MS, Verdana, MS Sans Serif; font-size:0.9em; margin:0; padding:0; } div#header { width: 100%; height: 100px; } #header a { background-position: 100px 30px; background: transparent url(site-style-images/sitelogo.jpg) no-repeat fixed 100px 30px; height: 80px; display: block; } #header, #menuwrapper { background-repeat: repeat; background-image: url(site-style-images/darkblue_background_color.jpg); } #menu #menuwrapper { height:25px; } div#menuwrapper { width:100% } #menu, #content { width:1024px; margin: 0 auto; } div#menu { height: 25px; background-color:#50657a; } Thanks for taking a looksi

    Read the article

  • C# ASP.NET update SQL database with values from text boxes

    - by Sir Graystar
    Here's what I have. User enters values into text boxes (personal information etc.) and then presses a save changes button. The values in these text boxes get stored in an SQL database. The problem I have is that when updating the database using the values from the text boxes, the page refreshes and the values in the text boxes are lost (or rather they return to the values that are already in the database as the data from the database is loaded into the text boxes on Page_Load). When I update the database using valuse stored in variables it all works fine. What is the best way to update with the values from the text boxes?

    Read the article

  • LINQ query needs either ascending or descending in the same query

    - by Sir Psycho
    Is there anyway this code can be refactored? The only difference is the order by part. Idealy I'd like to use a delegate/lamda expression so the code is reusable but I don't know how to conditionally add and remove the query operators OrderBy and OrderByDescending var linq = new NorthwindDataContext(); var query1 = linq.Customers .Where(c => c.ContactName.StartsWith("a")) .SelectMany(cus=>cus.Orders) .OrderBy(ord => ord.OrderDate) .Select(ord => ord.CustomerID); var query2 = linq.Customers .Where(c => c.ContactName.StartsWith("a")) .SelectMany(cus => cus.Orders) .OrderByDescending(ord => ord.OrderDate) .Select(ord => ord.CustomerID);

    Read the article

  • GWT: What is the way to handle Click on GWT FlowPanel

    - by shaman.sir
    May be a dumb question, but GWT FlowPanel (raw div element) does not provides something to handle a mouseclick/mousemovement on it. Overriding onBrowserEvent do not works either. If setting onclick event using native JavaScript (need to specify positive height before, 'div' have a height of 0 if not specified), then catching these events is working properly. Is there a way to do it without using JSNI?

    Read the article

  • HTML footer problem

    - by Sir Psycho
    Hello Is it possible to create a footer div that sits at the bottom of a site regardless of how much information is present in the middle? Currently the div I have is positioned depending on how much content i have in the body. See also: http://stackoverflow.com/questions/42294/how-do-you-get-the-footer-to-stay-at-the-bottom-of-a-web-page

    Read the article

  • Linq to SQL - Returning two values with one query

    - by Sir Psycho
    Hi, Is it possible to return a single value and an enumerable collection using LINQ to SQL? The problem is, I'm trying to do paging across a large recordset. I only want to return 10 rows at a time so I'm using .Skip(20).Take(10) approach. However I need to know the total number of records so I can show an appropriate page x of y. Trying to avoid two separate queries. Thanks

    Read the article

  • C# ASP.NET Update database with datatable

    - by Sir Graystar
    Scenario: I'm just trying to update my database with the changes made by the user to their information. Here is my code: SqlCommandBuilder cb = new SqlCommandBuilder(da); dt.Rows[0][2] = txtname.Text; dt.Rows[0][3] = txtinterests.Text; dt.Rows[0][4] = txtlocation.Text; da.SelectCommand = new SqlCommand(sqlcommand, conn); da.Update(dt); I know its going to be something obvious, but what have I missed? There are no errors, everything compiles correctly, but nothing happens. The record remains unchanged.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >