473,652 Members | 3,059 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 8439
"Shawn B." <le****@html.co m> wrote in message
news:uO******** ******@TK2MSFTN GP10.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*****@atrevi do.nospam.net> wrote in message
news:e4******** *****@TK2MSFTNG P10.phx.gbl...
There is no operator overloading in VB.

-JG

Nov 15 '05 #4
"Shawn B." <le****@html.co m> wrote in
news:#z******** ******@TK2MSFTN GP12.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/cpconcommonlang uagespecificati on.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
6089
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 difference in minutes, divide this result by a predefined size of interval, and make a loop that runs this many times. For example, with an interval size of 15 minutes, it will return 6 blocks... I have this all working fine, but am getting stuck on...
4
5435
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 can't figure out how to do the image loading and manipulation when it's not from inside an applet. Any hints on the subject are appreciated.
3
1863
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 a library which defines matrix and its manipulation. I know there must be one and it's somethere but I just have no experience. Thanks.
9
2586
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 ways to realize, like using cursor manipulation to backup & delete letters or otherwise to use getch to read them quetly. Maybe somebody here knows and will tell me about potentially dis-/advantages of each method. Meaning especially *intern*
9
2139
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.? Or are 3rd party solutions needed to do this? I am a php/codfusion programmer and know nothing about asp, so I'm hoping somebody here can help me out.
4
3480
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 substrings need be replaced, or one character needs be changed, what shall I do? Is it better to convert strings to UCS-32 before manipulation? But on Windows, wchar_t is 16 bits which isn't enough for characters which can't be simply encoded...
8
1999
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 file and manipuate the image like resizing, color...etc. how can i do this?
0
2577
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 Manipulation Profiling Tools Set is a set of advanced tools that help Serious Traders analyze the market direction, market manipulative behavior and predicting the change of trend.
0
2341
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 new TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set. L'eau Prosper Market Manipulation Profiling Tools Set is a set of
0
8367
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8279
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8703
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7302
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5619
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4145
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2703
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.