Two Plus Two Publishing LLC Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > >

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old 05-16-2017, 11:17 AM   #1
Daer
Carpal \'Tunnel
 
Daer's Avatar
 
Join Date: May 2007
Location: A real rainbow likening luck stop
Posts: 16,640
Looking for help on where to start

I know zero programming so I'm going to explain what I want to do and hopefully you guys can give me some ideas on what I need to learn to accomplish this.

So I have a master list of items (say 10k). This list is made up of sublists (say 100) of anywhere from 40 to 800 items. The order of items in the lists is important. I want users to be able to select 3-5 sublists and output a list of those 3-5 sublists in the correct order. An individual item might appear on multiple sublists but would only be outputted once.

Example:

Master List:

Ram 1
Ram 2

Chevy 1

Lion 1

Apple 1
Apple 2

Ram 3

Orange 1
Orange 2
Orange 3

Chevy 2

Dodge 1

Shark 1
Shark 2

Sublists are:

Cars, Fruits, and Animals

CarsFruitAnimals
Ram 1Apple 1Ram 1
Ram 2Apple 2Ram 2
Chevy 1Orange 1Lion 1
Ram 3Orange 2Ram 3
Chevy 2Orange 3Shark 1
Dodge 1 Shark 2

So then a user selects Cars and Animals and they would get a list like this:


Ram 1
Ram 2

Chevy 1

Lion 1

Ram 3

Chevy 2

Dodge 1

Shark 1
Shark 2

Outputting the list similar to the above, with spaces between different items but not the same items with different numbering is important too but I guess that just depends on how you format the final result.

=========================================

Now having no idea how to do this my thought would be to make a database of the master list, marking each item with whatever sublists they would show up in and giving each item a number to sort them in the master list. So keeping with the above example:

Item NameOrderSublist
Ram 100010Cars, Animals
Ram 200020Cars, Animals
Chevy 100030Cars
Lion 100040Animals
Apple 100050Fruit
Apple 200060Fruit
Ram 300070Cars, Animals

Another thing is sometimes an item might have its position changed or 100 items might be added into a list, hence the space between the order numbers. Chevy 1 might switch to after Apple 1, I would just change the Order # for Chevy 1 to 00051 to put it after Apple 1. Or five items would be added between Apple 2 and Ram 3, I would give them order #s of 00061, 00062, etc.

So basically what I'm wondering is if I'm on the right track at all and what do I need to learn to accomplish it?

Last edited by Daer; 05-16-2017 at 11:24 AM.
Daer is offline   Reply With Quote
Old 05-16-2017, 01:12 PM   #2
just_grindin
Pooh-Bah
 
Join Date: Dec 2007
Posts: 4,342
Re: Looking for help on where to start

My first thought would be to avoid keeping a master list and just generate it on demand from the sublists. So keeping a table for each sublists and just putting them together as needed.

Sent from my SM-G900R4 using Tapatalk
just_grindin is offline   Reply With Quote
Old 05-17-2017, 09:53 PM   #3
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 12,348
Re: Looking for help on where to start

You almost certainly want a database, as you guessed. I imagine you wouldn't need to learn anything other than the database's SQL. Maybe some Excel would be useful for transforming the original master list in to suitable INSERT INTO statements. I recommend Postgresql. Their documentation is really really good, it is powerful and free.
_dave_ is offline   Reply With Quote
Old 05-22-2017, 11:53 PM   #4
ZManODS
adept
 
Join Date: Jan 2003
Location: Bay Area
Posts: 1,006
Re: Looking for help on where to start

I don't understand the original question of "where to start". Are you asking "who can build this for me"? Do you have any programming background?
ZManODS is offline   Reply With Quote
Old 06-08-2017, 07:40 AM   #5
maxmax99
stranger
 
Join Date: Jun 2017
Posts: 3
Re: Looking for help on where to start

He told that he knows zero programming...so the best solution is to find somebody who can help you with that. With SQL it could be easier but if you don't know it at all...even with W3school it won't help you
maxmax99 is offline   Reply With Quote
Old 06-10-2017, 06:58 AM   #6
vento
journeyman
 
Join Date: Mar 2009
Posts: 306
Re: Looking for help on where to start

I would say learn SQL basics in a day or in a few hours
The basics syntax is really simple SELECT 'somecolumns' FROM 'some_table'

There is application called SQLite, with user interface so you can get your db or test database for learning up in a short time. Best thing is that you can use the user interface it offers.

next step would be how to add data or query data with programming
learn some basics of PYTHON, to understand the very basics takes couple of days
(search 'learn the python hard way). Python has a good library called pandas which you can use to modify your data for example but using libraries is not really required .

then you just establish connection and add data or make queries (below adds data)
conn = sqlite3.connect('yourdbname.db')
query = "INSERT * INTO test';"

somename.to_sql(query, con=conn, if_exists='replace')


Best thing with installing sqlite and creating test database is that youre half a way there already and by breaking the project into smaller pieces (mainly creating the database and other part how to get data out and use it)you can feel you are making progress rather than just trying to code hoping that it will work when you run it.

You can even use excel with SQLite. Havent tried it personally. If you have it at workplace you can try MS access instead of sqlite. Not sure if you should use vba and how to print/format the output (depending how large you are planning to grow your db check possible limitations each tool may have. I only used SQLite with a few tables with 20-30k rows)

It was long time ago I used python and SQLite so cant really comment more on code. the piece of code I posted was from simple code I did 2 years ago.

just think the way that you need a database and you need a way to add data and get data from there. start with creating test database and then look at options how to query data from there and what tool you want to use. Some other posters could perhaps comment if they agree with this approach I suggest in last paragraph in order to get you started.

Last edited by vento; 06-10-2017 at 07:25 AM.
vento is offline   Reply With Quote
Old 06-10-2017, 07:37 AM   #7
vento
journeyman
 
Join Date: Mar 2009
Posts: 306
Re: Looking for help on where to start

Cant edit my post.

One additional thing on top of creating db and learning how to get data in / out, is how to design the database.

*CREATE TEST DATABASE
*FIND TOOL TO Add AND GET DATA FROM THERE
*LOOK AT HOW TO DESIGN YOUR DATABASE BASED ON YOUR NEEDS and VERIFY THAT TOOLS/DESIGN WILL MEET YOUR DEMANDS
vento is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Forum Jump


All times are GMT -4. The time now is 02:09 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © 2008-2017, Two Plus Two Interactive
 
 
Poker Players - Streaming Live Online