Categories
Mastering Development

too many values to unpack (expected 3) pygame click issue

I am currently working on a CS50 project studying the AI required for tic-tac-toe. however I can’t get the runner.py file to run, as I get the following error: Traceback (most recent call last): File "/Users/newtracksuit/Downloads/tictactoe/runner.py", line 57, in click, _, _ = pygame.mouse.get_pressed() ValueError: too many values to unpack (expected 3) here is the […]

Categories
Mastering Development

Panel width not fitting the whole space

Hello i am defining a Panel like so : Ext.define(‘Mine.view.newDashboardPanel’, { extend: ‘Ext.Container’, xtype: ‘basic-panels’, requires: [ ‘Ext.layout.container.Table’ ], width: 760, height: 500, layout: ‘fit’, defaults: { xtype: ‘panel’, width: 1240, height: 600, padding: 0 }, items: [{ title: ‘proj’ }); But the default property fields width and height set to 100% don’t stretch the […]

Categories
Mastering Development

Electron does not play mp3 audio file using Html5 tag in Raspberry Pi 3b+

Problem: I made simple electron project on raspberry-pi, It play an audio file but somehow that cannot play. My Efforts I tried already lots of other audio files. Removed node_modules, nodejs and npm from my raspberry-pi 3b+ device and reinstall it. I tried also some Electron Versions 9.0.0, 9.3.1, 10.0.0. I tried to update and […]

Categories
Mastering Development

mainWindow is not defined electron js

i was making an app in ElectronJS, and tried to load a diffrent html document on a event. But when i tried to do this, i go this error (see in the image below)The error mesage So, have i done anything wrong, or is there a diffrent way of doing this..? Here is my code: […]

Categories
Mastering Development

.exe shows nothing after using electron-packager

When I use npm start (with "start": electron .") app works great. When I use .exe after packaging app with "start": "electron-packager ." it shows me nothing. Nothing at all. This is frustrating because when I go into app/resources/app folder I can run it just fine through index.html. Except files used by electron (init.js, package.json, […]

Categories
Mastering Development

Pygame running extremely slow

I’m trying to code a simple snake game with Pygame. For some reason, the game is running extremely slowly, at around 1.3 frames per second. I tested it on both my MacBook Pro and a Windows laptop and it runs at the same speed on both. The project is distributed across multiple files, so I’ll […]

Categories
CMS Mastering Development Wordpress

Generate and upload screenshot as featured image for user-submitted post

I have a website where users can submit posts (the posts must have a URL of a website). I would like to use a screenshot of that URL to be the featured image. I have used this code to generate the screenshot: https://wpscholar.com/blog/wordpress-display-screenshot-of-any-website/ and I found this code to upload the screenshot https://www.wpexplorer.com/wordpress-featured-image-url/ but am […]

Categories
Mastering Development

Passing a tkinter canvas between classes without calling the child from within the parent

I am somewhat of a beginner when it comes to Python, but i decided i want to write a basic 2-d physics playground. Unfortionetly i ran straigt into trouble when trying to setup the basic structure. My plan is to create a GUI with a canvas in a parent function named mainWindow, then i figured […]

Categories
Mastering Development

How to re-render React Component when promise resolves? | How to block render until data loads?

I’ve tried to update a functional component that points to an azure-devops-ui/Filter. I am using azure-devops-extension-sdk that returns an async response, in order to use this component: https://developer.microsoft.com/en-us/azure-devops/components/filter inside a WorkItem on Azure DevOps I’ve already code with both a class-based and function component using this.state/componentDidMount and useState/useEffect respectively. I followed this SO post. However, […]