C# - Isn't .NET's Integer Just Simply Based On Two's Complement System

May 18, 2012

MSDN: Int32 values are represented in 31 bits, with the thirty-second bit used as a sign bit. Positive values are represented by using sign-and-magnitude representation. Negative values are in two's complement representation. Isn't it true that the representation of positive values using sign-and-magnitude system is identical to the representation of positive values using two's complement system? So shouldn't it have been rewritten as: "Int32 values (regardless of positive or negative) are represented in two's complement representation",

View 1 Replies


ADVERTISEMENT

Implementing Two's Complement On Unsigned Integer Types?

Jun 24, 2011

How can I implement a two's complement in VB.NET using unsigned integer types such as Byte, UShort, UInteger and ULong? Can I cast a UInteger to an Integer?

View 1 Replies

Value Of Type 'System.Linq.IQueryable(Of Integer)' Cannot Be Converted To Integer?

Aug 11, 2011

I am new to EF Linq and I have been struggling with this query for a few days. From reading this forum, I have managed to get this far:

Dim noPic = (From f In myEntities.FriendLists
Where (f.UserID = Profile.ID)
Select f.FriendID).Except(From g In myEntities.GuestLists
Where g.EventID = _id
Select g.FriendID)

[Code]...

I am trying to get everybody from the FriendList who is not already on the GuestList to display in a Repeater control. After reading the forum I was able to append .First() to noPic at the myNoPic declaration and finally get a result but that only gave me the first element. Does anybody have any advice on how to accomplish this?

View 2 Replies

Asp.net - .Net Iniatialising A Class Using System.Reflection And System.Type To Create A Session Based Singlton Extension Method

Jun 11, 2009

I have had several occasions recently to access a specific class several times over a relatively small time frame.So I've been storing the value of the class in Session and trying to access it on page load, if it's not available creating a new instance and storing that in session.

So instead of constantly replicating the same code for different classes on different pages I'm trying to create an extension method to do this for me.

[Code]...

I'm stuck on what to do when I make my new instance of my class (it would have to have a New() sub)

I'm not sure where to go from here... or even if this is the best way to do it.

View 2 Replies

Change A Button Based On An Integer?

Feb 21, 2010

I have a form with a large number of buttons on it, each named btn1 through btn25. I have another button that is generating a random number and saving it to an integer variable intDrawn.

I'd like to know if there's a simple way to alter a particular button based on the result in intDrawn; if intDrawn = 5, then I want to change the font in btn5, for example.

Is there a way to alter a control programmatically like this? I'm using Visual Basic Express 2008.

View 4 Replies

Complement Hex String To Double Conversion

May 27, 2010

Here's my code, it works but its not elegant --- can this be improved? The final multiplication is done for the Analog to Digital conversion (weight of the LSB).
Public
Class Form1
Private
Sub Button1_Click(ByVal
sender As System.Object,
[Code] ......

View 7 Replies

C# :: Determine The Relative Complement Of Two IEnumerable<T> Sets In .NET?

Jun 2, 2010

Is there an easy way to get the relative complement of two sets? Perhaps using LINQ?I have to find the relative compliment of a set A relative to B. Both A and B are of type HashSet<T> but I think the algorithm could be made more general (IEnumerable<T> or even ISet<T>)?

View 1 Replies

Convert An Integer Into A Boolean Array Based On It's Binary Bits

Jul 14, 2009

I am looking to convert an integer into a boolean array where each item in the array corresponds to a bit in the binary representation of the integer.

MyInteger = 3 '011 in binary
to
MyArray(2) = False
MyArray(1) = True
MyArray(0) = True

Also is there anyway to assign a value to an Integer in binary or hex (like MyInteger = 1010b or MyInteger = A7h)?

View 20 Replies

Control The Tool Tip Popup Or Make Calls To The Text That Displays Based On A Integer Value?

May 12, 2012

how I can control the tool tip popup or make calls to the text that displays based on a integer value. I'm wanting it to display a text based on a interger value inside an if statment for a picture box. So if the ingteger = 1 then tooltip.text = "" else tooltip.text = "" but that is not the correct syntax.

View 2 Replies

.NET: Value Of Type 'Integer' Cannot Be Converted To 'System.Array'

Nov 11, 2011

In the below code I am getting the following error on line If (Not hash.Add(Numbers(Num))) Then Value of Type 'Integer' cannot be converted to 'System.Array'.

Module Module1
Sub Main()
Dim array() As Integer = {5, 10, 12, 8, 8, 14}
' Pass array as argument.

[code].....

View 4 Replies

Integer Cannot Be Converted To 'System.Data.DataSet'

Mar 19, 2011

I am trying to insert a small message of 150 characters into the "AdvertisingInfo" database into the "QuickPost" column. Right now there is only one row that will have various columns updated by several forms.I just started to teach myself VB10 and it has taken me 6 hours to get this far. I'm tired of trying today and am going to bed, but I need help trying to figure this out. I keep getting the error: Value of type 'Integer' cannot be converted to 'System.Data.DataSet'.[code]

View 3 Replies

Value Of Type Integer Cannot Be Convert To System.intptr

Aug 10, 2010

I'm trying to get the window of a game (jedi academy) I keep getting this error Cannot convert type 'integer' to system.intrptr This is were its underlined in blue DirectCast(Me.hWndGame, IntPtr),

Imports Microsoft.VisualBasic.CompilerServices
Imports System
Imports System.Runtime.InteropServices

[code]....

View 2 Replies

Set The System Date Of A Workstation Based On The System Date Of The Server?

Dec 13, 2009

i want to set the system date of my a client pc based on the system date where the sql server reside.In short i want to sysncronize the date between the client and server.I have a working code in vb6 but i dont know how to do it in vb 2008.

dim RstDate As ADODB.Recordset
Set RstDate = New ADODB.Recordset
RstDate.Open "SELECT GETDATE() as ServerDate ", CnAP

[code]....

View 5 Replies

Value Of Type 'Integer' Cannot Be Converted To 'System.Drawing.Color'?

Oct 31, 2010

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.BackColor = RGB(Rnd() * 255, Rnd() * 255, Rnd() * 255)
End Sub

then i see this error:Value of type 'Integer' cannot be converted to 'System.Drawing.Color'

View 8 Replies

Value Of Type System Drawing Image Cannot Be Converted To Integer

Nov 26, 2010

When I try and compile code in vb.net 2008 I get an error that says "value of type 'system.drawing.image' cannot be converted to integer. The error happens at piccolor.image
GetDIBits(Form1.PictureBox1.Handle,
picColor.Image , _
0, Form1.PictureBox1.Height, pixels(1, 1, 1), _
bitmap_info, DIB_RGB_COLORS)

Here's the code that explains what piccolor.image is, it's a picturebox on form1 that has an image
readpic(Form1.PictureBox1)
Public Function readpic(ByVal picColor As PictureBox)
GetDIBits(Form1.PictureBox1.Handle,
picColor.Image , _
0, Form1.PictureBox1.Height, pixels(1, 1, 1), _
[Code] .....

And Imports System.Runtime.InteropServices is on the top of the module, if u need more code then let me know. Also I wonder if there is a way to bitblt directly to a pixel array.

View 17 Replies

.NET And MYSQL Based Registration System?

Jun 21, 2010

I have linked my vb.net application with mysql database but i am having a problem inserting data from the vb forms into the relevant fields in the database...

View 1 Replies

Way Of Implementing A Plug-in Based System

Feb 18, 2011

I've written a pretty good browser in vb.net (it's in the "Share your Project" forum). I now want to give users and other developers the ability to extend/add buttons & functions to it. Can anyone suggest to me a good way of implementing this bearing in mind that I've never tried to do anything like this before? (so basically a way of implementing a plug-in based system. I was planning on these being small snippets of code which my application has the ability to compile.)

View 5 Replies

C# - .net Type Mismatch Looking Up A Constructor By Reflection (Integer() Vs System.Int32[])?

Jan 29, 2010

I'm passing a type name and some parameters from C# code into a navigation framework written in VB. The navigation framework looks for a constructor on the type that matches the parameters passed in using Type.GetConstructor(Types()). The constructor that I'm looking for expects an array of integers Integer() in vb. But it gets an array of System.Int32. I've gone so far as to try this:

[Code]...

And the VB code still sees System.Int32 on the other end, which means that it doesn't find the constructor.

View 2 Replies

Asp.net - Datarating System Based On Gridview Data?

May 19, 2011

What I want to do is basically have a column that ranks the users so if there were 10 people it would rank the person with the highest sales 10 and the second highest 9 and so on. Theres not always going to be 10 employees

I am using a stored procedure along with a sqldatasource to connect to my stored procedure. To get all the data for each agent, then I am using functions like

Dim TotalSales As Decimal = 0.0
Function GetTotalSales(ByVal Price As Decimal) As Decimal
TotalSales += Price

[Code]....

and then some how sort the array list and print the index of the agents sales total?

View 1 Replies

Convert A VB6 Program Based Off Of The Coordinate System?

Aug 5, 2009

I am trying to convert a vb6 program based off of the coordinate system. VB.net does not seem to recognize any of it.

View 2 Replies

Execution Based On System Idle Status

Oct 13, 2011

I am in the process of developing an application for one of my clients. I am not going into the details of the applications, but brief facts of the same. The application is divided into two tiers (actually three, but the third tier is the database (SQL SERVER) so that is not included). The top tier (or first tier) is a web application (ASP.NET) where the users shall log into the system and use the application. This web application will also access the Database directly. One important activity the users shall do is uploading excel files with various information to the server. Web Application once the upload is successful shall enter the details in the in Database about the upload along with an ID and save the excel file at a location in the server.The Second tier is a VB.NET Application which will run in the server. The application will connect the database and retrieve the list of excel file uploaded by the web application and start processing one excel file after another based on ID. The processing that will be done is very simple: read the excel file, check for certain parameters, do some calculations and insert the whole details into the database. (say some 100 records per excel file)

The server in which the VB.NET Application (Second tier) runs is hosting a serious of services and application which shall run simultaneously including the Database (SQLSERVER), web server. The Database also host tables and database for various other applications. In order to help in the smooth functioning of the system, it has been decided that the VB.NET shall do the processing activity only when the server is idle (including CPU usage is idle). I have searched the Net and found API to get the system Idle status. But the real question is how to pause the processing activity when the system switch from idle mode and continue when it is again back to idle mode. Please note that I am talking about system being idle because no other application is executing any activity except the VB.NET Application.

View 1 Replies

Generate A Specific Key Based On Certain Details About The System?

Apr 7, 2010

I have asked questions about this before but my program has came to cross roads where I require more flexibility in my security procedures.At the moment I generate a specific key based on certain details about the system, and I hash this data to file, which ensures it will only run on this system.

However it has now got to the point where I have a need for providing keys which will carry settings for the program within the key. So that if a customer wants an update its the matter of sending an updated key, which will allow certain areas of the program to be unlocked/locked.Obviously I can no longer use the hash, as it can't be decrypted. I am looking to use key encryption system, which will allow to encrypt data within a license key. But obviously it brings the problem of where to store Crypt & decrypt key within the program.

[Code]...

View 1 Replies

Restict The Input Of A User Based On What The System Needs?

Oct 6, 2011

how to restict the input of a user if im going to accept account e.g.,

View 7 Replies

Control A Video From Textbox Value In VB Based Scada System?

May 7, 2012

I have created a Scada System in Visual Basic 2010 In this system , its display the radial Gate position of hydro power plant. i have the analog value of particular signal in a textbox which use for gate position. how can i make the radial Gate animation in this VB based scada system. Or i have a gate opening and closing video of gate. Is it possible to control the video from textbox values so that i can show the gate position at the particular analog value..

View 1 Replies

Create A System That Will Trigger Alert Based On Few Condition?

Sep 20, 2010

i want to create a system that will trigger alert based on few condition, my condition is:the alert will trigger if there is a negative value for 2 consecutive years.

example:

1)negative amount for 2005
2)negative amount for 2006

here is the code that i have for now and the result only can trigger alert for one year only..

[Code]...

View 6 Replies

Developing An Winforms Based Event Tracking System Using .Net?

Sep 24, 2009

I'm looking for some advice for an application I currently developing. I'll try to keep this as brief as possible so if additional info is need just let me know.I'm developing an Winforms based event tracking system using VB.Net (VS 2008 Pro). The application collects data via serial bar code scanners and stores this data within a MS SQL Express db located on the same Windows XP Pro workstation that the application is installed on. When the application receives the formatted string of data it checks the db table and sends a reply back to the device indicating whether the data is a duplicate. I have written a PortManager class to handle the serial based devices and this functionality is working well.

I have now been asked to incorporate a new type of collection device into the system. The new device is running embedded Linux and uses TCPIP (POE) rather than serial communication. The device manufacture has assured me he can provide a string from the devices integrated scanner in the same format as my serial based devices.

If possible, I would like to utilize the current application and just add the ability to use the TCPIP devices to it. I was thinking it might be possible to just add a new class (similar to my Port Manager class) to handle the TCPIP based devices.I'm really at a loss as to the best way to approach this. I'm just not that familiar with collecting data from a Winforms application using a TCPIP based device.

View 3 Replies

Game Programming :: Coordinate Based 2D Map And Waypoint System

Dec 16, 2010

I am reading the memory from a game and I have managed to find the x,y,z values of the player (z is irrelevant). Now I am trying to make some sort of a waypoint system and I thought it would be best to make a small coordinate based map that will act as a birds-eye view of whats going on ingame. But I don't know where to begin creating this thing, since it needs tons of xyz values.Just throwing this in here since I've already made the thread:I also want a small circle to represent the player that will turn, facing waypoint 1 and move in a straight line towards it.

View 1 Replies

VS 2010 Option Strict On Disallows Implicit Conversions From 'Integer' To 'System.IntPtr

May 20, 2011

[Code]...

How do I convert this proper? (Option Strict On)

View 3 Replies

Asp.net - Hiding LinkButton - Disable Functionality Based On Whom Is Logged Into The System

Apr 27, 2012

In VB.NET, I have a LinkButton that, when clicked, creates a report. We want to disable this functionality based on whom is logged into the system. I have a session variable to indicate whether this should be visible or not but when I set idLinkButton.visible = False, it has no effect. Any ideas on what I need to do to be able to turn this on and off?

CODE:

View 1 Replies

.NET Window Based Project Built On .NET 3.5 Framework Is Not Working In Windows7 64 Bit System?

Jan 28, 2011

I have VB.NET Window based project built on .NET 3.5 Framework that is working on the Windows7 32 bit System but when I try to run this same application in Windows7 64 bit System it gives an error message: "System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved