Search Results

Search found 1909 results on 77 pages for 'adjacency matrix'.

Page 20/77 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • parallel to usb driver windows 7 dot matrix printer

    - by user975234
    I recently built a new Core i5 system with Windows 7 Professional. I had planned to hook up my TVS MSP 250 XL printer using a USB to parallel cable Once I plug the cable in, Windows 7 recognizes it as an IEEE-1284 controller and automatically installs the appropriate driver. However, in the status window it reports the following: "USB Printing Support -- Ready to use" "No Printer Attached -- Ready to use" When I then go ahead and manually add the printer using the "virtual printer port for USB" I can add the printer seemingly without problem. Once finished, it appears in the Devices and Printers panel. Yet, all attempts to print on this printer fail. It appears that simply no data is sent to the printer (either by programs like word or adobe or by attempting to print a test page. Does anybody know how to fix this?

    Read the article

  • Matrix Transpose TSQL

    - by rmdussa
    Can we do matrix transpose (rows become columns and columns become rows) in standard SQL? 1 2 3 4 5 4 5 6 6 7 7 8 9 8 9 1 3 4 5 6 2 4 5 6 7 changes to 1 4 7 1 2 2 5 8 3 4 3 6 9 5 6 4 6 8 5 6 5 7 9 6 7 how about no of rows < no of column ? let's consider the no of rows it's fixed.

    Read the article

  • Read data matrix barcodes on iPhone?

    - by Saurabh
    Hi All, Is there any Open Source project I can use to read data matrix codes (not QR codes, I know I can use ZXing project to read QR Codes) on iPhone? Any JAVA Open Source would also be helpful (I'll convert that into a web service and use on iPhone). Any help would be much appreciated! Thanks Saurabh

    Read the article

  • Performance Optimization for Matrix Rotation

    - by Summer_More_More_Tea
    Hello everyone: I'm now trapped by a performance optimization lab in the book "Computer System from a Programmer's Perspective" described as following: In a N*N matrix M, where N is multiple of 32, the rotate operation can be represented as: Transpose: interchange elements M(i,j) and M(j,i) Exchange rows: Row i is exchanged with row N-1-i A example for matrix rotation(N is 3 instead of 32 for simplicity): ------- ------- |1|2|3| |3|6|9| ------- ------- |4|5|6| after rotate is |2|5|8| ------- ------- |7|8|9| |1|4|7| ------- ------- A naive implementation is: #define RIDX(i,j,n) ((i)*(n)+(j)) void naive_rotate(int dim, pixel *src, pixel *dst) { int i, j; for (i = 0; i < dim; i++) for (j = 0; j < dim; j++) dst[RIDX(dim-1-j, i, dim)] = src[RIDX(i, j, dim)]; } I come up with an idea by inner-loop-unroll. The result is: Code Version Speed Up original 1x unrolled by 2 1.33x unrolled by 4 1.33x unrolled by 8 1.55x unrolled by 16 1.67x unrolled by 32 1.61x I also get a code snippet from pastebin.com that seems can solve this problem: void rotate(int dim, pixel *src, pixel *dst) { int stride = 32; int count = dim >> 5; src += dim - 1; int a1 = count; do { int a2 = dim; do { int a3 = stride; do { *dst++ = *src; src += dim; } while(--a3); src -= dim * stride + 1; dst += dim - stride; } while(--a2); src += dim * (stride + 1); dst -= dim * dim - stride; } while(--a1); } After carefully read the code, I think main idea of this solution is treat 32 rows as a data zone, and perform the rotating operation respectively. Speed up of this version is 1.85x, overwhelming all the loop-unroll version. Here are the questions: In the inner-loop-unroll version, why does increment slow down if the unrolling factor increase, especially change the unrolling factor from 8 to 16, which does not effect the same when switch from 4 to 8? Does the result have some relationship with depth of the CPU pipeline? If the answer is yes, could the degrade of increment reflect pipeline length? What is the probable reason for the optimization of data-zone version? It seems that there is no too much essential difference from the original naive version. EDIT: My test environment is Intel Centrino Duo processor and the verion of gcc is 4.4 Any advice will be highly appreciated! Kind regards!

    Read the article

  • MATrix LABoratory interview questions?

    - by Shane
    I programmed in MATrix LABoratory for many years, but switched to using R exclusively in the past few years so I'm a little out of practice. I'm interviewing a candidate today who describes himself as an expert? What interview questions that I should be asking?

    Read the article

  • Understanding this matrix transposition function in Haskell

    - by dmindreader
    This matrix transposition function works, but I'm trying to understand its step by step execurtion and I don't get it. transpose:: [[a]]->[[a]] transpose ([]:_) = [] transpose x = (map head x) : transpose (map tail x) with transpose [[1,2,3],[4,5,6],[7,8,9]] it returns: [[1,4,7],[2,5,8],[3,6,9]] I don't get how the concatenation operator is working with map. It is concatenating each head of x in the same function call? How?

    Read the article

  • Is there an Open Source licence matrix?

    - by tobsen
    I am trying to find a simple matrix overview of the various licenses around open source software but can't find anything useful. I would like to know whether software under a certain licence can be used in commercial closed source software, if there has to be the original source code included, if the licence has to be redistirbuted, etc. I know this is a difficult topic because I guess only the minority of programmers are also moonlighting lawyers - neither am I.

    Read the article

  • OpenGL: Implementing transformation matrix stack

    - by Jakub M.
    In a newer OpenGL there is no matrix stack. I am working on a simple display engine, and I am going to implement the transformation stack. What is a common strategy here? Should I build a push/pop stack, and use it with a tree representing my model? I suppose this is the "old" approach, that was deprecated in the newer OpenGL versions. Maybe then it is not the best solution (it was removed for some reason)

    Read the article

  • To find a determinate of Matrix using Boost library in c++

    - by user314097
    Hi, I' am required to convert a MATLAB function into C++, and this requires me to find determinate of a matrix. I was told that use of BOOST library would make my job easier. I went through the documentation of BOOST Library, but couldn't find much info about the same. If anyone could give a template for the above operation, It would be of lot of help and would be greatly appreciated. Thanks Regards

    Read the article

  • Using rowDiffs() to calculate difference in values in matrix

    - by user1723765
    I'm using the rowDiffs() command to calculate the step by step difference in 116 rows in a matrix. I get the following error: Error in r[i1] - r[-length(r):-(length(r) - lag + 1L)] : non-numeric argument to binary operator I have no idea why this is happening. I could take the diff() separately for each row and it would work. Any ideas? Here's the data: https://dl.dropbox.com/u/22681355/data.csv Code: a=rowDiffs(data)

    Read the article

  • RecursiveIterator: used to explode tree structure, or only flatten?

    - by Stephen J. Fuhry
    There are tons of examples of using the RecursiveIterator to flatten a tree structure.. but what about using it to explode a tree structure? Is there an elegant way to use this, or some other SPL library to recursively build a tree (read: turn a flat array into array of arbitrary depth) given a table like this: SELECT id, parent_id, name FROM my_tree EDIT: You know how you can do this with Directories? $it = new RecursiveDirectoryIterator("/var/www/images"); foreach(new RecursiveIteratorIterator($it) as $file) { echo $file . PHP_EOL; } .. What if you could do something like this: $it = new RecursiveParentChildIterator($result_array); foreach(new RecursiveIteratorIterator($it) as $group) { echo $group->name . PHP_EOL; echo implode(PHP_EOL, $group->getChildren()) . PHP_EOL . PHP_EOL; } :END EDIT

    Read the article

  • What is the most efficient way to determine if a directed graph is singly connected?

    - by zebraman
    I am working on an assignment where one of the problems asks to derive an algorithm to check if a directed graph G=(V,E) is singly connected (there is at most one simple path from u to v for all distinct vertices u,v of V. Of course you can brute force check it, which is what I'm doing right now, but I want to know if there's a more efficient way. Could anyone point me in the right direction?

    Read the article

  • ArrayList<String> NullPointerException

    - by Carlucho
    Am trying to solve a labyrinth by DFS, using adj List to represent the vertices and edges of the graph. In total there are 12 nodes (3 rows[A,B,C] * 4 cols[0,..,3]). My program starts by saving all the vertex labels (A0,..C3), so far so good, then checks the adjacent nodes, also no problems, if movement is possible, it proceeds to create the edge, here its where al goes wrong. adjList[i].add(vList[j].label); I used the debugger and found that vList[j].label is not null it contains a correct string (ie. "B1"). The only variables which show null are in adjList[i], which leads me to believe i have implemented it wrongly. this is how i did it. public class GraphList { private ArrayList<String>[] adjList; ... public GraphList(int vertexcount) { adjList = (ArrayList<String>[]) new ArrayList[vertexCount]; ... } ... public void addEdge(int i, int j) { adjList[i].add(vList[j].label); //NULLPOINTEREXCEPTION HERE } ... } I will really appreaciate if anyone can point me on the right track regrading to what its going wrong... Thanks!

    Read the article

  • A RecursiveParentChildIterator -- like the RecursiveDirectoryIterator

    - by Stephen J. Fuhry
    There are tons of examples of using the RecursiveIterator to flatten a tree structure.. but what about using it to explode a tree structure? Is there an elegant way to use this, or some other SPL library to recursively build a tree (read: turn a flat array into array of arbitrary depth) given a table like this: SELECT id, parent_id, name FROM my_tree EDIT: You know how you can do this with Directories? $it = new RecursiveDirectoryIterator("/var/www/images"); foreach(new RecursiveIteratorIterator($it) as $file) { echo $file . PHP_EOL; } .. What if you could do something like this: $it = new RecursiveParentChildIterator($result_array); foreach(new RecursiveIteratorIterator($it) as $group) { echo $group->name . PHP_EOL; // this would contain all of the children of this group, recursively $children = $group->getChildren(); } :END EDIT

    Read the article

  • Is this overly clever or unsafe?

    - by Liberalkid
    I was working on some code recently and decided to work on my operator overloading in c++, because I've never really implemented it before. So I overloaded the comparison operators for my matrix class using a compare function that returned 0 if LHS was less than RHS, 1 if LHS was greater than RHS and 2 if they were equal. Then I exploited the properties of logical not in c++ on integers, to get all of my compares in one line: inline bool Matrix::operator<(Matrix &RHS){ return ! (compare(*this,RHS)); } inline bool Matrix::operator>(Matrix &RHS){ return ! (compare((*this),RHS)-1); } inline bool Matrix::operator>=(Matrix &RHS){ return compare((*this),RHS); } inline bool Matrix::operator<=(Matrix &RHS){ return compare((*this),RHS)-1; } inline bool Matrix::operator!=(Matrix &RHS){ return compare((*this),RHS)-2; } inline bool Matrix::operator==(Matrix &RHS){ return !(compare((*this),RHS)-2); } Obviously I should be passing RHS as a const, I'm just probably not going to use this matrix class again and I didn't feel like writing another function that wasn't a reference to get the array index values solely for the comparator operation.

    Read the article

  • computing matting Laplacian matrix of an Image

    - by ajith
    hi everyone, i need to compute Laplacian Matrix-L for an image(nXn) in opencv...computing goes as follows.......... dij - 1/|wk|{[1+1/(e/|wk|+s2)][(Ii-µk)*(Ij -µk)]}.... for all(i,j)?wk,summing over k yields (i,j)th element of L. where Here dij is the Kronecker delta,µk and s2k are the mean & variance of intensities in the window wk around k,and |wk| is the number of pixels in this window.wk is 3X3 window... here am not clear about 2 things... 1.what ll be the size of L?nXn or (nXn)X(nXn)?? 2.how to select Ii and Ij separately in 2D image?

    Read the article

  • Vectorizatoin of index operation for a scipy.sparse matrix

    - by celil
    The following code runs too slowly even though everything seems to be vectorized. from numpy import * from scipy.sparse import * n = 100000; i = xrange(n); j = xrange(n); data = ones(n); A=csr_matrix((data,(i,j))); x = A[i,j] The problem seems to be that the indexing operation is implemented as a python function, and invoking A[i,j] results in the following profiling output 500033 function calls in 8.718 CPU seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function) 100000 7.933 0.000 8.156 0.000 csr.py:265(_get_single_element) 1 0.271 0.271 8.705 8.705 csr.py:177(__getitem__) (...) Namely, the python function _get_single_element gets called 100000 times which is really inefficient. Why isn't this implemented in pure C? Does anybody know of a way of getting around this limitation, and speeding up the above code? Should I be using a different sparse matrix type?

    Read the article

  • JAVA: Sort ArrayList<ArrayList<Integer>> on multiple columns

    - by Bob
    First, I did do my homework searching before posting here. My requirement seems to be slightly different compared to questions posted out there. I have a matrix like ArrayList<ArrayList<Integer>> in the following form | id1 | id2 | score | |-----|-----|-------| | 1 | 3 | 95% | | 1 | 2 | 100% | | 1 | 4 | 85% | | 1 | 5 | 95% | | 2 | 10 | 80% | | 2 | 15 | 99% | I want to sort the matrix column-wise (first using score, then the id1). I already have the id1 in a sorted manner. That means I also need to sort all records with the same id1 first by using score, second by the id2. The reason for doing this is to create a ranking of the id2 in each id1. The result for the above example would be: | q_id | d_id | rank | score | |------|------|------|-------| | 1 | 2 | 1 | 100% | | 1 | 3 | 2 | 95% | | 1 | 5 | 3 | 95% | | 1 | 4 | 4 | 85% | | 2 | 15 | 1 | 99% | | 2 | 10 | 2 | 80% | How can I achieve this in Java using some built-in methods of collections?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >