HarryHengst
Member
just hobby, was thinking it is a great skill to have
Just start with Python.
just hobby, was thinking it is a great skill to have
I even code some traps inside my code in order to ask them questions like "Can anyone tell my why doing that is a bad idea? How can we improve it?" Yet, I barely get any feedback.
Any suggestions on open source projects a beginner such as myself can get into to prepare for a job. I'm at the point where I just need to start coding and racking up hours to hone my craft. I am nearly graduated but feel like I have little to show for it and tons to learn. Basically I need a few good projects that will give me hands on experience and help me maintain good coding practices.
I had one professor who kept the roster in front of him and called on each student at least once each lecture.
I see, thank you for the insight and advice. I'll play around with it to see if I can get the hang of it. Hopefully the book I'm reading mention it sooner or later.You can generally use the same one...however nextInt and nextLine do not mix well. Basically nextInt does not consume the whole line (the carriage return at the end).
A good practice is to only use nextLine (and turn it into an int if required), or to have two scanners, one for lines and one for ints. Otherwise it all gets pretty messy .
Locals and static variables.
And how it was?
I've got another question for C. How would you write a void function that changes your input string into pig latin? What I have right now is close, but I am getting two of the first original character towards the end of my pig latin string when I need just one.
Just start with Python.
thanks! i will just start with that then!
If you're near Santa Clara (San Jose, CA) then you could sign up for some tutorials at PyCon in a couple of weeks...
I'm giving an Introduction to PyGame tutorial (game programming with Python)![]()
If you're near Santa Clara (San Jose, CA) then you could sign up for some tutorials at PyCon in a couple of weeks...
I'm giving an Introduction to PyGame tutorial (game programming with Python)![]()
Are you being forced to use Javascript?
http://jsfiddle.net/RSShG/
Not the best in the world by any means but it is kinda cool to see.
Yea i can't use that because we are doing javascript.
Pure javascript or are you allowed to use jQuery?
Yea pure javascript.
Maybe something like this will work?
if(R){
}else if (D){
}else if (L){
}else if
public class Month {
private int monthNumber;
private String monthName;
public Month() {
super();
// TODO Auto-generated constructor stub
this.monthNumber = 1;
}
public Month(int monthNumber, String monthName) {
super();
this.monthNumber = monthNumber;
this.monthName = monthName;
}
public int getMonthNumber() {
return monthNumber;
}
public void setMonthNumber(int m) {
if (m < 1 || m > 12)
monthNumber = 1;
else
monthNumber = m;
}
public String getMonthName() {
switch (monthNumber) {
case 1:
monthName = "January";
monthNumber = 1;
return this.monthName;
case 2:
monthName = "February";
monthNumber = 2;
return this.monthName;
case 3:
monthName = "March";
monthNumber = 3;
return this.monthName;
case 4:
monthName = "April";
monthNumber = 4;
return this.monthName;
case 5:
monthName = "May";
monthNumber = 5;
return this.monthName;
case 6:
monthName = "June";
monthNumber = 6;
return this.monthName;
case 7:
monthName = "July";
monthNumber = 7;
return this.monthName;
case 8:
monthName = "August";
monthNumber = 8;
return this.monthName;
case 9:
monthName = "September";
monthNumber = 9;
return this.monthName;
case 10:
monthName = "October";
monthNumber = 10;
return this.monthName;
case 11:
monthName = "November";
monthNumber = 11;
return this.monthName;
case 12:
monthName = "December";
monthNumber = 12;
return this.monthName;
default:
System.out.println("invalid number");
return this.monthName;
}
}
}
I would if I could, my professor checks for plagiarism so I can't risk it.
Edit: I basically have my string in a for loop so that I can have it shift the characters one space over. The problem is that the last character outputted by the loop is copying the letter that comes before 'ay'. So if my original string was clock, the function returns lockccay.
Edit 2: Got it.
tags. So if he pasted your code into Google, it would not come up on this forum because the code in those tags would not be searchable.
Also, what would coding be if you could not copy brilliant coding ideas from other people and making it your own (or not!)?
Need a little help with this code for JAVA
I'm getting this... Month@e3d4817
my friend is having issues with his too but are code is pretty much the same.
Code:...
Month test = new Month();
System.out.println(test.getMonthNumber());
System.out.println(test);
A few things I noticed. Why are you calling super in your constructors? You are not inheriting from another class, so I don't think it's necessary to call super on object. I got the same output of Month@e3d4817 because you haven't overriden the toString method in your month class. If you only want the month number or the month name then you should call those methods explicitly. For example:
Code:Month test = new Month(); System.out.println(test.getMonthNumber());
If you want to call
Code:System.out.println(test);
make sure that you override the toString method.
Wow thanks I actually had something like those above but forgot about the toString method.
And the whole super thing I not even sure myself my professor says it doesn't matter it shows up using generate stuff in the source tab.
case 1:
monthName = "January";
monthNumber = 1;
return this.monthName;
case 1:
return "January"
Also, setMonthNumber does validation, but the constructor does not. Unless you have a good reason to do otherwise, I would keep that sort of thing consistent.Need a little help with this code for JAVA
I'm getting this... Month@e3d4817
my friend is having issues with his too but are code is pretty much the same.
Also, setMonthNumber does validation, but the constructor does not. Unless you have a good reason to do otherwise, I would keep that sort of thing consistent.
Also, setMonthNumber does validation, but the constructor does not. Unless you have a good reason to do otherwise, I would keep that sort of thing consistent.
Uh, I'd say Prolog is nothing like lisp or erlang.
Prolog is not a functional language, it is a Logic Programming language, it can be more or less imperative or declarative depending on how you write it. I think that this is the standard disclaimer I give for these things but I know almost nothing about Prolog other than that. I do know though that http://www.learnprolognow.org/ is meant to be good, and it's also relatively recent (2003).
Bruce Tate's 7 Languages in 7 Weeks has a nicely written up gentle introduction to the language and many of the go to reference books for AI, such as Russell and Norvig's Artificial Intelligence: A Modern Approach contain very good explanations of the inference and forward chaining algorithms (and unification!) that make the language work.
edit: derp on the unification
Never used it in class or even saw in it the book. But I think its fine.
public Month()
{
this(1); // uses the other constructor
}
public Month(int monthNumber)
{
setMonthNumber(monthNumber)
}
public static final int DEFAULT_MONTH = 1; // the "public static" might be private but I'm guessing a class like "Month" will be used in a few different places
public Month()
{
this(DEFAULT_MONTH); // uses the other constructor
}
GAF I want to try and make a simple 2d game in Java for my final project. Does anyone have any good resources on simple 2D games in Java? I figure two and a half months should be plenty of time to make a simple 2D game, but I'm just not sure where to start.
Anyone got recommended material/required reading for C++, I mainly want to to get up to speed (again) on some of its basics (syntax and other things particular to it) as I'll probably be in need of it soon.
Anyone got recommended material/required reading for C++, I mainly want to to get up to speed (again) on some of its basics (syntax and other things particular to it) as I'll probably be in need of it soon.
Can anyone help me out with choosing a good Java reference book? As in, should I even get one now...? and if so, which? I'm after reading Head First Java, and I wrote some stuff by looking at the online API, but not much else.
From google I found this one, but I'm not confident at all about this![]()
some basics:Can anyone recommend some sites with C++ and Matlab tutorials?
Effective C++ is a really good book for after you've got the basic syntax down.Anyone got recommended material/required reading for C++, I mainly want to to get up to speed (again) on some of its basics (syntax and other things particular to it) as I'll probably be in need of it soon.
Those variable names... a little tricky to follow, but very cool.Thought this was interesting for those who care or are interested:
https://github.com/mortdeus/legacy-cc
One of the first and earliest versions of the C-compiler designed by Ritchie himself.
I have heard a couple of time, but not on this forum specifically, that web crawlers (Google) skip over things insideCode:tags. So if he pasted your code into Google, it would not come up on this forum because the code in those tags would not be searchable. Also, what would coding be if you could not copy brilliant coding ideas from other people and making it your own (or not!)?[/QUOTE] Interesting. How would you use code tags? This would be my first time.
int* a = new int[10];
delete a;
class A
{
public:
void foo() { printf("foo()"); }
};
A* pA = NULL;
pA->foo();
Getting a bit old these days but I always recommend Bruce Eckels "thinking in..." Books for any body starting out in c++ or java.
Effective C++ is a really good book for after you've got the basic syntax down.
Was asked to guess the result of the following codes during an interview:
Code:int* a = new int[10]; delete a;
Code:class A { public: void foo() { printf("foo()"); } }; A* pA = NULL; pA->foo();
I believe both codes will result in undefined behavior. That doesn't seem to be the answer that my interviewer wanted though... am I missing something?
Thought this was interesting for those who care or are interested:
https://github.com/mortdeus/legacy-cc
One of the first and earliest versions of the C-compiler designed by Ritchie himself.