Rashakil Fol 978 Super Senior Demiposter Team Colleague

openssl is open source.

Uh... what do you want this for?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Thanks for your reply but could you please tell me what is clojure??.As this is the first time i am hearing about it..:-Osome basic infos about clojure.:-/

Search for it on Google. It's a nice language that has access to all the Java libraries.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Hi frnds...
I am doing ma collg 1st yr and i am of CSE department(comp sci engg) and i want to do some additionals course on languages.I am already studying c nd c++ in ma sub and in add on to that i wanna study some other language as i am more interested in developing programs..plz reply me soon frnds w8ing 4 ur replies
;)

Learn Clojure.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Your problem is that you're writing very complicated and redundant code and thus it's hard to think about what your code is doing. Use a simpler algorithm to find and remove the largest and smallest values.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

and I know u can't bound a sum

Um, yes you can. For example, you can make a very rough bound: if you have a sum of j values that are each less than or equal to k, then their sum is less than or equal to j*k. You might be able to get a tighter bound, though -- going by the reasoning I just gave, you would say that 1+2+4+8+...+2^n <= (n+1)*2^n, which is more general than necessary -- a tighter bound would be 2*2^n. The sum actually equals 2*2^n - 1.

So you can, with very simple reasoning, find an upper bound for a sum -- but it might not be a tight upper bound -- it will give an asymptotic bound that is between O(1) and O(n) times the tightest possible.

To find a lower bound, you can use the same reasoning in the opposite direction: if you have a sum of j values that are each greater than or equal to l, then their sum is greater than or equal to j*l. So by that reasoning, you could say that 1+2+4+8+...+2^n >= n+1. That's pretty useless.

You can actually create a tighter lower bound (restricting yourself to dumb reasoning) by dropping the smaller elements from the sum. Let's drop half the elements from the sum: 2^(n/2) + 2^(n/2+1) + ... + 2^n >= ((n+1)/2)*2^(n/2). We get a tighter lower bound -- but not as tight as possible.

Try doing this reasoning to …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Is this where an instruction contains its addresses? For example, an instruction "0000 0001 0010" might mean "copy the value from register 1 into register 2", because "0000" means "copy", and "0001" and "0010" are "addresses" of a register. I don't really know the lingo.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I don't know.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The Akra-Bazzi theorem ( http://en.wikipedia.org/wiki/Akra-Bazzi_method ) applies in this case because sqrt(n) is O(n/log(n)^2) so you can just use the Master theorem. So BestJewSinceJC's intuition is correct.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

It depends on what field you're in. If you even have a desire to ask the question, that's trouble for you.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

At the very minimum, if this is an array of N-bit integers, we'll need 2N bits of state, because there's no way to represent two arbitrary N-bit integers with fewer than that amount of information. So if there's a very clever solution, it'll have two accumulatory variables. Maybe there isn't -- maybe it needs something like three or four variables, because of the nature of the problem. Of course, it might need O(N) space and O(N) time if you can't do better than a hash table.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Let's say I can do it with no variables.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

What is your definition of "tree"?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I have never heard the term "fabricated software." Sorry, I don't speak moron.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Especially I would recommend the comp.graphics.algorithms faq. There's a book section in there. I have no idea whether the recommendations are good or not, but if you look at the reviews on Amazon you might get some more info.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Generally speaking you use a graphics card for that... But if you want to implement them yourself, much of the good information is in textbooks. In general, search Google for "graphics algorithms" and "graphics algorithms book" -- I haven't looked closely but they seem to lead to promising results.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

D) Other, please explain

It doesn't matter. Do what you enjoy. It's not like it's hard to learn a new language later. Realize that you'll have to mostly teach yourself C++ if you really want to learn it, because your school is going to suck at teaching you C++, probably. You should take the C++ classes because if you're good at programming, they'll be easy, and if they're hard, they'll make your mind grow so that you become better at programming.

Also, you can learn more than one language at a time. You can learn 2 at a time. Or 3. Or dabble in whatever you want, from day to day.

Please consider Job opportunities.

This is the most depressing thing I've read today.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Don't listen to him, his complaint is logically inconsistent with the fact that you made this thread and using colors isn't going to draw extra attention to the first post of the thread.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You can't have abstract constructors since the child classes cannot implement constructors from an inherited class...

Obviously I wasn't talking about his code example because the methods there were not marked abstract.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Either that or the methods were abstract.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

First you will need a medical degree so that you know how to recognize a cataract when you see one. My eye specialist had to shine a bright light in my eyes in order to find them. Maybe you can do the same with a color picture -- maybe not. I don't know.

You just need a bunch of pictures of eyes with cataracts and without. Then write a classifier to classify the images.

Rashakil Fol 978 Super Senior Demiposter Team Colleague
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Recession is not over yet , so be happy whatever salary you are getting , more than 10% software engineers are job less now.

Don't listen to this troglodyte.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

It depends on location, but yeah, it's competitive. Do you want to work there?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Hi, my name is Strong(such a cool name :]), and I am a high school student looking for career path to follow.

Psh, Strong is nothing -- check out the names of Alan Grayson's children: http://grayson.house.gov/about/

I have found that computer engineering may be an fun and interesting career, so I have came up with a couple of interview questions, to learn more about the job. So if you have time for this please answer my questions. Thank you :D

I'm not in computer engineering. This is a computer science forum, which is a different field than computer engineering. The exact definition of computer engineering varies from university to university. But it's Halloween season, so I'm going to put on my computer engineering hat and answer your questions. I'm a computer programmer.

1. Do you love what you do? why?

No. I'm working on menial business programming.

2. Do you interact with other people or other engineers a lot?

Yes.

3. How dangerous is your job? Have you ever been seriously injured?

No. But a previous job was dangerous because I was programming some laser measurement device calibration system, and I could have gone blind.

4. How did you get interested in the field you work today?

I didn't "get" interested -- I was interested in computer science before I had heard of computers.

5. How are the work hours? Do you get breaks or off days?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

No, next_permutation won't work because his desired output is out of order :)

Hope this helps :)

#include <stdio.h>
int main(void) {
  puts("123");
  puts("132");
  puts("213");
  puts("231");
  puts("321");
  puts("312");
  return 0;
}
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Just write your "codes" in Python, test it that way, and tweak your syntax in arbitrary directions so that your code suddenly becomes "pseudo" code.

Thank you, and stop bothering me with your inane questions.

majestic0110 commented: lol +3
Rashakil Fol 978 Super Senior Demiposter Team Colleague

The U means that it's an unsigned integer literal. size_t is an unsigned integer type that's guaranteed to be able to hold the size of an array. But not a std::string. If you're paranoid you should use std::string::size_type. Don't be.

Your program is not segfaulting because of the hash function. The error is elsewhere.

iamthwee commented: Telling it how it is. Props to you young man. +11
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Thanks, but when I implemented your hash function it took nearly twice as long. Any other functions I should give a whirl?

Is your call to .length() getting called every time or are you assuming that will get optimized away?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Could someone explain to me why I received a down vote for my reply to this thread. Seems a little undeserving.
Or better yet, why doesn't the person who down voted my reply man-up and say why.

What do you care what other people think?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Don't use any globals (i.e. static variables) and have your function that calculates the answer be separate from the function that prints the answer.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Try understanding what the code does. This will allow you to find the fault. I suspect that I have made some stupid error in it, which you can easily figure out... :)

Bah, I meant to uprep this post with "complete win" while downrepping the first, but forgot you could only rep somebody once per day. :(

Rashakil Fol 978 Super Senior Demiposter Team Colleague

That's just saying it takes n-1 comparisons on the first pass, n-2 on the second, n-3 on the third, ... and 1 on the n-1'th pass -- so there are a total of n-1 passes.

So, ask yourself: why? What does bubble sort look like? What does it do, during each pass? Why is it not n-1 comparisons on every pass? Look at the actual algorithm's implementation.

As for the total number of comparisons: you'll want to add up the number of comparisons on each pass. What is 1 + 2 + 3 + ... + (n-2) + (n-1)? Hmmm, a math problem.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

When you run a Theta(n) operation n times, it takes Theta(n^2) time to do. I mean in general if you run an operation that takes n seconds n times, it's going to take n*n seconds.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Static methods are just global functions that could very well have nothing to do with the class you've put them in. Methods that are not static are merely functions that, in their definition, implicitly take the object they're called on as the first parameter.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I'm not so sure I expected the Array.Sort to go through any particular order, but I expected it to only compare spots in which a file actually existed. If I declare the array to be 64 spaces large, then only fill 5 of them, and tell it to do an Array.Sort does it sort even blank spaces?

There's no such thing as a 'blank space.' An array with 64 elements will contain 64 elements. Some of them will be null, because that's what they were initialized with -- but that's no different than if you had assigned null to any particular element. Array.Sort will try to sort the entire array.

If that's the case I guess I could just as easily push each one to a List<File> and then call Array.Sort on that.

Yes. You shouldn't preallocate arrays and then put several values in them, you should just use List<>.

sknake commented: This pains me to +rep you, but it is deserved. +5
Rashakil Fol 978 Super Senior Demiposter Team Colleague

It basically goes something like this:

1. Read the problem.
2. Think.
3. Write down the answer.

It might help if you ask a specific question, so that we might tell you how we'd go about solving it.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The "second" file from the list? Are you saying you're expecting Sort to look at the elements of the list in some particular order?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Basically as soon as it gets to the "Array.Sort" line it crashes where "int b" is declared in the "FreePtrCompare" class saying that File y is null object/pointer reference. which it is, but I'm not entirely sure why that isn't being passed through correctly.

If File y is null, what do you expect to happen? What is y.fsPos supposed to do when y is null? (Hint: it throws an exception.)

Apologies for the snark.

You should modify your Compare method to explicitly handle the case where parameters are null.

Edit: or you could remove nulls from the array that you're sorting, if that's the right thing to do.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Scala rules, Java drools.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Why is it Theta(n)? Isn't it still O(1) since it's still a constant number of steps done twice? Or does the fact that it's repeated mean it's linear where n is the amount of repeated operations?

No, when n is the size of the array, resizing takes Theta(n) time because you have to copy all the elements.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

No -- mainly because we don't know what problem you're having, other than that you find it hard.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

That's a pretty vague question.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

This should cause extra usage in the time of the algorithm. However, I don't know how to convey this on paper with asymptotic notation :( Hmm...

You would just write that each push and pop wolud take Theta(n) time. (And so the average time per operation is Theta(n) which is bad because we'd like it to be O(1).)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Describe all the interesting projects you've worked on outside of class.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

No, you're doing the proof backwards! You don't "know" that c1, c2, and n0 exist such that c1 <= 1 - 2/n + 1/n^2 <= c2 forall n >= n0 unless you prove it! You have to _show_ that values exist, that could be used for c1, c2, and n0, such that that statement is true. And this is easy to do: pick values fo c1, c2, and n0, and then show that the inequality is true whenever n > n0.

The fact that the inequality is true when n = 4 is completely irrelevent, because it does not mean that the inequality is true when n = 5, or n = 6, and so on. You have to show the inequality's correct with algebraic manipulation (or perhaps some other line of reasoning).

Also, one thing me and my clasmates don't understand is what n0(pronounce n not) really represents. Does it really have to be noted that it exists?

When using big O notation and its relatives, we're only interested in the relationship between functions as the values grow larger and larger. We don't care about the behavior of the functions when they're very small. So, when using theta notation, we'd like to say that the functions remain within constant multiples of one another. But suppose we were comparing the functions n and n - 2. Is n - 2 in theta(n)? Well, you'd note that when n = 2, the ratio |n-2|/n is zero. So you might say …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

When it scans, the object will be one color and the background will be another, right? Count the number of pixels that are the object's color. And multiply that by the area of a pixel.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

SVN I liked pretty well, but I agree with CVS. We were forced to use it for school one semester, and I used it without problems. The next semester, I helped a friend use it who didn't understand it. I locked him out of his own repository, giving an error that I couldn't resolve. It basically said another user had locked the resources, yet it was a one person project. . so there was nobody else who could lock the resources. Turns out a lot of his classmates experienced the same error and the professors just granted extensions.

I've found git and hg to be much easier to use than svn. Certainly for personal use they're very easy -- you don't have to setup an svn server anywhere. Then it's easy to add other people, because... you don't have to setup an svn server anywhere. And you don't have to worry about being connected to the internet all the time, which for somebody like me is useful. SVN is still better if you only want to give people access to a particular subfolder of your source code or if you're dealing with large binary files. And yeah, CVS is basically crap, that's the reason SVN got invented.

Nick Evan commented: Yes! +10
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Finally find one real world applications that use this technology,

You've received an impossible assignment.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

And another note - on a real project, you use a code management system such as CVS or SVN where everyone can share code, but without working on the same code at once or interfering with each other.

Never use CVS. Don't even mention CVS. Usually, don't use SVN either; it's easier to setup something like git or hg and they're better in most ways, but it depends.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

And to prove this, I can pick a lower bounds of 1 (cL) and upper bounds of 5(cU), where n is let's say 3.

1(2+3) <= 2+3 <= 5(2+3)

If this is right, then I'm starting to understand this notation.

Your answering is right, but your "proof" is quite nonsensical. You're just saying that 1*5 <= 5 <= 5*5? What does that even say? You have to show that the inequality holds for _all_ n greater than some base value, not for some particular value of n. And your inequality is nonsense, you just plugged n=3 into 1*(2+n) <= (2+n) <= 5*(2+n) which is a true but irrelevant fact. Maybe you meant to plug n=3 into 1*n <= (2+n) <= 5*n. Alas, you'd still need to consider the case where n=4, and the case where n=5, and so on, but you can't do that, because you'd get bored after checking the case n=362 and you'd still have infinitely many cases to check. So you might say something like this instead:

"And to prove that n + 2 is in Theta(n), we note that 1n <= n + 2 <= 2n, when n >= 3."

Maybe it's necessary to prove the inequality. I'd say it's obviously true, but you might want to state that the inequality is satisfied when n = 3 and then that the slopes of each part (1, 1, and 2) also satisfies the similar inequality (1 <= 1 <= 2), which means the inequality n …