Search Results

Search found 3908 results on 157 pages for 'terms'.

Page 59/157 | < Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >

  • How to implement a simple auto-complete functionality?

    - by Kaarel
    I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be: void add(String) void remove(String) String complete(String) What's the best way to do this in terms of algorithms and data-structures?

    Read the article

  • HTML5 Canvas + select / drag-and-drop features in a JS lib?

    - by István
    Hi, I'd like to use HTML5 Canvas, but I'd like to use it in terms of shapes, texts and curves, able to attach traditional DOM events like onClick or drag-and-drop functions. Is there any Javascript library that is able to do that for me? I've seen that gwt-canvas is close to this approach, but haven't looked it in details. Thanks, Istvan

    Read the article

  • Sorting a list of numbers with modified cost

    - by David
    First, this was one of the four problems we had to solve in a project last year and I couldn’t find a suitable algorithm so we handle in a brute force solution. Problem: The numbers are in a list that is not sorted and supports only one type of operation. The operation is defined as follows: Given a position i and a position j the operation moves the number at position i to position j without altering the relative order of the other numbers. If i j, the positions of the numbers between positions j and i - 1 increment by 1, otherwise if i < j the positions of the numbers between positions i+1 and j decreases by 1. This operation requires i steps to find a number to move and j steps to locate the position to which you want to move it. Then the number of steps required to move a number of position i to position j is i+j. We need to design an algorithm that given a list of numbers, determine the optimal (in terms of cost) sequence of moves to rearrange the sequence. Attempts: Part of our investigation was around NP-Completeness, we make it a decision problem and try to find a suitable transformation to any of the problems listed in Garey and Johnson’s book: Computers and Intractability with no results. There is also no direct reference (from our point of view) to this kind of variation in Donald E. Knuth’s book: The art of Computer Programing Vol. 3 Sorting and Searching. We also analyzed algorithms to sort linked lists but none of them gives a good idea to find de optimal sequence of movements. Note that the idea is not to find an algorithm that orders the sequence, but one to tell me the optimal sequence of movements in terms of cost that organizes the sequence, you can make a copy and sort it to analyze the final position of the elements if you want, in fact we may assume that the list contains the numbers from 1 to n, so we know where we want to put each number, we are just concerned with minimizing the total cost of the steps. We tested several greedy approaches but all of them failed, divide and conquer sorting algorithms can’t be used because they swap with no cost portions of the list and our dynamic programing approaches had to consider many cases. The brute force recursive algorithm takes all the possible combinations of movements from i to j and then again all the possible moments of the rest of the element’s, at the end it returns the sequence with less total cost that sorted the list, as you can imagine the cost of this algorithm is brutal and makes it impracticable for more than 8 elements. Our observations: n movements is not necessarily cheaper than n+1 movements (unlike swaps in arrays that are O(1)). There are basically two ways of moving one element from position i to j: one is to move it directly and the other is to move other elements around i in a way that it reaches the position j. At most you make n-1 movements (the untouched element reaches its position alone). If it is the optimal sequence of movements then you didn’t move the same element twice.

    Read the article

  • Best way to store a database password in a startup script / config file?

    - by Mark Harrison
    So our web server apps need to connect to the database, and some other apps have startup scripts that execute at boot time. What's the best way to store the name/password for these applications, in terms of security, e.g. perhaps we don't want sysadmins to know the database password maintainability, e.g. making the configuration easy to change when the password changes, etc. both windows and linux solutions appreciated!

    Read the article

  • Correct term for PSD to HTML to CMS

    - by John Magnolia
    Hi, I have heard a lot of different terms to describe the process of turning a website design into a editable CMS. Currently I take the design and "slice" this up into HTML and CSS then I "plug" this into a CMS. I would class this as frontend development depending on the level of customisation required for the CMS. The reason I ask is I am currently writing up my CV and have become stuck on the correct term for this. Kind Regards

    Read the article

  • Enterprise Library Review?

    Hi, Is enterprise library for exception handling and logging efficient in terms of its memory usage for the functionality provided? What are the pros and cons? Thanks

    Read the article

  • Android device guidelines/requirements

    - by Ravi Vyas
    Are there any requirements/guidelines for an Android device? like numbers of buttons or minimum buttons required. Also are there any android devices which do not have the menu and back buttons? ( I am aware that no menu/back buttons will kill most of the apps in terms of usability , I just wanted to know more on the topic :-) )

    Read the article

  • GUI options for emulator c++

    - by dbomb101
    I want to create a Gameboy emulator which runs directly from the exe file, in a similar fashion to visualboy advance. I was wondering in terms of creating a GUI interface for the emulator what would be the best option to accomplish this ?

    Read the article

  • Java array of arry [matrix] of an integer partition with fixed term

    - by user335209
    Hello, for my study purpose I need to build an array of array filled with the partitions of an integer with fixed term. That is given an integer, suppose 10 and given the fixed number of terms, suppose 5 I need to populate an array like this 10 0 0 0 0 9 0 0 0 1 8 0 0 0 2 7 0 0 0 3 ............ 9 0 0 1 0 8 0 0 1 1 ............. 7 0 1 1 0 6 0 1 1 1 ............ ........... 0 6 1 1 1 ............. 0 0 0 0 10 am pretty new to Java and am getting confused with all the for loops. Right now my code can do the partition of the integer but unfortunately it is not with fixed term public class Partition { private static int[] riga; private static void printPartition(int[] p, int n) { for (int i= 0; i < n; i++) System.out.print(p[i]+" "); System.out.println(); } private static void partition(int[] p, int n, int m, int i) { if (n == 0) printPartition(p, i); else for (int k= m; k > 0; k--) { p[i]= k; partition(p, n-k, n-k, i+1); } } public static void main(String[] args) { riga = new int[6]; for(int i = 0; i<riga.length; i++){ riga[i] = 0; } partition(riga, 6, 1, 0); } } the output I get it from is like this: 1 5 1 4 1 1 3 2 1 3 1 1 1 2 3 1 2 2 1 1 2 1 2 1 2 1 1 1 what i'm actually trying to understand how to proceed is to have it with a fixed terms which would be the columns of my array. So, am stuck with trying to get a way to make it less dynamic. Any help?

    Read the article

  • JQuery UI: is it possible to know where an object has been dropped?

    - by Jack Duluoz
    Hi, what I want to do is to know where (not in terms of position (x, y), but a reference to the DOM element) an object was dropped. I have a grid made up with divs where you can drop various items and I need to know which div on the grid was the item dropped on (getting its id would be fine). The callback function function(event, ui) { //code here } has just that ui object who doesn't apparently contain any information about this, but only about the draggable item or its helper.

    Read the article

  • WPF PIXELS DPI RESOLUTION

    - by Akshay
    I am reading a book on WPF.As with all books, it gives an introduction on the problems the earlier display systems had with them.He refers to terms such as DPI, Pixels, Resolution etc.Is there any place where I can learn about them and about how they are related to each other ?

    Read the article

  • C++ Expression Templates

    - by yCalleecharan
    Hi, I currently use C for numerical computations. I've heard that using C++ Expression Templates is better for scientific computing. What are C++ Expression Templates in simple terms? Are there books around that discuss numerical methods/computations using C++ Expression Templates? In what way, C++ Expression Templates are better than using pure C? Thanks a lot

    Read the article

  • Collecting IO outputs into list

    - by sisif
    how can i do multiple calls to SDL.pollEvent :: IO Event until the output is SDL.NoEvent and collect all the results into a list? in imperative terms something like this: events = [] event = SDL.pollEvent; while( event != SDL.NoEvent ) events.add( event ) event = SDL.pollEvent

    Read the article

  • MSSQL SQL Building Software

    - by TheGambler
    What are the option in terms of applications that help build SQL statements against a MSSQL database? We have some users that need to build sql statements, perferably through drag and dropping or linking up tables etc.., against a MSSQL databse who don't have any experience in this area. Any Ideas?

    Read the article

  • Speech recognition webservice that scores the accuracy of one audio clips vs. another?

    - by wgpubs
    Does such a thing exist? Building a Rails based web application where users can upload an audio file of them speaking that then needs to be compared to another audio file for the purposes of determining how similar to voices are. Ideally I'd like to simply get a response that gives me a score of how similar they are in terms of percentage (e.g. 75% similar etc...). Anyone have any ideas? Thanks

    Read the article

  • Monad in plain English? (For the OOP programmer with no FP background)

    - by fig-gnuton
    In terms that an OOP programmer would understand (without any functional programming background), what is a monad? What problem does it solve and what are the most common places it's used? EDIT: To clarify the kind of understanding I was looking for, let's say you were converting an FP application that had monads into an OOP application. What would you do to port the responsibilities of the monads into the OOP app?

    Read the article

  • In an iPhone app, is it beneficial to tile a background image that has a pattern in it?

    - by Dr Dork
    Here's an example of the type of background image I'm talking about, the iPhone Notes app... Clearly, there's a pattern in it. My question is, if this were an iPad app and the background image was twice the size, would there be any significant benefits to taking advantage of this pattern by tiling the image? Or would it really make no difference in terms of performance and just be easier to load the entire image into a UIImageView? Thanks in advance for all your wisdom!

    Read the article

  • How does timezone really work in relation to PHP and MYSQL?

    - by Rick
    I am getting very strange results in terms of timezones. I am currently using Wordpress and everytime I register a new user, I see the wrong datetime in the database. Ok so I am suspecting it is picking up the server time. So then I then set in php.ini to have date.timezone = "America/Los_Angeles" but again the time is still not correct in the database...And yes I have also set the timezone in Wordpress correctly. So how can this be done?

    Read the article

  • For a Chemical Equation Balancer App (Android), how do I count the number of atoms of each element in each term?

    - by Upas
    This is my app: If someone enters "C6H12O6+O2=CO2+H2O", then I have already written code to split the equation into terms, so in an ArrayList called rterms I have the strings: C6H12O6 CO2 and in another ArrayList called pterms, I have: CO2 H2O I need to count the number of C's in each term of the reactants, so 6 for term 1, 0 for term 2, and then the H's and then O's. How would I do this? Any help is appreciated.

    Read the article

  • http handlers and modules: what's a good example of a problem they solve?

    - by jcollum
    I got this in an interview question -- the question was more about what they do, which I didn't know beyond very vague terms. But after reading about them I'm still no closer to an understanding of what problems I would solve with an HttpHandler or HttpModule. I've worked a fair amount in ASP.NET but it's been a few years -- is this a large gap in my knowledge? Something that's been replaced by more current technology?

    Read the article

< Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >