Generate random item from list Excel 2003

I have a list of names in cells A1:A100, and I'm looking for a formula to enter into a cell that will select a random name from that range. I have spent much time searching to no avail, all solutions seem to be derived from the RANDBETWEEN function which is not part of Excel 2003, but only newer versions. This seems like a very common thing to want to do so I'm really surprised there is no easy-to-find solution. Help is much appreciated =)...Read more

Elisp: how to find list duplicates

I am using this to find list duplicates:(defun have-dups (x) (let ((dups (copy-tree x))) (if (eq (length (delete-dups dups)) (length x)) nil t)))(have-dups (list 1 2 3 3)) ;=> t(have-dups (list 1 2 3)) ;=> nil Considering the overhead of copy-tree and delete-dups, probably there is a better way....Read more

recursion - Recurrence relationship for an array-implementation of a list

I was asked this question recently and got stumped.Fill in the blanks to write a recurrence relation called RecSearch find a specific value x in a list of size n. You may assume that the list in held in an array called A. Efficiency is not a concern. You must use recursion. The function should return an index (position) of the desired item. Do not make any assumptions about the nature of the list.RecSearch(A,n,x) = _____ if _____ = _____ // _____ >= 1 (indexing from 1, but can also index from zero)RecSearch(A,n,x) = ...Read more

Build dynamic closure list from a list in order to pass it to OrderBy in Groovy

I am following this article to set the Order for sorting.Excerpt from above articleclass Language { String name boolean dynamic String toString() { "name: $name, dynamic: $dynamic" }}def languages = [ new Language(name: 'Groovy', dynamic: true), new Language(name: 'Java', dynamic: false), new Language(name: 'Clojure', dynamic: true)]def list = ['name', 'dynamic']sh = new GroovyShell()closure = sh.evaluate("{ }")def cList = list.collect { closure(it) }println cList// We order first on dynamic property and then name property.de...Read more

How to write an "indefinitly expanding list" in CodenameOne?

I have a list of items, that contains an list of objects of its own type. Something like this:class MyObject { List<MyObject>}This Object can inhibit itself indefinitly deep. That means, Its structure could be similar to this:Object1 [ Object1.1 [ Object1.1.1 [ ... Object1.1.1....n [] ] ]]Object2 ......Objectn(Notice: this is not a structure that I created, neither do I like it, but my company said, that I need to handle this design in mobile as well)So I imagined, that I could try to pack these into a list of objec...Read more

codenameone - Why is the List in Codename one not showing all entries if there are many?

I developed my own list in codename one with two possible entry types and two different renderer (one for each type of entry).I entered some hard-coded dummy entries into that listIf I start the app in the simulator, all the dummy entries are shown correctly, but once I download the app onto my phone for testing purpose, I can't scroll down the whole list, but only like 20 entries (While the 'scroll bar' on the left of the list looks like it went down the whole list).What could be the problem?ps: As I don't use the GUIBuilder, the files are pre...Read more

image and spanlabel render default output in List [CodenameOne]

I took one blank container and add ImageViewer & Spanlabel. Same is render in list but it shows me default output (which i put for test). I Try both ways dynamic and manual still output is same. Even i try to work with Multi-List but it not taking renderer.Here is My code : ArrayList<Map<String, Object>> a = new ArrayList<Map<String, Object>>(); HashMap<String, Object> m = new HashMap<String, Object>(); Image image=fetchResourceFile().getImage("puzzle_icon.png"); m.put("gSR_image", image); ...Read more

list - Horizontal stretching in ListRenderer

I have a list that should display 7 items that each look like this:Date Weekday Distance TimeLong text that may span many linestwo column text Distance Timetwo column text Distance Timetwo column text Distance TimeThe last lines repeat in a number depending on the data, i e there may be different amounts of such lines for each list item.I have tried implementing this with a ListCellRenderer that creates a table according to the requirements above, but I have a few problems with it:The long text tha...Read more

checkbox - All checkboxes are get selected in List instead of only clicked one in codename one

I have created my own Renderer class and I am doing something likeMyClass extends Container implements ListCellRendererI added some TextAreas Labels with CheckBox into this class..and setting this as a renderer to "List"So my code for initListModel is:@Overrideprotected boolean initListModelReceiptLineList(List cmp) { cmp.setRenderer(new RendererPOReceiptList(receiptLineList)); //valid data in receiptLineList cmp.setModel(new DefaultListModel(receiptLineList)); return true;}Everything is running fine, even data are also set in label...Read more

codename one - no way to set background image in list

I am new to codename one and I have tried for one and half day to fix my issue of,a list with background image in each row.Let me explain, I am having a list with some items(entries), I created renderer and name it appropriately. I set background correctly which is reflecting in designer (see image)but when I run it on simulator/device , all formatting and designs are just invisible..!! (see red arrow pointing to simulator in image)anyone have any idea ? why this is happening ?Thanks,Akash...Read more

list - display all logos on a page or map

I'm trying to find a way to display a list of 500+ logos from 500+ url's.I want to make a global map of all companies with their respective logos that's i have coming from a url http://www.xxxxxx/wp-content/uploads/QOPIUS.pngThe results could be like thisImage example from mediumI've tried some BI tools like Tableau or MS Report but none of them is doing the job to make a map and manually this weird.If any ideas from there, you are welcome.Thx....Read more

unity3d - Unity Iterate over a list to sort by the number value

I have a text file called highscore.txt and I know the format of the data going into the file which works in the following way:Username:scoreI then need to search through the whole file to see where the new score needs to be added such that the file is in order of score from largest to smallest List<string> tempoaryList = new List<string>(); List<int> valueList = new List<int>(); string lineValues = ""; using (StreamReader sr = new StreamReader(finalPath)) { while (sr.EndOfStream == false) { ...Read more

Pass all the elements of a list through a functions

I created a python program that arranges and finds the median of a series of numbers a user inputs. I keep getting this error.Traceback (most recent call last): File "C:/Users/NL-LP3/Desktop/Corses/Python/Tests Programs/median user input.py", line 24, in median(^series)TypeError: median() takes 1 positional argument but 4 were given series=[] finished = False while not finished: number = input("Please enter a number, when you are done hit ENTER") if len(number)>0: series.append([number]) p...Read more

How to sort list of string by n-grams in python

Hi i want to sort list of string accodring to descending order of n-grams.Suppose following is my list["sedan", "sail sedan", "sail", "price of", "price", "of chevrolet", "of", "chevrolet sail", "chevrolet"]I want output ["price of", "of chevrolet", "chevrolet sail", "sail sedan", "sedan", "sail", "price", "of", "chevrolet"]Note : There is no validation for alphabetically order....Read more