Re: [Tutor] [OT] Best Practices for Scientific Computing

2014-12-30 Thread Alan Gauld
On 29/12/14 23:50, Patti Scott wrote: Could someone clarify "Modularize code rather than copying and pasting?" Joel and Danny have given the basic answer in terms of putting loose code into functions. But it goes a little further too. You can be tempted to copy/paste functions because they alm

Re: [Tutor] [OT] Best Practices for Scientific Computing

2014-12-30 Thread Albert-Jan Roskam
- On Tue, Dec 30, 2014 12:34 PM CET Alan Gauld wrote: >On 29/12/14 23:50, Patti Scott wrote: >> Could someone clarify "Modularize code rather than copying and pasting?" > >Joel and Danny have given the basic answer in terms of putting >loose code into functions. But it

Re: [Tutor] Making Doubly Linked List with Less Lines of Code.

2014-12-30 Thread WolfRage
This is my most recent rendition of the code. It still needs to be improved. Below I am answering some questions that were posed. Also I think my code is currently wrong because I think the print_by functions are both printing the list the same way. Tomorrow I will fix this and improve the code

Re: [Tutor] Making Doubly Linked List with Less Lines of Code.

2014-12-30 Thread Danny Yoo
>> What are the _operations_ you want to support? Can you say more about >> this? > > I need to support lookups, no insertions or deletions are required. This > code will be used to quickly lookup nodes, and check for specific patterns > by checking the nodes values in either a row or column. As

Re: [Tutor] Making Doubly Linked List with Less Lines of Code.

2014-12-30 Thread wolfrage8...@gmail.com
On Tue, Dec 30, 2014 at 2:37 PM, Danny Yoo wrote: > If that's the case, then none of this requires linked list storage. > > Instead, we can represent this as a list of rows. Each row element > would be itself a list of tiles. In short, a matrix. See: > https://docs.python.org/2/faq/programming.

Re: [Tutor] Making Doubly Linked List with Less Lines of Code.

2014-12-30 Thread Alex Kleider
On 2014-12-30 14:40, wolfrage8...@gmail.com wrote: True, I could use a multidimensional list. And originally I was using I wanted the ability to quickly search across a row or up and down a column and so the added benefit of the linked list was that it simply requires me to access the next nod