Hi Dw. I'm trying to read a text file. This text file has a multiply lines and what I want is that I want to separate each line or should I say I want to split each line (chop it) so that I will be able to assign these fields to variables using the array. What I first did is to get the lines then for each line I need to break it. The split I'm using the "*" as a separator. Each line will produce/has 13 fields so I want to get these as a variable. Here is just …

Member Avatar
Member Avatar
+0 forum 12

session start has been evoked. I need the value of $v. $key = $_SESSION['sys_var_key']; $v = $_SESSION[$key]; echo '<br>key =>'.$key; echo '<br>value =>'.$v;

Member Avatar
Member Avatar
+0 forum 1

!USING PYTHON 3.1! Hello DaniWeb! Today I'm going to teach you a cool variable trick that I learned. So here's an example: [CODE] a, b, c = input('?x?x?: ').split('x') [/CODE] Now let's input something like: [CODE] >>> a, b, c = input('?x?x?: ').split('x') ?x?x?: 1x2x3 [/CODE] Now, variable 'a' is set to 1, variable 'b' is set to 2, variable 'c' is set to 3. I hope I explained that well enough. It can be used in various sections. NOTE: Because you used 3 variables, you [B]have[/B] to have three answers divided by the character you split with. If you …

Member Avatar
Member Avatar
+6 forum 11

In the good old days of VB6 I used to use this technique to communnicate between programmes, without using external files. In fact I could even set off the textbox interupt in the running programme so as it could do something once triggered. This being said, I can't get it working on dot net. Does any one have any idea on how to setup the same type of programme using dot net.

Member Avatar
Member Avatar
+0 forum 2

Hey guys! I have a quick question that I think is a simple mess up. I am trying to make a console word game in c#, and I have different classes, and a main class that calls those classes. I first have the Player class, and the CreateCharacter class. My player class houses all of the variables that pertain to the player of the class (level, stats etc.), and my CreateCharacter class is what calls on the startup of the game, which asks the name, race, class they want the character to be. So far that is well and good, …

Member Avatar
Member Avatar
+0 forum 5

Group, I'm using TOAD to query the Oracle database. My better expertise is in VB.net. I have very little SQL experience. My question: Can I create a variable in TOAD/SQL to prompt for a date(s)? Here is what I want to do: Question 1: Enter Beginning Date (user to enter date value that looks like this: 01/01/2015) Question 2: Enter Ending Date (user to enter ending date value, i.e. 04/30/2015) I then will need to create two further variables based on these first two to represent the prior years dates (i.e 01/01/2014 and 04/30/2014). I would know how to do …

Member Avatar
Member Avatar
+0 forum 6

Hey everyone, Got 2 questions here that i'm hoping will be answered. Say i have 2 variables int iValue; int iValueArray[300]; and later on init. them in the constructor Banana::Banana(): ival(0), ivalArray() {} 1. What would the ivalArray() indicate? Would it be the same as initializing every element to null/empty? Or does it actually mean something else such as every element is init. to 0? 2. I've always initialized variables in constructors like Banana::Banana() { iValue = 0; ... } is there a difference between initializing after a colon and before the {} and initializing inside the {}. I understand …

Member Avatar
Member Avatar
+0 forum 4

I'm not sure if this should be in this forum but I figured it was a good starting place. I am creating a database that, among other things, allows users to input a store's location (e.g. name, address, etc). Once a store has been added, there is an ability to go into a single store's "page" to view all of it's information including name, contact info, reviews, comments, etc. What I would really like is the ability for a Google Map to generate automatically when the page loads with the store's name and address listed (and pulled up in the …

Member Avatar
Member Avatar
+0 forum 6

Hi Hope,everyone is doing good out there. I need some help regarding which strategy to use for one of my projects. Here are the project details I want to generate PDF forms, by gathering data from user.There are different questions to ask and based on each answer,we will ask next question.i.e Where do you live? If s/he reply USA, next question will be regarding USA,if s/he reply Outside USA,next question will be different. I'll use FPDF to generate PDF on the go. But my question is how to implement questionnaire.Where should we store the values, either in session or Mysql …

Member Avatar
Member Avatar
+0 forum 6

I have the following javascript code var list = [ { Date : '2014-12-31 12:23:43', DateStart: '1980-12-30 23:43:42', Name: 'Kate', ... ... }, { Date : '1978-05-21 23:43:65', DateStart: '1973-04-06 12:34:09', Name: 'John', ... ... } ]; And the following code to verify for regex pattern: for (var i in list) { var data = []; if (/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/.test(list[i].?)) { data.push({ Data: list[i].Data }); } } What can I do to all columns be verified for the date pattern? Making the array date stay only with the values 2014-12-31 12:23:43,1980-12-30 23:43:42,1978-05-21 23:43:65,1973-04-06 12:34:09

Member Avatar
Member Avatar
+0 forum 2

Sometimes you want the value of a variable to be related to its name in the source code. For example, the variable x should have the value "var x". This is especially useful when you perform symbolic computations with python (with the sympy module for example). In standard python, the only way to obtain this behavior is to repeat the name of the variable in the call to the function which creates the value. For example `x, y, z = create_values(varnames = ('x', 'y', 'z'))`. This snippet defines a decorator `with_varnames` which can be applied to the value creation function …

Member Avatar
Member Avatar
+0 forum 4

i am missing something <?php $target = "images/dars/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; if (file_exists($_FILES['uploaded']['tmp_name'])) { echo "Sorry, file already exists."; $Ok = 0;} //This is our limit file type condition if ($target!=="image/jpg") { echo "You may only upload jpg files.<br>"; $ok=0; } //Here we check that $ok was not set to 0 by an error if ($ok==0) { Echo "Sorry your file was not uploaded"; } //If everything is ok we try to upload it else { if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded"; } else { echo "Sorry, there …

Member Avatar
Member Avatar
+0 forum 5

Hi everyone I have a script which contains contains mostly JavaScript. After various bits of user input, it ends up with an array which contains 6 times (hh:mm) and these can be access by times[0] thru times[5]. Obviously these variables would be available on a clients PC. Another PHP programmer wants to access these 6 variables and use them within his PHP script to display to the user. What I'm trying to figure out is some way to "present" these variables in such a way that this other programmer can pick them up and do whatever he (or she) wants. …

Member Avatar
Member Avatar
+0 forum 6

print ("The scope of this program is to multiply two matrices together\ and print the result") while True: matrix1_rows = input("How many rows does matrix one have? ") matrix1_columns = input("How many columns does matrix one have? ") print ("Matrix one is a", matrix1_rows, "x", matrix1_columns, "matrix") print() matrix2_rows = input("How many rows does matrix two have? ") matrix2_columns = input("How many columns does matrix one have? ") print ("Matrix two is a", matrix2_rows, "x", matrix2_columns, "matrix") if(matrix1_columns != matrix2_rows): print("\nSorry, cannot multiply these two matrices, must be (mxn)*(nxp)") else: break print("----------------------------------------------------------") print("\nThe system will now take values for matrix …

Member Avatar
Member Avatar
+0 forum 3

I am trying to make a function that rounds number.. I declared the function above the main and voided it Then I recalled the function in the program and listed the variables needed in brackets and then I wrote the function I can't work out what is wrong. [ICODE]#include<stdio.h> #include<math.h> void round2int(float,float); int main (void) { float roundednum,x; do { printf("Enter a number (Enter zero (0) to quit program)"); scanf("%f",&x); round2int(x,roundednum); } while(x!=0); fflush(stdin); getchar(); return 0; } void round2int(float test, float number) { float number,test; number=floor(test+05); printf("%f",number); }[/ICODE]

Member Avatar
Member Avatar
+0 forum 8

Hello, guys, I encountered a big problem. There is a genereted matrix of buttons: private void Single_Load(object sender, EventArgs e) { //code here for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { //a lot of working code here b[i, j].Click += new System.EventHandler(ClickButton); } } } What can I do when one of those buttons is pressed (i have the method `ClickButton`) to know what *i* and *j* has he? I want to make smoething like this ClickButton() { if (x%2==0) v[i, j] = x; //i and j should …

Member Avatar
Member Avatar
+1 forum 2

Friends I have a problem in totalling the variable .When I use my code I am not getting the answer as I expected. My code is as below Jsharbal = Format$(TRS("Sharbal"), "#,##0.00") Jworkbal = Format$(TRS("workbal"), "#,##0.00") Jsalabal = Format$(TRS("Salabal"), "#,##0.00") Jprofit = Format$(TRS("Prflbal"), "#,##0.00") CRTOTAL = (Val(Jsharbal.Caption) + Val(Jworkbal.Caption) + Val(Jsalabal.Caption)+ Val(Jprofit.Caption)) LblCrtotal.Caption = Format$(CRTOTAL, "#,##0.00") the values of my above variables are 900,000.00,4,500.00,30,000.00,10,000.00 When working I am getting the answer as 944.00 Instead of 944,500.00 Why this mistake. and if I am changing the above code like this Jsharbal = TRS("Sharbal") Jworkbal = TRS("workbal") Jsalabal = TRS("Salabal") Jprofit = …

Member Avatar
Member Avatar
+0 forum 2

Hi all, I am working on the following code and I am having a problem with defined variables. On the output on the Submitted and Username Inputs as being undefined. I have added $username = (isset($_POST['Username'])) ? $_POST['Username'] : ""; at the start of the function but not suppressed. Thanks for your help David index.php <?php session_start(); ob_start(); include_once ("includes/settings.php"); include("includes/functions/functions.php"); //include_once ("includes/optional.php"); var_dump($_POST); $Errors = ""; $_SESSION['LoggedIn'] = false; $_SESSION['UserID'] = ""; $_SESSION['UserAdmin'] = false; if ($_POST['Submitted'] == "true") { // process submitted data $userSQL = $Database->Execute("SELECT UserID, UserFullname, UserEmail, UserLastPassword FROM Users WHERE UserName = '" . mysql_real_escape_string($Text->ValidSQLString($_POST['Username'])) …

Member Avatar
Member Avatar
+0 forum 8

I'm starting my Computing project and am using Python linked via sqlite3 to a database. As part of my project I shall be searching for maths books in the database via name or module etc. I wish to display the results on a GUI in python so need to set variables to the results depending on the amount of results. I assume an list with a for loop setting each value in the list as a id of a book and then retrieving data via the id would work but I don't know how to set the results as the …

Member Avatar
Member Avatar
+0 forum 1

import os import web import traceback import datetime from functools import wraps ### Url mappings urls = [ '/', 'index', ] def addfolderhandler(f,root): u = os.path.join(root,f) u=u.strip("/").strip("\\") ident=u.lstrip("C:/Users/James/Desktop/it").replace("/","SLASH").replace("\\","SLASH").replace(".","DOT").strip() #replace invalid python expressions with valid ones globals()[ident] = "<h1>Directory listing for:%s</h1><hr>"%u+''.join(["<a href="+i+">"+i.lstrip(root)+"</a><br/>" for i in os.listdir(u)])+"<i>Python Server</i>" if ident=="": return try: exec(""" class %(classname)s: def GET(self): global %(data)s return %(data)s """%{"classname":ident+"server","data":ident}, globals(), globals()) #create a class as if were created in the global scope by passing in globals() as locals urls.extend((u.lstrip("C:/Users/James/Desktop/it").replace("\\","/"),ident+"server")) #use u not ident because ident has stuff like SLASH and DOT except: print"WARNING:Cannot Make Folder Handler for:"+ident def addfilehandler(f,root): …

Member Avatar
Member Avatar
+0 forum 1

I'm having difficulty opening message content for each unique message because I'm struggling to get the PHP variable `$message['id']` to a url defined in a javascript file. My foreach loop that echos out all of the messages for the user: foreach($mess_data as $message){ echo' <tr '.(($message["read"] == '0') ? 'class="unread"' : 'class=""').'> <td class="inbox-small-cells"> <input type="checkbox" class="mail-checkbox"> </td> <td class="inbox-small-cells">'.(($message['read'] == '0') ? '<i class="icon-envelope"></i>' : '<i class="icon-eye-open"></i>').'</td> <td class="view-message hidden-phone">'.$message['from'].'</td> <td class="view-message ">'.(($message['subject']) ? ''.$message['subject'].'' : 'This message has no subject.').' </td> <td class="view-message inbox-small-cells"><!--<i class="icon-paper-clip"></i>-></td> <td class="view-message text-right">'.$message['time'].' '.$message['date'].'</td> </tr>'; } } including the JS files: <script src="assets/plugins/jquery-1.10.1.min.js" …

Member Avatar
Member Avatar
+0 forum 19

Hi I was taught not to use global variables and one of my friend is using global variable for database handle for his website... could you please explain if there is an issue if he uses global variable for database handle? he is using it to access database from anywhere in the application.. so he doesn't need to connect to db every time but surely if someone has access to this global variable they can wipe the data in the database... could someone please explain if it is possible for someone(hacker) to access global database handle variable and run queries …

Member Avatar
Member Avatar
+0 forum 1

Hello, I need to pass an array from a VB6 application to another application. How can I do? Thank for help

Member Avatar
Member Avatar
+0 forum 2

Please can anyone explain clearly.... what is the difference between session and httpcontext.current.session and application variables? Thankyou in advance...

Member Avatar
Member Avatar
+0 forum 12

I would like to have a file in my project which contains variables for use by all classes. I this possible to accomplish efficiently. I have heard that using a module with static varibles could work.

Member Avatar
Member Avatar
+0 forum 3

I stumbled on upon this anomaly in one of my programs and can't figure out why this is happening. I made a small test function that exhibits the same behavoir. It's like the local variables of my function are being saved after the function exits. The exclude_ids variable keeps growing. This same behavoir is apparent in IDLE, from cmd line, and when compiled. Tested on windows XP & 8. Python 2.7.4 >>> def is_running(exe_name, by_path=False, exclude_ids=[], exclude_this_process=False): from os import getpid from os.path import basename, abspath if exclude_this_process: exclude_ids.append(getpid()) print "exluded ids %s" % exclude_ids return "-----------------" >>> for x …

Member Avatar
Member Avatar
+0 forum 6

Hello, I created an XBAP web application which I already implemented on my website but I am wondering if it would be possible to pass PHP variables like session etc. to the app itself? I know it's possible with ASP.net, but I am not sure for this one. For example, the username session would be passed to the xbap app and it would be inserted to the database when someone made some changes using the app. Thanks.

Member Avatar
Member Avatar
+0 forum 1

Hi everyone and thanks for reading! I use JavaScript to create sets of text boxes on the fly. I also have a hidden counter in a text box on the form which I also post to my PHP script. This hidden counter is how I tell PHP how many text boxes there are upon post (as PHP would have no idea if the user generated one more set, or ten more sets!). [CODE] if (isset($_POST["submit"])) { // Bind the value of the counter to a variable. $counter = $_POST["counter"]; echo "<p>There are <strong>" . $counter . "</strong> sets of text …

Member Avatar
Member Avatar
+0 forum 26

The following code gave error on gcc compiler int main() { extern int a; printf("%d",a); return 0; } static int a=5; But when static is removed from int a then it runs with no errors..Can someone please clear the doubt??

Member Avatar
Member Avatar
+0 forum 10

Hey guys, below is my code, I am working on trying to PASS Variables to a popup window. I have it to where it show the embed window(which is blank) link, the title(which is blank) and instuctions(which is blank), but I cannot get it to pass the variables of what I want to the popup window. I will also append the popup window for you. Thanks everyone for your help. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Exercise Video Library</title> <link href="twoColHybLtHdr.css" rel="stylesheet" type="text/css" /><!--[if IE]> <style type="text/css"> /* place css …

Member Avatar
Member Avatar
+0 forum 13

The End.