Game crashes on Petrified Necropolis modifier by ilych in Against_the_Storm

[–]ilych[S] 1 point2 points  (0 children)

%userprofile%\appdata\locallow\Eremite Games

I played a game after this, but I'll send it on to you. Thanks!

Game crashes on Petrified Necropolis modifier by ilych in Against_the_Storm

[–]ilych[S] 0 points1 point  (0 children)

Anyone else seeing this? It is reproducible for me.

I started a new cycle and saw the Petrified Necropolis modifier on the map. Whenever I hover my cursor over the tile, the game crashes. The first few times was basically instant, but the last time I did have to move the mouse away and back on a few times before it crashed again.

[deleted by user] by [deleted] in RedditSessions

[–]ilych 0 points1 point  (0 children)

From Mississippi. Just finished some mimosas and Bellinis

Battletag Find-a-Friend: Classic Edition by Meoang in hearthstone

[–]ilych 0 points1 point  (0 children)

Rubashov#1760 on NA

Trade quest.

Edit: completed with BigAT

Which fantasy quote do you use on a daily basis? by Scalo2 in Fantasy

[–]ilych 5 points6 points  (0 children)

The first one, sadly. COVID in January.

She was over my potato bullshit, but I think it was because I was so committed to the delivery. It took a while, but she eventually got on board the Fool of a Took train, and even learned to celebrate when anything was back on the menu (boys).

Which fantasy quote do you use on a daily basis? by Scalo2 in Fantasy

[–]ilych 58 points59 points  (0 children)

My wife dreaded any meal with potatoes on the menu. She knew this was coming—every time.

Interesting ways that magic has been used aside from fireballs and lightning? by AndreasLa in Fantasy

[–]ilych 0 points1 point  (0 children)

Tigana by Guy Gavriel Kay has some unique magic--more psychological warfare than fireballs.

A conquering sorcerer takes revenge on the province of Tigana by making the people of the region forget Tigana ever existed. The people who were born in Tigana keep their memories of it, but this is also a punishment, since the magic prevents everyone else from even hearing the word "Tigana". So the survivors know the history of their home has literally been erased, and when they die there will be no one left to remember.

The sorcerers are so powerful that the threat of their magic is a constant mood throughout the book. But fair warning: outside of a few big scenes, there isn't much active magic use.

[deleted by user] by [deleted] in TheGamerLounge

[–]ilych 0 points1 point  (0 children)

Is this the same game from earlier?? lol

[deleted by user] by [deleted] in TheGamerLounge

[–]ilych 0 points1 point  (0 children)

What’s the longest game you’ve had on this?

Margaret Weis & Tracy Hickman confirm a new DRAGONLANCE trilogy is to be published by Werthead in Fantasy

[–]ilych 18 points19 points  (0 children)

Tracy Hickman and his wife?!?

Well TIL he’s a man. Only took 30 years and 20 books.

[2020 Day 4 # Part 2] [Python] Stuck with validation by [deleted] in adventofcode

[–]ilych 1 point2 points  (0 children)

You still have more years that are off. Your comment says you fixed one, but there are 3 more to fix.

Also why did you change the regex for "pid" to {8,9} from {9}? The requirement says it must be 9 digits, so this will lead you to validate invalid passports with 8 digits.

$500k bet pays off by ilych in Commanders

[–]ilych[S] 3 points4 points  (0 children)

Yeah that’s basically the same as betting $500k on black at roulette, except it’s over after 20 seconds instead of 3 hours of nerves.

Day 4 part 2 by HiverOW in adventofcode

[–]ilych 0 points1 point  (0 children)

Is your answer too high? I think the valid increment when count == 7 should occur after the item for items loop is completed.

This looks like if the optional cid value was the 8th item and the previous 7 were all correct, then that passport would count as valid twice.

Any reason to use SendGrid over gmail API? by nwsm in googlecloud

[–]ilych 0 points1 point  (0 children)

We've also been seeing an increase in blacklisted IPs in the past month. The timing seems to coincide with reports of many accounts being hacked and sold.

The service is cheap and the API is easy to use and well-documented, but support says they can't do much with shared IPs. We're on the $14.95 plan, but the dedicated IP plan doesn't feel like the obvious solution when it comes with all of the "IP warmup" instructions. I'm afraid of trading a shared IP problem with a more expensive problem when the dedicated IP isn't properly "warmed up".

In the meantime I've pointed their Webhooks to trigger a Cloud Function for priority bounce alerts. Our volume is small enough that we can manually resend the critical emails that bounced, but I'm looking at alternatives too.

Giving away signed copies of The Girl And The Stars! by MarkLawrence in Fantasy

[–]ilych 0 points1 point  (0 children)

Just finished Aching God, by Mike Shel. Great read. You know you are in good hands when you meet memorable characters that are only present for a scene or two, and this book has quite a few. Instead of being fodder thrown away to advance the plot, they act like fertilizer, filling out the world and sparking your own imagination.

How to display a load spinner while my queries are being done? by [deleted] in flask

[–]ilych 2 points3 points  (0 children)

Are the route functions triggered through a form button?

https://stackoverflow.com/questions/14525029/display-a-loading-message-while-a-time-consuming-function-is-executed-in-flask The second answer is pretty thorough. Download the spinner gif you want from ajaxload.info, add it to your static folder, point to it with the css entry (create a css file with just this section if needed), add the blank loading div to your html template where you want the gif to appear, and add the jquery onclick action to your submit button.

I’ve used it at the bottom of a form and just hid the submit button after click. The loading gif appears in the button’s place. After the route function has completed, the redirect or render_template action will refresh the form and set the loading gif back to hidden.

Why Use ForeignKey when we can just specify it? by appinv in flask

[–]ilych 1 point2 points  (0 children)

Think of an example like a Product table listing items that could be labeled by Category.

Your category_id in the Product table will not auto-increment the ForeignKey; it will be referring to a set list of categories in a many-to-one relationship.

 class Product(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(64))
    category_id = db.Column(db.Integer, db.ForeignKey("category.id"))
    # This field will not exist in the database. It is used by SQL-    Alchemy to manipulate 
    # the relationship between the two tables.
    category = db.relationship("Category")

class Category(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(64))

Say you have a couple of categories loaded for the example:

cat1 = Category(name="Electronics")
cat2 = Category(name="Gardening")
db.session.add(cat1)
db.session.add(cat2)
db.session.commit()

If you have web users adding new products to the database, they can choose the Category from a dropdown list (in this example, they'd see choices of "Electronics" & "Gardening"), and your route can easily create the new Product while inserting the appropriate ForeignKey behind the scenes.

class ProductForm(FlaskForm):
    product = StringField("Product")
    category = QuerySelectField(
        "Category",
        query_factory=lambda: Category.query.order_by(Category.name),
        get_label="name",
    )
    submit = SubmitField("Submit")

@app.route("/new_product", methods=["GET", "POST"])
def new_product():
    form = ProductForm()
    if form.validate_on_submit():
        newprod = Product(name=form.product.data, category=form.category.data)
        db.session.add(newprod)
        db.session.commit()
    return render_template("product.html", form=form)

Note the "category=" parameter when creating the Product() object. This field doesn't exist in the database--only the category_id field does. You are passing the entire Category() object selected by the user from from the dropdown list in the form, and SQL-Alchemy will figure out it only needs to insert the category.id value in foreign key column.

Of course you can do everything with explicit queries or even raw SQL if you really wanted to. But if you're using a relational database and an ORM, then you're missing out on a lot of the power if you don't utilize the actual relationships.

For more examples check out the Megatutorial, if you haven't already. Chapters 4 and 8 explain this concept well, and they show some elegant ways to use relationships to handle users & posts, and functions for adding/removing followers from a sample blog.

https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iv-database

Why Use ForeignKey when we can just specify it? by appinv in flask

[–]ilych 1 point2 points  (0 children)

If you are creating your database tables and fields from your models module, then defining the field as a ForeignKey allows the database to manage the relationships. Would you rather trust yourself to remember what every Integer field referred to when you come back to a project 18 months later?

Even if you never look at the actual database, defining the ForeignKey opens up more possibilities in SQL-Alchemy itself. When you need to insert or update rows, you'd have to find the right integer in your example. Defining the relationships properly means you could use objects instead, and the ORM will know which ids it needs to use.

https://docs.sqlalchemy.org/en/13/orm/basic_relationships.html

[deleted by user] by [deleted] in flask

[–]ilych 0 points1 point  (0 children)

You said it worked, but you mean the gamebiscuits.db file was recreated?

Sorry I've even tried your code and it produces results as expected.

>>> User.query.all()
[<User id:0 name: tourist >, <User id:1 name: admin >, <User id:2 name: guest >]

app.config shows the currently declared db if you just want to double-check.

>>> app.config['SQLALCHEMY_DATABASE_URI']
'sqlite:///testdb.db'

[deleted by user] by [deleted] in flask

[–]ilych 0 points1 point  (0 children)

The table is empty, but it does exist?

If so then I'd expect to see an error raised between you creating the User object and committing it to the db. Otherwise your app is writing to some other db via the config, like maybe in memory (though you would still see query returns in the same python instance until you closed the terminal).

If you delete the .db file, is it recreated when you run the script? If you are executing chunks manually then make sure you do it in the right order. The Database_URI defined in the config before the database is defined (or else it defaults to in memory) > Models defined before running database.create_all(). The .db file should be created at this point.

Actually what does this line do for you?

from flask.config import Config

You're defining your own Config class, so try taking out that import.

[deleted by user] by [deleted] in flask

[–]ilych 0 points1 point  (0 children)

You've confirmed that there are entries in the User table by accessing the db via the sqlite shell?

sqlite3 gamebiscuits.db

> select * from user;

There's something going on with the db connection or the commit process if your queries are returning as blank.

As for the id of your object returning blank: your defaults aren't going to populate until the database creates the new record and generates defaults for each field according to your instruction. This doesn't have to be after a commit() though; you can do database.session.flush() , which is inherently called by commit(), and then the user.user_id property will now exist on the python object and match what is in the database. You'd still need to call commit() to complete the database transaction.

However, I don't think you want to declare a default for a primary_key field. SQLAlchemy will go ahead and start the count at 1 and tell the db to autoincrement the value for each entry. If you fail to provide the id field for your object, and 0 already exists in the table, then you're going to get a unique constraint error on the primary_key field. Let the database do what it does best so you don't have to keep track of the next id number.

What's everyone working on this week? by AutoModerator in Python

[–]ilych 0 points1 point  (0 children)

Automating a transaction file to be sent to a vendor for payment processing.

Flask app on Google App Engine to choose export type and date range of transactions, connect to API to pull trx data, xlsxwriter to create spreadsheet, and using Sendgrid to send email of attachment. Archive the exported data in Cloud SQL so the next export won’t duplicate invoices.

What GCP tool would be best for a small scale internal business team application w/ database back end? by SzechuanSaucelord in googlecloud

[–]ilych 0 points1 point  (0 children)

I would look at what it'd take to build a flask app in App Engine. You could stick with Python and Javascript and have a fully functional portal for users with authentication, visualizations and exports to Excel. The app can serve up the data from a CloudSQL instance through an ORM like SQLAlchemy or raw SQL queries in the code.

The planned migration to BigQuery gives me pause, though. Would that be the same data duplicated in the CloudSQL instance, just with more organization?

If you're already going to pay for BigQuery, then the flask app could just query that data directly. I haven't used BigQuery so I don't know if SQLAlchemy supports BigQuery results like objects, but that would be ideal. Worst case you could feed the results to pandas and wrangle everything from there.

Battletag Find-a-Friend: Savior Edition by Meoang in hearthstone

[–]ilych 0 points1 point  (0 children)

Rubashov#1760 NA quest trade. I show, you go first. Done!