LINQ practice exercises or puzzles? [closed] - linq

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I'm still trying to learn LINQ, though it's going more smoothly now that I've started to use it daily at work. I still don't feel good at it, though. Does anyone have any challenging practice exercises or puzzles I can use as a code-kata to improve my skills?
I'll leave this as community wiki, so maybe it can grow to a community list.

If you have not discovered http://www.linqpad.net/ it lets you practice linq in a lightweight way, as well as having some inbuilt examples from C# 5.0 in a nutshell and C# in Depth books.

101 Linq Samples is a good one for reference. Not a puzzle though

I know the 1st 2 questions at Project Euler is 'LINQ' friendly, I never did any more, but it should be fun either way :)

Puzzle:
Do a full outer join in LINQ.

I've been finding "foreach's" in existing code and attempting to linq'ify them. Many times things have been different enough for me to learn new concepts or at least if they're similar I get to feel more confident that my Linq skills are getting better.

Related

translate from Mathematica to maxima [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am tryingt o convert a code from Mathematica to Maxima. The code is around 300 lines, I did not write it and the person who did was not good with comments. I was wondering if anyone know of a program that does converting like this?
I tried one from source forge called mixima but I could not get it to run.
Best,
Ben
Converting from Mathematica syntax to Maxima is pretty straightforward. Somewhere out on the Interwebs there is a "Rosetta Stone" of programming languages that might help. (Found this [1] which seems helpful, although I seem to recall something more extensive. Can't find anything else at the moment.)
However, the difficult part is that there might be functions which work differently in one system or the other. In particular, I think Mathematica's function for solving equations is more powerful than Maxima's. So whether or not you can translate the code depends on more than just converting the syntax. My advice is to post the code to the Maxima mailing list (maxima#math.utexas.edu) and ask whether it can be translated.
[1] http://www.axiom-developer.org/axiom-website/rosetta.html

Is it good practice to use LINQ often? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
LINQ is extremely powerful and can be used highly in code. But is it best practice to use it?
It's a good idea to use it when it makes the code clearer and simpler to maintain, and when you're not in any of the situations where the performance of LINQ is too slow for your needs.
You haven't specified whether you're talking about LINQ to Objects or LINQ to SQL etc, but I know there are situations where the latter has proved too slow for some high traffic sites, and they've moved off it... but only after it's been shown to be an issue. LINQ to Objects will often have a very small performance hit compared with "hard-coding" the same logic, but that's even less likely to be a real problem.
Of course LINQ can certainly be overused, and I've seen people reaching for a LINQ solution when there are far more appropriate ways of achieving the same thing - so don't try to use it everywhere you possibly can. Just use it where it clearly helps.
the declarative nature of linq is one of its strongest features. Almost always this makes your code more readable and maintainable, so yes, unless there is a compelling performance reason not to, I'd say that it is best practice.

Analysis of algorithm complexity on linked lists [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Please suggest me some good materials or books or links that provede the methods to find the complexity of algorithms that use linked list for their implementation. My question may sound silly to some of you but please reply.Please help
Introduction to Algorithms is the canonical textbook.
It is possible to find a complete PDF of this book online. I'm not going to provide a link, though, because I'm not sure if these copies are legal.
If all you're after is a quick reference, then Wikipedia is the best place to start. For instance, see the table at http://en.wikipedia.org/wiki/Linked_list#Tradeoffs.
Gautam I have a feeling that you are trying to skip the understanding of 'complexity analysis' portion and jump to linked-list-complexity-analysis.
Just so you know, if you want to understand it truly, then you have to understand two parts
1. How to compute complexity of an algorithm
2. The flow of algorithm in question.
'linked-list-complexity-analysis ' is not something that you can understand without understanding {1}
That said, if at all you want ready answer (trust me that wouldnt help you in interviews), you can refer to this book "Data structures and algorithm and applications in C++" (http://www.mhhe.com/engcs/compsci/sahni/)
Highly recommended for beginner.
Immensely boring, and I doubt you will read it again. :P
You will find answers to your specific questions there.
After you are done with that book , I would suggest go with DataStructures using C/C++ by Langsam/tennenbaum.

Cool, visually-transmissible uses of Prolog [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I will be teaching only one lecture on basic Prolog to students with little to no experience in programming. I'd like them to see that programming and Prolog can be used in the real world, perhaps even to do cool things.
I have looked at this and this threads, but I cannot find anything that is visually appealing that I can show them when we wrap up the lecture.
Do you have any suggestions for cool applications that use Prolog? I'm especially looking for something that can be shown as a video or slideshow.
If what you want is to highlight the uses of prolog and use audio-visual media merely for presentation purposes, combining the following 2 links might do it:
Natural language processing with prolog in the IBM Watson system
IBM's Watson supercomputer destroys all humans in Jeopardy
Dynalearn is implemented in Prolog and has animations.
See:
http://personnel.univ-reunion.fr/fred/Enseignement/Prolog/index.html
under "La librairie clpfd", there are links to 3 finite domain constraint animations (N-Queens, Sudoku, Knight Tour) that are used in this class.
InFlow is written in Prolog. You may browse through the examples and / or contact the author for details. VisiRule might also help.
Disclaimer: I have not used either InFlow or VisiRule, but I do use WIN-Prolog which is the environment used for both programs.
+1 for Visirule. It is, as far as I can tell (and I've researched this topic quite a lot) a unique visual programming tool (I don't know of any other visual tool that is easily reduced to a turing-complete language). I have implemented a trouble-shooting website with it along with various other solutions. Highly recommended- version 5 coming out soon too.

What's the fastest way to brush up on algorithms for a technical interview (on Monday)? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I have a technical interview on Monday and they were kind enough to give me a heads-up to brush up on my basic algorithms. It's been years since I looked at that kind of stuff and I'm pretty weak on it to begin with so I generally have a bad feeling about this. What's the best way to review the basics and get some practice in before Monday?
Starting Project Euler might help you, also try picking up Algorithms in a Nutshell and working through those examples. Should be do-able in a weekend.
TopCoder Algorithm Tutorials
Get the Algorithm Design Manual and look at the reference section. It has a nice "Problem -> Algorithm" cheat sheet.
Also take a look at questions on StackOverflow that are tagged Algorithm.
They might actually turn up in the interview ;)
Best of Luck!
This SO Question would be helpful. Also, mostly you should know about
* Sorting
* Searching
* Inserting and removing from various data structures
As this are the main algorithms which are normally asked in the interviews.
*Note: This is from my personal experience and it may differ from person to person.
http://en.wikipedia.org/wiki/List_of_algorithms
Especially the Search, Item Search and Sorting sections.

Resources