|
A byte is equal to 8 bits. It has the same size as a character.
|
|
|
|
|
Ok. Thanks. Is it possible to compress 8bits into a byte using RLC( Run-Length Coding)?
|
|
|
|
|
You don't need to compress anything there - a byte is 8 bits.
|
|
|
|
|
Does that means I am actually shrinking the size of the data?
|
|
|
|
|
sclh wrote:
Does that means I am actually shrinking the size of the data?
Nope.
When you have an 8-bit binary number - that's a byte.
Exmaples of bytes are 10010010, 10001000, 11111111, 0 (00000000), 10000001 etc.
The decimal equivalent of the largest unsigned byte is 255. So if you have a byte variable, it can represent any of 256 values (0 included).
|
|
|
|
|
Ok, thank you for the info. Perhaps I will go and read up and find out my problem then I will consult help again.Thanks.
|
|
|
|
|
No, to compress with rle you need at minimum 4 bytes (32 bits). I assume you read the article at http://www.arturocampos.com/ac_rle.html[^] about RLE. I also believe it explains rle compression pretty well. Do you have any specific questions about the article or rle? Is your problem homework or for some other purpose? I ask this because rle is definitly not the best algorithm to use. And there are several source code compression libraries that you can download and use for free.
John
|
|
|
|
|
cedric moonen wrote:
A byte is equal to 8 bits.
Only for UTF-8. You could also have UTF-16 which would be a 16-bit byte (e.g., Unicode).
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
AFAIK, a byte is always 8-bits.
[edit]
I just saw the reference to the article that said there used to be 6-bit bytes, but today's byte is 8-bits in length.
[/edit]
I believe UTF-16 uses a 16-bit (i.e. 2 byte) "word". Hence, MBCS, DBCS, etc. refer to multi-byte, double-byte..., etc.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Fair enough. I rarely deal with such things, so I was just mainly throwing it out on the table for further discussion.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
the word byte comes from By Eight. Meaning they took eight bits together
No hurries, no worries.
|
|
|
|
|
|
ok I stand corrected.
No hurries, no worries.
|
|
|
|
|
you almost had me convinced
Blogless
|
|
|
|
|
And here I thought is was a contraction from the Old English - 'Byte Me!'
|
|
|
|
|
Hi, could somebody help me?
In my C application, I try to communicate with CISCO's devices, such as router, swith. then once the connection is established, I can issue some commands to grab some data from the CISCO's device.
could somebody tell me how can I do this, and if CISCO has the related "API" that I can use ?
thanks a lot
dadsadasd
|
|
|
|
|
asv wrote:
could somebody tell me how can I do this, and if CISCO has the related "API" that I can use ?
Sounds interesting. Never thought of doing this but in order to communicate with a Cisco device you will need to visit Cisco’s web site. As memory serves they use their own variation of SNMP (simple network management protocol) although some of the more general commands should work.
Not much help I know but it (SNMP) gives you a starting point.
-------------------------------
|
|
|
|
|
You could do this with the Telnet protocol.
Blogless
|
|
|
|
|
Okay, didn’t even think of just opening a socket connection to the device to see what it would allow you to do.
Then again do you really want it set up so insecure? I mean telnet is after all clear text over the wire.
Interesting...
-------------------------------
|
|
|
|
|
sfdougl wrote:
Then again do you really want it set up so insecure? I mean telnet is after all clear text over the wire.
Could use SSH or secure telnet, but either way you can use 'show run' and parse the return string to hold all the cisco configuration, then issue "config t" and the parameter is question to set it's appriopiate value. There are web base solutions but all are very crude.
Blogless
|
|
|
|
|
|
hi folks,
here is my problem.
i have a member function of my dialog box called OnEditDateDay() that maps an EditBox Control EN_CHANGE (ON_EN_CHANGE(IDC_DATEDAY_EDIT, OnEditDateDay) ).
when i code the folowing function, it works well under Visual Studio 6, but not perfecty on VS2003.
it returns the cursor (current position where to write in the edit control) at the begining of the edit, each time i reach the 2 characters string length...
here is the code.
void CFactEditorDlg::OnEditDateDay() {
m_peDateDay->GetWindowText(m_strDateDay);
if ((m_strDateDay.GetLength() >= 2) && (m_peDateDay == GetFocus())) {
m_strDateDay = m_strDateDay.Left(2);
m_peDateDay->SetWindowText(m_strDateDay);
m_peDateMonth->SetSel(0, -1);
m_peDateMonth->SetFocus();
}
m_strDateText.Format("%s/%s/%s", m_strDateDay, m_strDateMonth, m_strDateYear);
m_ptDate->SetWindowText(m_strDateText);
}
i really cannot understand why this...
i give up.
any idea or questions ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I am going to guess that is because when when you reach 2 charcters in length you then call SetWindowText on the edit control, which causes OnEditDateDay to be called again.
|
|
|
|
|
so why doesn't it do this under visual C++ 6 ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Blind luck! You are just ASKING for recursion to occur using SetWindowText on an EN_CHANGE message. A different user recently had a post here with a similar problem, and he DID suffer the recursion.
|
|
|
|