Search Results

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

Page 18/169 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • matlab - int array to binary array

    - by asel
    hi, currently in matlab i have int array a=[3,4,5,6,7]; i want to convert it to binary array with four bits each. for the above int array i would get the following binary array abinary=[0,0,1,1, 0,1,0,0, 0,1,0,1, 0,1,1,0, 0,1,1,1]; is there any fast way to do it? thanks a lot!

    Read the article

  • protobuf-net NOT faster than binary serialization?

    - by Ashish Gupta
    I wrote a program to serialize a 'Person' class using XMLSerializer, BinaryFormatter and ProtoBuf. I thought protobuf-net should be faster than the other two. Protobuf serialization was faster than XMLSerialization but much slower than the binary serialization. Is my understanding incorrect? Please make me understand this. Thank you for the help. Following is the output:- Person got created using protocol buffer in 347 milliseconds Person got created using XML in 1462 milliseconds Person got created using binary in 2 milliseconds Code below using System; using System.Collections.Generic; using System.Linq; using System.Text; using ProtoBuf; using System.IO; using System.Diagnostics; using System.Runtime.Serialization.Formatters.Binary; namespace ProtocolBuffers { class Program { static void Main(string[] args) { string XMLSerializedFileName = "PersonXMLSerialized.xml"; string ProtocolBufferFileName = "PersonProtocalBuffer.bin"; string BinarySerializedFileName = "PersonBinary.bin"; var person = new Person { Id = 12345, Name = "Fred", Address = new Address { Line1 = "Flat 1", Line2 = "The Meadows" } }; Stopwatch watch = Stopwatch.StartNew(); watch.Start(); using (var file = File.Create(ProtocolBufferFileName)) { Serializer.Serialize(file, person); } watch.Stop(); Console.WriteLine(watch.ElapsedMilliseconds.ToString()); Console.WriteLine("Person got created using protocol buffer in " + watch.ElapsedMilliseconds.ToString() + " milliseconds " ); watch.Reset(); watch.Start(); System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(person.GetType()); using (TextWriter w = new StreamWriter(XMLSerializedFileName)) { x.Serialize(w, person); } watch.Stop(); Console.WriteLine(watch.ElapsedMilliseconds.ToString()); Console.WriteLine("Person got created using XML in " + watch.ElapsedMilliseconds.ToString() + " milliseconds"); watch.Reset(); watch.Start(); using (Stream stream = File.Open(BinarySerializedFileName, FileMode.Create)) { BinaryFormatter bformatter = new BinaryFormatter(); //Console.WriteLine("Writing Employee Information"); bformatter.Serialize(stream, person); } watch.Stop(); Console.WriteLine(watch.ElapsedMilliseconds.ToString()); Console.WriteLine("Person got created using binary in " + watch.ElapsedMilliseconds.ToString() + " milliseconds"); Console.ReadLine(); } } [ProtoContract] [Serializable] public class Person { [ProtoMember(1)] public int Id {get;set;} [ProtoMember(2)] public string Name { get; set; } [ProtoMember(3)] public Address Address {get;set;} } [ProtoContract] [Serializable] public class Address { [ProtoMember(1)] public string Line1 {get;set;} [ProtoMember(2)] public string Line2 {get;set;} } }

    Read the article

  • C# convert binary dara to string?

    - by Tom
    Hi, just going through the registry retrieving values and binary is making my file outputer fall. I was wondering how could i convert Subkey.getValue(value[i]) into a String if the Value type is binary? Thank you in advance

    Read the article

  • Binary search in rotated sorted list

    - by Algorist
    I am having a sorted list which is rotated and I would like to do a binary search on that list to find the minimum element. Lets suppose initial list is {1,2,3,4,5,6,7,8} rotated list can be like {5,6,7,8,1,2,3,4} Normal binary search doesn't work in this case. Any idea how to do this.

    Read the article

  • How to generate correlated binary variables

    - by jonalm
    Dear All I need to generate a series of N random binary variables with a given correlation function. Let x = {x_i} be a series of binary variables (taking the value 0 or 1, i running form 1 to N). The marginal probability is given Pr(x_i = 1) = p, and the values should be correlated in the following way E[ x_i x_j ] = const * |i-j|^-alfa where alfa is a positive number. Is it possible to generate a series like this? preferably in python.

    Read the article

  • Which OS the binary was build

    - by Prakash
    We have recently installed RHEL 5.4 on some existing 6.2 OS and migrated our code from RH 6.2 to RHEL 5.4. We are facing a difficulty that given a binary (on both OS they have same name) how can we distinguish that which gcc and OS it was build as there are some minor differences in between binary respectively made. Please help

    Read the article

  • Binary serialization of datasets parameters in web services

    - by Someone
    In a system with both ends (client and server) in .NET, is it possible to use the binary serialization provided by the dataset class in ADO.NET 2.0 when the datasets are exposed as WebMethods parameters ? Is it ok to use something like the following just before the dataset is returned: someDataSet.RemotingFormat = SerializationFormat.Binary;

    Read the article

  • C# convert binary data to string?

    - by Tom
    Hi, just going through the registry retrieving values and binary is making my file outputer fall. I was wondering how could I convert Subkey.getValue(value[i]) into a String if the Value type is binary? Thank you in advance

    Read the article

  • Shell complains 'cannot execute binary file'

    - by Negai
    Hi everyone, I've playing around with linux and noticed that for some mysterious reason commands like '/bin/sh ' just will not work. Each time I'm trying to start a process it yields 'cannot execute binary file' error message. m@sanctuary:~$ sh sed /bin/sed: /bin/sed: cannot execute binary file When I first launch sh and try to execute sed, it succeeds. I'm starting to loose my wits. It would be just great, if somebody could help me. Thank you.

    Read the article

  • Set a C++ bitset from a binary input steam

    - by Jon
    I have an input stream from a binary file. I want to create a bitset for the first 5 bits of the stream. Here is the code I have so far: ifstream is; is.open ("bin_file.out", ios::binary ); bitset<5> first_five_bits; is >> first_five_bits; // always is set to default 00000

    Read the article

  • Are binary protocols dead?

    - by Earlz
    It seemed like there use to be way more binary protocols because of the very slow internet speeds of the time (dialup). I've been seeing everything being replaced by HTTP and SOAP/REST/XML. Why is this? Are binary protocols really dead or are they just less popular? Why would they be dead or less popular?

    Read the article

  • Boost::binary<> [c++][Boost]

    - by atch
    Hi, Is there anything in boost libraries like binary? For example I would like to write: binary<10101> a; I'm ashamed to admit that I've tried to find it (Google, Boost) but no results. They're mention something about binary_int< but I couldn't find neither if it is available nor what header file shall I include; Thanks for help.

    Read the article

  • Reading binary data from stdin

    - by thebeav
    Is it possible to read stdin as binary data in Python 2.6? If so, how? I see in the Python 3.1 documentation that this is fairly simple, but the facilities for doing this in 2.6 don't seem to be there. If the methods described in 3.1 aren't available, is there a way to close stdin and reopen in in binary mode?

    Read the article

  • Powershell overruling Perl binmode?

    - by hippietrail
    I have a Perl script which creates a binary file while scanning a very large text file. It outputs to STDOUT which I redirect in the commandline to a file. To optimize it I'm making changes then seeing how low it takes to run. On Linux for this I use the "time" command. On Windows the best way to time a program seemed to be to PowerShell's "measure-command". This seemed to work fine but I noticed the generated files were larger. On examination I found that the files generated from within PowerShell begin with a BOM and contain CRLF pairs! My Perl script has a "binmode STDOUT" directive and does work correctly in a normal dosbox. Is this a bug or misfeature in PowerShell or measure-command? Has it affected others creating binary files by means other than Perl? Googling hasn't turned anything up so far. I'm using Perl 5.12, PowerShell v1.0 and Windows XP.

    Read the article

  • Files built with a makefile are disapearing (including the binary)

    - by Reid
    I am building a program on a TS-7800(SBC), and when I run make (show below), it appears to go through all of the steps normally, but in the end i do not get a binary file. Why is this, and how can I get my file. makefile CC= /home/eclipse/ReidTest/cc/cross-toolchains/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc # compiler options #CFLAGS= -O2 CFLAGS= -mcpu=arm9 #CFLAGS= -pg -Wall # linker LN= $(CC) # linker options LNFLAGS= #LNFLAGS= -pg # extra libraries used in linking (use -l command) LDLIBS= -lpthread # source files SOURCES= HMITelem.c Cpacket.c GPS.c ADC.c Wireless.c Receivers.c CSVReader.c RPM.c RS485.c # include files INCLUDES= Cpacket.h HMITelem.h CSVReader.h RS485.h # object files OBJECTS= HMITelem.o Cpacket.o GPS.o ADC.o Wireless.o Receivers.o CSVReader.o RPM.o RS485.o HMITelem: $(OBJECTS) $(LN) $(LNFLAGS) -o $@ $(OBJECTS) $(LDLIBS) .c.o: $*.c $(CC) $(CFLAGS) -c $*.c RUN : ./HMITelem #clean: # rm -f *.o # rm -f *~ Output root@ts7800:ReidTest# make /home/eclipse/ReidTest/cc/cross-toolchains/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -mcpu=arm9 -c HMITelem.c /home/eclipse/ReidTest/cc/cross-toolchains/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -mcpu=arm9 -c Cpacket.c /home/eclipse/ReidTest/cc/cross-toolchains/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -mcpu=arm9 -c GPS.c /home/eclipse/ReidTest/cc/cross-toolchains/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -mcpu=arm9 -c ADC.c /home/eclipse/ReidTest/cc/cross-toolchains/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -mcpu=arm9 -c Wireless.c /home/eclipse/ReidTest/cc/cross-toolchains/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -mcpu=arm9 -c Receivers.c /home/eclipse/ReidTest/cc/cross-toolchains/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -mcpu=arm9 -c CSVReader.c /home/eclipse/ReidTest/cc/cross-toolchains/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -mcpu=arm9 -c RPM.c /home/eclipse/ReidTest/cc/cross-toolchains/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -mcpu=arm9 -c RS485.c /home/eclipse/ReidTest/cc/cross-toolchains/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -o HMITelem HMITelem.o Cpacket.o GPS.o ADC.o Wireless.o Receivers.o CSVReader.o RPM.o RS485.o -lpthread Thank you.

    Read the article

  • Changing the name of a binary packaged application and its evoking command

    - by jerkstore
    I have taken the source code of a large project, App A, and made many modifications to it to produce my version, App B. Both App A and App B compile cleanly on Debian and Red Hat and now I would like to build binary packages for both platforms. The last modification I need to make is ensuring App B can be installed alongside App A without any interference. I should be able to evoke both application-a and application-b in the terminal and have both be listed as separate software in whatever desktop environment is present. The projects have a debian/ folder (containing rules, control, etc.) and an rpm/ folder containing a SPEC file. Currently, building and installing the .rpm and .deb packages works except that App B is recognized as App A and therefore does not meet the aforementioned requirements. ldd shows the programs have the same exact dependencies and I am not able to pursue static linking of libraries. What modifications do I need to make to my project to achieve the desired outcome? Please be specific as I do not have much experience with the packaging process.

    Read the article

  • Why use binary files to stack up different versions on DMSs?

    - by edgarator
    I've used both Liferay and Alfresco trying to use them as the Document Management System for an intranet. I noticed the following: They use the file system and the database to store files They use a GUID to name the file on the filesystem and that GUID is used as an Id in the database. The GUID-named file is a binary file The GUID-named binary file stores all versions for a given file The path for the file in the DMS doesn't match the one in the file system The URL makes reference to the GUID when a certain file is requested What I want to know is why is this, and what would be the best way of doing it. Like how to would you create the binary file (zip?), and what parts would you keep in the binary file and what parts would you store in the database (meta-data, path?). I'm assuming some of the benefits of doing it like this. As having the same URL for a file, regardless of its current document path. And having only one file even if the file has changed names over time.

    Read the article

  • Simple Android Binary Text Clock

    - by Hristo
    Hello, I want to create a simple android binary clock but my application crashes. I use 6 textview fields: 3 for the decimal and 3 for the binary representation of the current time (HH:mm:ss). Here's the code: import java.text.SimpleDateFormat; import java.util.Calendar; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class Binary extends Activity implements Runnable { Thread runner; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); if (runner == null) { //start the song runner = new Thread(this); runner.start(); } } @Override public void run() { TextView hours_dec = (TextView) findViewById(R.id.hours_dec); TextView mins_dec = (TextView) findViewById(R.id.mins_dec); TextView secs_dec = (TextView) findViewById(R.id.secs_dec); TextView hours_bin = (TextView) findViewById(R.id.hours_bin); TextView mins_bin = (TextView) findViewById(R.id.mins_bin); TextView secs_bin = (TextView) findViewById(R.id.secs_bin); SimpleDateFormat hours_sdf = new SimpleDateFormat("HH"); SimpleDateFormat mins_sdf = new SimpleDateFormat("mm"); SimpleDateFormat secs_sdf = new SimpleDateFormat("ss"); Calendar cal = Calendar.getInstance(); while (runner != null) { WaitAMoment(); cal.getTime(); hours_dec.setText(hours_sdf.format(cal.getTime())); mins_dec.setText(mins_sdf.format(cal.getTime())); secs_dec.setText(secs_sdf.format(cal.getTime())); hours_bin.setText(String.valueOf(Integer.toBinaryString(Integer.parseInt((String) hours_dec.getText())))); mins_bin.setText(String.valueOf(Integer.toBinaryString(Integer.parseInt((String) mins_dec.getText())))); secs_bin.setText(String.valueOf(Integer.toBinaryString(Integer.parseInt((String) secs_dec.getText())))); } } protected void WaitAMoment() { try { Thread.sleep(100); } catch (InterruptedException e) { }; } }`

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >