SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Super Spike

Yep. It’s Super
Who am I?

            Who I am?
Indoctrination
                 Reduction in fear

 Super awesome MongoDB non-relational database tips
An introduction on how to use the MongoDB C# Driver


    Super awesome F# functional programming tips
      How to integrate F# into your apps today
      Looks at some functional techniques




     BONUS: (I hope) some inspiration
1. Analyze transactional data


                  2. Create models for setting prices


3. Work with sales team to raise prices


                         4. Measure results
Narrow




         Deep
• Mongo
  – Unstructured data
  – Flexible query language…using JavaScript!
  – Feels…”light”
• F#
  – Reasoning
       • Less code
       • No side effects
  – Productivity
       • fsi
       • Focus on what, not where
• Data Access
  – Mostly read-only
  – Data processing heavy
  – Non-standard formats from client to client
• Data Processing
  – Calculate metrics on different slices of data
  – Different formulas for various metrics
View (razor)


            Controller (C#)


Model
         Data Processing (F#)
 (C#)


           Data Access (F#)




         MongoDB
• Current Situation
  – Unknown schema
  – Complex transformation scripts
  – Complex loading scripts
static member Initialize() =
    BsonClassMap.RegisterClassMap<Customer>(fun cm ->
      cm.AutoMap()
      cm.SetIdMember(cm.GetMemberMap("Number"))
    ) |> ignore

   BsonClassMap.RegisterClassMap<Product>(fun cm ->
     cm.AutoMap()
     cm.SetIdMember(cm.GetMemberMap("SKU"))
   ) |> ignore
private static void ImportFromFile<T>(
        string filename, Dictionary<string, int> fieldMappings)
where T: CoreObject {
    var datafile = DataFile.FindOneById(filename);
    var record = datafile.ReadLine();
    while (record != null) {
        var o = Activator.CreateInstance<T>();
        o.Load(record, fieldMappings);
        o.Save();

        record = datafile.ReadLine();
    }
}
{
    "_id": "1234567",
    "_t": "Customer",
    "Attributes": {
              "Parent": "Mike's Chocolates",
              "Salesman": "Willy Wonka",
              "Industry": "Candy"
    },
    "Name": "Choc a lot"
}

                            • Invoice
                                • Date
                                • Quantity
                                • Amount
                                • Customer
                                • Product
• Current Situation
  – Hard to find
  – Hard to test
  – Calculations are often performed “on top of”
    other calculations
  – Technical team needs to explain how formulas
    work
let GetCollection<'T>() =
  (new MongoRepository())
    .GetDatabase()
    .GetCollection<'T> typeof<'T>.Name

let Invoices = GetCollection<Invoice>

let GetInvoices (fromDate:DateTime) (toDate:DateTime) includeFields =
  let query = Query
               .GTE("Date", BsonDateTime.Create(fromDate))
               .LTE(BsonDateTime.Create(toDate))
  let fields = Fields.Exclude("_id").Include(includeFields)
  Invoices().Find(query).SetFields(fields) :> seq<Invoice>
static member GetRevenueByYear (fromDate:DateTime) (toDate:DateTime) =
   GetInvoices fromDate toDate [|"Date"; "Amount"|]
     |> Seq.groupBy (fun i -> i.Date.Year)
     |> Seq.map (fun (year, invoices) -> (year, (sumRevenue invoices)))
     |> Seq.sortBy (fun (year, _) -> year)




   let sumRevenue (invoices:seq<Invoice>) =
     invoices |> Seq.sumBy (fun i -> i.Amount)
let IndexByCustomer fromDate toDate operation attribute =
    Index “Customer”
        (fun i -> i.Customer.Attributes.[attribute])
       fromDate toDate
       operation

let IndexByProduct fromDate toDate operation attribute =
    Index “Product”
       (fun i -> i.Product.Attributes.[attribute])
       fromDate toDate
       operation



  let Index type groupF fromDate toDate indexF

  string -> (Invoice -> string) -> DateTime -> DateTime -> (seq<Invoice> -> float) ->
     seq<string * float * float>
string -> (Invoice -> string) -> DateTime -> DateTime -> (seq<Invoice> -> float) ->
   seq<string * float * float>

let IndexCustomers attribute =
  Index "Customer" (fun (i:Invoice) -> i.Customer.Attributes.[attribute])

let IndexProducts attribute =
  Index "Product" (fun (i:Invoice) -> i.Product.Attributes.[attribute])


string -> (DateTime -> DateTime -> (seq<Invoice> -> float) ->
  seq<string * float * float>)



let IndexByCustomer fromDate toDate operation attribute =
    IndexCustomers attribute fromDate toDate operation

let IndexByProduct fromDate toDate operation attribute =
    IndexProducts attribute fromDate toDate operation
type Entity =
| Customer
| Product


let IndexEntity t attribute fromDate toDate indexOp =
  let f =
    match t with
      | Customer -> IndexCustomers
      | Product -> IndexProducts

 f attribute fromDate toDate indexOp
OPERATIONAL            DEVELOPMENT            USER PERCEIVED
From days to minutes   Reasoning about code   “OK”
                       Closer to the data
mongodb.org

https://github.com/mongodb/mongo-csharp-driver




http://www.tryfsharp.org

FsUnit (via NuGet)




http://www.jqplot.com/
www: michaelfalanga.com

E-mail: me@michaelfalanga.com

Twitter: @mfalanga

Weitere ähnliche Inhalte

Andere mochten auch

نشاط هرمي
نشاط هرمينشاط هرمي
نشاط هرميguest9b857e
 
第78回 ネスレジャパン 稼ぐ仕組み 高岡浩三
第78回 ネスレジャパン 稼ぐ仕組み 高岡浩三第78回 ネスレジャパン 稼ぐ仕組み 高岡浩三
第78回 ネスレジャパン 稼ぐ仕組み 高岡浩三Mitsuhiro Shimada
 
第75回 スポーツマーケティング③スポーツマーケティングの構造&amp;テレビとスポーツ
第75回 スポーツマーケティング③スポーツマーケティングの構造&amp;テレビとスポーツ第75回 スポーツマーケティング③スポーツマーケティングの構造&amp;テレビとスポーツ
第75回 スポーツマーケティング③スポーツマーケティングの構造&amp;テレビとスポーツMitsuhiro Shimada
 
Don't Do Agile, Be Agile
Don't Do Agile, Be AgileDon't Do Agile, Be Agile
Don't Do Agile, Be AgileMichael Falanga
 
第72回 レッドブル翼をさずける② 完結編 単なるスポーツマーケティングではない
第72回 レッドブル翼をさずける② 完結編 単なるスポーツマーケティングではない第72回 レッドブル翼をさずける② 完結編 単なるスポーツマーケティングではない
第72回 レッドブル翼をさずける② 完結編 単なるスポーツマーケティングではないMitsuhiro Shimada
 
Move the groves_into_jazz_danc
Move the groves_into_jazz_dancMove the groves_into_jazz_danc
Move the groves_into_jazz_dancsamantha25
 
Reasonable Code With Fsharp
Reasonable Code With FsharpReasonable Code With Fsharp
Reasonable Code With FsharpMichael Falanga
 
نشاط هرمي
نشاط هرمينشاط هرمي
نشاط هرميguest9b857e
 
第62回 イノベーションのジレンマ②「市場調査やアンケート調査 」vs「行動観察」
第62回 イノベーションのジレンマ②「市場調査やアンケート調査 」vs「行動観察」第62回 イノベーションのジレンマ②「市場調査やアンケート調査 」vs「行動観察」
第62回 イノベーションのジレンマ②「市場調査やアンケート調査 」vs「行動観察」Mitsuhiro Shimada
 
Yellowstone national park
Yellowstone national parkYellowstone national park
Yellowstone national parksamantha25
 
نشاط هرمي
نشاط هرمينشاط هرمي
نشاط هرميguest9b857e
 
第61回 ブルーオーシャン戦略② イノベーションのジレンマ 
第61回  ブルーオーシャン戦略② イノベーションのジレンマ 第61回  ブルーオーシャン戦略② イノベーションのジレンマ 
第61回 ブルーオーシャン戦略② イノベーションのジレンマ Mitsuhiro Shimada
 

Andere mochten auch (19)

نشاط هرمي
نشاط هرمينشاط هرمي
نشاط هرمي
 
第78回 ネスレジャパン 稼ぐ仕組み 高岡浩三
第78回 ネスレジャパン 稼ぐ仕組み 高岡浩三第78回 ネスレジャパン 稼ぐ仕組み 高岡浩三
第78回 ネスレジャパン 稼ぐ仕組み 高岡浩三
 
第75回 スポーツマーケティング③スポーツマーケティングの構造&amp;テレビとスポーツ
第75回 スポーツマーケティング③スポーツマーケティングの構造&amp;テレビとスポーツ第75回 スポーツマーケティング③スポーツマーケティングの構造&amp;テレビとスポーツ
第75回 スポーツマーケティング③スポーツマーケティングの構造&amp;テレビとスポーツ
 
Don't Do Agile, Be Agile
Don't Do Agile, Be AgileDon't Do Agile, Be Agile
Don't Do Agile, Be Agile
 
T
TT
T
 
PLM Leveraging 3D Imaging
PLM Leveraging 3D ImagingPLM Leveraging 3D Imaging
PLM Leveraging 3D Imaging
 
Jocsflorals
JocsfloralsJocsflorals
Jocsflorals
 
Book1
Book1Book1
Book1
 
第72回 レッドブル翼をさずける② 完結編 単なるスポーツマーケティングではない
第72回 レッドブル翼をさずける② 完結編 単なるスポーツマーケティングではない第72回 レッドブル翼をさずける② 完結編 単なるスポーツマーケティングではない
第72回 レッドブル翼をさずける② 完結編 単なるスポーツマーケティングではない
 
Software as a Service
Software as a ServiceSoftware as a Service
Software as a Service
 
Move the groves_into_jazz_danc
Move the groves_into_jazz_dancMove the groves_into_jazz_danc
Move the groves_into_jazz_danc
 
Reasonable Code With Fsharp
Reasonable Code With FsharpReasonable Code With Fsharp
Reasonable Code With Fsharp
 
نشاط هرمي
نشاط هرمينشاط هرمي
نشاط هرمي
 
第62回 イノベーションのジレンマ②「市場調査やアンケート調査 」vs「行動観察」
第62回 イノベーションのジレンマ②「市場調査やアンケート調査 」vs「行動観察」第62回 イノベーションのジレンマ②「市場調査やアンケート調査 」vs「行動観察」
第62回 イノベーションのジレンマ②「市場調査やアンケート調査 」vs「行動観察」
 
Yellowstone national park
Yellowstone national parkYellowstone national park
Yellowstone national park
 
نشاط هرمي
نشاط هرمينشاط هرمي
نشاط هرمي
 
Mar argentino (1)
Mar argentino (1)Mar argentino (1)
Mar argentino (1)
 
第61回 ブルーオーシャン戦略② イノベーションのジレンマ 
第61回  ブルーオーシャン戦略② イノベーションのジレンマ 第61回  ブルーオーシャン戦略② イノベーションのジレンマ 
第61回 ブルーオーシャン戦略② イノベーションのジレンマ 
 
Destilación
DestilaciónDestilación
Destilación
 

Ähnlich wie Super spike

Patterns of Enterprise Application Architecture (by example)
Patterns of Enterprise Application Architecture (by example)Patterns of Enterprise Application Architecture (by example)
Patterns of Enterprise Application Architecture (by example)Paulo Gandra de Sousa
 
SH 1 - SES 8 - Stitch_Overview_TLV.pptx
SH 1 - SES 8 - Stitch_Overview_TLV.pptxSH 1 - SES 8 - Stitch_Overview_TLV.pptx
SH 1 - SES 8 - Stitch_Overview_TLV.pptxMongoDB
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.GeeksLab Odessa
 
Simplify Feature Engineering in Your Data Warehouse
Simplify Feature Engineering in Your Data WarehouseSimplify Feature Engineering in Your Data Warehouse
Simplify Feature Engineering in Your Data WarehouseFeatureByte
 
[WSO2Con Asia 2018] Patterns for Building Streaming Apps
[WSO2Con Asia 2018] Patterns for Building Streaming Apps[WSO2Con Asia 2018] Patterns for Building Streaming Apps
[WSO2Con Asia 2018] Patterns for Building Streaming AppsWSO2
 
Kevin Bengtson Portfolio
Kevin Bengtson PortfolioKevin Bengtson Portfolio
Kevin Bengtson PortfolioKbengt521
 
Geek Sync | Rewriting Bad SQL Code 101
Geek Sync | Rewriting Bad SQL Code 101Geek Sync | Rewriting Bad SQL Code 101
Geek Sync | Rewriting Bad SQL Code 101IDERA Software
 
Introduction to MongoDB at IGDTUW
Introduction to MongoDB at IGDTUWIntroduction to MongoDB at IGDTUW
Introduction to MongoDB at IGDTUWAnkur Raina
 
Business Dashboards using Bonobo ETL, Grafana and Apache Airflow
Business Dashboards using Bonobo ETL, Grafana and Apache AirflowBusiness Dashboards using Bonobo ETL, Grafana and Apache Airflow
Business Dashboards using Bonobo ETL, Grafana and Apache AirflowRomain Dorgueil
 
DataSaturday #1 - PBI Modeling At Warp Speed With Tabular Editor Advanced Scr...
DataSaturday #1 - PBI Modeling At Warp Speed With Tabular Editor Advanced Scr...DataSaturday #1 - PBI Modeling At Warp Speed With Tabular Editor Advanced Scr...
DataSaturday #1 - PBI Modeling At Warp Speed With Tabular Editor Advanced Scr...Riccardo Perico
 
MongoDB Stich Overview
MongoDB Stich OverviewMongoDB Stich Overview
MongoDB Stich OverviewMongoDB
 
Joining the Club: Using Spark to Accelerate Big Data at Dollar Shave Club
Joining the Club: Using Spark to Accelerate Big Data at Dollar Shave ClubJoining the Club: Using Spark to Accelerate Big Data at Dollar Shave Club
Joining the Club: Using Spark to Accelerate Big Data at Dollar Shave ClubData Con LA
 
Build a game with javascript (april 2017)
Build a game with javascript (april 2017)Build a game with javascript (april 2017)
Build a game with javascript (april 2017)Thinkful
 
Adopting F# at SBTech
Adopting F# at SBTechAdopting F# at SBTech
Adopting F# at SBTechAntya Dev
 
INTEGRATE 2022 - Data Mapping in the Microsoft Cloud
INTEGRATE 2022 - Data Mapping in the Microsoft CloudINTEGRATE 2022 - Data Mapping in the Microsoft Cloud
INTEGRATE 2022 - Data Mapping in the Microsoft CloudDaniel Toomey
 
MongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: Tutorial
MongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: TutorialMongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: Tutorial
MongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: TutorialMongoDB
 
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 Harness SharePoint and jQuery to Make Dynamic Displays and Applications Harness SharePoint and jQuery to Make Dynamic Displays and Applications
Harness SharePoint and jQuery to Make Dynamic Displays and ApplicationsInnoTech
 
on SQL Managment studio(For the following exercise, use the Week 5.pdf
on SQL Managment studio(For the following exercise, use the Week 5.pdfon SQL Managment studio(For the following exercise, use the Week 5.pdf
on SQL Managment studio(For the following exercise, use the Week 5.pdfformaxekochi
 

Ähnlich wie Super spike (20)

PoEAA by Example
PoEAA by ExamplePoEAA by Example
PoEAA by Example
 
Patterns of Enterprise Application Architecture (by example)
Patterns of Enterprise Application Architecture (by example)Patterns of Enterprise Application Architecture (by example)
Patterns of Enterprise Application Architecture (by example)
 
SH 1 - SES 8 - Stitch_Overview_TLV.pptx
SH 1 - SES 8 - Stitch_Overview_TLV.pptxSH 1 - SES 8 - Stitch_Overview_TLV.pptx
SH 1 - SES 8 - Stitch_Overview_TLV.pptx
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
 
Simplify Feature Engineering in Your Data Warehouse
Simplify Feature Engineering in Your Data WarehouseSimplify Feature Engineering in Your Data Warehouse
Simplify Feature Engineering in Your Data Warehouse
 
[WSO2Con Asia 2018] Patterns for Building Streaming Apps
[WSO2Con Asia 2018] Patterns for Building Streaming Apps[WSO2Con Asia 2018] Patterns for Building Streaming Apps
[WSO2Con Asia 2018] Patterns for Building Streaming Apps
 
Kevin Bengtson Portfolio
Kevin Bengtson PortfolioKevin Bengtson Portfolio
Kevin Bengtson Portfolio
 
Geek Sync | Rewriting Bad SQL Code 101
Geek Sync | Rewriting Bad SQL Code 101Geek Sync | Rewriting Bad SQL Code 101
Geek Sync | Rewriting Bad SQL Code 101
 
Introduction to MongoDB at IGDTUW
Introduction to MongoDB at IGDTUWIntroduction to MongoDB at IGDTUW
Introduction to MongoDB at IGDTUW
 
Business Dashboards using Bonobo ETL, Grafana and Apache Airflow
Business Dashboards using Bonobo ETL, Grafana and Apache AirflowBusiness Dashboards using Bonobo ETL, Grafana and Apache Airflow
Business Dashboards using Bonobo ETL, Grafana and Apache Airflow
 
DataSaturday #1 - PBI Modeling At Warp Speed With Tabular Editor Advanced Scr...
DataSaturday #1 - PBI Modeling At Warp Speed With Tabular Editor Advanced Scr...DataSaturday #1 - PBI Modeling At Warp Speed With Tabular Editor Advanced Scr...
DataSaturday #1 - PBI Modeling At Warp Speed With Tabular Editor Advanced Scr...
 
MongoDB Stich Overview
MongoDB Stich OverviewMongoDB Stich Overview
MongoDB Stich Overview
 
Joining the Club: Using Spark to Accelerate Big Data at Dollar Shave Club
Joining the Club: Using Spark to Accelerate Big Data at Dollar Shave ClubJoining the Club: Using Spark to Accelerate Big Data at Dollar Shave Club
Joining the Club: Using Spark to Accelerate Big Data at Dollar Shave Club
 
Build a game with javascript (april 2017)
Build a game with javascript (april 2017)Build a game with javascript (april 2017)
Build a game with javascript (april 2017)
 
Adopting F# at SBTech
Adopting F# at SBTechAdopting F# at SBTech
Adopting F# at SBTech
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentals
 
INTEGRATE 2022 - Data Mapping in the Microsoft Cloud
INTEGRATE 2022 - Data Mapping in the Microsoft CloudINTEGRATE 2022 - Data Mapping in the Microsoft Cloud
INTEGRATE 2022 - Data Mapping in the Microsoft Cloud
 
MongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: Tutorial
MongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: TutorialMongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: Tutorial
MongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: Tutorial
 
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 Harness SharePoint and jQuery to Make Dynamic Displays and Applications Harness SharePoint and jQuery to Make Dynamic Displays and Applications
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 
on SQL Managment studio(For the following exercise, use the Week 5.pdf
on SQL Managment studio(For the following exercise, use the Week 5.pdfon SQL Managment studio(For the following exercise, use the Week 5.pdf
on SQL Managment studio(For the following exercise, use the Week 5.pdf
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Kürzlich hochgeladen (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Super spike

  • 2. Who am I? Who I am?
  • 3. Indoctrination Reduction in fear Super awesome MongoDB non-relational database tips An introduction on how to use the MongoDB C# Driver Super awesome F# functional programming tips How to integrate F# into your apps today Looks at some functional techniques BONUS: (I hope) some inspiration
  • 4. 1. Analyze transactional data 2. Create models for setting prices 3. Work with sales team to raise prices 4. Measure results
  • 5. Narrow Deep
  • 6. • Mongo – Unstructured data – Flexible query language…using JavaScript! – Feels…”light” • F# – Reasoning • Less code • No side effects – Productivity • fsi • Focus on what, not where
  • 7. • Data Access – Mostly read-only – Data processing heavy – Non-standard formats from client to client • Data Processing – Calculate metrics on different slices of data – Different formulas for various metrics
  • 8. View (razor) Controller (C#) Model Data Processing (F#) (C#) Data Access (F#) MongoDB
  • 9. • Current Situation – Unknown schema – Complex transformation scripts – Complex loading scripts
  • 10.
  • 11.
  • 12. static member Initialize() = BsonClassMap.RegisterClassMap<Customer>(fun cm -> cm.AutoMap() cm.SetIdMember(cm.GetMemberMap("Number")) ) |> ignore BsonClassMap.RegisterClassMap<Product>(fun cm -> cm.AutoMap() cm.SetIdMember(cm.GetMemberMap("SKU")) ) |> ignore
  • 13. private static void ImportFromFile<T>( string filename, Dictionary<string, int> fieldMappings) where T: CoreObject { var datafile = DataFile.FindOneById(filename); var record = datafile.ReadLine(); while (record != null) { var o = Activator.CreateInstance<T>(); o.Load(record, fieldMappings); o.Save(); record = datafile.ReadLine(); } }
  • 14. { "_id": "1234567", "_t": "Customer", "Attributes": { "Parent": "Mike's Chocolates", "Salesman": "Willy Wonka", "Industry": "Candy" }, "Name": "Choc a lot" } • Invoice • Date • Quantity • Amount • Customer • Product
  • 15. • Current Situation – Hard to find – Hard to test – Calculations are often performed “on top of” other calculations – Technical team needs to explain how formulas work
  • 16. let GetCollection<'T>() = (new MongoRepository()) .GetDatabase() .GetCollection<'T> typeof<'T>.Name let Invoices = GetCollection<Invoice> let GetInvoices (fromDate:DateTime) (toDate:DateTime) includeFields = let query = Query .GTE("Date", BsonDateTime.Create(fromDate)) .LTE(BsonDateTime.Create(toDate)) let fields = Fields.Exclude("_id").Include(includeFields) Invoices().Find(query).SetFields(fields) :> seq<Invoice>
  • 17. static member GetRevenueByYear (fromDate:DateTime) (toDate:DateTime) = GetInvoices fromDate toDate [|"Date"; "Amount"|] |> Seq.groupBy (fun i -> i.Date.Year) |> Seq.map (fun (year, invoices) -> (year, (sumRevenue invoices))) |> Seq.sortBy (fun (year, _) -> year) let sumRevenue (invoices:seq<Invoice>) = invoices |> Seq.sumBy (fun i -> i.Amount)
  • 18.
  • 19. let IndexByCustomer fromDate toDate operation attribute = Index “Customer” (fun i -> i.Customer.Attributes.[attribute]) fromDate toDate operation let IndexByProduct fromDate toDate operation attribute = Index “Product” (fun i -> i.Product.Attributes.[attribute]) fromDate toDate operation let Index type groupF fromDate toDate indexF string -> (Invoice -> string) -> DateTime -> DateTime -> (seq<Invoice> -> float) -> seq<string * float * float>
  • 20. string -> (Invoice -> string) -> DateTime -> DateTime -> (seq<Invoice> -> float) -> seq<string * float * float> let IndexCustomers attribute = Index "Customer" (fun (i:Invoice) -> i.Customer.Attributes.[attribute]) let IndexProducts attribute = Index "Product" (fun (i:Invoice) -> i.Product.Attributes.[attribute]) string -> (DateTime -> DateTime -> (seq<Invoice> -> float) -> seq<string * float * float>) let IndexByCustomer fromDate toDate operation attribute = IndexCustomers attribute fromDate toDate operation let IndexByProduct fromDate toDate operation attribute = IndexProducts attribute fromDate toDate operation
  • 21. type Entity = | Customer | Product let IndexEntity t attribute fromDate toDate indexOp = let f = match t with | Customer -> IndexCustomers | Product -> IndexProducts f attribute fromDate toDate indexOp
  • 22. OPERATIONAL DEVELOPMENT USER PERCEIVED From days to minutes Reasoning about code “OK” Closer to the data
  • 23.

Hinweis der Redaktion

  1. Principles: 1) software is a means to an end; 2) the customer is the architect
  2. Principles: 1) software is a means to an end; 2) the customer is the architect
  3. INVESTIGATION of a solutionNarrow: focused on particular objectivesDrives deep: feasibility and “how it works”
  4. Not unique…
  5. SOLUTION EXPLORER- Models, Lib, Web- Show References- Order of files in F# project
  6. Schema: wastexform: ripe for error, low bus numberload: complex, business rules data driven during load, can only be changed by reloading, “further from the data”Show C# code – fields we need versus “things that are interesting”How much effort did we just eliminate?
  7. So What? Can do this with RDBMSMapping to database tables and columns vs. mapping to properties of an object
  8. Field names: Parent, Salesman, Industry
  9. Map-ReduceSELECT … GROUP BY!!!!Within a single toolUnit testing
  10. So many ways to compose functions. Make DSLs