I followed this site -> https://www.box.com/blog/how-to-debug-php-with-vim-and-xdebug-on-linux/ but I'm not having much luck. I followed the firections and my phpinfo() functions is showing that xdebug is up and running but I see don evidence of xdebug from within vim. I typed in my localhost url, localhost/mysite.php?XDEBUG_SESSION_START=1 and then wen to vim and pressed f5 but that didn't seem to have an effect at all. When I run `cat /var/log/apache/error.log` I get no errors showing. And here are my xdebug setting in my /etc/php5/apache/php.ini file ;My Modules [bash][Zend] zend_extension = /usr/lib/php5/20121212/xdebug.so xdebug.remote_enable = 1 xdebug.remote_port = 9000 xdebug.remote_host = localhost [/bash] Any …

Member Avatar
Member Avatar
+0 forum 1

I'm sorry I keep having these strange problems but there's little I can do about them, they are unpredictable. I managed to fix the last one and I've been able to compile and run my programs. Now however I've run in to the *strangest *of problems, the one described in the title. I've set breakpoints in the constructor call and the header I created; and the program just skips past everything and straight to return. I have a picture: ![ProgramSkip.GIF](/attachments/large/4/361e7aa7e6b6f2f0076ea0cb116be8f0.GIF "align-center") My code does some cout statements in the header (for debugging) so there should be something in the command …

Member Avatar
Member Avatar
+0 forum 4

Hello, I feel like this is probably something silly, but for some reason if I declare a variable at a certain point in my code, then never use it... it crashes. This is literally what happens: //... code here int isBuf=0;//one of my variables int zeroAddr=0;//<-- another variable I want, but never ever use (yet) while (!file.eof())//code continues //... The above crashes while //... code here int isBuf=0;//one of myvariables //int zeroAddr=0;//<-- another variable I want, but never ever use (yet) while (!file.eof())//code continues //... Works perfectly. I have checked and zeroAddr is used absolutely nowhere else in my code. …

Member Avatar
Member Avatar
+0 forum 3

Hi, I'm newbie in Python Programming. I created the below code. I want to optimize it, but dont know where to start. I am sure, I can do the same with less lines of code. Please advise on best practices and ways on how to optimize it. import math def side_1(): print '' print "**********************************" print " Pythagorean Calculator " print "**********************************" print '' a = raw_input("Please enter the value of A: ") b = raw_input("Please enter the value of B: ") if a.isalpha(): print "Sorry, that is not a valid option." else: a = float(a) b = float(b) c …

Member Avatar
Member Avatar
+0 forum 3

Dear all Can anyone explain to me how a (local) counter can be modified in a loop without being touched in the code? ... and how I am best to debug this? Thanks Erich void test(double *x, int l, int N, int K, double *p, Comp * y) { int q, w; double *buf1 = new double[l]; double *buf2 = new double[l]; int i_out = 0; for (int n = 0 ; n < l; n=n+N) { /* ... main code, does not touch i_out */ i_out = i_out + K; } delete[] buf1; delete[] buf2; }

Member Avatar
Member Avatar
+0 forum 11

If you decorate a function, then some of the information is lost during the debugging process. Python supplies another decorator @wraps to help out. A decorator for a decorator, very interesting.

Member Avatar
+1 forum 0

There has got to be a better way of doing this. First of all pay no attention to the lack of validation and error checking. I just want the core of the script to work first. Also, Block 1 and Block 2 execute, Block 3 does not. Whats the best way to check for errors on MySQLi preperation AND executions? Ultimately what we're doing below is 1) creating the account 2) Adding a notification to the account 3) Sending a welcome message to the user via the in-site mailbox. //REGISTER PROCESSING if(isset($_POST['email'], $_POST["password"], $_POST['username'], $_POST['register'])){ $passwordHash = hash("sha1", $_POST["password"]); $time …

Member Avatar
Member Avatar
+0 forum 8

I have been struggling with this since yesterday and I really need to get it finished. I have no clue why its not working. THe porblem im facing at the moment is as follows: I have a method loadDB(); That is looks like this: public static void loadDB() { // load data into datasets - this will be called on form2 the login screen loadTblStaff(); loadTblCars(); con.ConnectionString = dbProvider + dbSource; } I have stepped into the program and placed breakpoints and the method never does anything other than call the first method. Then it jumps off to the next …

Member Avatar
Member Avatar
+0 forum 12

import java.util.Scanner; import java.util.Random; public class HangmanGame2 { public static void main(String[] args) { Scanner input = new Scanner(System.in); final String[] WordList = { "porcupine", "flamingo", "sasquatch", "poseidon", "minnie mouse", "mickey mouse", "galileo" }; String ChosenWord = WordList[(int)Math.random()*WordList.length]; StringBuffer display = new StringBuffer(ChosenWord.length()); for (int i = 0; i < ChosenWord.length(); i++) display.append("*"); int NumberOfTries = 0; System.out.print("Let's Begin \n\n"); System.out.println("Instructions: Enter a letter when asked. Try to guess the word in less than 6 tries or you will be a Dead Man! Good luck!\n\n"); boolean correct = false; while (NumberOfTries < 6 && !correct) { String UserGuess = input.next(); …

Member Avatar
Member Avatar
+0 forum 1

This program is not running due to 2 errors could someone please assist me? Thanks import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class UserList { public static void main(String[] args) throws Exception { String str1, str2 = "username"; int index; int initialCapacity = 10; BufferedReader dataIn = new BufferedReader(new InputStreamReader(System.in)); ArrayList(String) users = new ArrayList(String)(); System.out.print("Enter a user name: "); str1 = dataIn.readLine(); while(str1.length() > 0) { if(str1 == str2); System.out.println("That user name is NOT allowed!"); else { if(users.size() == initialCapacity) { System.out.println("List is full!"); System.out.println("Last entry is "+users.get(initialCapacity)); } else if(!users.contains(str1)) { users.add(str1); System.out.println("User \""+str1+"\" added to user list."); …

Member Avatar
Member Avatar
+0 forum 9

Where am I going wrong in this code? // Eyetee's Third Toy V0.0. Copyright 2012 by Eyetee and not released. // Declare variables needed var string_to_be_examined = "This is a test string that can also be obtained from \ some other location." var substring_to_test_for var i = 0 var j = 0 var storage_string = [] var location_found = [] // Obtain substring to test for substring_to_test_for = prompt("Type in the text you wish to search for:") // Test for presence of substring for (i; i < string_to_be_examined.length; i++) { if (string_to_be_examined[i] = substring_to_test_for[j]) { storage_string.push(substring_to_test_for[j]) if (j < substring_to_test_for.length) …

Member Avatar
Member Avatar
+0 forum 2

Afternoon (UTC +0) all I am having a slight problem with the FileSystemWatcher. The File watcher does exactly what i want it to do (as in throwing an event when needed). However, when this event is thrown the debugger stops with no exceptions. This has never happened to me before so i wondered if anyone could help me. This is the function for creating the watcher: private void CreateWatcher() { FileSystemWatcher watcher = new FileSystemWatcher(); watcher.Path = @"M:\CALL CENTRE\"; watcher.Filter = "*.accdb"; watcher.NotifyFilter = NotifyFilters.LastAccess; watcher.Changed += new FileSystemEventHandler(watcher_Changed); watcher.EnableRaisingEvents = true; } And this is the "watcher_Changed" event: private …

Member Avatar
Member Avatar
+0 forum 2

How do I put the following output in a table format as shown below in the code?

Member Avatar
Member Avatar
+0 forum 2

I have a website for a painter where the painter uploads a picture. The picture name is added to a mdb (access) database table, the picture is added to the end of a table called galleries, and the file is uploaded. It is also then resized to a small image. Sometimes, not always, I get Unrecognized Database Format error after running this. Anyone think of any possible causes and what I can do about them without changing the main structure of the program? Thanks for your help!

Member Avatar
Member Avatar
+0 forum 2

My application won't run anymore in my tablet and I don't know why. It runs fine in the emulator. public class TestingActivity extends Activity implements OnClickListener { /** Called when the activity is first created. */ String uname, pass, pic; EditText txtUname, txtPass; Button login; TextView result, tview2, tview3; String nameStartLine = " <td style=\"font:10px verdana; color:#312e25; text-align:right;\">Name:</td>"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); login=(Button)findViewById(R.id.button1); result=(TextView)findViewById(R.id.textView1); tview2=(TextView)findViewById(R.id.textView2); tview3=(TextView)findViewById(R.id.textView3); txtUname=(EditText)findViewById(R.id.editText1); txtPass=(EditText)findViewById(R.id.editText2); login.setOnClickListener(this); android.view.Display display = ((android.view.WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); //set width and height txtUname.setHeight((int)(display.getHeight()*0.079)); txtUname.setWidth((int)(display.getWidth()/1.2)); txtPass.setHeight((int)(display.getHeight()*0.079)); txtPass.setWidth((int)(display.getWidth()/1.2)); login.setHeight((int)(display.getHeight()*0.079)); login.setWidth((int)(display.getWidth()/3.2)); //set position RelativeLayout.LayoutParams lp1 = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, …

Member Avatar
Member Avatar
+0 forum 1

Here is an amazing article. Peter Norvig does not let small detail, that the language was never implemented in it's time, disturb his debugging the code written without implementation, but single handedly implements it with Python parser. Frustration warning, this is frustratingly amazing stuff: [Prescient but Not Perfect: A Look Back at a 1966 Scientific American Article on Systems Analysis By Peter Norvig | August 23, 2011](http://blogs.scientificamerican.com/at-scientific-american/2011/08/23/systems-analysis-look-back-1966-scientific-american-article/)

Member Avatar
+0 forum 0

i am using gcc 4.4.3 on ubuntu 10.4 32bit machine. i use 'gdb' to debug my code. Since few days i am seeing that whenever i debug code gdb steps into the c library functions used in the code also(like printf,fgets etc). This shows a long list of calls from one function to other.see the attached screen shot. Previously gdb was working fine just stepping over my own code. Maybe i am being novice !! But it is sometimes really irritating when gdb shows me numerous lines which i am not interested in the present context. If someone can guide …

Member Avatar
+0 forum 0

Hey guys, I need help finding out what is wrong with my code, I have no errors, but it is not doing what I want it to. I need my code to print a bar code when a user inputs a zip code. My program does not get to the method where it actually figures out what the bar code is. For example: when you enter 95014, you should get: | | : | : : : | : | : | | : : : : : : | | : | : : | : : : | …

Member Avatar
Member Avatar
+0 forum 5

I am trying to find a bug in my new and (theoretically) improved syntax highlighter program. I have made 3 versions now and have been able to debug them all with ease. Unfortunately my debugger does not do well with std containers as it shows ALL the information they contain and it can be hard to sift through it to find errors. Can anybody see where I went wrong in this code? evenBetterMain.cpp: (since I already have main.cpp and betterMain.cpp working :P) [CODE]#include <iostream> //for cin/cout #include <string> //for std::strings, obviously #include <fstream> //for file operations #include <stdio.h> //for integer …

Member Avatar
Member Avatar
+0 forum 8

PROGRAM GETS COMPILED...BUT GIVES ERROR ARRAY OUT OF BOUNDS...PLEASE HELP AS SOON AS POSSIBLE !!! import java.io.*; class Evaluate { char postfix[]; int stack[]; int i,a,b,c,top,n; BufferedReader input=new BufferedReader(new InputStreamReader(System.in)); Evaluate() throws IOException { System.out.println("ENTER ARRAY SIZE"); n=Integer.parseInt(input.readLine()); postfix=new char[n]; stack=new int[n]; top=-1; i=-1; } void readpostfix() throws IOException { char p; System.out.println("ENTER STRING"); do { p=(char)input.read(); i++; postfix[i]=p; } while(p!='\n'); postfix[i]='\0'; } boolean isoperand(char c) { if(c>='0'&&(c<='9')) return true; else return false; } void compute() { for(i=0;postfix[i]!='\0';i++) if(isoperand(postfix[i])) { top++; stack [top]= (int) (postfix[i]-'0'); } else { a=stack[top]; top--; b=stack[top]; switch(postfix[i]) { case'+':c=b+a; stack[top]=c; break; case'-':c=b-a; stack[top]=c; break; case'*':c=b*a; …

Member Avatar
Member Avatar
+0 forum 1

Good Day Everyone here is my code so far [CODE] #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> void vp(int x,int tc,int bk,char *text); void square(int x,int y,int size); void main() {//=========================================================== int gdriver = DETECT, gmode, errorcode; initgraph(&gdriver, &gmode, "C:\\TC\\BGI"); //------------------monitor-------------------- setbkcolor(0); setcolor(15); square(300,160,150); square(300,160,148); square(300,160,130); square(300,160,131); setaspectratio(2,5); int stangle=0,endangle=180;int radius = 100; setcolor (2); // This becomes drawing color square(300, 160, 128); // Draw the circle setfillstyle(1, 2); // Set pattern to fill interior floodfill(300,160, 2); // Fill the circle setcolor(15); /* draw arc */ arc(295+9, 353, stangle, endangle, radius); arc(295+9, 354, stangle, endangle, radius-1); arc(295+9, 355, stangle, …

Member Avatar
Member Avatar
+0 forum 1

I am having trouble debugging in sharepoint. It is acting like I am debugging a different dll than the one I made code for. When stepping through it will skip lines occasionally and randomly just stop debugging. Often it will start debugging then stop randomly and show any new breakpoints I add as the hollow red circles to say it does not have symbols for it. Sometimes it never breaks at all. I have deleted all the pdb files and all dlls to make sure I was getting new ones, but it did not change anything. I have tried restarting …

Member Avatar
Member Avatar
+0 forum 1

I've seen a lot of people having issues debugging JavaScript code. So here is how you can easily debug your JavaScript code using Visual Studio (I believe firebug has similar functionality). Also if someone has Visual Web Developer can you confirm that you can do it in that as well (I'm not at home so I can't test right now). When you have your project open, go to the Tools menu and click on "Attach to Process..." (also ctrl+alt+P). This will bring up a list of processes you can attach to. Select iexplorer.exe (there maybe multiple IE process if you …

Member Avatar
+0 forum 0

[CODE=c]# include<stdio.h> # include<string.h> # include<stdlib.h> int main(int argc, char **argv){ // Declare Variables char barcode[50]; int count; long long intBarcode; long countryCode; int dig0, dig1, dig2, dig3, dig4, dig5; int dig6, dig7, dig8, dig9, dig10, dig11; long long num; long rem, sum; int checksum; long long manufac, product, language, publish, title; char country[50]; int k, j, i = 0; // Get input from user as type string printf("Enter Barcode: \n"); count = scanf( "%s", barcode); // Check validity of input if (count != 1){ printf("not a valid input"); return 0; } // Remove Hyphens for (i = 0; i …

Member Avatar
Member Avatar
+0 forum 1

A couple weeks ago, Microsoft Research made available a project that had been under development for a while called Debugger Canvas. This is a visual tool for debugging applications where your functions appear as bubbles, similar to a database diagram or UML diagram. It only works on Visual Studio 2010 Ultimate due to the fact that it uses some internal features that are only included in the Ultimate edition. Because Debugger Canvas is a project of Microsoft Research, it's not "official" in that it's not actually a part of Visual Studio, nor is it an official, supported Microsoft product. And …

Member Avatar
Member Avatar
+1 forum 1

I posted a similar thread back in Nov and got some great help. I'm modifying the code to be useful to not only compare multiple columns from two separate files, but also to classify each line from @hairpin to determine if the parameters fall within any of the ESThits, outside of them, or overlap with them. I think the script is good, but I'm very much a newbie and am getting some errors I can't figure out how to debug. Below is the code, sample data, and the errors, but if a debugger could solve my problem, please tell me …

Member Avatar
Member Avatar
+0 forum 10

I have two friends whose computers run like paint drying! And their internet connects are dodgy. They are both cursed with Windows 7 On my XP computer I have Prevex 3.05.220 Teamviewer 177152237 Is it possible for me to copy (which files of?) Prevex and Teamviewer onto a thumb drive and TAKE IT to them and plug it in and thus HELP them? Many thanks hopefully from all THREE of us!

Member Avatar
Member Avatar
+0 forum 10

[CODE]#created by Jaron Graveley #April 26th, 2011 #This program completes reservations for Jon Von Poechman’s airline in an easy to use program #variable list: #i=counter used to limit the number of seats present on the diagram #n= counter to display the row number on the diagram #num_booked=counts the number of booked seats so the program stops #m=counter used to seperate the rows in the plane #r=row counter #p=position counter #plane=list of seats on the plane showing taken and empty seats #plane_name=same list as plane except it shows names for management use only #seat=shows the letter o for an open seat …

Member Avatar
Member Avatar
+0 forum 2

Hi! I just want to share you this code snippet of mine which I use always in my application. This code snippet will help you debug your code easily. It will also help you locate where the error occurred and it also create an Error log located on your project directory. [QUOTE] In Visual Basic, Erl, a Visual Basic (undocumented in Visual Basic 4, 5, and 6 but present in all versions of Visual Basic thus far) "global variable," gives you access to the line number of any erroring line of code. So by using line numbers and by using …

Member Avatar
Member Avatar
+0 forum 4

This is the Header file [CODE]#ifndef STUDENT_H #define STUDENT_H // class Student definition class Student { public: Student( char *nPtr ); ~Student(); void displayGrades() const; Student addGrade( int ); static int getNumStudents(); private: int *grades; char *name; int numGrades; int idNum; static int numStudents; }; // end class Student #endif // STUDENT_H[/CODE] Here is my coding.. the only error is "strcpy_s( name, nPtr );" keeps saying it doesn't take 2 arguments. [CODE]#include <iostream> using std::cout; using std::endl; #include <iomanip> using std::setw; #include <cstring> #include "Student.h" #include <new> const int numStudents = 0; // constructor Student::Student( char *nPtr ) { grades …

Member Avatar
Member Avatar
+0 forum 3

The End.