Average starting salary by programming language
http://www.businessinsider.com/best-tech-skills-resume-ranked-salary-2014-11
Thanks for the link. One correction though, I don't think that is starting salaries, just average salaries.
I would not read too heavily into those numbers. Looking at averages alone is rarely useful, especially when you don't know the sample sizes.
Cant figure out how to fix this programming issue I'm having.
So basically I have to remove items from a vector if they are present in the other vector. Problem is, If I actually delete anything, the program goes bonkers and stops working. I know this is most likely caused by me deleting an item from the vector thats size is tied to a for loop. Unfortunately I cant figure out a way to make this work.
Nevermind the mistake part in the code.Code:void dispatch(Order *disp) { bool mistake = true; for(int j = 0; j < disp->getSize(); j++) { for(int k = 0; k<stocked.size(); k++) { if(disp->getOrderName(j).compare(stocked[k]->giveName()) == 0) { stocked[k] = NULL; //mistake = false; return; } } if(mistake) { cout<<"An Error occured.\n"; return; } } }
Edit: Apparently adding k=stocked.size(); before deleting an element did the job. Also tried break after deleting but that didn't help. Not sure if this is the best courese of action, but it works...
Double Edit: Well that actually did not work as intended. I still need advice.
Threes the charm: Got a solution. Apparently had to check if an element was NULL before comparing it to something. Otherwise it went bonkers.
I am underpaid.
namespace testLibrary
{
public class Student
{
public int StudentID { get; set; }
public string StudentFirstName { get; set; }
public string StudentLastName { get; set; }
public Student()
{
this.StudentID = 0;
this.StudentFirstName = "FirstName";
this.StudentLastName = "LastName";
}
public Student(int studentID, string firstName, string lastName)
{
this.StudentID = studentID;
this.StudentFirstName = firstName;
this.StudentLastName = lastName;
}
}
}
using testLibrary;
namespace WindowsFormsApplication3
{
public class AcademicRecord: Student
{
public string degree { get; set; }
public string major { get; set; }
AcademicRecord()
{
Console.WriteLine("Child Constructor.");
}
}
}
using testLibrary;
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
ArrayList studentList = new ArrayList();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Student test = new Student();
Student test2 = new Student { StudentID = 2, StudentFirstName = "Jason", StudentLastName = "Smith" };
Student test3 = new Student(3, "Mary", "Jones");
studentList.Add(test);
studentList.Add(test2);
studentList.Add(test3);
AcademicRecord ar1 = new AcademicRecord();
}
This really is a C# for Dummies question.
So I'm playing around with class libraries and inheritance.
I have a class (called Student) in a class library (called testLibrary).
Anyway I've tried creating a child class of Student called AcademicRecord.
Anyway whenever I try and call AcademicRecord's default constructor I get a 'AcademicRecord() is inaccessible due to its protection level'. I'm wondering why that is.
I can create instances of Student just fine so the class library is accessible just fine.
The class library looks like this:
Prefix the constructor AcademicRecord() with "public"
Each method has a visibility level, either private, protected, or public (note: I don't know C#, but this is usually the case). C# defaults methods to private, meaning that only instances of that class can call that method.
Your constructor method needs to be public so that it can be called from outside the class.
On another note, this inheritance doesn't make sense. Whenever you have a class inherit from another, make sure you check that it follows the rule of "is a". Having "Ford" inherit from "CarManufacturer" makes sense, because Ford is a car manufacturer. An academic record is not a student. This would call for the student containing a member.
Average salary by programming language
http://www.businessinsider.com/best-tech-skills-resume-ranked-salary-2014-11
Who did they interview in 2014 that is strictly a Perl coder?
Average salary by programming language
http://www.businessinsider.com/best-tech-skills-resume-ranked-salary-2014-11
Who did they interview in 2014 that is strictly a Perl coder?
The more you know about C++, the more hesitant you should be to use it.C++ is the GOAT of programming languages.
I don't think you are wrong. Java is wordy and clunky, more so than any other language I've used. It's so bad that I feel C++ actually is cleaner and more expressive for hacking stuff together on a small scale; that's not a good comparison to end up in. Where C++ becomes painful is when it's written by poor programmers and/or put in a large system.My school started us off with C++.. I took nearly 2 years of C++ classes and ended up with a job where I have to learn Java and it feels so damn wordy to me.
I found this in my bookmarks from the project:
http://www.kylejlarson.com/blog/2011/fixed-elements-and-scrolling-divs-in-ios-5/
The project was a bit of an odd thing, it used an iPad hooked up to a monitor and the iPad was viewing a webpage in a UI webview, and clicks and scrolls that the user did on the iPad would be reflected on the monitor. I had to write bridging code that would go from JavaScript to Objective-C for some stuff.
In the end it didn't work as well as the client wanted because UIWebview performance was poop on iOS7.
document.addEventListener('touchmove', function(event) {
event.preventDefault();
}, false);
System.out.println("Phone: "+sStudentPhoneNumber);
Average salary by programming language
http://www.businessinsider.com/best-tech-skills-resume-ranked-salary-2014-11
Thanks for the link, and the help. This didn't end up solving my current issue though.
It seems as if iOS 8 is just not sending the proper touch events for paper.js to understand for it's built in functions. I may just end up hard coding touch events in and calling the paper functions manually instead to see if that fixes my issue.
Frustrating!
edit: I'm an idiot. Adding some code to prevent the default touch interaction on the page fixed the issue.
Code:document.addEventListener('touchmove', function(event) { event.preventDefault(); }, false);
Glad to see you worked it out!
Hey guys, simple problem that I need help with in Java that I have no idea how to solve.
Code:System.out.println("Phone: "+sStudentPhoneNumber);
It's printing out phone numbers that it reads from a text file, the problem is that the phone number printed just outputs like this:
Phone: 5615672436
and I need it to print out like this
Phone (561) 567-2436
How do I insert the parenthesis/dashes and space into the existing string variable?
Stringbuilder should be what your looking for.
Edit: http://stackoverflow.com/questions/5884353/insert-a-character-in-a-string-at-a-certain-position
If you're choosing StringBuilder in this situation because of efficiency, you're micro optimizing.
Not sure what your getting at? Situation not call for string builder? I also wouldnt clump phone numbers like that.
GLint loc1 = glGetUniformLocation(shader.id(),"rgba");
glUniform1fv(loc1, 4, rgba);
glGetUniformfv(shader.id(), loc1, ptr2);
printf("#####%f, %f, %f, %f\n",ptr2[0], ptr2[1], ptr2[2], ptr2[3]);
GLint loc4 = glGetUniformLocation(shader.id(),"modelviewprojection");
glUniformMatrix4fv(loc4, 1, false, *modelviewprojection.m);
glGetUniformfv(shader.id(), loc4, ptr2);
for(int i = 0; i < 16; i++)
printf("#####%f\n",ptr2[i]);
I meant that the performance difference between concatenation and using StringBuilder is so negligible that you shouldn't be considering performance as a factor at all. It's generally considered best not to worry about performance until you have a chance to profile your code and determine exactly where efficiency is needed.
Checkout String.format or system.out.printf formatting.Hey guys, simple problem that I need help with in Java that I have no idea how to solve.
How do I insert the parenthesis/dashes and space into the existing string variable?
if (sStudentPhoneNumber.length == 10) {
int area = sStudentPhoneNumber.substring(0, 3);
int p1 = sStudentPhoneNumber.substring(3, 6);
int p2 = sStudentPhoneNumber.substring(6, 10);
system.out.printf("(%s) %s-%s%n", area, p1, p2); // %n adds a line break
} else {
system.out.println("Invalid number?");
}
In fairness, this is true no matter what language you pick. Consistent code style is completely arbitrary and completely essential.C++ gets syntactically hairy fast though. Never mind good code practices; it's difficult to get consistent code between people if there's no, or lax, code style guides.
Yeah I see what your saying. StringBuilder was just the first thing that popped in my head when reading his issue. I don't see his response yet so hopefully he figured it out.
Checkout String.format or system.out.printf formatting.
//if (byState.size() > 0)
//{
//stateCensus.push_back(byState);
//}
//std::list<CityCensus> byState;
//CityCensus newCity(city, state, ten, eleven, twelve);
//byState.push_back(newCity);
I need some help with opengl/glsl. I'm trying to pass some variables over as uniforms to the shader but I want them to be type vec4. In opengl/main they are set up as float array[4]. How can I do this? I can only seem to set them up in the shader as the same type, which is very annoying for calculations. Is it possible to pass float arrays to the shader and have them be type vec4?
Also when I run this code it only spits out the first value. It works 100% as I can see the color change but only the first number is non zero as I change it.
Code:GLint loc1 = glGetUniformLocation(shader.id(),"rgba"); glUniform1fv(loc1, 4, rgba); glGetUniformfv(shader.id(), loc1, ptr2); printf("#####%f, %f, %f, %f\n",ptr2[0], ptr2[1], ptr2[2], ptr2[3]);
This works just fine though...
Code:GLint loc4 = glGetUniformLocation(shader.id(),"modelviewprojection"); glUniformMatrix4fv(loc4, 1, false, *modelviewprojection.m); glGetUniformfv(shader.id(), loc4, ptr2); for(int i = 0; i < 16; i++) printf("#####%f\n",ptr2[i]);
// compile & link shaders and get the program_id from OpenGL
GLuint location = glGetUniformLocation(program_id, "colors_variable_name_in_shader");
glUseProgram(program_id);
float color[4] = {1.f, 0.5f, 0.7f, 1.f};
glUniform4fv(location, 1, color);
// now you're ready to draw
How are you using byState before it's declared?Oh my. Program I'm working on just destroys my computer lol. Just hangs after I put in some object instantiations, so I'ma guess my problem is there somewhere.
It's something to do with these segments:
Code://if (byState.size() > 0) //{ //stateCensus.push_back(byState); //} //std::list<CityCensus> byState;
Code:// compile & link shaders and get the program_id from OpenGL GLuint location = glGetUniformLocation(program_id, "colors_variable_name_in_shader"); glUseProgram(program_id); float color[4] = {1.f, 0.5f, 0.7f, 1.f}; glUniform4fv(location, 1, color); // now you're ready to draw
Also, watch for any OpenGL errors you might have. I've said this a few times, but I love ApiTrace for checking if I have any OpenGL errors. It's pretty easy to build, too. On Linux at least... haven't tried on Windows.
How are you using byState before it's declared?
byState is actually a global. Is my line there in that if block not just making a new object? I'm unfamiliar with c++.
//if (byState.size() > 0)
//{
//stateCensus.push_back(byState);
//}
//std::list<CityCensus> byState; <-- this creates a new object called byState
byState = std::list<CityCensus>();
byState.clear();
template<typename T, int m, int n>
Matrix<T, m, n> columnMatrix(vector<T,m>&&... vecs)
{
Matrix<T,m,n> ret;
//blah blah blah construct the matrix from the given column vectors
return ret;
}
You seem to be creating a second object called byState at function scope. All further references to byState in that function would be referring to the function-scope byState rather than the global one. That's called called 'shadowing'.Code://if (byState.size() > 0) //{ //stateCensus.push_back(byState); //} //std::list<CityCensus> byState; <-- this creates a new object called byState
If you wanted to clear the existing byState, you'd do something more like this:
(which creates a new list and assigns it to the existing one)Code:byState = std::list<CityCensus>();
or
(which just calls the method that empties the list)Code:byState.clear();
Aren't varadic arguments handled at runtime? I don't think it's possible to specify n, because it depends on the varadic arguments (which could be staticly handled, but are not... they come from C, afterall).I have a piece of code sort of like this
Code:template<typename T, int m, int n> Matrix<T, m, n> columnMatrix(vector<T,m>&&... vecs) { Matrix<T,m,n> ret; //blah blah blah construct the matrix from the given column vectors return ret; }
Which clearly doesn't work since a call to columnMatrix does not give the compiler enough information to determine n. Obviously this is because it doesn't know how many arguments are in the vecs pack. I could explicitly state the n for each call of columnMatrix but I would prefer not to
I don't know how I can maintain the call syntax and be able to infer n.
Perfect! Fixed the memory problem as well
Hey guys, so Im fresh out of college, and I have an interview setup next week for a position as an automation tester.
Can anyone give me any details on it? Does anyone here have experience in that position?
Aren't varadic arguments handled at runtime? I don't think it's possible to specify n, because it depends on the varadic arguments (which could be staticly handled, but are not... they come from C, afterall).
That said, I don't know that much about either varadic arguments or the new parameter packs. The latter might have a way to do this, since I think it is compile-time...
EDIT: See: http://en.cppreference.com/w/cpp/language/parameter_pack
And: http://stackoverflow.com/questions/...er-pack-is-there-a-c0x-std-lib-function-for-t
EDIT: EDIT: I didn't notice before, but you refer to vecs as a pack. I'm not convinced it is. From my understanding, it needs to be a template argument to be a pack. I think without that it is a varadic function. See: http://stackoverflow.com/a/20407859/331041
And the troublesome bit of code here.vector <Item*> inCart;
inCart.insert ((inCart.begin()+i), (n-count), *prod);
Also, std::list is not the equivalent to C#'s List. std::list is a linked list, which is only rarely useful. You probably want std::vector.
I am a bit stuck in my program. I am doing a Multi-List Ordered List (Linked List) with Java. Really sucks, actually.
So, I am getting this rather strange exception when running:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -2
at SortedLinkedList.SortedLinkedList.getLength(SortedLinkedList.java:382)
at SortedLinkedList.SortedLinkedList.getObjectsForKey(SortedLinkedList.java:107)
at SortedLinkedList.Test.main(Test.java:63)
Not sure why I am getting -2, honestly.
Here's my Classes, for reference:
http://pastebin.com/HuSkMFJp
http://pastebin.com/0uTdFSGr
http://pastebin.com/PD0SBLhE
So basically, all I want to do right now is:
d. Display all flight information for a user inputted Flight # + Date this will list all the airports visited on this flight
The getObjectsForKey method is where I am making my implementation. Just kind of looking for some direction as to how to debug this.
So in C++ and inheritance.
I have 2 classes, one is inherited from another, both contain a vector of the same name.
I have a function in the base class that accesses the vector and want to use it in a derived class function. However this does not work. If I copy the function to the derived class it works.
Is there lika way to make this work?