As part of a larger application, I am trying to convert an IP address to binary. Purpose being to later calculate the broadcast address for Wake on LAN traffic. I am assuming that there is a much more efficient way to do this then the way I am thinking. Which is breaking up the IP address by octet, adding 0's to the beginning of each oct...
I've just tried to hg diff some C source files and was told that they are binary.
So, my question is: How can I convince UNIX and Mercurial that these files are, in fact, ASCII?
Thanks in advance for your help.
...
How to modify checksum of a binary?
Specifically, I want to edit embedded checksum in a dll/exe.
Are there any tools available?
...
I am working on the firmware for a device that uses an 8bit mcu (8051 architecture). I am using SDCC (Small Device C Compiler). I have a function that I use to set the speed of a stepper motor that my circuit is driving. The speed is set by loading a desired value into the reload register for a timer. I have a variable, MotorSpeed that ...
Hello,
I would like to convert a raw string to an array of big-endian words.
As example, here is a JavaScript function that do it well (by Paul Johnston):
/*
* Convert a raw string to an array of big-endian words
* Characters >255 have their high-byte silently ignored.
*/
function rstr2binb(input)
{
var output = Array(input.lengt...
In 'Thinking in C++' by Bruce Eckel, there is a program given to print a double value
in binary. (Chapter 3, page no. 189)
int main(int argc, char* argv[])
{
if(argc != 2)
{
cout << "Must provide a number" << endl;
exit(1);
}
double d = atof(argv[1]);
unsigned char* cp = reinterpret_cast<unsigned char*>(&...
Hi,
after fighting several versions of the CoreKeyGen created by some "minamoto" guy, a new version has appeared. This version is particularly sophisticated and seems to modify the actual binary itself, using a dylib known as libbassmod.dylib (this is in the keygen's mac os folder).
Has anyone ever come across this & can give me advic...
I have an ASP routine that gets a binary file's contents and writes it to a stream. The intention is to read it from the stream and process it st the server.
So I have:
ResponseBody = SomeRequest (SomeURL) ;
var BinaryInputStream = Server.CreateObject ("ADODB.Stream") ;
BinaryInputStream.Type = 1 ; // binary
BinaryInputStream.Open ;
...
I asked this question a few days ago but it seems to have gone cold fairly quickly. What I want to do is pretty simple and I can't believe someone hasn't figured it out.
Solution needs to be JScript classic ASP. I am reading a file from a remote server and I want to process that (binary) file on my server and spit the results back to ...
How can I do division by 2 in Binary Signed digit (Redundant Binary representation) ? Shifting won't work right ?
...
How can I compare two numbers in the form of Redundant binary representation RBR ?
Any Idea ?
...
Hi there,
Using Python 3.1.2 I am having a problem sending binary attachment files (jpeg, pdf, etc.) - MIMEText attachments work fine. The code in question is as follows...
for file in self.attachments:
part = MIMEBase('application', "octet-stream")
part.set_payload(open(file,"rb").read())
encoders.encode_base64(part)
part...
All I really know is PHP and I used the decbin function etc, It was fairly easy to do. In this C++ program I want to do the same thing, just a simple number or string how would I do this?
...
I just realized that one can use bitset to output binary data to a stream based on the (fixed) size of the bitset. What's the least-extra-syntax way to output binary data to a stream using integrals?
To show what I mean, here's a program and its output. I'd like the second line of output from this program to be identical to the first li...
I am trying to make a program that converts decimal numbers or text into binary numbers in perl. The program asks for user input of a character or string , and then prints out the result to the console. How do I do this? My code I have been working on is below, but i cannot seem to fix it.
print "Enter a number to convert: ";
chomp($dec...
Let's take a simple example of two lines supposedly doing the same thing:
if (value >= 128 || value < 0)
...
or
if (value & ~ 127)
...
Say 'If's are costly in a loop of thousands of iterations, is it better to keep with the traditional C syntax or better to find a binary optimized one if possible?
...
Consider this expression as a "selection" control structure on integer "x":
0 < x < 10,
with the intention that the structure returns TRUE if "x" is in the range 1..9.
Explain why a compiler should not accept this expression. (In particular, what are the issues regarding the binary operator "<"?
Explain how a prefix operator could be ...
Hey all.
I am looking for a fast and efficient protocol that can be used between different web services to send text-data (not binary data). Doesn't matter if the protocol is binary or text base.
Some conditions:
I has to be more "efficient" than normal XML which adds a lot of extra data and the tools to read/write is too heavy
It h...
Ok i have problem with my code for reading binary file...
First i will show you my writing code:
void book_saving(char *file_name, struct BOOK *current)
{
FILE *out;
BOOK buf;
out = fopen(file_name, "wb");
if(out != NULL)
{
printf_s("Writting to file...");
do
{
if(current != NUL...
http://gcc.gnu.org/install/binaries.html
This page has the binaries. Which one would work for Fedora?
...