The converting tag has no wiki summary.
4
votes
1answer
80 views
Char* hex string to BYTE Array
The idea is that i want any size string to put the corresponding hex value into a byte array. I've seen a million ways to do it. Some of them didn't look to clean. My needs are speed over memory, so ...
2
votes
1answer
64 views
Implement numbering scheme like A,B,C… AA,AB,… AAA…, similar to converting a number to radix26
I want to implement numbering scheme like Microsoft Word uses for numbering.
first one gets = A,next is B, next is C, .... then AA, then AB,....and so on.
as shown below
A
B
C
.
.
AA
...
1
vote
1answer
159 views
Help me improve my attempt to slap strong types on top of COM and ODBC
I am stuck with some old API that involves COM and ODBC, and I cannot switch to cool things like MEF or entity framework. So, I am working on some wrappers that will help me write less code and also ...
1
vote
4answers
138 views
Converting hex character to decimal
Is it possible to make this code more efficient & elegant?
int HexToDecimal(char ch)
{
ch = tolower(ch);
if ('a' <= ch && ch <= 'f')
{
return ch - 'a' + 10;
...
3
votes
3answers
329 views
Best C# idiom to convert the items on an object array to a string?
I have something akin to
object[] values = getValues();
string renderedValues = string.Join("-",
Array.ConvertAll<object,string>(values,
new ...
5
votes
1answer
2k views
Converting binary value from BitArray to an int and back in C#
What I am creating is essentially a binary clock face with touch input for setting values as well as displaying - so I need to convert both ways between an int and a binary sequence in a BitArray.
I ...
2
votes
1answer
506 views
Javascript conversion of datetime strings in PHP pages to user's timezone
I am working on an PHP/MySQL application that uses a different timezone from the server it runs on, and neither of the timezones are UTC. I'm converting displayed times to be in the user's timezone, ...
4
votes
1answer
2k views
Conversion from/to roman numbers
I wrote as an exercise in Test-Driven Development a piece of Python code that contains two functions:
roman2dec(roman), that converts a roman number (string) into a decimal number (int)
...
12
votes
6answers
3k views
Use of a regex stored inside yaml file
I installed settingslogic and in the configuration file I put the regex for the email as follows
#config/settings.yml
defaults: &defaults
email_regex: ...