Rashakil Fol 978 Super Senior Demiposter Team Colleague

Huh? MSBuild, NAnt, ....

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Regarding question #2: Programming is one of the easiest professions to get into without a formal degree in anything. You have a bachelor's in chemistry, and job descriptions tend to ask for "a bachelor's in computer science or some related degree." So if you're like "I have a bachelor's in chemistry and here's the proof that I don't suck at coding," and if you supply proof, well, you're hired. One of my coworkers has a bachelor's in chemistry.

Now, that's if you want to become a software developer. If you want to become some kind of... IT person... why in the world would you want to do that.

Regarding question #1: The FAQ is as valid as it was four years ago, but that doesn't mean it was a very good FAQ in the first place. It's not harmful.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I like the sound of that, but I'm afraid it's way beyond my level. Mind explaining what it does? :)

It uses the function System.Linq.Enumerable.Where, which takes an IEnumerable<T> and a function of type Func<T, Bool> and returns an IEnumerable<T> that contains all the values for which the function returns true.

Since it's an extension method, you can write path.Split('\\').Where(s => s.Length > 0) , which is equivalent to Enumerable.Where(path.Split('\\'), s => s.Length > 0) . The expression s => s.Length > 0 here is a function that takes a string and returns a boolean.

You could implement it like this

public static class Enumerable {
// pardon my indentation
public static IEnumerable<T> Where<T>(this IEnumerable<T> source, Func<T, Bool> predicate)
{
    foreach (T element in source)
    {
        if (predicate(element))
        {
            yield return element;
        }
    }
}

}

And calling that function doesn't evaluate the interior -- it returns an IEnumerable<T> such that when you enumerate it, the interior is evaluated step by step.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Thanks.. but can you be more clear by giving an example of what to make.

Make a poop simulator.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Whoops, I meant path.Split(new[] { '\\' }, StringSplitOptions.RemoveEmptyEntries) .

And if you wanted to filter the empty entries manually, you'd probably do path.Split('\\').Where(s => s.Length > 0).ToArray()

Rashakil Fol 978 Super Senior Demiposter Team Colleague

All the fields of a class are allocated in the same place, right next to one another. That means variables whose type is some value type are allocated in the same place as variables whose type is some reference type. Of course, the amount of space needed per variable might be different.

(Edit: I'm saying that the int "_customerID" will get allocated right next to the string reference "_SSN". _SSN is a reference that points to a string allocated elsewhere.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Does any one have ideas of creating useful 'softwares'
in C

Make a GUI application using GTK+ 2.

Can you give me any guide - how to improve my coding skill as soon as possible?

Use your coding skill to make stuff.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Just use path.Split('\\', StringSplitOptions.RemoveEmptyEntries) .

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Honestly Java's obsolete; you should just use Scala or Clojure.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You need using System.Linq; at the top of your file.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Er, actually not in theory. The current query seemed to work but maybe it was coincidence. I wanted to sort the Y values (descending) for each group of X values, then choose the first X,Y value (therefore the furthest down on the screen) to feed to another method. Perhaps I'm still confused about the IEnumerables that emerge from the LINQ query and how to access them properly.

Except when doing joins, I prefer to avoid the LINQ syntax and just use the Enumerable extension methods directly. It makes the behavior more clear, sometimes.

If you want things grouped by X and then each individual group sorted, you should do this:

var groups = invaders
    .GroupBy(invader => invader.Location.X)
    .Select(group => group.OrderByDescending(invader => invader.Location.Y));

If invaders looks like this: [(1,2), (1, 3), (1,1), (3, 5), (2, 4), (3, 4)] , then groups should look like this: [[(1, 3), (1, 2), (1, 1)], [(3, 5), (3, 4)], [(2, 4)]] (but you might want to double check that I'm right).

If you want LINQ syntax for that, you'd write

var groups = from invader in invaders
             group invader by invader.Location.X into g
             select g.OrderByDescending(invader => invader.Location.Y)

but I don't have a C# compiler on this computer so maybe I forgot something. This is equivalent:

var groups = from invader in invaders
             group invader by invader.Location.X into g
             select (from invader in g orderby invader.Location.Y descending select invader);
Rashakil Fol 978 Super Senior Demiposter Team Colleague

It should work for List<Microsoft.Xna.Framework.Rectangle> , which implements IEquatable<Microsoft.Xna.Framework.Rectangle> . Maybe you're expecting the code to modify the original list object. It doesn't do this; it instead creates a copy that lacks duplicates.

Rashakil Fol 978 Super Senior Demiposter Team Colleague
var Column = from all in invaders group all by all.Location.X into grpResult orderby grpResult.ElementAt(0).Location.Y descending select grpResult;

foreach (var v in Column)
Console.WriteLine(v.ElementAt(v.Count()-1).Location.ToString());

You can and should use v.Last() instead of v.ElementAt(v.Count()-1) . Using v.Last() also only iterates through the collection once, which is sometimes something to be aware of (and sometimes a needless microoptimization) and anyway it's less code.

Edit: And I think you have it all wrong. Your code groups by the X value and sorts the collection of groups by the groups' first Y values. That's what you want?

jonsca commented: Some long overdue rep +1
Rashakil Fol 978 Super Senior Demiposter Team Colleague

ATS

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Do you want to be a programmer or do you want to be a computer janitor? If you want to be a code janitor, go for CS. If you want to be a computer janitor, go for IT.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Oops, before anybody says anything, yes I'm aware that trumpet and saxophone aren't woodwind they're brass!

What are you talking about? The saxophone is a woodwind.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The piano.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

If you want to become a programmer, you have to know how to code. Nothing else really matters, as long as you can talk to people like a normal human being and can get to work before 1:00 PM. You're going to be a complete noob, coming out of college, no matter whether you're a "software engineering" major or a "computer science" major, and you'll learn more about the "communications and managing of the project" stuff in the first year on the job than you will in any kind of school environment software engineering program. So you should regard any university education in that department as useless. Usually, the university education in the practices of software development is out of date or just flat-out wrong.

Computer engineering is sort of halfway between computer science and electrical engineering, I don't really know anything about it in particular.

Ultimately the real answer on what the terms mean depends on the particular university's curriculum, and on nothing else.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Blah blah blah, why don't you answer the question instead of linking to some reference site.

linkpraveen: if you use a List<Invoice>, for example, it's impossible to have anything in that list which is not an invoice. If you just used an ArrayList, you would increase the probability of making a mistake and putting something of the wrong type in. Generics also let you make guarantees that somebody's passing something sensible into your function. For example, consider the function

T MaxBy<T>(List<T> values, Comparer<T> comparer);

This function can guarantee that you've supplied a comparer intend to operate on things of type T. Without generics, you'd have to write something like

object MaxBy(ArrayList list, Comparer comparer);

where a Comparer is a delegate that takes two objects as arguments. You might accidentally use a wrong delegate or change the type of the elements stored in a list you're using somewhere, and the compiler would never warn you about the error. You'd have to compensate for the lack of generics by writing more careful unit tests. Also, you'd have to double-check the documentation of more APIs.

So there is the general question asking what are the most common practical uses of generics. The most common is the simple use of generic collections, like List<T>, HashSet<T>, Dictionary<TKey, TValue>, T[] (which formally speaking in .NETenese isn't a generic collection), IEnumerable<T>, and so forth. The second most common use I see is the use of generic function types. I.e. Func<T>, Func<A, T>, Action<T>, …

sknake commented: great answer +14
Rashakil Fol 978 Super Senior Demiposter Team Colleague

You have two separate formulas for T(n). If you want to see if they're equivalent, you could plug in 3 into both of the formulas and see if the results are the same. If they're different, then you made a mistake. If they're the same, it doesn't prove you did things correctly, because you could have gotten lucky. But if you try plugging in a few different values and get the same results, that should give you confidence of your correctness.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Though a majority of the developers out there regard HTML as a programming language,

What????? Maybe in bizarro world.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

It should be easy to plug a few numbers in and see for yourself.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

One way is to use the master theorem, I think.

I prefer to think about these in terms of "layers." At the top layer of the problem, we spend an n*log(n) cost in order to move down one layer. At the layer underneath, we have two sub-problems and for each of them, we pay an (n/2)*log(n/2) cost to move down one more layer. And so on until the bottom.

That means our total cost at each layer is going to be

1 * n * lg(n)
2 * (n/2) * lg(n/2)
4 * (n/4) * lg(n/4)
8 * (n/8) * lg(n/8)
...
n * 1

We want to add up these costs, but first we can simplify.

n * lg(n)
n * lg(n/2)
n * lg(n/4)
n * lg(n/8)
...
n * 1

There are two questions to ask. One is: how many layers are there? The answer is lg(n) layers, rounded to an integer -- it's a typical divide 'n conquer situation. The other is: what's the total cost?

Well, we can add it up:

n * lg(n) + n * lg(n/2) + n * lg(n/4) + ... + n * lg(n/2^lg(n))
=
n * [lg(n) + lg(n/2) + lg(n/4) + ... + lg(n/2^lg(n))]
=
n * [lg(n) + lg(n)-1 + lg(n)-2 + ... + 0]

So we can see it's n multiplied by a sum …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Just like how before the decimal point, values count for .., 8, 4, 2, 1, to the right of the decimal point, values count for 1/2, 1/4, 1/8, ...

You just keep dividing by two, each digit over.

So 0.011 equals 1/4 + 1/8.

And 0.101 equals 1/2 + 1/8.

And 0.0101010101010101... equals 1/4 + 1/16 + 1/64 + 1/256 + ... which equals 1/3.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You haven't shared your own.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Fail it, and well you can guess the rest.

Fail it and you're on the road to having nothing to do with your life other than moaning at people on Daniweb about their futures?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Aren't web languages also programming languages or do you disagree?

HTML is not a programming language and neither is AJAX or CSS.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

How many steps does it take for i*2^k to be greater than n?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

.NET is not a programming language. I'm not quite sure just what it is but its part of MS-Windows os. Maybe you mean c++/CLR??

Probably meant C# or VB.NET or C++/CLI (or F# or Boo or ...)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

html

I thought we were talking about programming languages.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

HALT is in RE and this language is not

What is HALT?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

i've managed to get this code but not sure how to get the third to turn out a #t instead of a #f. i've only gotten it down to this, pretty basic but a start

(define nonlat?
(lambda (list)
(null? list)))

Not much of a start.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Actually, merge sort takes O(n*(log n)^2) time.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Haskell, C#

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You could use the unsolvability of the halting problem.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

And let's not forget about alignment issues, recursive functions, data structures, and anything whose size depends on user input.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Instead of keeping variables first_address , second_address , and third_address , and so on, make an array of addresses and walk through the array until one succeeds or until they all have failed.

serkan sendur commented: welcome +7
Rashakil Fol 978 Super Senior Demiposter Team Colleague

1. Offshore Outsourcing.

Racist. Antiquated retard.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Naked sex porn teens

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Once peer to peer social networking gets off the ground, things will be back to being free again.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

How can anybody rate this an "excellent" article? This is linkbaiting trash.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Nobody cares about your car.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I don't see any reason to desire standardization of Linux. I standardize on Debian.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Could you define the term "linux job"?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

so posting your gender is indeed against the rules

Rashakil Fol 978 Super Senior Demiposter Team Colleague

> This is what we call a call to action, an opportunity.

No it's not. The situation is simply that somebody who finds their job boring isn't going to do as good a job as somebody who doesn't.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

2000 is a perfectly reasonable number of bugs.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

stock stock stock stock stock stock up down stock up up down down down bear bull stock stock

stock stock stock sony stock up bear stock analyst futures income index stock price

verbiage verbiage verbiage verbiage verbiage verbiage

Rashakil Fol 978 Super Senior Demiposter Team Colleague

This is beautiful.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You just love the sound of your own words.