Hey people I have just recently purchased an Advent ERT2250 Laptop and the function (fn) key seems to be constantly on. This means i have to hold the fn key down so i am able to use some of the keys on the keyboard properly, if i dont hold the fn key down then other characters appear in its place, for example; the mjkluio keys appear as 0123456 unless fn is held down. I know it's supposed to be the other way around but it seems locked in this state. I have tried a format and put XP on the …

Member Avatar
Member Avatar
+0 forum 46

Hello everybody I am new here and hope to find an answer to my computer problem. I am Dutch, live in Germany and work with compuers for quite a while (home and work) I have a big problem with my USB keyboerd that stopped working after a restart some days ago. Since then the keyboard does not work anymore. My computer runs with Windows XP, SP2 I have so far tried all the classic tricks I could think of and ran out of ideas. The funny thing is that the keyboard will function before windows starts. Let me list all …

Member Avatar
Member Avatar
-2 forum 26

Hi Any one know how I can get the following function to return a value - thanks. [CODE]import threading import time def stringFunction(value): str = "This is string no. " + value return str thread1 = threading.Thread(stringFunction("one")) thread1.join() thread1.start() while threading.activeCount()>1: time.sleep(1) print thread1 [/CODE] Currently returns "<Thread(Thread, stopped)>" Not "This is string no. one" Many thanks

Member Avatar
Member Avatar
+1 forum 9

SELECT CASE WHEN (Employees.End_Date is null) THEN select EmpId, Emp_Name, Salary , Start_date , End_date ,DATEDIFF(DATE_ADD(Start_Date, INTERVAL 30 DAY), Start_Date) * Salary/30 as 'Total_Salary' from Employees ELSE Select EmpId, Emp_Name, Salary , Start_date , End_date ,DATEDIFF(End_Date, Start_Date) * Salary/30 as 'Total_Salary' from Employees END From Employees; Please help me to find error in this query. I

Member Avatar
Member Avatar
+0 forum 1

Hi, I have created a function that searches for a category in a category tree object and returns all the paths for it as an array of strings, please advice how I can improve it ? the result im getting now is : ["vehicles",["cars","mercedes"],["trucks","mercedes"],["motorcycles","BMW"]] i need it in one dimesional array like this : ["vehicles","cars","mercedes","trucks","mercedes","motorcycles","BMW"] here is also a plunker url for the same code im trying t solve : [Click Here](http://plnkr.co/edit/JOH63BuL55HgEtEYnVjd?p=preview) thanks in advance, please advice. var categories = {category:"vehicles",children:[ {category:"cars",children:[{category:"mercedes",children:[]}]}, {category:"trucks",children:[{category:"mercedes",children:[]}]}, {category:"motorcycles",children:[{category:"BMW",children:[]}]} ]}; function getnodes(nodes) { var arr=[]; if (!nodes.children.length) return nodes.category; else{ arr.push(nodes.category); for(var i =0 ; …

Member Avatar
Member Avatar
+0 forum 1

I am trying out a function from a book for the first time. I could use some help. It goes: [CODE] function sanitizeString($var) { $var = stripslashes($var); $var = htmlentities($var); $var = strip_tags($var)' return $var; } [/CODE] I have two simple forms. One that asks for an email address and another that does fahrenheit-celsius conversions (interesting stuff, I know). I have been testing this sanitizeString function out and it doesn't seem to do anything. Any HTML, or slashes or anything I put in text fields are not stripped of any of the harmful stuff. The code in its entirety is: …

Member Avatar
Member Avatar
+0 forum 5

Hey guys I am looking for a delete javascript function that will work with this code here. I have tried a few that I have found online. They work however they only seem to delete the first row. If you add rows none of those can be deleted there after. I'm still learning java but the id for the row is "myCells" and the id for the delete button is "delBtn". So i'm thinking I need something like everytime you click "delBtn" it removes "myCells" for that row. I was trying to write it out: var x = "myCells"; var …

Member Avatar
Member Avatar
+0 forum 4

How do you access a variable inside a function without placing the variable inside of the function in Javascript ?

Member Avatar
Member Avatar
+0 forum 3

How do i return an array with the file names from folder? I have this till now but doesn't work. function showFiles($path) { $folder = "gallery/$path"; $i = 0; if (is_dir($folder)) { if ($handle = opendir($folder)) { while (($file = readdir($handle)) != FALSE) { if ($file === "." || $file === ".." || $file === "index.html") { continue; } if (!in_array($file, array('.', '..')) && !is_dir($folder.$file)) $arrayName = array($file); foreach ($arrayName as $fileArr) { $files[] = $fileArr; print_r($files); } } return $files; closedir($handle); } } } Any help will be appreciated :)

Member Avatar
Member Avatar
+0 forum 2

I'm attempting to print a variable print(<variableName>) but I get an error it's not a; function ? I searched online and all I could find is that; it's not a function so how can I fix this; I don't know another command.

Member Avatar
Member Avatar
+0 forum 5

What "Hello World" is to the console, the "Bouncing Ball" is to the Graphical User Interface. Nothing fancy, the ball is created via a call to the API function ellipse() and then bounced within the confines of the windows form. For the DEV C++ crowd: Let me know if you find these snippets somewhat helpful in your learning process in the comments section at the end.

Member Avatar
Member Avatar
+1 forum 22

hello friends. i have i simple c/c++ function that return the min of the array to the main function, in the body of the function i'm using an iterative loop so i would like to do it recursivly and i don't know from where to start! all reply are usefull thank you all Danifriends! #include<stdio.h> int minarr(int n, int *arr){ int i,min; for(i=0; i<n; i++){ if(min > *(arr+i)){ min = *(arr+i); } } return min; } int main(int argc, char const *argv[]) { int n=10; int tab[10]={7,5,6,8,7,4,8,9,2,3}; int min=minarr(n, tab); printf("%d", min); return 0; }

Member Avatar
Member Avatar
+0 forum 6

I am trying to pass a javascript variable into another function and keep getting undefined errors etc. In the first function I have chatName that I want to use as the display title only in the second function, you can see where I want it to appear in the div class chatboxtitle. Any help to get that vaiable there would be greatly appreciated. Thanks function chatWith(chatuser,chatName) { createChatBox(chatuser); $("#chatbox_"+chatuser+" .chatboxtextarea").focus(); } function createChatBox(chatboxtitle,minimizeChatBox) { if ($("#chatbox_"+chatboxtitle).length > 0) { if ($("#chatbox_"+chatboxtitle).css('display') == 'none') { $("#chatbox_"+chatboxtitle).css('display','block'); restructureChatBoxes(); } $("#chatbox_"+chatboxtitle+" .chatboxtextarea").focus(); return; } $(" <div />" ).attr("id","chatbox_"+chatboxtitle) .addClass("chatbox") .html('<div class="chatboxhead"><div class="chatboxtitle">'+chatName+'</div><div class="chatboxoptions"><a …

Member Avatar
Member Avatar
+0 forum 2

I have this code session_start(); $username = $_SESSION['username']; function getUserRole($username, $roleid){ $con=dbConnect(); $query="select * from user inner join userrole on user.id = userrole.userid inner join role on role.id = userrole.roleid where username = $username"; $sql=$con->prepare($query); $sql->bindValue(':username',$username); $sql->bindValue(':roleid',$roleid); $sql->execute(); $row = $sql->fetch(); $username = $row['username']; $roleid = $row['roleid']; if($row > 0){ return $username; } else{ return false; } } My pain is that when i query the database where the username = $username, the query returns nothing but when i use the text for username i get results. Do session variables work inside functions? What can i be possibly be doing …

Member Avatar
Member Avatar
+0 forum 7

Okay so I'm writing a code for a game and the way its currently programmed is the main menu is contained within a large function that references another function, and so on. Not too complicated. But (as you'll see with the code below) I have all the essential variables set before the functions even happen, at the very beginning of the code. import pygame, sys, time, math ##This is where the variables are set pygame.init() DISPLAY = pygame.display.set_mode((1023, 647)) WHITE = (255, 255, 255) BLACK = (0, 0, 0) GREEN = (0, 255, 0) clock = pygame.time.Clock() active = True …

Member Avatar
Member Avatar
+0 forum 1

I need to read from a txt file and then pass that array into another function which prints the data in a neat organised manner depending which type pf book it is... So if its audiobook then the book is listed under audiobook, if ebook then under ebook etc... I get lots of errors and my array isn't being passed to the function so i am getting very confused. This is my code thus far: #include <iostream> #include <string> #include <fstream> #include <iomanip> using namespace std; class Product { string title; string surname; string isbn; double wholesalePrice; // public: string …

Member Avatar
Member Avatar
+0 forum 1

Im using the youtube api to search for videos. The information gets displayed perfectly on the page similiar to the youtube page layout. I have a function that when each div is clicked it will create an iframe fixed to the top of the page playing the video that was clicked, but my problem is making the function work for only the div that is clicked. obviously if i put the function under the iframe function comment it will create an iframe for each object so if maxResults is 10 it will create 10 iframes. How do i go about …

Member Avatar
Member Avatar
+0 forum 2

Function stored in database is not executing. I have following code for output $q = mysql_query("SELECT * FROM pages WHERE page_id='$id'"); $r = mysql_fetch_object($q); //print the pages content echo "<h1>$r->page_title</h2>"; echo $r->page_content; **page_title** & **page_content** are database column **page_content** column have following data slider(); // it may be text or function OR both text + function slider function function slider(){ echo "Hey! You have Slider";// query to display slider images from database } **Output:** slider(); **Output Expected:** ***Hey! You have Slider***

Member Avatar
Member Avatar
+0 forum 5

I want to create a page like http://uhbvn.org.in/web/portal/faqs With Expand and Collapse all link Along with functionality of Individual Slide Toggle Feature I already worked like http://yamunanagar.nic.in/g/FAQs.asp But in this i have to create separate function for each toggle question Thanks in advance

Member Avatar
Member Avatar
+0 forum 5

Sir I have following codes to create table <?php function create_table(){ $query = "CREATE TABLE IF NOT EXISTS country ( id INT(6) not null AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) NOT NULL, reg_date TIMESTAMP)"; $host = "localhost"; $db = "mysql"; $user = "root"; $pass = ""; $conn = mysqli_connect($host, $db,$user, $pass) or trigger_error(mysqli_error(),E_USER_ERROR); $result=mysqli_query($conn,$query); $count=mysqli_num_rows($result); if($count==1) { echo ('<script>alert("Table created")</script>'); } } ?> <html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script> <script> $(document).ready(function(){ $("#button").click(function(){ create_table(); }); }); </script> </head> <body> <input type="submit" name="button" id="button" value="Create Table"> </body> </html> The codes are not working. Please help me to sort out. Thanks

Member Avatar
Member Avatar
+0 forum 1

Hey everyone, I decided to do a lot of echos to make a letter for different selections based off the user. Everything works well except that when the user selects one of the options, two different letters are shown on the page and it's only for one of the options. Would anyone know why this would be the case? function greeting() { echo $GLOBALS['Date']; echo "<br><br> Name: ". $GLOBALS['FirstName']. " ". $GLOBALS['LastName']; echo "<br> Address: ". $GLOBALS['Address']. ", ". $GLOBALS['City']. ", ". $GLOBALS['State']. " ". $GLOBALS['Zip']; echo "<br><br> RE: Account# ". $GLOBALS['AccountNumber']; echo "<br><br> Dear ". $GLOBALS['Gender']. " ". $GLOBALS['LastName']. …

Member Avatar
Member Avatar
+0 forum 2

Hi all, I've been trying to create a friendly time function for a while, it's purpose should be quite obiovus from the code below. Currently, it outputs "expired" for everything. I am so utterly confused from visualising the code and trying to figure out where the times lie in relation to each other, so I would really appreciate if some good soul could come along and make any suggestions. public function generateFriendlyTime($time) { if(!is_numeric($time)) { $time = strtotime($time); } $current_time = time(); if($time < $current_time) { return 'expired'; } //If less than a minute elseif($time < ($current_time + 60)) { …

Member Avatar
Member Avatar
+0 forum 2

First - so I don't get in any trouble - I've posted a similar question on other forums but have not gotten any responses so branching out in my quest for help as well as changing the question a little. Previously I was trying to find out why calling LoadUserProfile(...) was not creating the User Profile if it did not already exist (for example when creating an account programmatically) - MSDN had the following article on HOW TO but it doesn't seem to work (copy/paste the code and switched it to C# - account is created, no failures or exceptions, …

Member Avatar
Member Avatar
+0 forum 22

I'm having trouble solving this porblem. Write only the “snippet” of C++ code for a function definition, fillArray, which fills int_array. Repeatedly prompt the user to enter an integer at the keyboard. (Input values should be stored in row order). fillArray has one argument, the 2D array. 'Protect' arrray values from being changed by the function when necessary. This is what I have so far. void fillArray(int int_array) { for (int row=0; row<rows; row++) { for (int column=0; column<columns; column++) { cout <<"Enter an integer:"; cin>>int_array; } } }

Member Avatar
Member Avatar
+0 forum 2

I'm having trouble implementing this function definition, any help will be appreciated. Write only the “snippet” of C++ code for a function definition, printColumn, which prints to the console the values in a column specified by the user in the function call. printColumn has two arguments, the 2D array and a integer column number, listed in this order. ‘Protect’ arguments from being changed by the function when necessary. So far I have this. void printColumn (int int_array[][], int number) { for (int i=0; i<number; i++) { int_array[i].printColumn(); } }

Member Avatar
Member Avatar
+0 forum 2

i did a class for the timer precision using the timeSetEvent(). of course i can have more than 7 instances from the Timer class(with 200ms or something so small). is these a limitation or what? class Timer { private: static unsigned int TimerCount; UINT_PTR timerid; UINT m_uResolution=0; unsigned int TimerID=0; unsigned int intInterval=0; static void CALLBACK _TimerProc(UINT wTimerID, UINT msg, DWORD dwUser, DWORD dw1, DWORD dw2) { Timer* obj=reinterpret_cast<Timer*>(dwUser); if(obj->timerprocedure!=nullptr) obj->timerprocedure(); } public: std::function<void()> timerprocedure=EmptyEvent; Timer(std::function<void()> tmrprocedure=EmptyEvent) { TimerCount++; TimerID=TimerCount-1; timerprocedure=tmrprocedure; } void Stop() { if(timerid!=0) { timeKillEvent(timerid); timeEndPeriod (m_uResolution); } } unsigned int GetInterval() { return intInterval; } void …

Member Avatar
+0 forum 0

[CODE]<? $conn = mysql_connect("localhost", "your_username","your_password") or die(mysql_error()); mysql_select_db('your_database', $conn) or die(mysql_error()); ?> [/CODE] this is the code i have on database.php, when i run register page i get a erro. [QUOTE]Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'your_username'@'localhost' (using password: YES) in /home/a4595523/public_html/database.php on line 2 Access denied for user 'your_username'@'localhost' (using password: YES)[/QUOTE] what should i do / change?

Member Avatar
Member Avatar
+0 forum 5

Hi. I am new to the forum and I had a question. I have looked around and haven't really been able to find exactly what I am looking for. I am looking for the code in C++ to read in a random single line with spaces from a file. This is the file I have...(example.txt) the big green forrest gump blades of glory glory road animal house pirates of the carribean the seven little foys the lord of the rings the green mile cast away star wars it now and then the princess bride This is the code for a …

Member Avatar
Member Avatar
+0 forum 43

Hi, I cant check combo value below. Where is the mistake? Thanks [code] <script Language="JavaScript"> function validateR(){ var selectedCombobox=(form2.selectCombo.value); if (selectedCombobox=='All') { alert("Please select something"); return false; } return true; } </script> [/code] [code] <select name="selectCombo"> <option value="All">All</option> <option value="Other">Other</option> </select> [/code]

Member Avatar
Member Avatar
+0 forum 4

I have main PHP file, and dozen of less files, something like modules, they work this way (imaginary file): if ($_GET["action"] == "login") { require_once("login.php"); return login_something($_GET["credit"]); } That `require_once();` and `return function(data);` recur a lot in my code. It looks kinda nasty, is there no way to make this action more direct? As in (imaginary code): `return require_once("login.php"):login_something($_GET["credit"]);`? Like a one-liner. *Please, don't ask why I seperate functionality of codes in different files, it's easier for me to maintain by just looking at it's name and search through robust code. Instead of scrolling 5000 lines PHP file.*

Member Avatar
Member Avatar
+0 forum 3

The End.