Search Results

Search found 1941 results on 78 pages for 'james ferguson'.

Page 38/78 | < Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >

  • C# TCP Async EndReceive() throws InvalidOperationException ONLY on Windows XP 32-bit

    - by James Farmer
    I have a simple C# Async Client using a .NET socket that waits for timed messages from a local Java server used for automating commands. The messages come in asynchronously and is written to a ring buffer. This implementation seems to work fine on Windows Vista/7/8 and OSX, but will randomly throw this exception while it's receiving a message from the local Java server: Unhandled Exception: System.InvalidOperationException: EndReceive can only be called once for each asynchronous operation.     at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult, SocketError& errorCode)     at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)     at SocketTest.Controller.RecvAsyncCallback(IAsyncResult ar)     at System.Net.LazyAsyncResult.Complete(IntPtr userToken)     ... I've looked online for this error, but have found nothing really helpful. This is the code where it seems to break: /// <summary> /// Callback to receive socket data /// </summary> /// <param name="ar">AsyncResult to pass to End</param> private void RecvAsyncCallback(IAsyncResult ar) { // The exception will randomly happen on this call int bytes = _socket.EndReceive(_recvAsyncResult); // check for connection closed if (bytes == 0) { return; } _ringBuffer.Write(_buffer, 0, bytes); // Checks buffer CheckBuffer(); _recvAsyncResult = _sock.BeginReceive(_buffer, 0, _buffer.Length, SocketFlags.None, RecvAsyncCallback, null); } The error doesn't happen on any particular moment except in the middle of receiving a message. The message itself can be any length for this to happen, and the exception can happen right away, or sometimes even up to a minute of perfect communication. I'm pretty new with sockets and network communication, and I feel I might be missing something here. I've tested on at least 8 different computers, and the only similarity with the computers that throw this exception is that their OS is Windows XP 32-bit.

    Read the article

  • stack.ToList() in .NET - order of elements?

    - by James M.
    When using the .ToList() extension method on a Stack<T>, is the result the same as popping each element and adding to a new list (reverse of what was pushed)? If so, is this because it really is iterating over each element, or does it store the elements in reverse internally and slip the array into a new List<T>?

    Read the article

  • Job Opportunities

    - by James
    I have a few questions about my job opportunities and I appreaciate it if people could give me some feedback on what I should have in front of me. I am graduatating from a University of Wisconsin--La Crosse this December with a degree in CS and a math minor. I have a cumulative GPA of 3.84 and a major GPA of 4.0 right now (though I still have many classes in front of me). I already have a degree from the U of Minnesota (History, 3.69 GPA) and have worked in the business world for 3+ years (working for a small company in the baseball world, doing some computer programming, statistical research, operations work, technical writing, etc.) I know Java and C well, also am comfortable with Perl. I should have a good grasp of SQL by graduation. I am looking to get a nice programming job (and will be open to moving). Anyone have any advice on things I should learn etc? Also, I would like to know what everyone thinks about my chances of landing a decent job (I realize that is subjective). Also, any ideas on salary I should be looking for (say I am working a metropolitan area). Thanks.

    Read the article

  • Correct permutation cycle for Verhoeff algorithm

    - by James
    Hello, I'm implementing the Verhoeff algorithm for a check digit scheme, but there seems to be some disagreement in web sources as to which permutation cycle should form the basis of the permutation table. Wikipedia uses: (36)(01589427) while apparently, Numerical Recipies uses a different cycle and this book uses: (0)(14)(23)(56789), quoted from a 1990 article by Winters. It also notes that Verhoeff used the one Wikipedia quotes. Now, my number theory is a little rusty, but the Wikipedia cycle clearly will repeat after the 8th power, while the book one will take 10, despite it saying that s^8=s. Table 2.14(b) has other errors in the 2-cycles, so this is dubious anyway. Unfortunately, I don't have copies of the original articles (and am too tight to pay/disgusted that 40-year old knowledge is still being held to ransom by publishers), nor a copy of Numerical Recipes to check (and am loath to install their paranoia-induced copy protection plug-in to view online). So does any one know which is correct? Are they both correct?

    Read the article

  • How do I DRY up my CouchDB views?

    - by James A. Rosen
    What can I do to share code among views in CouchDB? Example 1 -- utility methods Jesse Hallett has some good utility methods, including function dot(attr) { return function(obj) { return obj[attr]; } } Array.prototype.map = function(func) { var i, r = [], for (i = 0; i < this.length; i += 1) { r[i] = func(this[i]); } return r; }; ... Where can I put this code so every view can access it? Example 2 -- constants Similarly for constants I use in my application. Where do I put MyApp = { A_CONSTANT = "..."; ANOTHER_CONSTANT = "..."; }; Example 3 -- filter of a filter: What if I want a one view that filters by "is this a rich person?": function(doc) { if (doc.type == 'person' && doc.net_worth > 1000000) { emit(doc.id, doc); } } and another that indexes by last name: function(doc) { if (doc.last_name) { emit(doc.last_name, doc); } } How can I combine them into a "rich people by last name" view? I sort of want the equivalent of the Ruby my_array.select { |x| x.person? }.select { |x| x.net_worth > 1,000,000 }.map { |x| [x.last_name, x] } How can I be DRYer?

    Read the article

  • Source Control Checkin Comments at Top Of Source Files

    - by James Wiseman
    I've noticed a discrepancy with some source files in our system whereby some contain source-control checkin comments, and some do not. These comments are added automatically to the top of the file when it is checked in: * $Log: //vm1/Projects/Morpheus/Sleep.bdy-arc $ -- -- Rev 1.14 Apr 14 2009 15:32:52 John Smith --Fixed bugs 2292 and 2230. This seems to have been quite prevelant in all the compainies with which I have worked, but I must confess that I struggle to see the point. Generally the comments aren't that good, are ofen left by people who have long since departed, and even when they are of a high standard it is difficult to tie them to physical code changes. It also strikes me, that you are physically changing the file that you are checking in. Now, this may not be such a problem with files that will be compiled, but could be a disaster with others, e.g. JavaScript files. So really, my query is what was the motivation in concept behind providing this functionality in the first instance? Does anyone actually find these comments useful? Also, I would be curious to know if this was feature that is commonly supported within Source Control systems. I am aware of it with PVCS, VSS and Subversion (Subversion Keyword Substitution), however I wonder if it is also available in some of the more popular DVCSs. Your help, as always is much appreciated.

    Read the article

  • Font baseline in Silverlight v3

    - by James
    How do I get the baseline of a font in Silverlight v3. I need to be able to do some simple font metrics so that I can reproduce some online render using an external markup system and make the output looks the same. Silverlight renders fonts from top,left but the external system uses font baseline.

    Read the article

  • Using Windows Integrated Auth & Anonymous during redirect on IIS7

    - by James Black
    I have an application we bought that I need to integrate, and it uses jakarta connection to get to the application from IIS. So, the basic operation is: user goes to the url Gets redirected to the application SSO is enabled, so redirected back to IIS for fetching of domain credentials Back to application If username is blank show login page, else let user in. This is a simplification of all the steps, but the basic idea is here. My difficulty is that I need both Windows Integrated Auth and anonymous on, as some users won't have credentials, and need to be prompted for a username/password. I have looked at: http://stackoverflow.com/questions/2068546/iis-windows-authentication-before-anonymous already, but the user doesn't get to click on a link to decide. The application goes back to IIS looking for login.aspx and from there I want to either get their domain credentials or pass back to the application empty strings to signify that there are no credentials. It seems this isn't going to be possible though as if anonymous is on it doesn't make the 401 request so the credentials aren't passed. If I can't get this to work with just using an ASP page, could it be done using an ISAPI filter, or a module?

    Read the article

  • Masking FLV video in AS3 with PNG alpha channel.

    - by James Roberts
    Hey there, I'm trying to mask an FLV with a PNG alpha channel. I'm using BitmapData (from a PNG) but it's not working. Is there anything I'm missing? Cut up code below: var musclesLoader:Loader = new Loader(); var musclesContainer:Sprite = new Sprite(); var musclesImage:Bitmap = new Bitmap(); var musclesBitmapData:BitmapData; var musclesVideo:Video = new Video(752, 451.2); var connection:NetConnection = new NetConnection(); var stream:NetStream; function loadMuscles():void { musclesLoader.load(new URLRequest('img/muscles.png')); musclesLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, musclesComplete); } function musclesComplete():void { musclesBitmapData = new BitmapData(musclesLoader.content.width, musclesLoader.content.height, true, 0x000000); musclesImage.bitmapData = musclesBitmapData; musclesImage.smoothing = true; musclesContainer.addChild(musclesImage); contentContainer.addChild(musclesContainer); } function loadMusclesVideo():void { connection.connect(null); stream = new NetStream(connection); stream.client = this; musclesVideo.mask = musclesBitmapData; stage.addChild(musclesVideo); musclesVideo.attachNetStream(stream); stream.bufferTime = 1; stream.receiveAudio(true); stream.receiveVideo(true); stream.play("vid/muscles.flv"); } Outside this code I have a function that adds the containers to the stage, etc and places the objects in the appropriate spots. It sort of works - the mask applies, but in a square (the size of the boundaries of musclesBitmapData) rather than with the shape of the alpha channel. Is this the right way to go about this?

    Read the article

  • detecting pauses in a spoken word audio file using pymad, pcm, vad, etc

    - by james
    First I am going to broadly state what I'm trying to do and ask for advice. Then I will explain my current approach and ask for answers to my current problems. Problem I have an MP3 file of a person speaking. I'd like to split it up into segments roughly corresponding to a sentence or phrase. (I'd do it manually, but we are talking hours of data.) If you have advice on how to do this programatically or for some existing utilities, I'd love to hear it. (I'm aware of voice activity detection and I've looked into it a bit, but I didn't see any freely available utilities.) Current Approach I thought the simplest thing would be to scan the MP3 at certain intervals and identify places where the average volume was below some threshold. Then I would use some existing utility to cut up the mp3 at those locations. I've been playing around with pymad and I believe that I've successfully extracted the PCM (pulse code modulation) data for each frame of the mp3. Now I am stuck because I can't really seem to wrap my head around how the PCM data translates to relative volume. I'm also aware of other complicating factors like multiple channels, big endian vs little, etc. Advice on how to map a group of pcm samples to relative volume would be key. Thanks!

    Read the article

  • Open Source Graph Layout Library

    - by James Westgate
    I'm looking for an open source (GPL, LGPL etc) graph layout library for .net framework, preferably fully managed code. Im not worried about the visualisation aspect of things. I can find lots of them for Java, but none for .net... Thanks!

    Read the article

  • How do I resize a Google Map with JavaScript after it has loaded?

    - by Matthew James Taylor
    I have a 'mapwrap' div set to 400px x 400px and inside that I have a Google 'map' set to 100% x 100%. So the map loads at 400 x 400px, then with JavaScript I resize the 'mapwrap' to 100% x 100% of the screen - the google map resizes to the whole screen as I expected but tiles start disappearing before the right hand edge of the page. Is there a simple function I can call to cause the Google map to re-adjust to the larger size 'mapwrap' div?

    Read the article

  • Decoding a compressed short string; uncertain on compression used - Updated

    - by James
    Hi, I have a program that is compressing a string in an unknown way. I know a few inputs and the output produced, but I am not sure what is being used to compress the string. Here are my examples. (just 38 x a, no spaces or anything else) In: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" Out: "026900211AA63000026900"   (just 32 x a) In: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" Out: "0209001c1aa7a000020900" (31 x a, then 1 b) In: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab" Out: "0209000177c553c000020900" (31 x b, then 1 a) In: "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbba" Out: "0209001e7754f38000020900" In: "Hey wot u doing 2day u wanna do something" Out: "02990011C7C62E78CE6B8E3ACD83E81B37C5C5A6B9D1E1B06963DB5E71155C1000029900" (same as previous string, but with a space at the end) In: "Hey wot u doing 2day u wanna do something " Out: "02A90012C7718B9E339AE2EB360FA02CDF17177A674786DF4B1EDAF388AAE08000000002A90000" The only definite thing I can see so far is digit 2 and 3 are the amount of characters (hex value), ie first one is 26 = 38 Also the first 6 digits are repeated at the end Any help / advice would be great, thanks!

    Read the article

  • Maven-ear-plugin - excluding multiple modules i.e. jars, wars etc.

    - by James Murphy
    I've been using the Maven EAR plugin for creating my ear files for a new project. I noticed in the plugin documentation you can specify exclude statements for modules. For example the configuration for my plugin is as follows... <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId> <version>2.4.1</version> <configuration> <jboss> <version>5</version> </jboss> <modules> <!-- Include the templatecontroller.jar inside the ear --> <jarModule> <groupId>com.kewill.kdm</groupId> <artifactId>templatecontroller</artifactId> <bundleFileName>templatecontroller.jar</bundleFileName> <includeInApplicationXml>true</includeInApplicationXml> </jarModule> <!-- Exclude the following classes from the ear --> <jarModule> <groupId>javax.activation</groupId> <artifactId>activation</artifactId> <excluded>true</excluded> </jarModule> <jarModule> <groupId>antlr</groupId> <artifactId>antlr</artifactId> <excluded>true</excluded> </jarModule> ... declare multiple excludes <security> <security-role id="SecurityRole_1234"> <role-name>admin</role-name> </security-role> </security> </configuration> </plugin> </plugins> This approach is absolutely fine with small projects where you have say 4-5 modules to exclude. However, in my project I have 30+ and we've only just started the project so as it expands this is likely to grow. Besides explicitly declaring exclude statements per module is it possible to use wildcards or and exclude all maven dependencies flag to only include those modules i declare and exclude everything else? Is anyone aware of a more elegant solution?

    Read the article

  • CodeDom : compile partial class

    - by James
    I'm attempting to compile code in a text file to change a value in a TextBox on the main form of a WinForms application. Ie. add another partial class with method to the calling form. The form has one button (button1) and one TextBox (textBox1). The code in the text file is: this.textBox1.Text = "Hello World!!"; And the code: namespace WinFormCodeCompile { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { // Load code from file StreamReader sReader = new StreamReader(@"Code.txt"); string input = sReader.ReadToEnd(); sReader.Close(); // Code literal string code = @"using System; using System.Windows.Forms; namespace WinFormCodeCompile { public partial class Form1 : Form { public void UpdateText() {" + input + @" } } }"; // Compile code CSharpCodeProvider cProv = new CSharpCodeProvider(); CompilerParameters cParams = new CompilerParameters(); cParams.ReferencedAssemblies.Add("mscorlib.dll"); cParams.ReferencedAssemblies.Add("System.dll"); cParams.ReferencedAssemblies.Add("System.Windows.Forms.dll"); cParams.GenerateExecutable = false; cParams.GenerateInMemory = true; CompilerResults cResults = cProv.CompileAssemblyFromSource(cParams, code); // Check for errors if (cResults.Errors.Count != 0) { foreach (var er in cResults.Errors) { MessageBox.Show(er.ToString()); } } else { // Attempt to execute method. object obj = cResults.CompiledAssembly.CreateInstance("WinFormCodeCompile.Form1"); Type t = obj.GetType(); t.InvokeMember("UpdateText", BindingFlags.InvokeMethod, null, obj, null); } } } } When I compile the code, the CompilerResults returns an error that says WinFormCodeCompile.Form1 does not contain a definition for textBox1. Is there a way to dynamically create another partial class file to the calling assembly and execute that code? I assume I'm missing something really simple here.

    Read the article

  • using IE credentials to log on with c#

    - by james
    Hi i am writing a HTML parser for helping with some job duties, I can enter the site using IE explorer. but using csharp code i get an error i have tried using client.Credentials = CredentialCache.DefaultNetworkCredentials; client.Proxy.Credentials = CredentialCache.DefaultCredentials; i don't get the requested page, but an error page. if i can view page in explorer there must be a way to retrieve its html in C# (note that same page in other browsers requires authintication - not in IE) appreciate the help

    Read the article

  • wcf callback exception after updating to .net 4.0

    - by James
    I have a wcf service that uses callbacks with DualHttpBindings. The service pushes back a datatable of search results the client (for a long running search) as it finds them. This worked fine in .Net 3.5. Since I updated to .Net 4.0, it bombs out with a System.Runtime.FatalException that actually kills the IIS worker process. I have no idea how to even go about starting to fix this. Any recommendations appreciated. The info from the resulting event log is pasted below. An unhandled exception occurred and the process was terminated. Application ID: /LM/W3SVC/2/ROOT/CP Process ID: 5284 Exception: System.Runtime.FatalException Message: Object reference not set to an instance of an object. StackTrace: at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext) at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext) at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.Runtime.InputQueue1.AsyncQueueReader.Set(Item item) at System.Runtime.InputQueue1.Dispatch() at System.ServiceModel.Channels.ReliableDuplexSessionChannel.ProcessDuplexMessage(WsrmMessageInfo info) at System.ServiceModel.Channels.ReliableDuplexSessionChannel.HandleReceiveComplete(IAsyncResult result) at System.ServiceModel.Channels.ReliableDuplexSessionChannel.OnReceiveCompletedStatic(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.ServiceModel.Channels.ReliableChannelBinder1.InputAsyncResult1.OnInputComplete(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.Runtime.InputQueue1.AsyncQueueReader.Set(Item item) at System.Runtime.InputQueue1.Dispatch() at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) InnerException: * System.NullReferenceException* Message: Object reference not set to an instance of an object. StackTrace: at System.Web.HttpApplication.ThreadContext.Enter(Boolean setImpersonationContext) at System.Web.HttpApplication.OnThreadEnterPrivate(Boolean setImpersonationContext) at System.Web.AspNetSynchronizationContext.CallCallbackPossiblyUnderLock(SendOrPostCallback callback, Object state) at System.Web.AspNetSynchronizationContext.CallCallback(SendOrPostCallback callback, Object state) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)

    Read the article

  • How do I force Eclipse to rebuild if files in another project change (any change)?

    - by James Moore
    I've got an Eclipse (Galileo) project (called ProguardBuilder) that runs Proguard over a set of class files in other projects and produces a jar file. I'd like to have the ProguardBuilder project get rebuilt any time any class file in the other projects changes. AutoBuild doesn't do that; presumably it's smart enough to recognize and ignore any changes that don't affect anything externally visible. My problem is that I don't care whether or not the change is visible, since I need to completely rebuild ProguardBuilder any time the class files it depends on change at all. How do I tell Eclipse to do this sort of rebuild?

    Read the article

  • Consultant "branding" problem

    - by James Jones
    Where I work, we employ a consultant to do a considerable amount of work for us to hold us over until we can hire/train more staff. He has been working with us for quite a long time now, and he has always had this strange habit of leaving his initials on EVERYTHING he touches, as if its his sort of branding or advertising. And by everything, I mean: Database names Table names Variable names Web service names File names Server names etc... Is this a common practice among consultants? We politely asked if he could remove some of the branding, but he typically scoffs and quotes exorbitant time estimates to perform such 'silly' refactorings. I guess we could leave it alone, but it's really annoying to have to type out his name every time we reference something he made. Any recommendations on how to approach this problem? Edit: Our contract with him states that we "own" everything he makes for us.

    Read the article

  • Sending a JSON array to be received as a Dictionary<string,string>

    - by James Bond
    I have a method with the following signature: public ActionResult RenderFamilyTree(string name, Dictionary<string, string> children) I'm trying to call it from javascript using jQuery like this: $('#div_render').load( "<%= Url.Action("RenderFamilyTree") %>", { 'name': 'Raul', [ {'key':'key1','value':'value1'}, {'key':'key2','value':'value2'} ] }, function() { alert('Loaded'); } ); Am I missing something to get this to work?

    Read the article

< Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >