Click here to Skip to main content
15,897,968 members
Home / Discussions / C#
   

C#

 
QuestionSendkeys.Sendwait Pin
channbear13-Jan-09 18:38
channbear13-Jan-09 18:38 
QuestionHow to generate XML report using SQL Server Reporting Services Pin
DipaliG13-Jan-09 18:25
DipaliG13-Jan-09 18:25 
AnswerRe: How to generate XML report using SQL Server Reporting Services Pin
ColinM12313-Jan-09 18:50
ColinM12313-Jan-09 18:50 
GeneralRe: How to generate XML report using SQL Server Reporting Services Pin
ColinM12313-Jan-09 18:50
ColinM12313-Jan-09 18:50 
QuestionSmallest and fastest way to store numeric data in a file Pin
Reanalyse13-Jan-09 15:40
Reanalyse13-Jan-09 15:40 
AnswerRe: Smallest and fastest way to store numeric data in a file [modified] Pin
Luc Pattyn13-Jan-09 16:35
sitebuilderLuc Pattyn13-Jan-09 16:35 
AnswerRe: Smallest and fastest way to store numeric data in a file Pin
PIEBALDconsult13-Jan-09 16:51
mvePIEBALDconsult13-Jan-09 16:51 
AnswerRe: Smallest and fastest way to store numeric data in a file Pin
Guffa13-Jan-09 17:20
Guffa13-Jan-09 17:20 
For the simplest code you could use two bytes for each value:

value = data[0] + data[1] * 256;

You only need 12 bits to store each value (0 to 4095), so for the smallest file size you could pack two values in three bytes:

Bit usage:

11111111 11112222 22222222

pack:

data[0] = (byte)value1;<br />
data[1] = (byte)(((value1 >> 8) << 4) + (value2 & 15));<br />
data[2] = (byte)(value2 >> 4);


unpack:

value1 = data[0] + ((data[1] >> 4) << 8);<br />
value2 = (data[1] & 15) + (data[2] << 4);


Despite everything, the person most likely to be fooling you next is yourself.

modified on Wednesday, January 14, 2009 12:34 AM

AnswerRe: Smallest and fastest way to store numeric data in a file Pin
Mark Churchill13-Jan-09 17:42
Mark Churchill13-Jan-09 17:42 
GeneralRe: Smallest and fastest way to store numeric data in a file Pin
Reanalyse13-Jan-09 19:22
Reanalyse13-Jan-09 19:22 
AnswerRe: Smallest and fastest way to store numeric data in a file Pin
CPallini13-Jan-09 22:01
mveCPallini13-Jan-09 22:01 
QuestionObtain All Information from an Ocx [modified] Pin
angral13-Jan-09 14:41
angral13-Jan-09 14:41 
AnswerRe: Obtain All Information from an Ocx Pin
Henry Minute13-Jan-09 16:56
Henry Minute13-Jan-09 16:56 
GeneralRe: Obtain All Information from an Ocx Pin
angral13-Jan-09 18:05
angral13-Jan-09 18:05 
Questionanimations\video Pin
mjmim13-Jan-09 14:39
mjmim13-Jan-09 14:39 
AnswerRe: animations\video Pin
EliottA13-Jan-09 14:45
EliottA13-Jan-09 14:45 
QuestionDatasets / SQL [modified] Pin
CrimeanTurtle200813-Jan-09 13:42
CrimeanTurtle200813-Jan-09 13:42 
AnswerRe: Datasets / SQL Pin
leckey13-Jan-09 14:36
leckey13-Jan-09 14:36 
QuestionAutoresize column width in owner drawn ListView [modified] Pin
CodeBerserker13-Jan-09 12:30
CodeBerserker13-Jan-09 12:30 
QuestionNumber Vaildation Pin
tswright104113-Jan-09 12:26
tswright104113-Jan-09 12:26 
AnswerRe: Number Vaildation Pin
EliottA13-Jan-09 12:38
EliottA13-Jan-09 12:38 
AnswerRe: Number Vaildation Pin
RyanEK13-Jan-09 14:03
RyanEK13-Jan-09 14:03 
AnswerRe: Number Vaildation Pin
PIEBALDconsult13-Jan-09 14:18
mvePIEBALDconsult13-Jan-09 14:18 
AnswerRe: Number Vaildation [modified] Pin
Jon Rista13-Jan-09 14:36
Jon Rista13-Jan-09 14:36 
GeneralRe: Number Vaildation Pin
tswright104114-Jan-09 3:37
tswright104114-Jan-09 3:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.