Search Results

Search found 4214 results on 169 pages for 'binary serializer'.

Page 87/169 | < Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >

  • Why doesn't ifstream read to the end?

    - by user146780
    I'm making a notepad-like program. To get the text from a file I read each character into the buffer by doing while (!file.EOF()) { mystr += file.get(); } however if I load in an exe it stops after MZ but Notepad reads the whole exe. I set my ifstream to binary mode but still no luck. What am I doing wrong? Thanks

    Read the article

  • Saving image to database as varbinary, arraylength (part 2)

    - by Thomas Schoof
    This is a followup to my previous question, which got solved (thank you for that) but now I am stuck at another error. I'm trying to save an image in my database (called 'Afbeelding'), for that I made a table which excists of: id: int souce: varbinary(max) I then created a wcf service to save an 'Afbeelding' to the database. private static DataClassesDataContext dc = new DataClassesDataContext(); [OperationContract] public void setAfbeelding(Afbeelding a) { //Afbeelding a = new Afbeelding(); //a.id = 1; //a.source = new Binary(bytes); dc.Afbeeldings.InsertOnSubmit(a); dc.SubmitChanges(); } I then put a reference to the service in my project and when I press the button I try to save it to the datbase. private void btnUpload_Click(object sender, RoutedEventArgs e) { Afbeelding a = new Afbeelding(); OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "JPEG files|*.jpg"; if (openFileDialog.ShowDialog() == true) { //string imagePath = openFileDialog.File.Name; //FileStream fileStream = new FileStream(imagePath, FileMode.Open, FileAccess.Read); //byte[] buffer = new byte[fileStream.Length]; //fileStream.Read(buffer, 0, (int)fileStream.Length); //fileStream.Close(); Stream stream = (Stream)openFileDialog.File.OpenRead(); Byte[] bytes = new Byte[stream.Length]; stream.Read(bytes, 0, (int)stream.Length); string fileName = openFileDialog.File.Name; a.id = 1; a.source = new Binary { Bytes = bytes }; } EditAfbeeldingServiceClient client = new EditAfbeeldingServiceClient(); client.setAfbeeldingCompleted +=new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(client_setAfbeeldingCompleted); client.setAfbeeldingAsync(a); } void client_setAfbeeldingCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { if (e.Error != null) txtEmail.Text = e.Error.ToString(); else MessageBox.Show("WIN"); } However, when I do this, I get the following error: System.ServiceModel.FaultException: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter :a. The InnerException message was 'There was an error deserializing the object of type OndernemersAward.Web.Afbeelding. The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.'. Please see InnerException for more details. at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result) atOndernemersAward.EditAfbeeldingServiceReference.EditAfbeeldingServiceClient.EditAfbeeldingServiceClientChannel.EndsetAfbeelding(IAsyncResult result) at OndernemersAward.EditAfbeeldingServiceReference.EditAfbeeldingServiceClient.OndernemersAward.EditAfbeeldingServiceReference.EditAfbeeldingService.EndsetAfbeelding(IAsyncResult result) at OndernemersAward.EditAfbeeldingServiceReference.EditAfbeeldingServiceClient.OnEndsetAfbeelding(IAsyncResult result) at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result) I'm not sure what's causing this but I think it has something to do with the way I write the image to the database? (The array length is too big big, I don't really know how to change it) Thank you for your help, Thomas

    Read the article

  • Python float copy question

    - by SJA
    Hi, I'm puzzled by some behaviour I'm seeing when copying a float array member into another variable - please help! For example data_entry[1] = 9.6850069951 new_value = data_entry[1] <comment> #print both 9.6850069951 9.6850663300 I'm aware of the problem of binary storage of floats but I thought with a direct copy of memory we would end up with the same value. Any ideas? I need better precision than this! thanks in advance Stuart

    Read the article

  • Save binarydata into a image file in c# / silverlight 3

    - by Jin
    byte[] binaryData = new Byte[pngStream.Length]; long bytesRead = pngStream.Read(binaryData, 0, (int)pngStream.Length); string base64String = System.Convert.ToBase64String(binaryData, 0, binaryData.Length); I have a binary data in Byte array. Does anybody know how to save this into any image file (png or jpg) in silverlight3 or c#? Thanks

    Read the article

  • Exporting SQL Server Databases for offline use

    - by WedTM
    I have a desktop application (C# .NET 3.5) that uses a SQL server for it's database. I have had a request from the client, however, to make it possible to export the database as it stands, and be able to use it on a laptop without connectivity. They understand that updates to the parent server will not be reflected in these offline clients. Is there a way I can just save the DataSet's to a binary form and write them to a disk and send those files to the offline clients.

    Read the article

  • Selenium RC cannot test on compressed html

    - by JH
    In order to have the fast speed of website, the web sever compress (gzip) the html files before sending to our clients. When running selenium tests, it shows a pop-up saying: You have chosen to open ... which is a: Bin file from: http://... Would you like to save this file? "Cancel" "Save File" It seems that the compressed html file doesn't unzip and browsers recognise it as Binary file.

    Read the article

  • Linq DateTime expressions wont compare if only one is nullable

    - by tigermain
    I have been getting the following exception: The binary operator GreaterThanOrEqual is not defined for the types 'System.Nullable`1[System.DateTime]' and 'System.DateTime'. I am getting the left hand expression from a class property which is a nullable datetime variable and my right hand side is using Expression.Constant(new Nullable<DateTime>(DateTime.Now)) However I still get the above exception despite explicitly setting the right hand expression to a nullable type

    Read the article

  • Which dll's are required to run osql.exe as a standalone?

    - by chama
    According to the accepted answer to this question, the osql.exe utility can be run as a standalone program on a computer without SQLServer, simply by copying the binary file to the new computer. My question is, however, which other files need to be copied along with osql.exe for it to work? Thanks so much!

    Read the article

  • How can I link to a specific glibc version

    - by falstaff
    When I compile something on my Ubuntu Lucid 10.04 PC it gets linked against glibc. Lucid uses 2.11 of glibc. When I run this binary on another PC with an older glibc, the command fails saying there's no glibc 2.11... As far as I know glibc uses symbol versioning. Can I force gcc to link against a specific symbol version? In my concret use I try to compile a gcc cross toolchain for ARM.

    Read the article

  • Using static vs. member find method on a STL set?

    - by B Johnson
    I am using a set because, i want to use the quick look up property of a sorted container such as a set. I am wondering if I have to use the find member method to get the benefit of a sorted container, or can I also use the static find method in the STL algorithms? My hunch is that using the static version will use a linear search instead of a binary search like I want.

    Read the article

  • Haskell Type error

    - by Jon
    I am getting a Couldn't match expected type error on this code and am not sure why. Would appreciate it if someone could point me in the right direction as to fixing it. import qualified Data.ByteString.Lazy as S import Data.Binary.Get import Data.Word getBinary :: Get Word16 getBinary = do a <- getWord16be "Test.class" return (a) main :: IO () main = do contents <- S.getContents print getBinary contents Specifically it cannot match expected type 'S.ByteString - IO ()' to inferred type 'IO ()'

    Read the article

  • standard encryption decryption across different platforms

    - by Raj
    hey guys i need to implement a standard encryption decryption logic across an entire project platform which has different clients implemented using different platforms as follows: 1) iphone app (objectiv c) 2) website (classic asp) 3) webservice (asp.net) the iphone app as well as the website need to send info to webservice using encrypted query strings the web service then decrypts this and processes the info further wanted to know the simplest way to achieve this. is there some free and ready to use binary available with an easy to use api to achieve this? encryption needs to be as secure as possible thnx in advance

    Read the article

  • update app invalid help

    - by Florent
    hi all trying to update my app on itunes connet i get the following : The binary you uploaded was invalid. The executable name, as reported by CFBundleExecutable in the Info.plist file, may not contain any of these characters: \ [ ] { } ( ) . + * please i v searched the web no one encountered this error thanks

    Read the article

  • Autoconf -- including a static library (newbie)

    - by EB
    I am trying to migrate my application from manual build to autoconf, which is working very nicely so far. But I have one static library that I can't figure out how to integrate. That library will NOT be located in the usual library locations - the location of the binary (.a file) and header (.h file) will be given as a configure argument. (Notably, even if I move the .a file to /usr/lib or anywhere else I can think of, it still won't work.) It is also not named traditionally (it does not start with "lib" or "l"). Manual compilation is working with these (directory is not predictable - this is just an example): gcc ... -I/home/john/mystuff /home/john/mystuff/helper.a (Uh, I actually don't understand why the .a file is referenced directly, not with -L or anything. Yes, I have a half-baked understanding of building C programs.) So, in my configure.ac, I can use the relevant configure argument to successfully find the header (.h file) using AC_CHECK_HEADER. Inside the AC_CHECK_HEADER I then add the location to CPFLAGS and the #include of the header file in the actual C code picks it up nicely. Given a configure argument that has been put into $location and the name of the needed files are helper.h and helper.a (which are both in the same directory), here is what works so far: AC_CHECK_HEADER([$location/helper.h], [AC_DEFINE([HAVE_HELPER_H], [1], [found helper.h]) CFLAGS="$CFLAGS -I$location"]) Where I run into difficulties is getting the binary (.a file) linked in. No matter what I try, I always get an error about undefined references to the function calls for that library. I'm pretty sure it's a linkage issue, because I can fuss with the C code and make an intentional error in the function calls to that library which produces earlier errors that indicate that the function prototypes have been loaded and used to compile. I tried adding the location that contains the .a file to LDFLAGS and then doing a AC_CHECK_LIB but it is not found. Maybe my syntax is wrong, or maybe I'm missing something more fundamental, which would not be surprising since I'm a newbie and don't really know what I'm doing. Here is what I have tried: AC_CHECK_HEADER([$location/helper.h], [AC_DEFINE([HAVE_HELPER_H], [1], [found helper.h]) CFLAGS="$CFLAGS -I$location"; LDFLAGS="$LDFLAGS -L$location"; AC_CHECK_LIB(helper)]) No dice. AC_CHECK_LIB is looking for -lhelper I guess (or libhelper?) so I'm not sure if that's a problem, so I tried this, too (omit AC_CHECK_LIB and include the .a directly in LDFLAGS), without luck: AC_CHECK_HEADER([$location/helper.h], [AC_DEFINE([HAVE_HELPER_H], [1], [found helper.h]) CFLAGS="$CFLAGS -I$location"; LDFLAGS="$LDFLAGS -L$location/helper.a"]) To emulate the manual compilation, I tried removing the -L but that doesn't help: AC_CHECK_HEADER([$location/helper.h], [AC_DEFINE([HAVE_HELPER_H], [1], [found helper.h]) CFLAGS="$CFLAGS -I$location"; LDFLAGS="$LDFLAGS $location/helper.a"]) I tried other combinations and permutations, but I think I might be missing something more fundamental....

    Read the article

  • javascript xmlhttprequest question.

    - by Johnny
    assumbe ie is still the dominate web browser, the XMLHttpRequest.responseText or XMLHttpRequest.responseXML in ie desire txt or xml/xhtml/html,but what about the server response the xmlHttprequest whith MIME TYPE octact/binary? would the response string all littele than 256 ?(every char of that string < 256), thanks very much for a straight answer, i have no webserver env,so i don't know how to test it out.

    Read the article

  • attachment is not proper in mail in rails

    - by Harsh Raval
    hi, i'm sending a mail with attachment(1.pdf) but in mail it doesnt shows 1.pdf instead it shows some random file named "ATT008220.dat". i'm using Rails 3.0 following is the code i'm using: @file = File.read('c:/1.pdf') @file.force_encoding('BINARY') attachment "application/octet-stream" do |a| a.body = @file end anybody knows why its happening? any idea? Thanks & Regards, Harsh Raval.

    Read the article

  • question about api functions

    - by davit-datuashvili
    i have question we have API functions in java can user create it's own function and add to his java IDE? for example i am using netbeans can i create my own function add to netbean IDE?let say create binary function or something else thanks

    Read the article

< Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >