Search Results

Search found 1421 results on 57 pages for 'arbitrary'.

Page 11/57 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Trouble with SAT style vector projection in C#/XNA

    - by ssb
    Simply put I'm having a hard time working out how to work with XNA's Vector2 types while maintaining spatial considerations. I'm working with separating axis theorem and trying to project vectors onto an arbitrary axis to check if those projections overlap, but the severe lack of XNA-specific help online combined with pseudo code everywhere that omits key parts of the algorithm, googling has left me little help. I'm aware of HOW to project a vector, but the way that I know of doing it involves the two vectors starting from the same point. Particularly here: http://www.metanetsoftware.com/technique/tutorialA.html So let's say I have a simple rectangle, and I store each of its corners in a list of Vector2s. How would I go about projecting that onto an arbitrary axis? The crux of my problem is that taking the dot product of say, a vector2 of (1, 0) and a vector2 of (50, 50) won't get me the dot product I'm looking for.. or will it? Because that (50, 50) won't be the vector of the polygon's vertex but from whatever XNA calculates. It's getting the calculation from the right starting point that's throwing me off. I'm sorry if this is unclear, but my brain is fried from trying to think about this. I need a better understanding of how XNA calculates Vector2s as actual vectors and not just as random points.

    Read the article

  • NET Math Libraries

    - by JoshReuben
    NET Mathematical Libraries   .NET Builder for Matlab The MathWorks Inc. - http://www.mathworks.com/products/netbuilder/ MATLAB Builder NE generates MATLAB based .NET and COM components royalty-free deployment creates the components by encrypting MATLAB functions and generating either a .NET or COM wrapper around them. .NET/Link for Mathematica www.wolfram.com a product that 2-way integrates Mathematica and Microsoft's .NET platform call .NET from Mathematica - use arbitrary .NET types directly from the Mathematica language. use and control the Mathematica kernel from a .NET program. turns Mathematica into a scripting shell to leverage the computational services of Mathematica. write custom front ends for Mathematica or use Mathematica as a computational engine for another program comes with full source code. Leverages MathLink - a Wolfram Research's protocol for sending data and commands back and forth between Mathematica and other programs. .NET/Link abstracts the low-level details of the MathLink C API. Extreme Optimization http://www.extremeoptimization.com/ a collection of general-purpose mathematical and statistical classes built for the.NET framework. It combines a math library, a vector and matrix library, and a statistics library in one package. download the trial of version 4.0 to try it out. Multi-core ready - Full support for Task Parallel Library features including cancellation. Broad base of algorithms covering a wide range of numerical techniques, including: linear algebra (BLAS and LAPACK routines), numerical analysis (integration and differentiation), equation solvers. Mathematics leverages parallelism using .NET 4.0's Task Parallel Library. Basic math: Complex numbers, 'special functions' like Gamma and Bessel functions, numerical differentiation. Solving equations: Solve equations in one variable, or solve systems of linear or nonlinear equations. Curve fitting: Linear and nonlinear curve fitting, cubic splines, polynomials, orthogonal polynomials. Optimization: find the minimum or maximum of a function in one or more variables, linear programming and mixed integer programming. Numerical integration: Compute integrals over finite or infinite intervals, over 2D and higher dimensional regions. Integrate systems of ordinary differential equations (ODE's). Fast Fourier Transforms: 1D and 2D FFT's using managed or fast native code (32 and 64 bit) BigInteger, BigRational, and BigFloat: Perform operations with arbitrary precision. Vector and Matrix Library Real and complex vectors and matrices. Single and double precision for elements. Structured matrix types: including triangular, symmetrical and band matrices. Sparse matrices. Matrix factorizations: LU decomposition, QR decomposition, singular value decomposition, Cholesky decomposition, eigenvalue decomposition. Portability and performance: Calculations can be done in 100% managed code, or in hand-optimized processor-specific native code (32 and 64 bit). Statistics Data manipulation: Sort and filter data, process missing values, remove outliers, etc. Supports .NET data binding. Statistical Models: Simple, multiple, nonlinear, logistic, Poisson regression. Generalized Linear Models. One and two-way ANOVA. Hypothesis Tests: 12 14 hypothesis tests, including the z-test, t-test, F-test, runs test, and more advanced tests, such as the Anderson-Darling test for normality, one and two-sample Kolmogorov-Smirnov test, and Levene's test for homogeneity of variances. Multivariate Statistics: K-means cluster analysis, hierarchical cluster analysis, principal component analysis (PCA), multivariate probability distributions. Statistical Distributions: 25 29 continuous and discrete statistical distributions, including uniform, Poisson, normal, lognormal, Weibull and Gumbel (extreme value) distributions. Random numbers: Random variates from any distribution, 4 high-quality random number generators, low discrepancy sequences, shufflers. New in version 4.0 (November, 2010) Support for .NET Framework Version 4.0 and Visual Studio 2010 TPL Parallellized – multicore ready sparse linear program solver - can solve problems with more than 1 million variables. Mixed integer linear programming using a branch and bound algorithm. special functions: hypergeometric, Riemann zeta, elliptic integrals, Frensel functions, Dawson's integral. Full set of window functions for FFT's. Product  Price Update subscription Single Developer License $999  $399  Team License (3 developers) $1999  $799  Department License (8 developers) $3999  $1599  Site License (Unlimited developers in one physical location) $7999  $3199    NMath http://www.centerspace.net .NET math and statistics libraries matrix and vector classes random number generators Fast Fourier Transforms (FFTs) numerical integration linear programming linear regression curve and surface fitting optimization hypothesis tests analysis of variance (ANOVA) probability distributions principal component analysis cluster analysis built on the Intel Math Kernel Library (MKL), which contains highly-optimized, extensively-threaded versions of BLAS (Basic Linear Algebra Subroutines) and LAPACK (Linear Algebra PACKage). Product  Price Update subscription Single Developer License $1295 $388 Team License (5 developers) $5180 $1554   DotNumerics http://www.dotnumerics.com/NumericalLibraries/Default.aspx free DotNumerics is a website dedicated to numerical computing for .NET that includes a C# Numerical Library for .NET containing algorithms for Linear Algebra, Differential Equations and Optimization problems. The Linear Algebra library includes CSLapack, CSBlas and CSEispack, ports from Fortran to C# of LAPACK, BLAS and EISPACK, respectively. Linear Algebra (CSLapack, CSBlas and CSEispack). Systems of linear equations, eigenvalue problems, least-squares solutions of linear systems and singular value problems. Differential Equations. Initial-value problem for nonstiff and stiff ordinary differential equations ODEs (explicit Runge-Kutta, implicit Runge-Kutta, Gear's BDF and Adams-Moulton). Optimization. Unconstrained and bounded constrained optimization of multivariate functions (L-BFGS-B, Truncated Newton and Simplex methods).   Math.NET Numerics http://numerics.mathdotnet.com/ free an open source numerical library - includes special functions, linear algebra, probability models, random numbers, interpolation, integral transforms. A merger of dnAnalytics with Math.NET Iridium in addition to a purely managed implementation will also support native hardware optimization. constants & special functions complex type support real and complex, dense and sparse linear algebra (with LU, QR, eigenvalues, ... decompositions) non-uniform probability distributions, multivariate distributions, sample generation alternative uniform random number generators descriptive statistics, including order statistics various interpolation methods, including barycentric approaches and splines numerical function integration (quadrature) routines integral transforms, like fourier transform (FFT) with arbitrary lengths support, and hartley spectral-space aware sequence manipulation (signal processing) combinatorics, polynomials, quaternions, basic number theory. parallelized where appropriate, to leverage multi-core and multi-processor systems fully managed or (if available) using native libraries (Intel MKL, ACMS, CUDA, FFTW) provides a native facade for F# developers

    Read the article

  • From a language design perspective, if Javascript objects are simply associative arrays, then why ha

    - by Christopher Altman
    I was reading about objects in O'Reilly Javascript Pocket Reference and the book made the following statement. An object is a compound data type that contains any number of properties. Javascript objects are associative arrays: they associate arbitrary data values with arbitrary names. From a language design perspective, if objects are simply associative arrays, then why have objects? I appreciate the convenience of having objects in the language, but if convenience is the main purpose for adding a data type, then how do you decide what to add and what to not add in a language? A language can quickly become bloated and less valuable if it is weighed down by several overlapping methods and data types (Is this a true statement or am I missing something).

    Read the article

  • How can I mark a group of changes/changesets in SVN, Hg, or Git

    - by sylvanaar
    I would like to mark an arbitrary group of commits/changesets with a label. Commit 1 *Mark 1 Commit 2 *Mark 2 Commit 3 Commit 4 *Mark 1 Commit 5 *Mark 2 The goal is to easily locate all the changes for a specific mark, and to have that grouping persisted in the VCS directly, as opposed to some outside system like a bug tracking system. The location and ordering of the marks needs to be arbitrary, and should be able to work with both committed/uncommitted and pushed/unpushed changes. In SVN the best way I know is to just edit the commit notes and add some sort of special text that you can search for e.g. "**Mark 1". Or just to make a fake edit and commit it and use its commit note to list all the included revisions. Is there a better solution for SVN? Are there equivalent or better solutions for Hg or Git?

    Read the article

  • Formatting an indented list in CSS

    - by Colen
    Hi, Let's say I have a list, with an arbitrary number of indentation levels, like so: Item Item Item Item Item Item Item Item Item Item Item If I'm displaying this list in an HTML document, how can I use CSS to handle the indentation? There might be an arbitrary number of indentation levels (although in practice there isn't going to be more than 5 or so). I don't want to create an "indent1" class that indents 10 pixels, an "indent2" class that indents 20 pixels, etc - that's clumsy. Is it possible to create a general rule that will indent by a certain distance based on an attribute value, or the position of an element in the hierarchy?

    Read the article

  • Computational geometry: find where the triangle is after rotation, translation or reflection on a mi

    - by newba
    I have a small contest problem in which is given a set of points, in 2D, that form a triangle. This triangle may be subject to an arbitrary rotation, may be subject to an arbitrary translation (both in the 2D plane) and may be subject to a reflection on a mirror, but its dimensions were kept unchanged. Then, they give me a set of points in the plane, and I have to find 3 points that form my triangle after one or more of those geometric operations. Example: 5 15 8 5 20 10 6 5 17 5 20 20 5 10 5 15 20 15 10 I bet that have to apply some known algorithm, but I don't know which. The most common are: convex hull, sweep plane, triangulation, etc. Can someone give a tip? I don't need the code, only a push, please!

    Read the article

  • Piano Keys using GridLayout (or Something Else)

    - by yar
    I am creating a container of JComponents which will look like a piano keyboard. The black keys look like this (Groovy) def setBlackNotes(buttons) { def octaves = (int)(buttons.size() / 5) def gridLayout = new GridLayout(1, octaves*7); def blackNotePanel = new JPanel(gridLayout) this.add blackNotePanel def i = 0 octaves.times { 2.times { blackNotePanel.add buttons[i++] } blackNotePanel.add Box.createHorizontalBox() 3.times { blackNotePanel.add buttons[i++] } blackNotePanel.add Box.createHorizontalBox() } } Which is just what I need, and looks like this: but then I'd like to move this over to the right by half-a-key width. All of my attempts to move the blackNotePanel over by an arbitrary width -- wrapping it a BorderLayout, a MigLayout, etc. -- have failed or changed the spacing of the GridLayout radically. Any suggestions on how to move this over to the right by an arbitrary amount in pixels?

    Read the article

  • Computation geometry: find where's the triangle after rotation, tranlastion or reflection in a mirro

    - by newba
    Hi, I have a small contest problem in which is given a set of points, in 2D, that form a triangle. This triangle may be subject to an arbitrary rotation, may be subject to an arbitrary translation (both in the 2D plane) and may be subject to a reflection on a mirror, but its dimensions were kept unchanged. Then, they give me a set of points in the plane, and I have to find 3 points that form my triangle after one or more of those geometric operations. Example: 5 15 8 5 20 10 6 5 17 5 20 20 5 10 5 15 20 15 10 I bet that have to apply some known algorithm, but I don't know which. The most common are: convex hull, sweep plane, triangulation, etc. Can someone give a tip? I don't need the code, only a push, please!

    Read the article

  • Inscribe and center an image within a frame

    - by Brennan Roberts
    Given a div of arbitrary aspect ratio, what's the best way to place and style an image (also with an arbitrary aspect ratio) inside such that: It is both inscribed and centered Its dimensions and position are set using relative values so that the image will remain inscribed and centered automatically when the frame is uniformly scaled (javascript should only be required when the image is initially inserted, or if the frame's aspect ratio changes) Extra markup is minimized Here's the result we want: Here's a fiddle template, which is just: Markup Should pillarbox <div class="frame"> <img src="http://www.placekitten.com/200/300" /> </div> Should letterbox <div class="frame"> <img src="http://www.placekitten.com/300/200" /> </div> CSS .frame { width: 200px; height: 200px; border: 2px solid black; margin: 10px 0px 100px 0; }

    Read the article

  • [C++]Advantage of using a static member function instead of an equivalent non-static member function

    - by jonathanasdf
    I was wondering whether there's any advantages to using a static member function when there is a non-static equivalent. Will it result in faster execution (because of not having to care about all of the member variables), or maybe less use of memory (because of not being included in all instances)? Basically, the function I'm looking at is an utility function to rotate an integer array representing pixel colours an arbitrary number of degrees around an arbitrary centre point. It is placed in my abstract Bullet base class, since only the bullets will be using it and I didn't want the overhead of calling it in some utility class. It's a bit too long and used in every single derived bullet class, making it probably not a good idea to inline. How would you suggest I define this function? As a static member function of Bullet, of a non-static member function of Bullet, or maybe not as a member of Bullet but defined outside of the class in Bullet.h? What are the advantages and disadvantages of each?

    Read the article

  • Libraries/Solutions for using XSL to create interactive web forms from XML

    - by Brabster
    This seems like a pretty straightforward thing to do, but I can't find anything off the open-source shelf. Is there a solution already out there that does the following: can be configured with an arbitrary XSL stylesheet generates a web form based on an arbitrary XML document and the XSL creates edit functionality in appropriate places in the rendered form updates the local representation of the XML document provides capabilities to view, save the new XML document Ideally, one that plugs into a Java web application. Even better if it can generate the XSL based on schema documents - but that might not be feasible, not really thought it through. For context, I'm thinking things like pleasant-for-humans editing of Maven POMs, ANT build.xml, etc. Cheers,

    Read the article

  • Web-based JSON editor that works like property explorer with AJAXy input form

    - by dreftymac
    Background: This is a request for something that may not exist yet, but I've been meaning to build one for a long time. First I will ask if anyone has seen anything like it yet. Suppose you have an arbitrary JSON structure like the following: { 'str_title':'My Employee List' ,'str_lastmod': '2009-June-15' ,'arr_list':[ {'firstname':'john','lastname':'doe','age':'33',} ,{'firstname':'jane','lastname':'doe','age':'34',} ,{'firstname':'samuel','lastname':'doe','age':'35',} ] } Question: Is there a web-based JSON editor that could take a structure like this, and automatically allow the user to modify this in a user-friendly GUI? Example: Imagine an auto-generated HTML form that displays 2 input-type-text controls for both title and lastmod, and a table of input-type-text controls with three columns and three rows for arr_list ... with the ability to delete or add additional rows by clicking on a [+][X] next to each row in the table. Big Idea: The "big idea" behind this is that the user would be able to specify any arbitrary (non-recursive) JSON structure and then also be able to edit the structure with a GUI-based interaction (this would be similar to the "XML Editor Grid View" in XML Spy).

    Read the article

  • Calculating the pixel size of a string with Python

    - by Aristide
    I have a Python script which needs to calculate the exact size of arbitrary strings displayed in arbitrary fonts in order to generate simple diagrams. I can easily do it with Tkinter. The problem is the results seem to depend on the version of Python and/or the system. import Tkinter as tk import tkFont root = tk.Tk() times12 = tkFont.Font(family="times",size=12) print times12.metrics("linespace"), print times12.measure("Hello world") times24 = tkFont.Font(family="times",size=24) print times24.metrics("linespace"), print times24.measure("Hello world") Python 2.5 on Mac OS X gives the actual pixel measurements: 12 57 24 116 Python 2.6.1 on Mac OS X gives: 14 58 27 115 Python 2.6.3 on Windows XP gives: 19 71 36 154 Such a need being quite common, I suspect I did something wrong. Any idea?

    Read the article

  • Advantage of using a static member function instead of an equivalent non-static member function?

    - by jonathanasdf
    I was wondering whether there's any advantages to using a static member function when there is a non-static equivalent. Will it result in faster execution (because of not having to care about all of the member variables), or maybe less use of memory (because of not being included in all instances)? Basically, the function I'm looking at is an utility function to rotate an integer array representing pixel colours an arbitrary number of degrees around an arbitrary centre point. It is placed in my abstract Bullet base class, since only the bullets will be using it and I didn't want the overhead of calling it in some utility class. It's a bit too long and used in every single derived bullet class, making it probably not a good idea to inline. How would you suggest I define this function? As a static member function of Bullet, of a non-static member function of Bullet, or maybe not as a member of Bullet but defined outside of the class in Bullet.h? What are the advantages and disadvantages of each?

    Read the article

  • Given an instance of a Ruby object, how do I get its metaclass?

    - by Stanislaus Wernstrom
    Normally, I might get the metaclass for a particular instance of a Ruby object with something like this: class C def metaclass class << self; self; end end end # This is this instance's metaclass. C.new.metaclass => #<Class:#<C:0x01234567>> # Successive invocations will have different metaclasses, # since they're different instances. C.new.metaclass => #<Class:#<C:0x01233...>> C.new.metaclass => #<Class:#<C:0x01232...>> C.new.metaclass => #<Class:#<C:0x01231...>> Let's say I just want to know the metaclass of an arbitrary object instance obj of an arbitrary class, and I don't want to define a metaclass (or similar) method on the class of obj. Is there a way to do that?

    Read the article

  • String encryption only with numbers?

    - by HH
    Suppose your bank clerk gives you an arbitrary password such as hel34/hjal0@# and you cannot remember it without writing it to a paper. Dilemma: you never write passwords to paper. So you try to invent an encryption, one-to-one map, where you write only a key to a paper, only numbers, and leave the rest junk to your server. Of course, the password can consist of arbitrary things. Implemention should work like hel34/hjal0#@ ---- magic ----> 3442 and to other way: 3442 ---- server magic ---> hel34/hjal0#@ [Update] mvds has the correct idea, to change the base, how would you implement it?

    Read the article

  • How can I add floats together in different orders, and always get the same total?

    - by splicer
    Let's say I have three 32-bit floating point values, a, b, and c, such that (a + b) + c != a + (b + c). Is there summation algorithm, perhaps similar to Kahan summation, that guarantees that these values can be summed in any order and always arrive at the exact same (fairly accurate) total? I'm looking for the general case (i.e. not a solution that only deals with 3 numbers). Is arbitrary precision arithmetic the only way to go? I'm dealing with very large data sets, so I'd like to avoid the overhead of using arbitrary precision arithmetic if possible. Thanks!

    Read the article

  • Allocate from buffer in C

    - by Grimless
    I am building a simple particle system and want to use a single array buffer of structs to manage my particles. That said, I can't find a C function that allows me to malloc() and free() from an arbitrary buffer. Here is some pseudocode to show my intent: Particle* particles = (Particle*) malloc( sizeof(Particle) * numParticles ); Particle* firstParticle = <buffer_alloc>( particles ); initialize_particle( firstParticle ); // ... Some more stuff if (firstParticle->life < 0) <buffer_free>( firstParticle ); // @ program's end free(particles); Where <buffer_alloc> and <buffer_free> are functions that allocate and free memory chunks from arbitrary pointers (possibly with additional metadata such as buffer length, etc.). Do such functions exist and/or is there a better way to do this? Thank you!

    Read the article

  • How do I serve dynamic WebDAV directory listings using Apache

    - by Jack Douglas
    I can use mod_rewrite to redirect /dynamic.php/xyz.php to /dynamic.php and then server different content for xyz.php using $_SERVER - where xyz.php is any arbitrary filename requested by a client. No problem so far. When a client connects to my WebDAV server they can list the contents of a directory, eg / or /dynamic.php/ - how do I intercept this request so I can dynamically generate a list of available files for the client (which requests this list using PROPFIND)?

    Read the article

  • Meta package / quick reference for string manipulation commands?

    - by Dylan McCall
    The latest version of the Scribes text editor lets us select some text, hit Alt+X, and then run an arbitrary command. For example, I can run the sort command and the selected text is replaced appropriately. This is quite useful but I am also not very well-versed in awk and the like. Is there something I can grab that will provide more of these commands like sort? Maybe a package with a whole bunch of handy, task-specific string manipulation commands?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >