FAQ Database Discussion Community


How to exchange TList items during a for-loop

delphi,list-manipulation
I have a TList which' items are continuously processed by many for-loops. I sometimes need to exchange items in the list in order to rearrange the order of the visual representation of the list (in a StringGrid). How do I exchange these items? My preliminary thoughts are: During the for-loop...

How to replace a block matrix with a new one?

matlab,matrix,replace,list-manipulation
I have an image size 128*128, I divided into 32*32 non-overlapping blocks, the problem is that I want to change the values of a specific or choosing block (the first or the 3rd.. for example) and getting a block with new values then replace it in my image. Do you...

How to remove zeroes from list

python,python-3.x,list-manipulation
I am creating a program and at a point in the program i subtract two integers. This leaves me with this: [76499618373903541704700923371133789862262100000000000000000000000] What I want to know is if there is a built-in-function with the CPython Library that would remove a specific character from the list? Note: This list has...

Mathematica Dynamic List Design [closed]

dynamic,graphics,slider,wolfram-mathematica,list-manipulation
Suppose a dynamic list of 5 that if one changes, all the others would change correspondingly to keep the sum 1. It comes from a practical problem that 5 probabilities of a total of 1, if one of them changes (by Slider), all the others will also change in an...