Except that even the coronor doesn't know that since Michael is still alive.
Software Zen: delete this;
Except that even the coronor doesn't know that since Michael is still alive.
Software Zen: delete this;
Well, Luc, you took my post too literally. The code I posted was one of the first examples I quickly grabbed. Essentially all the code is as follows: get a stream reader, read the data into a byte array, create a stream writer, feed it the byte array. Our issue as I noted in the example is that the byte[] buffer = stream.ReadToEnd() always throws an out of memory exception. I was ready that for very large files you can do a multi-part so that you read and transmit small packets and the FTP server puts the packets together into the original massive file. That is what I'm looking for so that we do not blow out our memory again.
Software Zen: delete this;
We have a need to send very large files to an internal FTP server. These files are videos that may last as long as an hour. All of the FTP sample I find have the standard code in them:
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Timeout = CONNECTION_TIMEOUT;
request.ReadWriteTimeout = CONNECTION_TIMEOUT;
request.UsePassive = false;
//Set credentials if necesary
if (credentials != null)
request.Credentials = credentials;
//Read source file
StreamReader sourceStream = new StreamReader(source);
byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd()); //<--- this is where we bomb!
sourceStream.Close();
request.ContentLength = fileContents.Length;
//Send contents
Stream requestStream = request.GetRequestStream();
requestStream.Write(fileContents, 0, fileContents.Length);
requestStream.Close();
This logic gives us an out-of-memory condition with very large files. What I'd like to do is have it send the file as a multi-part file sent as small chunks instead of a single large stream. Does anyone know how this is implemented?
Software Zen: delete this;
In my WCF services (that I have control over) I find I get the lost connection when sending a call to a WCF service and that service throws an exception. Try configuring the third party service to return the exception on a call to see what is causing the exception. If you cannot do that, you may need to pull in the third party to discuss how they are logging exceptions within their service so you can debug it.
Software Zen: delete this;
For your main project you should be adding a Service Reference to the WCF service. Once that is successfully implemented, you will have a local class library to represents the data returned to you by the server. Sometimes you have to look inside the server reference to locate that library but once you find it you can easily access the data.
Software Zen: delete this;
My suggestion may not be usable by you: First get rid of remoting services and deploy your service as a WCF service. Second make sure your WCF service is NOT deployed as Asynchronous. Third pull the 'black box' into your service so make it a class that you can instantiate and call internally. When your service gets the answer back then return it. In the WCF service your service would be written as if it was an inline method call making the setup quite simple. It also gets rid of the buffering and polling. If you cannot get rid of the black box behaviour then you might be SOL.
Software Zen: delete this;
PING and TRACERTE can also help you in your issues as well. If you do a PING SMTP.GMAIL.COM and you get no resolve then you know it is a DNS error in your network. If you do a PING and you get a resolve but then timeout, you might have a firewall issue. A TRACERTE (not sure of utility name....sorry) will show you how far you go in connecting to the server. It may stop inside your network or you are getting to the firewall and to an external router but no further. In that case your router isn't forwarding it out to the internet.
Software Zen: delete this;
Well I think I would disagree with the statement of using Interfaces. In the truest, textbook usage of polymorphism your are providing a different implementation of an existing implementation. While an Interface defines necessary methods/properties that must be implemented, and you can have various implementations of those methods, you don't have a base behaviour to fall back on. So an example of Polymorphism would be a class that has a computation method that has been marked virtual. In the base class it uses all of the various properties within the class to compute a value. In addition to this computation method are a number of setters/validators that ensure all the data is valid before you call the method. There may also be some security wrapped around everything and it has all been tested and proven functional. You now need that class library to collect exactly the same data, and all validations, but you need to alter how the computation method behaves. So you inherit the base class and override the existing method to implement your behaviour. In a few months you may have another use of the same base class and in that case you want the base computation to occur, but you need to return half the value. In that case, once again, you inherit the base class, override the method, call the base computation and then return the value returned by 2. What you gain in the polymorphism model is all of the functionality of the base class that does NOT have to be tested (since it is already tested and working). All you have to test is your new computation code. Thus you gain functionality and minimize the testing needed to accomplish your goal.
Software Zen: delete this;
Silly....you route it through an accumulator circuit.
Software Zen: delete this;
John Simmons / outlaw programmer wrote:
And MS Access was born...
oh yeh baby!!!
Software Zen: delete this;
He has really mastered the hammer on technique! Wonder what his tuning was. Sounded like he tuned the guitar to the chord of E then did his thing.
Thanks for the suggestion but the passing of the subquery is where ValueConverter fails. MSDN suggested that I implement an Interaction.Trigger and invoke a DelegateCommand. I'm going to give that route a try. Michael
We have one screen that has a datagrid. The datagrid contains the entire object (Parcel) and displays 3 fields in the display. The display is intended to be as such: All parcels for a given site. Highlight (or use a checkbox) to display those parcels that pertain to this record. We can always do it the old way -- iterate thru the existing elements manually turning on the checkbox. But I prefer to keep this loosely bound. We've tried a few things but we both get brain freeze when coming up with the next approach. Any suggestions on deploying this display of a query that intersects a subquery?
Excuse me sir, but if you read my response carefully you will see that his answer was wrong and did nothing to fix my problem. He stated my problem was that I was feeding it a string. Per documentation the Source is specifically a URI of the location. His 'fix' was copy and pasted from the poor example posted out on MSDN. It was a wrong answer because my solution now works and all I am doing is passing the path within the assembly of the image, which is what the documentation states for that field. If he was totally correct, and source only takes a BitMapImage then I'd greatly appreciate it. Secondly, while I was a bit short on his comments of my hack it was a statement made with no concept of what I was doing. As it turns out this screen was a prototype and we pumped in a quick and dirty way to get a functional boolean into the form. Finally, the form was not an application form tied to a ViewModel as he assumed. It was a dialog being used by a View Model that was facing a great deal of redesign once the changing images and text were functional. Was it not a good design? Quite possibly. But it had absolutely NOTHING to do with my question. And now, like a little child, he is running around rating everything of mine as 1. So how is not endearing themselves to people?
Well, First off I did not ask for comments on how I have a boolean passed to my binding. Secondly the definition of the Source field is a path to the image. In this case the strings define the path to the resource within the current active assembly. Also as stated the one image worked. Turns out that the problem was in the path to the second image. Once I removed the s from images, the image loads just fine. Finally now that both have been tested I can then do the refactoring for proper handling of the boolean.
In this problem I have a screen displaying with the results of any operation a user performs. It has an image control on it and the binding for source is as such: <pre> <Image Height="150" HorizontalAlignment="Left" Margin="94,12,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="179" Source="{Binding ElementName=isFailure, Path=IsChecked, Mode=OneWay, Converter={StaticResource ImageConverter}}" /> </pre> The ElementName isFailure is a hidden checkbox on the form. The ViewModel sets the value to checked or unchecked for the application being in an error state. The design approach is that the image changes from thumbs up to thumbs down for a failure and one lable's text changes as well. The text change works great. It flips back and forth easily. The image change leaves me with a blank image window. If I manually change it either image displays fine. But programmatic change of Source fails. (Yes the class name does not match ImageConverter....ImageConverter is the name given to the ImageStateConverter in the controls Resources definition.) My ImageConverter is as follows: <pre> /// <summary> /// Determines which image resource to use based on the state of a hidden checkbox on the form /// </summary> public class ImageStateConverter:IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return (bool)value == true ? "/SIMS;component/Views/images/thumbs_down.png" : "/SIMS;component/Views/image/thumbs_up.png"; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } </pre> Now I figure I have to call something on the control to force it to reload the image prior to doing a control.Show(); but I'm having trouble finding how to force it to reload the resource! Suggestions? Michael
Yup, you cannot change the SaveFileName property in the dialog. You will have to parse the directory from that name, construct your own file name/extension, and save the file manually using System.IO.File.
Christian, When I was on the Technical Beta Team with Microsoft I found a major issue in one of the OS builds with SCSI adapters. I bugged it and gave them repro steps. Nothing. Five builds later I bugged it again. Not reproducable. RC release and it still didn't work. I got bitched at for consistently recording a bug that did not exist. RELEASE DAY: it hit the news within a week that the OS had issues with certain SCSI adapters. :doh:
Well I never did C++ coding much but I always do null checks. How else do you avoid the object not set to an instance of an object exception??? Of course if they slap try catches around it and ignore the exception..... :omg:
Well Christopher, I must have had some vodka in my slushy because I saw exactly the same text too!!! :wtf: