## [Solved] How to count the number of characters in a line in a csv file

I suggest you to read the javadoc of String.split. I think that you misunderstood the concept when you did this: String[] f=line.split(“,”); a[count]=Integer.parseInt(f[2]); //–> java.lang.NumberFormatException here! Avoid using ‘magic’ numbers in your code like int[] a = new int[24];. Why 24? Well, here comes a version that do what you want to do. Maybe it … Read more

## [Solved] Convert binary, octal, decimal and hexadecimal values between each other in BASH / Shell [duplicate]

Convert binary, octal, decimal and hexadecimal values between each other in BASH with bc and printf Some relevant Q&A: Understand “ibase” and “obase” in case of conversions with bc? TL;DR: ibase and obase params order matters, but not always. Hex values must be in UPPERCASE. Convert a character from and to its decimal, binary, octal, … Read more

## [Solved] iOS:convert hex data to integer format

Define a struct with all the correct types and order. Point the struct to the data. Then just access the items via the struct elements. Be careful with the types, it is probably best to use well defined types such as int8_t, uint8_t, uint16_t, int16_t, etc to insure the correct element size. You will want … Read more

## [Solved] Extracting hex numbers from char array [closed]

Not very hard, all you need is a loop and a cast to make sure your numbers are unsigned for (int i = 0; i < 16; ++i) printf(“%02X”, (unsigned char)data[i]); 4 solved Extracting hex numbers from char array [closed]

## [Solved] Invert 7th bit of hex string C++ [duplicate]

#include <stdio.h> void flipme(char *buf, const char *inBuf) { int x; sscanf(inBuf, “%x”, &x); x ^= 1 << 17; sprintf(buf, “%06X”, x); } int main(void) { char buf[16]; flipme(buf, “002A05”); printf(“002A05->%s\n”, buf); flipme(buf, “ABCDEF”); printf(“ABCDEF->%s\n”, buf); } Output: 002A05->022A05 ABCDEF->A9CDEF You wrote: I tried converting hex string to integer via strtol, but that function strip … Read more

## [Solved] Convert a Hex String to comma separated Hex String c#

string temp = “aaff4455”; string temp2 = “”; int size = temp.Length; for (int i = 0; i < size; i += 2) { temp2 += temp.Substring(i, 2); if ((i+2) < size) temp2 += “,”; } 5 solved Convert a Hex String to comma separated Hex String c#

## [Solved] Explanation of HEX value representation and Endianess

Big or little endianness defines how to interpret a sequence of bytes longer than one byte and how to store those in memory. Wikipedia will help you with that. I was really just looking to understand how 0x0300020 when read 2 bytes at a time and reprinted yields 0 1 2. You don’t read 2 … Read more

## [Solved] How to inverse an integer in C?

Technically, no. But why are you using htons? It changes the endianess of a 16 bit datum to big-endian (that is, network byte order). First is your variable not 16 bit but 32 bit, so uint16_t acc = 0xBBD1 would be more appropriate. Second, as your on a little-endian machine, the bytes are exchanged, hence … Read more

## [Solved] copy hexstream in a char buffer to be sent over network [closed]

You’ve converted the binary content to a string when you copied it from Wireshark. The result is a string that represents the binary data in a hex Format. Instead of revers the convertion you should use an appropriate methop to copy the data. Try Wireshark’s feature “follow XXX stream” and take the “C Arrays” representation, … Read more

## [Solved] How can I find the language of this code and how can I find the tool to convert this code to text or HTML [closed]

They seem to be HTML entities, but they are not complete, they should end with ‘;’ So the code should read: &#1112;&#965;&#1109;t The characters you see are: &amp;#1112; CYRILLIC SMALL LETTER JE &amp;#965; GREEK SMALL YPSILON &amp;#1109; CYRILLIC SMALL LETTER DZE t a normal t In your browser it look almost like ‘just’ For a … Read more