| name | description | allowed-tools |
|---|---|---|
docs |
Review and update project documentation to keep it current with code changes |
Read, Glob, Grep, Edit |
When invoked, check if documentation needs updating based on recent work.
| scala> val l = "a" :: "b" :: "c" :: "b" :: "a" :: List() | |
| l: List[java.lang.String] = List(a, b, c, b, a) | |
| scala> val distinct = l.distinct | |
| distinct: List[java.lang.String] = List(a, b, c) | |
| scala> distinct zip (distinct map (p => l.filter(p == _).size)) | |
| res0: List[(java.lang.String, Int)] = List((a,2), (b,2), (c,1)) |
| import java.io.BufferedReader; | |
| import java.io.FileReader; | |
| import java.io.FileWriter; | |
| import java.io.IOException; | |
| import java.io.PrintWriter; | |
| import java.util.*; | |
| public class DuplicateWords { | |
| public static void main(String[] args) { |
| case class AcceptHeader(mediaType: String, mediaSubType: String, qualityFactor: Float) |
| package code.service | |
| import xml.{Elem, Node} | |
| import net.liftweb.http._ | |
| import rest.RestHelper | |
| import provider.HTTPCookie | |
| import net.liftweb.common.{Empty, Full} | |
| import code.model.Product | |
| object WebService extends RestHelper { |
| case class NotModifiedResponse(eTag: String) extends LiftResponse with HeaderDefaults { | |
| def toResponse = InMemoryResponse(Array(), "ETag" -> ("\"" + eTag + "\"") :: headers, cookies, 304) | |
| } |
| trait RestHelper extends LiftRules.DispatchPF { | |
| ... | |
| /** | |
| * A function that chooses JSON or XML based on the request.. | |
| * Use with serveType | |
| */ | |
| implicit def jxSel(req: Req): Box[JsonXmlSelect] = | |
| if (jsonResponse_?(req)) Full(JsonSelect) | |
| else if (xmlResponse_?(req)) Full(XmlSelect) | |
| else None |
| serve { | |
| case "api" :: "user" :: id :: _ Get _ => userDetails(id) | |
| } |