Years ago I wrote a program in Fortran for a structural analysis class. At the time I had very little programming experience and mottled my way through the assignment. Fast forward to now and I'm attempting to teach myself Python 3. I figured I'd would try to convert the old program from Fortran to Python. I've made some good progress but I've hit a wall. I've got the program running to the point where all the element stiffness matrices are defined and combined into the structure stiffness matrix using the code number technique. The structure stiffness matrix is triangular. At …

Member Avatar
Member Avatar
+0 forum 7

Hello all, I need to validate google oauth2 access token... I found one script online but it is stuck on cURL function... I suppose JSON to ARRAY conversion or something similar.. but I dont know how to solve it.... can anyone show me? PLEASE!!! when I run it... it gives me this error: ***Notice: Trying to get property of non-object in C:\xampp\htdocs\----*** ** Here is the script:** <?php define('CLIENTID','xxxxxxxxxxxx.apps.googleusercontent.com'); define('CLIENTSECRET','xxxxxxxxxxxxxxxxxxxxxxx'); define('URLCALLBACK', 'http://xxxxx.com/googcallback.php'); define('URL','http://xxxxx.com/'); function request_token($code){ //Solicita el token a google a con el código pasado $tokendata = array(); $ch = curl_init('https://accounts.google.com/o/oauth2/token'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "code=".$code."&client_id=".CLIENTID."&client_secret=".CLIENTSECRET."&redirect_uri=".URLCALLBACK."&grant_type=authorization_code"); curl_setopt($ch, CURLOPT_RETURNTRANSFER , …

Member Avatar
Member Avatar
+0 forum 7

I am currently confused and not sure why. I believe I have stared at this for to long. I am currently just trying to populate a ComboBox with the data that is read in from a SQL DB through a SQL query. Currently I have the below code. I am confused as to why I would get the error, " conversion from string "cname" to type 'Integer' is not valid. Private Sub QuoteInfo_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'Loads the Existing customers names in the Customer Dropdown Mysqlconn = New SqlConnection Mysqlconn.ConnectionString = "Server=RTIRAKLAP\SQLEXPRESS;database=GriseDB;Trusted_Connection=yes;" Dim READER As SqlDataReader …

Member Avatar
Member Avatar
+0 forum 3

Hi Daniweb, I am working on an assignment that is aimed to help us understand floating points. The current task is to take a number as input, example 3.5, or 2.25 etc and output it as a binary decimal, ex 11.100000000, 10.0100000000. To do this, I am taking the whole number and floating point seperately, converting them seperately and storing them seperately. The whole number part is working ok, however an issue is coming with the decimal part: I am inputting it as a string, so .25 would be inputted as "25". I then convert it to binary by: 1) …

Member Avatar
Member Avatar
+0 forum 1

Can any one convert this Java code to c++? import java.util.*; import java.io.*; public class Test { private static HashMap<String, List<String>> left_map_rights; public static void main(String args[]) throws Exception { left_map_rights = new HashMap<>(); BufferedReader r = new BufferedReader(new FileReader("routes.text")); String line; HashMap<String, Void> lines = new HashMap<>(); while ((line = r.readLine()) != null) { if (lines.containsKey(line)) { // ensure no duplicate lines continue; } lines.put(line, null); int space_location = line.indexOf(' '); String left = line.substring(0, space_location); String right = line.substring(space_location + 1); if(left.equals(right)){ // rejects entries whereby left = right continue; } List<String> rights = left_map_rights.get(left); if (rights == …

Member Avatar
Member Avatar
+0 forum 1

I'm working on a C++ program to convert MPH to minutes and seconds. I'm stuck. This is my code so far. It runs, but when I key a value (i.e. 6.5), the program crashes and stalls. What I am overlooking?

Member Avatar
Member Avatar
+0 forum 12

Hello all, I am working through Beginning Microsoft Visual C# 2008 I was asked to create a console application that multiplies 4 input values. I decided to take all 4 values at once and multiply them. Here is my code: string inputNumbers; string userName; Console.WriteLine("Enter your name:"); userName = Console.ReadLine(); Console.WriteLine("Welcome {0}!", userName); Console.WriteLine("Now give me 4 numbers seperated by a space:"); inputNumbers = Console.ReadLine(); string[] numbers = inputNumbers.Split(' '); Console.WriteLine("The product of {0} * {1} * {2} * {3} is {4}.", numbers[0], numbers[1], numbers[2], numbers[3], Convert.ToDouble(numbers[0]) * Convert.ToDouble(numbers[1]) * Convert.ToDouble(numbers[2]) * Convert.ToDouble(numbers[3]) ); Is there an easier way to …

Member Avatar
Member Avatar
+0 forum 4

Hello again good people, i have done some coding on lexical analyzer phase of compiler but it is giving me some error that i am unable to understand.. Fair Warning: Code is a little longer. Here is the code: # include <iostream> # include <fstream> # include <string.h> # include <stdlib.h> # include <stdio.h> # include <conio.h> # include <ctype.h> using namespace std; const int Rows = 34; const int Cols = 15; int iTT[Rows][Cols] = {0}; void loadTransitionTable( ) { fstream File("tt.txt"); if (!File) { cout << "\n Cannot open the input file." << endl; cout << "\n Press …

Member Avatar
Member Avatar
+0 forum 5

Hello my fellow Daniwebaholics! I know it is kindof off the wall, but I need help converting a piece of C# code to VB.net. I know a little C#, but not enough to be able to convert complex syntax from one to the other. Here is the code in C#: [CODE] p.Location = new System.Drawing.Point(((Panel)PanelContainer[PanelContainer.Count - 1]).Left, ((Panel)PanelContainer[PanelContainer.Count - 1]).Bottom + 5); [/CODE] Where PanelContainer is an arrayList. Any help would be GREATLY appreciated. Thank you, BegginnerDev

Member Avatar
Member Avatar
+0 forum 2

The End.