Search Results

Search found 356 results on 15 pages for 'pat wallace'.

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

  • Modifying jQuery ajax request Connectino header

    - by Pat
    I'm trying to modify the Connection header with the following code with no success jQuery.ajax ( { url: URL, async: boolVariable, beforeSend: function(xhr) { xhr.setRequestHeader("Connection", "close"); } } ) The request headers via Firebug show: Connection keep-alive X-Requested-With XMLHttpRequest Any odd bugs/problems with setting this particular header known? Or is there something I'm doing wrong?

    Read the article

  • Tool to generate a GUI (WinForms or WPF) from a class.

    - by Pat
    Say we've got a class like public class Doer { public int Timeout {get;set;} public string DoIt(string input) { string toReturn; // Do something that involves a Timeout return toReturn; } } Is there a tool that would create a Form or Control for prototyping this class? The GUI might have a NumericUpDown control with a label of "Timeout" and a GroupBox with a TextBox for "input" and a button labeled "DoIt" with an eventhandler that calls Doer.DoIt with the Text property of the input TextBox and puts the response in another TextBox.

    Read the article

  • Getting size of a specific byte array from an array of pointers to bytes

    - by Pat James
    In the following example c code, used in an Arduino project, I am looking for the ability to get the size of a specific byte array within an array of pointers to bytes, for example void setup() { Serial.begin(9600); // for debugging byte zero[] = {8, 169, 8, 128, 2,171,145,155,141,177,187,187,2,152,2,8,134,199}; byte one[] = {8, 179, 138, 138, 177 ,2,146, 8, 134, 8, 194,2,1,14,199,7, 145, 8,131, 8,158,8,187,187,191}; byte two[] = {29,7,1,8, 169, 8, 128, 2,171,145,155,141,177,187,187,2,152,2,8,134,199, 2, 2, 8, 179, 138, 138, 177 ,2,146, 8, 134, 8, 194,2,1,14,199,7, 145, 8,131, 8,158,8,187,187,191}; byte* numbers[3] = {zero, one, two }; function(numbers[1], sizeof(numbers[1])/sizeof(byte)); //doesn't work as desired, always passes 2 as the length function(numbers[1], 25); //this works } void loop() { } void function( byte arr[], int len ) { Serial.print("length: "); Serial.println(len); for (int i=0; i<len; i++){ Serial.print("array element "); Serial.print(i); Serial.print(" has value "); Serial.println((int)arr[i]); } } In this code, I understand that sizeof(numbers1)/sizeof(byte)) doesn't work because numbers1 is a pointer and not the byte array value. Is there a way in this example that I can, at runtime, get at the length of a specific (runtime-determined) byte array within an array of pointers to bytes? Understand that I am limited to developing in c (or assembly) for an Arduino environment. Also open to other suggestions rather than the array of pointers to bytes. The overall objective is to organize lists of bytes which can be retrieved, with length, at runtime.

    Read the article

  • Jquery date in a adropdown with interval

    - by Zoom Pat
    I am trying to use Jquery to display dates in a dropdown with interval of half month... so the first value would be the coming month's 1st, then second will be the coming month's 15th and third value would be next to next month's first and so on... If today date is less than 15th then the first value would be the 15th of current month. What will be the best or a cleaner way to do this... (want to display in the dropdown) Thanks

    Read the article

  • Calculate an Internet (aka IP, aka RFC791) checksum in C#

    - by Pat
    Interestingly, I can find implementations for the Internet Checksum in almost every language except C#. Does anyone have an implementation to share? Remember, the internet protocol specifies that: "The checksum field is the 16 bit one's complement of the one's complement sum of all 16 bit words in the header. For purposes of computing the checksum, the value of the checksum field is zero." More explanation can be found from Dr. Math. There are some efficiency pointers available, but that's not really a large concern for me at this point. Please include your tests! (Edit: Valid comment regarding testing someone else's code - but I am going off of the protocol and don't have test vectors of my own and would rather unit test it than put into production to see if it matches what is currently being used! ;-) Edit: Here are some unit tests that I came up with. They test an extension method which iterates through the entire byte collection. Please comment if you find fault in the tests. [TestMethod()] public void InternetChecksum_SimplestValidValue_ShouldMatch() { IEnumerable<byte> value = new byte[1]; // should work for any-length array of zeros ushort expected = 0xFFFF; ushort actual = value.InternetChecksum(); Assert.AreEqual(expected, actual); } [TestMethod()] public void InternetChecksum_ValidSingleByteExtreme_ShouldMatch() { IEnumerable<byte> value = new byte[]{0xFF}; ushort expected = 0xFF; ushort actual = value.InternetChecksum(); Assert.AreEqual(expected, actual); } [TestMethod()] public void InternetChecksum_ValidMultiByteExtrema_ShouldMatch() { IEnumerable<byte> value = new byte[] { 0x00, 0xFF }; ushort expected = 0xFF00; ushort actual = value.InternetChecksum(); Assert.AreEqual(expected, actual); }

    Read the article

  • Modifying jQuery ajax request Connection header

    - by Pat
    I'm trying to modify the Connection header with the following code with no success jQuery.ajax({ url: URL, async: boolVariable, beforeSend: function(xhr) { xhr.setRequestHeader("Connection", "close"); } }) The request headers via Firebug show: Connection keep-alive X-Requested-With XMLHttpRequest Any odd bugs/problems with setting this particular header known? Or is there something I'm doing wrong?

    Read the article

  • Alternatives to HTML for website creation?

    - by Pat
    Hello It seems the most common aproach to web design is to use HTML/XHTML & CSS in conjunction with other technologies or languages like Javascript or PHP. On a theoretical level, I'm interested to know what other languages or technologies could be used to build an entire site without using a single HTML tag or CSS style for styling/positioning? Could a website be made only using XML or PHP alone, including actual styling and positioning? Presumably Flash sites are till embedded in HTML tags? Thanks

    Read the article

  • Easiest way to retrofit retry logic on LINQ to SQL migration to SQL Azure

    - by Pat James
    I have a couple of existing ASP .NET web forms and MVC applications that currently use LINQ to SQL with a SQL Server 2008 Express database on a Windows VPS: one VPS for both IIS and SQL. I am starting to outgrow the VPS's ability to effectively host both SQL and IIS and am getting ready to split them up. I am considering migrating the database to SQL Azure and keeping IIS on the VPS. After doing initial research it sounds like implementing retry logic in the data access layer is a must-do when adopting SQL Azure. I suspect this is even more critical to implement in my situation where IIS will be on a VPS outside of the Azure infrastructure. I am looking for pointers on how to do this with the least effort and impact on my existing code base. Is there a good retry pattern that can be applied once at the LINQ to SQL data access layer, as opposed to having to wrap all of my LINQ to SQL operations in try/catch/wait/retry logic?

    Read the article

  • Using Interface Builder tags

    - by pat
    I'm using interface builder's tag feature to access some UILabels I'm instantiating in a xib file. Since this a UITextViewCell I want to avoid superfluous method calls, but I want to do it right too. Thus when I do: UILabel *label = (UILabel *)[cell viewWithTag:1]; I'm wondering if I should wrap it up like so: if([[cell viewWithTag:1] isKindOfClass [UITableViewCell class]]) { UILabel *label = (UILabel *)[cell viewWithTag:1]; } Any discussion on this would be appreciated. Thanks

    Read the article

  • How can I explain to a programmer that CSS positioning has many benefits over table based layouts?

    - by Pat
    I have a friend who wishes to work as a freelance web developer, but insists that tables are the way forwards for layouts. Several points he maintains in favour of tables: 1 This is what was taught at the beginning of 10 years of programming & computer science degrees. 2 Large companies use tables to achieve 'technical' things. 3 It saves time I have coded him some examples of CSS exactly matching table based layouts, and provided many links to articles explaining SEO and accessibility benefits. From the perspective of a client, I have been explaining to him that I wouldn't hire someone using outdated methods as their main strategy for layout. As he is my friend and I wish him every success, I believe it is important for him to gain the best start when pitching for work. The question again: How can I explain to a programmer that CSS positioning has many benefits over table based layouts?

    Read the article

  • Jquery date in a dropdown with interval

    - by Zoom Pat
    I am trying to use Jquery to display dates in a dropdown with interval of half month... so the first value would be the coming month's 1st, then second will be the coming month's 15th and third value would be next to next month's first and so on... If today date is less than 15th then the first value would be the 15th of current month. What will be the best or a cleaner way to do this... (want to display in the dropdown) Thanks

    Read the article

  • Powershell and some simple string manipulation

    - by Pat
    need some help with building a powershell script to help with some basic string manipulation. I know just enough powershell to get in trouble, but can't figure out the syntax or coding to make this work. I have a text file that looks like this - Here is your list of servers: server1 server2.domain.local server3 Total number of servers: 3 I need to take that text file and drop the first and last lines (Always first and last.) Then I need to take every other line and basically turn it into a CSV file. The final output should be a text file that looks like this - server1,server2.domain.local,server3 Any suggestions on where to start? Thanks!

    Read the article

  • What's your favorite programmable calculator?

    - by Pat Notz
    The HP-32S still holds a soft spot in my heart, even though it only had 4 registers. I have fond memories of writing a nonlinear solver for finding an azeotrope curve during a Thermodynamics final. Despite the increase in power, memory, pixels and features the HP-32G that followed never could steal my heart away. Here's to you, HP-32S. Let's hear it, what's your favorite programmable calculator? As with all poll type questions, do NOT submit a new answer unless your answer is not represented. Vote up your answer instead of adding yet another TI-85 or HP-49 to the list, and add comments to that answer if you want to relate specifics. EDIT: I moved my photo into an answer for polling.

    Read the article

  • Install usb device without manager prompt

    - by Pat
    We have a usb device and the drivers (.inf, libusb.dll, libusb.sys) and can install it using Windows' Device Installation Wizard (by pointing to the .inf file). However, we need to install the drivers without using the wizard (passively, so the user doesn't need to do anything). Does anyone know how this can be achieved?

    Read the article

  • How do you make an existing git branch track a remote branch?

    - by Pat Notz
    I know how to make a new branch that tracks remote branches. But how do I make an existing branch track a remote branch. I know I can just edit the .git/config file but it seems there should be an easier way. EDIT It looks like this can't currently be done in a convenient way with the current (1.6.1.x) version of Git. UPDATE Git version = 1.7.0 supports this. See the accepted answer

    Read the article

  • Foolproof way to check for nonzero (error) return code in windows batch file

    - by Pat
    Intro There's a lot of advice out there for dealing with return codes in batch files (using the ERROLEVEL mechanism), e.g. Get error code from within a batch file ERRORLEVEL inside IF Some of the advice is to do if errorlevel 1 goto somethingbad, while others recommend using the %ERRORLEVEL% variable and using ==, EQU, LSS, etc. There seem to be issues within IF statements and such, so then delayedexpansion is encouraged, but it seems to come with quirks of its own. Question What is a foolproof (i.e. robust, so it will work on nearly any system with nearly any return code) way to know if a bad (nonzero) code has been returned? My attempt For basic usage, the following seems to work ok to catch any nonzero return code: if not errorlevel 0 ( echo error level was nonzero )

    Read the article

  • Seperate compilation in C++

    - by Pat Murray
    Suppose you are creating a class with multiple .cpp files (which each contain the implementation of a member function) and have the class' declaration in a .h file. Also, each .cpp file includes the .h file via the include directive. I was told that if you change the implementation of any of the member functions (.cpp files) that you will have to recompile every .cpp file in order to run the program. That is, if I had 5 member functions (each implemented in a .cpp file) and I changed the implementation of 1 of the .cpp files I would have to compile the 1 .cpp file I changed AND the 4 other .cpp files I didn't change in order to correctly run my program. My question, if the previous statement is true, is why is the statement is true? Any insight on this concept would be helpful.

    Read the article

  • Data Warehouse: Modelling a future schedule

    - by Pat
    I'm creating a DW that will contain data on financial securities such as bonds and loans. These securities are associated with payment schedules. For example, a bond could pay quarterly, while a mortage would usually pay monthly (sometimes biweekly). The payment schedule is created when the security is traded and, in the majority of cases, will remain unchanged. However, the design would need to accomodate those cases where it does change. I'm currently attempting to model this data and I'm having difficulty coming up with a workable design. One of the most commonly queried fields is "next payment date". Users often want to know when a security will pay next. Therefore, I want to make it as easy as possible for them to get the next payment date and amount for each security. Also, users often run historical queries in which case they'd want the next payment date and amount as of a specific point in time. For example, they may want to look back at 1/31/09 and query the next payment dates (which would usually be in February 2009 for mortgages). It's also common that they want to query a security's entire payment schedule, which might consist of 360 records (30 year mortgage x 12 payments/year). Since the next payment date and amount would be changing each month or even biweekly, these fields wouldn't seem to fit into a slow-changing dimension very well. It would probably make more sense to use a fact table, but I'm unsure of how to model it. Any ideas would be greatly appreciated.

    Read the article

  • How to take a collection of bytes and pull typed values out of it?

    - by Pat
    Say I have a collection of bytes var bytes = new byte[] {0, 1, 2, 3, 4, 5, 6, 7}; and I want to pull out a defined value from the bytes as a managed type, e.g. a ushort. What is a simple way to define what types reside at what location in the collection and pull out those values? One (ugly) way is to use System.BitConverter and a Queue or byte[] with an index and simply iterate through, e.g.: int index = 0; ushort first = System.BitConverter.ToUint16(bytes, index); index += 2; // size of a ushort int second = System.BitConverter.ToInt32(bytes, index); index += 4; ... This method gets very, very tedious when you deal with a lot of these structures! I know that there is the System.Runtime.InteropServices.StructLayoutAttribute which allows me to define the locations of types inside a struct or class, but there doesn't seem to be a way to import the collection of bytes into that struct. If I could somehow overlay the struct on the collection of bytes and pull out the values, that would be ideal. E.g. Foo foo = (Foo)bytes; // doesn't work because I'd need to implement the implicit operator ushort first = foo.first; int second = foo.second; ... [StructLayout(LayoutKind.Explicit, Size=FOO_SIZE)] public struct Foo { [FieldOffset(0)] public ushort first; [FieldOffset(2)] public int second; } Any thoughts on how to achieve this?

    Read the article

  • Should I bother with C++ or go straight to C#?

    - by Pat Riley
    I have been writing embedded C applications for almost 20 years. In the last few years I have written quite a few PC based GUI interfaces in Visual C so I could interface my embedded systems to a PC. Although my primary work will still be in deeply embedded C, I have finally decided to move my PC based tools into Ruby - (for quick scripting type stuff) and C++ or C# for GUI based interfaces and applications. Should I bother with C++ or just move straight to C#?

    Read the article

  • Differences between Zend Framework 1.8 and 1.10

    - by Pat
    I want to start learning Zend Framework. My only concern is that the most recent ZF book on Amazon with good reviews teaches version 1.8 of the framework, which is now about a year old. Do you think it would be a good idea to still pick up that book or is it too old now?

    Read the article

  • Timing issues with playback of the HTML5 Audio API

    - by pat
    I'm using the following code to try to play a sound clip with the HTML5 Audio API: HTMLAudioElement.prototype.playClip = function(startTime, stopTime) { this.stopTime = stopTime; this.currentTime = startTime; this.play(); $(this).bind('timeupdate', function(){ if (this.ended || this.currentTime >= stopTime) { this.pause(); $(this).unbind('timeupdate'); } }); } I utilize this new playClip method as follows. First I have a link with some data attributes: <a href=# data-stop=1.051 data-start=0.000>And then I was thinking,</a> And finally this bit of jQuery which runs on $(document).ready to hook up a click on the link with the playback: $('a').click(function(ev){ $('a').click(function(ev){ var start = $(this).data('start'), stop = $(this).data('stop'), audio = $('audio').get(0), $audio = $(audio); ev.preventDefault(); audio.playClip(start,stop); }) This approach seems to work, but there's a frustrating bug: sometimes, the playback of a given clip plays beyond the correct data-stop time. I suspect it could have something to do with the timing of the timeupdate event, but I'm no JS guru and I don't know how to begin debugging the problem. Here are a few clues I've gathered: The same behavior appears to come up in both FF and Chrome. The playback of a given clip actually seems to vary a bit -- if I play the same clip a couple times in a row, it may over-play a different amount of time on each playing. Is the problem here the inherent accuracy of the Audio API? My app needs milliseconds. Is there a problem with the way I'm using jQuery to bind and unbind the timeupdate event? I tried using the jQuery-less approach with addEventListener but I couldn't get it to work. Thanks in advance, I would really love to know what's going wrong.

    Read the article

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