Several keyboard keys in Daniweb are doing the wrong things. - Occasionally backspace is taking me back to previous pages instead of removing characters. - The END key takes me to the beginning of the line instead of the end of the line. - I occasionally find myself navigating where I didn't want to go, and have no idea what key did that. Editing keys should be STANDARD, always doing the same things on all web pages in the universe.. Please, no hot keys.

Member Avatar
Member Avatar
+0 forum 11

Hello good people I am working on a caeser cipher program for class. However, I ran into a problem with my outputs. Up to a certain point for example: two('y', 'z') Would give a '\x92' output instead of a 'x' output. Currently this is my code so far: def chartonum(ch): return ord(ch) - 97 def numtochar(n): return chr(n + 97) def two(c1 , c2): c1 = chartonum(c1) c2 = chartonum(c2) return numtochar(c1 + c2 %26) I am thinking I have messed up on my mod 26, however, I am at a lost where I might have went wrong in that. …

Member Avatar
Member Avatar
+0 forum 1

After I enter first name then program fail. Error: RUN FAILED (exit value 1, total time: 2s). I use Netbeans #include <iostream> using namespace std; struct Student { char * firstName; char * lastName; char * telephone; }; void printStudent(Student s) { cout << "Student info: " << endl; cout << "Name: " << s.firstName << " " << s.lastName << ". Telephone: " << s.telephone << endl; } int main() { Student s; cout << "First name?" << endl; cin.getline(s.firstName, 100); cout << "Last name?" << endl; cin.getline(s.lastName, 100); cout << "Telephone?" << endl; cin.getline(s.telephone, 100); }

Member Avatar
Member Avatar
+0 forum 6

Hello, I have a problem with my php script. Everything works fine except when i will write the data to the database. I get a error Warning: **Wrong parameter count for mysql_query()** Here is my code: <?php include('../sec/inc_mysql_connect.php'); include 'googledistance.class.php'; $sql = "SELECT VVBnummer, Adres, Postcode FROM tblscheidsrechters";// echo($sql); $result = mysql_query($sql); $sql_sh = "SELECT ID, SporthalAdres, Postcode FROM tblsporthal"; //echo('<br>' . $sql_sh); $result_sh = mysql_query($sql_sh); while($record = mysql_fetch_array($result)) { while($record_sh = mysql_fetch_array($result_sh)) { $fromAddress = $record['Adres'] . ',' . $record['Postcode']; //echo($fromAddress . '<br>'); $toaddress = $record_sh['SporthalAdres'] . ',' . $record_sh['Postcode']; //echo($toaddress . '<br>'); $gd = new GoogleDistance($fromAddress, $toaddress); $vvb …

Member Avatar
Member Avatar
+0 forum 4

I a new c++ programmer, and i started to solve the SPOJ online challenges just practising , and because of my few experiance.. it gives me wrong answers alwayes. See [ **the Challenge** ](http://www.spoj.com/problems/PALIN/) here. My Code : #include<iostream> #include <vector> using namespace std; int reverse(int input) { int last_digit; int reversedNum = 0; while (input != 0) { last_digit = input % 10; reversedNum = reversedNum * 10 + last_digit; input = input / 10; } return reversedNum; } bool check(int input) { if (reverse(input) == input) { return false; } else { return true; } } int main() …

Member Avatar
Member Avatar
+0 forum 2

so im trying to make a very basic multiplayer game that gets a players x y from a server then displays the player. the script works fine when there is only one user in the database but when more users are added the script wont display the right player. i think the error is in the displayplayers2() function. Any ideas on what i did wrong or how to make the script better? import MySQLdb import sys import pygame,string,random from pygame import * import threading import thread from pygame import font def textren(text): text = font.render(text, True, (255,255, 255), (0,0,0)) return …

Member Avatar
Member Avatar
+0 forum 1

I need serious help with a website! It works fine with Safari, Google Chrome, and I spent a long time making it compatable for Firefox. But the website is completely differently in Internet Explorer. I am not having any luck at all with this one. If anyone could have a look and make suggestions as to what needs to be changed, it would be greatly appreciated. I am especially having problems changing the menu bar – none of my css corrections seem to have any affect. Here is a link to the website: www.vaudevillian.co.uk

Member Avatar
Member Avatar
+0 forum 2

this is the index page <?php if (isset ($_POST['keywords'])){ $keywords =mysql_real_escape_string(htmlspecialchars(trim($_POST['keywords']))); $keywords =$_POST['keywords']; $errors = array (); if (empty ($keywords)){ $errors[] = ('Please enter a serch terms'); }else if (strlen($keywords)<3){ $errors[] = ('Your search terms must be three or more characters'); }else if (search_results ($keywords) == false){ $errors []= ('Your search for '.$keywords.' returned no results'); } if(empty($errors)) { $results=search_results ($keywords); $results_num = count ($results); echo '<p>Your search for <strong>',$keywords,'</strong>returned <strong>',$results_num,'</strong>results</p>'; }else { foreach ($errors as $error){ echo $error,'</br>'; } } } ?>

Member Avatar
Member Avatar
+0 forum 16

Okay, I'm very new to Java as a whole, and I'm just trying to get to grips with it. I'm experimenting with classes, and I'm struggling to get this one thing to work. Basically, I've made a short program which one can make matrices, and all it has at the moment is a function to print them out and edit their entries. However, although I managed to get the print function to work when it was in my main java file, when I move the print function to the class I made: Matrix, for some reason the printing horribly fails …

Member Avatar
Member Avatar
+0 forum 4

Hello Everyone, I have a website created by some specialists. Well I think that these professional website developers stiffed me. I mean, the website to create was quiet expensive, but it doesn't really work. They made a quiet good work though, the SEO of the site is critical I think. The site is about 1 and a half year old now. It has got 881 European festivals, 9300 events at 3614 venues uploaded on it. Well this is a nice number of content in my opinion, and the website structure is well-planned. The problem is that I only have daily …

Member Avatar
Member Avatar
+0 forum 4

My problem is that when I try to gather the parts of an array, the part of my code that decides what to keep seems to be making a mistake, though I can't fathom how it is making that mistake. My code is posted below. You should see the parts of my code that I am talking about, but if you don't understand, please ask! [CODE] static void remove(String str) { String[] keep = new String[getEntries()]; String[] removed = new String[getEntries()]; // Go through the file, and only add the non-str ones to the keep array. String test = "none"; …

Member Avatar
Member Avatar
+0 forum 2

This program should extract the first line. Somehow I'm getting the last line instead of the first... This is the textfile: [ICODE]N100 G96 S200 N115 G0 X600 Z-1004.95 T11 D2 M3 M7 H10 N125 G0 X500 N130 G1 X419 F0.5 N135 G1 Z-1004 N140 G0 X500 N145 G0 Z-419.7 N150 G0 X405[/ICODE] Trying to get the first line and place it in a character array with this .c program : [CODE]#include <stdio.h> #include <stdlib.h> int main (int argc, char *argv[]) { FILE *filePtr; int i = 0; char line[255]; if ((filePtr=fopen(argv[1], "r")) == NULL) { printf("Cannot open file.\n"); return -1; …

Member Avatar
Member Avatar
+0 forum 1

Hello My problem is I am calling a method in my main but this method doesn't have any code written in it, and yet I am getting an output of numbers approximately 10 digits long, and a negative value. For example, in my main I have: [CODE]Date d1(9,20,2011); // Date is an object that requires a month,day,and year Date d2(10,1,2011); cout << d1.dayDifference(d4) << endl;[/CODE] Then in my .cpp for the [B]dayDifference method[B] I have written: [CODE]int Date::dayDifference(const Date& d) const { //lots of commented out code }[/CODE] My Date object works fine, I overloaded the pre-increment and post-increment operators, …

Member Avatar
Member Avatar
+0 forum 3

I just try to calculate 5.3 - 5, and the answer is a bit off. this is the code: [CODE]double answer = 5.3 - 5; println("answer = " + answer);[/CODE] and the output is: "answer = 0.2999999999999998" instead of 0.3. I use Eclipse on win 7 32 bit as a compiler and editor. Any idea why this is happening and how to fix this? tnx!

Member Avatar
Member Avatar
+0 forum 5

hi I wrote php code do.php [CODE]<?php session_start(); ob_start(); $salladim = $_SESSION['salla']; $salladin = isset($_GET['url'])?$_GET['url']:'' ; if(!in_array($salladin,$salladim)) { header( 'refresh: 1; url='.$_SERVER['HTTP_REFERER'].'' ); echo '<h2>Hazirlaniyor...</h2>'; exit(); } [/CODE] file.php [CODE]<?php session_start(); function kodsalla($uzunluk) { $karakterler = "0123456789"."ABCDEFGHIJKLMNOPQRSTUVWXYZ"; $kod = ""; while(strlen($kod) < $uzunluk) { $kod .= substr($karakterler, (rand() % strlen($karakterler)), 1); } return($kod); } $kodsalla = kodsalla(8); $_SESSION['salla'][] = $kodsalla; [/CODE] When i run this code, i get the following error : [CODE]PHP Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in /home/site/public_html/do.php on line 5[/CODE]

Member Avatar
Member Avatar
+0 forum 25

Hello everybody!! I'm trying to print a *.pdf file from Java code, and the printer out gives the right document, but smaller than the original pdf (smaller text, images, margins, everything), the print result seems shrinked from the original... Here is the code I'm using: [CODE] File f = new File("\\Some.pdf"); FileInputStream fis = new FileInputStream(f); FileChannel fc = fis.getChannel(); Paper paper = new Paper(); paper.setImageableArea(20, 40, paper.getWidth() - 20, paper.getHeight() - 40); ByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); PDFFile pdfFile = new PDFFile(bb); PDFPrintPage pages = new PDFPrintPage(pdfFile); PrinterJob pjob = PrinterJob.getPrinterJob(); PageFormat pf = PrinterJob.getPrinterJob().defaultPage(); pf.setPaper(paper); pf = …

Member Avatar
Member Avatar
+0 forum 1

Hi, i´m quite new in pascal programing. Can someone explain me please why [CODE] function kolik(pocet:integer; retez: string):integer; var p: array[1..pocet] of integer; pomocna,j,i,k,l,od,nep:integer;[/CODE] is compiler telling me p: array[1..pocet] of integer; cannot evaluate this expression? Thank you in advance

Member Avatar
Member Avatar
+0 forum 2

Right, so I installed a 512mb module, but it is only showing 64mb? Im sure its compatible, it is pc133-333-542, just like the 128mb that came with the computer. I upgraded my bios yet still no luck :( Thanks in advance

Member Avatar
Member Avatar
+0 forum 20

Hi, I'm trying to call a bunch of methods during run-time using reflection, but I'm getting an exception saying "IllegalArgumentException: wrong number of arguments". Here's some information on the variables used. - All elements of mailTestClass[] are classes that extend AbstractTestCase. (FirstTestCase extends AbstractTestCase and FirstTestCase.class is the first element of mailTestClass) - These classes have constructors which take a String as an argument. - After instantiating a class, init(Object[][] args) method is called using reflection. The part of the code which creates the objects using reflection works fine. The code blows up when the method init(Object[][] args) is called. …

Member Avatar
Member Avatar
+0 forum 2

The End.