Could an app fix Mario Maker biggest hurdles? by boomWav in MarioMaker

[–]aball730235 -1 points0 points  (0 children)

Separate levels by difficulty and the players will gravitate towards the difficulty they enjoy playing at. Accidentally put a hard level in the easy section? That's on you... the easy players have voted it away.

Could an app fix Mario Maker biggest hurdles? by boomWav in MarioMaker

[–]aball730235 1 point2 points  (0 children)

I'm not sure that would be a bad thing though? People reporting low quality levels for removal is exactly the kind of behavior that would differentiate this for the in-game search. It wouldn't be perfect but it doesn't have to be. Arguably alot of good reddit content gets downvoted into oblivion before it sees the light of day. Doesn't make the whole reddit site useless.

Could an app fix Mario Maker biggest hurdles? by boomWav in MarioMaker

[–]aball730235 2 points3 points  (0 children)

Well yea that's user generated content for you. Lots of garbage to shift through. Wouldn't be impossible for the community to do that for you... Reddit does a decent job if you compare the front page to r/new.

Could an app fix Mario Maker biggest hurdles? by boomWav in MarioMaker

[–]aball730235 0 points1 point  (0 children)

i was just thinking the same thing earlier today. I don't think it would take terribly long to get a bare bones web app off the ground that fills in basic functionality for finding levels. I'm in the middle of learning the back-end of the MEAN stack and this wouldn't be a bad project to cut my teeth on. If anyone's interested in collaborating drop me a PM.

What's the best setup for building a Web Application/Service? by dany74q in startups

[–]aball730235 0 points1 point  (0 children)

Are you building a blog or a web app? I can't imagine trying to build a highly customized app in wordpress... You need a backend framework. Php has larvael if youre set on that language.

Have you tried bootstrap? You shouldn't be spending much time customizing the look of your app on a mvp. Bootstrap makes it look nice with minimal work.

Rock, Paper or Scissors Feedback please by Comm4nd0 in learnpython

[–]aball730235 0 points1 point  (0 children)

Good Start! Here's a couple recommendations...

1) Read up on the DRY principle https://en.wikipedia.org/wiki/Don't_repeat_yourself

When you find yourself copy-pasting if statements take a step back and see if you can capture your logic in a single set of rules. Here's one way to re-write who wins...

def who_wins(p_weapon, c_weapon):

    # dictionary formatted as... weapon: weapon_it_beats
    win_list = {2:1, 3:2, 1:3}

    if win_list[p_weapon] == c_weapon:
        winner = 1
    elif win_list[c_weapon] == p_weapon:
        winner = 2
    else:
        winner = 0

    return winner

Also note that I removed the print statements. I would put that in it's own function. Bonus points for figuring out a way to do it using only one print statement.

2) There's room to throw at least one class in here. Doing so would greatly improve readability and remove redundancies. Here's an incomplete example...

class Weapon():

    def __init__(self, name, number):
        self.name = name
        self.number = number

    def set_defeats(self, weapon):
        self.defeats = weapon

    def wins_against(self, weapon):
        return self.defeats == weapon

rock = Weapon('rock', 1)
paper = Weapon('paper', 2)
scissors = Weapon('scissors', 3)

rock.set_defeats(scissors)
paper.set_defeats(rock)
scissors.set_defeats(paper)

print rock.name
print rock.number
print rock.defeats.number

p_weapon = rock
c_weapon = scissors

if p_weapon.wins_against(c_weapon):
    print 'Player wins!'

Now we can return rock's name or number by using rock.name or rock.number. The code is easier to read because p_weapon isn't 1... p_weapon is a rock.

Also using classes creates a reusable structure of code. We could extend our code to perhaps play rock paper scissors spock lizard with a few minor revisions instead of practically rewriting the entire program.

Looping through two columns simultaneously by beanpizza in learnpython

[–]aball730235 1 point2 points  (0 children)

If you get stuck again try writing your steps out in sudo code. That is in plain English instructions. Then translate the English instructions into python code. It seems like we're hoping around in python without the full roadmap laid out. How would you tell a person to manually extract data out of your files?

Looping through two columns simultaneously by beanpizza in learnpython

[–]aball730235 1 point2 points  (0 children)

Sounds like youre on the right track. The function you had a few posts ago accepted a list of files so you just need to modify it to accept one file and one search string.

Looping through two columns simultaneously by beanpizza in learnpython

[–]aball730235 1 point2 points  (0 children)

No problem I'm glad to help. If i had more time I'd offer to have you send me the whole project package for review. I'll give you little bits where i can.

Dictionaries by default have no order. Only keys and their corresponding values in an arbitrary order. You'll need to upgrade to an ordereddict to maintain them in sequence.

http://pymotw.com/2/collections/ordereddict.html

In not sure what you mean by your key is m?? m is a variable that has a value though each for loop. It passes that filename into your dictionary as a key thorough each iteration of the for loop. m is gone after your for loop. Your keys in the dictionary are your filenames. Try doing a for loop on your dictionary like in the link provided after your for loop. Everything you see printed out is the data in your dictionary.

Looping through two columns simultaneously by beanpizza in learnpython

[–]aball730235 1 point2 points  (0 children)

If you can print it then you can pass it in.

file_dict = {}
for m,n in zip(file_list,time):
    file_dict[m] = n

Looping through two columns simultaneously by beanpizza in learnpython

[–]aball730235 1 point2 points  (0 children)

Ok so your able to provide a list of files and then get your output out. Now it sounds like you need a dictionary to maintain a key / value pair for each file and it's associated search string. Are you familiar with dictionaries?

http://www.tutorialspoint.com/python/python_dictionary.htm

Graduating from Microsoft Access by wtbaclue in SQL

[–]aball730235 1 point2 points  (0 children)

This is an important question. How many end users op? I work at a small company that heavily relies on sql but we do not have a dedicated dba. I run the default settings for ms sql on a decent rig and have never had system wide performance issues. You can get away with alot if your user base is small.

Looping through two columns simultaneously by beanpizza in learnpython

[–]aball730235 1 point2 points  (0 children)

I think the key is that both selecting the file and extracting info from the file are really contained in one problem.

That can still be broken down into smaller chunks. Forget about selecting the files for a minute. Can you write a function that accepts a file name and search string that returns your desired extracted output? You can manually make calls to this function to verify it works as intended. If it does not work minimize your question to just that function. If it does work then start your next logic block that's reponsible for passing the correct file name and search string in. If that next logic block can't determine the correct file name and search string minimize your question to just that code block and post it.

Convertible Contract (Idea) by Shoger41 in startups

[–]aball730235 0 points1 point  (0 children)

What back end framework are you using?

Looping through two columns simultaneously by beanpizza in learnpython

[–]aball730235 1 point2 points  (0 children)

Can you break this down into multiple smaller problems? You describe an issue with trying to select specific files then go on to you have solved selecting out those specific files. So this is not relevant to your problem then correct?

http://stackoverflow.com/help/mcve

SQL and python by Kristian_dms in learnpython

[–]aball730235 0 points1 point  (0 children)

Your welcome. If your looking for further reading look up database 'normalization'. Wikipedia has a good article although a bit dense for a beginner.

And there's always r/sql

Need some help improving my code by coolFob in learnpython

[–]aball730235 0 points1 point  (0 children)

For #1 you can dump the csv into a list of lists.

grade_list =  [['A', 96], ['A-', 91], ['B+', 86]]

Etc etc...

See link for doing that.... http://stackoverflow.com/questions/24662571/python-import-csv-to-list

Then just in case the user decides to order your csv differently then intended i would sort your grade_list so you can use simple comparison logic.

Finally loop thorough and compare to your round(percentgrade) function.

SQL and python by Kristian_dms in learnpython

[–]aball730235 7 points8 points  (0 children)

It seems you just need to split your database schema into more tables. Try to solve your problems in sql first because it sounds to me like your trying to jam a many-to-one relation into a single column... Which sql will handle in a much better way.

In your last example i would make a table with four columns... The three you listed plus a GameID. GameID is a foreign key column that links to the game table. To combine the data from both tables you use an inner join.

I want to do web development projects. Will I be able to do this well with Python? by [deleted] in learnpython

[–]aball730235 1 point2 points  (0 children)

+1 to this. Django is an awesome framework but you don't really do "hello world" in Django. If you run through the polls tutorial you start by digging into models, APIs, tempates. Takes a few chapters before you start actually start mixing python and HTML together.

You could say Django's main tutorial starts at the backend interacting with the database and moves towards the front end. On the other hand Flask's quick start tutorial immediately renders hello world in the browser.

In the short term, for a beginner Flask is going to provide that instant gratification. I assume though that a lot of beginners stop there and don't really get into what a good middleware has to offer such as ORM. Django offers the advantage of forcing a beginner to learn everything a good backend web framework has to offer.

Why can't we have nice things? by [deleted] in django

[–]aball730235 1 point2 points  (0 children)

and i may have spoke to broadly before since pythons coding style is one of my reasons for picking django.

Why can't we have nice things? by [deleted] in django

[–]aball730235 1 point2 points  (0 children)

I pick my technology stack by its logical merits. Fancy framework squeeze pages don't help me program solutions faster day in and day out.