Search Results

Search found 2659 results on 107 pages for 'vector drawings'.

Page 26/107 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Screenshot from WPF application as SVG / vector graphic?

    - by stefan.at.wpf
    Hello, is it possible to create a screenshot of a WPF application as SVG / is there some WPF built-in function to get the XAML code for the current drawn window that then can be converted to SVG? I need some screenshots for documenting a WPF application and I'd like them to be zoomable like a WPF program is using e.g. Snoop or Vista Magnifyer. Thanks for any hint!

    Read the article

  • How can I store spell & items using a std::vector implementation?

    - by Vladimir Marenus
    I'm following along with a book from GameInstitute right now, and it's asking me to: Allow the player to buy and carry healing potions and potions of fireball. You can add an Item array (after you define the item class) to the Player class for storing them, or use a std::vector to store them. I think I would like to use the std::vector implementation, because that seems to confuse me less than making an item class, but I am unsure how to do so. I've heard from many people that vectors are great ways to store dynamic values (such as items, weapons, etc), but I've not seen it used.

    Read the article

  • String quotation marks when exporting a Mathematica Grid as vector graphics

    - by Janus
    Running the following agrid = Grid[{{Style["hello", Bold]}}] ImportString[ExportString[agrid, "PNG"], "PNG"] ImportString[ExportString[agrid, "EPS"], "EPS"] spits out hello hello "hello" That is, the EPS exporter included the quotation marks in the output. Same for PDF. Without the Grid, all exporters leave out the quotation marks. What magic do I need to get rid of the quotation marks in the PDF?

    Read the article

  • Implementing a linear, binary SVM (support vector machine)

    - by static_rtti
    I want to implement a simple SVM classifier, in the case of high-dimensional binary data (text), for which I think a simple linear SVM is best. The reason for implementing it myself is basically that I want to learn how it works, so using a library is not what I want. The problem is that most tutorials go up to an equation that can be solved as a "quadratic problem", but they never show an actual algorithm! So could you point me either to a very simple implementation I could study, or (better) to a tutorial that goes all the way to the implementation details? Thanks a lot!

    Read the article

  • How to rotate an SSE/AVX vector

    - by user1584773
    I need to perform a rotate operation with as little clock cycle as possible. In the first case let's assume __m128i as source and dest type source: || A0 || A1 || A2 || A3 || dest : || A1 || A2 || A3 || A0 || dest = (__m128i)_mm_shuffle_epi32((__m128i)source, _MM_SHUFFLE(0,3,2,1)); Now I want to do the same whit AVX intrinsics So let's assume this time __m256i as source and dest type source: || A0 || A1 || A2 || A3 || A4 || A5 || A6 || A7 || dest : || A1 || A2 || A3 || A4 || A5 || A6 || A7 || A0 || The Avx intrinsics is missing most of the corresponding SSE integer operations. Maybe there is some way go get the desider output working with the floating point version. I've tryed with: dest = (__m256i)_mm256_shuffle_ps((__m256)source, (__m256)source, _MM_SHUFFLE(0,3,2,1)); but what I get is: || A0 || A2 || A3 || A4 || A5 || A6 || A7 || A1 || Any Idea on how to solve this in an efficient way? (without mixing SSE and AVX operation and without "manually" inverting A0 and A1 Thanks in advance!

    Read the article

  • Vector addition of lists

    - by ntimes
    If I had a N lists each of length M, how could I write a nice clean function to return a single list of length M, where each element is the sum of the corresponding elements in the N lists? (starting to learn lisp - go easy!)

    Read the article

  • Convert large raster graphics image(bitmap, PNG, JPEG, etc) to non-vector postscript in C#

    - by Dennis Cheung
    How to convert an large image and embed it into postscript? I used to convert the bitmap into HEX codes and render with colorimage. It works for small icons but I hit a /limitcheck error in ghostscript when I try to embed little larger images. It seem there is a memory limit for bitmap in ghostscript. I am looking a solution which can run without 3rd party/pre-processing other then ghostscript itself.

    Read the article

  • How to solve such system with given parts of it? (maple)

    - by Kabumbus
    So I had a system #for given koefs k:=3; n:=3; #let us solve system: koefSolution:= solve({ sum(a[i], i = 0 .. k) = 0, sum(a[i], i = 0 .. k)-(sum(b[i], i = 0 .. k)) = 0, sum(i^n*a[i], i = 0 .. k)-(sum(i^(n-1)*b[i], i = 0 .. k)) = 0 }); So I have a vector like koefSolution := { a[0] = 7*a[2]+26*a[3]-b[1]-4*b[2]-9*b[3], a[1] = -8*a[2]-27*a[3]+b[1]+4*b[2]+9*b[3], a[2] = a[2], a[3] = a[3], b[0] = -b[1]-b[2]-b[3], b[1] = b[1], b[2] = b[2], b[3] = b[3]} I have a[0] so I try solve({koefSolution, a[0] = 1}); why it does not solve my system for given a[0]? ( main point here is to fill koefSolution with given a[] and b[] and optimize.)

    Read the article

  • vector collision on polygon in 3d space detection/testing?

    - by LRFLEW
    In the 3d fps in java I'm working on, I need a bullet to be fired and to tell if it hit someone. All visual objects in the game are defined through OpenGL, so the object it can be colliding with can be any drawable polygon (although they will most likely be triangles and rectangles anyways). The bullet is not an object, but will be treated as a vector that instantaneously moves all the way across the map (like the snipper riffle in Halo). What's the best way to detect/test collisions with the polygon and the vector. I have access to OpenCL, however I have absolutely no experience with it. I am very early in the developmental stage, so if you think there's a better way of going about this, feel free to tell me (I barley have a player model to collide with anyways, so I'm flexible with it). Thanks

    Read the article

  • Matlab - applying low-pass filter to a vector?

    - by waitinforatrain
    If I have a simple low-pass filter, e.g. filt = fir1(20, 0.2); and a matrix with a list of numbers (a signal), e.g. [0.1, -0.2, 0.3, -0.4] etc, how do I actually apply the filter I've created to this signal? Seems like a simple question but I've been stuck for hours. Do I need to manually calculate it from the filter coefficients?

    Read the article

  • Compute divergence of vector field using python

    - by nyvltak
    Is there a function that could be used for calculation of the divergence of the vectorial field? (in matlab http://www.mathworks.ch/help/techdoc/ref/divergence.html) I would expect it exists in numpy/scipy but I can not find it using google :(. # I need to calculate div[A * grad(F)], where F = np.array([[1,2,3,4],[5,6,7,8]]) (2D numpy ndarray) A = np.array([[1,2,3,4],[1,2,3,4]]) (2D numpy ndarray) so grad(F) is a set of 2D ndarrays # I know, I can calculate divergence like this: http://en.wikipedia.org/wiki/Divergence#Application_in_Cartesian_coordinates but do not want to reinvent the wheel. (and also I expent there is some optimized function)

    Read the article

  • Android AES and init vector

    - by Donald_W
    I have an issue with AES encryptio and decryption: I can change my IV entirely and still I'm able to decode my data. public static final byte[] IV = { 65, 1, 2, 23, 4, 5, 6, 7, 32, 21, 10, 11, 12, 13, 84, 45 }; public static final byte[] IV2 = { 65, 1, 2, 23, 45, 54, 61, 81, 32, 21, 10, 121, 12, 13, 84, 45 }; public static final byte[] KEY = { 0, 42, 2, 54, 4, 45, 6, 7, 65, 9, 54, 11, 12, 13, 60, 15 }; public static final byte[] KEY2 = { 0, 42, 2, 54, 43, 45, 16, 17, 65, 9, 54, 11, 12, 13, 60, 15 }; //public static final int BITS = 256; public static void test() { try { // encryption Cipher c = Cipher.getInstance("AES"); SecretKeySpec keySpec = new SecretKeySpec(KEY, "AES"); c.init(Cipher.ENCRYPT_MODE, keySpec, new IvParameterSpec(IV)); String s = "Secret message"; byte[] data = s.getBytes(); byte[] encrypted = c.doFinal(data); String encryptedStr = ""; for (int i = 0; i < encrypted.length; i++) encryptedStr += (char) encrypted[i]; //decryoption Cipher d_c = Cipher.getInstance("AES"); SecretKeySpec d_keySpec = new SecretKeySpec(KEY, "AES"); d_c.init(Cipher.DECRYPT_MODE, d_keySpec, new IvParameterSpec(IV2)); byte[] decrypted = d_c.doFinal(encrypted); String decryptedStr = ""; for (int i = 0; i < decrypted.length; i++) decryptedStr += (char) decrypted[i]; Log.d("", decryptedStr); } catch (Exception ex) { Log.d("", ex.getMessage()); } } Any ideas what I'm doing wrong? How can I get 256 bit AES encryption (only change key to 32-byte long array?) Encryption is a new topic for me so please for newbie friendly answers.

    Read the article

  • signed angle between two 3d vectors with same origin within the same plane? recipe?

    - by Advanced Customer
    Was looking through the web for an answer but it seems like there is no clear recipe for it. What I need is a signed angle of rotation between two vectors Va and Vb lying within the same 3D plane and having the same origin knowing that: the plane contatining both vectors is an arbitrary and is not parallel to XY or any other of cardinal planes Vn - is a plane normal both vectors along with the normal have the same origin O = { 0, 0, 0 } Va - is a reference for measuring the left handed rotation at Vn The angle should be measured in such a way so if the plane would be XY plane the Va would stand for X axis unit vector of it. I guess I should perform a kind of coordinate space transformation by using the Va as the X-axis and the cross product of Vb and Vn as the Y-axis and then just using some 2d method like with atan2() or something. Any ideas? Formulas?

    Read the article

  • How do you return a pointer to a base class with a virtual function?

    - by Nick Sweet
    I have a base class called Element, a derived class called Vector, and I'm trying to redefine two virtual functions from Element in Vector. //element.h template <class T> class Element { public: Element(); virtual Element& plus(const Element&); virtual Element& minus(const Element&); }; and in another file //Vector.h #include "Element.h" template <class T> class Vector: public Element<T> { T x, y, z; public: //constructors Vector(); Vector(const T& x, const T& y = 0, const T& z =0); Vector(const Vector& u); ... //operations Element<T>& plus(const Element<T>& v) const; Element<T>& minus(const Element<T>& v) const; ... }; //sum template <class T> Element<T>& Vector<T>::plus(const Element<T>& v) const { Element<T>* ret = new Vector((x + v.x), (y + v.y), (z + v.z)); return *ret; } //difference template <class T> Element<T>& Vector<T>::minus(const Element<T>& v) const { Vector<T>* ret = new Vector((x - v.x), (y - v.y), (z - v.z)); return *ret; } but I always get error: 'const class Element' has no member named 'getx' So, can I define my virtual functions to take Vector& as an argument instead, or is there a way for me to access the data members of Vector through a pointer to Element? I'm still fairly new to inheritance polymorphism, fyi.

    Read the article

  • Convolve a column vector

    - by Geoff
    This is an OpenCV2 question. I have a matrix: cv::Mat_<Point3f> points; representing some space curve. I want to smooth it (using, for example a Gaussian kernel). I have tried using: cv::Mat_<Point3f> result; cv::GaussianBlur(points, result, cv::Size(4 * sigma, 1), sigma, sigma, cv::BORDER_WRAP); But I get the error: Assertion failed (columnBorderType != BORDER_WRAP)

    Read the article

  • How to track the touch vector?

    - by mystify
    I need to calculate the direction of dragging a touch, to determine if the user is dragging up the screen, or down the screen. Actually pretty simple, right? But: 1) Finger goes down, you get -touchesBegan:withEvent: called 2) Must wait until finger moves, and -touchesMoved:withEvent: gets called 3) Problem: At this point it's dangerous to tell if the user did drag up or down. My thoughts: Check the time and accumulate calculates vectors until it's secure to tell the direction of touch. Easy? No. Think about it: What if the user holds the finger down for 5 minutes on the same spot, but THEN decides to move up or down? BANG! Your code would fail, because it tried to determine the direction of touch when the finger didn't move really. Problem 2: When the finger goes down and stays at the same spot for a few seconds because the user is a bit in the wind and thinks about what to do now, you'll get a lot of -touchesMoved:withEvent: calls very likely, but with very minor changes in touch location. So my next thought: Do the accumulation in -touchesMoved:withEvent:, but only if a certain threshold of movement has been exceeded. I bet you have some better concepts in place?

    Read the article

  • Best way to insert items from a Derived class's constructor into a Base class's private std::vector?

    - by Will
    I have these classes: class Base { ... private: std::vector<X> v; }; class Derived { Derived(X*, int n); } where the constructor of Derived is passed an array of item Xs, which I need to insert into my vector v in the Base class. (X is a smart pointer) Currently I see two ways to do this: 1) Create a function in Base: InsertItem(X*) that will insert an item into the vector. 2) Create a vector in Derived that contains the full list, then get it into Base by moving the entire vector. I dont see any advantages to #2, but was wondering if #1 was a good solution, or if there are better ways to do this. Thanks!

    Read the article

  • Fastest way to find the rotation of a vector

    - by kriss
    I have two 2D vectors, say u and v, defined by cartesian coordinates. Imagine that vectors are needles of a clock. I'm looking for the fastest way to find out, using python, if v is after or before u (or in other words find out in wich half plane is v, regarding to position of u). For the purpose of the problem if vectors are aligned answer should be before. It seems easy using some trigonometry, but I believe there should be a faster way using coordinates only. My test case: def after(u, v): """code here""" after((4,2), (6, 1)) : True after((4,2), (3, 3)) : False after((4,2), (2, 1)) : False after((4,2), (3, -3)) : True after((4,2), (-2, -5)) : True after((4,2), (-4, -2)) : False

    Read the article

  • How do I put a vector inside of a struct in Go?

    - by Brian T Hannan
    I'm trying to put a vector variable inside a struct in Google's Go programming language. This is what I have so far: Want: type Point struct { x, y int } type myStruct struct { myVectorInsideStruct vector; } func main(){ myMyStruct := myStruct{vector.New(0)}; myPoint := Point{2,3}; myMyStruct.myVectorInsideStruct.Push(myPoint); } Have: type Point struct { x, y int } func main(){ myVector := vector.New(0); myPoint := Point{2,3}; myVector.Push(myPoint); } I can get the vector to work in my main function just fine, but I want to encapsulate it inside a struct for easier use.

    Read the article

  • Is it correct to add booleans in order to count the number of true values in a vector?

    - by gerrit
    Is it conceptually correct to sum a vector of booleans? From a mathematical point of view, I would argue it's not: True + True != 2. But it's quite practical to do so still! Example using the vectorised Python library numpy: In [1]: X = rand(10) In [2]: large = X>0.6 In [3]: large.dtype Out[3]: dtype('bool') In [4]: large.sum() Out[4]: 7 I don't like it, but it's very practical. Is this a good practice? Update: the aim is to count the number of true values in a vector.

    Read the article

  • How to interpret situations where Math.Acos() reports invalid input?

    - by Sean Ochoa
    Hey all. I'm computing the angle between two vectors, and sometimes Math.Acos() returns NaN when it's input is out of bounds (-1 input && input 1) for a cosine. What does that mean, exactly? Would someone be able to explain what's happening? Any help is appreciated! Here's me method: public double AngleBetween(vector b) { var dotProd = this.Dot(b); var lenProd = this.Len*b.Len; var divOperation = dotProd/lenProd; // http://msdn.microsoft.com/en-us/library/system.math.acos.aspx return Math.Acos(divOperation) * (180.0 / Math.PI); }

    Read the article

  • Scalling connected lines

    - by Hristo
    Hello, I have some kind of a shape consisting of vertical, horizontal and diagonal lines. I have starting X,Y and ending X,Y (this is my input - just 2 points defining a line) of each line and I would like to make the whole shape scalable (just by changing the value of a scale ratio variable), so that I can still preserve the proper connection of the lines and the proportions as well. Just for getting a better idea of what I mean: it'd be as if I had the same lines in a vector editor. Would that be possible with an algorithm, and could you please, give me another possible solution if there is no such algorithm ? Thank you very much in advance!

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >