Categories
Mastering Development

Calling setPos() on custom QGraphicsPixmapItem doesn’t update QGraphicsScene immediately

I’m working on a little poker game and I am having a graphical glitch I would like to understand better and fix. For my “Card” class I subclassed QGraphicsPixmap items and added a 52-card “deck” to my QGraphicsScene. During runtime, I click on a button to deal the cards which then calls setPos() on the […]

Categories
Ask Mathematics

After having drawn 13 cards from a deck of 52 What’s the probability of you having done that in that order whatever it was? [closed]

I hope the question is clear. After the fact of drawing 13 cards from the top of shuffled deck in any given order. What was the odds of drawing those same cards in that order. What i mean is basically this: it seems intuitive that if you draw the top 13 cards from a deck […]

Categories
Development

Chrome Extensions: Use a content script to modify existing scripts on a web page?

I’m creating a chrome extension that needs to hook into another script that already exists on my target web page. For simplicity’s sake, I’m trying to find the following existing script element on a page and add a console.log() to it. <script type=”text/javascript”> var viewModel = new ScenePlayViewModel(”, ‘Ace’, false); viewModel .load(‘jgWJJ2qsxx’) .then(function () { […]

Categories
Development

Blackjack Java game(NullPointerException)

So I’ve been coding this BlackJack game on Java and I’ve been running into an issue. How do I make the cardDeck array of Card objects all not be null so I can set them to a new card? Also, how do I make the program actually check to see if the user has entered […]

Categories
Development

Why Spyder will not run or debug my code?

I am a beginner programmer using Python 3.7 on Spyder, and when i run my code, it opens a command window and immediately closes it. Nothing happens. The same thing happens when I try to press the debug button. I’ll paste my code here. I know it has a ton of errors, and I’m trying […]

Categories
Development

Why does this for loop not cycle through the list?

I am trying to make a loop to create a deck of cards. I understand this isn’t an efficient way of doing this, but I want to try anyways. For some reason the for loop doesn’t cycle through the “Suits” list like it should. Any ideas why? #Pre Assigned Variables suits = [“Hearts”, “Diamonds”, “Clubs”, […]