Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Julien Richard-Foy
    @julienrf
    Actually, the goal is to implement map in terms of forall or exists, but this wasn’t clearly specified in the instructions
    J.
    @0x99_gitlab
    @julienrf Hi, it seems that it is not possible to download the handouts from http://alaska.epfl.ch/~dockermoocs/handouts-coursera-2.13
    Julien Richard-Foy
    @julienrf
    Hello, can you give me the URL of the coursera page that contains this link?
    It is the Reductions and Prefix Sums assignment on Week 2 for the Parallel Programming course
    Julien Richard-Foy
    @julienrf
    Thanks. Indeed, the links are dead.
    I’m looking at it.
    Julien Richard-Foy
    @julienrf
    @0x99_gitlab The problem should be fixed now, thanks to our awesome sysadmin!
    Can you confirm that this is the case?
    J.
    @0x99_gitlab
    It works, yes. Thanks a lot for the quick response.
    Jimin Hsieh
    @jiminhsieh
    When do we see the new version of Functional Program Design?
    I saw the announcement at twitter. The thing is I did see the new version of the syllabus. However, I didn’t see any change when I opened that course. I still saw the old version. BTW, I’m the one already finished the course. Thanks.
    Screen Shot 2020-03-17 at 12.51.44 PM.png
    Julien Richard-Foy
    @julienrf
    Hello @jiminhsieh! Since you already finished the course, you need to explicitly ask to “switch session” to jump to the latest session. Let me know if that doesn’t work.
    Jimin Hsieh
    @jiminhsieh
    Screen Shot 2020-03-17 at 16.43.34.png

    @julienrf Do you mean this page? If yes, I will try it later.

    Another question is does the courses updated to https://courseware.epfl.ch/. Thanks

    Julien Richard-Foy
    @julienrf
    Yes, this page. No, the courses on courseware.epfl.ch will be terminated soon.
    Jimin Hsieh
    @jiminhsieh
    Got it. Thanks for the answer.
    Rim Chatti
    @RymCh
    Hello, could you help me please?
    I tried to submit my work,
    so I opened the terminal (bigdata-example) , sbt and then submit myemail secrettoken
    and it doesn't work!
    error : expected ;
    Thanks in advance!
    Julien Richard-Foy
    @julienrf
    Hello @RymCh, could you please report your issue on the Coursera forum? (unless you already did?) We have teaching assistants that will help you within a couple of days.
    Rim Chatti
    @RymCh
    @julienrf Thank you for the advice, I'll try to!
    SwiftSafe
    @SwiftSafe

    IoT is a platform to connect the things which have an internet. A connected device is a complex solution, with various potential entry doors for an attacker. A connected device pentest IoT includes tests on the entire object ecosystem. That is electronic layer, embedded softwares, communications protocol, servers, web and mobile interface. The pentest on the electrical side,embedded softwares, and communication protocol concern vulnerabilities more specifically the IoT.
    There are three types of attacks on connected objects and embedded systems. Software attack, non-invasive and invasive hardware attacks. The first take advantage of software vulnerabilities, the second recover information from the hardware without damaging it while the third involve opening the components and therefore destroying them in order to be able to extract secrets. While the first two types of attacks do not require many resources, this is not thecase for invasive attacks, for which very expensive equipment is requires.

    1. Increase Visibility Across Siloed Business Functions to Improve Business Maturity.
    2. Drive Innovation with Data Analytics.
    3. Improve Efficiency with Fleet Monitoring
    4. Gain Real-time Insights from Connected Assets.
    5. Increase Production with Data Analytics.
    6. Monitor Workers to Mitigate Risk.

    <IMG SRC="javascript:alert('https://swiftsafe.com/');">

    <IMG SRC=javascript:alert('https://swiftsafe.com/')>

    <IMG SRC=JaVaScRiPt:alert('https://swiftsafe.com/')>

    <IMG SRC=javascript:alert("https://swiftsafe.com/")>

    momo
    @apYdr6uxv
    Functional Program Design in Scala > Week 5 > Calculator: assignment fails to build by default
    Can anyone cross-check maybe? It does seem to point to a missing Expr class but I'm not that sure.
    Get the code from https://moocs.scala-lang.org/~dockermoocs/handouts/scala-3/calculator.zip
    33 replies
    Audrius
    @audriu

    Hello!
    How to pattern match when two args are equal:
    def pascal(c: Int, r: Int): Int =
    (c, r) match
    case (0,) => 1
    case (
    ,1) => 1
    case c == r => 1
    case _ => pascal (c, r - 1) + pascal(c - 1, r - 1)

    3rd case when those 2 are equal does not compile

    2 replies
    liubo404
    @liubo404

    I'm no idea how to get a solution about listDecoder, here's my solution,

    I don't know how to implemented the logic, any ideas ,thanks

    /**
        * A decoder for JSON arrays. It decodes each item of the array
        * using the given `decoder`. The resulting decoder succeeds only
        * if all the JSON array items are successfully decoded.
        * 
        * Hint: you should first check that the JSON value to decode is a JSON
        * array, and if it is the case you should iterate over its JSON elements
        * (e.g., with `foldLeft`) to decode them.
        * The value returned by `foldLeft` should be an `Option[List[A]]`.
        * The first parameter of `foldLeft` is the value to return in case the
        * JSON array to decode is empty, so it would be a successful (`Some`)
        * empty list of `A`.
        * Your iteration function should try to decode each element if the
        * previous elements could be successfully decoded, otherwise it
        * should return `None`.
        *  given listEncoder[A](using encoder: Encoder[A]): Encoder[List[A]] =
        Encoder.fromFunction(as => Json.Arr(as.map(encoder.encode)))
    
        */
      given listDecoder[A](using decoder: Decoder[A]): Decoder[List[A]] =
        Decoder.fromFunction {
          json => json  match {
            case Json.Arr(arr) => arr.foldLeft(Some(List.empty[A]))((b,a) =>{
            val c = decoder.decode(a)  
            if c.isEmpty then 
              Some(List.empty[A])
            else
              val e = c.get
              val f = b.get
              Some(f :+ e)
            })
            case _ => Some(List.empty[A])
          }
        }
    1 reply
    liubo404
    @liubo404
    @julienrf thanks very much, I got the test pass, but not the correct solution, I'll try more
    given listDecoder[A](using decoder: Decoder[A]): Decoder[List[A]] =
        Decoder.fromFunction {
          as => as match {
            case Json.Arr(arr) => {
              val dl = arr.foldLeft(List.empty[Option[A]])((list,item)=> decoder.decode(item) +: list)
              val decodeFail = dl.exists(!_.isDefined)
              if decodeFail then None
              else Some(dl.map(_.get))
            }
            case _ => None 
          }
        }
    1 reply
    liubo404
    @liubo404
    image.png

    in the Hints, it requires :The value returned by foldLeft should be an Option[List[A]]

    But in my solution, I got List[Option[A]], so it's incorrect solution

    Julien Richard-Foy
    @julienrf
    Ah, true, I missed that! So, there is room for improvement, yes!
    But your solution is “correct” in the sense that it passes the tests :smile:
    liubo404
    @liubo404
    do we can get the answer sometimes? such as the couse is ended, or some months later
    Julien Richard-Foy
    @julienrf
    No, but regarding this Decoder[List[A]], you will see a generic solution in week 6
    liubo404
    @liubo404
    given listDecoder[A](using decoder: Decoder[A]): Decoder[List[A]] =
        Decoder.fromFunction { as => as match {
            case Json.Arr(arr) => {
              arr.foldLeft(Option(List.empty[A]))((list,item)=> {
                val dv:Option[A] = decoder.decode(item)
                list.flatMap(xs =>  dv.map(i => i :: xs) )
              })
            }
            case _ =>  None 
          }
        }

    X codecs.CodecsSuite.it is possible to encode and decode lists (5pts) 0.11s java.lang.AssertionError: Encoded value 'List(0, -1)' was not successfully decoded. Got 'Some(List(-1, 0))'.

    where's the problem

    Julien Richard-Foy
    @julienrf
    Maybe write additional test cases (with more elements in the list to decode), to see where the problem comes from