Post on 02-Jul-2015
description
transcript
Thinking in LINQSudipta Mukherjee
About me
twitter.com/samthecoder sudipto80@yahoo.com
codeplex.com/stringdefscodeplex.com/datedefs
SKILLS .INTERESTS. HOBBIES
C;C++; C#; F#; Framework Design; Data Structures; Algorithms; Tools Development; Text Processing; NLP; Machine Learning; Domain Specific Languages; Unit Testing; Expressive Computing; Usability; Refactoring; Web Crawlers; Data Visualization; Data Analysis; Sketching; Paintings; Geometry; Physics; Humor; Technical Writing;
200820122014
Avail 30% Discount! (Code: LINQ14)
Here is how you can get the discount
About this session
LINQ scripts solving real problems
Example from the book
Q & A
LINQPadThe tool used in demo
The best C#/VB/F# snippet editor/compiler ever
Download from http://www.linqpad.net/
Use Dump() method to see anything. You can dump anything
DateTime.Today.Dump();
(new List<int>(){1,2,3}).Dump();
Loop to LINQDitch the loop in favor of parallelization
General strategy for Loop to LINQ
Human Computer InteractionSimulating T9 and Gesture Keyboard (Swype)
Human Computer Interaction
T9 input in Action
Show me code T9 Simulationhttps://gist.github.com/sudipto80/5c887a7df2971c84c196
Swype in action
Some amusing sub-sequences
ORNAMENTAL
Rental
Mental
Oral
Metal
Mental
World is not enough
Wine
Show me code Swype Simulationhttps://gist.github.com/sudipto80/8b9819b37b8bd27448ff
Spell CheckingCloning Peter Norvig’s Spell Checking using List Comprehension in LINQ
Peter Norvig’s spell check
Show me codehttps://gist.github.com/sudipto80/1d96feab131cc03c7cb4
Memoization in ActionFibonacci Series and Friends
Fibonacci Series
Calculate and Cache for faster evaluation
Show me the codehttps://gist.github.com/sudipto80/6194ecce24861d2b3474
Domain Specific Languages (DSLs)Creating a DSL for Mathematicians
Creating Domain Specific Languages
Imperative Style
Embedded DSL
External DSL
Armstrong in Action
Show me the codehttps://gist.github.com/sudipto80/ccb75622b3f83b33b3f1
Please buy the book for explanation.
Meta ProgrammingUsing LINQ and Roslyn
Roslyn
Download CTP from http://www.microsoft.com/en-in/download/details.aspx?id=34685
Show me the codeFor all these you need to create Roslyn Console Application
Finding all methods that don’t use all the parameters
https://gist.github.com/sudipto80/a008f7f992d7a8f01d71
Finding number of lines of code for all functions
https://gist.github.com/sudipto80/824c84bac10a9e1e3780
Finding number of local variables
https://gist.github.com/sudipto80/3c286e7167e99dc6a6bc
Machine LearningIdentifying a flower using k-NN
Iris flowers
Iris – virginica
Iris – versicolor
Iris-setosa
Implementing k-NN in a line!
Can you guess the class of the green circle ?
Show me the codehttps://gist.github.com/sudipto80/994bfb0495b3fcdac344
Iris.csv
Thanks!Questions?
sudipto80@yahoo.com