hexadecimal

C#: Integer value being returned as hexadecimal in VS 2008

I have a c# code snippets where i am creating a list of my custom class objects.When i am taking the count of that,its showing me a hexadecimal value in the quickwatch window. But if i type listItemCount.ToStrin(), i am getting the proper value as output (ie : 50061) Any idea how to correct this ? ...

Convert hex string to long

Are there any Cocoa classes that will help me convert a hex value in a NSString like 0x12FA to a long or NSNumber? It doesn't look like any of the classes like NSNumberFormatter support hex numbers. Thanks, Hua-Ying ...

Find HEX patterns and number of occurrences

Hi, I'd like to find patterns and sort them by number of occurrences on an HEX file I have. I am not looking for some specific pattern, just to make some statistics of the occurrences happening there and sort them. DB0DDAEEDAF7DAF5DB1FDB1DDB20DB1BDAFCDAFBDB1FDB18DB23DB06DB21DB15DB25DB1DDB2EDB36DB43DB59DB32DB28DB2ADB46DB6FDB32DB44DB40D...

How to create a System.Drawing.Color from its hexadecimal RGB string?

I want to create a System.Drawing.Color from a value like #FF00FF or FF00FF without needing to write code for that. There is any .NET built-in parser for that? ...

64 bit hexadecimal to base 10 conversion

The hex value is 1679EDDF2CFD1455 I am expecting the decimal equivalent to be 1.619587084 X 10 ^ 18 If possible, could someone please confirm this, and if possible I would love more significant digits to the decimal value. Thank you in advance. ...

How to print integer literals in binary or hex in haskell?

How to print integer literals in binary or hex in haskell? printBinary 5 => "0101" printHex 5 => "05" Which libraries/functions allow this? I came across the Numeric module and its showIntAtBase function but have been unable to use it correctly. > :t showIntAtBase showIntAtBase :: (Integral a) => a -> (Int -> Char) -> a -> String...

How to write a HEX string into a file as HEX using REXX..

I have a string 'RAJA' which should be written into a file as HEX data. Here are sample codes which help me to describe the issue. Case(a) name = 'RAJA' name = C2X(name) /* Hex value = '52414A41' */ QUEUE name. Output to the file: 52414A41 But if we use HEX data directly to write into file it's working fine Case(b) name = '52414A...

Convert Hex Char To Int - Is there a better way?

I have written a function to take in the data from a Sirit IDentity MaX AVI reader and parse out the facility code and keycard number. How I am currently doing it works, but is there a better way? Seems little hackish... buff & buf are size 264 buf and buff are char Data received from reader: 2009/12/30 14:56:18 epc0 LN:001 C8...

storing hexadecimal in a variable (Dim xx as "Hex") in vb.net

As the title says how can I store a hexadecimal number in a variable without it becoming a decimal. Or do I have to store it as either a string or integer? ...

Show Hexadecimal Numbers Of a File

I want to build a bash program that can read a file, like a *.bin and print all its hexadecimal numbers, as 'hex' editors do. Where I can start? ...

Print Hexadecimal Numbers Of a File At C And C++

I'm now developing a home project, but before I start, I need to know how can I printcout the content of a file(*.bin as example) in hexadecimal? I like to learn, then a good tutorial is very nice too ;-) Remember that I need to develop this, without using external applications, because this home project is to learn more about hexadeci...

Substituting 0A For \n

I'm at the time beginning the development of a simple hex editor(that only reads at the time). I want to substitute OA for "\n", I'm trying with this code: #include <iostream> #include <fstream> #include <iomanip> using namespace std; int main() { ifstream infile; int crtchar = (int)infile.get(); infile.open("test.txt", ifstre...

Best/Easiest Language To Work With Disassembling

I'm now thinking to develop a disassembler, but as I know that it's very hard to build a disassembler I want to know the best/easiest language to turn my dream into a reality, also, a tutorial suggestion is very nice too ;-) ...

A question for you who work with hexadecimal frequently

Hello, Whenever I work with hexadecimal values, I do the conversion (if needed) into decimal in my head or with the help of a converter. Well I was thinking, if you work long enough and get used to hexadecimal, do you just 'see' the value (whatever that means), as when reading decimal ? I mean are you after a while able to read base 16 ...

Python conversion from binary string to hexadecimal

how can I perform a conversion of a binary string to the corresponding hex value in python I have 0000 0100 1000 1101 and I want to get 048D I'm using python2.6 Thanks for the help ...

Converting a Char to Its Int Representation

I don't see this an option in things like sprintf(). How would I convert the letter F to 255? Basically the reverse operation of conversion using the %x format in sprintf? I am assuming this is something simple I'm missing. ...

How to get Color from Hex color code using .NET?

How can I get Color from a Hex color code(e.g. #FFDFD991)? I am reading a file and getting Hex color code, I need to create the corresponding System.Windows.Media.Color instance for the Hex color code. Is there any inbuilt method in framework to do this? ...

Setting ints to negative values using hexadecimal literals in C#

Is there any way to set an int to a negative value using a hexadecimal literal in C#? I checked the specification on Integer literals but it didn't mention anything. For example: int a = -1; // Allowed int b = 0xFFFFFFFF; // Not allowed? Hexadecimal notation is clearer for my application, and I'd prefer not to use uints becau...

Can anyone solve this 8080 assembly code 'puzzle'?

Hi, A friend of mine was given 8080 assembly code as part of a puzzle he's trying to solve. This is the code: 3E 02 4F C6 04 47 11 41 01 21 69 00 19 76 He needs the values of B, DE, C and HL Can anyone solve this or point me in the right direction on how to run this? Thx! Update Spoiler: The solution seems to be: C = 02, B = 06, D...

Simple Hexadecimal color question

I have a number between 0.0 and 1.0, I would like to convert it to a grayscale color. White = 0 Black = 1 You can show me how in any understandable language (I prefer actionscript 3) Please, don't just give a name of a function that a language have to do this, I want to know how it does. ...