Featured Editorial

Create a code using python of random walk where food is placed in spots on the grid. Whenever a Walker runs into the food it eats it and reproduces

Continue Reading

Am at an intermediate level in python and tkinter, and have been trying to figure out how to get the code below into some kind of workable form I can understand.

What I want to do is, like, if I typed something into the bottom frame, then I'd like to …

Continue Reading

Recommended Topics

Member Avatar

Hi. here is my code, actually what i meant is , i have created a button called button into my exe, and linked it to text file. so when user click on the update button, it will copy all the text file data into the exe. i tried it works, but it only updating the last data. any ideas? Private Sub ButtonUpdate_Click(sender As System.Object, e As System.EventArgs) Handles ButtonUpdate.Click Dim Lines() As String Dim SplitText() As String Dim PLArraySize As Integer = 1 Dim PLExist(0) As String Dim ItemNumberArraySize As Integer = -1 Dim ItemNumberExist(0) As String If IO.File.Exists(MLabelPath) Then …

1
161
Member Avatar

A.Employee and ProductionWorker Classes Design a class named Employee. The class should keep the following information in • Employee name • Employee number • Hire date Write one or more constructors and the appropriate set and get functions for the class. Next, write a class named ProductionWorker that is derived from the Employee class. The ProductionWorker class should have member variables to hold the following information: • Shift (an integer) • Hourly pay rate (a double) The workday is divided into two shifts: day and night. The shift variable will hold an integer value representing the shift that the employee …

Member Avatar
0
95
Member Avatar

In my main activity, I have two tab, named tab1 and tab 2. Tab 2 page consists of a listView and I use StreamSubscription to listen upload progress result. On tab2 action bar, it has one icon. When icon is pressed, it will navigate to pageC,which consists of listView, and I use StreamSubscription too. The problem is I notice when I upload image in PageC, it will display the upload progress in Tab2 page first, then only it will display upload progress in pageC. Why would this happened? I defined subscription in both page as below StreamSubscription<UploadTaskResponse> _subscription; FlutterUploader uploader …

Member Avatar
0
164
Member Avatar

This is Python 3.4.2 The documentation says that s2 = s1.strip('a') will strip out all the 'a' in s1. When I run it, only the leftmost character - and only if it is 'a' - is stripped. The default s2 = s1.strip() takes out all whitespace. PS: I understand that the chars in () are a list. This is from an IDLE shell: >>> s2 = 'qazxswedc'.rstrip('x') >>> s2 'qazxswedc' (Also with .lstrip('x') and .strip('x') ) Have I found the very last bug in Python?

Member Avatar
0
9,333
Member Avatar

I was doing GUI based application, when i run the MyChatPage particularly, it able to send the text to the server and send to the client textarea, which is my objective, but if i run from MyChatIP class and create new object to open the MyCHatpage frame, it will hang, and i know is because due to the run() method from MyChatpage that i called the question is, if i not allowed to call the run()method in MyCHatIP, the what i suppose to do to make it run automatically when open the MyChatPage frame without hang, so i able to …

Member Avatar
0
425
Member Avatar

Do you still use reCAPTCHA or something homemade? For us, we use jQuery to inject a hidden form field upon form submission that sends a little time sensitive and cookie sensitive string that we validate on the server side. I’m always curious to know what everyone else is doing.

Member Avatar
2
289
Member Avatar

In python how to write a program which takes a number of days from now - 100 days, and find in which month that future day is.

Member Avatar
1
193
Member Avatar

How can I show a div when menu item is clicked in angular? The Div show fine when I click list item, but dsn't disappear when I navigate to other menu items. <li><a class="nav-link slots" (click)="showme = true" >Slots</a> <div ng-hide="showme"> <div class="ribbon" *ngIf="game.categories[0]"> <span>TOP</span> </div> <div class="ribbon" *ngIf="game.categories[2]"><span>NEW</span></div> </div> TS file: showme : boolean = false;

Member Avatar
1
533
Member Avatar

Hello! I needed a configuration file for a application I'm working on so I first used the built in ini functions in php but it wasn't easy to write the ini files. So I wrote myself a class here to parse a configuration file and write/edit configuration files. I plan to write some other useful functions for it eventually but it's quite simple really so I thought I would share it. Hope it helps! Ok here is the class: class config { //this function parses a config file public function parse_config($file){ //fetch the contents of the specified file. $content = …

Member Avatar
2
808
Member Avatar

I have spent a lot of time on this question, namely, how to programatically use a PHP script to send a PDF document to the printer without launching the Adobe print dialog that results from using arcord32.exe (the adobe reader). PHP has some useful classes for creating PDF's, i.e., the FPDF library, but printing the created file is a bear. For Windows XP and Windows 7 servers, the one open -source solution which works is to use the PDFBOX java library. Here are the steps. 1) Download the latest java pdfbox binary: http://www.apache.org/dyn/closer.cgi/pdfbox/1.7.1/pdfbox-app-1.7.1.jar and put it in a directory. I …

Member Avatar
7
15,340
Member Avatar

I'm trying to create a trigger that does two things, first take an ip that's in dot notation and run inet_aton on it and put the result in another field. Second, checks a lookup table to identify an ip range that the result of the first action falls into and enters the id of that row in the table. Do I have to break this down to separate triggers, a before insert and an after insert? This is a mysql database. DELIMITER // CREATE TRIGGER download_ins BEFORE INSERT ON download FOR EACH ROW begin declare vip varbinary(16); select `ADDRESS` from …

Member Avatar
1
181
Member Avatar

Hello, Any ever build web using AMP? What is it really? Is it similar like bootstrap? How to do it? Is it difficult or taking a long time to implement? Thanks in advance.

Member Avatar
1
831
Member Avatar

I created custom post type with custom taxonomy. Its working, but i am facing one issue is http://example.com/taxonomy-slug/%term%/post-title this is my custom post type url exg: http://example.com/products/cars/bmw-z4 Here products -> taxonomy-slug cars -> taxonomy-term bmw-z4 -> product title custom-post-type slug -> products/%custom_taxonomy% this link is working, but also its working when i change taxonomy term value Exg: http://example.com/products/crs/bmw-z4 This link also working even after changing(cars -> crs)/puting any value at that position. Actually it should be redirect to page not found page.

Member Avatar
0
124
Member Avatar

Hi all, Before I begin this question, and before you tell me we dont do homework, I would like to state that I have read a few articles, I have tried a couple of functions (=REPLACE, =SUBSTITUTE) but i'm not able to get the reuslts require, I'm new to Excel Question: Useappropriate text functions to shorten the variable names to something like Arizona Females Young, Arizona Females Old, and Arizona Females All, also is there a way to do it automatically for all variables in 1 function. The screenshot is attached. It is kind of urgent (I understand people help …

Member Avatar
0
192
Member Avatar

which code can i use to make enemy shoot at the player non stop and when the bullet catches the player the health decreases any kind of help i appreciate - pygame

Member Avatar
0
120
Member Avatar

hello everyone iam kinda new with pygame. I wanted to create a one mans game which is similar to shoot and killl. i was able to move around my play but the issue is that whenever i press the K_space nothing is coming out and also i would like when the bullet collide health shows up and when the enemy reaches the player game over to be displayed.

Member Avatar
0
256
Member Avatar

Hello! I am creating a turtle code where I want to create multiple circles on a map. However, my turtle is currently coninuing to go around in a circle over and over again, and so the other circles cannot happen. Any help or advice will be greatly appreciated! Thanks! This is my code: def mapofbins(): #sig: str -> turtle #campus map is the background #shows where on campus the compost bins on a campus map #setting the background image screen = turtle.Screen() screen.setup(600,500) screen.bgpic("campusmap") #creates a circle around x circle = turtle.Turtle() circle.speed(0) circle.penup() circle.forward(50) circle.right(90) circle.forward(50) circle.pendown() while True: …

Member Avatar
0
198
Member Avatar

My code has a query that looks like: INSERT INTO table VALUES (...) ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id), ... id is a PRIMARY KEY. My question is that I can't for anything remember why I have id = LAST_INSERT_ID(id). I wrote it years ago and it's not commented. Can anyone think of a reason why I was doing this?

Member Avatar
0
983

The End.