FAQ Database Discussion Community

Convert from bin to int/char without loosing leading “0”

Is there anyway that >>> int('0000001',2) 1 Could save the leading 0s ? What I want to do is, with a huge string of bits, in 8 and 8 bits I would convert to int, and then to char, and write it all in a file. Later I would want...

Creating the same bin file as content of string C#

I would like to create a bin file for example file.bin with the same content as a string variable contains. For example I have string str="10101" and I want to create conversion of str's content to bin file. After conversion, when I open file.bin I want to see the same...

MatLab Rose color by bin size

my Problem is the following. I want to do a rose plot with Matlab. (http://de.mathworks.com/help/matlab/ref/rose.html) I have the following code: f2=figure('visible','off'); h=rose(degtorad(angles(:,i)),40); title(['Marker '], 'FontSize',20) x=get(h,'Xdata'); y=get(h,'Ydata'); g=patch(x,y,[0.3 0.3 0.3]); saveas(f2,'\roses\marker.jpg') And that is working fine. But I now want to change the color of its bins by the size...

Copy a Binary file 32 bytes per 32 bytes

What i'm trying to do here, is to copy a binary file 32 bytes per 32 bytes. WHY am i trying to do that ? because i need to send this binary file on the USART of my board. I cannot send it in one shot, that's why i send...

Running custom program located in /bin

I have created a folder ~/bin. This is my own bin to store my own custom programs. As a test, I wrote a simple hello world program. I export using PATH=~/bin:$PATH so that Linux looks in that directory. If I save hello (my test program name) I can successfully run...

What is the difference between an out folder and a bin folder in IntelliJ?

I have recently switched over from Eclipse to IntelliJ IDEA 14.0.2. When using some of my old Eclipse projects, I have noticed that in the project view, there is an src and a bin folder. I have previously used the bin folder to run the java program through my Terminal...

R : Create specific bin based on data range

I am attempting to repeatedly add a "fixed number" to a numeric vector depending on a specified bin size. However, the "fixed number" is dependent on the data range. For instance ; i have a data range 10 to 1010, and I wish to separate the data into 100 bins....

Display .bin depth image in Matlab

Here is the .bin image which I saved in c#. Please anyone help to view this in MATLAB. the dimension of image 424 x 512. I have tried this code, but its not working correctly file = fopen('test0.bin', 'r'); A = fread(file, 424*512, 'uint16=>uint16'); A1 = reshape(A, 424, 512); imagesc(A1)...

PHP decode literal string

in php for decode a hex string we use hex2bin() function for example "test" in hex is : "74657374" Now i want to add \x format to them , Like this : \x74\x65\x73\x74 How do i can decode this ? I wrote a function that removes \x from this string...

Making .bin File

This may be a stupid question, but I want a simpler way to replicate this technique used by Jon Erikson in the art of exploitation. In it he fills a .bin file using a bunch of complicated stuff grepping for source code and so forth. $ for i in $(head...

What is the address from which /bin/ls program execution starts?

I need to know what's the address from which /bin/ls program execution starts (after dynamic linker fix the environment, what address gets the control?) I need it in hexadecimal (0xNNN...) or decimal format

In Python how do I parse the 11th and 12th bit of 3 bytes?

If I have 3 bytes b'\x00\x0c\x00', which can be represented with the bits 00000000 00001100 00000000, how do I then parse the 11th and 12th bit 11 most efficiently? Here positions: ** 00000000 11111110 22222111 tens 87654321 65432109 43210987 ones |||||||| |||||||| |||||||| 00000000 00001100 00000000 ** I have the...