binary

convert double value to binary value

How can i convert double value to binary value. i have some value like this below 125252525235558554452221545332224587265 i want to convert this to binary format..so i am keeping it in double and then trying to convert to binary (1 & 0's).. i am using C#.net ...

What is the most effective way to erase individual bits in a bitset? is it XOR or AND/NOT?

I have a large bitset that I want to frequently reset individual bits in it. Which method is faster? a) bitset[word_index] ^= 1 << bit_index or b) bitset[word_index] &= ~(1 << bit_index) The application is for the desktop (if that plays a role). ...

C++ in mobile apps. How does it works

Tell me. How is executed binaries (written in c++ ForExample) in mobiles?? Is it only possible as mixed with J2ME or is it possible to execute "RAW" (like exe file) binary. (In old and new mobiles) ...

Multiplying Base10 and Base2

When multiplying (or doing any mathematics) to binary and decimal numbers, would you simply convert then multiply in decimals? E.g., 3(base10) * 100(base2) would = 3 * 4 = 12? ...

How do I extract ASCII data from binary file with unknown format, in Windows?

On Windows, what is the best way to convert a binary file where the internal structure is unknown less that its contents are ASCII in nature back to plain text? Ideally the conversion would produce a "human"-readable version. I think the file should contain something like the following: Date: 10 FEB 2010 House: 345 Dogwood Drive Exter...

Parse binary data for c# bootp server?

I need one of my C# .NET applications to act as a bootp server. The protocol is pretty simple but I dont know an easy way to build/parse the binary data. Any ideas: ...

Clarification on Masking Bits

I have a quick question about masking bits. If I want to turn two 8 bit streams on, do I use the AND logic against the two: 10101010 AND 01101001 ________ 00101000 or do I actually change one of the bits in the stream to turn the bits on? I guess my question is when I'm turning on (using AND) or turning off (using OR)...

Separating ASCII text from binary content in a file

I have a file that has both ASCII text and binary content. I would like to extract the text without having to parse the binary content as the binary content is 180MB. Can I simply extract the text for further manipulation ... what would be the best way of going about it. The ASCII is at the very beginning of the file. ...

Base8 = Base10 - How?

I know 75(base8) = 61(base10), but I can't easily find the formula for this. How does one convert from base 8 to base 10? ...

Binary Addition of 2 values ( there is a catch :D) C# - RESOLVED

hey guys , im doin a final year project but it has come to a dead end as i dont know any way i can perform binary addition in C# what i am trying to do is i have two strings string a= "00001"; /* which is decimal 1 i made it with the '0's using string a = Convert.ToString(2, 2).PadLeft(5, '0'); */ string b= "00010"; what i want to...

C# Winform Binary Icon

I want to change the icon my binary has for my applications. The people I work with aren't technologically savvy and quite literally changed AppName.exe to CLICK ME.exe because they didn't know which icon to click... Anyway, I figure an easy solution to this is to just make all of my applications for them have the same, bright icon so ...

How can I pack an int as 32 bits big endian in Perl?

Consider this snippet: use strict; use warnings; my $data = "1"; my $packed = pack("I",$data); open(my $file,">","test.bin") || die "error $!\n"; binmode $file; print $file $packed; The thing is, trying to read it from another language, this appears to be little endian. Is there any template argument that allows me to write it as big...

What is the "biggest" negative number on a 4-bit machine?

Or, what is the range of numbers that can be represented on a 4-bit machine using 2s-complement? ...

Reading a binary file in Python: takes a very long time to read certain bytes.

This is very odd I'm reading some (admittedly very large: ~2GB each) binary files using numpy libraries in Python. I'm using the: thingy = np.fromfile(fileObject, np.int16, 1) method. This is right in the middle of a nested loop - I'm doing this loop 4096 times per 'channel', and this 'channel' loop 9 times for every 'receiver', an...

Need help with Binary Columns

Hi, I have to query a column containing a Binary column with data like this ®â{Õ■K!Eòû▓♫;#§ø. How can i query this colmn..if I wanted something like: SELECT Name FROM Users WHERE ID = ®â{Õ■K!Eòû▓♫;#§ø THanks ...

What is the best way to avoid unexpected behavior due to the binary storage of floating point numbers?

I was writing a simple for loop recently and got some unexpected behavior: for(double x = 0.0; x <= 1.0; x += 0.05) { Console.WriteLine(x.ToString()); } This is the output: 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 Notice that 1 doesn't appear even though the condition for continuin...

Is there any way to convert an integer (3 in decimal form) to its binary equivalent 11 in SQLite???-RESOLVED

i am aware that there are functions in Oracle and MsSQl that can do so , sooooo is there any function that does it or is there any way to convert it inside sqlite . my table is of structure : col 1primary key int| col2 not null int <------- i want to convert the value of this column into binary an perform a few comparisons for a set se...

How to see possible combinations of a given number in python

Hi, in Python I wanting see all the possible combination's of a number, but limiting to 0's and 1's... So for example the result of some loop would be: 0000 0001 0011 0111 1111 1000 and so on. What python algorithm would best suite this? ...

Would there ever be a reason to write code in pure binary?

Is there ever a situation when ASM just isn't low-level enough? After all, assembler still has to be assembled. Has anyone ever written a program in binary? I'm just wondering if there's ever a theoretical reason why doing so might be practical or even if it's possible on modern computers. ...

Variable names of unordered set items without implied structure

This question will be asked in a specific form, but applies to a more general question, how to name unordered set items without implying any sort of structure. In terms of graph theory, a connected, undirected graph will contain vertices that are connected via edges. When creating an edge class with two member variables that are vertic...