Search Results

Search found 5101 results on 205 pages for 'expression trees'.

Page 93/205 | < Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >

  • Using Scala array from java

    - by Grégoire
    Hi I'm trying to use some library code written in scala from a java program. I have a function that returns an Array (a scala Array) and I thought it would be possible to do Tree[] = ScalaObject.myScalaFunction() But the I get this error : [error] found : scala.runtime.BoxedArray [error] required: org.grammaticalframework.Trees.Absyn.Tree[] What is the correct way to use a scala array in java ?

    Read the article

  • how to load json in separate method

    - by frosty
    I need to generate the playlist dynamically. What is the best way to extract the playlist so that the playlist json below is separated into a different method or variable. $f(videoid, "/swf/flowplayer-3.1.5.swf", { playlist: [ { url: videoUrl }, { url: '59483.flv', title: 'Palm trees and the sun' }, { url: '58192.flv', title: 'Happy feet in a car' }, { url: '63617.flv', title: 'People jogging' } ], wmode: 'opaque', plugins: { gatracker: { url: "/swf/flowplayer.analytics-3.1.5.swf", trackingMode: "Bridge", debug: false } } });

    Read the article

  • Separate specific #ifdef branches

    - by detly
    In short: I want to generate two different source trees from the current one, based only on one preprocessor macro being defined and another being undefined, with no other changes to the source. If you are interested, here is my story... In the beginning, my code was clean. Then we made a new product, and yea, it was better. But the code saw only the same peripheral devices, so we could keep the same code. Well, almost. There was one little condition that needed to be changed, so I added: #if defined(PRODUCT_A) condition = checkCat(); #elif defined(PRODUCT_B) condition = checkCat() && checkHat(); #endif ...to one and only one source file. In the general all-source-files-include-this header file, I had: #if !(defined(PRODUCT_A)||defined(PRODUCT_B)) #error "Don't make me replace you with a small shell script. RTFM." #endif ...so that people couldn't compile it unless they explicitly defined a product type. All was well. Oh... except that modifications were made, components changed, and since the new hardware worked better we could significantly re-write the control systems. Now when I look upon the face of the code, there are more than 60 separate areas delineated by either: #ifdef PRODUCT_A ... #else ... #endif ...or the same, but for PRODUCT_B. Or even: #if defined(PRODUCT_A) ... #elif defined(PRODUCT_B) ... #endif And of course, sometimes sanity took a longer holiday and: #ifdef PRODUCT_A ... #endif #ifdef PRODUCT_B ... #endif These conditions wrap anywhere from one to two hundred lines (you'd think that the last one could be done by switching header files, but the function names need to be the same). This is insane. I would be better off maintaining two separate product-based branches in the source repo and porting any common changes. I realise this now. Is there something that can generate the two different source trees I need, based only on PRODUCT_A being defined and PRODUCT_B being undefined (and vice-versa), without touching anything else (ie. no header inclusion, no macro expansion, etc)?

    Read the article

  • API for displaying graphs in a web app?

    - by Rosarch
    I have graphs (nodes/arcs) that I want to display to the user. I need to be able to capture the event of a user clicking on a node. Something like Google Charts API's Simple Org Chart would be great, but it looks like it only supports trees. What other service can I use? Or should I hack something ugly together using Google Charts?

    Read the article

  • Learning functional/clojure programming - practical excersises?

    - by Konrad Garus
    I'm learning functional programming with Clojure. What practical excersises can you recommend? Online repositories with solutions would be perfect. One idea I can think of is going through all the popular algorithms on sorting, trees, graphs etc. and implementing them in Clojure myself. While it could work, it may be pretty steep and I'm likely to do it inefficiently (compared to someone who knows what she's doing).

    Read the article

  • Efficient Array Storage for Binary Tree

    - by Sundararajan S
    We have to write the nodes of a binary tree to a file. What is the most space efficient way of writing a binary tree . We can store it in array format with parent in position 'i' and its childs in 2i,2i+1. But this will waste lot of space in case of sparse binary trees.

    Read the article

  • Longest common substring from more than two strings - Python

    - by Nicolas Noël
    Hi, I'm looking for a python library for finding the longest common substring from a set of python strings. I'have read that it exist to way to solve this problem : - one using suffix trees - the other using dynamic programming. The method implemented is not important. Otherwise, it is important to have a implementation that can be use for a set of strings and not only two strings Thanks,

    Read the article

  • How can I unattach an element from another element in the XAML tree?

    - by Edward Tanguay
    In my Silverlight application, I load all the images I need at application start and store them in a dictionary. Then as I need them I pick them out of the dictionary and attach them in XAML trees etc. However, I have the problem that if I attach an Image object to a Grid, then want to use that image again, it tells me: The image element is already a child of another element. How can I run through my dictionary and "detach all images from parent XAML elements"?

    Read the article

  • Algorithms behind FarmVille Game

    - by Vadi
    What are all the algorithms involved in Farmville game, specifically I am interested in drawing trees that has fruits based on user's activities. I am into a project which has a specific need to draw a tree-type image in SVG. I am not sure how to go about the algorithms to define the tree and based on certain business rules the leafs in the tree grows etc., I think you get the idea. Farmville is just an example I took to explain. Any help is greatly appreciated..

    Read the article

  • How to diff just the source files?

    - by Kimvais
    I have two almost similar source code trees, but do not have access to the source code repository so I am stuck with release packages that contain also test reports, documentation, binaries etc. the diff command only support --exclude, but I would like to do something like diff -wbur --include='*.c,*.h' tree1 tree2 I know that this question is somewhat related, but does not really address my issue. Bonus points for ignoring change blocks that are completely in C comments :)

    Read the article

  • How come Java doesn't accept my LinkedList in a Generic, but accepts its own?

    - by master chief
    For a class assignment, we can't use any of the languages bultin types, so I'm stuck with my own list. Anyway, here's the situation: public class CrazyStructure <T extends Comparable<? super T>> { MyLinkedList<MyTree<T>> trees; //error: type parameter MyTree is not within its bound } However: public class CrazyStructure <T extends Comparable<? super T>> { LinkedList<MyTree<T>> trees; } Works. MyTree impleements the Comparable interface, but MyLinkedList doesn't. However, Java's LinkedList doesn't implement it either, according to this. So what's the problem and how do I fix it? MyLinkedList: public class MyLinkedList<T extends Comparable<? super T>> { private class Node<T> { private Node<T> next; private T data; protected Node(); protected Node(final T value); } Node<T> firstNode; public MyLinkedList(); public MyLinkedList(T value); //calls node1.value.compareTo(node2.value) private int compareElements(final Node<T> node1, final Node<T> node2); public void insert(T value); public void remove(T value); } MyTree: public class LeftistTree<T extends Comparable<? super T>> implements Comparable { private class Node<T> { private Node<T> left, right; private T data; private int dist; protected Node(); protected Node(final T value); } private Node<T> root; public LeftistTree(); public LeftistTree(final T value); public Node getRoot(); //calls node1.value.compareTo(node2.value) private int compareElements(final Node node1, final Node node2); private Node<T> merge(Node node1, Node node2); public void insert(final T value); public T extractMin(); public int compareTo(final Object param); }

    Read the article

  • What good Computer Science Podcasts are out there

    - by Hannes de Jager
    I listen to several podcasts about technology like Java,PHP,Linux and then I listen to Software Engineering Radio to help me along with Software Architecture, but I need a good podcast on Computer Science concepts and advances, especially one that will cover data structures like Trees and Graphs and its applications. Anyone know of such a podcast?

    Read the article

  • are there any useful datasets available on the web for data mining?

    - by niko
    Hi, Does anyone know any good resource where example (real) data can be downloaded for experimenting statistics and machine learning techniques such as decision trees etc? Currently I am studying machine learning techniques and it would be very helpful to have real data for evaluating the accuracy of various tools. If anyone knows any good resource (perhaps csv, xls files or any other format) I would be very thankful for a suggestion.

    Read the article

  • OFF descriptions

    - by Myx
    Hi: I'd like to make a scene that uses meshes and primitives (such as spheres, cylinders, boxes, etc). I was wondering if there are any recommendations with regard to where I can go to find .off files that describes complex meshes, such as mountains, rocks, trees, animals, etc. Thanks.

    Read the article

  • Java: If I overwrite the .equals method, can I still test for reference equality with ==?

    - by shots fired
    I have the following situation: I need to sort trees based by height, so I made the Tree's comparable using the height attribute. However, I was also told to overwrite the equals and hashCode methods to avoid unpredictable behaviour. Still, sometimes I may want to compare the references of the roots or something along those lines using ==. Is that still possible or does the == comparison call the equals method?

    Read the article

< Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >