I create a project encrypt and decrypt data in vb.net how to use this code as a function please help it is work only on a textbox i want to send a string value then return encrypt value and when i send encrypt value then send me decrypt value. [Click Here](https://www.daniweb.com/programming/software-development/threads/375789/encrypt-decrypt-vb-net) **What I have tried:** `Private arLetterChars() As Char = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 "` `Private arEncryptedChars() As Char = "******************************************************"` **' encrypt.** Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button4.Click With TextBox1 For Each myTextBoxChar As Char In .Text '// loop thru TextBox, one char. at a …

Member Avatar
Member Avatar
+0 forum 1

Hi, How can i calculate time difference in swift 2 between two dates/time and store in 2 different variables, one showing the full difference in terms of "Year, Month, Days, Hours, Minutes" & one variable for converting the total time difference in minutes. For example- First Date/time - 04/13/2016 8:11 AM Current Date/Time - 04/22/2016 12:53 AM Now one variable should display difference as "8 Day 16 hours & 43 Minutes", if there was a year & month difference, it should show that as well. And second variable should simply convert "8 Day 16 hours & 43 Minutes" into minutes …

Member Avatar
Member Avatar
+0 forum 3

im having a problem controlling a stepper motor using a microcontroller..what i did is that i test it with my board coz it has led's to check whether its working or not..we are tasked to make a program in c++ that would make a variable reluctance stepper motor work. If you press the the R button the rotor of the stepper motor will turn forward (clockwise), if you press L it will turn backward (counter clockwise), and if you press S the program will stop.. so how would you be able to make a program out of this conditions?

Member Avatar
Member Avatar
+0 forum 24

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

post

Member Avatar
Member Avatar
+0 forum 6

How to check in **vb6 ** if variable value is a string(**except for special character**) or number? Thanks, - Jeff -

Member Avatar
Member Avatar
+0 forum 1

I want to use Tkinter funtion to create a a temperature calculator. I have all the code for the calculator, however using Tkinter function i cant figure out how to get the variable input by the users. I am new to python and programming, just started programming less then a month, so please give detailed codes. Thank you. P.S. I'm using Python 3.2.2.

Member Avatar
Member Avatar
+0 forum 4

Hi all , i want to cast the output of fuzzy logic algorithm into any another type (float , int ,double..), i tried this with usual methods but there is no change.. This is the complete java code public static void main(String[] args)throws Exception { String filename = "output.fcl"; FIS fis = FIS.load(filename, true); if (fis == null) { System.err.println("Can't load file: '" + filename + "'"); System.exit(1); } // Show FunctionBlock fb = fis.getFunctionBlock(null); // Set inputs fb.setVariable("input1", 3 ); fb.setVariable("input2", 9.9); // Evaluate fb.evaluate(); JFuzzyChart.get().chart(fb); // Show output variable's chart Variable output = fb.getVariable("output"); JFuzzyChart.get().chart(output, output.getDefuzzifier(), true); } …

Member Avatar
Member Avatar
+0 forum 3

If user issues a query, I would like AJAX to download the result of query into browser so that JavaScript can do the parsing. The results could be around 1MB-5MB (at most, doubt it would get anywhere near 0.1MB), and I would send it from PHP to front-end using JSON, then convert it into array, which I would then parse depending on users expectations. Given that 57KB is what my asset is worth (project not finished), DaniWeb is for example 1.232kB (as my browser receives it). Would containing 5MB of data in a single array-variable hurt the performance of a …

Member Avatar
Member Avatar
+0 forum 5

I want to echo the url which includes an onlick property. Here is my code below: function royal_sidebutton_body_tag_html() { // get plugin option array and store in a variable $royal_sidebutton_plugin_option_array = get_option( 'royal_sidebutton_plugin_options' ); // fetch individual values from the plugin option variable array $royal_sidebutton_text_for_tab = $royal_sidebutton_plugin_option_array[ 'text_for_tab' ]; $royal_sidebutton_tab_url = /*$royal_sidebutton_plugin_option_array[ 'tab_url' ]; */ 'https://www.example.co.uk">'; $royal_sidebutton_target_blank = $royal_sidebutton_plugin_option_array[ 'target_blank' ]; // set the page target if ($royal_sidebutton_target_blank == '1') { $royal_sidebutton_target_blank = ' target="_blank"'; } // Write HTML to render tab echo '<a href="' . esc_url( $royal_sidebutton_tab_url ) . '"' . $royal_sidebutton_target_blank . '><div id="royal_sidebutton_tab" class="royal_sidebutton_contents royal_sidebutton_left">' . esc_html( …

Member Avatar
Member Avatar
+0 forum 1

How can I use a variable in a MySQL select statement? Code: $serverid = $_SESSION['server_id']; $sql = "SELECT * FROM servers WHERE server_id = '$serverid'";

Member Avatar
Member Avatar
+0 forum 3

Hello All. I'm trying to loop the following statement with PHPmyAdmin in order to add 1000 entries with the variable "i" incremented for each entry. (data and ip can be static) INSERT INTO 'TABLE'('id', 'data', 'ip') VALUES ([i], [06/03/2016],[192.168.0.1]) It's been 20 years since I've done any coding with loops. Can anyone help me?

Member Avatar
Member Avatar
+0 forum 3

The eror says: llegal static declaration in inner class Question1.Question1Listener modifier 'static' is only allowed in constant variable declarations ---- /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author 1001334386 */ import java.awt.*; import javax.swing.*; import java.awt.Event.*; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class Question1 extends JFrame{ JLabel txt1 = new JLabel("Number 1"); JTextArea txtarea1 = new JTextArea(); JLabel txt2 = new JLabel("Number 2"); JTextArea txtarea2 = new JTextArea(); JLabel resulttxt = …

Member Avatar
Member Avatar
+0 forum 2

Hi all, In all my time with PHP I have only ever seen one way of adding a variable onto the end of the string: $string = "hello" . $variable; However, recently I came across another method, which was used in the context of constructing a mySQL query. Can someone explain the difference? It seems like a much easier way to achieve the same result: $sql = "SELECT * FROM {$table}";

Member Avatar
Member Avatar
+0 forum 4

I have problems with the following program which is long to post at once so I will explain what are the problems step by step. 1. Define two structs that represents books and a bookstore as following: typedef struct { char id[14]; char title[16]; int availableNumOfBooksWithSameTitle; }BOOK; typedef struct { char bookstoreName[31]; int totalNumberOfBooksInBookstore; BOOK *books; }BOOKSTORE; 2. Write a function that reads n books. If the book with previously read ID already exists, then just increment variable availableNumOfBooksWithSameTitle. void readBook(BOOK *bk) { printf("ID: "); scanf("%s",bk->id); while(strlen(bk->id) != 13) { printf("Invalid ID length. Try again.\n"); printf("ID: "); scanf("%s",bk->id); } printf("Title: …

Member Avatar
Member Avatar
+0 forum 1

hello friends sorry for posting this basic question here but i can't figure it out why my variable "tasse" is getting 8 or (the value of variabale i) in this code below. #include <stdio.h> int main(){ int leght = 15; int tasse =0; int random; int array[15]={1,5,4,7,8,5,1,0,9,7,0,0,5,4,10}; int i,j; for(i=0; i<leght; ++i){ if(array[i]==0){ //increase variable tasse by 1 BUT IT IS GETTING VALUE 8 CAN'T UNDESTAND WHY// tasse++; /*FOR J FROM I WE ARE FINDING A VALUE >0 TO EXCHANGE WITH I THIS WORKS WELL*/ for(j=i; j<leght; ++j){ if((array[i]==0)&&(array[j]>0)){ array[i] = array[j]; array[j]=0; } } } } leght -= tasse; …

Member Avatar
Member Avatar
+0 forum 4

I have a php page that lists a bunch of data including id's from a database. I then have a button next to each id that will open a Twitter Bootstrap modal window in the page and I need to pass the php variable (the id) to that model window so that I can do a mysql query in it. My issue is the model window is just displaying the textbox I setup that should be showing the unique id. However instead it is showing the textbox with just the word "null" in it. My code is below The link …

Member Avatar
+0 forum 0

I am trying to assign a method to a varibale called from a constructor, but it returns null when I am calling it. public class ProjectManager { Calculation a = new Calculation(); private Scanner in = new Scanner(System.in); private Scanner price = new Scanner(System.in); private Scanner duration = new Scanner(System.in); private String input; private Calendar calendar = new GregorianCalendar(); private SimpleDateFormat sdf = new SimpleDateFormat("dd-MMMMM-yyyy"); private String printCal = sdf.format(calendar.getTime()); private AdvertisementType ad = new AdvertisementType("webAdvert", "email", "radio"); private AdvertisementType[] array = new AdvertisementType[1]; double aa = a.getTotalPromotion(); When i try to print out "aa varibale" it gives me null …

Member Avatar
Member Avatar
+0 forum 1

The following is a similar program I had when having trouble: float x; int n=0; cout << "enter some numbers separated by space; enter 1.2 when done: "; cin >> x; while (x!=1.2) { n++; cin >> x; } The problem is, when using certain numbers as the sentinel (in the above it's 1.2), the sentinel would not work, i.e. it would always wait for the next input, even though it's supposed to end. There was no pattern which numbers worked or not, e.g. maybe 2.2, 4.5, didn't work, but 5.5 worked. But chaning the type of x from float …

Member Avatar
Member Avatar
+0 forum 1

Given Problem: A professor at Hardtack University has an unusual method of grading. The students may or may not all take the same number of tests. The individual tests are weighted, and these weights are used to compute the student's average. Important: the weights for all of the tests for a given student must add to 100. Assuming that w1 ... wn are the weights, and g1 ... gn are the grades, the average is computed by the formula: ((w1 * g1) + (w2 * g2) + ... + (wn * gn)) / 100 The names of the students and …

Member Avatar
Member Avatar
+0 forum 2

Yes I did read these two posts. http://stackoverflow.com/questions/3082914/c-compile-error-variable-sized-object-may-not-be-initialized http://stackoverflow.com/questions/14186879/c-error-variable-sized-object-may-not-be-initialized My case is a bit different because I'm using `char * ptr[buflen]`. This is what I have tried: char *ptr[buflen] = {0}; //This gave me the variable sized object error. char *ptr[buflen]; memset( ptr, 0, buflen*buflen*sizeof(char)); //I figured this would work with looking at the previous examples. //This seemed to work but I am curious if I need to use free or malloc after looking at the previous examples. I don't want this to seg fault later in the program and have no clue what is causing it. char *ptr[buflen]; memset(ptr, …

Member Avatar
Member Avatar
+0 forum 2

Hi, I'm trying to .push several urls to a global variable inside a function of a javascript and casperjs script. The global variable does not seem to be filled with the data. var page_links = ['http://www.olx.pt']; var product_links = []; casper.start(); function spider(url) { casper.open(url).then(function() { var pager = this.evaluate(getMorePages); // get the product_links of the webpage var temp_links = this.evaluate(getLinks); for (j = 0; j < temp_links.length; ++j) { product_links.push(temp_links[j]); this.echo("temp_link: " + temp_links[j]); this.echo("product pushed: " + product_links[product_links.length - 1]); } for (var i = 0; i < pager.length; ++i) { var new_url = pager[i]; if (! existsInArray(new_url, …

Member Avatar
+0 forum 0

xml output: <balance> <credits>39660</credits> </balance> how to fetch the xml output from url and store the credits i.e. 39660 into php variable. the above xml output is coming from following url http://www.xyz.com/check-balance.php?username=ssgent&password=ssgentr check-balance.php code: <?php require('dbcon.php'); include('encrypt.php'); include('functions.php'); $username = $_GET['username']; $password = $_GET['password']; $password = encrypt($password, 'riffre'); $url = $_SERVER['HTTP_HOST']; $url_length = strlen($url); if (substr($url, 0, 4) == 'www.') { $url_length = $url_length - 4; $url = substr( $url, 4, $url_length ); } $query = "select * from users where username='$username' and password='$password' and status='Active'"; if(!($result = mysql_query($query))) { exit(mysql_error()); (bool)true; } $crq=mysql_fetch_array($result); $userid = $crq['id']; $rows = mysql_num_rows($result); …

Member Avatar
Member Avatar
+0 forum 5

Hi all, I have a multi-dimensional array. Using a **for** function, I would like to display the information inside the array. This means using a variable $i for the first index of the array, which I think is causing the problem. I am getting the error message: `Undefined offset: 2` Note, that the number changes depending on the value of $i. The code I am using is: $created = $results[$i]['data']; But I get the above error when I echo that information inside the for loop. Is this because you can't use variables as indexes for arrays?

Member Avatar
Member Avatar
+0 forum 6

So I have 2 files: M.java, and construct.java. In construct .java, I have 5 instance variables, and made a constructor to initialize the variables. I have also created an getters, adn setters for each instance variable. In Main. java, I created an array: construct[] c= {new construct(int1, string1, string2, string3, int2, int3), new construct(int4, string4, string5, string6, int5, int6)}; Now, I want to show int1, when I compare string1, and another variable string, and the tresult is true It is giving me: "void type not allowed here"

Member Avatar
Member Avatar
+0 forum 1

// Program to show swap of two no’s without using third variable #include<stdio.h> #include<conio.h> void main() { int a, b; printf("\nEnter value for num1 & num2 : "); scanf("%d %d", &a, &b); a=a+b-(a=b); //Swaping printf("\nAfter swapping value of a : %d", a); printf("\nAfter swapping value of b : %d", b); getch(); }

Member Avatar
Member Avatar
-3 forum 13

Why my $last_id variable is null always ? i am using this scirpt for ajax..but i tried to excute without my ajax page,it works fine and the output give me `{"data_from_file":"ghjghj","timestamp":1441695735,"msg_id":"1190","reciver_id":"12","sender_id":"10"}` when i want to check my $last_id variable that was null, <?php set_time_limit(0); $con = mysqli_connect('localhost','root','') or die ("Could not connect to the Database"); mysqli_select_db($con,"msg") or die("Cannot find the database"); error_reporting(E_ALL); $last_id=null; while (true) { $last_ajax_call = isset($_GET['timestamp']) ? (int)$_GET['timestamp'] : null; $date = new DateTime(); clearstatcache(); $last_change_in_data_file = $date->getTimestamp(); $last_change_in_data_file; if ($last_ajax_call == null || $last_change_in_data_file > $last_ajax_call) { /*$mydbid= 10; $name=11;*/ $lastid=mysqli_query($con,"SELECT * FROM massg ORDER BY …

Member Avatar
Member Avatar
+0 forum 2

Hi, I was learning operator overloading and I noticed a very strange thing. I could access the private variable of another object by using the object reference and the . operator. Both the objects belong to the same class and I can alter the value of a private variable of object b by using its reference in the overloaded function for the + operator. Below is my code: #include<iostream> class complex{ private: float real; float imag; public: void display(void){ std::cout<<real<<" + j"<<imag<<std::endl; } complex(){ } complex(float r, float i){ real =r; imag=i; } complex operator + (complex &); }; complex …

Member Avatar
Member Avatar
+0 forum 2

i have an array of usernames and if a specific name is entered then code should say i know you concatenated with input name...this part is working fine...the problem is in `if(!$knowyou)` this line of code is giving the error of **undefined variable** i'm not getting it i tried to resolve it by declaring variable to to top of code i.e giving variable a global scope but this doesn't solve my problem i also tried defining variable at different places but it doesn't work for me...please anyone of you can explain the solution of error?? if you have time then …

Member Avatar
Member Avatar
+0 forum 2

Hi, from the result in my "for" loop, have stored four value. How to extract that value to show the value(sprintf) ? Kindly refer to the attached the image file. Thanks Regrads, nazif

Member Avatar
Member Avatar
+0 forum 2

The End.