Search Results

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

Page 49/169 | < Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >

  • How to JSON serialize math vector type in F#?

    - by The_Ghost
    Hello! I'm trying to serialize "vector" (Microsoft.FSharp.Math) type. And I get that error: Exception Details: System.Runtime.Serialization.SerializationException: Type 'Microsoft.FSharp.Math.Instances+FloatNumerics@115' with data contract name 'Instances.FloatNumerics_x0040_115:http://schemas.datacontract.org/2004/07/Microsoft.FSharp.Math' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer. I have tried to put KnownType attribute and some other stuff, but nothing helps! Could someone know the answer? This is the code I use: // [< KnownType( typeof<vector> ) >] type MyType = vector let public writeTest = let aaa = vector [1.1;2.2] let serializer = new DataContractJsonSerializer( typeof<MyType> ) let writer = new StreamWriter( @"c:\test.txt" ) serializer.WriteObject(writer.BaseStream, aaa) writer.Close()

    Read the article

  • Rtti for Variant Records

    - by Coco
    I try to write a kind of object/record serializer with Delphi 2010 and wonder if there is a way to detect, if a record is a variant record. E.g. the TRect record as defined in Types.pas: TRect = record case Integer of 0: (Left, Top, Right, Bottom: Longint); 1: (TopLeft, BottomRight: TPoint); end; As my serializer should work recursively on my data structures, it will descent on the TPoint records and generate redundant information in my serialized file. Is there a way to avoid this, by getting detailed information on the record?

    Read the article

  • How to parse JSON to receive a Date object in JavaScript?

    - by Piotr Owsiak
    I have a following piece of JSON: \/Date(1293034567877)\/ which is a result of this .NET code: var obj = DateTime.Now; var serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); serializer.Serialize(obj).Dump(); Now the problem I am facing is how to create a Date object from this in JavaScript. All I could find was incredible regex solution (many containing bugs). It is hard to believe there is no elegant solution as this is all in JavaScrip, I mean JavaScript code trying to read JSON (JavaScript Object Notation) which is supposed to be a JavaScript code and at this moment it turns out it's not cause JavaScript cannot do a good job here. I've also seen some eval solutions which I could not make to work (besides being pointed out as security threat). Is there really no way to do it in an elegant way? Similar question with no real answer: How to parse ASP.NET JSON Date format with GWT

    Read the article

  • Exception while trying to deserialize JSON into EntityFramework using JavaScriptSerializer

    - by Barak
    I'm trying to deserialize JSON which I'm getting from an external source into an Entity Framework entity class using the following code: var serializer = new JavaScriptSerializer(); IList<Feature> obj = serializer.Deserialize<IList<Feature>>(json); The following exception is thrown: Object of type 'System.Collections.Generic.List1[JustTime.Task]' cannot be converted to type 'System.Data.Objects.DataClasses.EntityCollection1[JustTime.Task]'. My model is simple: The Feature class has a one-to-many relation to the Tasks class. The problem appears to be the deserializer is trying to create a generic List to hold the collection of tasks instead of an EntityCollection. I've tried implementing a JavaScriptConverted which would handle System.Collections.Generic.List but it didn't get called by the deserializer.

    Read the article

  • Is there a reason why a base class decorated with XmlInclude would still throw a type unknown exception when serialized?

    - by Tedford
    I will simplify the code to save space but what is presented does illustrate the core problem. I have a class which has a property that is a base type. There exist 3 dervived classes which could be assigned to that property. If I assign any of the derived classes to the container then the XmlSerializer throws dreaded "The type xxx was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically." exception when attempting to seralize the container. However my base class is already decorated with that attribute so I figure there must be an additional "hidden" requirement. The really odd part is that the default WCF serializer has no issues with this class hierarchy. The Container class [DataContract] [XmlRoot(ElementName = "TRANSACTION", Namespace = Constants.Namespace)] public class PaymentSummaryRequest : CommandRequest { /// <summary> /// Gets or sets the summary. /// </summary> /// <value>The summary.</value> /// <remarks></remarks> [DataMember] public PaymentSummary Summary { get; set; } /// <summary> /// Initializes a new instance of the <see cref="PaymentSummaryRequest"/> class. /// </summary> public PaymentSummaryRequest() { Mechanism = CommandMechanism.PaymentSummary; } } The base class [DataContract] [XmlInclude(typeof(xxxPaymentSummary))] [XmlInclude(typeof(yyyPaymentSummary))] [XmlInclude(typeof(zzzPaymentSummary))] [KnownType(typeof(xxxPaymentSummary))] [KnownType(typeof(xxxPaymentSummary))] [KnownType(typeof(zzzPaymentSummary))] public abstract class PaymentSummary { } One of the derived classes [DataContract] public class xxxPaymentSummary : PaymentSummary { } The serialization code var serializer = new XmlSerializer(typeof(PaymentSummaryRequest)); serializer.Serialize(Console.Out,new PaymentSummaryRequest{Summary = new xxxPaymentSummary{}}); The Exception System.InvalidOperationException: There was an error generating the XML document. --- System.InvalidOperationException: The type xxxPaymentSummary was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically. at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPaymentSummaryRequest.Write13_PaymentSummary(String n, String ns, PaymentSummary o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPaymentSummaryRequest.Write14_PaymentSummaryRequest(String n, String ns, PaymentSummaryRequest o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPaymentSummaryRequest.Write15_TRANSACTION(Object o) --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o, XmlSerializerNamespaces namespaces) at UserQuery.RunUserAuthoredQuery() in c:\Users\Tedford\AppData\Local\Temp\uqacncyo.0.cs:line 47

    Read the article

  • How to create and restore a backup from SqlAlchemy?

    - by swilliams
    I'm writing a Pylons app, and am trying to create a simple backup system where every table is serialized and tarred up into a single file for an administrator to download, and use to restore the app should something bad happen. I can serialize my table data just fine using the SqlAlchemy serializer, and I can deserialize it fine as well, but I can't figure out how to commit those changes back to the database. In order to serialize my data I am doing this: from myproject.model.meta import Session from sqlalchemy.ext.serializer import loads, dumps q = Session.query(MyTable) serialized_data = dumps(q.all()) In order to test things out, I go ahead and truncation MyTable, and then attempt to restore using serialized_data: from myproject.model import meta restore_q = loads(serialized_data, meta.metadata, Session) This doesn't seem to do anything... I've tried calling a Session.commit after the fact, individually walking through all the objects in restore_q and adding them, but nothing seems to work. What am I missing? Or is there a better way to do what I'm aiming for? I don't want to shell out and directly touch the database, since SqlAlchemy supports different database engines.

    Read the article

  • Is there a way to send text to an aspcontrol via jquery

    - by Garrith Graham
    Is there a way to send data to an aspcontrol say a label called label1? Via jquery? I know jquery only likes html but is there a way to just send the raw text to an asp control using a similar method below: <script type="text/javascript"> $(document).ready(function () { var label = $("#<%= testLabel.ClientID %>"); var div = $("<div></div>").html("content").attr('id', 'test'); var serializer = new XMLSerializer(); label.text(serializer.serializeToString(div)); }); </script>

    Read the article

  • Problem with Apache webserver and MySQL after installing cPanel

    - by Santhosh S
    I have a Fedora machine with Apache webserver and MySQL installed with some data present in both the servers. I installed cPanel on this machine with a test license. After installing cPanel I am not able to start Apache Webserver and login to MySQL. I am getting the following error when I try to start the webserver Building global cache for cpanel...warn [Cpanel::AdvConfig::apache::modules] Unable to locate executable Apache binary warn [Cpanel::AdvConfig::apache::modules] Unable to locate executable Apache binary

    Read the article

  • Static build ffmpeg 0.8

    - by Riduidel
    Is there anywhere an available static build of ffmpeg with all encoder/decoders libs for Linux (not a source tarball, but a binary) ? Although this question seems trivial, I spent the last half hour looking for it, without any success. EDIT I'm looking for binary to be run on x86 Suse 10 systems. Notice I can't use local package manager as all update repositories have bene removed by admin (to avoid uncontrolled software update).

    Read the article

  • "fopen: No such file or directory" error

    - by Akshay Bhat
    I am getting following cryptic error: akshay@akshay-VirtualBox:/mnt/mmpp$ ./bin/metamap10 /mnt/mmpp/bin/SKRrun.10 -L 2010 /mnt/mmpp/bin/metamap10.BINARY.Linux -Z 10 --debug input.txt fopen: No such file or directory does this error implies that it cannot fopen cannot find a required file or fopen itself is nonexistent, note that both SKRrun.10 and metamap10.BINARY.Linux are present at the correct location I am using this software http://metamap.nlm.nih.gov/ on Ubuntu.

    Read the article

  • Does Qmail utilize any of Sendmail's own configuration files?

    - by user1780242
    I am trying to run sendmail in tandem with qmail. Presently there is a symlink in the /usr/sbin/ directory pointing to the /var/qmail/sendmail binary. What do I have to change in the qmail configuration if I remove the symlink and rename sendmail.sendmail (I think this is the present name for sendmail's binary) to sendmail so my program can call it. What do I have to do to isolate the two installations aside from selecting a different port in sendmail's configuration?

    Read the article

  • Possible to see % uploaded when uploading a file using a form?

    - by quantumpotato
    I'm attempting to submit my iPhone app to iTunesConnect. The pictures loaded fine, and I picked "submit binary later" because iTunesConnect kept having the connection reset. I'm using Firefox to upload the binary. Is there any way I can see the % or data transferred of a specific file uploading, in real time? It would be great to see that the bits haven't moved in a while and manually reload the page instead of waiting for the connection to reset. Cheers

    Read the article

  • FSharp.Compiler.CodeDom for VS2008 and VS2010 side-by-side

    - by SztupY
    I'm using FSharp.Compiler.CodeDom to dynamically create F# classes. The problem is, that I have both VS2008 and VS2010 on my computer side-by-side (they works fine), and using F# in this configuration is buggy at best: If I don't install InstallFSharp.msi, then under VS2008 the built classes complain about not finding FSharp.Core (even if they're referenced) If I install InstallFSharp.msi, then under VS2008 the built classes will use the F# built for VS2010, and will throw a binary-incompatibility exception, because it will load the .net4 variant: FSC: error FS0219: The referenced or default base CLI library 'mscorlib' is binary- incompatible with the referenced F# core library 'C:\Program Files (x86)\Microsoft F#\v4.0\FSharp.Core.dll'. Consider recompiling the library or making an explicit reference to a version of this library that matches the CLI version you are using. If I replace the F# found at the previous location to the separately installed dll-s, then of course VS2010 will complain about binary-incompatibility Am I overlooking something, or they won't simply work for a shared environment like this? This might mean real problems when I deploy the applications. Thanks

    Read the article

  • SSRS 2005: How do I make available varbinary data for download in a report?

    - by Angelo
    Hi, SSRS newbie question here... I have a table where one column is varbinary(max) data. I would like to make a report that makes this data available for download as a hyperlink so the user can just click on the item and get a file download dialog for the binary data. In this particular case, the binary data happens to be the content of old pdf files, but that shouldn't matter. I tried searching around but I can't find any pointers on how to do this. It seems to me that it should be possible. There are ways to display images in a report using varbinary data, so it makes sense that one should be able to make arbitrary binary data downloadable on a report, right?

    Read the article

  • Replace text in Word Document via ASP.NET

    - by jreedinc
    How can I replace a string/word in a Word Document via ASP.NET? I just need to replace a couple words in the document, so I would like to stay AWAY from 3rd party plugins & interop. I would like to do this by opening the file and replacing the text. The following attempts were made: I created a StreamReader and Writer to read the file but I think that I am reading and writing in the wrong format. I think that Word Documents are stored in binary?? If word documents are binary, how would I read and write the file in binary? Dim template As String = Request.MapPath("documentName.doc") If File.Exists(template) Then Dim sr As New StreamReader(template) Dim content As String = sr.ReadToEnd() sr.Close() Dim sw As New StreamWriter(template) content = content.Replace("@ T O D A Y S D A T E", Date.Now.ToString("MM/dd/yyyy")) sw.Write(content) sw.Close() Else

    Read the article

  • dynamic linking:change of the linking path.

    - by benjamin button
    Normally it happens that when ever the path of the library that has to be linked dynamically is defined in LD_LIBRARY_PATH or it it will be mentioned with -L flag while creating the binary. In actual scenario if ,lets say the binary has been built and deployed at the client place. Now if there is a change in the path of one of the dynamic link library path. then we need to supply a new make file to all the clients where the binary was deployed. is there any other method where we need not tell all the clients to change their makefiles and can something can be done in the code itself? if yes...could anybody please suggest how? This was ironically an interview question that was asked to me and i didnot have the answer for it.

    Read the article

  • Apache Commons Codec with Android: could not find method

    - by dqminh
    Today I tried including the apache.commons.codec package in my Android application and couldn't get it running. Android could not find method ord.apache.commons.codec.binary.* and output the following errors in DDMS 01-12 08:41:48.161: ERROR/dalvikvm(457): Could not find method org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString, referenced from method com.dqminh.app.util.Util.sendRequest 01-12 08:41:48.161: WARN/dalvikvm(457): VFY: unable to resolve static method 10146: Lorg/apache/commons/codec/binary/Base64;.encodeBase64URLSafeString ([B)Ljava/lang/String; 01-12 08:41:48.161: WARN/dalvikvm(457): VFY: rejecting opcode 0x71 at 0x0004 Any clue on how to solve this problem ? Thanks a lot.

    Read the article

  • Using wix3 SqlScript to run generated temporary sql-script files.

    - by leiflundgren
    I am starting to write an installer which will use the SqlScript-element. That takes a reference to the Binary-table what script to run. I would like to dynamically generate the script during the installation. I can see three possibilities: Somehow to get SqlScript to read it data from a file rather then a Binary entry. Inject my generated script into the Binary table Using SqlString Which will cause the need to place some rather long strings into Properties, but I guess that shouldn't really be a prolem. Any advice? Regards Leif (My reason, should anyone be interested is that the database should have a job set up, that calls on an installed exe-file. I prefer to create the job using sqlscript. And the path of that file is not known until InstallDir has been choosen.)

    Read the article

  • Change Cursor for Netbeans on Linux

    - by Daziplqa
    Hi, I am recently have been successfully installed NetBean 6.8 on Ubuntu Box (10.04). But the problem is, NetBeans doesn't use the Gnome mouse Cursor by default. instead, It uses some freak mouse cursor that I hate! So, do you have any idea about how to change the cursor that appears inside netbeans.(I have looked inside tools options but without any output) Also I have did: $ grep -iR cursor * Binary file var/cache/all-resources.dat matches Binary file var/cache/all-layers.dat matches Binary file var/cache/index/s2/javascript/8/1/_0.cfs matches (note, I didn't talked here about how to change the cursor inside some Java program written in NetBeans) Thanks in advance.

    Read the article

  • installing ruby 1.9.3 of osx mavricsmavrics

    - by user1648962
    I am trying to install ruby 1.9.3 on my osx 10.9 operating system and I keep getting the following error : Error running 'requirements_osx_port_update_system ruby-1.9.3-p448', please read /Users/ramesh/.rvm/log/1383430694_ruby-1.9.3-p448/update_system.log Requirements installation failed with status: 1. I am using the following command to do the installtion : rvm install 1.9.3 The complete log is as given below : Ramesh:Downloads ramesh$ rvm install 1.9.3 Searching for binary rubies, this might take some time. No binary rubies available for: osx/10.9/x86_64/ruby-1.9.3-p448. Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. Checking requirements for osx. Installing requirements for osx. Updating system............................................................................................................................................................................................................................................................. Error running 'requirements_osx_port_update_system ruby-1.9.3-p448', please read /Users/ramesh/.rvm/log/1383430694_ruby-1.9.3-p448/update_system.log Requirements installation failed with status: 1. Ramesh:Downloads ramesh$ clear

    Read the article

  • Manually inserting varbinary data into SQL Server

    - by Jeremy Jarrell
    Hi, We have a SQL Server table for user settings. Originally the settings were domain objects which had been serialized as XML into the table but we recently begun serializing them as binary. However, as part of our deployment process we statically pre-populate the table with predefined settings for our users. Originally, this was as simple as copying the XML from a customized database and pasting it into an INSERT statement that was ran after the database was built. However, since we've moved to storing the settings as binary data we can't get this to work. How can we extract binary data from a varbinary column in SQL Server and paste it into a static INSERT script? We only want to use SQL for this, we don't want to use any utilities. Thanks in advance, Jeremy

    Read the article

  • Linux core dumps are too large!

    - by themoondothshine
    Hey guys, Recently I've been noticing an increase in the size of the core dumps generated by my application. Initially, they were just around 5MB in size and contained around 5 stack frames, and now I have core dumps of 2GBs and the information contained within them are no different from the smaller dumps. Is there any way I can control the size of core dumps generated? Shouldn't they be at least smaller than the application binary itself? Binaries are compiled in this way: Compiled in release mode with debug symbols (ie, -g compiler option in GCC). Debug symbols are copied onto a separate file and stripped from the binary. A GNU debug symbols link is added to the binary. At the beginning of the application, there's a call to setrlimit which sets the core limit to infinity -- Is this the problem?

    Read the article

  • How are integers converted to strings under the hood?

    - by CrazyJugglerDrummer
    I suppose the real question is how to convert base2/binary to base10. The most common application of this would probably be in creating strings for output: turning a chunk of binary numerical data into an array of characters. How exactly is this done? my guess: Seeing as there probably isn't a string predefined for each numerical value, I'm guessing that the computer goes through each bit of the integer from right to left, each time incrementing the appropriate values in the char array/base10 notation places. If we take the number 160 in binary (10100000), it would know that a 1 in the 8th place means 128, so it places 1 into the third column, 2 in the second, and 8 in the third. The 1 in the 6th column means 32, and it would add those values to the second and first place, carrying over if needed. After this it's an easy conversion to actual char codes.

    Read the article

  • using bash: write bit representation of integer to file

    - by theseion
    Hullo First, I want to use bash for this and the script should run on as many systems as possible (I don't know if the target system will have python or whatever installed). Here's the problem: I have a file with binary data and I need to replace a few bytes in a certain position. I've come up with the following to direct bash to the offset and show me that it found the place I want: dd bs=1 if=file iseek=24 conv=block cbs=2 | hexdump Now, to use "file" as the output: echo anInteger | dd bs=1 of=hextest.txt oseek=24 conv=block cbs=2 This seems to work just fine, I can review the changes made in a hex editor. Problem is, "anInteger" will be written as the ASCII representation of that integer (which makes sense) but I need to write the binary representation. How do I tell the command to convert the input to binary (possibly from a hex)?

    Read the article

  • [Python] How can I speed up unpickling large objects if I have plenty of RAM?

    - by conradlee
    It's taking me up to an hour to read a 1-gigabyte NetworkX graph data structure using cPickle (its 1-GB when stored on disk as a binary pickle file). Note that the file quickly loads into memory. In other words, if I run: import cPickle as pickle f = open("bigNetworkXGraph.pickle","rb") binary_data = f.read() # This part doesn't take long graph = pickle.loads(binary_data) # This takes ages How can I speed this last operation up? Note that I have tried pickling the data both in using both binary protocols (1 and 2), and it doesn't seem to make much difference which protocol I use. Also note that although I am using the "loads" (meaning "load string") function above, it is loading binary data, not ascii-data. I have 128gb of RAM on the system I'm using, so I'm hoping that somebody will tell me how to increase some read buffer buried in the pickle implementation.

    Read the article

< Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >