Categories
Mastering Development

Calculate percentage of larger values than each ‘y’ value in Python [closed]

y = (1212, 900, 730, 714, 650, 591, 565, 500, 450, 440, 430, 420, 407, 381, 324, 315, 283) Trying to write a code in Python to calculate % of values larger than each of these values from the y list. Mathematically would be each value (1st, 2nd, 3rd…. till n total values) – 1 […]

Categories
Mastering Development

Taking a certain part of the page with selenium

from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.webdriver import ActionChains import selenium.webdriver.common.keys from bs4 import BeautifulSoup import requests import time driver = webdriver.Chrome(executable_path=”../drivers/chromedriver.exe”) driver.get(“https://www.Here the address of the relevant website ends with aspx.com.aspx”) element=driver.find_element_by_id(“ctl00_ContentPlaceHolder1_LB_SEKTOR”) drp=Select(element) drp.select_by_index(0) element1=driver.find_element_by_id(“ctl00_ContentPlaceHolder1_Lb_Oran”) drp=Select(element1) drp.select_by_index(41) element2=driver.find_element_by_id(“ctl00_ContentPlaceHolder1_LB_DONEM”) drp=Select(element2) drp.select_by_index(1) driver.find_element_by_id(“ctl00_ContentPlaceHolder1_ImageButton1”).click() time.sleep(1) print(driver.page_source) The last part of these codes, I can […]

Categories
Game Creation Mastering Development

Class Not Found Exception on Class.forName()

I am having this exception on title. I have been following a LibGDX programming PDF, everything was working perfectly and then this code have been implemented, and it isnt working anymore. I should add that Rock and Starfish are classes on my project, and there is no typo on class names Caught message: java.lang.ClassNotFoundException: Rock […]

Categories
Mastering Development

Python Shell crashes when I press a button which calls a method that updates my database

from PyQt5 import QtCore, QtGui, QtWidgets import sqlite3 class Ui_MainWindow(object): def messagebox(self,title,message): mess = QtWidgets.QMessageBox() mess.setWindowTitle(title) mess.setText(message) mess.setStandardButtons(QtWidgets.QMessagebox.Ok) mess.exec_() def insertData(self): name = str(self.patientName.text()) age = int(ageBox.Value()) rov = str(self.patientROV.text()) if self.priorityBox.currentText() == “Urgent”: priority = 1 elif self.priorityBox.currentText() == “Routine”: priority = 2 elif self.priorityBox.currentText() == “Minor”: priority = 3 frequency = str(self.frequenctBox.currentText()) time […]

Categories
Apple User Help

GUI for client is not updating information correctly in Connect4 game

I have been trying to make a server client connect4 game. The connection side seems to be working correctly. The issue I am experience is from the third move onwards, the information is being received at the client side but the GUI only up dates showing the oppositions move after their mouse click selecting their […]

Categories
Game Creation Mastering Development

Why is Jbutton being cropped out by JFrame in Java

I am making a calculator GUI which is just a simple one with simple functions. Right now I can’t even implement operators without a bug. My JButtons can only be seen when going into fullscreen mode. Here is my code: `package com.company; import javax.swing.*; import java.awt.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.image.BufferedImage; import java.util.ArrayList; public […]

Categories
Mastering Development

Bash Script on displaying number more than 100 using grep and regex from the text file

How to write a bash script called example.sh that uses grep and regex to display only lines in bash.txt that are yellow in colour and have a number > 100. My bash.txt file is: tapt,1,3,4,pink cent,40,2,677,Red lean,4,56,450,yellow

Categories
Mastering Development

How to have Jframe and a while loop

I want to create a server and client application in java with Jframe. The server needs to always listen to the client so i’ve made a while loop. I have a start button in the Jframe code and when i click it the server starts with the while loop and then the Jframe does not […]

Categories
CMS Development Wordpress

WP_query sort by custom meta_key “price”

I’ve created a custom post field for use on my site that is the price of a real estate item for sale (that is the subject of the post). It should sort posts archives by price but I cannot get it to sort high to low; it still sorts as follows: $2,900,000 $24,450,000 $1,900,000 $13,000,000 […]

Categories
CMS Development Wordpress

WP_query sort by custom meta_key “price”

I’ve created a custom post field for use on my site that is the price of a real estate item for sale (that is the subject of the post). It should sort posts archives by price but I cannot get it to sort high to low; it still sorts as follows: $2,900,000 $24,450,000 $1,900,000 $13,000,000 […]