A while back I came across an article that mentioned genetic algorithms. For those unfamiliar with the term, simply put, rather than finding a solution to a problem by iterating over all possible cases, a genetic algorithm attempts to find a solution by starting with a guess, then generating a next guess by applying numerous random changes to the current guess and picking the guess that best fits the solution as the next best guess. Rinse and repeat. Unfortunately, most of the articles and examples I came across involved far too much tech speak and math for a brain long …

Member Avatar
Member Avatar
+2 forum 4

May sound all too easy for some, but I'm just getting started on android development and I can't find out why I got an error when everything is exactly as it is in the tutorial. Weird but I'm confused so I thought I'd post to see if someone can help me out here. Error is: Gradle: error: cannot find symbol variable container at line (23,30) **MainActivity.Java** package com.example.myfirstapp; import android.support.v7.app.ActionBarActivity; import android.support.v7.app.ActionBar; import android.support.v4.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.os.Build; public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { …

Member Avatar
Member Avatar
+0 forum 6

This is the updated version of the Tiny Tkinter Calculator. It has more power, since you can type in functions contained in the Python math module then press the equals key. You can then move the result into memory for other calculations. The code is written in OOP class style as an exercise, still simple and hopefully very readable. Again, you are welcome to improve the functionality, but don't turn it into a HUGE calculator.

Member Avatar
Member Avatar
+4 forum 8

Hi All, thought I'd pass on a (very) simple password class which is built on the new `password_hash()` and `password_verify()` functions. You will need php 5.5.0+ in order to get this to work. If you're thinking of modifying this and using it in a production site, please check that your host has 5.5.0+, as many do not. To be honest there's not much going on beyond the two functions mentioned, but it can be modified easily to change any validation rules. [VERSION 1.1 with improved validation and rehashing](https://www.daniweb.com/web-development/php/threads/485519/a-simple-password-hash-and-verify-class#post2125105) (as suggested by veedeoo and ~s.o.s~) Comments, improvements etc. most welcome.

Member Avatar
Member Avatar
+8 forum 9

Here's a simple game code, open a new vb project and copy paste this code and hit run. the game contains 3 levels, all you have to do is to shoot the smiley faces to earn money using mouse clicks, also there's a boss enemy on level 3. I didn't have much time to add more levels to the game (actually i only tried to play it once :p), here's my point of this code "Just for fun" try to import some enemy characters(in a picturebox) and add more levels and add some sound effects to the shooting or when …

Member Avatar
Member Avatar
+3 forum 8

Hello there. I recently have been teaching myself C++ and have come across something that I just can't seem to grasp. I undersatdn the basics of structures but when it comes to this nesting type situation I just can't figure out what is going on. If someone could explain in a somewhat simple manner it would help me greatly Here's the code: #include <iostream> using namespace std; struct sct { int t[2]; }; struct str { sct t[2]; }; int main(void) { str t[2] = { {0, 2, 4, 6}, {1, 3, 5, 7} }; cout << t[1].t[0].t[1] << t[0].t[1].t[0]; …

Member Avatar
Member Avatar
+0 forum 2

Alright I apologize for the completely uninformative title but i had no idea what to call it. Basically I have an array with multiple values and I only want information to be sent from certain forms if a certain value is met in the array. <?php if(isset($_POST['cb1'])) { $cb1 = implode(",", $_POST['cb1']); } else { $cb1 = ""; } ?> <?php if(isset($_POST['cb2'])) { $cb2 = implode(",", $_POST['cb2']); } else { $cb2 = ""; } ?> <?php if(isset($_POST['tutor'])) { $tutor = implode(",", $_POST['tutor']); } else { $tutor = ""; } ?> <?php $con = mysqli_connect("localhost","root","admin","form_info"); if (mysqli_connect_errno()) { echo "Failed to …

Member Avatar
Member Avatar
+0 forum 5

Hi, I'M using the simple grid theme and I want to add a LinkedIn social media button on the top right that linkS to my LinkedIn profile. Most of the other main networks are built in to the theme So that you only have to add a link to your profile, but LinkedIn isn't included. I actually managed to figure out how to add The LinkedIn field to the theme. The only problem is I cant get the LinkedIn image icon to display. There is a broken iage displaying and this is even linking to my LinkedIn profile. I just …

Member Avatar
Member Avatar
+0 forum 1

Hello I am using jxls quite fine. I'm sort of on my last lap with exporting my data to a file. However all I want to know is, how do I display my collection in the same row please? I've manage to do this downwards in the same column, but I'm not sure how to display them across in the same row. There website telss me how to do multiple collections across, but not one. Oy. I hope someone has an idea, because it "seems" simple enough.....seeems, but I judt don't tknow the syntax.

Member Avatar
Member Avatar
+0 forum 1

How would I use [web.py](http://www.webpy.org) to execute ASP/PHP server files? Or can web.py not do that and can someone provide me a python script that can execute ASP/PHP server files? Should I try posting this in the PHP forum, Web Design, html, and css fourm, or the Web development forum if I don't get an awnser here?

Member Avatar
Member Avatar
+0 forum 2

Here's a small piece of code in python that may be helpful to those who like to play with substitution ciphers..... Say we have a text that is ciphered with simple [substitution cipher](http://en.wikipedia.org/wiki/Substitution_cipher), and say we know that the original text contained a certain phrase...but all we have now is a ciphered text and we don't know where is that phrase in the text. On the other hand, if we knew what part of ciphered text represents that certain phrase, that could be a great help for deciphering the text. Here's a simple code that can do that...feel free to …

Member Avatar
Member Avatar
+2 forum 1

So i'm making an rpg game in xna. I can move my player around the screen, however it can also move off the screen. How can I implament a simple camera that will follow the player and prevent them from moving off of the screen? I only need it to follow, not zoom or rotate or anything like that. Any responses will be greatly appreciated!

Member Avatar
Member Avatar
+0 forum 2

Hello, I'm new to these forums and I was wondering if any of you guys know a programmming language that is more designed for Video Games than casual software. I want to make a basic 2D platformer or maybe a simeple RPG that has a moving sprite. I have tried C++ and it was HELL for me! The code was very hard and very complex. I know VB.net and Python but, I don't think those languges where made for Video Games. I'm kinda not used to OOP but, I'll practice.

Member Avatar
Member Avatar
+0 forum 16

I need help with this: -write an application to perform simple arithmetic operations on integers. Specification 1.Name the .java file SimpleMath 2.The program should do the following: ◦Prompt the user to enter five integer values from the keyboard. ◦Display the sum and average of the numbers. ◦Display the quotient of the first number divided by the second. ◦Display the remainder of the fourth number divided by the fifth. NOTE:The average calculation should result in the integer representation of the average, not the decimal valu

Member Avatar
+0 forum 0

Create a check digit that is the remainder of the account number when it is divided by 5. This digit should be added to the end of the 4 digit account number. Account #12344 #include <cstdlib> // Standard C library... #include <iostream> // Contains cout, cin objects... using namespace std; /* * */ int main(int argc, char** argv) { int accountNumber1, accountNumber2; double accountBalance1, accountBalance2, checkDigit; cout << "First account: Enter account number: "; cin >> accountNumber1; checkDigit = 4 //(accountNumber1 / 5) % 2; accountNumber1 = accountNumber1 + checkDigit; cout << "Enter balance: "; cin >> accountBalance1; cout << …

Member Avatar
Member Avatar
+0 forum 6

I need help with my homework. Out professor doesn't explain anything and i'm struggeling. TMy homework is: Write, test and debug a program which asks the user to enter three floating point numbers and then reports the largest and the smallest of these values. Here is the example program dialog: Enter the first number: 43.5 Enter the second number: 110.2 Enter the third number 35 The smallest of the values is: 35 The largest of the values is: 110.2 When your program is working correctly, run it four times, using these value sets for the input: 20.5, 14.3, and 90.9 …

Member Avatar
Member Avatar
+0 forum 4

# /*Given an array arr[] of n integers, construct a Product Array prod[] (of same size) such that prod[i] is equal to the product of all the elements of arr[] except arr[i]. My code is printing garbage value.Pls someone suggest me what is wrong and how can I correct it..Thank you */ #include<stdio.h> main() { int i,j,a; int sum=1; int vari=1; int array[5]={1,2,3,4,5}; int temp[4]; while(a<=4) { printf("sum"); for(i=0;i<=4;i++) { if(i==a) i++; else sum=sum*array[i]; } temp[j]=sum; j++; a++; sum=vari; } for(j=0;j<=4;j++) printf("%d\n",temp[j]); }

Member Avatar
Member Avatar
+0 forum 4

Hi guys, I'm working on a side project for a friend and I'm looking for a C++ library that allows me to put bunch of paragraphs in a PDF format. Anyone know any good libraries that can do this as simply as possible? It will be just paragraphs and paragraphs that need to be added to a pdf with normal margins and Times font! I'm looking for a library that I can use quick so I won't have to spend much time on this... not too familiar with this area that's why I'm hoping one of you has done somehting …

Member Avatar
Member Avatar
+0 forum 4

Hi there, I need a simple socket server which will echo a client message to all connected clients. I've found this easy py script below, but it only echos the string to the client that sent the message. Any way to mod this so that it will send the message to all clients connected? ...yes, this is probably really simple, but I have very little understanding of python... [URL="http://www.pvmgarage.com/2011/03/a-multi-threaded-persistent-echo-socket-server-in-python/"]http://www.pvmgarage.com/2011/03/a-multi-threaded-persistent-echo-socket-server-in-python/[/URL] [CODE]from socket import * import threading import thread def handler(clientsock,addr): while 1: data = clientsock.recv(BUFSIZ) if not data: break msg = 'echoed:... ' + data clientsock.send(msg) clientsock.close() if __name__=='__main__': HOST = …

Member Avatar
Member Avatar
+0 forum 4

Hi all! So I have created this for my first portion of my Beginning CIS class project, calculating the final grade based on scores. For the next step, the user must be able to enter in their own number of projects they have completed, and from that, be able to put individual scores in that number of projects they entered. (For example, if they say they did 5 projects, they then individually write the number grade of each project). Then, the final letter grade is computed based on all the information. I'm totally stuck and don't know where to begin …

Member Avatar
Member Avatar
+0 forum 1

After I clicked the 'Run' button in Netbeans, it will compile and run and then it will stop at this point : [Click Here](http://i.imgur.com/4O8vY2d.png) I will have to press any key on the keyboard then it will display the text, but it doesn't allow the user to enter any form of input. [Click Here](http://i.imgur.com/uFAhEPO.png) Code below, any guidance is helpful. #include <stdio.h> #include <stdlib.h> int main(void) { int height, length, width, volume, weight; printf("Enter height of box: "); scanf("%d", &height); printf("Enter length of hon: "); scanf("%d", &length); printf("Enter width of bow; "); scanf("%d", &width); volume = height * length * …

Member Avatar
Member Avatar
+0 forum 4

This code works fine but it would be too long if the score is 50 or over. Is there any way to make it shorter and quicker? I tried to use for loop statement but it didn't work well. background(backgroundChange); if (score >= 5 && score < 10) backgroundChange-=0.8; else if (score >= 10 && score < 15) backgroundChange+=0.8; else if (score >= 15 && score < 20) backgroundChange-=0.8;

Member Avatar
Member Avatar
+0 forum 3

[B]!USING PYTHON 3.1![/B] Hello DaniWeb! Today I'm going to be posting a [B]simple[/B] threading tutorial. First of all, what is threading? Well, threading is just another way of doing a side task without interrupting the main program. Now here's a simple example. Let's say we are going to make a simple program. When the program starts it is going to start a timer, and it will show the time. Now, observe these 2, similar programs. Good version: [CODE] import threading import time threadBreak = False def TimeProcess(): while not threadBreak: print (time.time() - startTime) startTime = time.time() threading.Thread(target = TimeProcess).start() …

Member Avatar
Member Avatar
+3 forum 13

hi, I am new to javascript learning. I just want to know the detail explanation of this code given in w3schools. http://www.w3schools.com/js/tryit.asp?filename=tryjs_lightbulb I know method match() works for finding match. But I can not understand the function. I have knowlege of C. Know if...else, while loop, for loop and the basics. Please anyone tell me how the given code is working.

Member Avatar
Member Avatar
+0 forum 3

I'm looking for a simple database-server maintenance and management software. It need not to be free but it must be known in the field of networking.

Member Avatar
Member Avatar
+0 forum 3

[CODE]public class MinDif { public static void main(String[] args) { EasyReader keyboard = new EasyReader(); EasyWriter screen = new EasyWriter(); //Create an array to the length of the specified entry int numItems=keyboard.readInt("Enter the length of the array: "); String[] myArray = new String[numItems]; // Read in the contents of the array for (int i=0; i<numItems; i++) myArray[i]=keyboard.readString("Enter number "+(i+1)+" (index"+i+") : "); // Set a vairable and test it int dMin = 0; int i,j; for(i=0; i< numItems; i++) { for(j=i+1; j< numItems;j++) { dMin = Math.min(dMin,( myArray[i]-myArray[j] )); } } System.out.println(dMin); } }[/CODE] I need to find the minimum …

Member Avatar
Member Avatar
+0 forum 7

Hey! **Im here to ask for Your advice.** For a school project we choosed to create a android application that uses a database. As we are thrid year studens we have some experiance. But it is not as notable. We have **seen some**: **Access SQL** only on acess. How to create a **PHP** website using **MYSQL** as **server side** application. I have used **postgres SQL** with **pgAdmin** to develop a java web application as a part job. **Our valus & goals:** -keep it simple. -db must be on server. (to gain some administrative features) -Cover 80% of code with tests …

Member Avatar
Member Avatar
+0 forum 3

im very new to c++ and was just wondering if its possible to make a simple program where you type the name of the file and when you press enter it downloads that file from the internet to a certain place on your computer. where would the files be stored? could you store on internet or would they have to come from my pc via internet to were i want it downloaded? could you show some source code with explanations of it? thankyou =)

Member Avatar
Member Avatar
+0 forum 5

Hi, I have some basic php knowledge. I want to know about ' -> ' sign. What does this arrow means? I know it is very sipmle question but don't know. I am learning php from my own effort. Jahur

Member Avatar
Member Avatar
+0 forum 3

I'm trying to come up with a small block of code that simply takes a character value that is input by the user and then use an "if" statement to determine what is excecuted depending on what is entered. I just started C++ this week and have no prior experience so please be gentle! :) This is wrong, but something to the effect of this; [CODE] int input; cout << "Enter t or f: "; cin >> input; if(input = t) { cout << "True"; if(input = f) { cout << "False"; // if anything other than t or f …

Member Avatar
Member Avatar
+0 forum 10

The End.