Search Results

Search found 34 results on 2 pages for 'ender'.

Page 2/2 | < Previous Page | 1 2 

  • Convert byte array to understandable String

    - by Ender
    I have a program that handles byte arrays in Java, and now I would like to write this into a XML file. However, I am unsure as to how I can convert the following byte array into a sensible String to write to a file. Assuming that it was Unicode characters I attempted the following code: String temp = new String(encodedBytes, "UTF-8"); Only to have the debugger show that the encodedBytes contain "\ufffd\ufffd ^\ufffd\ufffd-m\ufffd\ufffd\/ufffd \ufffd\ufffdIA\ufffd\ufffd". The String should contain a hash in alphanumerical format. How would I turn the above String into a sensible String for output?

    Read the article

  • how to return a list using SwingWorker

    - by Ender
    I have an assignment where i have to create an Image Gallery which uses a SwingWorker to load the images froma a file, once the image is load you can flip threw the image and have a slideshow play. I am having trouble getting the list of loaded images using SwingWorker. This is what happens in the background it just publishes the results to a TextArea // In a thread @Override public List<Image> doInBackground() { List<Image> images = new ArrayList<Image>(); for (File filename : filenames) { try { //File file = new File(filename); System.out.println("Attempting to add: " + filename.getAbsolutePath()); images.add(ImageIO.read(filename)); publish("Loaded " + filename); System.out.println("Added file" + filename.getAbsolutePath()); } catch (IOException ioe) { publish("Error loading " + filename); } } return images; } } when it is done I just insert the images in a List<Image> and that is all it does. // In the EDT @Override protected void done() { try { for (Image image : get()) { list.add(image); } } catch (Exception e) { } } Also I created an method that returns the list called getImages() what I need to get is the list from getImages() but doesn't seam to work when I call execute() for example MySwingWorkerClass swingworker = new MySwingWorkerClass(log,list,filenames); swingworker.execute(); imageList = swingworker.getImage() Once it reaches the imageList it doesn't return anything the only way I was able to get the list was when i used the run() instead of the execute() is there another way to get the list or is the run() method the only way?. or perhaps i am not understanding the Swing Worker Class.

    Read the article

  • C# BinarySearch breaks when inheriting from something that implements IComparable<T>?

    - by Ender
    In .NET the BinarySearch algorithm (in Lists, Arrays, etc.) appears to fail if the items you are trying to search inherit from an IComparable instead of implementing it directly: List<B> foo = new List<B>(); // B inherits from A, which implements IComparable<A> foo.Add(new B()); foo.BinarySearch(new B()); // InvalidOperationException, "Failed to compare two elements in the array." Where: public abstract class A : IComparable<A> { public int x; public int CompareTo(A other) { return x.CompareTo(other.x); } } public class B : A {} Is there a way around this? Implementing CompareTo(B other) in class B doesn't seem to work.

    Read the article

  • How many indexes will actually get used?

    - by Ender
    I'm writing a page that does very simple search queries, resulting in something like: SELECT * FROM my_table WHERE A in (a1, a2, a3) AND B in (b1, b2) AND C in (c1, c2, c3, c4) AND And so on for a variable number of columns, usually ~5. If I create a separate index for each column (one for A, one for B, one for C, not (A,B,C)), will all of them be used in the above query?

    Read the article

  • What Programming Book would you NOT recommend to Developers?

    - by Ender
    Like a lot of people on Stack Overflow I love to read books about programming, almost as much as I love to read the lists that people add onto their websites, Blog's and this very website. However, for every gem there are a thousand turds, and to one developer a gem could just be a shiny turd to another. Whilst there are hundreds of book questions on this website asking users to recommend books that they have loved I have decided (after looking for a similar question and not finding it) to create a list of books that users have detested. After all, if we're going to fork out money for these books it'd be a good idea to get both positive and negative aspects out there. Please refer to a specific book, and with it add an image of either the latest version or the version you have read. Also, if you have the time please comment on the answers to provide your experiences with the books.

    Read the article

  • Would you work for an "Adult" Company?

    - by Ender
    Although I try to distance myself from web-oriented work nowadays (unless I need the money) I've received a number of emails from clients wishing for me to help design and develop online solutions for adult websites. Hell, when I was 17 I was asked to help design an adult website that I would not legally be able to view. After talking to a few Software Engineers and Flash Developers I have heard that there is a lot of interesting work in the adult industry for those who like to work with new technologies. Have any of you worked for a company dealing with adult/pornographic content? Did you enjoy it? If you haven't would you ever consider it? More than anything I find it interesting to see how others would view the offer, whether you would be afraid to list it on a CV/Resume, how interesting the work would be, how you think future employees would see you and whether you believe that they would judge you for working in a dirty industry.

    Read the article

  • Require help with program for edutainment game

    - by Ender
    I am working on a factorisation problem and for small numbers it is working well. I've been able to calculate the factors (getting the answers from Wolfram Alpha) for small numbers, like the one on the Wikipedia page (5959). Along with the Wikipedia page I have been following this guide. Once again, as my Math knowledge is pretty poor I cannot follow what I need to do next. EDIT: It finally works! I'll post the working code up here once I've got it fully working so that others in my predicament can learn from it.

    Read the article

  • "Make" system for Actionscript?

    - by Ender
    In working on larger Actionscript/Flash projects, I've started to really feel the need for some kind of "make" system, but I haven't found it yet. Does anyone know if it exists? Required features: Ability to associate SWCs with their source code and/or FLAs i.e. "this swc is compiled from this source" Ability to mark my current project as depending on these SWCs (either as compile-time or runtime libraries) A single, big shiny button, that when pressed does the following: Checks to see if any of the source files have changed, and if so, recompiles their associated SWCs Recompiles and relinks the main .swf, if necessary Runs the main .swf Have yet to find a way to get something like FlashDevelop to do this (but I don't know it well enough to be sure). Support for both code and FLA sources is preferred.

    Read the article

< Previous Page | 1 2