thoughtcoder 167 Junior Poster

Top-posting?

thoughtcoder 167 Junior Poster

Agh why is there priority queue code mixed in? Kill me now.

thoughtcoder 167 Junior Poster

Why is your message in code tags?

thoughtcoder 167 Junior Poster

You're just going to give the code? What?

thoughtcoder 167 Junior Poster

You people have no sense of humor.

thoughtcoder 167 Junior Poster

Its indentation is obfuscious and the naming scheme is mendacious.

No, it's not right.

thoughtcoder 167 Junior Poster

There's nothing wrong with that.

carobee, write a simulator for Conway's Game of Life. And then make it run faster.

thoughtcoder 167 Junior Poster

It is obviously Matlab code.

thoughtcoder 167 Junior Poster

Why is your prefix notation and preorder traversal any different?

thoughtcoder 167 Junior Poster

No, you aren't.

thoughtcoder 167 Junior Poster

Your problem is a case of http://en.wikipedia.org/wiki/Bayes'_theorem#Bayes.27_theorem_for_probability_densities

That might be an oversimplification.

thoughtcoder 167 Junior Poster

They got that one right, didn't they!?

No.

thoughtcoder 167 Junior Poster

Well any way you use to ensure that there's no more than 1 instance created for a class will be called a 'singleton', so by definition no.

thoughtcoder 167 Junior Poster

The language versions are called C# 2 and C# 3. It's perfectly fine to start with C# 2.

thoughtcoder 167 Junior Poster

The paragraph is a bit nonsensical, where it suggests using a singleton factory as a workaround to using a singleton.

Yes, the solution is to make a single instance and pass it around. You can use the private and friend features of C++ to prevent people from creating second copies.

thoughtcoder 167 Junior Poster

-- if n is greater than 1, count how many times the expression is performed. - Not working at all

co is being incremented just fine.

thoughtcoder 167 Junior Poster

Don't get an A+ certification unless you're going to use it somehow between the time you get it and the time you get your bachelors in computer science.

It is supposedly trivially easy to get, so don't spend any money on a course.

thoughtcoder 167 Junior Poster

If you attach a debugger, does it show the line m_IPAddressLbl.Text = "HELLO WORLD"; running?

thoughtcoder 167 Junior Poster

How are you calling this functions?

thoughtcoder 167 Junior Poster

you normally would use this singleton method for a configuration accessor class

Hah! If only you knew the Hell I went through thanks to people thinking that.

or a group of data that needs to be shared throught the app without passing a class object around

This situation (the operative word being "needs") never exists.

If you ask me, the best use of singletons is to protect yourself from "junior" programmers who are liable to want to open up a fresh db connection in some inner function.

thoughtcoder 167 Junior Poster

The same way you normally stop scanning bar codes?

thoughtcoder 167 Junior Poster

Let's learn some ways to write code more efficiently. If your code is hastily edited and cut for the sake of an example or you can't use things you've never learned and such, you don't need to reply back explaining yourself.
...

const string file = "File.TXT";

            // don't declare variables and assign them with values,
            // only to overwrite those values later.  How can you
            // stand it?
            string first = cBoxFirst.Text;
            string last = cBoxSecond.Text;

            // your stream reading code looked good, but note
            // you have this function available:
            string[] array = File.ReadAllLines(file);

            // note that you could have used
            // string[] array = nList.ToArray();
            // in your previous code.

            // you probably would want to sort your array here...

            int fIndex = Array.BinarySearch(array, first);
            int lIndex = Array.BinarySearch(array, last);

Also, make sure you read the documentation (http://msdn.microsoft.com/en-us/library/y15ef976.aspx) and see where negative numbers might be returned -- like when the string is not found.

thoughtcoder 167 Junior Poster

Is your array sorted? Binary search only works when the array is sorted. The contents of "File.TXT" would have to be sorted for it to work.

thoughtcoder 167 Junior Poster

If you're a horrible programmer looking for a horrible programming job, then a certification might impress somebody, somewhere. But any reasonable employer will not count them in your favor. They will only be counted against you. You should have things that actually boost your resume like projects you've worked on for fun, that show how smart you are. A resume that says "I actually did stuff" means a lot more than one that says "I passed some exam and present this as evidence."

thoughtcoder 167 Junior Poster

Well some people have better things to do than explain why their product can only be configured to use powers of two.

thoughtcoder 167 Junior Poster

For algorithms that directly require modular arithmetic, such as some encryption algorithms.

For writing log messages every Nth time through a loop.

The "do something every Nth time through a loop" problem is probably where you'll see the modulus operator used most often.

thoughtcoder 167 Junior Poster

I did that once, and I liked it!

thoughtcoder 167 Junior Poster

Yes. You can still use them. They're not formally obsolete -- they aren't going away.

But it's better to use List<double> because that gives you better type safety and makes your code easier for others to read.

thoughtcoder 167 Junior Poster

Computer Science books:
Numerical Methods for Scientists and Engineers (Hamming),
Approximation Algorithms (Vazirani),
Types and Programming Languages (Pierce),
Advanced Types and Programming Languages (Pierce),
Computer Systems: A Programmer's Persective,
Computational Science & Engineering (Strang),
Data Structures and Algorithms in C++ (Goodrich, ...),
Modern Operating Systems (Tanenbaum),
Purely Functional Datastructures (Okasaki),
Intro to the Theory of Computation (Sipser),
Programming Language Pragmatics (Scott)

I think that's it. There are some practical programming books too... do you want a list of those?

thoughtcoder 167 Junior Poster

Java? What? Are you going into software development or IT?

thoughtcoder 167 Junior Poster

His problem is just that he needs to think more about the problem, maybe with some sleep in between.

thoughtcoder 167 Junior Poster

ArrayList is in the System.Collections namespace and List<> is in the System.Collections.Generic namespace. Use List<double> instead of an ArrayList, and use System.Collections.Generic instead of System.Collections. There's no reason to use obsolete collection types here.

thoughtcoder 167 Junior Poster

But I am not being a bully. I genuinely believe one should have no respect for people's "opinions" and their need to share them.

thoughtcoder 167 Junior Poster

Not much, the usual intelligence level it seems, maybe you should join multiple forums; maybe a socket question will come up in one of them. Do some RSSing and scraping and you can have a nice socket-related feed.

thoughtcoder 167 Junior Poster

If you could get a certifiably awesome certification, that would be nice. If you're getting a degree, why do you need a certification? I do not understand the IT world.

thoughtcoder 167 Junior Poster

Yeah! What if they just post stupid crap that they think makes them sound sorta intellectual? Or posting pedantic crap that worries about 'pure conjecture' - get a life.

Wow, being a bully. How's that working out for you?

thoughtcoder 167 Junior Poster

Okay, serious answer: just show up for the interview dressed to kill: http://www.zazzle.com/janitor_computer_janitor_tshirt-235616259722072332

thoughtcoder 167 Junior Poster

Wouldn't this advice depend on your location? Reveal that information to us. I'm guessing by your hair color and sun-exposure level that you're Canadian or Alaskan.

Edit: on the other hand, the lipstick makes me think you must be some kind of english dandy.

jbennet commented: thats not very nice -7
ahihihi... commented: ek-ek.. :) +1
jephthah commented: if you're going to be a jerk, at least have a reason +6
thoughtcoder 167 Junior Poster

I hereby accuse you of being a person I've never met.

thoughtcoder 167 Junior Poster

You people are so sexually repressed. There's nothing so cathartic as seeing a well-animated tentacle monster trapping a 12-year-old virgin in a library and challenging her to a Boggle contest, where the winner gets tickets to the next Jonas Brothers concert.

Nick Evan commented: Haha :) +15
~s.o.s~ commented: Wha..? I thought the monster intended to film his next fairness cream ad! ;-) +27
ddanbe commented: He seems I love the Jonas Brothers as much as you do. +4
thoughtcoder 167 Junior Poster

No one should be here to throw dirt on anyone elses beliefs, regardless of what they are.

But what if they're stupid? Why shouldn't we throw dirt at stupid beliefs? Like the belief that one should just make pronouncements and feel proud at the fact.

It's pure conjecture.

No, there is past exposure to information influencing people's opinions. Nothing is pure conjecture.

thoughtcoder 167 Junior Poster

So the question is: How to detect when last character found? You surely know how to do that? Well then, finding the recursive function that outputs them in reverse order is a simple matter of mentally stimulating exploration! Good luck!

thoughtcoder 167 Junior Poster

This is not a C++ question? This certainly isn't a compiler question...

thoughtcoder 167 Junior Poster

I would post my "marks", but they are all links to movies involving large groups of black men fornicating with one white female midget, and serious geeks like you wouldn't be interested.

thoughtcoder 167 Junior Poster

Your ideas are stupid. They would be too expensive. You value your ideas too highly.

thoughtcoder 167 Junior Poster

I was known as the person most likely to become a serial killer.

thoughtcoder 167 Junior Poster

Wow, the folks here really love replying to a dead thread.

Edit: me too.

thoughtcoder 167 Junior Poster

And why are you asking a question like this in the wrong thread.

thoughtcoder 167 Junior Poster

Well... when do you want it to terminate?

thoughtcoder 167 Junior Poster

What? Why would I censor myself in afraid of being banned?