Search Results

Search found 796 results on 32 pages for 'hex'.

Page 3/32 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Chrome causing 404's ending with "/cache/[hex-string]/"?

    - by Jan Fabry
    Since the last weeks we see many 404's on our sites caused by Chrome adding /cache/[hex-string]/ to the current page URL. The hex strings we have seen are: e9c5ecc3f9d7fa1291240700c8da0728 1d292296547f895c613a210468b705b7 408cfdf76534ee8f14657ac884946ef2 9b0771373b319ba4f132b9447c7060a4 b8cd4270356f296f1c5627aa88d43349 If you search for these strings you get matches from different sites, but they are most likely auto-generated (/search/cache/e9c5ecc3f9d7fa1291240700c8da0728/ for example). Is this a known issue with Chrome (or an extension)?

    Read the article

  • HTML Named Colors + Hex Using Reflection

    This sample actually shows several things, like how to add controls to a page/Placeholder, dynamically, how to get a color from RGB, convert a color to Hex, plus (the main point) it shows how, using reflection, you can iterate through the system colors and display them (using dynamic labels), plus get the HTML hex for each color.

    Read the article

  • linux shell utils: convert a list of hex to list of decimals

    - by osgx
    Hello How can I convert a file with a lot hex numbers into the decimal? Example: file1 0x59999 0x5acdc 0xffeff I want to start $ cat file1 | util | cat file2 and get file2 with smth like 1021489 1249230 3458080 (numbers in example output are random, as I cant convert so long hex to dec) Upd: perl : perl -pe '$_=hex;$_.="\n"'. Can anybody do it better? The real task is a sorting of hex numbers.

    Read the article

  • Hex to Decimal conversion in C

    - by darkie15
    Hi All, Here is my code which is doing the conversion from hex to decimal. The hex values are stored in a unsigned char array: int liIndex ; long hexToDec ; unsigned char length[4]; for (liIndex = 0; liIndex < 4 ; liIndex++) { length[liIndex]= (unsigned char) *content; printf("\n Hex value is %.2x", length[liIndex]); content++; } hexToDec = strtol(length, NULL, 16); Each array element contains 1 byte of information and I have read 4 bytes. When I execute it, here is the output that I get : Hex value is 00 Hex value is 00 Hex value is 00 Hex value is 01 Chunk length is 0 Can any one please help me understand the error here. Th decimal value should have come out as 1 instead of 0. Regards, darkie

    Read the article

  • How to convert from hex-encoded string to a "human readable" string?

    - by John Jensen
    I'm using the Net-SNMP bindings for python and I'm attempting to grab an ARP cache from a Brocade switch. Here's what my code looks like: #!/usr/bin/env python import netsnmp def get_arp(): oid = netsnmp.VarList(netsnmp.Varbind('ipNetToMediaPhysAddress')) res = netsnmp.snmpwalk(oid, Version=2, DestHost='10.0.1.243', Community='public') return res arp_table = get_arp() print arp_table The SNMP code itself is working fine. Output from snmpwalk looks like this: <snip> IP-MIB::ipNetToMediaPhysAddress.128.10.200.6.158 = STRING: 0:1b:ed:a3:ec:c1 IP-MIB::ipNetToMediaPhysAddress.129.10.200.6.162 = STRING: 0:1b:ed:a4:ac:c1 IP-MIB::ipNetToMediaPhysAddress.130.10.200.6.166 = STRING: 0:1b:ed:38:24:1 IP-MIB::ipNetToMediaPhysAddress.131.10.200.6.170 = STRING: 74:8e:f8:62:84:1 </snip> But my output from the python script yields a tuple of hex-encoded strings that looks like this: ('\x00$8C\x98\xc1', '\x00\x1b\xed;_A', '\x00\x1b\xed\xb4\x8f\x81', '\x00$86\x15\x81', '\x00$8C\x98\x81', '\x00\x1b\xed\x9f\xadA', ...etc) I've spent some time googling and came across the struct module and the .decode("hex") string method, but the .decode("hex") method doesn't seem to work: Python 2.7.3 (default, Apr 10 2013, 06:20:15) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> hexstring = '\x00$8C\x98\xc1' >>> newstring = hexstring.decode("hex") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/encodings/hex_codec.py", line 42, in hex_decode output = binascii.a2b_hex(input) TypeError: Non-hexadecimal digit found >>> And the documentation for struct is a bit over my head.

    Read the article

  • How to scroll hex tiles?

    - by Chris Evans
    I don't seem to be able to find an answer to this one. I have a map of hex tiles. I wish to implement scrolling. Code at present: drawTilemap = function() { actualX = Math.floor(viewportX / hexWidth); actualY = Math.floor(viewportY / hexHeight); offsetX = -(viewportX - (actualX * hexWidth)); offsetY = -(viewportY - (actualY * hexHeight)); for(i = 0; i < (10); i++) { for(j = 0; j < 10; j++) { if(i % 2 == 0) { x = (hexOffsetX * i) + offsetX; y = j * sourceHeight; } else { x = (hexOffsetX * i) + offsetX; y = hexOffsetY + (j * sourceHeight); } var tileselected = mapone[actualX + i][j]; drawTile(x, y, tileselected); } } } The code I've written so far only handles X movement. It doesn't yet work the way it should do. If you look at my example on jsfiddle.net below you will see that when moving to the right, when you get to the next hex tile along, there is a problem with the X position and calculations that have taken place. It seems it is a simple bit of maths that is missing. Unfortunately I've been unable to find an example that includes scrolling yet. http://jsfiddle.net/hd87E/1/ Make sure there is no horizontal scroll bar then trying moving right using the - right arrow on the keyboard. You will see the problem as you reach the end of the first tile. Apologies for the horrid code, I'm learning! Cheers

    Read the article

  • How to convert a string color to its hex code or RGB value?

    - by Abs
    Hello all, I am not sure if its possible but I would like to create some sort of function where you pass in a string such as "yellow" or "green" and it returns its hex code or the range of hex codes that greens or yellows fit into. Is this possible in PHP? If not possible, I am willing to try anything else that can do this! Thanks all

    Read the article

  • how to type/send hex on a putty session

    - by Amit Phatarphekar
    I'm using Putty to make a serial connection to a device. I need to send a Hex string on this session. How do I do this? The Hex String is FF7E414244 This is required to break the serial device into command interface mode... From an XP machine, I can use HyperTerminal. And then on the serial connection, do a "send file", where the file has this hexstring entered using hex editing means. So this mechanism works. But now I have a windows 7 with no hyperterminal. so I'm using putty. But now how do I send the hex string? Thanks

    Read the article

  • Can I interpolate two HEX color values without converting them to RGB?

    - by navand
    I'm trying to make a Gradient Class for a Blackberry app. At first I thought about converting the HEX values to RGB and then interpolating them before converting the result back into HEX, but since I will be doing this for every pixel line of an area, and the calculations will be made by a mobile, I thought that maybe there's a more efficient way of doing it. Maybe involving those pesky bitwise operators which I know nothing of... or something. So, is there a way of interpolating without converting to RGB and back? If so, is it faster than the original way? In any case, can you help me make the most efficient color interpolation? Thank you in advance!

    Read the article

  • Hex Dump using LINQ (in 7 lines of code)

    Eric White has posted an interesting LINQ query on his blog that shows how to create a Hex Dump in something like 7 lines of code.Of course, this is not production grade code, but it's another good example that demonstrates the expressiveness of LINQ.Here is the code:byte[] ba = File.ReadAllBytes("test.xml");int bytesPerLine = 16;string hexDump = ba.Select((c, i) => new { Char = c, Chunk = i / bytesPerLine })    .GroupBy(c => c.Chunk)    .Select(g => g.Select(c...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Storing a Hex Grid

    - by Pedro Caetano
    I've been creating a small hex grid framework for Unity3D and have come to the following dilema. This is my coordinate system (taken from here) Link because I'm a new user It all works pretty nicely except for the fact I have no idea how to store it. I originally intended to store this in a 2D array and use images to generate my maps. One problem was that it had negative values (this was easily fixed by offsetting the coordinates a bit). However, due to this coordinate system, such an image or bitmap would have to be diamond shaped - and since these structures are square shaped, this would cause a lot of headaches even if I hack something together. Is there anything I'm missing that could fix this? I recall seeing a forum post regarding this in the unity forums but I can no longer find the link. Is writing a set of coordinate translators the best solution here? If you guys think it would be helpful, I can post code and images of my problem.

    Read the article

  • Hex Dump using LINQ (in 7 lines of code)

    - by Fabrice Marguerie
    Eric White has posted an interesting LINQ query on his blog that shows how to create a Hex Dump in something like 7 lines of code.Of course, this is not production grade code, but it's another good example that demonstrates the expressiveness of LINQ.Here is the code:byte[] ba = File.ReadAllBytes("test.xml");int bytesPerLine = 16;string hexDump = ba.Select((c, i) => new { Char = c, Chunk = i / bytesPerLine })    .GroupBy(c => c.Chunk)    .Select(g => g.Select(c => String.Format("{0:X2} ", c.Char))        .Aggregate((s, i) => s + i))    .Select((s, i) => String.Format("{0:d6}: {1}", i * bytesPerLine, s))    .Aggregate("", (s, i) => s + i + Environment.NewLine);Console.WriteLine(hexDump); Here is a sample output:000000: FF FE 3C 00 3F 00 78 00 6D 00 6C 00 20 00 76 00000016: 65 00 72 00 73 00 69 00 6F 00 6E 00 3D 00 22 00000032: 31 00 2E 00 30 00 22 00 20 00 65 00 6E 00 63 00000048: 6F 00 64 00 69 00 6E 00 67 00 3D 00 22 00 75 00000064: 3E 00Eric White reports that he typically notices that declarative code is only 20% as long as imperative code. Cross-posted from http://linqinaction.net

    Read the article

  • Problem with writing a hexadecimal string

    - by quilby
    Here is my code /* gcc -c -Wall -g main.c gcc -g -lm -o main main.o */ #include <stdlib.h> #include <stdio.h> #include <string.h> void stringToHex(const char* string, char* hex) { int i = 0; for(i = 0; i < strlen(string)/2; i++) { printf("s%x", string[2*i]); //for debugging sprintf(&hex[i], "%x", string[2*i]); printf("h%x\n", hex[i]); //for debugging } } void writeHex(char* hex, int length, FILE* file, long position) { fseek(file, position, SEEK_SET); fwrite(hex, sizeof(char), length, file); } int main(int argc, char** argv) { FILE* pic = fopen("hi.bmp", "w+b"); const char* string = "f2"; char hex[strlen(string)/2]; stringToHex(string, hex); writeHex(hex, strlen(string)/2, pic, 0); fclose(pic); return 0; } I want it to save the hexadecimal number 0xf2 to a file (later I will have to write bigger/longer numbers though). The program prints out - s66h36 And when I use hexedit to view the file I see the number '36' in it. Why is my code not working? Thanks!

    Read the article

  • Simple number-to-number (or number-to-hex) encryption algorithm that minimizes # of characters

    - by Clay Nichols
    I need to encrypt a number and I and this encrypted value will be given to a customer ask a key so I want to minimize the number of digits and make them all printable. So I'd like the result to be either all number or all Hex characters. The current encryption method I'm using (for non numbers) converts the characters to hex (2 hex digits each). That doubles the number of characters. I also considered just treating the input as hex (so each pair of numbers is treated as a Hex pair, but then you have ambiguity between an input of 0123 and 123 (when decrypting that leading '0' is lost. Any suggestions?

    Read the article

  • BuiltIn Function to Convert from Hex String to Byte

    - by Ngu Soon Hui
    This question is similar to the one here. One can easily convert from hex string to byte via the following formula: public static byte[] HexStringToBytes(string hex) { byte[] data = new byte[hex.Length /2]; int j = 0; for (int i = 0; i < hex.Length; i+=2) { data[ j ] = Convert.ToByte(hex.Substring(i, 2), 16); ++j; } return data; } But is there a built-in function ( inside .net framework) for this?

    Read the article

  • Strange hex formatting in NSString

    - by pseudopeach
    Try this: unsigned long long int N; = 23229877463LL; NSString* s = [NSString stringWithFormat:@"dec:%qi, hex:%qX",N,N]; NSLog(@"output: %@",s); output: dec:23229877460, hex:689BCCD400000005 What's up with the 00000005??? In mySQL, hex(23229877460) = 5689BCCD4. Also, every other language seems to do this correctly. A 16 digit long hex is like 4 gazillion (16^16), right? How can I get objective-c to format hex numbers that other languages can understand?

    Read the article

  • How to get the MD5 hex hash for a file using VBA?

    - by aF
    How can I get the MD5 hex hash for a file using VBA? I need a version that works for a file. Something as simple as this Python code: import hashlib def md5_for_file(fileLocation, block_size=2**20): f = open(fileLocation) md5 = hashlib.md5() while True: data = f.read(block_size) if not data: break md5.update(data) f.close() return md5.hexdigest() But in VBA.

    Read the article

  • How to convert an ASCII HEX character to it's value (0-15)?

    - by philcolbourn
    I am writing a string parser and the thought occurred to me that there might be some really interesting ways to convert an ASCII hexadecimal character [0-9A-Fa-f] to it's numeric value. What are the quickest, shortest, most elegant or most obscure ways to convert [0-9A-Fa-f] to it's value between 0 and 15? Assume, if you like, that the character is a valid hex character. I have no chance so I'll have a go at the most boring. ( c <= '9' ) ? ( c - '0' ) : ( (c | '\x60') - 'a' + 10 )

    Read the article

  • Hex characters in varchar() is actually ascii. Need to decode it.

    - by csauve
    This is such an edge-case of a question, I'd be surprised if there is an easy way to do this. I have a MS SQL DB with a field of type varchar(255). It contains a hex string which is actually a Guid when you decode it using an ascii decoder. I know that sounds REALLY weird but here's an example: The contents of the field: "38353334373838622D393030302D343732392D383436622D383161336634396339663931" What it actually represents: "8534788b-9000-4729-846b-81a3f49c9f91" I need a way to decode this, and just change the contents of the field to the actual guid it represents. I need to do this in T-SQL, I cannot use .Net (which if I could, that is remarkably simple).

    Read the article

  • Getting value of LSB from Hex (C code)

    - by Rjff
    Hi - first post here :) I've got a code like this in C: unsigned char const data[ ] = {0x0a, 0x1d, 0xf0, 0x07}; I need to extract it such that the final value is: 0xa1df7 I have only been able to extract and get it working if the hex values that have at least 1 zero: unsigned char const data[ ] = {0x0a, 0xd0, 0xf0, 0x07}; using the code below: for(int i = 0; i < SIZE; ++i) { tmp = data[i]; if ( (data[i] <= 0x0F) && (((data[i] & 0x0F) == 0) || (data[i] & 0xF0) == 0)) // one of the hex is zero { tmp = ((tmp << 4) >> 4) << N[i]; std::cout << "foo: " << std::hex << tmp << ":" << std::endl; } else if ((data[i] >= 0x0F) && (((data[i] & 0x0F) == 0) || (data[i] & 0xF0) == 0) ) { tmp = (tmp >> 4) << N[i]; std::cout << "bar: " << std::hex << tmp << ":" << std::endl; } else { std::cout << "result: " << std::hex << result << ":" << std::endl; std::cout << "tmp << 8: " << std::hex << (tmp << 8)<< ":" << std::endl; result = result | (tmp << 8); std::cout << "result |= (tmp << 8): " << std::hex << result << ":" << std::endl; } result |= tmp; std::cout << "boo: " << std::hex << result << ":" << std::endl; } It seems the last else {...} block is troublesome for me. Any ideas? Thanks!

    Read the article

  • URL hex characters in .htaccess

    - by Steve
    There is an old page with a space in the filename, and this is no longer found on the website. So I need to redirect this page to another page using a 301 redirect in .htaccess. If I place the filename directly into .htaccess (Bouquets%20%26%20Loose.html), the redirect does not work. If I escape the % sign like this (Bouquets\%20\%26\%20Loose.html), the redirect still does not work. How do I get this redirect to work in .htaccess? Thanks.

    Read the article

  • convert float numbers to hex

    - by jordan2010
    I am quite new in Python and I am looking for converting numbers from decimal to hex How to convert float numbers to hex or char in Python 2.4.3? how can I keep it to write it as ("\xa5\x (here the new hex number)") any help Thanks,

    Read the article

  • invalid scalar hex value 0x8000000 and over

    - by kioto
    Hi. I found a problem getting hex value from yaml file. It couldn't get hex value 0x80000000 and over. Following is a sample C++ program. // ymlparser.cpp #include <iostream> #include <fstream> #include "yaml-cpp/yaml.h" int main(void) { try { std::ifstream fin("hex.yaml"); YAML::Parser parser(fin); YAML::Node doc; parser.GetNextDocument(doc); int num1; doc["hex1"] >> num1; printf("num1 = 0x%x\n", num1); int num2; doc["hex2"] >> num2; printf("num2 = 0x%x\n", num2); return 0; } catch(YAML::ParserException& e) { std::cout << e.what() << "\n"; } } hex.yaml hex1: 0x7FFFFFFF hex2: 0x80000000 Error message is here. $ ./ymlparser num1 = 0x7fffffff terminate called after throwing an instance of 'YAML::InvalidScalar' what(): yaml-cpp: error at line 2, column 7: invalid scalar Aborted Environment yaml-cpp : getting from svn, March.22.2010 or v0.2.5 OS : Ubuntu 9.10 i386 I need to get hex the value on yaml-cpp now, but I have no idea. Please tell me how to get it another way. Thanks,

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >