473,503 Members | 1,643 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

bit manipulation

Greetings,

Thanks for helping me with some of the C# bit manipulation issues I've asked
about over the last couple days. I've got a first public preview of the
Binary8, Binary16, Binary32, and Binary64 classes I've worked on.

http://www.visualassembler.com/binary/

Use it like you would any other int, short, byte, whatever... I've
overloaded all but one of the operators (^ -- don't know how to do so).
Examples,

Binary8 bin = "10110100";
Binary16 bin = "1101";

Binary8 bin2 = bin << 3;
Binary64 bin3 = "10101";
Binary8 bin4 = bin3; // accepable because it doesn't exceed 8 bits

Binary8 bin = 0xFF;
Binary16 bin2 = ~bin;

if (bin > bin2) {
bin >>= 7;
}

bin2 = bin.RoateLeft(3);

if (bin2 != bin) {
bin2 = bin;
}

bin++;
bin *= "0101";

you get the picture...

optimizations wanted. There will be more updates, this is just a preview...

Thanks,
Shawn
Nov 15 '05 #1
5 8432
"Shawn B." <le****@html.com> wrote in message
news:uO**************@TK2MSFTNGP10.phx.gbl...
Greetings,

Thanks for helping me with some of the C# bit manipulation issues I've asked about over the last couple days. I've got a first public preview of the
Binary8, Binary16, Binary32, and Binary64 classes I've worked on.

http://www.visualassembler.com/binary/

Use it like you would any other int, short, byte, whatever... I've
overloaded all but one of the operators (^ -- don't know how to do so).
Examples,

Binary8 bin = "10110100";
Binary16 bin = "1101";

Binary8 bin2 = bin << 3;
Binary64 bin3 = "10101";
Binary8 bin4 = bin3; // accepable because it doesn't exceed 8 bits

Binary8 bin = 0xFF;
Binary16 bin2 = ~bin;

if (bin > bin2) {
bin >>= 7;
}

bin2 = bin.RoateLeft(3);

if (bin2 != bin) {
bin2 = bin;
}

bin++;
bin *= "0101";

you get the picture...

optimizations wanted. There will be more updates, this is just a preview...
Thanks,
Shawn


It seems I can't get this to work in VB.NET, it won't allow me to assign the
object and none of the operators work. Guess it's a MC++, C# only solution.
Anyone have ideas how I can make it work in VB?
Thanks,
Shawn
Nov 15 '05 #2
There is no operator overloading in VB.

-JG
Nov 15 '05 #3
One of the biggest marketing pushes for .NET is that if you write in one
language, they are compatible with other languages that target .NET. All
you have to do is create you're own type with an operator and all of the
sudden, you're not compatible with other languages that target .NET. I can
understand that VB.NET doesn't support operator overloading in its syntax,
but if I overload in MC++ or in C#, I would expect any other language to be
able to use that object, regardless whether it supports a syntax for
overloading its own operator. Good thing this project isn't designed to be
compatible with VB.NET in the first place, or I would have to make an object
out of this and do everything by means of methods, which is not very
..NETish.

So it seems only the intrinsic, int, long, bool, etc. are supported by
VB.NET in terms of using operators on them, and all non-MS objects are not
supported by VB?
Thanks,
Shawn

"Juan Gabriel Del Cid" <jd*****@atrevido.nospam.net> wrote in message
news:e4*************@TK2MSFTNGP10.phx.gbl...
There is no operator overloading in VB.

-JG

Nov 15 '05 #4
"Shawn B." <le****@html.com> wrote in
news:#z**************@TK2MSFTNGP12.phx.gbl:
One of the biggest marketing pushes for .NET is that if you
write in one language, they are compatible with other languages
that target .NET. All you have to do is create you're own type
with an operator and all of the sudden, you're not compatible
with other languages that target .NET. I can understand that
VB.NET doesn't support operator overloading in its syntax, but
if I overload in MC++ or in C#, I would expect any other
language to be able to use that object, regardless whether it
supports a syntax for overloading its own operator. Good thing
this project isn't designed to be compatible with VB.NET in the
first place, or I would have to make an object out of this and
do everything by means of methods, which is not very .NETish.

So it seems only the intrinsic, int, long, bool, etc. are
supported by VB.NET in terms of using operators on them, and all
non-MS objects are not supported by VB?


Shawn,

Objects written in different .Net languages are compatible if they
follow the Common Language Specification (CLS) guidelines:

http://msdn.microsoft.com/library/en-
us/cpguide/html/cpconcommonlanguagespecification.asp

or

http://tinyurl.com/qiyg
Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 15 '05 #5
> Good thing this project isn't designed to be
compatible with VB.NET in the first place, or I would have to make an object out of this and do everything by means of methods, which is not very
.NETish.


I think you have a misconception about software development... you don't
write an application in all the available languages that exist. You *use*
all the languages you have available.

In .Net you can write in any language you want and have it all be
compatible. For example, I once had a project where I needed to talk to
Excel, MQ Series and be a windows service. So, I used VB for the Excel
interop, managed C++ for the MQ Series bit and wrote the rest in C# (because
I love C#).

I hope that clears it up for you,
-JG
Nov 15 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6076
by: Marcus | last post by:
I am having some problems with trying to perform calculations on time fields. Say I have a start time and an end time, 1:00:00 and 2:30:00 (on a 24 hour scale, not 12). I want to find the...
4
5424
by: Rune Johansen | last post by:
Hi. I'm doing some image manipulation in an applet using the example code on this page: http://www.akop.org/art/pixels3.htm However, I really want an application rather than an applet, I just...
3
1854
by: Sam | last post by:
Hello, in my coding work I'm going to using a lot of matix manipulation, just basic matrix addition, multiplication, Gaussian method solving for roots, least square... But I don't know if there's...
9
2578
by: I. Kobrinsky | last post by:
I'm new here. I started a personal password-program, a trial that includes username, logincounter and password. So my intention is to hide pwd while tipping. So I'm thinking about two popular...
9
2129
by: Job | last post by:
Hi, I would like to find out what ASP/ASP.net can do with image manipulation. Does ASP have built in functions (eg. after upload to server) to manipulate images, like rotate, scale, crop etc.?...
4
3470
by: WaterWalk | last post by:
Hello, I'm currently learning string manipulation. I'm curious about what is the favored way for string manipulation in C, expecially when strings contain non-ASCII characters. For example, if...
8
1975
by: shotokan99 | last post by:
i have this situation. i have a query string: http://www.myquerystring.com?x=xxxxx what this url does is it will return or start downloading a .png file. what i wanted to do is trap this png...
0
2565
by: L'eau Prosper Research | last post by:
Press Release: L'eau Prosper Research (Website: http://www.leauprosper.com) releases new TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set. L'eau Prosper Market...
0
2335
by: L'eau Prosper Research | last post by:
NEW TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set By L'eau Prosper Research Press Release: L'eau Prosper Research (Website: http://www.leauprosper.com) releases...
0
7084
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5013
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.