Search Results

Search found 638 results on 26 pages for 'ian stevens'.

Page 14/26 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • jQuery .ajax call to bit.ly returns results in IE but not FF or Chrome

    - by Ian Quigley
    I am trying to call to the bit.ly URL shortening service using jQuery with an .ajax call. <html><head> <script type="text/javascript" src="http://www.twipler.com/settings/scripts/jquery.1.4.min.js"></script> <script type="text/javascript"> jQuery.fn.shorten = function(url) { var resultUrl = url; $.ajax( { url: "http://api.bit.ly/shorten?version=2.0.1&login=twipler&apiKey=R_4e618e42fadbb802cf95c6c2dbab3763&longUrl=" + url, async: false, dataType: 'json', data: "", type: "GET", success: function (json) { resultUrl = json.results[url].shortUrl; } }); return resultUrl; } ; </script></head><body> <a href="#" onclick="alert($().shorten('http://amiconnectedtotheinternet.com'));"> Shorten</a> </body> </html> This works in IE8 but does not work in FireFox (3.5.9) nor in Chrome. In both cases 'json' is null. Headers in IE8 GET http://api.bit.ly/shorten?ver..[SNIP]..dtotheinternet.com HTTP/1.1 Accept: application/json, text/javascript, */* Accept-Language: en-US Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; Media Center PC 6.0; InfoPath.2; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729) Host: api.bit.ly Connection: Keep-Alive Headers in Chrome GET http://api.bit.ly/shorten?versio..[SNIP]..nectedtotheinternet.com HTTP/1.1 Host: api.bit.ly Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1045 Safari/532.5 Origin: file:// Accept: application/json, text/javascript, */* Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 So the only obvious difference is that Chrome is sending "Origin: file://" and I've no idea how to stop it doing that.

    Read the article

  • 'Generic' ViewModel

    - by Ian MacPherson
    Using EF 4, I have several subtypes of a 'Business' entity (customers, suppliers, haulage companies etc). They DO need to be subtypes. I am building a general viewmodel which calls into a service from which a generic repository is accessed. As I have 4 subtypes, it would be good to have a 'generic' viewmodel used for all of these. Problem is of course is that I have to call a specific type into my generic repository, for example: BusinessToRetrieve = _repository .LoadEntity<Customer>(o => o.CustomerID == customerID); It would be good to be able to call <SomethingElse>, somethingElse being one or other of the subtypes), otherwise I shall have to create 4 near identical viemodels, which seems a waste of course! The subtype entity name is available to the viewmodel but I've been unable to figure out how to make the above call convert this into a type. An issue with achieving what I want is that presumably the lambda expression being passed in wouldn't be able to resolve on a 'generic' call ?

    Read the article

  • update jquery validation plugin dateISO javascript

    - by Ian McCullough
    Right now...the dateISO method is as follows: dateISO: function(value, element) { return this.optional(element) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value); }, but ive noticed that when a user enters something like 1991-99-99 it sees it as a "valid date" when it obviously is not. How would i change this code to have it check if the month is 01-12 and the date is 1-31?

    Read the article

  • Getting started with F#

    - by Ian Quigley
    What's a good way to get into F# programming? What's a good "Hello world" example and what simple examples can show me why I want to use it over C#. Also what tools do I need? I have WindowsXP, Visual Studio 2008 etc.

    Read the article

  • Source control products that support linked/shared files?

    - by Ian Boyd
    We're interested in moving from a source control system that supports the concept of shared or linked files. A shared file means: a file modified in one project, is automatically updated changed in every other project that uses that same file. It does this without a developer having to request it, reverse-integrate it, ask for it, or even want it. We're trying to see if any other commonly used source-control systems can meet our needs, and include linked or shared files. My limited research shows that: Team Foundation Server doesn't support sharing files Subversion doesn't support sharing files (including Externals) CVS doesn't support sharing files (including Modules) Anything else? (besides our current source control product, obviously) References Subversion and shared files across repositories/projects? How to share files between CVS projects? Will TFS ever support shared files for projects under source control?

    Read the article

  • Win32: IProgressDialog will not disappear until you mouse over it.

    - by Ian Boyd
    i'm using the Win32 progress dialog. The damnest thing is that when i call: progressDialog.StopProgressDialog(); it doesn't disappear. It stays on screen until the user moves her mouse over it - then it suddenly disappers. The call to StopProgressDialog returns right away (i.e. it's not a synchronous call). i can prove this by doing things after the call has returned: private void button1_Click(object sender, EventArgs e) { //Force red background to prove we've started this.BackColor = Color.Red; this.Refresh(); //Start a progress dialog IProgressDialog pd = (IProgressDialog)new ProgressDialog(); pd.StartProgressDialog(this.Handle, null, PROGDLG.Normal, IntPtr.Zero); //The long running operation System.Threading.Thread.Sleep(10000); //Stop the progress dialog pd.SetLine(1, "Stopping Progress Dialog", false, IntPtr.Zero); pd.StopProgressDialog(); pd = null; //Return form to normal color to prove we've stopped. this.BackColor = SystemColors.Control; this.Refresh(); } The form: starts gray turns red to show we've stared turns back to gray color to show we've called stop So the call to StopProgressDialog has returned, except the progress dialog is still sitting there, mocking me, showing the message: Stopping Progress Dialog Doesn't Appear for 10 seconds Additionally, the progress dialog does not appear on screen until the System.Threading.Thread.Sleep(10000); ten second sleep is over. Not limited to .NET WinForms The same code also fails in Delphi, which is also an object wrapper around Window's windows: procedure TForm1.Button1Click(Sender: TObject); var pd: IProgressDialog; begin Self.Color := clRed; Self.Repaint; pd := CoProgressDialog.Create; pd.StartProgressDialog(Self.Handle, nil, PROGDLG_NORMAL, nil); Sleep(10000); pd.SetLine(1, StringToOleStr('Stopping Progress Dialog'), False, nil); pd.StopProgressDialog; pd := nil; Self.Color := clBtnFace; Self.Repaint; end; PreserveSig An exception would be thrown if StopProgressDialog was failing. Most of the methods in IProgressDialog, when translated into C# (or into Delphi), use the compiler's automatic mechanism of converting failed COM HRESULTS into a native language exception. In other words the following two signatures will throw an exception if the COM call returned an error HRESULT (i.e. a value less than zero): //C# void StopProgressDialog(); //Delphi procedure StopProgressDialog; safecall; Whereas the following lets you see the HRESULT's and react yourself: //C# [PreserveSig] int StopProgressDialog(); //Delphi function StopProgressDialog: HRESULT; stdcall; HRESULT is a 32-bit value. If the high-bit is set (or the value is negative) it is an error. i am using the former syntax. So if StopProgressDialog is returning an error it will be automatically converted to a language exception. Note: Just for SaG i used the [PreserveSig] syntax, the returned HRESULT is zero; MsgWait? The symptom is similar to what Raymond Chen described once, which has to do with the incorrect use of PeekMessage followed by MsgWaitForMultipleObjects: "Sometimes my program gets stuck and reports one fewer record than it should. I have to jiggle the mouse to get the value to update. After a while longer, it falls two behind, then three..." But that would mean that the failure is in IProgressDialog, since it fails equally well on CLR .NET WinForms and native Win32 code.

    Read the article

  • One repository per table or one per functional section?

    - by Ian Roke
    I am using ASP.NET MVC 2 and C# with Entity Framework 4.0 to code against a normalised SQL Server database. A part of my database structure contains a table of entries with foreign keys relating to sub-tables containing drivers, cars, engines, chassis etc. I am following the Nerd Dinner tutorial which sets up a repository for dinners which is fair enough. Do I do one for drivers, one for engines, one for cars and so on or do I do one big one for entries? Which is the best practise for this type of work? I am still new to this method of coding.

    Read the article

  • Recommendations for a .NET component to access an email inbox

    - by Ian Nelson
    I've been asked to write a Windows service in C# to periodically monitor an email inbox and insert the details of any messages received into a database table. My instinct is to do this via POP3 and sure enough, Googling for ".NET POP3 component" produces countless (ok, 146,000) results. Has anybody done anything similar before and can you recommend a decent component that won't break the bank (a few hundred dollars maximum)? Would there be any benefits to using IMAP rather than POP3?

    Read the article

  • SQL Server: Must numbers all be specified with latin numeral digits?

    - by Ian Boyd
    Does SQL server expect numbers to be specified with digits from the latin alphabet, e.g.: 0123456789 Is it valid to give SQL Server digits in other alphabets? Rosetta Stone: Latin: 01234567890 Arabic: ?????????? Bengali: ?????????? i know that the client (ADO) will convert 8-bit strings to 16-bit unicode strings using the current culture. But the client is also converting numbers to strings using their current culture, e.g.: SELECT * FROM Inventory WHERE Quantity > ???,?? Which throws SQL Server for fits. i know that the server/database has it's defined code page and locale, but that is for strings. Will SQL Server interpret numbers using the active (or per-login specified) locale, or must all numeric values be specifid with latin numeral digits?

    Read the article

  • Relational database data explorer / visualization?

    - by Ian Boyd
    Is there a tool that can let one browse relational data as a graph of connected nodes? For example, i'm faced with trying to cleanse some anomolous data. i can start with two offending rows. In this particular example, the TransactionID should, by business rules, be unique to the table, but i find a transaction that violates that rule: SELECT * FROM LCTTrans WHERE TransactionID = 1075048 LCTID TransactionID ========= ============= 4358 1075048 4359 1075048 2 row(s) affected But really what i want to begin to hunt down all the related data, to try to see which is right. So this hypothetical software would start by showing me these two rows: Next, i want to see that transaction that is linked into this table: Now that transaction points to an MAL, so show me that: Now lets add those two LCTs, that the transaction is "on". A transaction can be on only one LCT, yet this one is pointing to two: Okay computer, both of those LCTs point to an MAL and the transaction that created them, show me those: Those last two transactions, they also point at an MAL, and they themselves point to an LCT, show me those: Okay, now are there any entries in LCTTrans that point to LCTs 4358 or 4359?... And so on, and so on. Now i did all this manually, running single selects, copying and pasting uniqueidentifier keys and converting them into friendly id numbers so i could easily see the relationships. Is there software that can do this?

    Read the article

  • .NET: What's the difference between HttpMethod and RequestType of HttpRequest?

    - by Ian Boyd
    The HttpRequest class defines two properties: HttpMethod: Gets the HTTP data transfer method (such as GET, POST, or HEAD) used by the client. public string HttpMethod { get; } The HTTP data transfer method used by the client. and RequestType: Gets or sets the HTTP data transfer method (GET or POST) used by the client. public string RequestType { get; set; } A string representing the HTTP invocation type sent by the client. What is the difference between these two properties? When would i want to use one over the other? Which is the proper one to inspect to see what data transfer method was used by the client? The documentation indicates that HttpMethod will return whatever verb was used: such as GET, POST, or HEAD while the documentation on RequestType seems to indicate only one of two possible values: GET or POST i test with a random sampling of verbs, and both properties seem to support all verbs, and both return the same values: Testing: Client Used HttpMethod RequestType GET GET GET POST POST POST HEAD HEAD HEAD CONNECT CONNECT CONNECT MKCOL MKCOL MKCOL PUT PUT PUT FOOTEST FOOTEST FOOTEST What is the difference between: HttpRequest.HttpMethod HttpRequest.RequestType and when should i use one over the other? Keywords: iis asp.net http httprequest httphandler

    Read the article

  • Using a WCF Service Library from Silverlight

    - by Ian Oakes
    I've added a WCF Service Library to a Silverlight project. But when I try calling a method on the service I get a CommunicationException complaining about accessing a service in a cross-domain way. I've tried adding both a crossdomain.xml and clientaccesspolicyfile.xml to the service library project, but it doesn't help. Any idea what I'm doing wrong?

    Read the article

  • Is there a 3 way merger tool that “understands” common refactoring?

    - by Ian Ringrose
    When a simple refactoring like “rename field” has been done on one branch it can be very hard to merge the changes into the other branches. (Extract method is much harder as the merge tools don’t seem to match the unchanged blocks well) Now in my dreams, I am thinking of a tool that can record (or work out) what well defined refactoring operations have been done on one branch and then “replay” them on the other branch, rather than trying to merge every line the refactoring has affected. see also "Is there an intelligent 3rd merge tool that understands VB.NET" for the other half of my pain! Also has anyone try something like MolhadoRef (blog article about MolhadoRef and Refactoring-aware SCM), This is, in theory, refactoring-aware source control.

    Read the article

  • How do I scrape information off ASP.NET websites when paging and JavaScript links are being used?

    - by Ian Roke
    I have been given a staff list which is supposed to be up to date but it doesn't match an intranet People Finder which is written in ASP.NET. As the information is sensitive I am not able to access the database the People Finder is using so the only way I can get at the information is by scraping the structure starting at the top brass at the top and then going through each tier in turn. Each person has a Staff number which then forms the URL http://intranet/peoplefinder/index.aspx?srn=ABC1234 and then all the people who report to them are listed underneth in the format <a id="gvEmployees_ctl03_lnkFullName" href="index.aspx?srn=ABC4321" target="_self"> where each URL indicates the Staff number and provides a link to their team. The trouble arises when the teams are big as paging is implemented in the GridView with an URL such as <a href="javascript:__doPostBack('gvEmployees','Page$2')">2</a>. How would I scrape this page, capture the SRN and other details along with the people who report to the person on all pages of the GridView then loop through each reportee and do the same process until the whole list is complete?

    Read the article

  • How can I transfer an NHibernate PersistentGenericSet over WCF

    - by Ian Oakes
    I'm trying to send objects retrieved by NHibernate over WCF, but whenever a have a property of ICollection I get an exception. When NHibernate gets the data from the database this property is intitialized with an instance of PersistentGenericSet. Is there a way I can send a PersistentGenericSet over WCF? -or- Is there some way making NHibernate initialize these properties with another type?

    Read the article

  • Vista/7: How to get glass color?

    - by Ian Boyd
    How do you use DwmGetColorizationColor? The documentation says it returns two values: a 32-bit 0xAARRGGBB containing the color used for glass composition a boolean parameter that is true "if the color is an opaque blend" (whatever that means) Here's a color that i like, a nice puke green: You can notice the color is greeny, and the translucent title bar (against a white background) shows the snot color very clearly: i try to get the color from Windows: DwmGetColorizationColor(dwCcolorization, bIsOpaqueBlend); And i get dwColorization: 0x0D0A0F04 bIsOpaqueBlend: false According to the documentation this value is of the format AARRGGBB, and so contains: AA: 0x0D (13) RR: 0x0A (10) GG: 0x0F (15) BB: 0x04 (4) This supposedly means that the color is (10, 15, 4), with an opacity of ~5.1%. But if you actually look at this RGB value, it's nowhere near my desired snot green. Here is (10, 15, 4) with zero opacity (the original color), and (10,15,4) with 5% opacity against a white/checkerboard background: So the question is: How to get glass color in Windows Vista/7? i tried using DwmGetColorizationColor, but that doesn't work very well. A person with same problem, but a nicer shiny picture to attract you squirrels: So, it boils down to – DwmGetColorizationColor is completely unusable for applications attempting to apply the current color onto an opaque surface. i love this guy's screenshots much better than mine. Using his screenshots as a template, i made up a few more sparklies: For the last two screenshots, the alpha blended chip is a true partially transparent PNG, blending to your browser's background. Cool! (i'm such a geek) Edit 2: Had to arrange them in rainbow color. (i'm such a geek) Edit 3: Well now i of course have to add Yellow. Undocumented/Unsupported/Fragile Workarounds There is an undocumented export from DwmApi.dll at entry point 137, which we'll call DwmGetColorizationParameters: HRESULT GetColorizationParameters_Undocumented(out DWMCOLORIZATIONPARAMS params); struct DWMCOLORIZATIONPARAMS { public UInt32 ColorizationColor; public UInt32 ColorizationAfterglow; public UInt32 ColorizationColorBalance; public UInt32 ColorizationAfterglowBalance; public UInt32 ColorizationBlurBalance; public UInt32 ColorizationGlassReflectionIntensity; public UInt32 ColorizationOpaqueBlend; } We're interested in the first parameter: ColorizationColor. We can also read the value out of the registry: HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM ColorizationColor: REG_DWORD = 0x6614A600 So you pick your poison of creating appcompat issues. You can rely on an undocumented API (which is bad, bad, bad, and can go away at any time) use an undocumented registry key (which is also bad, and can go away at any time) See also Is there a list of valid parameter combinations for GetThemeColor / Visual Styles API How does Windows change Aero Glass color? DWM - Colorization Color Handling Using DWMGetColorizationColor Retrieving Aero Glass base color for opaque surface rendering i've been wanting to ask this question for over a year now. i always knew that it's impossible to answer, and that the only way to get anyone to actually pay attention is to have colorful screenshots; developers are attracted to shiny things. But on the downside it means i had to put all kinds of work into making the lures.

    Read the article

  • How does a WCF server inform a WCF client about changes? (Better solution then simple polling, e.g.

    - by Ian Ringrose
    see also "WCF push to client through firewall" I need to have a WCF client that connect to a WCF server, then when some of the data changes on the server the clients need to update its display. As there is likely to be a firewall between the clients and the server. All communications must be over HTTP The server can not make an (physical) outgoing call to the client. As I am writing both the client and the server I do not need to limit the solution to only using soap etc. I am looking for built in surport for "long polling" / "Comet" etc Thanks for the most informative answer from Drew Marsh on how to implement long polling in WCF. However I thought the main “selling point” of WCF was that you could do this sort of thing just by configuring the channels to be used in the config file. E.g I want a channel that logically two way but physically incoming only.

    Read the article

  • Delphi: Fast(er) widestring concatenation

    - by Ian Boyd
    i have a function who's job is to convert an ADO Recordset into html: class function RecordsetToHtml(const rs: _Recordset): WideString; And the guts of the function involves a lot of wide string concatenation: while not rs.EOF do begin Result := Result+CRLF+ '<TR>'; for i := 0 to rs.Fields.Count-1 do Result := Result+'<TD>'+VarAsString(rs.Fields[i].Value)+'</TD>'; Result := Result+'</TR>'; rs.MoveNext; end; With a few thousand results, the function takes, what any user would feel, is too long to run. The Delphi Sampling Profiler shows that 99.3% of the time is spent in widestring concatenation (@WStrCatN and @WstrCat). Can anyone think of a way to improve widestring concatenation? i don't think Delphi 5 has any kind of string builder. And Format doesn't support Unicode. And to make sure nobody tries to weasel out: pretend you are implementing the interface: IRecordsetToHtml = interface(IUnknown) function RecordsetToHtml(const rs: _Recordset): WideString; end; Update One I thought of using an IXMLDOMDocument, to build up the HTML as xml. But then i realized that the final HTML would be xhtml and not html - a subtle, but important, difference. Update Two Microsoft knowledge base article: How To Improve String Concatenation Performance

    Read the article

  • Can't compare the norm of a vector to 1 in matlab

    - by Ian
    I'm trying to find out wether a matrix is orthonormal. I begin by checking if the vectors are normal by doing for j=1:2; if norm(S:,j) ~= 1; return; % Not normal vector end end But when norm returns 1.0000 comparing that to 1 is true and the function returns, which is not what i want. Any ideas? Thx

    Read the article

  • Is there any working implementation of reverse mode automatic differentiation for Haskell?

    - by Ian Fiske
    The closest-related implementation in Haskell I have seen is the forward mode at http://hackage.haskell.org/packages/archive/fad/1.0/doc/html/Numeric-FAD.html. The closest related related research appears to be reverse mode for another functional language related to Scheme at http://www.bcl.hamilton.ie/~qobi/stalingrad/. I see reverse mode in Haskell as kind of a holy grail for a lot of tasks, with the hopes that it could use Haskell's nested data parallelism to gain a nice speedup in heavy numerical optimization.

    Read the article

  • Python Socket Getting Connection Reset

    - by Ian
    I created a threaded socket listener that stores newly accepted connections in a queue. The socket threads then read from the queue and respond. For some reason, when doing benchmarking with 'ab' (apache benchmark) using a concurrency of 2 or more, I always get a connection reset before it's able to complete the benchmark (this is taking place locally, so there's no external connection issue). class server: _ip = '' _port = 8888 def __init__(self, ip=None, port=None): if ip is not None: self._ip = ip if port is not None: self._port = port self.server_listener(self._ip, self._port) def now(self): return time.ctime(time.time()) def http_responder(self, conn, addr): httpobj = http_builder() httpobj.header('HTTP/1.1 200 OK') httpobj.header('Content-Type: text/html; charset=UTF-8') httpobj.header('Connection: close') httpobj.body("Everything looks good") data = httpobj.generate() sent = conn.sendall(data) def http_thread(self, id): self.log("THREAD %d: Starting Up..." % id) while True: conn, addr = self.q.get() ip, port = addr self.log("THREAD %d: responding to request: %s:%s - %s" % (id, ip, port, self.now())) self.http_responder(conn, addr) self.q.task_done() conn.close() def server_listener(self, host, port): self.q = Queue.Queue(0) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind( (host, port) ) sock.listen(5) for i in xrange(4): #thread count thread.start_new(self.http_thread, (i+1, )) while True: self.q.put(sock.accept()) sock.close() server('', 9999) When running the benchmark, I get totally random numbers of good requests before it errors out, usually between 4 and 500. Edit: Took me a while to figure it out, but the problem was in sock.listen(5). Because I was using apache benchmark with a higher concurrency (5 and up) it was causing the backlog of connections to pile up, at which point the connections started getting dropped by the socket.

    Read the article

  • XSD NewDataSet Namespace?

    - by Ian
    I'm running XSD on an XML file and getting something strange. Depending on the depth of elements it produces a 'NewDataSet' element which will then is prefixed in Visual Studio to my auto-generated classes which is something I don't want. I've got quite a complex structure and am just trying to add a simple version element or attribute which is causing the problem. The simplest demo I could come up with is this. <A> <B>Text</B> </A> Running this through XSD says there is an element called 'NewDataSet' which may or may not appear and will prefix namespaces. <A> <B> <C>Text</C> </B> </A> This example works as expected and there is no magic 'NewDataSet' element in the generated XSD file.

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >