Rashakil Fol 978 Super Senior Demiposter Team Colleague

Going by that reasoning, any algorithm is constant time (or doesn't terminate) because computers have a finite amount of memory. That's not the point. Anyway, there's no clean function that would tell you how many iterations of 2^_ are needed to reach a given number.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Delete it.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Haskell's the right language to learn functional programming. Well, maybe SML is a good baby step.

The lisps aren't really functional languages, and, other than R6RS Scheme and Clojure, are not particularly modern. (At least not by lispy standards. They're more modern than most newer languages, certainly.) They are good for functional programming, they just happen to not be particularly functional themselves. Maybe I'm a bit of a purist, sorry.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

This is clearly (n choose 0) + (n-1 choose 1) + (n-2 choose 2) + ... which is well known to be the fibonacci function.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

i would guess yes.

You would guess wrong. If you consider computing 2^x to be a constant time operation, it's faster than log(n), but if you consider the actual cost of computing 2^x, it's slower than log(n).

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Use a server-side script.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Welcome to the internet, nwest.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

What's the powerset of the empty set?

Given x and given the powerset of xs, what's the powerset of (x :: xs)?

Bam, use recursion.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You don't have to write mouse move code for each. You just have to write it once.

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

Try doing some thinking.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The approach I recommend taking to red-black trees is to (1) understand the constraints of a red-black tree and why they mean the tree is balanced, and (2) implement the tree yourself, in a convenient programming language.

It's fairly straightforward to understand why the constraints lead to a balanced tree -- they just implicitly bound the depth of the tree. The rest is just implementation details, and that's something you understand best by implementing it. Figure out how to add and remove elements while maintaining the constraints, yourself.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Very carefully.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You can make games in C#, you can make web applications in C#, and you can make desktop apps in C#, so just go with C#.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Maybe you should read what you have more slowly and carefully. If you can't understand something just because it's not laid out for you in just the comfortable manner, you need to learn how.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I hate dumb instructors.

I would just add up how many times the very inside part executes.

In the first example, the inner loop executes its inside n times each time it's run, and the inner loop gets run n times. So the inside of the inner loop gets run n*n times. Easy, right?

In the second example, the very inside of the inner loop gets hit 1 time the first time the inner loop runs, then 2 times the second time the inner loop runs, and then 3 times, and then 4 times, and so on, until the last time it's run, it runs n times, for whatever value n is.

Adding those numbers up, we see that the very inside is hit this many times:

1 + 2 + 3 + 4 + ... + (n-2) + (n-1) + n

What's that sum? Using pure *math*, we can find that the expression adds up to n(n+1)/2.

And so the inner loop gets run n(n+1)/2 times. It looks like your professor (who said n(n-1)/2) was wrong.

(So how do you find that the sum of the first n positive integers is n(n+1)/2? There are many ways. One way is to pick the points (1,1), (2,3), (3,6) and find what parabola fits it by solving the equations ax^2+bx+c = y, where (x,y) are the constants (1,1), (2,3), and (3,6) in the three equations, and a, b, and c are the variables we're …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

What languages depends on where on this planet you live. Look in the newspaper and see what the bigger IT company's are looking for.

"IT company's"? Anyway, regarding the question of commonly used languages, the answer is something like Java, C#, C++, C, Perl, Python, .... The exact ranking depends on your location.

Look into the biggest technical university in your country and see what language they are teaching. This will give you a hint of what is in the air at the moment.

No it won't, unless by chance it is.

Which language should I start back up with, what do you recommend and why?

How quickly do you intend to get a programming job? C# 3. There exist .NET jobs to choose from. You'll learn more with C#, because it's a more advanced language, than you will with Java, so that's why one would prefer it.

Which websites would be most beneficial you think?

If C#, the MSDN language documentation would be beneficial, and a few blogs like Eric Lippert's blog archives would be beneficial.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I would recommend checking out Learn You a Haskell online. It's a tutorial, and it's well-written and focused. It will be useful. Maybe you're already past the point where it would be useful. Anyway, I'm glad you got through the assugment. Do you really understand how monads work? And do you know how do notation translates to calls using >>=?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I don't know what they mean by encapsulating the data from the driving the car code into an object oriented design.

I don't either. The question seems like B.S. to me. If they want to teach object oriented concepts they should do it with real examples and with real programs. Go to your university and demand a refund.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Um, iPad applications can do multi-threading. You don't know the difference between threads and processes, do you.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You basically don't understand what's going on or how Haskell works and you need to go back to relearn some of the basics. This is going to take some time, since there's stuff that comes before do blocks, like mandatory variable naming conventions, that you should not be confused with, and yet you are. There's not much of a point of filling these informational blanks -- it's too much. Go back and learn the material you should have learned already.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

It was Fern Gully, not Fern Valley.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Do you not know how the modulus or / operators work? Please identify the source of your confusion.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

This should be a thread, not a code snippet. What Scheme interpreter are you running?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

i can, and i already proved it. Why don't you make your own signature and don't be jealous. ahaha.

The person was probably a low-quality "genius" then. Or maybe you defeated him at wrestling.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

@naraue: you criticize people like your a super genius... ohhh... your too full of yourself... you think your so smart?

She is a super genius.

And oh, by the way, you can't defeat a genius through hard work.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Hi I am ravi, this is my first personal interview in my career. Please comment me over my answers and my way of answering:)

No, I'm going to make some general commentary about society and seem really obnoxious but that's just the effect of stupidity rubbing off on me.

Q: Tell about yourself?
Me: I am N.Ravikumar coming from Unjapalayam; I am pursuing my B.Sc Information Technology degree in Dr.NGP Arts and Science College. I love programming and blogging.

Okay.

Q: what are the different stages in SDLC?
Me: Requirement Analysis -> Design -> coding -> Testing -> Implementation and Maintenance

What? WTF is SDLC? Is that some Indian codeword that they teach? Oh, it means Software Development Lifecycle. And your answer's wrong because there are plenty of different approaches to the question of how to develop software. It seems like you're describing the waterfall model, which is the worst one. I can't understand how an education system could churn out people who give such answers. And why would anybody even ask such a braindead question? It's not as if a candidate is going to have trouble adapting to whatever some particular company does for its development process.

Q: what are the advantages of C++ over C?
Me: C++ is an Object Oriented Programming Language while C is a Procedure oriented language
Q: Other than that?
Me: Sorry madam, I don’t know.

You didn't answer the question, you completely fail. You didn't even try …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Why don't you pay for it? Here's an idea: shovel snow for a few hours. Or, if you live in a third world country, shovel mud for a few months.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

If they're separate questions then each question has infinitely many solutions. And it should be pretty obvious, if you know the basics of [s]algebra[/s] obviosity.

iamthwee commented: Just the right amount of help and not too much. +11
Rashakil Fol 978 Super Senior Demiposter Team Colleague

The question isn't really between Java and C#. It's between Java, Scala, C#, F#, and some others. The answer is Scala, which compiles to the JVM.

From a purely Java vs. C# language perspective, you would generally prefer to use C# because it has anonymous functions, using blocks, a reasonable collections library (in System.Linq), and no weird special cases for primitive types. However, Scala exists, and the Scala language is better than the C# language, and you should always use it in place of Java. That's assuming you aren't interested in using the .NET API. If you wanted to write a native Windows application, well, you might want C# then. From a multiprocessing/etc perspective they're both similar, but if you _really_ want to scale up you don't want to have to worry about getting a zillion Windows licenses and such, so the JVM rules there :P

I have never looked at performance information, but the general resonance I get from the Internet is that the JVM is faster and better than the .NET vm.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

<<snip>> Look up the meanings of the terms and then figure out what's different about them.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

If a + b = 23 and a^b = 16, well, you know that a = 23 - b, which means (23 - b) ^ b = 16.

So here's what you should do. Write (23 - b) ^ b - 16 = 0, and then use Newton's method to find the zero of that equation. You know how to differentiate (23 - b) ^ b, right? Haha, that's one of the harder ones. Good luck.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

All countries allow the brutal slaughter of animals, some just don't allow humans to do it, and it has nothing to do with improving the general animal condition and has everything to do with hating on sociopathic humans.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

What operating system?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

This is a completely incomprehensible question that makes no sense and you are probably wanting something very bad and insecure.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I recommend translating this problem.

How many integral solutions exist for y1 + y2 + ... + y100 = 5050, where each yi > -1?

You can see that these map to solutions to your equation by letting xi = yi - (i - 1).

The resulting equation is a simple combinatorial problem, if you look at it the right way.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

In some sense, the problem is impossible. Simply indexing an array takes O(log(n)) time. The reason is that the number of bits needed to describe the index is log_2(n). Of course, processors operate with bitstrings in chunks of 32 or 64 at a time, so we like to pretend that array indices are magic values that can be used in O(1) time. It's sensible, from a machine performance standpoint, to treat them as such.

The thing is that when we uncover problems such as the one we now face, the obvious solutions invariably produce real logarithmic time performance for lookup and setting operations. We could make a side-array of bits that describes whether a given element in the main array is initialized. Of course we'll need a side-side-array of bits to describe which chunks of bits in that side-array are initialized. And so on. This tower of side-arrays invariably has size O(log(n)), and the actual logarithmic constant depends on how many bits we chunk together.

We might decide that our main array is an array of n 32-bit integers. Then we have a side-array with n bits, each bit telling whether a given element of the main array is initialized. Then we have a side-side-array with n/32 bits, each bit telling whether a given block of 32 bits in the side-array has been initialized. (We initialize the whole block in the side-array to zero the first time we try to touch it.) Then we have a side-side-side-array with …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

So count how many instructions it would take to execute.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Just output '1' and then copy the contents of the file but don't include any spaces -- the integer you output will be the concatenation of the integers in the input and can't equal any of them.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I'd like to get a degree in computer graphics (something like physically-based animation and rendering) in a major American university.

My ex-roommate is getting a PhD in this subject. It sounds like you want to get a masters degree. I don't personally know what grad schools are good for computer graphics, and I avoided the grad school game, so I can't help you, other than to give the general statement that you want to look for a university whose cs department has a good computer graphics program. You probably should ask in a computer graphics-specific forum (i.e. not one that is on daniweb.com -- a forum where the entire website is devoted to computer graphics).

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Implement a bunch of old-school pencil and paper ciphers like Vigenere.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I can agree that any book by Strang is good, but I don't think a linear algebra book is the right choice. I say this because I actually had one before going to college -- it was similar in scope to your recommendation, and it didn't serve me very well.

The book I'm dreaming of should be (relatively) easy to understand and provide enough information to give me some idea of what will hit me when I finally head off to Uni.

I'm assuming you're a CS major or something like it. I dual majored in CS and Math.

First of all, you should recognize that you'll be fine. You don't need any preparation for the mathematics you'll use in computer science. The only piece of math that's really really necessary for undergraduate computer science, other than basic algebra, is an understanding of modular arithmetic and an understanding of big O notation, and they're not prerequisites -- you'll be taught about both when you need them.* I still recommend being comfortable with modular arithmetic now, though, because that's just a natural life skill people should have.

I recommend Reading, Writing, and Proving. It's actually designed for math majors, not CS majors, for a sort of "introduction to proofs" class. It's not a book with a bunch of math facts or what not, it's a book about thinking rigorously. I think it's the most relevant boost in mathematical ability that a future computer science student can …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You can use any general purpose language. Good luck.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Think I'll just stick to the complex fantasy worlds and intertwining storylines of most modern video games, than be subjected to 2.7 hours of some hack movie.

Agghhh this is James Cameron's first movie in over a decade, Ebert gave it four stars, some folks old enough to have seen Star Wars are reporting being blown away even moreso than Star Wars, and you're calling it a hack movie without having seen it? I'm surprised -- none of your previous posts have ever reached these extremes of mental illness.

iamthwee commented: Nice recommendation. +0
Rashakil Fol 978 Super Senior Demiposter Team Colleague

I'll catch it on DVD this spring.

No. This is wrong. You have to see it in the theater and you have to see the 3D version.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

So, Avatar is an awesome movie. You need to see it in 3D. It is mandatory.

ahihihi... commented: yeahah +0
maydhyam commented: The plot was pointless...the graphics on the other hand was excellent! +0
Rashakil Fol 978 Super Senior Demiposter Team Colleague

The US Congress has already tried this with stuff like the CDA and COPA and both times got shot down by the Supreme Court.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The first step to understand is that (loop for item in foo collecting bar) will ...

Heck, install SBCL yourself and run the code and do experiments that figure it out.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Sorry, I'm interested in teaching, not in working.