|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
Pootie too good!4331 Posts
Hey guys, so I am making a website and I want to incorporate a user login system. I am using phpmyadmin, lubuntu 12.10, html 4, and mysql. The problem I am having is that whenever I try to register a user, my browser just downloads register.php instead of adding the user to the database.
I think it has something to do with my apache2 conf files, but I haven't nailed it down.
I edited etc/apache2/mods-available/php5.conf and I created a .htaccess file in the same directory as my index.html where all it has in it is: Type application/x-httpd-php5 .php .phtml
Point is, I am totally lost and would love some insight! I am new to website programming.
|
Hyrule19174 Posts
do you have php installed and enabled?
|
Hi everyone, I've been spending the last 2 days try to figure out but I gave up. It looks like a simple homework except I don't know how or where to start. Please help me with this Java problem
here's the question and code + Show Spoiler +Write a graphics program that asks the user to specify the radii of two circles. The first circle has center (100, 200), and the second circle has center (200, 100). Draw the circles. If they intersect, then color both circles green. Otherwise, color them red. Hint: Compute the distance between the centers and compare it to the radii. Your program should draw nothing if the user enters a negative radius. In your exercise, declare a class Circle and a method boolean intersects(Circle other). import java.awt.Color; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.geom.Point2D;
/** This class implements a Circle. It includes a method to test whether two circles intersect. */ public class Circle { private double xCenter; private double yCenter; private double radius; private Color color;
/** Constructs a black circle. @param x the x-coordinate of the center @param y the y-coordinate of the center @param r the radius */ public Circle(double x, double y, double r) { xCenter = x; yCenter = y; radius = r; color = Color.BLACK; } /** Sets the color of this circle. @param aColor the color */ public void setColor(Color aColor) { color = aColor; }
/** Draws the circles. @param g2 the graphics context */ public void draw(Graphics2D g2) { if (radius < 0) return;
g2.setColor(color); // draw the circle Ellipse2D.Double circle = new Ellipse2D.Double(xCenter - radius, yCenter - radius, 2 * radius, 2 * radius); g2.draw(circle); }
/** Tests whether or not the two circles intersect with each other. @param other the other circle @return true the two circles intersect */ public boolean intersects(Circle other) { double distance; distance =...... radius = radius + other.radius; if (distance <= radius) { return true; } else { return false;
} } }
tester file import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.geom.Point2D; import javax.swing.JComponent; import javax.swing.JPanel;
/** Shows two Circles and tests whether they intersect or not. */ public class CircleComponent extends JComponent { private Circle circle1; private Circle circle2;
/** Constructs a component for showing two circles. @param r1 the radius of the first circle @param r2 the radius of the second circle */ public CircleComponent( double r1, double r2) { String message;
circle1 = new Circle(100, 200, r1); circle2 = new Circle(200, 100, r2); Color color; if (........) color = Color.GREEN; else color = Color.RED; circle1.setColor(color); circle2.setColor(color); }
public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g;
circle1.draw(g2); circle2.draw(g2); } }
I think I have the idea of finding distance and compare it with radius, however I don't know what's the right formula for calculating distance cause I haven't touched trig since like 9th grade. Also for the if statement in the tester file, i keep having error with the parameter for the argument.
|
On March 07 2013 10:41 tuho12345 wrote:Hi everyone, I've been spending the last 2 days try to figure out but I gave up. It looks like a simple homework except I don't know how or where to start. Please help me with this Java problem here's the question and code + Show Spoiler +Write a graphics program that asks the user to specify the radii of two circles. The first circle has center (100, 200), and the second circle has center (200, 100). Draw the circles. If they intersect, then color both circles green. Otherwise, color them red. Hint: Compute the distance between the centers and compare it to the radii. Your program should draw nothing if the user enters a negative radius. In your exercise, declare a class Circle and a method boolean intersects(Circle other). import java.awt.Color; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.geom.Point2D;
/** This class implements a Circle. It includes a method to test whether two circles intersect. */ public class Circle { private double xCenter; private double yCenter; private double radius; private Color color;
/** Constructs a black circle. @param x the x-coordinate of the center @param y the y-coordinate of the center @param r the radius */ public Circle(double x, double y, double r) { xCenter = x; yCenter = y; radius = r; color = Color.BLACK; } /** Sets the color of this circle. @param aColor the color */ public void setColor(Color aColor) { color = aColor; }
/** Draws the circles. @param g2 the graphics context */ public void draw(Graphics2D g2) { if (radius < 0) return;
g2.setColor(color); // draw the circle Ellipse2D.Double circle = new Ellipse2D.Double(xCenter - radius, yCenter - radius, 2 * radius, 2 * radius); g2.draw(circle); }
/** Tests whether or not the two circles intersect with each other. @param other the other circle @return true the two circles intersect */ public boolean intersects(Circle other) { double distance; distance =...... radius = radius + other.radius; if (distance <= radius) { return true; } else { return false;
} } }
tester file import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.geom.Point2D; import javax.swing.JComponent; import javax.swing.JPanel;
/** Shows two Circles and tests whether they intersect or not. */ public class CircleComponent extends JComponent { private Circle circle1; private Circle circle2;
/** Constructs a component for showing two circles. @param r1 the radius of the first circle @param r2 the radius of the second circle */ public CircleComponent( double r1, double r2) { String message;
circle1 = new Circle(100, 200, r1); circle2 = new Circle(200, 100, r2); Color color; if (........) color = Color.GREEN; else color = Color.RED; circle1.setColor(color); circle2.setColor(color); }
public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g;
circle1.draw(g2); circle2.draw(g2); } }
I think I have the idea of finding distance and compare it with radius, however I don't know what's the right formula for calculating distance cause I haven't touched trig since like 9th grade. Also for the if statement in the tester file, i keep having error with the parameter for the argument.
http://www.purplemath.com/modules/distform.htm
Basically: + Show Spoiler + That image looks like aids...
D = SQUAREROOT( ( x1 - x2)^2 + (y1 - y2 )^2 )
That should hopefully get you started. You can use the java Math library to compute a square root.
*edit* If you're a beginner at programming, my suggestion to you is to NEVER spend two days trying to figure out how to do things. Ask your professors and classmates and TL for help. There is no point banging your head against the wall for two days trying to figure it out yourself. Give it an honest shot. If you can't get it, then just ask for help.
Now if you're an experienced programmer programming DLL injections which uses detours to hook to a function and redirect it to a another program whose responsibility is to send input to another program through windows messages, then you can bang your head against a wall for two days.
|
On March 07 2013 03:37 JonGalt wrote: Hey guys, so I am making a website and I want to incorporate a user login system. I am using phpmyadmin, lubuntu 12.10, html 4, and mysql. The problem I am having is that whenever I try to register a user, my browser just downloads register.php instead of adding the user to the database.
I think it has something to do with my apache2 conf files, but I haven't nailed it down.
I edited etc/apache2/mods-available/php5.conf and I created a .htaccess file in the same directory as my index.html where all it has in it is: Type application/x-httpd-php5 .php .phtml
Point is, I am totally lost and would love some insight! I am new to website programming. Are you using Xampp?
I have no idea what your problem is.
|
On March 07 2013 10:51 Abductedonut wrote:Show nested quote +On March 07 2013 10:41 tuho12345 wrote:Hi everyone, I've been spending the last 2 days try to figure out but I gave up. It looks like a simple homework except I don't know how or where to start. Please help me with this Java problem here's the question and code + Show Spoiler +Write a graphics program that asks the user to specify the radii of two circles. The first circle has center (100, 200), and the second circle has center (200, 100). Draw the circles. If they intersect, then color both circles green. Otherwise, color them red. Hint: Compute the distance between the centers and compare it to the radii. Your program should draw nothing if the user enters a negative radius. In your exercise, declare a class Circle and a method boolean intersects(Circle other). import java.awt.Color; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.geom.Point2D;
/** This class implements a Circle. It includes a method to test whether two circles intersect. */ public class Circle { private double xCenter; private double yCenter; private double radius; private Color color;
/** Constructs a black circle. @param x the x-coordinate of the center @param y the y-coordinate of the center @param r the radius */ public Circle(double x, double y, double r) { xCenter = x; yCenter = y; radius = r; color = Color.BLACK; } /** Sets the color of this circle. @param aColor the color */ public void setColor(Color aColor) { color = aColor; }
/** Draws the circles. @param g2 the graphics context */ public void draw(Graphics2D g2) { if (radius < 0) return;
g2.setColor(color); // draw the circle Ellipse2D.Double circle = new Ellipse2D.Double(xCenter - radius, yCenter - radius, 2 * radius, 2 * radius); g2.draw(circle); }
/** Tests whether or not the two circles intersect with each other. @param other the other circle @return true the two circles intersect */ public boolean intersects(Circle other) { double distance; distance =...... radius = radius + other.radius; if (distance <= radius) { return true; } else { return false;
} } }
tester file import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.geom.Point2D; import javax.swing.JComponent; import javax.swing.JPanel;
/** Shows two Circles and tests whether they intersect or not. */ public class CircleComponent extends JComponent { private Circle circle1; private Circle circle2;
/** Constructs a component for showing two circles. @param r1 the radius of the first circle @param r2 the radius of the second circle */ public CircleComponent( double r1, double r2) { String message;
circle1 = new Circle(100, 200, r1); circle2 = new Circle(200, 100, r2); Color color; if (........) color = Color.GREEN; else color = Color.RED; circle1.setColor(color); circle2.setColor(color); }
public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g;
circle1.draw(g2); circle2.draw(g2); } }
I think I have the idea of finding distance and compare it with radius, however I don't know what's the right formula for calculating distance cause I haven't touched trig since like 9th grade. Also for the if statement in the tester file, i keep having error with the parameter for the argument. http://www.purplemath.com/modules/distform.htmBasically: + Show Spoiler +That image looks like aids... D = SQUAREROOT( ( x1 - x2)^2 + (y1 - y2 )^2 ) That should hopefully get you started. You can use the java Math library to compute a square root. *edit* If you're a beginner at programming, my suggestion to you is to NEVER spend two days trying to figure out how to do things. Ask your professors and classmates and TL for help. There is no point banging your head against the wall for two days trying to figure it out yourself. Give it an honest shot. If you can't get it, then just ask for help. Now if you're an experienced programmer programming DLL injections which uses detours to hook to a function and redirect it to a another program whose responsibility is to send input to another program through windows messages, then you can bang your head against a wall for two days. thanks, I've figured out the distance, now the condition for the tester.
//btw I like to figure shit out lol, I tried to ask friends around but they all afraid of spoiling everything and gave me really ambiguous answer and professor simply never cares about the questions from student, I even tried tutor service at school but a bunch of nerds sat there and no one even cares so fuck it lol
|
On March 07 2013 11:09 tuho12345 wrote:Show nested quote +On March 07 2013 10:51 Abductedonut wrote:On March 07 2013 10:41 tuho12345 wrote:Hi everyone, I've been spending the last 2 days try to figure out but I gave up. It looks like a simple homework except I don't know how or where to start. Please help me with this Java problem here's the question and code + Show Spoiler +Write a graphics program that asks the user to specify the radii of two circles. The first circle has center (100, 200), and the second circle has center (200, 100). Draw the circles. If they intersect, then color both circles green. Otherwise, color them red. Hint: Compute the distance between the centers and compare it to the radii. Your program should draw nothing if the user enters a negative radius. In your exercise, declare a class Circle and a method boolean intersects(Circle other). import java.awt.Color; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.geom.Point2D;
/** This class implements a Circle. It includes a method to test whether two circles intersect. */ public class Circle { private double xCenter; private double yCenter; private double radius; private Color color;
/** Constructs a black circle. @param x the x-coordinate of the center @param y the y-coordinate of the center @param r the radius */ public Circle(double x, double y, double r) { xCenter = x; yCenter = y; radius = r; color = Color.BLACK; } /** Sets the color of this circle. @param aColor the color */ public void setColor(Color aColor) { color = aColor; }
/** Draws the circles. @param g2 the graphics context */ public void draw(Graphics2D g2) { if (radius < 0) return;
g2.setColor(color); // draw the circle Ellipse2D.Double circle = new Ellipse2D.Double(xCenter - radius, yCenter - radius, 2 * radius, 2 * radius); g2.draw(circle); }
/** Tests whether or not the two circles intersect with each other. @param other the other circle @return true the two circles intersect */ public boolean intersects(Circle other) { double distance; distance =...... radius = radius + other.radius; if (distance <= radius) { return true; } else { return false;
} } }
tester file import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.geom.Point2D; import javax.swing.JComponent; import javax.swing.JPanel;
/** Shows two Circles and tests whether they intersect or not. */ public class CircleComponent extends JComponent { private Circle circle1; private Circle circle2;
/** Constructs a component for showing two circles. @param r1 the radius of the first circle @param r2 the radius of the second circle */ public CircleComponent( double r1, double r2) { String message;
circle1 = new Circle(100, 200, r1); circle2 = new Circle(200, 100, r2); Color color; if (........) color = Color.GREEN; else color = Color.RED; circle1.setColor(color); circle2.setColor(color); }
public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g;
circle1.draw(g2); circle2.draw(g2); } }
I think I have the idea of finding distance and compare it with radius, however I don't know what's the right formula for calculating distance cause I haven't touched trig since like 9th grade. Also for the if statement in the tester file, i keep having error with the parameter for the argument. http://www.purplemath.com/modules/distform.htmBasically: + Show Spoiler +That image looks like aids... D = SQUAREROOT( ( x1 - x2)^2 + (y1 - y2 )^2 ) That should hopefully get you started. You can use the java Math library to compute a square root. *edit* If you're a beginner at programming, my suggestion to you is to NEVER spend two days trying to figure out how to do things. Ask your professors and classmates and TL for help. There is no point banging your head against the wall for two days trying to figure it out yourself. Give it an honest shot. If you can't get it, then just ask for help. Now if you're an experienced programmer programming DLL injections which uses detours to hook to a function and redirect it to a another program whose responsibility is to send input to another program through windows messages, then you can bang your head against a wall for two days. thanks, I've figured out the distance, now the condition for the tester. //btw I like to figure shit out lol, I tried to ask friends around but they all afraid of spoiling everything and gave me really ambiguous answer and professor simply never cares about the questions from student, I even tried tutor service at school but a bunch of nerds sat there and no one even cares so fuck it lol
if ( circle1.intersects(circle2) ) color = Color.GREEN; else color = Color.RED;
You need to call the intersects function of circle 1 with circle 2 passed in as the object. Depending on whether or not they intersect it will change the color. You've got all the pieces now. You know the distance they're seperated by. How do you figure out whether or not they intersect?
|
On March 07 2013 11:50 Abductedonut wrote:Show nested quote +On March 07 2013 11:09 tuho12345 wrote:On March 07 2013 10:51 Abductedonut wrote:On March 07 2013 10:41 tuho12345 wrote:Hi everyone, I've been spending the last 2 days try to figure out but I gave up. It looks like a simple homework except I don't know how or where to start. Please help me with this Java problem here's the question and code + Show Spoiler +Write a graphics program that asks the user to specify the radii of two circles. The first circle has center (100, 200), and the second circle has center (200, 100). Draw the circles. If they intersect, then color both circles green. Otherwise, color them red. Hint: Compute the distance between the centers and compare it to the radii. Your program should draw nothing if the user enters a negative radius. In your exercise, declare a class Circle and a method boolean intersects(Circle other). import java.awt.Color; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.geom.Point2D;
/** This class implements a Circle. It includes a method to test whether two circles intersect. */ public class Circle { private double xCenter; private double yCenter; private double radius; private Color color;
/** Constructs a black circle. @param x the x-coordinate of the center @param y the y-coordinate of the center @param r the radius */ public Circle(double x, double y, double r) { xCenter = x; yCenter = y; radius = r; color = Color.BLACK; } /** Sets the color of this circle. @param aColor the color */ public void setColor(Color aColor) { color = aColor; }
/** Draws the circles. @param g2 the graphics context */ public void draw(Graphics2D g2) { if (radius < 0) return;
g2.setColor(color); // draw the circle Ellipse2D.Double circle = new Ellipse2D.Double(xCenter - radius, yCenter - radius, 2 * radius, 2 * radius); g2.draw(circle); }
/** Tests whether or not the two circles intersect with each other. @param other the other circle @return true the two circles intersect */ public boolean intersects(Circle other) { double distance; distance =...... radius = radius + other.radius; if (distance <= radius) { return true; } else { return false;
} } }
tester file import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.geom.Point2D; import javax.swing.JComponent; import javax.swing.JPanel;
/** Shows two Circles and tests whether they intersect or not. */ public class CircleComponent extends JComponent { private Circle circle1; private Circle circle2;
/** Constructs a component for showing two circles. @param r1 the radius of the first circle @param r2 the radius of the second circle */ public CircleComponent( double r1, double r2) { String message;
circle1 = new Circle(100, 200, r1); circle2 = new Circle(200, 100, r2); Color color; if (........) color = Color.GREEN; else color = Color.RED; circle1.setColor(color); circle2.setColor(color); }
public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g;
circle1.draw(g2); circle2.draw(g2); } }
I think I have the idea of finding distance and compare it with radius, however I don't know what's the right formula for calculating distance cause I haven't touched trig since like 9th grade. Also for the if statement in the tester file, i keep having error with the parameter for the argument. http://www.purplemath.com/modules/distform.htmBasically: + Show Spoiler +That image looks like aids... D = SQUAREROOT( ( x1 - x2)^2 + (y1 - y2 )^2 ) That should hopefully get you started. You can use the java Math library to compute a square root. *edit* If you're a beginner at programming, my suggestion to you is to NEVER spend two days trying to figure out how to do things. Ask your professors and classmates and TL for help. There is no point banging your head against the wall for two days trying to figure it out yourself. Give it an honest shot. If you can't get it, then just ask for help. Now if you're an experienced programmer programming DLL injections which uses detours to hook to a function and redirect it to a another program whose responsibility is to send input to another program through windows messages, then you can bang your head against a wall for two days. thanks, I've figured out the distance, now the condition for the tester. //btw I like to figure shit out lol, I tried to ask friends around but they all afraid of spoiling everything and gave me really ambiguous answer and professor simply never cares about the questions from student, I even tried tutor service at school but a bunch of nerds sat there and no one even cares so fuck it lol if ( circle1.intersects(circle2) ) color = Color.GREEN; else color = Color.RED; You need to call the intersects function of circle 1 with circle 2 passed in as the object. Depending on whether or not they intersect it will change the color. You've got all the pieces now. You know the distance they're seperated by. How do you figure out whether or not they intersect? in intersects method I need an if statement like this
if (distance <= radius) { return true; } else { return false;
}
the tester file will call up that statement and if it's true - turn green, else - red.
Got it, all work now. Thanks a lot man!:D
|
On March 07 2013 12:02 tuho12345 wrote: the tester file will call up that statement and if it's true - turn green, else - red.
Got it, all work now. Thanks a lot man!:D
Yeah, and just as a friendly reminder:
Always put curly braces around single-line statements (trust me, someone will write code there not realizing it's not braced)
Like so:
if ( kitty ) { doggy(); }
And fix your allman style coding:
if (distance <= radius) { return true; } else { return false; }
Happy programming.
|
Pootie too good!4331 Posts
On March 07 2013 04:57 tofucake wrote: do you have php installed and enabled?
I have php installed. I think I have it enabled, but I am unsure now.
I installed php5, mysql, and phphmyadmin through the terminal the other day. Then I made a dbconfig.php, register.php, login.php, members.php, logout.php, and integrated them with my login.html and register.html.
When I try to register a user through register.html, my browser (chromium) just downloads register.php instead of sending the data to the database. I did many searches and it seemed like I did not have the apache2 conf files correctly configured. After editing what was suggested, I still have the same problem.
And I don't think I have Xammp installed. If you need more information or I am unclear, let me know.
|
Pootie too good!4331 Posts
On a different note, I feel like even though I graduated with a degree in Computer Science last May at a good university and did well - when I go to program many times I feel lost. I usually can start a program or website or what have you, but then I just get utterly lost and confused halfway through.
I know that a four year degree can not possibly cover everything needed, but sometimes I feel all my degree gave me was a large foundation in which now I am just starting to build upon.
I also have never had a programming internship. I had two internships but neither one involved programming unfortunately.
I guess what I am saying is I feel like I should know more and I don't. I have downloaded many books in all areas of computer programming and am reading those. I am going through the various tuutorials at w3schools, got rid of windows and use linux exclusively, and have tackled various projects (2 website, and one program) to help improve. Is there any other suggestions that you guys have to help me improve more?
|
What you're feeling is pretty typical of those in your situation. Your workplace will typically have project/technical managers that will push projects along and deal with the "what do I do now" situation.
|
On March 07 2013 16:05 JonGalt wrote: On a different note, I feel like even though I graduated with a degree in Computer Science last May at a good university and did well - when I go to program many times I feel lost. I usually can start a program or website or what have you, but then I just get utterly lost and confused halfway through.
I know that a four year degree can not possibly cover everything needed, but sometimes I feel all my degree gave me was a large foundation in which now I am just starting to build upon.
I also have never had a programming internship. I had two internships but neither one involved programming unfortunately.
I guess what I am saying is I feel like I should know more and I don't. I have downloaded many books in all areas of computer programming and am reading those. I am going through the various tuutorials at w3schools, got rid of windows and use linux exclusively, and have tackled various projects (2 website, and one program) to help improve. Is there any other suggestions that you guys have to help me improve more? When I first learned how to do Objective-C and iOS development, I started out with a book. I read the whole book straight through, manually typing out all the examples so I could immediately get a feel for the XCode UI and experience with debugging typos. After having finished the entire book and gained a firm understanding of how iOS coding works, when it came time to actually sit down and start my first project, I honestly didn't know what to do. And this is coming from someone who's been developing for quite a while. It took a long time, but eventually I was able to make the mental connections between what I had learned and how I needed to apply it. Now it's second nature. But only because I sat down and actually tried to do something with what I've learned.
I imagine it like a big block of super awesome wizardry in your head. You have the potential to do the magic, but you have to build the mental connections to it and that can only be done with experience. I think if you just keep on going the direction you are, you'll be fine.
|
Pootie too good!4331 Posts
|
On March 07 2013 15:54 JonGalt wrote:Show nested quote +On March 07 2013 04:57 tofucake wrote: do you have php installed and enabled? I have php installed. I think I have it enabled, but I am unsure now. I installed php5, mysql, and phphmyadmin through the terminal the other day. Then I made a dbconfig.php, register.php, login.php, members.php, logout.php, and integrated them with my login.html and register.html. When I try to register a user through register.html, my browser (chromium) just downloads register.php instead of sending the data to the database. I did many searches and it seemed like I did not have the apache2 conf files correctly configured. After editing what was suggested, I still have the same problem. And I don't think I have Xammp installed. If you need more information or I am unclear, let me know.
Did you install libapache2-mod-php5 and not just the php cli? (If you want to run php as a apache module that is, which I am assuming you do).
Using a package manager (apt-get) makes your life so much easier. It will automatically update the configuration files for you as well.
|
Hey guys, I have a question I will have have to do a c++ project for university(most likely some b+ tree implementation) which needs to be able to run on Linux The problem is that I have Windows 7 as my main OS and I don't really want to code using a virtual os, cause the whole thing seems kinda slow, So would it be a problem to code and test, etc in Windows(probably with Eclipse) and then compile it a final time on Linux after making some hopefully small adjustements? Or would I encounter a massive amount of errors, that are hard to remove? thx for your advice
|
Pootie too good!4331 Posts
On March 07 2013 19:02 KainiT wrote:Hey guys, I have a question I will have have to do a c++ project for university(most likely some b+ tree implementation) which needs to be able to run on Linux The problem is that I have Windows 7 as my main OS and I don't really want to code using a virtual os, cause the whole thing seems kinda slow, So would it be a problem to code and test, etc in Windows(probably with Eclipse) and then compile it a final time on Linux after making some hopefully small adjustements? Or would I encounter a massive amount of errors, that are hard to remove? thx for your advice 
I had the same issues in university as well.
I always coded in Windows using notepad++ from home. However, I would save all my work on university account using a mapped network drive and a vpn. Then using putty, I could connect to my university's linux computers where my work was saved and run it thought the putty terminal. Win win!
|
Pootie too good!4331 Posts
On March 07 2013 18:50 disco wrote:Show nested quote +On March 07 2013 15:54 JonGalt wrote:On March 07 2013 04:57 tofucake wrote: do you have php installed and enabled? I have php installed. I think I have it enabled, but I am unsure now. I installed php5, mysql, and phphmyadmin through the terminal the other day. Then I made a dbconfig.php, register.php, login.php, members.php, logout.php, and integrated them with my login.html and register.html. When I try to register a user through register.html, my browser (chromium) just downloads register.php instead of sending the data to the database. I did many searches and it seemed like I did not have the apache2 conf files correctly configured. After editing what was suggested, I still have the same problem. And I don't think I have Xammp installed. If you need more information or I am unclear, let me know. Did you install libapache2-mod-php5 and not just the php cli? (If you want to run php as a apache module that is, which I am assuming you do). Using a package manager (apt-get) makes your life so much easier. It will automatically update the configuration files for you as well.
I have apt-get, the problem is I don't have internet save for the few times I go to an internet cafe.
I am not sure if I have libapaxhe2-mod-php5 installed. I feel like I only installed the php5 cli, so maybe that is it. I will explore this this weekend. Thanks!
|
On March 07 2013 19:02 KainiT wrote:Hey guys, I have a question I will have have to do a c++ project for university(most likely some b+ tree implementation) which needs to be able to run on Linux The problem is that I have Windows 7 as my main OS and I don't really want to code using a virtual os, cause the whole thing seems kinda slow, So would it be a problem to code and test, etc in Windows(probably with Eclipse) and then compile it a final time on Linux after making some hopefully small adjustements? Or would I encounter a massive amount of errors, that are hard to remove? thx for your advice 
If you are using eclipse or other IDE that isn't Visual Studio you will be mostly fine. The only thing you need is compile the code on a Linux Machine after you wrote it and tested it on Windows. However, some libs and commands are Windows or Linux only and you will have to be careful with those.
|
Poland794 Posts
On March 07 2013 03:37 JonGalt wrote: Hey guys, so I am making a website and I want to incorporate a user login system. I am using phpmyadmin, lubuntu 12.10, html 4, and mysql. The problem I am having is that whenever I try to register a user, my browser just downloads register.php instead of adding the user to the database.
I think it has something to do with my apache2 conf files, but I haven't nailed it down.
I edited etc/apache2/mods-available/php5.conf and I created a .htaccess file in the same directory as my index.html where all it has in it is: Type application/x-httpd-php5 .php .phtml
Point is, I am totally lost and would love some insight! I am new to website programming.
You almost answered the question yourself.
You have to copy or link php5.conf from mods-available to mods-enabled.
|
|
|
|
|
|