Rashakil Fol 978 Super Senior Demiposter Team Colleague

Hello Qonquest, unfortunately you no longer have the legal right to use the code you have written. By posting your code, you have granted DaniWeb an exclusive copyright license to your code according to DaniWeb's terms of service. You may no longer use it and have no rights to you code. Please delete your code from your computer. As the Terms of Service say:

Any and all information posted on DaniWeb may not be copied or used elsewhere, in any way, shape, or form, either on the Internet or in print, without prior written permission from Dani Horowitz.

Further transmission of your source code material, such as in a personal project or in handing in an assignment, may be prosecutable as criminal copyright infringement.

happygeek commented: yawn +0
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Note that I fixed a few other issues as well... :-)

Oh really? Now Valgrind can't catch uninitialized value errors when somebody forgets to initialize the object with setvolume.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

That is a low-specced laptop by modern standards, but it's not a cheap piece of trash by merit of being made by Lenovo, your classmate is an idiot. It's cheap because Lenovo's Ideapad line is a bunch of cheap laptops. Obviously if you're going to get the laptop that costs the least, it's going to be one of the worst laptops out there.

Also the CPU is two generations old, assuming I'm reading you correctly. I assume you mean an i3-370M, and 2.4GHz. It will suffer from significantly worse battery life that it would get with a later generation. However, it's powerful enough for any modern need, unless you want to play graphics-intensive video games.

It's a laptop, not part of your identity, so you shouldn't care if it gets insulted.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The answer is that yes, exploiting security holes requires programming. And finding them requires knowing how to code, too.

(Or we could get butthurt and chatter on about how one person could write the code and another might deploy it, and gosh, some people are morally wrong, how dare they be so? But that's boring and we might as well find something more entertaining like watching the paint dry, or arguing about what the definitions of words should be.)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Start with Cryptography Engineering.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Koenig & Moo's Accelerated C++ is the standard recommendation for people who already know how to program in a language.

Personally I didn't have the mental capacity to learn C++ until I was 18. Other people could certainly learn it at a younger age.

He could always learn Python. Or Haskell.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You could also figure out your problems by reading the Common Lisp hyperspec.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

If you package it right you can make something with no dependencies. You just have to distribute a Python exe with your application.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Java or Python would suffice.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

What do you know about linked lists? Can you implement a linked list? Do you know what you can do with one?

Surely you understand what polynomials are and how adding them works.

One part of the question is, how would you represent a polynomial using a linked list? The other part is, what's the algorithm that would add two polynomials that are represented thusly?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I'm going to college with a computer science degree in mind, but I ask myself am I ready for the math.

There's also the question of whether you're ready for the programming.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

There does exist this notion of "front-end developer". There is a market for those skills. How much money you could make depends on how good you are and how good you are at getting people to give you money.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The people in this thread are apparently completely wrong, ignorant hicks.

Can I use my own code that I slapped a GPL on and provided to sourceforge in my own commercial application?

Yes.

In that way, does the GPL somehow relinquish my own rights to my IP?

No. It only gives other people rights to your IP.

Yes. You could use the code to a certain extent and with sufficient changes not be legally bound by the GPL, but by placing the code under the GPL you've given up your right to make a verbatim copy under closed source.

This is completely wrong.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

A flat text file could have an index too. You can't be too strict about these sorts of definitions.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

> Moreover, I somewhat find the way in which the depth (height) relates to the number of nodes at each level confusing to me. Perhaps because I think of how the Heap is represented both as an array and as a tree. But I know that with every deeper i, the Heap splits children such that its got 2^i nodes at each i.

Okay. It seems to me that you get it. At the end of this post I will show an exact calculation of the heap's height.

> The while loop runs in O(log n) time because the worst case depth an element could have is the whole height of the tree.

Also there's implicit in your argument the fact that the body of the while loop takes O(1) time. It's perfectly reasonable that you omitted this obvious fact in writing down your explanation. This and the rest of your argument are correct.


Now here's how I would calculate the exact height of the complete binary tree. Let's first note that the first k levels of the tree can hold 1, 2, 4, 8, ..., 2^(k-1) nodes, respectively. Then the first k levels of the tree can hold a total of 1 + 2 + 4 + 8 + ... + 2^(k-1) nodes. That sum equals 2^k - 1. So, if we have a complete tree with n nodes, where 2^k <= n < 2^(k+1), the first k levels of the tree cannot …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

So it seems like you understand most things, but you are thinking somewhat fuzzily and imprecisely. You say "around O(log n)", you count some leaf nodes as internal nodes in your answer to the second question, and you said a balanced binary tree is log n height with a question mark.

So I have to wonder these things: Why are you unsure? Why are you saying "around" O(log n)?

Why can't you compute the running time of that function?

is what I am wondering. If you know the height of a balanced binary tree, you should be able to compute the running time of the while loop. If you know the running time of Extract-Min, you should be able to compute the running time for the entire function. If you don't know what running time means, or don't know the math, you need to learn that.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Why aren't you sure it's O(log n)? (It seems totally obvious to me, of course I'm very familiar with this sort of thing.)

Specific questions I have to probe your understanding:

- Do you know the running time of Extract-Min? What is it?

- Do you know what shape a heap's tree looks like?

- Do you know the depth (i.e. height) of a balanced binary tree?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

If a heap is stored in an array, you can access the element at a given index in constant time. I think this is what the question assumes. I don't know what it would mean by "its index" if the heap is stored using an old fashioned tree with nodes and child pointers.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I think you misunderstand the question. What are you using the hash table for?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

No they don't. Not ones you'd want to work for.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

No, certifications are worthless, especially Microsoft certifications.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Just learn to deal with Logo's syntax.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Do something involving computers.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Taywin is basically incredibly confused.

If your algorithm does n^2/2 + n/2 operations then its running time is Theta(n^2).

As a general rule the polynomial a*n^k + b*n^(k-1) + ... + c*n^0 is Theta(n^k).

In particular, (1/2)*(n^2) <= n^2/2 + n/2 <= n^2, for all n >= 1. (Can you prove this yourself?) This by definition means that the function taking n to n^2/2 + n/2 is in Theta(n^2).

Edit:
You could also say that your formula n*(n+1)/2 is Theta(n*(n+1)/2). This is never incorrect. Of course the idea is to simplify it, since Theta(n^2) = Theta(n*(n+1)/2).

Rashakil Fol 978 Super Senior Demiposter Team Colleague

That depends on how your program is written. Does it take the file name as a command line parameter? Does it read the file as standard input? It depends.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You'll need to use map or write a recursive function that is like map.

Note that your output requires O(n^2) work to construct, which means you'll need an O(n^2) algorithm here, not one of these obviously-O(n) algorithms.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

If it's supposed to be impossible for a value to be null, don't check if it's null. But if it's possible and all you want to do is exit the function, either way is fine. Do what you want.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Obviously it's PHP.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

1. I'm not telling you my name. My job is "Systems Engineer" but "Software Engineer" or "Software Developer" or "Computer Programmer" would also fit.

2. Every day.

3. Not very important, because usually it's code comments and IRC messages, which is far less important than the actual code. Discussions are a more important form of communication at my company, but that's partly because it's small. As you grow you need more in writing.

4. Not really.

5. See #3.

6. This question makes no sense.

7. There are none. The only thing that matters is that the writing says what is needed to be said.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Yes, Common Lisp is a general purpose programming language, and you can do pretty much anything with it (except things that really need to run without garbage collection).

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Look at the wikipedia articles, read them slowly and carefully, and tell us what you don't understand.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Depends on what YOU consider "awsome". Awsome software such as Microsoft Word or Paint, is written by a team of programmers, analysts and graphics designers.

ROFL it doesn't take a Team Of Programmers to create MS Paint.

And it usually takes years to design, code and test.

Maybe at Microsoft.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

That sounds correct (assuming you've defined a BST accordingly).

If you want to be really anal you should explicitly point out that S is a binary tree.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

If you haven't entered college then you don't really know what career you want, but if you like making software then maybe you should major in CS, or maybe math or computer engineering if you're into that too.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Basically the cabal packaging system, or possibly the Hackage package repository, is crap. You can get around problems by installing the required dependencies directly. For some reason, this works. It is a mystery.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Uh, write the code in a file? And then load the file.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Looping up to j-2 sure looks dubious.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

If you can't even pass the easier math course, I don't see how you could be any good at programming or computer science. From what I can tell of your few posts on this forum, you do not have the aptitude for either subject.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You probably don't really know whether you're good at math. So I'm not going to believe you when you say you're not very good at it. (Actually, I might believe that you're not very good, but I won't believe you if you say you're not good at it.)

Are you good at programming? That's basically the only question which tells whether you can handle a CS program. And that includes the math parts (which are quite elementary).

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Um, yeah. *itemsArray is an AoE2Wide::DrsItem& , and inTables[q].Items is a std::vector<AoE2Wide::DrsItem>& .

You can't assign a DrsItem to a std::vector<DrsItem> .

That's what the error message said.

Edit: And then you're trying to read the Id field of a std::vector<DrsItem> ? Again that's what the error message says. A std::vector<T> does not have an Id field.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

No.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Of course not. Who do you think you are?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

What part do you need help with?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

C++ is. It's complicated and subtle.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Maybe there are some tests that are highly correlated with abstraction ability. For example, suppose you gave the examinee a shuffled deck of cards and asked him to sort it in a particular order. Then have him shuffle it and then pick a different way of sorting it in that particular order. See how many ways he can think of. This is not an objectively measured test or one that's efficient to administer. (I don't know if it would be an effective test, either -- my point is that a good test might be some particular problem such as this one. I assume you realize that I'm not an expert on testing, I'm a babbling idiot on a message board.)

There are also the tests that some computer science teachers gave students which showed new people who had never programmed before some really simple pseudocode and asked them what the given program's output would be. (I forget whether they gave some examples of code with output, too.) Those students who adopted a consistent mental model of how the program would work were the ones who ended up doing well in the class.

But is that measuring abstraction ability? Is it measuring something correlated with abstraction ability?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Abstract is not a verb.

How you approach this problem depends on what your goals are, which affects whether you'd rather have a high false positive rate or a high false negative rate.

The proper general approach to your question also depends on the age of the people you're assessing.

> Also what questions could i use to test someones abilty to think of different uses for objects.

Are you hiring ninjas?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

If you're afraid of the USA and Americans in general, then you've apparently never been here. Believe it or not, you can walk down the street, and people don't shoot you! Not even the police! Why are you so afraid of people?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

In the long run (where "long run" means 10-20 years), gun rights don't matter. Once desktop manufacturing becomes affordable, people will be able to download whatever kind of weapons they want.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Ignore all these scrub posters and use Horner's algorithm.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Dealing with the syntax is the easiest part of programming and of learning how to program.

> There is a balance between making programming languages look like natural languages and having them be as unambiguous as possible.

I would disagree, completely. There is no reason to make programming languages look like natural languages.