C# - Arbitrary Precison Floating Types In .net : Finding Library That Allows That?

Oct 21, 2009

I need to do maths on both floats and integers with much bigger accuracies and magnitudes than offered both by int/float/double in .net. I recall there was something like that for c/c++.

View 2 Replies


ADVERTISEMENT

Collection Of Arbitrary Types

Oct 21, 2010

I know there's the old, late-bound, VB6 Collections, but I was looking for something like Generics, but either without having to specify the type at compile time, OR finding a clever way to allow the code to determine the type on its own and then call some generic class.Why? I'm bored, and I thought it'd be fun to try and implement my own library for NBT, or NamedBinaryTag.It's the storage format used in the popular Minecraft game.url...I know there are existing implementations out there, but there's no point in copying those if I'm doing this solely as a learning experience to get a better grasp on file streams, byte arrays, endian conversion, and general .NET stuff (I used to fiddle with VB6/VBA a lot, so .NET is a huge change).

What's hanging me up is TAG_Compound. Per that specification, it's essentially a collection of objects of any other Tag type, including additional, nested TAG_Compounds. You can do some freaky nesting/recursion with this kind of a format.I've got a rough outline in my head of how to do the other classes, but the storage of arbitrary types is just making me draw a blank on how to store that in a stub class (clsTagCompound) So that a generic class (clsNBT(Of T)) can use generic functions to access the payload.List(Of T) looks like it could work if I could feed it a common interface. But since a Generic class will be the main component used, its interface is also generic, and that just leads to nasty generics chain (List(Of (clsNBT(Of XXX))).[code]What I'm thinking of doing, is making all derived classes implement INbt(Of T).For clsTagCompound, its SetPayload method will start walking a bytestream after the compound's name field is parsed. For each new TagType that it encounters, it would theoretically call DirectCast on a temp variable Dim'ed to INbt(Of T) to convert it to the class defining that particular TagType.But this doesn't seem to work as planned. I believe my Catch 22 is that to even use clsTagCompound, I still have to define T, and that's where I get stuck again. I somehow need to create an interface that is NOT generic, yet can be applied to all the classes for the various Tag types and still call their GetPayload function to return the payload specific to a particular tag.

View 4 Replies

Library To Play Different Media Types

Jan 26, 2012

I made a program that plays several streams, and radio stations from its online sources. Some streams WMP can play, and some only quicktime can play. Currently, I am using the dll libraries for wmp and quicktime and compiling them with my program. it works but it's very laggy and it causes problems in other computers.So, my question, Do you guys know a library to play most media types? so I would have only one dll file.

View 2 Replies

C# - Finding A Free SQL Formatting Library For .NET?

Jul 26, 2010

I've been looking for a free library/source code to format SQL queries, preferably in .NET, for quite a while. Even after searching some of the responses here on SO, I'm almost at the point where I'm willing to believe that nothing like this exists. The closest thing I've found, a project called sqlformat, does not seem to be active, nor does it really even support a workable subset of SQLs features for formatting.Are there any free or open source SQL formatting libraries out there? I don't want a canned product, as I need to integrate this functionality into a tool I'm building. Web services aren't acceptable either, since the ones I have found like T-SQL Tidy haven't proven to be very reliable.

View 3 Replies

Finding Equality In Items In Two Lists Of Differing Types?

Jun 9, 2009

I have two objects that are derived from same the base class. ets say ObjA is the base class, and ClassB and ClassC inherits ObjA. f I have a dim lst1 as List(Of ClassB) im list2 as List(Of ClassA)nd and I want to check for the existence of something being in lst1 that it is in list2, now I am only interested in comparing against one key bit of information that it is declared in the base class and is a string. How can I iterate through the lst1 comparing against list2? I thought I could I overload/override the Equals method but I am having no joy for either of the classes and say some thing similar to

Public Overloads Overrides Function Equals(ByVal obj As Object) As Boolean
Dim temp As ClassA = TryCast(obj, ClassA)
If temp.Id = Me.Id Then

[code].....

View 1 Replies

Finding Any Free Msdn Library 2005?

Feb 9, 2010

is there any free msdn library 2005?

View 5 Replies

VS 2010 Adding Sound To A 3D Game / Finding A Sound Library?

Aug 24, 2011

I'm ready to start adding sound to a 3D game and I'm looking for a decent Free library.it would not require DX and be something like:

dim MySound as SoundLib.Sound
MySound = SoundLib.LoadSound("soundfile.wav")

SoundLib.Play3DWorld(Location.X, Location.Y, Location.Z, VolumeModifier, MySound)so far all Im finding is expensive, C#, old, or not .NET compatible.

View 9 Replies

C# - Finding Any Console "graphics" Library For .Net?

Oct 21, 2010

My basic goal here is writing a .NET remake of Kingdom of Kroz. For those not familiar with the game:

[URL]

Originally it was supposed to be a quick distraction project to give me a break from all the generic enterprise WCF/WF/LINQ2SQL/etc work projects occupying most of my time lately. While the result of my effort is playable, it looks like absolute arse (even for a console-based game) because of the way I'm redrawing everything in each frame.

I'm aware of some alternate approaches but in the brief tests I've done they still don't offer significant performance or aesthetic benefits. I almost can't believe I'm asking this, but... does anyone know of a fast and efficient "console graphics" library for VB.Net / C#?

Edit: failing the availability of a "library" as such, perhaps there's a reference for fast console drawing/update techniques?

View 2 Replies

Declare With An Arbitrary Number Of Parameters?

Jan 19, 2009

Is it possible to have a class, sub or function declared with an arbitrary number of parameters? And those parameters be a type, like generics? For example

vb.net
Public Class Test (Of T1, (Of T2))'The (Of T2) means that after the first parameter can be an arbitrary number of parameters

[Code]....

View 9 Replies

Set Listview Items In Arbitrary Order?

Aug 27, 2010

You can set listview items in a-z order and z-a order but how to set listview items in arbitrary order?

View 4 Replies

Adding Arbitrary Labels And TextBoxes At Run Time?

Sep 28, 2011

The three labels "Floor" "Typ." "HeadsI can insert once fine but multiple times only the third instance is written to the form.I have 2 textboxes to test that the Label.Name is changed but I can't make the Label.text stand for each label. I am certain this will occur too with the textboxes.I also need to keep track of these boxes for further use with the program.

Public Class Form1
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged

[code]....

View 1 Replies

Asp.net - Select A Variable TimeSpan With An Arbitrary End Point

Apr 29, 2009

I've been working on a Stored Procedure that checks the time, then retrieves records going back over the last full 24 hour period between 8am and the previous 8am. So, for instance, assume that it's currently 10am. The stored procedure looks at the current time, notes that it is past 8am, and sets the query to run backwards 24 hours, from 8am today to 8a yesterday. If it were, say, 7am, the query would be set to check from 8am yesterday to 8am the day before. This was actually relatively simple to do. The SP is meant to be used to retrieve records for a report tracking jobs completed in the given time span.

However, they've come back at me and asked me to change the stored procedure such that the hour the report ends at, and the span of time checked, is configurable from the front-end of the site. I have this working for TimeSpans greater or equal to 24 hours, but am having trouble with spans under that. Here's what I have so far for my logic in the Stored Procedure -

-- Retrieves data on jobs that completed/completed with errors during a given time span.
DECLARE @Hour NVARCHAR(2)
DECLARE @TimeFrame NVARCHAR(2)

[Code].....

View 2 Replies

C# - Order List By Arbitrary Sort Expression?

Mar 2, 2011

I have a generic list, like this:
System.Collections.Generic.List<Question> myquestions = new System.Collections.Generic.List<Question>();

And I have a paging example, using a LINQ table acquried from database, doing this for paging:
var questions = context.Questions
.OrderBy(sidx + " " + sord)
.Skip(pageIndex * pageSize)
.Take(pageSize);

Right now, for paging my populated from code list, I have:
var questionss = myquestions
.OrderBy(x => x.Id)
.Skip(pageIndex * pageSize)
.Take(pageSize);

And what I want is being able to order "myquestions" by a string as in the above example. Is that possible?

View 5 Replies

Accessing Elements In A Multidimensional Array Of Arbitrary Dimensions?

Jul 3, 2010

I'm trying to write some of my own linear algebra methods, and I'd like them to work independent of the number of dimensions of the array. However, there doesn't seem to be any generic method, that I can see, for looking up a particular element in an array of arbitrary size. I mean I could write code to find the rank and then use (), (,), (,,), (,,,), etc, but that seems rather cumbersome.

View 4 Replies

Adding Arbitrary Number Of Controls In Loop At Runtime

Jul 12, 2009

How do you add an arbitrary number of controls to a form at run time? With indexed controls I could define the 'seed' control at design time and reference 'clones' of the 'seed' control at run time via the index. Now I must declare each additional instance of the control at run time then set each individual property that differs from the default for that control for each instance. Then I must add the newly declared control to the appropriate container controls collection. I'd like to do this in a loop but how can I get away from using a fixed control name in the declaration:

Dim controlname As New Control

I can't use a string that I can manipulate the contents of for controlname because it sees it as a double declaration. I can't use an array such as Control(index) for controlname. Dim Control(maxindex) As New Control doesn't work. Dim Control(maxindex) As Control works but any assignment based on this such as Control(indexvalue).Name = "ControlName" fails. It didn't address the issue of handling the declaration of new controls in a loop with some kind of variable name for the control.

View 1 Replies

C# :: Determining Object Equivalence For Value Types, Reference Types And ILists?

Nov 1, 2009

I have a class with a Property called 'Value' which is of type Object.Value can be of any type, a structure, a class, an array, IList etc.My problem is with the setter and determining whether the value has changed or not.This is simple enough for value types, but reference types and lists present a problem.For a class, would you assume that the Equals method has been implemented correctly, or just assume that the value has changed every time the setter is called?If I did assume it's changed, then perhaps I should assume it for value types as well, so that the behaviour is consistent.

View 2 Replies

Add A New Floating Rectangle With An Image?

Mar 16, 2012

i want to add a new floating rectangle with an image inside it to my form when i click on a button control and then use a timer control to move it in a straight line across the Form. the problems I'm having are:

1) Drawing and filling the RectangleF on the screen.

2) Animating/moving it from X1,Y1 to X2,Y2

3) Triggering the Drawing and movement with a Button Control

View 6 Replies

Getting The Floating Function Keys?

Jan 10, 2010

I use IrfanView for screen capture.After activating it (making it ready) it is necessary to use Ctrl & F11 to invoke the actual screen capture selector.how I may achieve a "Floating Key" which would act in the same way as the Ctrl & F11 combination?

View 4 Replies

Forms :: Make A Floating Toolbar

Jan 7, 2010

How can I make a floating toolbar (like the font toolbar that appears when highlighting text in Word 2007)?

I would like it to appear at a given point when mouse is clicked.

View 2 Replies

Make Floating Mini Toolbar?

Jan 7, 2010

How can I make a floating toolbar (like the font toolbar that appears when highlighting text in Word 2007)?

I would like it to appear at a given point when mouse is clicked.

View 9 Replies

Read 6 Bytes Floating From A File

Mar 5, 2011

I have an old fashion Database with several random access files and I need to import the data to a new Sql Server dababase the data. There are tables with 6 Bytes floating numbers fields and we have no Number data type with that length in VB. I tried and tried and... and can't find. I found this code in the ERP folder, is AlphaBasic. It use an envoirement namend A-shell from Microsabio .

[Code]...

View 1 Replies

C# - Understanding Floating Point Limitations In Calculations

Jan 12, 2011

How to determine when floating point limitations will cause errors in your calculations. For example the following code.
CalculateTotalTax = function (TaxRate, TaxFreePrice) {
return ((parseFloat(TaxFreePrice) / 100) * parseFloat(TaxRate)).toFixed(4);
};

I have been unable to input any two values that have caused for me an incorrect result for this method. If I remove the toFixed(4) I can infact see where the calculations start to lose accuracy (somewhere around the 6th decimal place). Having said that though, my understanding of floats is that even small numbers can sometimes fail to be represented or have I misunderstood and can 4 decimal places (for example) always be represented accurately.

MSDN explains floats as such... This means they cannot hold an exact representation of any quantity that is not a binary fraction (of the form k / (2 ^ n) where k and n are integers). Now I assume this applies to all floats (inlcuding those used in javascript). How can one determine if any specific method will be vulnerable to errors in floating point operations, at what precision will those errors materialize and what inputs will be required to produce those errors?

View 5 Replies

Implementing Floating Toolbar In Desktop Form?

Mar 30, 2009

How to implement a floating toolbar in the desktop form that can be placed anywhere in the form and also tell me if this can be called by other form other than actual form implementing it to display to the user for some common purpose.

View 5 Replies

VS 2010 Floating Splash Screen Image?

Jan 31, 2011

I have an image on a transparent background. This is my "splash screen" for my project. I want it to basically show up in the middle of the screen for 5 seconds and then load my frmMain Form.

Here's the image: (removed)

I can't seem to get the gray form's background off it.

View 7 Replies

VB2010 Class Library: Create A Static Library Instead Of DLL?

Jun 21, 2011

I have a Visual Basic Class Library project. It generates a DLL. Is there a method to generate a static .LIB to which I can do a static link?Alternatively, can I do a static link against a DLL?

View 6 Replies

Floating Point - Displaying A Decimal With A Given Maximum Length?

Apr 28, 2010

I am writing a custom totaling method for a grid view. I am totaling fairly large numbers so I'd like to use a decimal to get the total. The problem is I need to control the maximum length of the total number. To solve this problem I started using float but it doesn't seem to support large enough numbers, I get this in the totals column(1.551538E+07). So is there some formating string I can use in .ToString() to guarentee that I never get more then X characters in the total field? Keep in mind I'm totaling integers and decimals.

View 2 Replies

.net - Floating Point Result Discrepancy Between Two Seemingly Identical Statements

Sep 14, 2011

I've got the following Visual Basic code:

Dim L16, L23, L45, t As Double
Dim LBase, LAdjacent, LOpposite As Double
L16 = 20

[Code].....

Both equations should be equivalent: I've simply replaced L16 with LBase, L23 with LAdjacent and L45 with LOpposite. Yet the first equation outputs 3586 while the second outputs 3587.

View 1 Replies

Regular Expression (RegEx) To Replace Floating-point Numbers In XML?

Aug 22, 2011

I'm using Visual Basic 2010 Express to edit an XML file. I want to replace items that have (typically) non-zero floating point numbers with a single zero.

View 4 Replies

VS 2008 Floating Toolbar - Display That Container (containing Toolstrip) In Form

Mar 30, 2009

I've two forms Form1 and Form2, I want to add container(*) in form2 having toolstrip(Toolbar) and later want to display that container(containing toolstrip) in Form1, that enable the user to use toolstrip to execute needed actions written in form2.

[Code]...

View 1 Replies

Convert Single Precision Floating Point Numbers To IEEE 754 Hex And Back?

Aug 12, 2009

Private Function SingleToIEEE754Hex(ByVal pValue As Single) As String

[Code]...

View 1 Replies







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