VS 2008 Bitwise Operation (Reversing Bits)?
Feb 16, 2011
I have written a simple VB.net application which saves information to an RFID tag. I am now trying to compress my data. The solution I have come up with involves bitwire operation.Basically I store 2 numbers per 1 byte (0-9, 10 being a period, 12 possibly being a negative/positive flag,13,14,15 unused as of yet).The code I am using basically shifts the byte containing a number left, 4 spaces, then 'OR's it against another number.Therefore 12 is now represented as 00010010. The problem i'm having is decompressing. Obviously getting the '1' back is easy, as I just shift right 4, then grab it. I need to append or remove the last 4 bits.My solution after many headaches was to reverse the bit order, shift left 4, then reverse, then tostring it.
View 17 Replies
ADVERTISEMENT
Oct 28, 2010
I want to perform a bitwise-AND operation in VB.NET, taking a Short (16-bit) variable and ANDing it with '0000000011111111' (thereby retaining only the least-significant byte / 8 least-significant bits).
View 3 Replies
Mar 1, 2010
This work nicely
Public Const test As ULong = 1 << 30
This doesn't work nicely
Public Const test As ULong = 1 << 31
[code].....
View 2 Replies
Mar 14, 2011
I am a visual basic developer, I have windows 7 64 bits and Visual Studio 64 bits installed.CAN I DESIGN APPLICATIONS WITH THESE SETTINGS THAT CAN BE COMPATIBLE with 32 bits operating system(example in windows Xp 32 bits)?
View 2 Replies
May 9, 2010
An application created with Visual Basic in Win7 64 bits will it still work fine in both WinXP 32 bits and Win7 32 bits ?
View 6 Replies
Jul 27, 2010
dim str as string = "Today is Wednesday"i want to reverse the string in this order:
View 16 Replies
Apr 8, 2011
I'm trying to figure out how to calculate the lower 7 bits and 7-13 bits of two hex numbers.
Here is some example c code, just need this in vb.net:
serialBytes[2] = 0x64 & 0x7F; // Second byte holds the lower 7 bits of target.
serialBytes[3] = (0x64 >> 7) & 0x7F; // Third data byte holds the bits 7-13 of target
The 0x7F is a constant so the only number that changes based off input is the 0x64.
View 2 Replies
Mar 28, 2012
how can I use SQLConfigDataSource to add DSN to the 32 bits ODBC on Windows 7 64 bits? I know it use C:WindowsSysWow64odbcad32.exe and on registry, HKLMSoftwareWow6432Node but the API do not allow me to configure it?how can I do ?
View 1 Replies
Jul 3, 2010
m_ArchiveBoolean, m_HiddenBoolean, m_ReadOnlyBoolean, m_IndexedBoolean, m_CompressedBoolean are all form level booleans that's set from their appropriate Checkboxes on the form before this code runs in a BackgroundWorker.
Why is it that this code works:
Try
Dim fi As New FileInfo(element)
[code].....
View 9 Replies
Apr 9, 2010
Here's what I have that Doesn't work (I have one button, one OpenFileDialog, and a label named Status):
Public Sub ProcessBytes(ByVal Bytes() As Byte)
Status.Text = "Status: Processing . . ."
Try
[code].....
View 3 Replies
May 3, 2011
I have been working on a project to read some data of facebook user walls. So I have researched I need to use json and System.Web.Script.Serialization to extract the required data I suppose. Has anyone have a tidy example of how to get something out of json script?
View 2 Replies
Sep 22, 2010
This seems like it would be so simple and fast, but I cannot figure out how to accomplish it in VB since there aren't many bit functions. I want to take a file and append 5 junk bits at the beginning and 3 junk bits at the end. In essence, just add 1 byte to the file, but in the process offset all the current bits so the file is no longer readable.
I just need a very simple encryption/decryption, but it needs to be very fast as well. I try XORing the bytes, but it gets slow with just a 1MB file. Some of the files are going to be close to 10MB.
View 3 Replies
Jul 8, 2010
I have detected a problem running my application under Vista 64 bits OS.
My application is developed using VB.NT 2008 and compiled as x86
I have a main form. In this form there is an option to open other form. TThis second form must return a few values to the main form. When the user click on this 2nd form, to return values, this form hangs up (2nd form hangs up)
But for what I could have known, it continues executing the rest of code that exists after to open form. I want to say that the form dialog (2nd form) is not closed (hangs up) but it the code continues being executed, because I have seen that inserts the data in the database.
The application not returns any error and any exception.
frmWaiting (form displayed when call thread)
This forms contains progressbar
main form
Dim ThreadVentas As System.Threading.Thread
[Code].....
View 4 Replies
Apr 1, 2010
I was wondering how it is possible to reverse a TreeNodeCollection. Since it doesn't have an inline reverse function, I've tried several other methods to no avail: everything from copying the nodes into an array (which has a built-in reverse function), reversing it, and then copying it back into the TreeNodeCollection to using a custom reversing algorithm. Nothing has succeeded.
[Code]...
Any ideas as to why, or how, additional nodes are being added? It doesn't make sense to me as to why that would happen. All I'm doing is changing the values of nodes that already currently exist.Edit: In addition to this method, another possible way to approach it would be to sort the treeview in reverse order in the first place (I think by using an ICollection, or possibly IComparer?), but I've no idea how to accomplish this. I'm not even sure where to start regarding using an ICollection to sort the nodes in a custom fashion.
View 6 Replies
Dec 30, 2010
result = SendMessage(buttonhandle, BM_GETSTATE, 0, 0)
buttonChecked = (result = BST_CHECKED)
Now I want to know whether the bit for BST_CHECKED is turned on or not.
How would I do that?
I can do
buttonChecked = (result % 2 = BST_CHECKED)
Is there a better way?
View 2 Replies
Jul 21, 2011
Original Code (VB.net): curStyle = curStyle And (Not ES_NUMBER)
Changed Code (C#):
curStyle = curStyle & (!ES_NUMBER);
But it is giving me this error: Operator '!' cannot be applied to operand of type 'long'ES_NUMBER is of data type long.I tried changing it to int, string, etc. All doesn't work.
View 4 Replies
Apr 1, 2010
I'm having problems reversing my string. For example if the string is "DOG", i want it to be like "GOD"
Here is my code. what to add?
Dim oldpassword As String
Dim newpassword As String
Const Prompt As String = "Please Enter 5 to 7 digits only"
[CODE]...
View 4 Replies
May 9, 2011
I am attempting to reverse the numbers in the array I have below. I was able to set the numbers from 1 - 10, but now I am unable to get the array to work properly when trying to reverse, I keep getting an error "Value of type 'Integer' cannot be converted to 'System.Array'. [code]
View 3 Replies
Feb 14, 2012
I am attempting to reverse the numbers in the array I have below. I was able to set the numbers from 1 - 10, but now I am unable to get the array to work properly when trying to reverse, I keep getting an error "Value of type 'Integer' cannot be converted to 'System.Array'.
Module Module1im
Sub Main()
Dim array(10) As Integer
[code]......
View 2 Replies
Oct 24, 2007
So for an intro to programming class, we use visual basic, and i have to write a program that reverses the characters in a string. I've written a code that (i think) turns the string into an array, and then used the array.reverse method to reverse the characters.
I feel like my code is correct, but clearly it is not....when i run the program, there are no bugs, but instead of giving me any part of the input string, it returns "System.Char"
I'm a TOTAL beginner, and clearly not very good at this sort of thing, but here's my code for my "reverse" button:
CODE:
I'm open to other methods for reversing strings, but I'd like to stick with this one if at all possible...
View 4 Replies
May 15, 2011
When I run this command in PHP, I get:
[Code]...
The interesting thing is, that when I try to shift any number greater than int32 in .net, it yields bad results.. Every number under int32 (2147483647) yields the same results from php and c#.net or vb.net Is there a workaround for this in .net?
View 2 Replies
Dec 29, 2010
Did anyone else read this article under Visual Basic News? I thought it was a very bad treatment of the subject. I especially don't like articles like that when the code they post relies on Option Strict Off.
View 12 Replies
Aug 9, 2011
According to MSDN The And operator can act as a bitwise operator OR a logical operator.The only way to know if it is used as One operator or another is, If it is on the right side of an assignment operation? for example x = 3 AND 5. I cannot find any other instances where the bitwise operator would be used instead of the logical operator, are there?
View 1 Replies
Sep 13, 2009
How do I bitwise shift right/left in VB.NET? Does it even have operators for this, or do I have to use some utility method?
View 4 Replies
Feb 13, 2011
Text file
a
b
c
d
e
Want to turn them into e,d,c,b,a
What's the most efficient way to do so? stack? Queue? List?
View 4 Replies
Feb 4, 2010
I'm creating this program where the user inputs their name in this one textbox, and they click on the button where it should come up with their name in reverse(Last Name, First Name) in a message box. My message box doesn't work. My code does show I'm using the If statement because I'm trying my make sure the user is inputting letters only and nothing else. But I would fix that later thats not my biggest concerns.
[Code]
View 7 Replies
Jun 29, 2010
Im looking to dynamically populate a Placeholder with data sent from a textbox on the same page, but in reverse order i.e. the latest post goes to the top ratehr than the bottom - kidda like Twitter or Facebook.The code I have so far is below but I keep geeting an error stating that "BC30311: Value of type 'System.Collections.ArrayList' cannot be converted to 'System.Array'." [code]
View 7 Replies
Aug 24, 2009
I have an abstract user control(baseModule) that has a property that I plan on using a bitwise comparison on to determine what export types are supported by that module. In the designer of a module derived from baseModule, I am presented with a combobox with the ability to just select a single value (Html, Xml, etc.) I would like to be presented with a drop-down checked listbox so I could select which values I want.How can I accomplish this inside of VS2008? I've seen other properties support this.
Public Class ExportTypes
Public Enum ExportType
Html = 1
Xml = 2[code]......
View 1 Replies
Jul 19, 2010
I'm re-writing some old application in VB.NET to C# and ASP.NET 3.5. Everything is going OK but I have this problem - and, as the database will not be changed, I must find a solution to it.The old app saves the list o desired days (from Sunday to Saturday) in a byte. This is the way it do it:
If chkDaily.Checked Then
daysBitmask = 127 ' This is for a full week
Else
[code]....
View 1 Replies
Jun 14, 2009
m_ArchiveBoolean, m_HiddenBoolean, m_ReadOnlyBoolean, m_IndexedBoolean, m_CompressedBoolean are all form level booleans that's set from their appropriate Checkboxes on the form before this code runs in a BackgroundWorker.
Why is it that this code works:
Try
Dim fi As New FileInfo(element)
With fi
If m_ArchiveBoolean = False Then
[code]....
In this 2nd one attributes are being changed, but they're the wrong ones and I can't pinpoint it right off hand.
Edit: What the overall goal of this is that if the user has the attribute checkbox checked then the file needs to have it set, other wise the attribute (if it's present) needs to be unset.
View 7 Replies