├── project └── assembly.sbt ├── lib ├── pdfclown.jar └── pdfclown-0.1.2-sources.jar ├── src ├── test │ ├── resources │ │ ├── agile_contracts_primer.pdf │ │ ├── Test1.txt │ │ ├── ExampleClippings.txt~ │ │ ├── ExampleClippings.txt │ │ ├── pdfHighlightTest.txt │ │ └── MyClippings.txt │ └── scala │ │ └── com │ │ └── fabiooliveiracosta │ │ └── highlight2pdf │ │ ├── UnitSpec.scala │ │ ├── FileReaderSpec.scala │ │ ├── PDFHandlerSpec.scala │ │ ├── ClippingSpec.scala │ │ ├── CommonSubstringSpec.scala │ │ └── ReadClippingSpec.scala └── main │ └── scala │ └── com │ └── fabiooliveiracosta │ └── highlight2pdf │ ├── Clippings.scala │ ├── FileReader.scala │ ├── CommonSubstring.scala │ ├── CLIApp.scala │ ├── ClippingFactory.scala │ ├── ClippingsReader.scala │ ├── PDFHighlightIntervalFilter.scala │ └── PDFHandler.scala ├── .gitignore ├── README.md ├── LICENSE └── samples.txt /project/assembly.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.13.0") -------------------------------------------------------------------------------- /lib/pdfclown.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drFabio/highlight2pdf/master/lib/pdfclown.jar -------------------------------------------------------------------------------- /lib/pdfclown-0.1.2-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drFabio/highlight2pdf/master/lib/pdfclown-0.1.2-sources.jar -------------------------------------------------------------------------------- /src/test/resources/agile_contracts_primer.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drFabio/highlight2pdf/master/src/test/resources/agile_contracts_primer.pdf -------------------------------------------------------------------------------- /src/test/scala/com/fabiooliveiracosta/highlight2pdf/UnitSpec.scala: -------------------------------------------------------------------------------- 1 | package com.fabiooliveiracosta.highlight2pdf 2 | 3 | import org.scalatest._ 4 | 5 | abstract class UnitSpec extends FlatSpec with Matchers with OptionValues with Inside with Inspectors -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | *.log 3 | 4 | # sbt specific 5 | .cache 6 | .history 7 | .lib/ 8 | dist/* 9 | target/ 10 | lib_managed/ 11 | src_managed/ 12 | project/boot/ 13 | project/plugins/project/ 14 | 15 | # Scala-IDE specific 16 | .scala_dependencies 17 | .worksheet 18 | -------------------------------------------------------------------------------- /src/main/scala/com/fabiooliveiracosta/highlight2pdf/Clippings.scala: -------------------------------------------------------------------------------- 1 | package com.fabiooliveiracosta.highlight2pdf 2 | 3 | abstract class AbstractClipping(val firstPage:Int,val lastPage:Int,val bookTitle:String) 4 | case class HighlightClipping(fstPage:Int, 5 | lstPage:Int, 6 | title:String, 7 | val content:String) 8 | extends AbstractClipping(fstPage,lstPage,title) 9 | 10 | case class BookmarkClipping(fstPage:Int, 11 | lstPage:Int, 12 | title:String) 13 | extends AbstractClipping(fstPage,lstPage,title) -------------------------------------------------------------------------------- /src/test/resources/Test1.txt: -------------------------------------------------------------------------------- 1 | Highlight1 2 | - Your Highlight on page 22-22 | Added on Wednesday, 8 April 2015 16:03:38 3 | 4 | Lorem ipsum dolor sit amet 5 | ========== 6 | Highlight2 7 | - Your Highlight on page 24-24 | Added on Sunday, 12 April 2015 14:15:50 8 | 9 | Consectur lorem ipsum sit 10 | ========== 11 | Highlight3 12 | - Your Highlight on page 24-24 | Added on Sunday, 12 April 2015 14:15:50 13 | 14 | Consectur lorem ipsum sit 15 | ========== 16 | 17 | Bookmark1 18 | - Your Bookmark Location 45 | Added on Monday, 4 November 13 17:13:14 19 | 20 | 21 | ========== -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # highlight2pdf 2 | A scala program that get Kingle clipping highlights and highlight them on the PDF 3 | It uses pdfClown for the pdfHighlight 4 | See the tests for further informations 5 | You can use this as a CLI app using the jar on build like so: 6 | java -jar highlight2pdf -h clippings.txt -t "BookTitleOnClippings" pdfFileToHighlight.pdf 7 | 8 | ## Build 9 | You can build using sbt 10 | 11 | ##F urther improvements 12 | 13 | - PDF bookmarking 14 | 15 | - Make a mapping of clipping title to a pdf file on a folder 16 | 17 | ### About the pdf on tests 18 | The pdf on tests can be found here http://www.agilecontracts.org/ 19 | -------------------------------------------------------------------------------- /src/test/scala/com/fabiooliveiracosta/highlight2pdf/FileReaderSpec.scala: -------------------------------------------------------------------------------- 1 | package com.fabiooliveiracosta.highlight2pdf 2 | 3 | import org.scalatest._ 4 | import java.io.FileNotFoundException 5 | class FileReaderSpec extends UnitSpec { 6 | "Files that are not found" should "throw an exception" in{ 7 | intercept[FileNotFoundException] { 8 | FileReader.getFileLines("nontExistent.txt"); 9 | } 10 | } 11 | "Files that are found " should "return the file lines " in { 12 | val path:String=getClass.getResource("/ExampleClippings.txt").getPath() 13 | val lines:Iterable[String]=FileReader.getFileLines(path) 14 | assert(lines.size>0) 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /src/test/resources/ExampleClippings.txt~: -------------------------------------------------------------------------------- 1 | Lean Architecture 2 | - Your Highlight on page 22-22 | Added on Wednesday, 8 April 2015 16:03:38 3 | 4 | We will deliver code just in time instead of stockpiling software library warehouses ahead of time 5 | ========== 6 | Lean Architecture 7 | - Your Highlight on page 24-24 | Added on Sunday, 12 April 2015 14:15:50 8 | 9 | that 70% of the software they build is never used 10 | ========== 11 | Lean Architecture 12 | - Your Highlight on page 26-26 | Added on Sunday, 12 April 2015 14:19:35 13 | 14 | Lean focuses on what’s important now, whenever ‘‘now’’ is – whether that is hitting the target for next week’s delivery or doing long-term planning 15 | ========== 16 | -------------------------------------------------------------------------------- /src/test/scala/com/fabiooliveiracosta/highlight2pdf/PDFHandlerSpec.scala: -------------------------------------------------------------------------------- 1 | package com.fabiooliveiracosta.highlight2pdf 2 | 3 | import java.net.URL 4 | import org.scalatest._ 5 | import java.io.FileNotFoundException 6 | class PDFHandlerSpec extends UnitSpec { 7 | "Highlight" should "be possible" in{ 8 | val clippingPath:String=getClass.getResource("/pdfHighlightTest.txt").getPath() 9 | val highlightList:List[HighlightClipping]=ClippingsReader.readHighlightsFromFile(clippingPath,"agile_contracts_primer") 10 | val url:URL=getClass.getResource("/agile_contracts_primer.pdf") 11 | val path:String=url.getPath() 12 | val ret:Boolean=PDFHandler.highlightOnFile(path,highlightList) 13 | assert(ret) 14 | 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /src/test/resources/ExampleClippings.txt: -------------------------------------------------------------------------------- 1 | Lean Architecture 2 | - Your Highlight on page 22-22 | Added on Wednesday, 8 April 2015 16:03:38 3 | 4 | We will deliver code just in time instead of stockpiling software library warehouses ahead of time 5 | ========== 6 | Lean Architecture 7 | - Your Highlight on page 24-24 | Added on Sunday, 12 April 2015 14:15:50 8 | 9 | that 70% of the software they build is never used 10 | ========== 11 | Lean Architecture 12 | - Your Highlight on page 26-26 | Added on Sunday, 12 April 2015 14:19:35 13 | 14 | Lean focuses on what’s important now, whenever ‘‘now’’ is – whether that is hitting the target for next week’s delivery or doing long-term planning 15 | ========== 16 | Lean Architecture 17 | - Your Bookmark Location 45 | Added on Monday, 4 November 13 17:13:14 18 | 19 | 20 | ========== -------------------------------------------------------------------------------- /src/main/scala/com/fabiooliveiracosta/highlight2pdf/FileReader.scala: -------------------------------------------------------------------------------- 1 | package com.fabiooliveiracosta.highlight2pdf 2 | 3 | import java.nio.file.{Paths, Files} 4 | import scala.io.Source 5 | 6 | object FileReader{ 7 | protected val defaultCodecs = List( 8 | io.Codec("UTF-8"), 9 | io.Codec("ISO-8859-1") 10 | ) 11 | def getFileLines(fileName:String, codecs:Iterable[io.Codec] = defaultCodecs): Iterable[String]={ 12 | if(!Files.exists(Paths.get(fileName))){ 13 | throw new java.io.FileNotFoundException("File: "+fileName+" not found "); 14 | } 15 | val codec = codecs.head 16 | val fileHandle=Source.fromFile(fileName)(codec) 17 | try{ 18 | fileHandle.getLines().toList 19 | } 20 | catch{ 21 | case ex: Exception => { 22 | if (codecs.tail.isEmpty) { 23 | throw ex 24 | } 25 | getFileLines(fileName, codecs.tail) 26 | } 27 | } 28 | finally{ 29 | fileHandle.close() 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/scala/com/fabiooliveiracosta/highlight2pdf/CommonSubstring.scala: -------------------------------------------------------------------------------- 1 | package com.fabiooliveiracosta.highlight2pdf 2 | import scala.util.control.Breaks 3 | 4 | object CommonSubstring{ 5 | /** 6 | *Finds the segment of a needle on a haystack assuming that needle is started on haystack always 7 | */ 8 | def findSegment(needle:String,haystack:String):String={ 9 | var start:Int=0 10 | var max:Int=0 11 | val needleLength:Int=needle.length() 12 | val haystackLength:Int=haystack.length() 13 | var j:Int=0 14 | var x:Int=0 15 | for(j<-0 until haystackLength){ 16 | x=0 17 | def loopNeedle{ 18 | if(x>=needleLength || (j+x)>=haystackLength){ 19 | return 20 | } 21 | if(needle.charAt(x)==haystack.charAt(j+x)){ 22 | x+=1 23 | } 24 | else{ 25 | return 26 | } 27 | loopNeedle 28 | } 29 | loopNeedle 30 | 31 | if(x>max){ 32 | max=x 33 | start=j 34 | } 35 | //Already found match 36 | if(max==needleLength){ 37 | return haystack.substring(start,(start+max)) 38 | } 39 | } 40 | 41 | haystack.substring(start,(start+max)) 42 | } 43 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Fabio Oliveira Costa 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /src/test/scala/com/fabiooliveiracosta/highlight2pdf/ClippingSpec.scala: -------------------------------------------------------------------------------- 1 | package com.fabiooliveiracosta.highlight2pdf 2 | 3 | import org.scalatest._ 4 | import java.io.FileNotFoundException 5 | class ClippingSpec extends UnitSpec { 6 | "Clipping with highlight " should "be returned as highlighted clippings " in{ 7 | val clippingList=List("Some title", 8 | "- Your Highlight on page 24-30 | Added on Sunday, 12 April 2015 14:15:50 ", 9 | "Lorem ipsum dolor sit amet"); 10 | 11 | val clipping:Option[AbstractClipping]=ClippingFactory.getClippling(clippingList) 12 | clipping match{ 13 | case Some(h:HighlightClipping)=>{ 14 | println(h.lastPage) 15 | assert(h.lastPage==30) 16 | assert(h.firstPage==24) 17 | assert(h.bookTitle=="Some title") 18 | assert(h.content=="Lorem ipsum dolor sit amet") 19 | } 20 | case _=>{ 21 | fail("Type of clipping should be highlight") 22 | } 23 | } 24 | } 25 | "Clipping with Bookmark " should "be returned as bookmarks clippings " in{ 26 | val clippingList=List("Another title", 27 | "- Your Bookmark on Page 67 | Added on Sunday, 12 April 2015 14:15:50 "); 28 | 29 | val clipping:Option[AbstractClipping]=ClippingFactory.getClippling(clippingList) 30 | clipping match{ 31 | case Some(b:BookmarkClipping)=>{ 32 | println(b.lastPage) 33 | assert(b.lastPage==67) 34 | assert(b.firstPage==67) 35 | assert(b.bookTitle=="Another title") 36 | } 37 | case _=>{ 38 | fail("Type of clipping should be bookmark") 39 | } 40 | } 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/test/scala/com/fabiooliveiracosta/highlight2pdf/CommonSubstringSpec.scala: -------------------------------------------------------------------------------- 1 | package com.fabiooliveiracosta.highlight2pdf 2 | 3 | import org.scalatest._ 4 | class CommonSubstringSpec extends UnitSpec { 5 | val haystack:String="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse porttitor luctus massa, quis pretium sapien tristique vitae. Cras non magna scelerisque, pretium ex quis, blandit lacus. Aenean lacinia aliquet tempus. Aenean suscipit eget quam in pharetra. Donec id velit sit amet velit pretium pretium. Donec et enim ac velit congue hendrerit. Cras tempus sodales dui quis gravida. Cras pellentesque ut sem eu ullamcorper. Aenean dictum, purus eget pulvinar semper, nulla magna suscipit erat, non vestibulum mi ante eget elit. Aliquam ut leo nisl. Fusce tristique vitae nisi a gravida. Vestibulum semper tristique turpis quis ultricies. Sed sit amet euismod quam. In hac habitasse platea dictumst. Nulla dapibus sagittis orci vitae cursus. Aliquam libero nisi, volutpat sit amet rhoncus eu, dapibus a lorem" 6 | "The longest common substring" should "be found if fully matched" in{ 7 | val needle:String="Lorem ipsum dolor sit amet" 8 | val comparison=CommonSubstring.findSegment(needle,haystack) 9 | assert(needle==comparison) 10 | } 11 | "The longest common substring" should "be found if partialy matched" in{ 12 | val baseNeedle:String="volutpat sit amet rhoncus eu, dapibus a lorem" 13 | val comparison=CommonSubstring.findSegment(baseNeedle+"Some stuff that should never be found",haystack) 14 | assert(baseNeedle==comparison) 15 | } 16 | } -------------------------------------------------------------------------------- /src/main/scala/com/fabiooliveiracosta/highlight2pdf/CLIApp.scala: -------------------------------------------------------------------------------- 1 | package com.fabiooliveiracosta.highlight2pdf 2 | object CLIApp { 3 | val usage = """Usage: highlight2pdf -h highlightFile -t bookHighlightTitle pdfFile""" 4 | 5 | type OptionMap = Map[Symbol, String] 6 | 7 | def highlightFromClippingIntoFile(highlightFile:String,bookTitle:String,pdfFile:String):Boolean={ 8 | val highlightList:List[HighlightClipping]=ClippingsReader.readHighlightsFromFile(highlightFile,bookTitle) 9 | PDFHandler.highlightOnFile(pdfFile,highlightList) 10 | } 11 | def parseCliArguments(args:Array[String]):OptionMap={ 12 | val arglist = args.toList 13 | 14 | def isSwitch(s : String) = (s(0) == '-') 15 | def nextOption(map : OptionMap, list: List[String]) : OptionMap = { 16 | list match { 17 | case Nil => map 18 | case "-h" :: value :: tail =>{ 19 | nextOption(map ++ Map('highlightFile -> value), tail) 20 | } 21 | case "-t" :: value :: tail =>{ 22 | nextOption(map ++ Map('bookTitle -> value), tail) 23 | } 24 | case value :: opt2 :: tail if isSwitch(opt2) => { 25 | nextOption(map ++ Map('pdfFile -> value), list.tail) 26 | } 27 | case value :: Nil =>{ 28 | nextOption(map ++ Map('pdfFile -> value), list.tail) 29 | } 30 | case _=>{ 31 | throw new Exception("Invalid usage") 32 | } 33 | } 34 | } 35 | nextOption(Map(),arglist) 36 | } 37 | def main(args: Array[String]){ 38 | if (args.length <5){ 39 | println(usage) 40 | return 41 | } 42 | val opt:OptionMap=parseCliArguments(args) 43 | val highlightFile:String=opt.get('highlightFile).get 44 | val bookTitle:String=opt.get('bookTitle).get 45 | val pdfFile:String=opt.get('pdfFile).get 46 | println("Trying to highlight the clippings from "+highlightFile+" on the book "+bookTitle+" for the pdf "+pdfFile) 47 | highlightFromClippingIntoFile(highlightFile,bookTitle,pdfFile) 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /src/main/scala/com/fabiooliveiracosta/highlight2pdf/ClippingFactory.scala: -------------------------------------------------------------------------------- 1 | package com.fabiooliveiracosta.highlight2pdf 2 | 3 | object ClippingFactory{ 4 | val titleRegex="""(?i)\s*-\s*Your (Highlight|Bookmark) (on Page|Location) ((\d*)(-(\d*))?) \|[^,]*, (\d*) (\w*) (\d*) (\d*):(\d*):(\d*)""".r 5 | def getHighlight(data:List[String],desiredTitles:String*):Option[HighlightClipping]={ 6 | val theClipping=this.getClippling(data,desiredTitles:_*) 7 | theClipping match{ 8 | case Some(h:HighlightClipping)=>Some(h) 9 | case _=>None 10 | } 11 | } 12 | def getBookmark(data:List[String],desiredTitles:String*):Option[BookmarkClipping]={ 13 | val theClipping=this.getClippling(data,desiredTitles:_*) 14 | theClipping match{ 15 | case Some(h:BookmarkClipping)=>Some(h) 16 | case _=>None 17 | } 18 | } 19 | def getClippling(data:List[String],desiredTitles:String*):Option[AbstractClipping]={ 20 | val title:String=data.head.trim 21 | if(desiredTitles.length>0 && !(desiredTitles contains title)){ 22 | return None 23 | } 24 | val temp=data.tail 25 | val typeData:String=temp.head.trim 26 | val groupMatchs=titleRegex findFirstMatchIn typeData 27 | var firstPage:Int=0 28 | var lastPage:Int=0 29 | var isBookmark:Boolean=false 30 | 31 | groupMatchs match { 32 | case Some(value) =>{ 33 | if(value.group(3) contains "-"){ 34 | firstPage=value.group(4).toInt 35 | lastPage=value.group(6).toInt 36 | } 37 | else{ 38 | firstPage=value.group(3).toInt 39 | lastPage=firstPage 40 | } 41 | if(value.group(1).toLowerCase() contains "bookmark"){ 42 | isBookmark=true 43 | } 44 | else{ 45 | isBookmark=false 46 | } 47 | } 48 | case None => throw new Exception("Invalid info data") 49 | } 50 | if(isBookmark){ 51 | Some(new BookmarkClipping(firstPage,lastPage,title)) 52 | } 53 | else{ 54 | val content:String=temp.tail.head.trim 55 | Some(new HighlightClipping(firstPage,lastPage,title,content)) 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /src/main/scala/com/fabiooliveiracosta/highlight2pdf/ClippingsReader.scala: -------------------------------------------------------------------------------- 1 | package com.fabiooliveiracosta.highlight2pdf 2 | import scala.collection.mutable.ListBuffer 3 | 4 | object ClippingsReader{ 5 | protected val defaultSeparator="==========" 6 | object ClippingTypes extends Enumeration { 7 | val ALL,BOOKMARK,CLIPPING = Value 8 | } 9 | def readClippingsFromFile(fileName:String,desiredTitles:String*):List[AbstractClipping]={ 10 | filterClippings(fileName,ClippingTypes.ALL,desiredTitles:_*) 11 | } 12 | def filterClippings(fileName:String,desiredType:ClippingTypes.Value,desiredTitles:String*):List[AbstractClipping]={ 13 | val lines:Iterable[String]=FileReader.getFileLines(fileName); 14 | var line:String="" 15 | var clippingsLinesList=new ListBuffer[String]() 16 | var clippingBuffer=new ListBuffer[AbstractClipping]() 17 | var theClipping:Option[AbstractClipping]=None 18 | var clippingStrList:List[String]=Nil 19 | for(line<-lines){ 20 | if(line!=""){ 21 | if(line==defaultSeparator){ 22 | clippingStrList=clippingsLinesList.toList 23 | desiredType match{ 24 | case ClippingTypes.ALL=>{ 25 | theClipping=ClippingFactory.getClippling(clippingStrList,desiredTitles:_*) 26 | } 27 | case ClippingTypes.CLIPPING=>{ 28 | theClipping=ClippingFactory.getHighlight(clippingStrList,desiredTitles:_*) 29 | } 30 | case ClippingTypes.BOOKMARK=>{ 31 | theClipping=ClippingFactory.getBookmark(clippingStrList,desiredTitles:_*) 32 | } 33 | } 34 | theClipping match{ 35 | case Some(h)=>clippingBuffer+=h 36 | case None=> 37 | } 38 | clippingsLinesList.clear() 39 | } 40 | else{ 41 | clippingsLinesList+=line 42 | } 43 | } 44 | } 45 | clippingBuffer.toList 46 | } 47 | def readHighlightsFromFile(fileName:String,desiredTitles:String*):List[HighlightClipping]={ 48 | filterClippings(fileName,ClippingTypes.CLIPPING,desiredTitles:_*).asInstanceOf[List[HighlightClipping]] 49 | } 50 | def readBookmarksFromFile(fileName:String,desiredTitles:String*):List[BookmarkClipping]={ 51 | filterClippings(fileName,ClippingTypes.BOOKMARK,desiredTitles:_*).asInstanceOf[List[BookmarkClipping]] 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /src/test/scala/com/fabiooliveiracosta/highlight2pdf/ReadClippingSpec.scala: -------------------------------------------------------------------------------- 1 | package com.fabiooliveiracosta.highlight2pdf 2 | 3 | import org.scalatest._ 4 | import java.io.FileNotFoundException 5 | class ReadClippingSpec extends UnitSpec { 6 | "All Clippings " should "be obtained from a file and returned on the order they were found" in{ 7 | val path:String=getClass.getResource("/Test1.txt").getPath() 8 | val clippingList:List[AbstractClipping]=ClippingsReader.readClippingsFromFile(path) 9 | assert(clippingList.size==4) 10 | assert(clippingList(0).bookTitle=="Highlight1") 11 | assert(clippingList(1).bookTitle=="Highlight2") 12 | assert(clippingList(2).bookTitle=="Highlight3") 13 | assert(clippingList(3).bookTitle=="Bookmark1") 14 | } 15 | "Only bookmark clippings" should " be returned when using readHighlightsFromFile" in { 16 | val path:String=getClass.getResource("/Test1.txt").getPath() 17 | val clippingList:List[BookmarkClipping]=ClippingsReader.readBookmarksFromFile(path) 18 | assert(clippingList.size==1) 19 | assert(clippingList(0).bookTitle=="Bookmark1") 20 | assert(clippingList(0).isInstanceOf[BookmarkClipping]) 21 | } 22 | "Only Highlight clippings" should " be returned when using readHighlightsFromFile" in { 23 | val path:String=getClass.getResource("/Test1.txt").getPath() 24 | val clippingList:List[AbstractClipping]=ClippingsReader.readHighlightsFromFile(path) 25 | assert(clippingList.size==3) 26 | assert(clippingList(0).bookTitle=="Highlight1") 27 | assert(clippingList(1).bookTitle=="Highlight2") 28 | assert(clippingList(2).bookTitle=="Highlight3") 29 | assert(clippingList(0).isInstanceOf[HighlightClipping]) 30 | assert(clippingList(1).isInstanceOf[HighlightClipping]) 31 | assert(clippingList(2).isInstanceOf[HighlightClipping]) 32 | } 33 | "Only the highlights from the selected title " should " be returned only when using readHighlightsFromFileForBook" in { 34 | val path:String=getClass.getResource("/Test1.txt").getPath() 35 | val clippingList:List[AbstractClipping]=ClippingsReader.readHighlightsFromFile(path,"Highlight1","Highlight2") 36 | assert(clippingList.size==2) 37 | assert(clippingList(0).bookTitle=="Highlight1") 38 | assert(clippingList(1).bookTitle=="Highlight2") 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/scala/com/fabiooliveiracosta/highlight2pdf/PDFHighlightIntervalFilter.scala: -------------------------------------------------------------------------------- 1 | package com.fabiooliveiracosta.highlight2pdf 2 | 3 | import scala.collection.JavaConversions._ 4 | 5 | import java.awt.geom.Rectangle2D 6 | import java.util.ArrayList 7 | import java.util.{Map => JMap, List => JList,Iterator=>JIterator} 8 | 9 | import org.pdfclown.documents.Pages 10 | import org.pdfclown.documents.Page 11 | import org.pdfclown.documents.contents.ITextString 12 | import org.pdfclown.documents.contents.TextChar 13 | import org.pdfclown.documents.interaction.annotations.TextMarkup 14 | import org.pdfclown.documents.interaction.annotations.TextMarkup.MarkupTypeEnum 15 | import org.pdfclown.files.File 16 | import org.pdfclown.tools.TextExtractor 17 | import org.pdfclown.util.math.Interval 18 | import org.pdfclown.util.math.geom.Quad 19 | 20 | class PDFHighlightIntervalFilter(val page:Page,val pageText:String,val desiredHighlight:String) extends TextExtractor.IIntervalFilter{ 21 | 22 | protected var _alreadyFound=false 23 | protected var _remainingText:Option[String]=None 24 | def getRemainingText:Option[String]={ 25 | _remainingText 26 | } 27 | def hasNext():Boolean={ 28 | if(_alreadyFound){ 29 | false 30 | } 31 | else{ 32 | _alreadyFound=true 33 | true 34 | } 35 | } 36 | def next():Interval[Integer]={ 37 | val actualHighlight=CommonSubstring.findSegment(desiredHighlight,pageText) 38 | if(actualHighlight!=desiredHighlight){ 39 | _remainingText=Some(desiredHighlight.substring(actualHighlight.length()+1)) 40 | } 41 | val startIndex:Int=pageText.indexOf(actualHighlight) 42 | val endIndex:Int=startIndex+actualHighlight.length() 43 | new Interval[Integer](startIndex,endIndex) 44 | } 45 | def process(interval:Interval[Integer],textMatch:ITextString){ 46 | val highlightQuads:JList[Quad] = new ArrayList[Quad]() 47 | /* 48 | NOTE: A text pattern match may be split across multiple contiguous lines, 49 | so we have to define a distinct highlight box for each text chunk. 50 | */ 51 | var textBox:Rectangle2D = null 52 | val txtMatchList=textMatch.getTextChars().toList 53 | for(textChar:TextChar <- txtMatchList) 54 | { 55 | 56 | var textCharBox:Rectangle2D = textChar.getBox() 57 | if(textBox == null) 58 | { 59 | textBox=textCharBox.clone().asInstanceOf[Rectangle2D] 60 | } 61 | else{ 62 | if(textCharBox.getY() > textBox.getMaxY()){ 63 | highlightQuads.add(Quad.get(textBox)); 64 | textBox=textCharBox.clone().asInstanceOf[Rectangle2D] 65 | } 66 | else 67 | { 68 | textBox.add(textCharBox);} 69 | } 70 | } 71 | highlightQuads.add(Quad.get(textBox)); 72 | val markup:TextMarkup=new TextMarkup(page, null, MarkupTypeEnum.Highlight, highlightQuads); 73 | markup.setVisible(true) 74 | markup.setPrintable(true) 75 | } 76 | } -------------------------------------------------------------------------------- /src/main/scala/com/fabiooliveiracosta/highlight2pdf/PDFHandler.scala: -------------------------------------------------------------------------------- 1 | package com.fabiooliveiracosta.highlight2pdf 2 | 3 | import scala.collection.JavaConversions._ 4 | 5 | import java.awt.geom.Rectangle2D 6 | import java.util.ArrayList 7 | import java.util.{Map => JMap, List => JList,Iterator=>JIterator} 8 | import java.util.regex.Matcher 9 | import java.util.regex.Pattern 10 | 11 | import org.pdfclown.documents.Document 12 | import org.pdfclown.documents.Pages 13 | import org.pdfclown.documents.PageLabels 14 | import org.pdfclown.documents.interaction.navigation.page.PageLabel 15 | import org.pdfclown.documents.Page 16 | import org.pdfclown.documents.contents.ITextString 17 | import org.pdfclown.documents.contents.TextChar 18 | import org.pdfclown.documents.interaction.annotations.TextMarkup 19 | import org.pdfclown.documents.interaction.annotations.TextMarkup.MarkupTypeEnum 20 | import org.pdfclown.files.File 21 | import org.pdfclown.tools.TextExtractor 22 | import org.pdfclown.util.math.Interval 23 | import org.pdfclown.util.math.geom.Quad 24 | import org.pdfclown.files.SerializationModeEnum 25 | import org.pdfclown.objects.PdfInteger 26 | 27 | object PDFHandler{ 28 | val txtExtractor:TextExtractor= new TextExtractor(true, true) 29 | def highlightOnFile(filePath:String,highlights:List[HighlightClipping]):Boolean={ 30 | val file:File= new File(filePath) 31 | val doc:Document=file.getDocument() 32 | val numericStart:Int=getNumericStart(doc) 33 | val pages:Pages=doc.getPages() 34 | for (h <- highlights){ 35 | highlightPages(pages,h,numericStart) match{ 36 | case false=> return false 37 | case _ => 38 | } 39 | } 40 | file.save(SerializationModeEnum.Incremental) 41 | file.close() 42 | true 43 | } 44 | /** 45 | *Get the first numerical start of a page 46 | */ 47 | def getNumericStart(doc:Document):Int={ 48 | val labels:JMap[PdfInteger,PageLabel]=doc.getPageLabels() 49 | labels.foreach(kv=>{ 50 | if(kv._2.getNumberStyle()==PageLabel.NumberStyleEnum.ArabicNumber && kv._2.getPrefix()==null){ 51 | return kv._1.getIntValue() 52 | } 53 | }) 54 | 0 55 | } 56 | def highlightPages(pages:Pages,clipping:HighlightClipping,numericStart:Int):Boolean={ 57 | var desiredHighlight:String=clipping.content 58 | var intervalFilter:PDFHighlightIntervalFilter=null 59 | var page:Page=null 60 | var pageText:String=null 61 | var textMap:JMap[Rectangle2D,JList[ITextString]]=null 62 | var i:Int=0 63 | for(i<-((clipping.firstPage+numericStart)-1) until (clipping.lastPage+numericStart)){ 64 | page=pages.get(i) 65 | textMap= txtExtractor.extract(page) 66 | pageText=TextExtractor.toString(textMap) 67 | intervalFilter=new PDFHighlightIntervalFilter(page,pageText,desiredHighlight) 68 | txtExtractor.filter(textMap,intervalFilter) 69 | 70 | intervalFilter.getRemainingText match{ 71 | case Some(s:String)=>{ 72 | desiredHighlight=s 73 | } 74 | case None=> 75 | } 76 | } 77 | true 78 | } 79 | } -------------------------------------------------------------------------------- /samples.txt: -------------------------------------------------------------------------------- 1 | package org.pdfclown.samples.cli; 2 | 3 | import java.awt.geom.Rectangle2D; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import java.util.Map; 7 | import java.util.regex.Matcher; 8 | import java.util.regex.Pattern; 9 | 10 | import org.pdfclown.documents.Page; 11 | import org.pdfclown.documents.contents.ITextString; 12 | import org.pdfclown.documents.contents.TextChar; 13 | import org.pdfclown.documents.interaction.annotations.TextMarkup; 14 | import org.pdfclown.documents.interaction.annotations.TextMarkup.MarkupTypeEnum; 15 | import org.pdfclown.files.File; 16 | import org.pdfclown.tools.TextExtractor; 17 | import org.pdfclown.util.math.Interval; 18 | import org.pdfclown.util.math.geom.Quad; 19 | 20 | /** 21 | This sample demonstrates how to highlight text matching arbitrary patterns. 22 |

Highlighting is defined through text markup annotations.

23 | 24 | @author Stefano Chizzolini (http://www.stefanochizzolini.it) 25 | @since 0.1.1 26 | @version 0.1.2, 09/24/12 27 | */ 28 | public class TextHighlightSample 29 | extends Sample 30 | { 31 | @Override 32 | public void run( 33 | ) 34 | { 35 | // 1. Opening the PDF file... 36 | File file; 37 | { 38 | String filePath = promptFileChoice("Please select a PDF file"); 39 | try 40 | {file = new File(filePath);} 41 | catch(Exception e) 42 | {throw new RuntimeException(filePath + " file access error.",e);} 43 | } 44 | 45 | // Define the text pattern to look for! 46 | String textRegEx = promptChoice("Please enter the pattern to look for: "); 47 | Pattern pattern = Pattern.compile(textRegEx, Pattern.CASE_INSENSITIVE); 48 | 49 | // 2. Iterating through the document pages... 50 | TextExtractor textExtractor = new TextExtractor(true, true); 51 | for(final Page page : file.getDocument().getPages()) 52 | { 53 | System.out.println("\nScanning page " + (page.getIndex()+1) + "...\n"); 54 | 55 | // 2.1. Extract the page text! 56 | Map> textStrings = textExtractor.extract(page); 57 | 58 | // 2.2. Find the text pattern matches! 59 | final Matcher matcher = pattern.matcher(TextExtractor.toString(textStrings)); 60 | 61 | // 2.3. Highlight the text pattern matches! 62 | textExtractor.filter( 63 | textStrings, 64 | new TextExtractor.IIntervalFilter( 65 | ) 66 | { 67 | @Override 68 | public boolean hasNext( 69 | ) 70 | {return matcher.find();} 71 | 72 | @Override 73 | public Interval next( 74 | ) 75 | {return new Interval(matcher.start(), matcher.end());} 76 | 77 | @Override 78 | public void process( 79 | Interval interval, 80 | ITextString match 81 | ) 82 | { 83 | // Defining the highlight box of the text pattern match... 84 | List highlightQuads = new ArrayList(); 85 | { 86 | /* 87 | NOTE: A text pattern match may be split across multiple contiguous lines, 88 | so we have to define a distinct highlight box for each text chunk. 89 | */ 90 | Rectangle2D textBox = null; 91 | for(TextChar textChar : match.getTextChars()) 92 | { 93 | Rectangle2D textCharBox = textChar.getBox(); 94 | if(textBox == null) 95 | {textBox = (Rectangle2D)textCharBox.clone();} 96 | else 97 | { 98 | if(textCharBox.getY() > textBox.getMaxY()) 99 | { 100 | highlightQuads.add(Quad.get(textBox)); 101 | textBox = (Rectangle2D)textCharBox.clone(); 102 | } 103 | else 104 | {textBox.add(textCharBox);} 105 | } 106 | } 107 | highlightQuads.add(Quad.get(textBox)); 108 | } 109 | // Highlight the text pattern match! 110 | new TextMarkup(page, null, MarkupTypeEnum.Highlight, highlightQuads); 111 | } 112 | 113 | @Override 114 | public void remove( 115 | ) 116 | {throw new UnsupportedOperationException();} 117 | } 118 | ); 119 | } 120 | 121 | // 3. Highlighted file serialization. 122 | serialize(file); 123 | } 124 | } 125 | 126 | 127 | 128 | public void filter( 129 | Map> textStrings, 130 | IIntervalFilter filter 131 | ) 132 | { 133 | Iterator> textStringsIterator = textStrings.values().iterator(); 134 | if(!textStringsIterator.hasNext()) 135 | return; 136 | 137 | Iterator areaTextStringsIterator = textStringsIterator.next().iterator(); 138 | if(!areaTextStringsIterator.hasNext()) 139 | return; 140 | 141 | List textChars = areaTextStringsIterator.next().getTextChars(); 142 | int baseTextCharIndex = 0; 143 | int textCharIndex = 0; 144 | while(filter.hasNext()) 145 | { 146 | Interval interval = filter.next(); 147 | TextString match = new TextString(); 148 | { 149 | int matchStartIndex = interval.getLow(); 150 | int matchEndIndex = interval.getHigh(); 151 | while(matchStartIndex > baseTextCharIndex + textChars.size()) 152 | { 153 | baseTextCharIndex += textChars.size(); 154 | if(!areaTextStringsIterator.hasNext()) 155 | {areaTextStringsIterator = textStringsIterator.next().iterator();} 156 | textChars = areaTextStringsIterator.next().getTextChars(); 157 | } 158 | textCharIndex = matchStartIndex - baseTextCharIndex; 159 | 160 | while(baseTextCharIndex + textCharIndex < matchEndIndex) 161 | { 162 | if(textCharIndex == textChars.size()) 163 | { 164 | baseTextCharIndex += textChars.size(); 165 | if(!areaTextStringsIterator.hasNext()) 166 | {areaTextStringsIterator = textStringsIterator.next().iterator();} 167 | textChars = areaTextStringsIterator.next().getTextChars(); 168 | textCharIndex = 0; 169 | } 170 | match.textChars.add(textChars.get(textCharIndex++)); 171 | } 172 | } 173 | filter.process(interval, match); 174 | } 175 | } 176 | -------------------------------------------------------------------------------- /src/test/resources/pdfHighlightTest.txt: -------------------------------------------------------------------------------- 1 | agile_contracts_primer 2 | - Your Highlight on page 4-4 | Added on Saturday, 18 January 2014 06:17:44 3 | 4 | key difference is the approach to and understanding of operational process and delivery and how this is captured in or intersects with contracts 5 | ========== 6 | agile_contracts_primer 7 | - Your Highlight on page 4-4 | Added on Saturday, 18 January 2014 06:19:00 8 | 9 | Contracts reflect people’s hopes and, especially, fears. Successful projects are not ultimately born from contracts, but from relationships based on collaboration, transparency, and trust.‘Successful’ contracts contain mechanisms that support the building of collaboration, transparency, and trust. As trust builds between a customer and supplier, the commercial and contract model should ‘relax’ to support increasing “customer collaboration over contract negotiation. ” 10 | ========== 11 | agile_contracts_primer 12 | - Your Highlight on page 6-6 | Added on Saturday, 18 January 2014 06:23:40 13 | 14 | First, it is common that they view it as similar to a construction project—relatively predictable—rather than the highly uncertain and variable research and development that it usually is. 15 | ========== 16 | agile_contracts_primer 17 | - Your Highlight on page 7-7 | Added on Saturday, 18 January 2014 06:28:37 18 | 19 | These assumptions are invalidated in agile development. 20 | ========== 21 | agile_contracts_primer 22 | - Your Highlight on page 7-7 | Added on Saturday, 18 January 2014 06:29:25 23 | 24 | The first and perhaps most common misunderstanding is to misinterpret the agile values in terms of a false dichotomy; that is, “customer collaboration is good and contract negotiation is bad” rather than, to quote the Agile Manifesto, …while there is value in the items on the right, we value the items on the left more 25 | ========== 26 | agile_contracts_primer 27 | - Your Highlight on page 8-8 | Added on Saturday, 18 January 2014 06:31:15 28 | 29 | The very thing the contract is ultimately about, the expectation of a deliverable (for example, software that will accelerate bills to be processed), is not in the top ten issues 30 | ========== 31 | agile_contracts_primer 32 | - Your Highlight on page 9-9 | Added on Saturday, 18 January 2014 06:32:59 33 | 34 | win-win” approach is really what is mutually optimal 35 | ========== 36 | agile_contracts_primer 37 | - Your Highlight on page 9-9 | Added on Monday, 20 January 2014 08:10:38 38 | 39 | without understanding the larger impact of their choices and actions or ignoring higher-level goals of the system. 40 | ========== 41 | agile_contracts_primer 42 | - Your Highlight on page 9-9 | Added on Monday, 20 January 2014 08:11:10 43 | 44 | On this last point: Measurement and incentives not only inject dysfunction and locally optimizing behavior into project delivery, they do likewise in contract writing. If professionals in a legal department are rewarded on the basis of legal outcomes, there may be fewer legal issues—but not greater project success 45 | ========== 46 | agile_contracts_primer 47 | - Your Highlight on page 9-9 | Added on Monday, 20 January 2014 08:17:41 48 | 49 | also of the legal professionals’ ability to foster a framework for collaboration and success 50 | ========== 51 | agile_contracts_primer 52 | - Your Highlight on page 10-10 | Added on Monday, 20 January 2014 08:18:48 53 | 54 | how important are they in the larger picture of ensuring the success of the underlying focus of the contract—the project? There is an amusing story [Parkinson57] told by the British civil servant, C. Northcote Parkinson, illustrating his Law of Triviality: Time spent on any item of an agenda is inversely proportional to the cost of the item. He shares the story of a government steering committee with two items on the agenda: 1) the choice of technology for a nuclear power plant, and 2) the choice of coffee for the meetings. The government mandarins, overwhelmed by the technical complexities and science, quickly pass the technology recommendation of the advising engineer, but everybody has an opinion on the coffee—and wants to discuss it at length. A similar dynamic plays out amongst lawyers writing project contracts: There is an inverse relationship between time spent on the terms that are being negotiated and what is being dealt with on a day-to-day level during execution of the project. But there is good news with respect to negotiating issues: An agile and iterative approach can—by design—decrease risk.Therefore, pressure on negotiating “big issue” terms (such as liability) is alleviated because agile methods imply early and frequent incremental delivery of done slices of the system. The early feedback and delivery of a working system every two weeks (for example) fundamentally changes the dynamics behind negotiating some terms, whose excruciating negotiation in traditional ‘waterfall’ projects is driven by the assumption (and fear) of a long delay before delivery. One can understand how extreme pressure comes to bear on articulating terms, when viewed in the light of a big “all or nothing” delivery model. Because of the small, iterative nature of deliverables in an agile approach and the ability to stop the project at any two-week boundary (since each incrementally small slice of the system is done and potentially deployable or ‘shippable’), there should be less pressure on concepts such as liability multiples and indemnity. In The Fifth Discipline, Peter Senge states that systems thinking and a learning organization are ultimately aimed at building “…organizations where people continually expand their capacity to create results they truly desire, where new and expansive patterns of thinking are nurtured, where collec-10 55 | ========== 56 | agile_contracts_primer 57 | - Your Highlight on page 10-10 | Added on Monday, 20 January 2014 23:25:17 58 | 59 | An agile and iterative approach can—by design—decrease risk 60 | ========== 61 | agile_contracts_primer 62 | - Your Highlight on page 11-11 | Added on Monday, 20 January 2014 23:27:11 63 | 64 | …Lawyers study the impact of potentially deployable two-week increments on assumptions and contracts 65 | ========== 66 | agile_contracts_primer 67 | - Your Highlight on page 11-11 | Added on Monday, 20 January 2014 23:28:29 68 | 69 | This means that a supplier cannot fully be comfortable with the deliverable until the end of the project, and may not therefore be able to recognize total order value until the final deliverable. 70 | ========== 71 | agile_contracts_primer 72 | - Your Highlight on page 11-11 | Added on Monday, 20 January 2014 23:29:14 73 | 74 | aims to build not partial components of a project iteratively, but rather to build a deployable working model of value to the customer that can be accepted and used at each two-week iteration 75 | ========== 76 | agile_contracts_primer 77 | - Your Highlight on page 11-11 | Added on Monday, 20 January 2014 23:29:48 78 | 79 | agile model of delivering a useful deployable system after each short iteration 80 | ========== 81 | agile_contracts_primer 82 | - Your Highlight on page 12-12 | Added on Monday, 20 January 2014 23:31:23 83 | 84 | The customer has something of value that she has paid for and accepted 85 | ========== 86 | agile_contracts_primer 87 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:33:57 88 | 89 | An agile approach contemplates that requirements will be articulated in an iterative and evolutionary manner so that time and money is not wasted in developing software for requirements that are not ultimately needed 90 | ========== 91 | agile_contracts_primer 92 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:35:10 93 | 94 | money may be better spent for requirements that were not recognized at the beginning 95 | ========== 96 | agile_contracts_primer 97 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:35:34 98 | 99 | Requirements identified and developed in a sequential-development project may never be used, because they were ill-conceived or lacked effective engagement with real users. 100 | ========== 101 | agile_contracts_primer 102 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:36:00 103 | 104 | that “conforms to the contract,” requirements still need to be added to meet the true needs. From a contractual perspective, this means that a contract based on a sequential 105 | ========== 106 | agile_contracts_primer 107 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:36:24 108 | 109 | a contractual perspective, this means that a contract based on a sequential approach will actually increase 110 | ========== 111 | agile_contracts_primer 112 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:36:34 113 | 114 | From a contractual perspective, this means that a contract based on a sequential approach will actually increase the risk that the client pays more and gets less than she expects 115 | ========== 116 | agile_contracts_primer 117 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:37:35 118 | 119 | The attendant contract will not protect against this scenario but will actually promote it by incorrectly assuming that it is quite possible to define and deliver a large set of requirements without ongoing feedback and evolution of understanding. 120 | ========== 121 | agile_contracts_primer 122 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:39:20 123 | 124 | Hence, once a lawyer knows about agile principles, she will be neglectful if she does not protect her client’s interests by continuing to allow (by continuing to write traditional contracts) that client to pay for what she doesn’t need and then allowing that client to pay extra to realize what she truly needed 125 | ========== 126 | agile_contracts_primer 127 | - Your Highlight on page 14-14 | Added on Tuesday, 21 January 2014 01:03:41 128 | 129 | Heighten lawyer sensitivity to software project complexity by analogies to legal work 130 | ========== 131 | agile_contracts_primer 132 | - Your Highlight on page 14-14 | Added on Tuesday, 21 January 2014 01:04:20 133 | 134 | want a fully complete project contract for my new project: A new enterprise-wide financial management system that will probably involve around 200 development people in six countries involving four outsourcing service providers never used before, and that takes between two and four years to complete. To the exact hour, how long will it take you to negotiate and write the contract with the four providers? To the exact word count, how many words will be in the contract? What will be the exact cost?” 135 | ========== 136 | agile_contracts_primer 137 | - Your Highlight on page 15-15 | Added on Tuesday, 21 January 2014 01:05:41 138 | 139 | there is ample evidence incentives lead to increased gaming, a reduction in transparency and quality, and other dysfunctions. Research was summarized in the Organization chapter of our book Scaling Lean & Agile Development. 140 | ========== 141 | agile_contracts_primer 142 | - Your Highlight on page 16-16 | Added on Tuesday, 21 January 2014 01:12:00 143 | 144 | Contract lawyers need to understand the Definition of Done because it changes how agile contacts are framed, and how projects are done. In short, the Scrum Definition of Done defines the “doneness” of the product increment each iteration in terms of activities and artifacts 145 | ========== 146 | agile_contracts_primer 147 | - Your Highlight on page 16-16 | Added on Tuesday, 21 January 2014 01:12:34 148 | 149 | coded, integrated, functional/performance/usability tested, documented 150 | ========== 151 | agile_contracts_primer 152 | - Your Highlight on page 19-19 | Added on Tuesday, 21 January 2014 01:17:16 153 | 154 | However, the content of these topics in the contract—and legal professional’s mindset behind it—contains elements that support collaboration, learning, and evolution. 155 | ========== 156 | agile_contracts_primer 157 | - Your Highlight on page 19-19 | Added on Tuesday, 21 January 2014 01:17:53 158 | 159 | At the end of each two-week (or up to four-week) timeboxed iteration, deliver a deployable system with useful features. – it may have insufficient functionality to be of interest to deploy, but each cycle it is closer to interesting deployment 160 | ========== 161 | agile_contracts_primer 162 | - Your Highlight on page 20-20 | Added on Tuesday, 21 January 2014 01:18:24 163 | 164 | doneness and deployability—each iteration delivery is done, programmed, tested, and so on, and is in theory deployable - duration—smaller, usually two weeks - timeboxing—fixed time but variable scope 165 | ========== 166 | agile_contracts_primer 167 | - Your Highlight on page 20-20 | Added on Tuesday, 21 January 2014 01:26:10 168 | 169 | Agile contracts do not define an exact and unchanging project scope 170 | ========== 171 | agile_contracts_primer 172 | - Your Highlight on page 20-20 | Added on Tuesday, 21 January 2014 01:26:56 173 | 174 | target-cost contracts, in which the overall project scope and details are identified at the start as best as possible 175 | ========== 176 | agile_contracts_primer 177 | - Your Highlight on page 20-20 | Added on Tuesday, 21 January 2014 01:27:20 178 | 179 | progressive contracts, in which no (necessary) scope is defined beyond one iteration 180 | ========== 181 | agile_contracts_primer 182 | - Your Highlight on page 21-21 | Added on Monday, 9 March 2015 20:44:58 183 | 184 | The issue of change is largely inherently addressed within the overall philosophy of an agile approach because of a re-prioritizable backlog and adaptive iterative planning 185 | ========== 186 | agile_contracts_primer 187 | - Your Highlight on page 21-21 | Added on Monday, 9 March 2015 20:46:50 188 | 189 | change in relationships between parties 190 | ========== 191 | agile_contracts_primer 192 | - Your Highlight on page 21-21 | Added on Monday, 9 March 2015 20:47:22 193 | 194 | change in project scope – This area requires the most care in contracting, to prevent subverting the point of agile development: to make change easy and frequent in the collaboration between customer and vendor. Avoid mandating change-management boards, change requests, or special change processes. – But, as with project scope, there are variations in change-management flexibility, ranging from high flexibility without penalty when using flexible-scope progressive contracts, to medium flexibility with shared gain/pain when using target-cost models. 195 | ========== 196 | agile_contracts_primer 197 | - Your Highlight on page 21-21 | Added on Monday, 9 March 2015 20:47:50 198 | 199 | early termination should be viewed as a positive, desirable event in an agile project 200 | ========== 201 | agile_contracts_primer 202 | - Your Highlight on page 22-22 | Added on Monday, 9 March 2015 20:48:38 203 | 204 | both parties will have clear and up-to-date views on the state of the deliverable. These are crucial points for legal professionals to grasp 205 | ========== 206 | agile_contracts_primer 207 | - Your Highlight on page 22-22 | Added on Monday, 9 March 2015 20:49:45 208 | 209 | Is it done?”—“What to do if not done?”—“We have now decided to change our minds and reject the iteration delivery from three iterations ago. Do you mind 210 | ========== 211 | agile_contracts_primer 212 | - Your Highlight on page 22-22 | Added on Monday, 9 March 2015 20:50:08 213 | 214 | Clarity (in so far as practically feasible) regarding doneness, acceptance, and correction both in the minds of the parties and the contract language should be a leading concern for legal professionals 215 | ========== 216 | agile_contracts_primer 217 | - Your Highlight on page 22-22 | Added on Monday, 9 March 2015 20:50:24 218 | 219 | negotiating a contractual framework for acceptance that encourages collaboration 220 | ========== 221 | agile_contracts_primer 222 | - Your Highlight on page 22-22 | Added on Monday, 9 March 2015 20:51:14 223 | 224 | only the framework for acceptance must be contractually clear 225 | ========== 226 | agile_contracts_primer 227 | - Your Highlight on page 22-22 | Added on Monday, 9 March 2015 20:51:53 228 | 229 | Legal professionals concerned with a successful project should ask, “Are the right people—the hands-on users—involved in acceptance, and at each iteration are they collaborating with the supplier?” 22 230 | ========== 231 | agile_contracts_primer 232 | - Your Highlight on page 23-23 | Added on Monday, 9 March 2015 20:52:24 233 | 234 | Sample clauses 235 | ========== 236 | agile_contracts_primer 237 | - Your Highlight on page 24-24 | Added on Monday, 9 March 2015 21:02:09 238 | 239 | an agile approach, the same problematic bills could be sent. But it is also possible that those bills would be sent early to a much smaller subset of customers, using an early release of the system with just-sufficient functionality to field-test this critical feature 240 | ========== 241 | agile_contracts_primer 242 | - Your Highlight on page 24 | Added on Monday, 9 March 2015 21:02:55 243 | 244 | Warranty 245 | ========== 246 | agile_contracts_primer 247 | - Your Highlight on page 24-24 | Added on Monday, 9 March 2015 21:03:38 248 | 249 | leads to an increase in waste activities rather than a focus on working software, and there is a presumption—possibly untrue—of knowing what artifacts are valuable. - There is a focus on negotiating and conforming to “quality plans” rather than cooperating to create useful software24 250 | ========== 251 | agile_contracts_primer 252 | - Your Highlight on page 25-25 | Added on Monday, 9 March 2015 21:04:46 253 | 254 | reinforces (the illusory) command-control predictive-planning mindset rather than learning and responding to change. - It reinforces the (untrue) belief that a fully defined system can be predictably ordered and delivered as though it were a meal in a restaurant rather than creative discovery work. 255 | ========== 256 | agile_contracts_primer 257 | - Your Highlight on page 25-25 | Added on Tuesday, 10 March 2015 10:14:33 258 | 259 | On occasion, technical documentation to support maintenance is valuable 260 | ========== 261 | agile_contracts_primer 262 | - Your Highlight on page 25-25 | Added on Tuesday, 10 March 2015 10:15:36 263 | 264 | could be wasteful to require it as an early deliverable. 265 | ========== 266 | agile_contracts_primer 267 | - Your Highlight on page 25-25 | Added on Tuesday, 10 March 2015 10:16:21 268 | 269 | after the system is finished. 270 | ========== 271 | agile_contracts_primer 272 | - Your Highlight on page 25-25 | Added on Tuesday, 10 March 2015 10:16:52 273 | 274 | Timing of Payment 275 | ========== 276 | agile_contracts_primer 277 | - Your Highlight on page 26-26 | Added on Tuesday, 10 March 2015 10:19:51 278 | 279 | Fixed price per iteration (per unit of time 280 | ========== 281 | agile_contracts_primer 282 | - Your Highlight on page 26-26 | Added on Tuesday, 10 March 2015 10:21:09 283 | 284 | key issue (or cost) for customers is that the supplier adds a contingency fee to the rate because of the risk associated with variability in research and development work. 285 | ========== 286 | agile_contracts_primer 287 | - Your Highlight on page 27-27 | Added on Tuesday, 10 March 2015 10:23:51 288 | 289 | pay-per-use contracts with their customers 290 | ========== 291 | agile_contracts_primer 292 | - Your Highlight on page 29-29 | Added on Tuesday, 10 March 2015 10:25:51 293 | 294 | Avoid…Fixed-price, fixed-scope (FPFS) contracts 295 | ========== 296 | agile_contracts_primer 297 | - Your Highlight on page 29-29 | Added on Tuesday, 10 March 2015 10:29:10 298 | 299 | suppliers can easily lose money. And in an effort to deliver something within the constraints of price and scope, suppliers will often degrade the quality of their work 300 | ========== 301 | agile_contracts_primer 302 | - Your Highlight on page 30-30 | Added on Tuesday, 10 March 2015 10:30:42 303 | 304 | supplier generates further revenue—in India, outsourcers call this ‘rent’—through a series of follow-on change requests, each for an additional cost beyond the original fixed price 305 | ========== 306 | agile_contracts_primer 307 | - Your Highlight on page 31-31 | Added on Tuesday, 10 March 2015 10:34:41 308 | 309 | Do not allow any changes in requirements or scope, or only allow new requirements to displace existing requirements if they are of equal effort 310 | ========== 311 | agile_contracts_primer 312 | - Your Highlight on page 31-31 | Added on Tuesday, 10 March 2015 10:35:05 313 | 314 | Increase the margin of the contract price, to reflect the significant risk inherent in FPFS software development—a domain that is fraught with discovery, variability, and nasty surprises. - Employ experienced domain experts with towering technical excellence 315 | ========== 316 | agile_contracts_primer 317 | - Your Highlight on page 31-31 | Added on Tuesday, 10 March 2015 10:36:26 318 | 319 | displace existing requirements with new ones of equal effort 320 | ========== 321 | agile_contracts_primer 322 | - Your Highlight on page 31-31 | Added on Tuesday, 10 March 2015 10:36:50 323 | 324 | Customer may request additional releases at any time, priced with T&M. 325 | ========== 326 | agile_contracts_primer 327 | - Your Highlight on page 32-32 | Added on Tuesday, 10 March 2015 10:37:21 328 | 329 | Customer may terminate early if satisfied early, for a payment to supplier of 20% of remaining unbilled value 330 | ========== 331 | agile_contracts_primer 332 | - Your Highlight on page 32-32 | Added on Tuesday, 10 March 2015 10:37:44 333 | 334 | There is evidence that sequential life cycle development is correlated with higher cost, slower delivery, lower productivity, more defects, or higher failure rates, compared with iterative, incremental, or agile methods 335 | ========== 336 | agile_contracts_primer 337 | - Your Highlight on page 33-33 | Added on Tuesday, 10 March 2015 10:39:13 338 | 339 | Try…Variable-price variable-scope progressive contracts 340 | ========== 341 | agile_contracts_primer 342 | - Your Highlight on page 33-33 | Added on Tuesday, 10 March 2015 10:43:51 343 | 344 | Contract Evolution on a Large Agile Project 345 | ========== 346 | agile_contracts_primer 347 | - Your Highlight on page 34-34 | Added on Tuesday, 10 March 2015 10:48:28 348 | 349 | the goals for iteration N are clarified during iteration N-2 350 | ========== 351 | agile_contracts_primer 352 | - Your Highlight on page 34-34 | Added on Tuesday, 10 March 2015 10:48:55 353 | 354 | price variable-scope progressive contract is common; there is an overall project price cap 355 | ========== 356 | agile_contracts_primer 357 | - Your Highlight on page 34-34 | Added on Tuesday, 10 March 2015 10:49:16 358 | 359 | This backlog is included as an appendix to the contract.However, it is agreed that nothing in the original backlog is binding 360 | ========== 361 | agile_contracts_primer 362 | - Your Highlight on page 35-35 | Added on Tuesday, 10 March 2015 10:49:59 363 | 364 | frequent pattern (not a recommendation) is 1. 2.early contracts that are variations of fixed price and fixed scope later, a shift to progressive contracts with simple T&M or capped T&M per iteration 365 | ========== 366 | agile_contracts_primer 367 | - Your Highlight on page 35-35 | Added on Tuesday, 10 March 2015 10:54:43 368 | 369 | …Increase flexibility in project and contract variables 370 | ========== 371 | agile_contracts_primer 372 | - Your Highlight on page 35-35 | Added on Tuesday, 10 March 2015 11:12:29 373 | 374 | If trust is low, customers can bound their risk (and fear) by using a series of short-duration, flexible contracts. For example, one year-long, fixed-price, fixed-date, variable-scope contract may be viewed with trepidation. But a series of two-month, fixed-price, fixed-date, variable-scope contracts—with the ability to terminate at the end any cycle—is more palatable 375 | ========== 376 | Plano de Negócios_Como Elaborar_Sebrae_2013 377 | - Your Highlight on page 19-19 | Added on Friday, 13 March 2015 16:28:25 378 | 379 | sumário contendo seus pontos mais importantes 380 | ========== 381 | Plano de Negócios_Como Elaborar_Sebrae_2013 382 | - Your Highlight on page 19-19 | Added on Friday, 13 March 2015 16:28:43 383 | 384 | Missão da empresa 385 | ========== 386 | agile_contracts_primer 387 | - Your Highlight on page 36-36 | Added on Monday, 16 March 2015 13:54:35 388 | 389 | They are used in Toyota with their suppliers, reflecting the pillar of respect for people in lean thinking 390 | ========== 391 | agile_contracts_primer 392 | - Your Highlight on page 36-36 | Added on Monday, 16 March 2015 13:55:06 393 | 394 | target-cost contracts must realistically account for overall effort and cost as best as possible.20. That usually means placing requirement-related risks (‘what’) in the hands of the customer, and placing implementation and technical-related risks (‘how’) in the hands of the supplier36 395 | ========== 396 | agile_contracts_primer 397 | - Your Highlight on page 37-37 | Added on Monday, 16 March 2015 13:57:17 398 | 399 | As will be seen, Adjustment may be positive or negative 400 | ========== 401 | agile_contracts_primer 402 | - Your Highlight on page 39-39 | Added on Monday, 16 March 2015 14:02:28 403 | 404 | One Valtech multi-phase variable-model example reflects the common Scrum pattern 405 | ========== -------------------------------------------------------------------------------- /src/test/resources/MyClippings.txt: -------------------------------------------------------------------------------- 1 | CONDICIONAL - 1ª revisao.docx 2 | - Your Bookmark on Page 9 | Added on Saturday, 21 September 13 00:20:29 3 | 4 | 5 | ========== 6 | CONDICIONAL - 1ª revisao.docx 7 | - Your Note on Page 12 | Added on Saturday, 21 September 13 00:25:32 8 | 9 | untroducao muito boa.seduzivel enquanto falq de sefucao 10 | ========== 11 | CONDICIONAL - 1ª revisao.docx 12 | - Your Highlight on Page 12-12 | Added on Saturday, 21 September 13 00:25:32 13 | 14 | que são seduzíveis. Conheci tantas pessoas que ficavam me encarando sem dizer nada e eu tinha certeza que, no fundo, elas deviam interiorizar o questionamento sobre o tipo de cara que eu deveria ser, mas elas nunca me perguntaram diretamente e imagino que era por medo de que eu acabasse sendo sincero. “Você é bonito, mas devo confiar em você?” – Não! Naquela época eu diria que não rapidamente para facilitar o desapego. Não me recordo de pelo menos uma vez na vida ter sido questionado. Simplesmente não queriam saber. Deixavam pra descobrir tentando a sorte... Sou o Lucas. Já ia quase me esquecendo. Fico empolgado quando começo a me descrever e me desconstruir a ponto até de achar dispensáveis as apresentações formais. Penso que é interessante começar assim com ar prepotente e cheio de mim, pois, talvez ninguém fosse ler minha história procurando também se perguntar “Devo confiar nele?”caso eu começasse com papo furado vendendo uma imagem hipócrita para agradar. Neste caso, me revelo te 11 15 | ========== 16 | Magento PHP Developer's Guide 17 | - Your Bookmark on Page 67 | Added on Saturday, 28 September 13 14:09:35 18 | 19 | 20 | ========== 21 | Magento PHP Developer's Guide 22 | - Your Bookmark on Page 67 | Added on Saturday, 28 September 13 14:09:49 23 | 24 | 25 | ========== 26 | Magento PHP Developer's Guide 27 | - Your Bookmark on Page 67 | Added on Saturday, 28 September 13 14:09:51 28 | 29 | 30 | ========== 31 | Magento PHP Developer's Guide 32 | - Your Bookmark on Page 65 | Added on Saturday, 28 September 13 14:10:03 33 | 34 | 35 | ========== 36 | Magento PHP Developer's Guide 37 | - Your Bookmark on Page 3 | Added on Saturday, 28 September 13 14:10:26 38 | 39 | 40 | ========== 41 | Magento PHP Developer's Guide 42 | - Your Bookmark on Page 3 | Added on Saturday, 28 September 13 14:10:29 43 | 44 | 45 | ========== 46 | Magento PHP Developer's Guide 47 | - Your Bookmark on Page 32 | Added on Saturday, 28 September 13 16:52:56 48 | 49 | 50 | ========== 51 | Magento Beginner’s Guide Second Edition (Ravensbergen, Robbert;Schoneville, Sander) 52 | - Your Bookmark Location 2722 | Added on Saturday, 28 September 13 16:54:25 53 | 54 | 55 | ========== 56 | Magento PHP Developer's Guide 57 | - Your Bookmark on Page 4 | Added on Saturday, 28 September 13 18:12:11 58 | 59 | 60 | ========== 61 | Magento PHP Developer's Guide 62 | - Your Bookmark on Page 111 | Added on Monday, 30 September 13 08:35:34 63 | 64 | 65 | ========== 66 | Mastering the SPL Library (Joshua Thijssen) 67 | - Your Highlight Location 362-362 | Added on Monday, 30 September 13 19:03:43 68 | 69 | DJBX33A 70 | ========== 71 | Mastering the SPL Library (Joshua Thijssen) 72 | - Your Highlight Location 362-362 | Added on Monday, 30 September 13 19:04:17 73 | 74 | The algorithm used is called DJBX33A which returns a bucket number (a number between 75 | ========== 76 | Mastering the SPL Library (Joshua Thijssen) 77 | - Your Highlight Location 362-362 | Added on Monday, 30 September 13 19:04:31 78 | 79 | The algorithm used is called DJBX33A 80 | ========== 81 | Mastering the SPL Library (Joshua Thijssen) 82 | - Your Highlight Location 451-452 | Added on Monday, 30 September 13 19:08:10 83 | 84 | makes linked lists very memory efficient data structures with very fast insert/delete capabilities. 85 | ========== 86 | Mastering the SPL Library (Joshua Thijssen) 87 | - Your Highlight Location 460-462 | Added on Monday, 30 September 13 19:09:17 88 | 89 | SplDoublyLinkedLists is a perfect way to save memory while still being able to use (most) array functionality. Its main purpose is to iterate over elements in a sequential way, either forwards or backwards. Do not use this data structure when you are planning to do mostly random reads. 90 | ========== 91 | Mastering the SPL Library (Joshua Thijssen) 92 | - Your Highlight Location 572-572 | Added on Monday, 30 September 13 19:13:23 93 | 94 | Dealing with SplHeap Corruptions 95 | ========== 96 | Mastering the SPL Library (Joshua Thijssen) 97 | - Your Highlight Location 786-786 | Added on Monday, 30 September 13 19:42:57 98 | 99 | This can be done by the spl_object_hash() function. 100 | ========== 101 | Mastering the SPL Library (Joshua Thijssen) 102 | - Your Highlight Location 788-789 | Added on Monday, 30 September 13 19:43:33 103 | 104 | The SplObjectStorage allows you to directly add an object as key without hashing it manually. 105 | ========== 106 | Mastering the SPL Library (Joshua Thijssen) 107 | - Your Highlight Location 790-791 | Added on Monday, 30 September 13 19:44:28 108 | 109 | splObjectStorage also can be used for “sets”. 110 | ========== 111 | Mastering the SPL Library (Joshua Thijssen) 112 | - Your Highlight Location 806-807 | Added on Monday, 30 September 13 19:45:17 113 | 114 | Use this class when you need to maintain a (large) set of objects. 115 | ========== 116 | Mastering the SPL Library (Joshua Thijssen) 117 | - Your Highlight Location 1104-1105 | Added on Monday, 30 September 13 23:42:06 118 | 119 | But the CachingIterator is much more than a simple “lookahead” iterator. It’s second feature is that it is possible to let the iterator “cache” all the values it returns. This 120 | ========== 121 | Mastering the SPL Library (Joshua Thijssen) 122 | - Your Highlight Location 1193-1194 | Added on Monday, 30 September 13 23:50:28 123 | 124 | you need to clone() the objects if you are going to reuse them outside your iterator foreach() loop: 125 | ========== 126 | Mastering the SPL Library (Joshua Thijssen) 127 | - Your Highlight Location 1209-1209 | Added on Monday, 30 September 13 23:58:28 128 | 129 | FilesystemIterator 130 | ========== 131 | Mastering the SPL Library (Joshua Thijssen) 132 | - Your Highlight Location 1333-1334 | Added on Tuesday, 1 October 13 08:53:42 133 | 134 | The IteratorIterator can create an iterator out from anything that has implemented traversable. 135 | ========== 136 | Mastering the SPL Library (Joshua Thijssen) 137 | - Your Highlight Location 1354-1354 | Added on Tuesday, 1 October 13 08:57:08 138 | 139 | MultipleIterator 140 | ========== 141 | Mastering the SPL Library (Joshua Thijssen) 142 | - Your Highlight Location 1397-1398 | Added on Tuesday, 1 October 13 08:58:56 143 | 144 | This iterator is useful for filtering out elements that CAN be recursed. 145 | ========== 146 | Mastering the SPL Library (Joshua Thijssen) 147 | - Your Highlight Location 1474-1476 | Added on Tuesday, 1 October 13 09:05:09 148 | 149 | The purpose of the RecursiveIteratorIterator is to turn any RecursiveIterator into a “plain” iterator so you can traverse it linearly even though the data is recursive 150 | ========== 151 | Mastering the SPL Library (Joshua Thijssen) 152 | - Your Highlight Location 1508-1508 | Added on Tuesday, 1 October 13 09:06:14 153 | 154 | Iteration Hooks 155 | ========== 156 | Mastering the SPL Library (Joshua Thijssen) 157 | - Your Highlight Location 1527-1527 | Added on Tuesday, 1 October 13 09:07:48 158 | 159 | RecursiveTreeIterator 160 | ========== 161 | Mastering the SPL Library (Joshua Thijssen) 162 | - Your Highlight Location 1527-1527 | Added on Tuesday, 1 October 13 09:07:57 163 | 164 | really easy way to create tree-like ASCII structures. 165 | ========== 166 | Mastering the SPL Library (Joshua Thijssen) 167 | - Your Highlight Location 1693-1693 | Added on Tuesday, 1 October 13 09:13:32 168 | 169 | This is only possible by interfaces defined by PHP itself, since they are written in C 170 | ========== 171 | Mastering the SPL Library (Joshua Thijssen) 172 | - Your Highlight Location 1693-1694 | Added on Tuesday, 1 October 13 09:13:45 173 | 174 | It is not possible for you to create this kind of functionality, unless you implement them as PHP extensions or directly in the PHP core. 175 | ========== 176 | Mastering the SPL Library (Joshua Thijssen) 177 | - Your Highlight Location 1722-1724 | Added on Tuesday, 1 October 13 09:15:26 178 | 179 | Do not try to check if an object is traversable by checking for Iterator or IteratorAggregate directly, but use the Traversable interface instead. 180 | ========== 181 | Mastering the SPL Library (Joshua Thijssen) 182 | - Your Highlight Location 1841-1842 | Added on Tuesday, 1 October 13 09:19:36 183 | 184 | will not call __destruct() prior to the actual serialization. If you need this functionality, you need to add it yourself. 185 | ========== 186 | Mastering the SPL Library (Joshua Thijssen) 187 | - Your Highlight Location 1974-1974 | Added on Tuesday, 1 October 13 09:29:53 188 | 189 | SplObserver and SplSubject 190 | ========== 191 | Mastering the SPL Library (Joshua Thijssen) 192 | - Your Highlight Location 2049-2049 | Added on Tuesday, 1 October 13 09:33:32 193 | 194 | “failure-first” principle. 195 | ========== 196 | Mastering the SPL Library (Joshua Thijssen) 197 | - Your Highlight Location 2141-2142 | Added on Tuesday, 1 October 13 09:37:49 198 | 199 | Domain exceptions should reflect the working of your domain instead of the inner workings. 200 | ========== 201 | Mastering the SPL Library (Joshua Thijssen) 202 | - Your Highlight Location 2143-2143 | Added on Tuesday, 1 October 13 09:38:02 203 | 204 | should be extended to reflect a more detailed exception. 205 | ========== 206 | Mastering the SPL Library (Joshua Thijssen) 207 | - Your Highlight Location 2190-2191 | Added on Tuesday, 1 October 13 11:19:05 208 | 209 | Always look for a better suited (logic)exception, since you should throw that particular exception instead of this one. 210 | ========== 211 | Mastering the SPL Library (Joshua Thijssen) 212 | - Your Highlight Location 2386-2387 | Added on Tuesday, 1 October 13 19:29:59 213 | 214 | This would imply that you would register the autoloaders that will load the most classes as early as possible in the queue (you can prepend the autoloaders if needed). 215 | ========== 216 | Mastering the SPL Library (Joshua Thijssen) 217 | - Your Highlight Location 2427-2428 | Added on Tuesday, 1 October 13 19:31:54 218 | 219 | following the PSR-0 can be considered as best practice to ensure maximal interoperability between your code and others, now and in the future. 220 | ========== 221 | expert_php_5_tools 222 | - Your Highlight on Page 333-333 | Added on Tuesday, 1 October 13 19:44:26 223 | 224 | I usually redirect users temporarily to a generic HTML page that informs them that the server is undergoing maintenance and that they should retry their request in a couple of minutes. 225 | ========== 226 | expert_php_5_tools 227 | - Your Highlight on Page 333-333 | Added on Tuesday, 1 October 13 19:45:24 228 | 229 | On systems that support symbolic links (or aliases or shortcuts), it is good practice to have a symlink that points to the directory containing the application files. When it is time to upgrade, you merely have to point the symlink at a different directory and the new files become visible instantly[ 333 ] 230 | ========== 231 | expert_php_5_tools 232 | - Your Highlight on Page 334-334 | Added on Tuesday, 1 October 13 20:12:02 233 | 234 | DbDeploy 235 | ========== 236 | Speed Reading: Easily 5X Your Reading Speed And Comprehension Immediately (Dunar, Michael) 237 | - Your Highlight Location 136-139 | Added on Wednesday, 2 October 13 08:52:31 238 | 239 | Refrain from thinking of another thing while reading – having something else in your awareness aside from what you are reading will result in reading at a slower pace as well as a slower processing of information. If you think that you have to do something, attend to it immediately. It will be more counter-productive if what you’re doing is not aligned with what you’re thinking. 240 | ========== 241 | Speed Reading: Easily 5X Your Reading Speed And Comprehension Immediately (Dunar, Michael) 242 | - Your Highlight Location 140-143 | Added on Wednesday, 2 October 13 08:53:02 243 | 244 | Do not take a mini-break – if you’ve decided to allot one hour for your reading, make sure that you read for the duration of that time. Do not take short breaks. Even a 30-second break can destroy your focus; and according to some researches, it can take at least 15 minutes to get your focus back on that particular activity. 245 | ========== 246 | Speed Reading: Easily 5X Your Reading Speed And Comprehension Immediately (Dunar, Michael) 247 | - Your Highlight Location 369-369 | Added on Wednesday, 2 October 13 09:10:21 248 | 249 | the exercise ten times for each eye. 250 | ========== 251 | Speed Reading: Easily 5X Your Reading Speed And Comprehension Immediately (Dunar, Michael) 252 | - Your Highlight Location 424-425 | Added on Wednesday, 2 October 13 09:13:48 253 | 254 | For readers, these two portions in a paragraph are essential to inform them of its content. 255 | ========== 256 | Machine of Death: A collection of stories about people who know how they will die (North, Ryan) 257 | - Your Highlight on Page 247 | Location 3201-3211 | Added on Thursday, 3 October 13 08:59:20 258 | 259 | hand. Karen smokes a cigarette and looks at nothing.  There passes several moments when no one speaks, which I can only describe as uncomfortable. The Spandex guy suddenly remembers the friends he left at the other end of the bar, and returns to them in a single bound or so. Aimee, I notice, has scratched out “NEVER” on her tag and written in “BOREDOM.” I am glad to have a drink because it gives me something to do with my hands.  Later, I am taking a deep breath, preparing to say something, anything, when the band starts up again—incredibly loud. Which is how I know Jill’s phone was probably on vibrate. She leans forward on the barstool, holding the phone to one ear and plugging the other with a finger. A deep crease begins to form between her eyebrows. Suddenly, still bent forward in that same position, she bolts. “Don’t—!” I hear her yelling into the phone as she darts headlong through the crowd.    I look to the other girls. “What an asshole,” Liza says, turning to Aimee. “Brian’s tag should read, ‘Crushed Under Own Ego.’” “‘Being a Total Dickweed,’” Aimee replies. Karen exhales a cloud of grey smoke. “‘Cock Suckery.’”  I have been trying to follow this exchange arcing back and forth over my head like a lethal volleyball. “Really?” I say 260 | ========== 261 | Machine of Death: A collection of stories about people who know how they will die (North, Ryan) 262 | - Your Highlight on Page 249 | Location 3238-3238 | Added on Thursday, 3 October 13 09:02:27 263 | 264 | private and reverent about these things. They don’t wear tags. 265 | ========== 266 | Machine of Death: A collection of stories about people who know how they will die (North, Ryan) 267 | - Your Bookmark on Page 325 | Location 4248 | Added on Sunday, 6 October 13 14:24:56 268 | 269 | 270 | ========== 271 | Machine of Death: A collection of stories about people who know how they will die (North, Ryan) 272 | - Your Bookmark on Page 333 | Location 4336 | Added on Sunday, 6 October 13 15:00:30 273 | 274 | 275 | ========== 276 | Machine of Death: A collection of stories about people who know how they will die (North, Ryan) 277 | - Your Highlight on Page 367 | Location 4776-4777 | Added on Sunday, 6 October 13 19:10:46 278 | 279 | Masks are for daylight—once dusk hits, it’s the moon’s turf, and she likes us naked, naked, naked, just the way she made us. 280 | ========== 281 | Orange Is the New Black: My Time in a Women's Prison (Kerman, Piper) 282 | - Your Bookmark Location 69 | Added on Friday, 18 October 13 17:17:59 283 | 284 | 285 | ========== 286 | Orange Is the New Black: My Time in a Women's Prison (Kerman, Piper) 287 | - Your Highlight Location 855-855 | Added on Friday, 18 October 13 17:22:22 288 | 289 | sale 290 | ========== 291 | Orange Is the New Black: My Time in a Women's Prison (Kerman, Piper) 292 | - Your Highlight Location 874-874 | Added on Friday, 18 October 13 17:25:56 293 | 294 | room at 295 | ========== 296 | Orange Is the New Black: My Time in a Women's Prison (Kerman, Piper) 297 | - Your Highlight Location 874-874 | Added on Friday, 18 October 13 17:30:28 298 | 299 | room at my 300 | ========== 301 | expert_php_5_tools 302 | - Your Bookmark on Page x | Added on Thursday, 24 October 13 08:53:10 303 | 304 | 305 | ========== 306 | expert_php_5_tools 307 | - Your Bookmark on Page x | Added on Thursday, 24 October 13 08:53:33 308 | 309 | 310 | ========== 311 | expert_php_5_tools 312 | - Your Bookmark on Page 4 | Added on Thursday, 24 October 13 08:54:56 313 | 314 | 315 | ========== 316 | expert_php_5_tools 317 | - Your Bookmark on Page 4 | Added on Thursday, 24 October 13 08:56:27 318 | 319 | 320 | ========== 321 | O Hobbit (J. R. R. Tolkien) 322 | - Your Bookmark Location 357 | Added on Monday, 4 November 13 17:13:14 323 | 324 | 325 | ========== 326 | The Healthy Programmer 327 | - Your Bookmark on Page 133 | Added on Tuesday, 5 November 13 17:38:08 328 | 329 | 330 | ========== 331 | The Healthy Programmer 332 | - Your Highlight on Page 24-24 | Added on Tuesday, 5 November 13 18:00:16 333 | 334 | What did I do yesterday to improve my health? • What will I do today to improve my health? • Is there anything blocking me from staying healthy? 335 | ========== 336 | O Hobbit (J. R. R. Tolkien) 337 | - Your Bookmark Location 1046 | Added on Monday, 18 November 13 19:22:06 338 | 339 | 340 | ========== 341 | programming_scala 342 | - Your Highlight on Page 77-77 | Added on Monday, 9 December 13 14:52:01 343 | 344 | structural type of 345 | ========== 346 | programming_scala 347 | - Your Bookmark on Page 112 | Added on Friday, 27 December 13 14:49:34 348 | 349 | 350 | ========== 351 | the_wordpress_anthology 352 | - Your Bookmark on Page xvii | Added on Tuesday, 4 February 14 11:05:45 353 | 354 | 355 | ========== 356 | the_wordpress_anthology 357 | - Your Highlight on Page 243-243 | Added on Tuesday, 4 February 14 11:16:00 358 | 359 | load_theme_textdomain() for themes, or load_plugin_textdomain() for 360 | ========== 361 | the_wordpress_anthology 362 | - Your Highlight on Page 250-250 | Added on Tuesday, 4 February 14 11:27:34 363 | 364 | With theme localizations, you’ll want to name your . MO file in the format of locale.mo. For example, in translating your theme to German, your theme translation file in the languages directory within your theme should be named de_DE.mo. On the other hand, if you’re localizing a plugin, WordPress will seek the translation 365 | ========== 366 | the_wordpress_anthology 367 | - Your Highlight on Page 250-250 | Added on Tuesday, 4 February 14 11:27:43 368 | 369 | With theme localizations, you’ll want to name your . MO file in the format of locale.mo. For example, in translating your theme to German, your theme translation file in the languages directory within your theme should be named de_DE.mo. On the other hand, if you’re localizing a plugin, WordPress will seek the translation file in your specified languages directory within your plugin in the format of pluginname-locale.mo. In this 370 | ========== 371 | the_wordpress_anthology 372 | - Your Highlight on Page 257-257 | Added on Tuesday, 4 February 14 11:31:24 373 | 374 | This is the tricky part—and essential for creating a . POT file with Poedit. Before you do anything else here, save the file a second time. The reason this is necessary is that when Poedit initially creates the . PO file, it saves the file first and then imports the translatable strings. If you fail to save the file a second time and close it, you'll end up with a blank . PO file that has no translatable strings, thus defeating the purpose. Once you save your . PO file a second time as in Figure 11.11 (with your translatable strings added), close the file and quit Poedit. Don't worry—we’ll be right back 375 | ========== 376 | the_wordpress_anthology 377 | - Your Highlight on Page 53-53 | Added on Tuesday, 4 February 14 11:58:37 378 | 379 | Role Scoper 380 | ========== 381 | the_wordpress_anthology 382 | - Your Bookmark on Page 83 | Added on Tuesday, 4 February 14 12:53:51 383 | 384 | 385 | ========== 386 | the_wordpress_anthology 387 | - Your Bookmark on Page 82 | Added on Tuesday, 4 February 14 12:53:58 388 | 389 | 390 | ========== 391 | the_wordpress_anthology 392 | - Your Highlight on Page 82-82 | Added on Tuesday, 4 February 14 12:54:22 393 | 394 | The Basics of register_post_type() 395 | ========== 396 | node_up_and_running 397 | - Your Highlight on Page 31-31 | Added on Tuesday, 4 February 14 14:37:24 398 | 399 | Because they get passed an array, they will repeat for each item in the array 400 | ========== 401 | node_up_and_running 402 | - Your Highlight on Page 31-31 | Added on Tuesday, 4 February 14 14:37:43 403 | 404 | The template called chirp accesses its data in a variable of the same name. In this case, the data is simple strings, but if we passed in an array of objects, we could do chirp .property or chirp['property'] to access the properties of the objects 405 | ========== 406 | node_up_and_running 407 | - Your Highlight on Page 34-34 | Added on Tuesday, 4 February 14 14:49:17 408 | 409 | it’s “single-threaded” so that only one thing happens at once. 410 | ========== 411 | node_up_and_running 412 | - Your Highlight on Page 37-37 | Added on Tuesday, 4 February 14 14:54:10 413 | 414 | event-driven architectures don’t add anything. If all (or most) of the work your server does is computation 415 | ========== 416 | node_up_and_running 417 | - Your Highlight on Page 40-40 | Added on Tuesday, 4 February 14 15:00:21 418 | 419 | Once setup has been completed, make all actions event-driven. • If Node.js is required to process something that will take a long time, consider delegating it to web workers 420 | ========== 421 | node_up_and_running 422 | - Your Highlight on Page 46-46 | Added on Tuesday, 4 February 14 15:12:03 423 | 424 | An error during the GET cannot be caught by a try/catch block 425 | ========== 426 | node_up_and_running 427 | - Your Highlight on Page 47-47 | Added on Tuesday, 4 February 14 15:13:24 428 | 429 | the error event catches all kinds of exceptions 430 | ========== 431 | node_up_and_running 432 | - Your Highlight on Page 47-47 | Added on Tuesday, 4 February 14 15:14:57 433 | 434 | Node provides a module called cluster that allows you to delegate work to child processes. This means that Node creates a copy of its current program in another process 435 | ========== 436 | node_up_and_running 437 | - Your Highlight on Page 48-48 | Added on Tuesday, 4 February 14 15:17:34 438 | 439 | cluster provides a cross-platform way to invoke several processes that share a socket 440 | ========== 441 | node_up_and_running 442 | - Your Highlight on Page 56-56 | Added on Wednesday, 5 February 14 09:31:46 443 | 444 | EventEmitter has a handful of methods, the main two being on and emit 445 | ========== 446 | node_up_and_running 447 | - Your Highlight on Page 56-56 | Added on Wednesday, 5 February 14 09:32:43 448 | 449 | utils module so we can use the inherits method. inherits provides a way for the EventEmitter class to add its methods to the Server class we created 450 | ========== 451 | node_up_and_running 452 | - Your Highlight on Page 59-59 | Added on Wednesday, 5 February 14 09:36:40 453 | 454 | Consequently, the this variable must be passed in as a parameter and assigned to a variable if we wish to make use of it in event callback functions. 455 | ========== 456 | node_up_and_running 457 | - Your Highlight on Page 65-65 | Added on Wednesday, 5 February 14 09:46:05 458 | 459 | The URL module provides tools for easily parsing and dealing with URL strings 460 | ========== 461 | node_up_and_running 462 | - Your Highlight on Page 68-68 | Added on Wednesday, 5 February 14 09:57:04 463 | 464 | Another important part of querystring is encode 465 | ========== 466 | node_up_and_running 467 | - Your Highlight on Page 71-71 | Added on Wednesday, 5 February 14 10:31:11 468 | 469 | Buffer provides direct memory access 470 | ========== 471 | node_up_and_running 472 | - Your Highlight on Page 74-74 | Added on Wednesday, 5 February 14 10:46:42 473 | 474 | So when you are building really highly scalable apps, it’s often worth using Buffers to hold strings 475 | ========== 476 | node_up_and_running 477 | - Your Highlight on Page 79-79 | Added on Wednesday, 5 February 14 10:55:11 478 | 479 | Node uses the OpenSSL library as the basis of its cryptography. This 480 | ========== 481 | node_up_and_running 482 | - Your Highlight on Page 79-79 | Added on Wednesday, 5 February 14 10:55:26 483 | 484 | you have to compile Node with OpenSSL support in order to use the methods in this section 485 | ========== 486 | node_up_and_running 487 | - Your Highlight on Page 81-81 | Added on Wednesday, 5 February 14 11:02:15 488 | 489 | When we call hash.digest() again, we get an error. This is because once hash.digest() is called, the Hash object is finalized and cannot be reused. We need to create a new instance of Hash and use that instead. This time we get the hex output that is often more useful. The options for hash.digest() output are binary (default), hex, and base64 490 | ========== 491 | node_up_and_running 492 | - Your Highlight on Page 81-81 | Added on Wednesday, 5 February 14 11:03:18 493 | 494 | The HMAC API in Node is virtually identical to the Hash API. The only difference is that the creation of an hmac object requires a key as well as a hash algorithm 495 | ========== 496 | node_up_and_running 497 | - Your Highlight on Page 81-81 | Added on Wednesday, 5 February 14 11:03:45 498 | 499 | The key required to create an Hmac object is a PEM-encoded key, passed as a string 500 | ========== 501 | node_up_and_running 502 | - Your Highlight on Page 87-87 | Added on Wednesday, 5 February 14 11:06:31 503 | 504 | event loop will not run after the exit event, so only code without callbacks will be executed. 505 | ========== 506 | node_up_and_running 507 | - Your Highlight on Page 87-87 | Added on Wednesday, 5 February 14 11:07:03 508 | 509 | The uncaughtException event provides an extremely brute-force way of catching these exceptions. It’s really a last line of defense, but it’s extremely useful for that purpose. 510 | ========== 511 | node_up_and_running 512 | - Your Highlight on Page 91-91 | Added on Wednesday, 5 February 14 15:51:04 513 | 514 | Before attempting to read from stdin, call its resume() method 515 | ========== 516 | node_up_and_running 517 | - Your Highlight on Page 92-92 | Added on Wednesday, 5 February 14 16:46:30 518 | 519 | generally inadvisable to write a lot to stderr in a production system, because it may block real work 520 | ========== 521 | node_up_and_running 522 | - Your Highlight on Page 92-92 | Added on Wednesday, 5 February 14 16:46:49 523 | 524 | process.stderr is always a UTF-8 stream 525 | ========== 526 | node_up_and_running 527 | - Your Highlight on Page 92-92 | Added on Wednesday, 5 February 14 16:47:11 528 | 529 | argv is an array containing the command-line arguments, starting with the node command itself ( 530 | ========== 531 | node_up_and_running 532 | - Your Highlight on Page 93-93 | Added on Wednesday, 5 February 14 16:48:33 533 | 534 | process.nextTick() creates a callback to be executed on the next “tick,” or iteration of the event 535 | ========== 536 | node_up_and_running 537 | - Your Highlight on Page 95-95 | Added on Wednesday, 5 February 14 16:52:11 538 | 539 | child processes have some common properties. They each contain properties for stdin, stdout 540 | ========== 541 | node_up_and_running 542 | - Your Highlight on Page 95-95 | Added on Wednesday, 5 February 14 16:52:37 543 | 544 | When you call exec(), you can pass a shell command for the new process to run. Note that the entire command is a string 545 | ========== 546 | node_up_and_running 547 | - Your Highlight on Page 97-97 | Added on Wednesday, 5 February 14 16:59:10 548 | 549 | This means that spawn() is most often used in server contexts to create subcomponents of a server and is the most common way people make Node work with multiple cores on a single machine. 550 | ========== 551 | node_up_and_running 552 | - Your Highlight on Page 99-99 | Added on Wednesday, 5 February 14 17:05:19 553 | 554 | we can ask child processes to share an existing file descriptor with the parent process 555 | ========== 556 | node_up_and_running 557 | - Your Highlight on Page 100-100 | Added on Wednesday, 5 February 14 17:18:02 558 | 559 | We could start a bunch of Node processes with different ports and load-balance them with Nginx or Apache Traffic Server. However, that’s inelegant and requires us to use more software 560 | ========== 561 | node_up_and_running 562 | - Your Highlight on Page 101-101 | Added on Wednesday, 5 February 14 17:18:55 563 | 564 | This is where passing custom FDs comes into its own. In the same way that we can pass the stdin, stdout, and stderr of a master process, we can create other sockets and pass those in to child processes. However, because we are passing file descriptors instead of messages, the kernel will deal with the routing. This means that although the master Node process is still required, it isn’t bearing the load for all the traffic. 565 | ========== 566 | node_up_and_running 567 | - Your Highlight on Page 102-102 | Added on Wednesday, 5 February 14 17:23:43 568 | 569 | So the deepEqual() and notDeep Equal() methods provide a way of deeply comparing object values. Without going into too many of the gory details 570 | ========== 571 | node_up_and_running 572 | - Your Highlight on Page 102-102 | Added on Wednesday, 5 February 14 17:24:33 573 | 574 | The important point here is that deepEqual() and notDeepEqual() are extremely helpful and thorough, but also potentially expensive 575 | ========== 576 | node_up_and_running 577 | - Your Highlight on Page 105-105 | Added on Thursday, 6 February 14 09:21:26 578 | 579 | You can also compile vm.Script objects (Example 5-43). These save a piece of code that you can then run repeatedly. At runtime, you can choose the context to be applied. This is helpful when you are repeatedly running the same code against multiple contexts. 580 | ========== 581 | node_up_and_running 582 | - Your Highlight on Page 106-106 | Added on Thursday, 6 February 14 09:23:28 583 | 584 | you need to pass in the objects to which you refer (such as the console object); otherwise, even basic global functions are not available. 585 | ========== 586 | node_up_and_running 587 | - Your Highlight on Page 115-115 | Added on Thursday, 6 February 14 09:28:04 588 | 589 | Redis is used when performance and scaling are important 590 | ========== 591 | node_up_and_running 592 | - Your Highlight on Page 115-115 | Added on Thursday, 6 February 14 09:28:27 593 | 594 | choose to use it as a cache for data retrieved from a relational database such as MySQL 595 | ========== 596 | node_up_and_running 597 | - Your Highlight on Page 115-115 | Added on Thursday, 6 February 14 09:28:50 598 | 599 | Node drivers to communicate with it 600 | ========== 601 | node_up_and_running 602 | - Your Highlight on Page 121-121 | Added on Thursday, 6 February 14 09:30:52 603 | 604 | Redis supports the publish-subscribe (or pub-sub) messaging pattern 605 | ========== 606 | node_up_and_running 607 | - Your Highlight on Page 122-122 | Added on Thursday, 6 February 14 09:33:15 608 | 609 | When the unsubscribe command detects no more active subscriptions, both clients end their connection to Redis, and the program execution stops 610 | ========== 611 | node_up_and_running 612 | - Your Highlight on Page 122-122 | Added on Thursday, 6 February 14 09:33:44 613 | 614 | Redis supports password authentication 615 | ========== 616 | node_up_and_running 617 | - Your Highlight on Page 122-122 | Added on Thursday, 6 February 14 09:34:20 618 | 619 | Notice the lack of usernames and multiple passwords. Redis does not include user management functionality 620 | ========== 621 | node_up_and_running 622 | - Your Highlight on Page 122-122 | Added on Thursday, 6 February 14 09:34:35 623 | 624 | Instead, system administrators are expected to secure their servers using other means, such as portblocking Redis from the outside world so that only internal, trusted users may access it 625 | ========== 626 | node_up_and_running 627 | - Your Highlight on Page 122-122 | Added on Thursday, 6 February 14 09:35:10 628 | 629 | Some “dangerous” commands can be renamed or removed entirely 630 | ========== 631 | node_up_and_running 632 | - Your Highlight on Page 123-123 | Added on Thursday, 6 February 14 09:35:22 633 | 634 | BSON object storage 635 | ========== 636 | node_up_and_running 637 | - Your Highlight on Page 123-123 | Added on Thursday, 6 February 14 09:35:29 638 | 639 | BSON object storage (a binary adaption of JSON 640 | ========== 641 | node_up_and_running 642 | - Your Highlight on Page 123-123 | Added on Thursday, 6 February 14 09:35:44 643 | 644 | ideal in high-write situations 645 | ========== 646 | node_up_and_running 647 | - Your Highlight on Page 123-123 | Added on Thursday, 6 February 14 10:08:03 648 | 649 | inserting data into Mongo is nonblocking, making it ideal for logging operations and telemetry data 650 | ========== 651 | node_up_and_running 652 | - Your Highlight on Page 123-123 | Added on Thursday, 6 February 14 10:08:17 653 | 654 | Mongo supports JavaScript functions inside queries, making it very powerful in read situations, including MapReduce queries. Using MongoDB’s document- 655 | ========== 656 | node_up_and_running 657 | - Your Highlight on Page 123-123 | Added on Thursday, 6 February 14 10:08:58 658 | 659 | supports JavaScript functions inside queries, making it very powerful in read situations, including MapReduce queries. Using MongoDB’s document 660 | ========== 661 | node_up_and_running 662 | - Your Highlight on Page 123-123 | Added on Thursday, 6 February 14 10:09:32 663 | 664 | The native MongoDB driver is a good choice when you need precise control over your MongoDB connection 665 | ========== 666 | node_up_and_running 667 | - Your Highlight on Page 127-127 | Added on Thursday, 6 February 14 10:13:30 668 | 669 | you work with Mongoose, you don’t need to maintain a connection to MongoDB, because all of your schema definitions and queries are buffered until you connect. This is a big deal, and an important way Mongoose serves Node’s methodology. By issuing all of the “live” commands at once against Mongo, you limit the amount of time and the number of callbacks to work with your data and greatly increase the number of operations your application is able to perform. 670 | ========== 671 | node_up_and_running 672 | - Your Highlight on Page 131-131 | Added on Thursday, 6 February 14 10:14:44 673 | 674 | Sequelize is an object relational mapper (ORM 675 | ========== 676 | node_up_and_running 677 | - Your Highlight on Page 137-137 | Added on Thursday, 6 February 14 10:17:22 678 | 679 | Connection pooling 680 | ========== 681 | node_up_and_running 682 | - Your Highlight on Page 137-137 | Added on Thursday, 6 February 14 10:17:28 683 | 684 | The solution is to maintain database connections inside a cache pool after they are no longer needed, so they can be used immediately by the next incoming request. 685 | ========== 686 | node_up_and_running 687 | - Your Highlight on Page 137-137 | Added on Thursday, 6 February 14 10:17:42 688 | 689 | Node developers should use the generic-pool module in front of their data layer to serve new database connections 690 | ========== 691 | node_up_and_running 692 | - Your Highlight on Page 139-139 | Added on Thursday, 6 February 14 10:18:40 693 | 694 | The beauty of Node’s pool is that any persistent resource can be represented. Databases are a natural fit, but you can just as easily write commands to maintain connections to an outside session cache, or even to hardware interfaces. 695 | ========== 696 | node_up_and_running 697 | - Your Highlight on Page 139-139 | Added on Thursday, 6 February 14 10:21:27 698 | 699 | This is known as a publish-subscribe pattern. 700 | ========== 701 | node_up_and_running 702 | - Your Highlight on Page 139-139 | Added on Thursday, 6 February 14 10:21:44 703 | 704 | This is known as a request-reply pattern. 705 | ========== 706 | node_up_and_running 707 | - Your Highlight on Page 140-140 | Added on Thursday, 6 February 14 10:22:06 708 | 709 | RabbitMQ is a message broker that supports the advanced message queueing protocol (AMQP). It is useful in situations where data needs to be communicated between different servers, or between different processes on the same server 710 | ========== 711 | node_up_and_running 712 | - Your Highlight on Page 140-140 | Added on Thursday, 6 February 14 10:22:30 713 | 714 | Once RabbitMQ has been installed and is running, use npm to retrieve Node’s AMQP drivers: 715 | ========== 716 | node_up_and_running 717 | - Your Highlight on Page 140-140 | Added on Thursday, 6 February 14 10:23:03 718 | 719 | For example, a publisher written in PHP can send a message to a consumer written in JavaScript. 720 | ========== 721 | node_up_and_running 722 | - Your Highlight on Page 142-142 | Added on Thursday, 6 February 14 10:24:43 723 | 724 | Using RabbitMQ, is it possible to split tasks among multiple workers and ensure that tasks are completed even if the first worker that handles them dies mid-process 725 | ========== 726 | node_up_and_running 727 | - Your Highlight on Page 143-143 | Added on Thursday, 6 February 14 10:25:56 728 | 729 | Although there is no “sleep” function in Node, you can fake it with a blocking loop, as done here. 730 | ========== 731 | node_up_and_running 732 | - Your Highlight on Page 144-144 | Added on Thursday, 6 February 14 10:27:09 733 | 734 | common “gotcha” occurs when developers forget to use the q.shift() command. If you forget it, your program will continue to function as normal, but as soon as your client disconnects, the server will place all of the messages the client processed back onto the queue. Another side effect is that the memory usage by RabbitMQ will gradually rise. This is because, although the messages are removed from active duty on the queue, they are kept in memory until they are acknowledged and deleted by the client. 144 | Chapter 6: 735 | ========== 736 | node_up_and_running 737 | - Your Highlight on Page 152-152 | Added on Thursday, 6 February 14 10:29:36 738 | 739 | Some of the more popular engines are Haml, Jade, Embedded Javascript (EJ), CoffeeKup (a CoffeeScript-based engine), and jQuery templates 740 | ========== 741 | node_up_and_running 742 | - Your Highlight on Page 159-159 | Added on Thursday, 6 February 14 10:35:59 743 | 744 | Socket.IO allows you to send messages back and forth with browser clients that connect with your Node server, using an efficient, low-level socket mechanism 745 | ========== 746 | node_up_and_running 747 | - Your Highlight on Page 161-161 | Added on Thursday, 6 February 14 10:37:21 748 | 749 | how namespaces avoid this problem by effectively dividing Socket.IO’s listeners into channels. 750 | ========== 751 | node_up_and_running 752 | - Your Highlight on Page 169-169 | Added on Thursday, 6 February 14 10:39:33 753 | 754 | The Node module system is based on the commonJS module specification. 755 | ========== 756 | node_up_and_running 757 | - Your Highlight on Page 170-170 | Added on Thursday, 6 February 14 10:41:31 758 | 759 | you can instruct npm to clean the cache using the following command 760 | ========== 761 | node_up_and_running 762 | - Your Highlight on Page 170-170 | Added on Thursday, 6 February 14 10:42:18 763 | 764 | Creating a package doesn’t require much more work than creating a package.json file with some basic definitions about your module—its name and version number being the most critical components 765 | ========== 766 | node_up_and_running 767 | - Your Highlight on Page 171-171 | Added on Thursday, 6 February 14 10:43:13 768 | 769 | This raises an interesting point about npm: because anyone can publish a package without any prefiltering or oversight, the quality of the libraries you install using npm is uncertain. So “buyer beware 770 | ========== 771 | node_up_and_running 772 | - Your Highlight on Page 172-172 | Added on Thursday, 6 February 14 10:44:01 773 | 774 | Using npm init is the fastest way to generate a barebones version of this file. 775 | ========== 776 | node_up_and_running 777 | - Your Highlight on Page 172-172 | Added on Thursday, 6 February 14 10:44:28 778 | 779 | If you have linked Express in more than one project, all of those projects will be synchronized to the most recent version, freeing you from having to update every one of them whenever Express is updated 780 | ========== 781 | node_up_and_running 782 | - Your Highlight on Page 172-172 | Added on Thursday, 6 February 14 10:44:48 783 | 784 | Whereas modules are the JavaScript extensions for Node, add-ons are the C/C++ extensions 785 | ========== 786 | node_up_and_running 787 | - Your Highlight on Page 172-172 | Added on Thursday, 6 February 14 10:45:03 788 | 789 | Add-ons are dynamically linked shared objects. 790 | ========== 791 | node_up_and_running 792 | - Your Highlight on Page 172-172 | Added on Thursday, 6 February 14 10:45:20 793 | 794 | Node uses the waf build system written in Python 795 | ========== 796 | node_up_and_running 797 | - Your Highlight on Page 172-172 | Added on Thursday, 6 February 14 10:45:47 798 | 799 | The first thing this code needs to do is include the v8 header file because Node is built on top of V8 800 | ========== 801 | node_up_and_running 802 | - Your Highlight on Page 172-172 | Added on Thursday, 6 February 14 10:46:08 803 | 804 | We’ll hang everything we expose from the add-on off a function with the signature extern 'C' void init (Handle target). 805 | ========== 806 | the_wordpress_anthology 807 | - Your Bookmark on Page 97 | Added on Thursday, 6 February 14 14:00:47 808 | 809 | 810 | ========== 811 | the_wordpress_anthology 812 | - Your Bookmark on Page 97 | Added on Thursday, 6 February 14 14:00:50 813 | 814 | 815 | ========== 816 | programming_scala 817 | - Your Bookmark on Page 370 | Added on Thursday, 6 February 14 17:20:33 818 | 819 | 820 | ========== 821 | Head First C 822 | - Your Bookmark on Page 4 | Added on Friday, 7 February 14 14:38:43 823 | 824 | 825 | ========== 826 | Head First C 827 | - Your Bookmark on Page 4 | Added on Friday, 7 February 14 14:38:56 828 | 829 | 830 | ========== 831 | natural_language_processing_with_python 832 | - Your Bookmark on Page 9 | Added on Thursday, 13 February 14 11:31:28 833 | 834 | 835 | ========== 836 | 101 Design Ingredients to Solve Big Tech Problems 837 | - Your Highlight on Page 23-23 | Added on Thursday, 13 February 14 11:35:56 838 | 839 | any result as long as it immediately satisfies stakeholders and customers 840 | ========== 841 | 101 Design Ingredients to Solve Big Tech Problems 842 | - Your Highlight on Page 23-23 | Added on Thursday, 13 February 14 11:36:04 843 | 844 | Solve the real big issues, and you’ll solve related ones too 845 | ========== 846 | 101 Design Ingredients to Solve Big Tech Problems 847 | - Your Highlight on Page 23-23 | Added on Thursday, 13 February 14 11:36:28 848 | 849 | Prioritize 850 | ========== 851 | 101 Design Ingredients to Solve Big Tech Problems 852 | - Your Highlight on Page 23-23 | Added on Thursday, 13 February 14 11:36:48 853 | 854 | that persist. Add these to an up-to-date list so y o u don’t lose track of them. Identify related issues and group those together. Put measures in place to prevent problems from occurring again. 6 4. 855 | ========== 856 | 101 Design Ingredients to Solve Big Tech Problems 857 | - Your Highlight on Page 26-26 | Added on Thursday, 13 February 14 11:38:06 858 | 859 | Get them to understand what you do, and why and how you do it. 860 | ========== 861 | hadoop_the_definitive_guide_3nd_edition 862 | - Your Highlight on Page xv-xv | Added on Thursday, 13 February 14 11:46:39 863 | 864 | data storage, data analysis, and coordination 865 | ========== 866 | hadoop_the_definitive_guide_3nd_edition 867 | - Your Highlight on Page 1-1 | Added on Thursday, 13 February 14 11:49:45 868 | 869 | In pioneer days they used oxen for heavy pulling, and when one ox couldn’t budge a log, they didn’t try to grow a larger ox. We shouldn’t be trying for bigger computers, but for more systems of computers 870 | ========== 871 | hadoop_the_definitive_guide_3nd_edition 872 | - Your Highlight on Page 2-2 | Added on Friday, 14 February 14 09:27:08 873 | 874 | Initiatives such as Public Data Sets on Amazon Web Services, Infochimps.org, and theinfo.org exist to foster the “information commons,” where data can be freely (or in the case of AWS, for a modest price) shared for anyone to download and analyze. Mashups between different information sources make for unexpected and hitherto unimaginable applications. 875 | ========== 876 | hadoop_the_definitive_guide_3nd_edition 877 | - Your Highlight on Page 3-3 | Added on Friday, 14 February 14 09:30:31 878 | 879 | MapReduce provides a programming model that abstracts the problem from disk reads and writes, 880 | ========== 881 | hadoop_the_definitive_guide_3nd_edition 882 | - Your Highlight on Page 4-4 | Added on Friday, 14 February 14 09:31:21 883 | 884 | This, in a nutshell, is what Hadoop provides: a reliable shared storage and analysis system. The storage is provided by HDFS and analysis by MapReduce. There are other parts to Hadoop, but these capabilities are its kernel. 885 | ========== 886 | hadoop_the_definitive_guide_3nd_edition 887 | - Your Highlight on Page 4-4 | Added on Friday, 14 February 14 09:31:43 888 | 889 | MapReduce is a batch query processor 890 | ========== 891 | hadoop_the_definitive_guide_3nd_edition 892 | - Your Highlight on Page 5-5 | Added on Friday, 14 February 14 09:36:44 893 | 894 | MapReduce is a good fit for problems that need to analyze the whole dataset, in a batch fashion, particularly for ad hoc analysis. An 895 | ========== 896 | hadoop_the_definitive_guide_3nd_edition 897 | - Your Highlight on Page 6-6 | Added on Friday, 14 February 14 09:39:13 898 | 899 | query languages built on MapReduce 900 | ========== 901 | hadoop_the_definitive_guide_3nd_edition 902 | - Your Highlight on Page 7-7 | Added on Friday, 14 February 14 09:41:48 903 | 904 | MapReduce is able to do this since it is a shared-nothing architecture, meaning that tasks have no dependence on one other 905 | ========== 906 | hadoop_the_definitive_guide_3nd_edition 907 | - Your Highlight on Page 7-7 | Added on Friday, 14 February 14 09:46:39 908 | 909 | MapReduce was invented by engineers at Google as a system for building production search indexes because they found themselves solving the same problem over and over again (and MapReduce was inspired by older ideas from the functional programming, distributed computing, and database communities 910 | ========== 911 | hadoop_the_definitive_guide_3nd_edition 912 | - Your Highlight on Page 12-12 | Added on Friday, 14 February 14 09:55:09 913 | 914 | Hadoop projects that are covered in this book are described briefly here 915 | ========== 916 | hadoop_the_definitive_guide_3nd_edition 917 | - Your Highlight on Page 17-17 | Added on Friday, 14 February 14 10:13:14 918 | 919 | Hadoop can run MapReduce programs written in various languages 920 | ========== 921 | hadoop_the_definitive_guide_3nd_edition 922 | - Your Highlight on Page 19-19 | Added on Friday, 14 February 14 10:15:43 923 | 924 | The classic tool for processing line-oriented data is awk 925 | ========== 926 | hadoop_the_definitive_guide_3nd_edition 927 | - Your Highlight on Page 20-20 | Added on Friday, 14 February 14 10:18:54 928 | 929 | So, though it’s feasible to parallelize the processing, in practice it’s messy. Using a framework like Hadoop to take care of these issues is a great help 930 | ========== 931 | hadoop_the_definitive_guide_3nd_edition 932 | - Your Highlight on Page 24-24 | Added on Friday, 14 February 14 10:28:40 933 | 934 | When we run this job on a Hadoop cluster, we will package the code into a JAR file (which Hadoop will distribute around the cluster 935 | ========== 936 | hadoop_the_definitive_guide_3nd_edition 937 | - Your Highlight on Page 28-28 | Added on Friday, 14 February 14 10:39:47 938 | 939 | The new API is in the org.apache.hadoop.mapreduce package (and subpackages). The old API can still be found in org.apache.hadoop.mapred 940 | ========== 941 | node_up_and_running 942 | - Your Bookmark on Page 185 | Added on Monday, 17 February 14 09:26:23 943 | 944 | 945 | ========== 946 | Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, Erich;Helm, Richard;Johnson, Ralph;Vlissides, John) 947 | - Your Highlight Location 430-430 | Added on Thursday, 20 February 14 08:18:45 948 | 949 | The Catalog of Design Patterns 950 | ========== 951 | hadoop_the_definitive_guide_3nd_edition 952 | - Your Highlight on Page 34-34 | Added on Wednesday, 12 March 14 15:41:38 953 | 954 | possible to have zero reduce tasks 955 | ========== 956 | 101 Design Ingredients to Solve Big Tech Problems 957 | - Your Highlight on Page 33-33 | Added on Wednesday, 12 March 14 15:53:38 958 | 959 | Combine what makes sense to achieve success, and highlight the risks of not connecting the dots 960 | ========== 961 | 101 Design Ingredients to Solve Big Tech Problems 962 | - Your Bookmark on Page 35 | Added on Wednesday, 12 March 14 15:55:37 963 | 964 | 965 | ========== 966 | hadoop_the_definitive_guide_3nd_edition 967 | - Your Highlight on Page 37-37 | Added on Wednesday, 19 March 14 21:08:10 968 | 969 | Hadoop provides an API to MapReduce that allows you to write your map and reduce functions in languages other than Java 970 | ========== 971 | hadoop_the_definitive_guide_3nd_edition 972 | - Your Highlight on Page 37-37 | Added on Wednesday, 19 March 14 21:08:30 973 | 974 | uses Unix standard streams as the interface between Hadoop and your program 975 | ========== 976 | hadoop_the_definitive_guide_3nd_edition 977 | - Your Highlight on Page 37-37 | Added on Wednesday, 19 March 14 21:08:44 978 | 979 | Streaming is naturally suited for text processing (although, as of version 0.21.0, it can handle binary streams, too 980 | ========== 981 | hadoop_the_definitive_guide_3nd_edition 982 | - Your Highlight on Page 38-38 | Added on Wednesday, 19 March 14 21:10:07 983 | 984 | —for example, it could easily read and process multiple lines at a time since it’s in control of the reading. The 985 | ========== 986 | hadoop_the_definitive_guide_3nd_edition 987 | - Your Highlight on Page 38-38 | Added on Wednesday, 19 March 14 21:10:34 988 | 989 | The Java API is geared toward processing your map function one record at a time 990 | ========== 991 | hadoop_the_definitive_guide_3nd_edition 992 | - Your Highlight on Page 39-39 | Added on Wednesday, 19 March 14 21:12:36 993 | 994 | The hadoop command doesn’t support a Streaming option; instead, you specify the Streaming JAR file along with the jar option. Options to the Streaming program specify the input and output paths, and the map and reduce scripts. This is what it looks like: 995 | ========== 996 | hadoop_the_definitive_guide_3nd_edition 997 | - Your Highlight on Page 39-39 | Added on Wednesday, 19 March 14 21:13:00 998 | 999 | When running on a large dataset on a cluster, we should set the combiner, using the -combiner option. 1000 | ========== 1001 | hadoop_the_definitive_guide_3nd_edition 1002 | - Your Highlight on Page 41-41 | Added on Wednesday, 19 March 14 21:13:45 1003 | 1004 | Hadoop Pipes is the name of the C++ interface to Hadoop MapReduce 1005 | ========== 1006 | hadoop_the_definitive_guide_3nd_edition 1007 | - Your Highlight on Page 43-43 | Added on Wednesday, 19 March 14 21:15:03 1008 | 1009 | To run a Pipes job, we need to run Hadoop in pseudo-distributed mode (where all the daemons run on the local machine 1010 | ========== 1011 | hadoop_the_definitive_guide_3nd_edition 1012 | - Your Highlight on Page 43-43 | Added on Wednesday, 19 March 14 21:16:12 1013 | 1014 | We specify two properties using the -D option: hadoop.pipes.java.recordreader and hadoop.pipes.java.recordwriter, setting both to true to say that we have not specified a C++ record reader or writer, but that we want to use the default Java ones (which are for text input and output 1015 | ========== 1016 | hadoop_the_definitive_guide_3nd_edition 1017 | - Your Highlight on Page 43-43 | Added on Wednesday, 19 March 14 21:16:43 1018 | 1019 | fact, you can have a mixture of Java or C++ classes within any one job. 1020 | ========== 1021 | natural_language_processing_with_python 1022 | - Your Highlight on Page 20-20 | Added on Wednesday, 19 March 14 21:32:42 1023 | 1024 | A 1025 | ========== 1026 | natural_language_processing_with_python 1027 | - Your Highlight on Page 20-20 | Added on Wednesday, 19 March 14 21:32:52 1028 | 1029 | collocation is a sequence of words that occur together unusually often 1030 | ========== 1031 | natural_language_processing_with_python 1032 | - Your Highlight on Page 20-20 | Added on Wednesday, 19 March 14 21:33:31 1033 | 1034 | they are resistant to substitution with words that have similar senses; for example, maroon wine sounds very odd. 1035 | ========== 1036 | natural_language_processing_with_python 1037 | - Your Highlight on Page 20-20 | Added on Wednesday, 19 March 14 21:33:47 1038 | 1039 | list of word pairs, also known as bigrams 1040 | ========== 1041 | natural_language_processing_with_python 1042 | - Your Highlight on Page 20-20 | Added on Wednesday, 19 March 14 21:34:13 1043 | 1044 | Now, collocations are essentially just frequent bigrams 1045 | ========== 1046 | natural_language_processing_with_python 1047 | - Your Highlight on Page 21-21 | Added on Wednesday, 19 March 14 21:35:09 1048 | 1049 | The collocations that emerge are very specific to the genre of the texts. In order to find red wine as a collocation, we would need to process a much larger body of text 1050 | ========== 1051 | natural_language_processing_with_python 1052 | - Your Highlight on Page 28-28 | Added on Wednesday, 19 March 14 21:38:42 1053 | 1054 | Sense Disambiguation 1055 | ========== 1056 | natural_language_processing_with_python 1057 | - Your Highlight on Page 39-39 | Added on Wednesday, 19 March 14 21:51:00 1058 | 1059 | large bodies of linguistic data, or corpora 1060 | ========== 1061 | natural_language_processing_with_python 1062 | - Your Highlight on Page 48-48 | Added on Wednesday, 19 March 14 21:59:29 1063 | 1064 | >>> from nltk.corpus import udhr >>> languages = ['Chickasaw', 'English', 'German_Deutsch', ...'Greenlandic_Inuktikut', 'Hungarian_Magyar', 'Ibibio_Efik'] >>> cfd = nltk.ConditionalFreqDist( ...(lang, len(word)) ... for lang in languages ... for word in udhr.words(lang + '-Latin1')) >>> cfd.plot(cumulative=True) Your Turn: Pick a language of interest in udhr.fileids(), and define a variable raw_text = udhr.raw(Language-Latin1). Now plot a frequency distribution of the letters of the text using nltk.FreqDist(raw_text).plot().Unfortunately, for many languages, substantial corpora are not yet available. Often there is insufficient government or industrial support for developing language resources, and individual efforts are piecemeal and hard to discover or reuse. Some languages have no established writing system, or are endangered.(See 1065 | ========== 1066 | hadoop_the_definitive_guide_3nd_edition 1067 | - Your Highlight on Page 45-45 | Added on Tuesday, 22 April 14 11:38:48 1068 | 1069 | Hadoop Distributed Filesystem 1070 | ========== 1071 | Lean Architecture 1072 | - Your Highlight on Page 22-22 | Added on Sunday, 11 May 14 14:12:52 1073 | 1074 | Lean’s primary focus is the enterprise value stream. Lean 1075 | ========== 1076 | Lean Architecture 1077 | - Your Highlight on Page 22-22 | Added on Sunday, 11 May 14 14:13:32 1078 | 1079 | Whereas the Agile manifesto emphasizes customers, Lean emphasizes stakeholders – with everybody in sight being a stakeholder. 1080 | ========== 1081 | Lean Architecture 1082 | - Your Highlight on Page 23-23 | Added on Sunday, 11 May 14 14:15:56 1083 | 1084 | we reduce the waste incurred by rework (from inadequate planning), unused artifacts (such as comprehensive documentation and speculative code), and wait states (as can be caused by the review life cycle of architecture and design documents, or by handoffs between functional teams) 1085 | ========== 1086 | Lean Architecture 1087 | - Your Highlight on Page 25-25 | Added on Sunday, 11 May 14 14:17:05 1088 | 1089 | What is Lean Architecture 1090 | ========== 1091 | Lean Architecture 1092 | - Your Highlight on Page 27-27 | Added on Sunday, 11 May 14 14:17:52 1093 | 1094 | Agile production plans for change 1095 | ========== 1096 | lean-agile_acceptance_test-driven_development 1097 | - Your Highlight on Page 56-56 | Added on Thursday, 15 May 14 18:35:08 1098 | 1099 | Stories should meet the INVEST criteria—independent, negotiable, valuable, estimable, small, and testable 1100 | ========== 1101 | lean-agile_acceptance_test-driven_development 1102 | - Your Bookmark on Page 20 | Added on Thursday, 15 May 14 18:37:40 1103 | 1104 | 1105 | ========== 1106 | AM-aula16 1107 | - Your Bookmark on Page 34 | Added on Monday, 19 May 14 07:47:08 1108 | 1109 | 1110 | ========== 1111 | AM-aula16 1112 | - Your Bookmark on Page 50 | Added on Monday, 19 May 14 07:48:14 1113 | 1114 | 1115 | ========== 1116 | AM-aula17 1117 | - Your Bookmark on Page 78 | Added on Monday, 19 May 14 08:11:25 1118 | 1119 | 1120 | ========== 1121 | Viagem ao Centro da Terra (Julio Verne) 1122 | - Your Note Location 168 | Added on Thursday, 12 June 14 11:12:52 1123 | 1124 | ws391989 1125 | 1126 | ws391990 1127 | ========== 1128 | Viagem ao Centro da Terra (Julio Verne) 1129 | - Your Highlight Location 168-168 | Added on Thursday, 12 June 14 11:12:52 1130 | 1131 | Ao ouvir essas palavras, ergui a cabeça bruscamente. Meu tio 1132 | ========== 1133 | Rules of the Game (Strauss, Neil) 1134 | - Your Highlight on Page 28 | Location 653-653 | Added on Wednesday, 18 June 14 16:46:31 1135 | 1136 | Change your hairstyle. 1137 | ========== 1138 | Rules of the Game (Strauss, Neil) 1139 | - Your Highlight on Page 28 | Location 659-660 | Added on Wednesday, 18 June 14 16:46:47 1140 | 1141 | Get a manicure and pedicure. 1142 | ========== 1143 | Rules of the Game (Strauss, Neil) 1144 | - Your Highlight on Page 29 | Location 662-663 | Added on Wednesday, 18 June 14 16:47:03 1145 | 1146 | Remove excess hair. 1147 | ========== 1148 | Rules of the Game (Strauss, Neil) 1149 | - Your Highlight on Page 29 | Location 665-665 | Added on Wednesday, 18 June 14 16:47:28 1150 | 1151 | Examine yourself closely in a mirror. 1152 | ========== 1153 | Rules of the Game (Strauss, Neil) 1154 | - Your Highlight on Page 29 | Location 668-668 | Added on Wednesday, 18 June 14 16:47:34 1155 | 1156 | Manage your eyebrows. 1157 | ========== 1158 | Rules of the Game (Strauss, Neil) 1159 | - Your Highlight on Page 29 | Location 669-669 | Added on Wednesday, 18 June 14 16:47:42 1160 | 1161 | Whiten your teeth. 1162 | ========== 1163 | Rules of the Game (Strauss, Neil) 1164 | - Your Highlight on Page 29 | Location 671-672 | Added on Wednesday, 18 June 14 16:48:07 1165 | 1166 | Freshen your breath. Start flossing daily. Consider getting a tongue scraper if halitosis is a problem. Buy gum or mints, and carry them with you at all times. 1167 | ========== 1168 | Rules of the Game (Strauss, Neil) 1169 | - Your Highlight on Page 29 | Location 678-678 | Added on Wednesday, 18 June 14 16:48:41 1170 | 1171 | Join a gym. Make 1172 | ========== 1173 | Rules of the Game (Strauss, Neil) 1174 | - Your Highlight on Page 29 | Location 680-680 | Added on Wednesday, 18 June 14 16:48:57 1175 | 1176 | Eat healthier. 1177 | ========== 1178 | Rules of the Game (Strauss, Neil) 1179 | - Your Highlight on Page 30 | Location 683-683 | Added on Wednesday, 18 June 14 16:49:15 1180 | 1181 | Make sure your clothes fit. 1182 | ========== 1183 | Rules of the Game (Strauss, Neil) 1184 | - Your Highlight on Page 34 | Location 751-751 | Added on Wednesday, 18 June 14 16:52:35 1185 | 1186 | “It’s too loud for her to hear me.” 1187 | ========== 1188 | Rules of the Game (Strauss, Neil) 1189 | - Your Highlight on Page 34 | Location 752-753 | Added on Wednesday, 18 June 14 16:52:52 1190 | 1191 | “Why bother? It won’t work out anyway,” “I don’t feel like it right now,” or “I’m having too much fun with my friends.” 1192 | ========== 1193 | Rules of the Game (Strauss, Neil) 1194 | - Your Highlight on Page 35 | Location 777-778 | Added on Wednesday, 18 June 14 16:54:45 1195 | 1196 | Shift Your Submodalities 1197 | ========== 1198 | Rules of the Game (Strauss, Neil) 1199 | - Your Highlight on Page 36 | Location 789-790 | Added on Wednesday, 18 June 14 16:55:56 1200 | 1201 | Now change the submodalities. Make the images in your limiting mind small, distant, black-and-white, slow-moving, blurry, and dark. Disassociate with these negative images by seeing them not through your own eyes but as if you’re watching yourself as a character on a movie screen. 1202 | ========== 1203 | Rules of the Game (Strauss, Neil) 1204 | - Your Highlight on Page 36 | Location 799-800 | Added on Wednesday, 18 June 14 16:56:41 1205 | 1206 | Emotionally detaching from the outcome—while rationally working toward your goal—will significantly alleviate your anxiety. This is why the Stylelife Challenge offers small, easy-to-accomplish goals rather than large, unlikely ones. 1207 | ========== 1208 | Rules of the Game (Strauss, Neil) 1209 | - Your Highlight on Page 37 | Location 814-814 | Added on Wednesday, 18 June 14 16:57:51 1210 | 1211 | Practice the Crash and Burn Strategy 1212 | ========== 1213 | Rules of the Game (Strauss, Neil) 1214 | - Your Highlight on Page 38 | Location 832-833 | Added on Wednesday, 18 June 14 16:58:43 1215 | 1216 | you can open by saying almost anything when you’re confident, congruent, and upbeat. 1217 | ========== 1218 | Clean Code 1219 | - Your Highlight on Page 34-34 | Added on Thursday, 19 June 14 11:09:36 1220 | 1221 | Two decades later I met one of the early employees of that company and asked him what had happened. The answer confirmed my fears. They had rushed the product to market and had made a huge mess in the code. As they added more and more features, the code got worse and worse until they simply could not manage it any longer. It was the bad code that brought the company down 1222 | ========== 1223 | Clean Code 1224 | - Your Highlight on Page 34-34 | Added on Thursday, 19 June 14 11:10:51 1225 | 1226 | significantly impeded by bad code 1227 | ========== 1228 | Clean Code 1229 | - Your Highlight on Page 34-34 | Added on Thursday, 19 June 14 11:10:56 1230 | 1231 | wading 1232 | ========== 1233 | Clean Code 1234 | - Your Highlight on Page 39-39 | Added on Thursday, 19 June 14 11:19:23 1235 | 1236 | Clean code is focused. Each function, each class, each module exposes a single-minded attitude that remains entirely undistracted, and unpolluted, by the surrounding details. 1237 | ========== 1238 | Clean Code 1239 | - Your Highlight on Page 40-40 | Added on Thursday, 19 June 14 11:21:07 1240 | 1241 | Code, without tests, is not clean 1242 | ========== 1243 | Clean Code 1244 | - Your Highlight on Page 45-45 | Added on Thursday, 19 June 14 11:27:56 1245 | 1246 | the ratio of time spent reading vs. writing is well over 10:1. 1247 | ========== 1248 | Clean Code 1249 | - Your Highlight on Page 70-70 | Added on Thursday, 26 June 14 10:06:17 1250 | 1251 | Don’t be afraid to make a name long. A long descriptive name is better than a short enigmatic name. A long descriptive name is better than a long descriptive comment 1252 | ========== 1253 | Clean Code 1254 | - Your Highlight on Page 72-72 | Added on Thursday, 26 June 14 10:10:57 1255 | 1256 | Flag arguments are ugly. Passing a boolean into a function is a truly terrible practice 1257 | ========== 1258 | Clean Code 1259 | - Your Highlight on Page 73-73 | Added on Thursday, 26 June 14 10:11:32 1260 | 1261 | The parts we ignore are where the bugs will hide. 1262 | ========== 1263 | Clean Code 1264 | - Your Highlight on Page 74-74 | Added on Thursday, 26 June 14 10:13:42 1265 | 1266 | For example, assertEquals might be better written as assertExpectedEqualsActual(expected, actual 1267 | ========== 1268 | Clean Code 1269 | - Your Highlight on Page 75-75 | Added on Thursday, 26 June 14 10:14:13 1270 | 1271 | Side effects are lies. Your function promises to do one thing, but it also does other hidden things 1272 | ========== 1273 | Clean Code 1274 | - Your Highlight on Page 76-76 | Added on Thursday, 26 June 14 10:15:41 1275 | 1276 | Anything that forces you to check the function signature is equivalent to a double-take. It’s a cognitive break and should be avoided 1277 | ========== 1278 | Clean Code 1279 | - Your Highlight on Page 76-76 | Added on Thursday, 26 June 14 10:16:10 1280 | 1281 | Functions should either do something or answer something, but not both 1282 | ========== 1283 | Clean Code 1284 | - Your Highlight on Page 77-77 | Added on Monday, 30 June 14 06:49:13 1285 | 1286 | So it is better to extract the bodies of the try and catch blocks out into functions of their own 1287 | ========== 1288 | Clean Code 1289 | - Your Highlight on Page 78-78 | Added on Monday, 30 June 14 06:50:09 1290 | 1291 | Error handing is one thing. Thus, a function that handles errors should do nothing else. This implies (as in the example above) that if the keyword try exists in a function, it should be the very first word in the function and that there should be nothing after the catch/finally blocks 1292 | ========== 1293 | Clean Code 1294 | - Your Highlight on Page 79-79 | Added on Monday, 30 June 14 06:54:38 1295 | 1296 | Duplication may be the root of all evil in software 1297 | ========== 1298 | Clean Code 1299 | - Your Highlight on Page 80-80 | Added on Monday, 30 June 14 07:03:34 1300 | 1301 | Functions are the verbs of that language, and classes are the nouns 1302 | ========== 1303 | Clean Code 1304 | - Your Highlight on Page 80-80 | Added on Monday, 30 June 14 07:03:51 1305 | 1306 | The art of programming is, and has always been, the art of language design. 1307 | ========== 1308 | Clean Code 1309 | - Your Highlight on Page 84-84 | Added on Monday, 30 June 14 07:05:30 1310 | 1311 | comments are, at best, a necessary evil. If 1312 | ========== 1313 | Clean Code 1314 | - Your Highlight on Page 85-85 | Added on Monday, 30 June 14 07:11:56 1315 | 1316 | Every time you write a comment, you should grimace and feel the failure of your ability of expression. 1317 | ========== 1318 | Clean Code 1319 | - Your Highlight on Page 102-102 | Added on Monday, 30 June 14 11:59:57 1320 | 1321 | Agile Software Development, Principles, Patterns, and Practices 1322 | ========== 1323 | Clean Code 1324 | - Your Highlight on Page 107-107 | Added on Monday, 30 June 14 12:07:27 1325 | 1326 | It helps to have an automated tool that can apply those formatting rules for you. 1327 | ========== 1328 | Clean Code 1329 | - Your Highlight on Page 107-107 | Added on Monday, 30 June 14 12:07:43 1330 | 1331 | It is too important to ignore and it is too important to treat religiously 1332 | ========== 1333 | Clean Code 1334 | - Your Highlight on Page 111-111 | Added on Monday, 30 June 14 12:19:23 1335 | 1336 | Control variables for loops should usually be declared within the loop statement 1337 | ========== 1338 | Clean Code 1339 | - Your Highlight on Page 113-113 | Added on Monday, 30 June 14 12:21:43 1340 | 1341 | If one function calls another, they should be vertically close, and the caller should be above the callee, if at all possible 1342 | ========== 1343 | Clean Code 1344 | - Your Highlight on Page 115-115 | Added on Monday, 30 June 14 12:23:15 1345 | 1346 | bits. They have a certain conceptual affinity. The stronger that affinity, the less vertical distance there should be between them. 1347 | ========== 1348 | Clean Code 1349 | - Your Highlight on Page 121-121 | Added on Monday, 30 June 14 12:42:03 1350 | 1351 | We don’t want it to appear to have been written by a bunch of disagreeing individuals. 1352 | ========== 1353 | Clean Code 1354 | - Your Highlight on Page 124-124 | Added on Monday, 30 June 14 12:43:24 1355 | 1356 | There is a reason that we keep our variables private. We don’t want anyone else to depend on them. We 1357 | ========== 1358 | Clean Code 1359 | - Your Highlight on Page 128-128 | Added on Monday, 30 June 14 12:48:33 1360 | 1361 | a module should not know about the innards of the objects it manipulates 1362 | ========== 1363 | Clean Code 1364 | - Your Highlight on Page 129-129 | Added on Monday, 30 June 14 12:49:36 1365 | 1366 | Are these two snippets of code violations of the Law of Demeter? Certainly the containing module knows that the ctxt object contains options, which contain a scratch directory, which has an absolute path. That’s a lot of knowledge for one function to know. The calling function knows how to navigate through a lot of different objects 1367 | ========== 1368 | Clean Code 1369 | - Your Highlight on Page 132-132 | Added on Monday, 30 June 14 12:57:39 1370 | 1371 | Unfortunately we often find that developers try to treat these data structures as though they were objects by putting business rule methods in them. This is awkward because it creates a hybrid between a data structure and an object 1372 | ========== 1373 | Clean Code 1374 | - Your Highlight on Page 132-132 | Added on Monday, 30 June 14 12:57:57 1375 | 1376 | The solution, of course, is to treat the Active Record as a data structure and to create separate objects that contain the business rules and that hide their internal data (which are probably just instances of the Active Record) 1377 | ========== 1378 | Clean Code 1379 | - Your Bookmark on Page 134 | Added on Monday, 30 June 14 20:41:44 1380 | 1381 | 1382 | ========== 1383 | Clean Code 1384 | - Your Highlight on page 136-136 | Added on Thursday, 3 July 2014 12:16:15 1385 | 1386 | Write Your Try-Catch-Finally Statement First 1387 | ========== 1388 | Amazon Route 53 Developer Guide (Amazon Web Services) 1389 | - Your Highlight at location 153-154 | Added on Monday, 7 July 2014 10:38:42 1390 | 1391 | You cannot create a CNAME record for example.com, but you can create CNAME records for www.example.com, newproduct.example.com, and so on. 1392 | ========== 1393 | Amazon Route 53 Developer Guide (Amazon Web Services) 1394 | - Your Highlight at location 154-156 | Added on Monday, 7 July 2014 10:39:17 1395 | 1396 | if you create a CNAME record for a subdomain, you cannot create any other resource record sets for that subdomain. For example, if you create a CNAME for www.example.com, you cannot create any other resource record sets for which the value of the Name field is www.example.com. 1397 | ========== 1398 | Clean Code 1399 | - Your Highlight on page 138-138 | Added on Monday, 7 July 2014 10:55:38 1400 | 1401 | This means that a change at a low level of the software can force signature changes on many higher levels. The changed modules must be rebuilt and redeployed, even though nothing they care about changed. 1402 | ========== 1403 | Clean Code 1404 | - Your Highlight on page 138-138 | Added on Monday, 7 July 2014 10:57:52 1405 | 1406 | Create informative error messages and pass them along with your exceptions 1407 | ========== 1408 | Clean Code 1409 | - Your Highlight on page 140-140 | Added on Monday, 7 July 2014 11:00:15 1410 | 1411 | wrapping third-party APIs is a best practice. 1412 | ========== 1413 | Clean Code 1414 | - Your Highlight on page 140-140 | Added on Monday, 7 July 2014 11:00:41 1415 | 1416 | When you wrap a third-party API, you minimize your dependencies upon it 1417 | ========== 1418 | Clean Code 1419 | - Your Highlight on page 141-141 | Added on Monday, 7 July 2014 11:06:15 1420 | 1421 | You create a class or configure an object so that it handles a special case for you. When you do, the client code doesn’t have to deal with exceptional behavior 1422 | ========== 1423 | Clean Code 1424 | - Your Highlight on page 141-141 | Added on Monday, 7 July 2014 11:06:55 1425 | 1426 | When we return null, we are essentially creating work for ourselves and foisting problems upon our callers. 1427 | ========== 1428 | Clean Code 1429 | - Your Highlight on page 146-146 | Added on Monday, 7 July 2014 11:25:46 1430 | 1431 | you use a boundary interface like Map, keep it inside the class, or close family of classes, where it is used. Avoid returning it from, or accepting it as an argument to, public APIs. 1432 | ========== 1433 | Puppet 3 Beginner's Guide 1434 | - Your Highlight on page 13-13 | Added on Wednesday, 9 July 2014 12:10:05 1435 | 1436 | The term "devops" has begun to be used to describe the growing overlap between these skill sets. It can mean sysadmins who happily turn their hand to writing code when needed, or developers who don't fear the command line 1437 | ========== 1438 | Puppet 3 Beginner's Guide 1439 | - Your Highlight on page 16-16 | Added on Wednesday, 9 July 2014 12:13:30 1440 | 1441 | Puppet itself is an interpreter that reads those descriptions (written in the Puppet language) and makes configuration changes on a machine so that it conforms to your specification 1442 | ========== 1443 | Puppet 3 Beginner's Guide 1444 | - Your Highlight on page 17-17 | Added on Wednesday, 9 July 2014 12:14:26 1445 | 1446 | Chapter 1 Another example is as follows: user { 'jen': ensure => present, } This is Puppet language for the declaration "The jen user should be present. " Again, this results in Puppet checking for the existence of the jen user on the system, and creating it if necessary. So you can see that the Puppet program—the Puppet manifest—for your configuration is a set of declarations about what things should exist, and how they should be configured. You don't give commands, such as "Do this, then do that. " Rather, you describe how things should be, and let Puppet take care of making it happen. These are two quite different kinds of programming. The first (procedural style) is the traditional model used by languages, such as C, Python, shell, and so on. Puppet's 1447 | ========== 1448 | Puppet 3 Beginner's Guide 1449 | - Your Highlight on page 17-17 | Added on Wednesday, 9 July 2014 12:14:49 1450 | 1451 | Puppet's is called declarative style because you declare what the end result should be, rather than specifying the steps to get there 1452 | ========== 1453 | Puppet 3 Beginner's Guide 1454 | - Your Highlight on page 29-29 | Added on Thursday, 10 July 2014 09:50:42 1455 | 1456 | node" is the Puppet term for an individual machine that has a Puppet configuration) 1457 | ========== 1458 | Puppet 3 Beginner's Guide 1459 | - Your Highlight on page 30-30 | Added on Thursday, 10 July 2014 09:51:16 1460 | 1461 | they are inside a node declaration, Puppet will apply them only on a machine whose hostname matches the node name. 1462 | ========== 1463 | Puppet 3 Beginner's Guide 1464 | - Your Highlight on page 36-36 | Added on Thursday, 10 July 2014 09:55:37 1465 | 1466 | . To see what version of a package you currently have installed on Ubuntu, you can run the following command: 1467 | ========== 1468 | Puppet 3 Beginner's Guide 1469 | - Your Highlight on page 37-37 | Added on Thursday, 10 July 2014 09:56:38 1470 | 1471 | you can use a Puppet construct called a selector to choose the appropriate package name 1472 | ========== 1473 | Puppet 3 Beginner's Guide 1474 | - Your Highlight on page 37-37 | Added on Thursday, 10 July 2014 09:58:57 1475 | 1476 | Using ensure => absent will remove the package if it's installed 1477 | ========== 1478 | Puppet 3 Beginner's Guide 1479 | - Your Highlight on page 43-43 | Added on Thursday, 10 July 2014 10:13:42 1480 | 1481 | we make this explicit in Puppet by saying the following: ensure => running 1482 | ========== 1483 | Puppet 3 Beginner's Guide 1484 | - Your Highlight on page 44-44 | Added on Thursday, 10 July 2014 10:14:42 1485 | 1486 | Puppet can control whether a service starts during the system boot process, using the enable attribute 1487 | ========== 1488 | Puppet 3 Beginner's Guide 1489 | - Your Highlight on page 45-45 | Added on Friday, 11 July 2014 11:34:29 1490 | 1491 | If you have this problem, you can use the hasstatus attribute to change this behavior: 1492 | ========== 1493 | Puppet 3 Beginner's Guide 1494 | - Your Highlight on page 45-45 | Added on Friday, 11 July 2014 11:34:45 1495 | 1496 | If hasstatus is false for a service, Puppet will instead look at the system process list (such as that produced by the ps command) and see if the service name is listed in it. If it is, Puppet assumes the service is running.Otherwise, it will attempt to start it. 1497 | ========== 1498 | Puppet 3 Beginner's Guide 1499 | - Your Highlight on page 45-45 | Added on Friday, 11 July 2014 11:35:01 1500 | 1501 | If the service name itself wouldn't appear in the process list, you can specify a different pattern for Puppet to search for using the pattern attribute: 1502 | ========== 1503 | Puppet 3 Beginner's Guide 1504 | - Your Highlight on page 45-45 | Added on Friday, 11 July 2014 11:35:38 1505 | 1506 | If the service status can't be detected from the process list, you can give Puppet a command to run that will return an appropriate exit status (0 for running, any other value for not running) using the status attribute 1507 | ========== 1508 | Puppet 3 Beginner's Guide 1509 | - Your Highlight on page 46-46 | Added on Friday, 11 July 2014 11:37:01 1510 | 1511 | However, some services support a restart or reload command, which may be preferable to stopping and starting the service. For example, some daemons keep a lot of state information in memory, and if you stopped the service this would be lost. 1512 | ========== 1513 | Puppet 3 Beginner's Guide 1514 | - Your Highlight on page 46-46 | Added on Friday, 11 July 2014 11:43:18 1515 | 1516 | Nginx virtual host. This will tell Nginx how to respond to requests for the cat-pictures website 1517 | ========== 1518 | Puppet 3 Beginner's Guide 1519 | - Your Highlight on page 48-48 | Added on Wednesday, 16 July 2014 10:03:32 1520 | 1521 | source is a file attribute that we haven't seen before. Previously we used content to supply the contents of the file as a string.Here, source tells Puppet where to find a copy of the file: 1522 | ========== 1523 | Puppet 3 Beginner's Guide 1524 | - Your Highlight on page 49-49 | Added on Wednesday, 16 July 2014 10:04:33 1525 | 1526 | It means "whenever this file is changed, tell Service['nginx'] to restart". That's what we saw happen as Puppet deployed the file (which of course counts as a change 1527 | ========== 1528 | Puppet 3 Beginner's Guide 1529 | - Your Highlight on page 49-49 | Added on Wednesday, 16 July 2014 10:04:56 1530 | 1531 | When a file resource notifies a service resource, the file must be present before the service is started. So if a file notifies a service, it's just another way of saying that the service requires the file. You can express the relationship either way, and the result will be the same 1532 | ========== 1533 | Puppet 3 Beginner's Guide 1534 | - Your Highlight on page 50-50 | Added on Wednesday, 16 July 2014 10:06:46 1535 | 1536 | The service THE_STUFF should be running ‹ Before the service THE_STUFF is started, the package THE_STUFF should be installed ‹ Before the service THE_STUFF is started, the file /etc/THE_STUFF.conf should be present (remember that "A notifies B" implies "B requires A") ‹ If the file /etc/THE_STUFF.conf changes, restart the service THE_STUFF 1537 | ========== 1538 | Puppet 3 Beginner's Guide 1539 | - Your Highlight on page 50-50 | Added on Wednesday, 16 July 2014 10:07:06 1540 | 1541 | The package resource is used to manage packages. To install a package, you set the ensure attribute to installed 1542 | ========== 1543 | Puppet 3 Beginner's Guide 1544 | - Your Highlight on page 51-51 | Added on Friday, 18 July 2014 11:57:45 1545 | 1546 | The enable attribute controls whether or not a service is started at boot time. To start the service at boot time, use enable => true. If you don't want it to start on boot (unlikely, but possible) use enable => false 1547 | ========== 1548 | Puppet 3 Beginner's Guide 1549 | - Your Highlight on page 51-51 | Added on Friday, 18 July 2014 11:58:20 1550 | 1551 | If a service's control script doesn't support a status command, you can set hasstatus => false for the service resource. In this case, Puppet will look in the system process table to see if the service is running. 1552 | ========== 1553 | Puppet 3 Beginner's Guide 1554 | - Your Highlight on page 51-51 | Added on Friday, 18 July 2014 11:58:36 1555 | 1556 | If you need Puppet to search the process table for something other than the service's name, you can specify what to search for using the pattern attribute. If searching the process table won't work, you can provide a command for Puppet to use to determine the service's status, using the status attribute. 1557 | ========== 1558 | Puppet 3 Beginner's Guide 1559 | - Your Highlight on page 51-51 | Added on Friday, 18 July 2014 11:58:58 1560 | 1561 | you want to restart a service some other way than just stopping and starting the service, you can give Puppet the command you want to use via the restart attribute. You can also specify custom service start and stop commands using the start and stop attributes 1562 | ========== 1563 | Clean Code 1564 | - Your Highlight on page 149-149 | Added on Friday, 18 July 2014 12:05:19 1565 | 1566 | The learning tests were precise experiments that helped increase our understanding 1567 | ========== 1568 | Clean Code 1569 | - Your Highlight on page 149-149 | Added on Friday, 18 July 2014 12:10:22 1570 | 1571 | Without these boundary tests to ease the migration, we might be tempted to stay with the old version longer than we should 1572 | ========== 1573 | Clean Code 1574 | - Your Highlight on page 151-151 | Added on Friday, 18 July 2014 12:15:00 1575 | 1576 | When we use code that is out of our control, special care must be taken to protect our investment and make sure future change is not too costly. 1577 | ========== 1578 | Clean Code 1579 | - Your Highlight on page 155-155 | Added on Friday, 18 July 2014 12:20:36 1580 | 1581 | Test code is just as important as production code. It 1582 | ========== 1583 | Clean Code 1584 | - Your Highlight on page 158-158 | Added on Friday, 18 July 2014 12:23:44 1585 | 1586 | These functions and utilities become a specialized API used by the tests. 1587 | ========== 1588 | Clean Code 1589 | - Your Highlight on page 162-162 | Added on Friday, 18 July 2014 12:43:22 1590 | 1591 | Perhaps a better rule is that we want to test a single concept in each test function 1592 | ========== 1593 | Clean Code 1594 | - Your Highlight on page 163-163 | Added on Friday, 18 July 2014 12:44:07 1595 | 1596 | Clean tests follow five other rules that form the above acronym 1597 | ========== 1598 | Clean Code 1599 | - Your Highlight on page 163-163 | Added on Friday, 18 July 2014 12:45:07 1600 | 1601 | If your tests aren’t repeatable in any environment, then you’ll always have an excuse for why they fail. You’ll also find yourself unable to run the tests when the environment isn’t available 1602 | ========== 1603 | Clean Code 1604 | - Your Highlight on page 164-164 | Added on Friday, 18 July 2014 12:45:31 1605 | 1606 | tests should be written just before the production code that makes them pass 1607 | ========== 1608 | Clean Code 1609 | - Your Highlight on page 167-167 | Added on Friday, 18 July 2014 12:46:51 1610 | 1611 | There is seldom a good reason to have a public variable 1612 | ========== 1613 | Clean Code 1614 | - Your Highlight on page 167-167 | Added on Friday, 18 July 2014 12:47:22 1615 | 1616 | We like to put the private utilities called by a public function right after the public function itself 1617 | ========== 1618 | Clean Code 1619 | - Your Highlight on page 170-170 | Added on Wednesday, 23 July 2014 10:15:28 1620 | 1621 | Trying to identify responsibilities (reasons to change) often helps us recognize and create better abstractions in our code. 1622 | ========== 1623 | Clean Code 1624 | - Your Highlight on page 170-170 | Added on Wednesday, 23 July 2014 10:16:10 1625 | 1626 | This is wholly appropriate. Maintaining a separation of concerns is just as important in our programming activities as it is in our programs 1627 | ========== 1628 | Clean Code 1629 | - Your Highlight on page 170-170 | Added on Wednesday, 23 July 2014 10:21:50 1630 | 1631 | However, a system with many small classes has no more moving parts than a system with a few large classes. There is just as much to learn in the system with a few large classes. So the question is: Do you want your tools organized into toolboxes with many small drawers each containing well-defined and well-labeled components? Or do you want a few drawers that you just toss everything into 1632 | ========== 1633 | Clean Code 1634 | - Your Highlight on page 172-172 | Added on Wednesday, 23 July 2014 10:24:39 1635 | 1636 | When classes lose cohesion, split them! 1637 | ========== 1638 | Puppet 3 Beginner's Guide 1639 | - Your Highlight on page 58-58 | Added on Wednesday, 23 July 2014 19:21:33 1640 | 1641 | The line you added to nginx.pp is useful; it tells Puppet to configure the nginx service so that it starts when 1642 | ========== 1643 | Puppet 3 Beginner's Guide 1644 | - Your Highlight on page 74-74 | Added on Thursday, 24 July 2014 11:11:45 1645 | 1646 | Puppet will not create this directory for you unless you also set the managehome attribute 1647 | ========== 1648 | Puppet 3 Beginner's Guide 1649 | - Your Highlight on page 74-74 | Added on Thursday, 24 July 2014 11:12:17 1650 | 1651 | Although Puppet can set passwords for users (with the password attribute) I recommend you use SSH authentication instead 1652 | ========== 1653 | Puppet 3 Beginner's Guide 1654 | - Your Highlight on page 74-74 | Added on Thursday, 24 July 2014 11:21:42 1655 | 1656 | To remove a user from the system altogether, use the ensure => absent attribute 1657 | ========== 1658 | Puppet 3 Beginner's Guide 1659 | - Your Highlight on page 76-76 | Added on Thursday, 24 July 2014 11:23:04 1660 | 1661 | You'll need your own SSH public key for this. If you already have one on your own computer, display the contents: 1662 | ========== 1663 | Puppet 3 Beginner's Guide 1664 | - Your Highlight on page 76-76 | Added on Thursday, 24 July 2014 11:23:31 1665 | 1666 | Edit your manifests/nodes.pp file as follows (using your own key string as the value for key): 1667 | ========== 1668 | Puppet 3 Beginner's Guide 1669 | - Your Highlight on page 77-77 | Added on Thursday, 24 July 2014 11:24:31 1670 | 1671 | following line declares an ssh_authorized_key resource 1672 | ========== 1673 | Puppet 3 Beginner's Guide 1674 | - Your Highlight on page 79-79 | Added on Thursday, 24 July 2014 11:26:28 1675 | 1676 | The value for key in the example above is an empty single-quoted string (''). This will disable SSH logins for the user. If you have enabled password authentication (which I don't recommend, but you might need it in some situations) then this won't stop the user from logging in using his password. To do this, set a password of a single star (* ) in Puppet 1677 | ========== 1678 | Puppet 3 Beginner's Guide 1679 | - Your Highlight on page 79-79 | Added on Thursday, 24 July 2014 11:28:33 1680 | 1681 | you can use Puppet to manage the global SSH configuration for your system, for example, to allow only a specified list of users to log in. 1682 | ========== 1683 | Puppet 3 Beginner's Guide 1684 | - Your Highlight on page 81-81 | Added on Thursday, 24 July 2014 11:29:46 1685 | 1686 | etc/sudoers. We can use Puppet to manage this file, and thus control user privileges on the machine 1687 | ========== 1688 | Puppet 3 Beginner's Guide 1689 | - Your Highlight on page 83-83 | Added on Thursday, 24 July 2014 11:30:57 1690 | 1691 | The line ubuntu ALL = (ALL) NOPASSWD:ALL allows user ubuntu to run any command, on any system, as any user, without having to enter a password 1692 | ========== 1693 | Puppet 3 Beginner's Guide 1694 | - Your Highlight on page 89-89 | Added on Friday, 25 July 2014 22:59:47 1695 | 1696 | can also use the unless or onlyif attributes to control when an exec is run. unless or onlyif both specify a command for Puppet to run to test whether the exec needs to be applied. 1697 | ========== 1698 | Puppet 3 Beginner's Guide 1699 | - Your Highlight on page 90-90 | Added on Friday, 25 July 2014 23:05:14 1700 | 1701 | Puppet will not apply the exec unless it's triggered by subscribe or notify from some other resource. In this example, the exec subscribes to the file /etc/icinga/icinga.cfg. If this file changes, Puppet will run the exec, but not otherwise. 1702 | ========== 1703 | Puppet 3 Beginner's Guide 1704 | - Your Highlight on page 91-91 | Added on Friday, 25 July 2014 23:09:09 1705 | 1706 | more complicated sequences, or where you may also need to trigger individual commands from other resources, you can use the require attribute to specify the ordering explicitly 1707 | ========== 1708 | Puppet 3 Beginner's Guide 1709 | - Your Highlight on page 92-92 | Added on Friday, 25 July 2014 23:10:20 1710 | 1711 | Note the capital E for Exec. This means "make this the default for all exec resources. " Then you can use unqualified commands without an explicit path attribute 1712 | ========== 1713 | Puppet 3 Beginner's Guide 1714 | - Your Highlight on page 92-92 | Added on Friday, 25 July 2014 23:11:13 1715 | 1716 | Puppet can manage cron jobs directly using the cron resource type 1717 | ========== 1718 | Puppet 3 Beginner's Guide 1719 | - Your Highlight on page 95-95 | Added on Friday, 25 July 2014 23:12:27 1720 | 1721 | The recurse attribute allows you to do this. We'll see how to use it in the next example. 1722 | ========== 1723 | Puppet 3 Beginner's Guide 1724 | - Your Highlight on page 96-96 | Added on Friday, 25 July 2014 23:26:55 1725 | 1726 | recurse => true attribute tells Puppet to copy all files and directories contained in the source 1727 | ========== 1728 | Puppet 3 Beginner's Guide 1729 | - Your Highlight on page 96-96 | Added on Friday, 25 July 2014 23:27:16 1730 | 1731 | In practice Puppet is rather slow to manage large file trees, because it has to examine every file in the tree on every run to determine if it is up to date with the source. In this situation, you might be better off using Git, for example, to manage large trees of files 1732 | ========== 1733 | Puppet 3 Beginner's Guide 1734 | - Your Highlight on page 99-99 | Added on Friday, 25 July 2014 23:29:06 1735 | 1736 | Note that when we refer to these variables in Puppet code, we use a $ prefix ($site_name), but in the template it's an @ prefix (@site_name). This is because in templates we're actually writing Ruby, not Puppet 1737 | ========== 1738 | Puppet 3 Beginner's Guide 1739 | - Your Highlight on page 102-102 | Added on Friday, 25 July 2014 23:30:51 1740 | 1741 | everything between the <%= and %> signs is Ruby code. So you can do math: 1742 | ========== 1743 | Puppet 3 Beginner's Guide 1744 | - Your Highlight on page 110-110 | Added on Friday, 25 July 2014 23:33:50 1745 | 1746 | better way is to group this pair of resources (the file and the cron job) and give them a name using the define keyword 1747 | ========== 1748 | Puppet 3 Beginner's Guide 1749 | - Your Highlight on page 111-111 | Added on Friday, 25 July 2014 23:35:10 1750 | 1751 | strings that do not contain variables should be enclosed in single quotes. Double quotes should be used when variable interpolation is required 1752 | ========== 1753 | Puppet 3 Beginner's Guide 1754 | - Your Highlight on page 112-112 | Added on Tuesday, 29 July 2014 13:31:03 1755 | 1756 | This results in a job that runs at midnight.However, if you pass in values for hour or minute, they will override the defaults 1757 | ========== 1758 | Clean Code 1759 | - Your Highlight on page 188-188 | Added on Tuesday, 29 July 2014 13:55:40 1760 | 1761 | True Dependency Injection goes one step further. The 1762 | ========== 1763 | Clean Code 1764 | - Your Highlight on page 188-188 | Added on Tuesday, 29 July 2014 13:56:10 1765 | 1766 | True Dependency Injection goes one step further. The class takes no direct steps to resolve its dependencies; it is completely passive. Instead, it provides setter methods or constructor arguments (or both) that are used to inject the dependencies 1767 | ========== 1768 | Clean Code 1769 | - Your Highlight on page 189-189 | Added on Tuesday, 29 July 2014 13:57:39 1770 | 1771 | It is a myth that we can get systems “right the first time.” Instead, we should implement only today’s stories, then refactor and expand the system to implement new stories tomorrow. This is the essence of iterative and incremental agility. Test-driven development, refactoring, and the clean code they produce make this work at the code level 1772 | ========== 1773 | Clean Code 1774 | - Your Highlight on page 198-198 | Added on Wednesday, 30 July 2014 11:48:33 1775 | 1776 | BDUF is even harmful because it inhibits adapting to change, due to the psychological resistance to discarding prior effort and because of the way architecture choices influence subsequent thinking about the design. 1777 | ========== 1778 | Clean Code 1779 | - Your Highlight on page 198-198 | Added on Wednesday, 30 July 2014 11:50:07 1780 | 1781 | However, we must maintain the ability to change course in response to evolving circumstances 1782 | ========== 1783 | Clean Code 1784 | - Your Highlight on page 198-198 | Added on Wednesday, 30 July 2014 11:50:29 1785 | 1786 | good API should largely disappear from view most of the time, so the team expends the majority of its creative efforts focused on the user stories being implemented. If not, then the architectural constraints will inhibit the efficient delivery of optimal value to the customer. 1787 | ========== 1788 | Clean Code 1789 | - Your Highlight on page 199-199 | Added on Wednesday, 30 July 2014 11:51:06 1790 | 1791 | postpone decisions until the last possible moment 1792 | ========== 1793 | Clean Code 1794 | - Your Highlight on page 199-199 | Added on Wednesday, 30 July 2014 11:51:18 1795 | 1796 | make informed choices with the best possible information. 1797 | ========== 1798 | Clean Code 1799 | - Your Highlight on page 200-200 | Added on Wednesday, 30 July 2014 11:54:04 1800 | 1801 | DSLs, when used effectively, raise the abstraction level above code idioms and design patterns. They allow the developer to reveal the intent of the code at the appropriate level of abstraction 1802 | ========== 1803 | Clean Code 1804 | - Your Highlight on page 203-203 | Added on Wednesday, 30 July 2014 11:55:21 1805 | 1806 | Runs all the tests • Contains no duplication • Expresses the intent of the programmer • Minimizes the number of classes and methods 1807 | ========== 1808 | Clean Code 1809 | - Your Highlight on page 204-204 | Added on Wednesday, 30 July 2014 12:06:52 1810 | 1811 | Duplication is the primary enemy of a well-designed system. It represents additional work, additional risk 1812 | ========== 1813 | Clean Code 1814 | - Your Highlight on page 205-205 | Added on Thursday, 31 July 2014 12:03:44 1815 | 1816 | This “reuse in the small” can cause system complexity to shrink dramatically. Understanding how to achieve reuse in the small is essential to achieving reuse in the large 1817 | ========== 1818 | Clean Code 1819 | - Your Highlight on page 207-207 | Added on Thursday, 31 July 2014 12:07:06 1820 | 1821 | although it’s important to keep class and function count low, it’s more important to have tests, eliminate duplication, and express yourself. 1822 | ========== 1823 | Clean Code 1824 | - Your Highlight on page 212-212 | Added on Thursday, 31 July 2014 12:14:01 1825 | 1826 | Keep your concurrency-related code separate from other code. 6 Corollary: Limit the Scope of Data As we saw, two threads modifying the same field of a shared object can interfere with each other, causing unexpected behavior. One solution is to use the synchronized keyword to protect a critical section in the code that uses the shared object. It is important to restrict the number of such critical sections. The more places shared data can get updated, the more likely: • You will forget to protect one or more of those places—effectively breaking all code that modifies that shared data. • There will be duplication of effort required to make sure everything is effectively guarded (violation of DRY 7 ). • It will be difficult to determine the source of failures, which are already hard enough to find. Recommendation: Take data encapsulation to heart; severely limit the access of any data that may be shared. Corollary: Use Copies of Data A good way to avoid shared data is to avoid sharing the data in the first place. In some situations it is possible to copy objects and treat them as read-only. In other cases it might be possible to copy objects, collect results from multiple threads in these copies and then merge the results in a single thread. 5. [PPP] 6. See “Client/Server Example” on page 317. 7. [PRAG]. www.it-ebooks.info 1827 | ========== 1828 | Clean Code 1829 | - Your Highlight on page 212-212 | Added on Thursday, 31 July 2014 12:14:31 1830 | 1831 | Keep your concurrency-related code separate from other code 1832 | ========== 1833 | Clean Code 1834 | - Your Highlight on page 212-212 | Added on Friday, 1 August 2014 09:15:55 1835 | 1836 | Take data encapsulation to heart; severely limit the access of any data that may be shared 1837 | ========== 1838 | Clean Code 1839 | - Your Highlight on page 215-215 | Added on Friday, 1 August 2014 09:21:15 1840 | 1841 | Dining Philosophers 11 1842 | ========== 1843 | Clean Code 1844 | - Your Highlight on page 216-216 | Added on Friday, 1 August 2014 09:22:57 1845 | 1846 | Keep your synchronized sections as small as possible. 1847 | ========== 1848 | Clean Code 1849 | - Your Highlight on page 217-217 | Added on Friday, 1 August 2014 09:24:05 1850 | 1851 | you must write concurrent code that involves shutting down gracefully, expect to spend much of your time getting the shutdown to happen correctly 1852 | ========== 1853 | Clean Code 1854 | - Your Highlight on page 217-217 | Added on Friday, 1 August 2014 09:24:17 1855 | 1856 | Think about shut-down early and get it working early. It’s going to take longer than you expect. Review existing algorithms because this is probably harder than you think. 1857 | ========== 1858 | Clean Code 1859 | - Your Highlight on page 217-217 | Added on Friday, 1 August 2014 09:24:33 1860 | 1861 | Testing does not guarantee correctness. However, good testing can minimize risk. 1862 | ========== 1863 | Clean Code 1864 | - Your Highlight on page 217-217 | Added on Friday, 1 August 2014 09:24:51 1865 | 1866 | Write tests that have the potential to expose problems and then run them frequently, with different programatic configurations and system configurations and load. If tests ever fail, track down the failure. Don’t ignore a failure just because the tests pass on a subsequent run. 1867 | ========== 1868 | Clean Code 1869 | - Your Highlight on page 218-218 | Added on Friday, 1 August 2014 09:25:38 1870 | 1871 | Getting the right balance of threads typically requires trial an error. Early on, find ways to time the performance of your system under different configurations 1872 | ========== 1873 | Clean Code 1874 | - Your Highlight on page 219-219 | Added on Friday, 1 August 2014 09:26:10 1875 | 1876 | Things happen when the system switches between tasks. To encourage task swapping, run with more threads than processors or cores. The more frequently your tasks swap, the more likely you’ll encounter code that is missing a critical section or causes deadlock 1877 | ========== 1878 | Clean Code 1879 | - Your Highlight on page 231-231 | Added on Friday, 1 August 2014 09:32:45 1880 | 1881 | am not expecting you to be able to write clean and elegant programs in one pass 1882 | ========== 1883 | Clean Code 1884 | - Your Highlight on page 317-317 | Added on Friday, 1 August 2014 09:40:14 1885 | 1886 | Redundant Comment 1887 | ========== 1888 | Clean Code 1889 | - Your Highlight on page 318-318 | Added on Friday, 1 August 2014 09:40:37 1890 | 1891 | A comment worth writing is worth writing well 1892 | ========== 1893 | Clean Code 1894 | - Your Highlight on page 319-319 | Added on Friday, 1 August 2014 09:42:46 1895 | 1896 | Multiple Languages in One Source File 1897 | ========== 1898 | Clean Code 1899 | - Your Highlight on page 333-333 | Added on Friday, 1 August 2014 09:48:38 1900 | 1901 | Avoid Negative Conditionals 1902 | ========== 1903 | Clean Code 1904 | - Your Highlight on page 337-337 | Added on Friday, 1 August 2014 09:49:30 1905 | 1906 | Keep Configurable Data at High Levels 1907 | ========== 1908 | Clean Code 1909 | - Your Highlight on page 337-337 | Added on Friday, 1 August 2014 12:06:50 1910 | 1911 | we don’t want a single module to know much about its collaborators. More 1912 | ========== 1913 | Puppet 3 Beginner's Guide 1914 | - Your Highlight on page 114-114 | Added on Friday, 1 August 2014 12:18:22 1915 | 1916 | So inside that package definition, $name will have the value nginx.Similarly, we declared this instance of nginx::website with the name adorable-animals: nginx::website { 'adorable-animals': So here, $name will have the value adorable-animals. We assign this value to the variable $site_name. 1917 | ========== 1918 | Puppet 3 Beginner's Guide 1919 | - Your Highlight on page 116-116 | Added on Friday, 1 August 2014 12:20:16 1920 | 1921 | should go in the file modules/nginx/manifests/loadbalancer.pp 1922 | ========== 1923 | Puppet 3 Beginner's Guide 1924 | - Your Highlight on page 116-116 | Added on Friday, 1 August 2014 12:20:24 1925 | 1926 | Each class should be stored in the modules/MODULE_NAME/manifests directory, in a file named after the class, with each file containing just one class. 1927 | ========== 1928 | Puppet 3 Beginner's Guide 1929 | - Your Highlight on page 116-116 | Added on Friday, 1 August 2014 12:20:33 1930 | 1931 | The exception is the class named after the module (for example, nginx). This should be in the file modules/nginx/manifests/init.pp. 1932 | ========== 1933 | Puppet 3 Beginner's Guide 1934 | - Your Highlight on page 116-116 | Added on Friday, 1 August 2014 12:21:04 1935 | 1936 | Alternatively, you can use require. This behaves just like include, except it specifies that everything in the required class must be applied immediately, before Puppet moves on to the next part of the code: 1937 | ========== 1938 | Puppet 3 Beginner's Guide 1939 | - Your Highlight on page 117-117 | Added on Friday, 1 August 2014 12:22:24 1940 | 1941 | Classes are singletons 1942 | ========== 1943 | Puppet 3 Beginner's Guide 1944 | - Your Highlight on page 117-117 | Added on Friday, 1 August 2014 12:22:46 1945 | 1946 | Definitions, by contrast, can have as many instances as you like 1947 | ========== 1948 | Puppet 3 Beginner's Guide 1949 | - Your Highlight on page 125-125 | Added on Friday, 1 August 2014 12:24:55 1950 | 1951 | unless is like if, but with the opposite sense. The block is not applied if the expression is true. An unless statement has this form 1952 | ========== 1953 | Puppet 3 Beginner's Guide 1954 | - Your Highlight on page 126-126 | Added on Friday, 1 August 2014 12:25:23 1955 | 1956 | situations like this, Puppet provides the case statement: 1957 | ========== 1958 | Puppet 3 Beginner's Guide 1959 | - Your Highlight on page 128-128 | Added on Friday, 1 August 2014 12:26:30 1960 | 1961 | situations like this, Puppet provides the selector, which is like a case statement, but instead of matching a case and applying a code block, it matches a case and returns a value. 1962 | ========== 1963 | Puppet 3 Beginner's Guide 1964 | - Your Highlight on page 129-129 | Added on Friday, 1 August 2014 12:37:49 1965 | 1966 | in tests whether the first operand is a substring of the other. For example, this expression 1967 | ========== 1968 | Puppet 3 Beginner's Guide 1969 | - Your Highlight on page 132-132 | Added on Friday, 1 August 2014 12:40:12 1970 | 1971 | The operator which tests whether a string matches a regex, as in the previous example, is the regex match operator, =~ 1972 | ========== 1973 | Puppet 3 Beginner's Guide 1974 | - Your Highlight on page 132-132 | Added on Friday, 1 August 2014 12:40:37 1975 | 1976 | particular flavor of regular expression language that Puppet recognizes is the same as that implemented by Ruby, so any valid Ruby regex is just fine with Puppet. You can find a good introduction to Ruby regular expression syntax here: 1977 | ========== 1978 | Puppet 3 Beginner's Guide 1979 | - Your Highlight on page 134-134 | Added on Friday, 1 August 2014 12:41:21 1980 | 1981 | regsubst function, which matches text with a regular expression and replaces it with the value you specify 1982 | ========== 1983 | Puppet 3 Beginner's Guide 1984 | - Your Highlight on page 142 | Added on Friday, 1 August 2014 12:42:29 1985 | 1986 | Hashes 1987 | ========== 1988 | Puppet 3 Beginner's Guide 1989 | - Your Highlight on page 144-144 | Added on Friday, 1 August 2014 13:05:14 1990 | 1991 | This facility in Puppet is called reporting 1992 | ========== 1993 | Puppet 3 Beginner's Guide 1994 | - Your Highlight on page 144-144 | Added on Friday, 1 August 2014 13:05:46 1995 | 1996 | --summarize flag to puppet apply 1997 | ========== 1998 | Puppet 3 Beginner's Guide 1999 | - Your Highlight on page 155-155 | Added on Friday, 1 August 2014 13:07:36 2000 | 2001 | Devops people like to say, "If it's not monitored, it's not in production 2002 | ========== 2003 | Puppet 3 Beginner's Guide 2004 | - Your Highlight on page 155-155 | Added on Friday, 1 August 2014 13:07:57 2005 | 2006 | your customers know the system is down before you do, then you don't have effective monitoring. 2007 | ========== 2008 | Puppet 3 Beginner's Guide 2009 | - Your Highlight on page 155-155 | Added on Friday, 1 August 2014 13:08:23 2010 | 2011 | Puppet has some built-in support for Nagios in particular 2012 | ========== 2013 | Puppet 3 Beginner's Guide 2014 | - Your Highlight on page 155-155 | Added on Friday, 1 August 2014 13:08:51 2015 | 2016 | PuppetDB, a central database that stores information about your nodes. 2017 | ========== 2018 | Puppet 3 Beginner's Guide 2019 | - Your Highlight on page 161-161 | Added on Friday, 1 August 2014 13:09:39 2020 | 2021 | print out debugging messages, or other information, use a notify resource, which simply prints out its name to the console during Puppet's run: notify { "I think my hostname is ${::hostname}": } 2022 | ========== 2023 | Puppet 3 Beginner's Guide 2024 | - Your Highlight on page 164-164 | Added on Friday, 1 August 2014 13:10:29 2025 | 2026 | when it comes to programming, conformity is a virtue 2027 | ========== 2028 | Puppet 3 Beginner's Guide 2029 | - Your Highlight on page 166-166 | Added on Friday, 1 August 2014 13:11:34 2030 | 2031 | One of the benefits of having your infrastructure managed by Puppet is that (in theory) you can look at the manifest and see what each machine does 2032 | ========== 2033 | Puppet 3 Beginner's Guide 2034 | - Your Highlight on page 172 | Added on Friday, 1 August 2014 13:14:16 2035 | 2036 | Projects 2037 | ========== 2038 | programming_amazon_ec2 2039 | - Your Highlight on page 6-6 | Added on Saturday, 2 August 2014 18:26:35 2040 | 2041 | RDS, a managed MySQL service 2042 | ========== 2043 | programming_amazon_ec2 2044 | - Your Highlight on page 7-7 | Added on Saturday, 2 August 2014 18:27:26 2045 | 2046 | 2001, the Agile Manifesto 2047 | ========== 2048 | programming_amazon_ec2 2049 | - Your Highlight on page 8-8 | Added on Saturday, 2 August 2014 18:29:42 2050 | 2051 | Elastic IP addresses to an instance, so if the instance dies or you replace it, you reassign the Elastic IP address 2052 | ========== 2053 | programming_amazon_ec2 2054 | - Your Highlight on page 8-8 | Added on Saturday, 2 August 2014 18:29:55 2055 | 2056 | With EBS, you can “carry around” your disks from instance to instance 2057 | ========== 2058 | programming_amazon_ec2 2059 | - Your Highlight on page 10-10 | Added on Saturday, 2 August 2014 18:45:05 2060 | 2061 | With Auto Scaling, you can set up an autoscaling group to manage a certain group of instances. The autoscaling group launches and terminates instances depending on triggers, for example on percentage of CPU utilization 2062 | ========== 2063 | programming_amazon_ec2 2064 | - Your Highlight on page 10-10 | Added on Saturday, 2 August 2014 18:45:27 2065 | 2066 | ELB’s scalability comes at a cost. The management overhead of this scaling adds latency to the transactions. But in the end, human labor is more expensive 2067 | ========== 2068 | programming_amazon_ec2 2069 | - Your Highlight on page 10-10 | Added on Saturday, 2 August 2014 18:46:10 2070 | 2071 | Google has BigTable and Amazon has SimpleDB 2072 | ========== 2073 | programming_amazon_ec2 2074 | - Your Highlight on page 11-11 | Added on Saturday, 2 August 2014 18:48:30 2075 | 2076 | You build it, you run it. This brings developers into contact with the day-to-day operation of their software. It also brings them into day-to-day contact with the customer. This customer feedback loop is essential for improving the quality of the service 2077 | ========== 2078 | programming_amazon_ec2 2079 | - Your Highlight on page 13-13 | Added on Saturday, 2 August 2014 19:02:03 2080 | 2081 | often misused for the purpose of deciding who is responsible for problems: development or operations 2082 | ========== 2083 | programming_amazon_ec2 2084 | - Your Highlight on page 19-19 | Added on Saturday, 2 August 2014 19:11:18 2085 | 2086 | With IAM, you can, for example, create users with a very limited set of rights 2087 | ========== 2088 | programming_amazon_ec2 2089 | - Your Highlight on page 22-22 | Added on Saturday, 2 August 2014 19:14:52 2090 | 2091 | Kulitzer architecture v1.0 2092 | ========== 2093 | programming_amazon_ec2 2094 | - Your Highlight on page 23-23 | Added on Saturday, 2 August 2014 19:17:40 2095 | 2096 | An AMI is like a boot CD. It contains the root image with everything necessary to start an instance 2097 | ========== 2098 | programming_amazon_ec2 2099 | - Your Highlight on page 23-23 | Added on Saturday, 2 August 2014 19:17:48 2100 | 2101 | publicly available AMIs, and you can create your own preconfigured one for your needs. 2102 | ========== 2103 | programming_amazon_ec2 2104 | - Your Highlight on page 24-24 | Added on Saturday, 2 August 2014 19:18:29 2105 | 2106 | S3-backed AMI cannot be stopped and started; they can only be restarted or terminated. 2107 | ========== 2108 | programming_amazon_ec2 2109 | - Your Highlight on page 24-24 | Added on Saturday, 2 August 2014 19:19:03 2110 | 2111 | EBS-backed instance can now be stopped and started, making it much easier to use the instance only when you need it 2112 | ========== 2113 | programming_amazon_ec2 2114 | - Your Highlight on page 25-25 | Added on Saturday, 2 August 2014 19:21:00 2115 | 2116 | Instances come in types. You can think of a type as the size of the instance 2117 | ========== 2118 | programming_amazon_ec2 2119 | - Your Highlight on page 26-26 | Added on Saturday, 2 August 2014 19:22:39 2120 | 2121 | For new users, there is a limit of 20 concurrent instances. If you need more than 20 instances, you request it from Amazon by filling out the Request to Increase Amazon EC2 Instance Limit form 2122 | ========== 2123 | programming_amazon_ec2 2124 | - Your Highlight on page 27-27 | Added on Saturday, 2 August 2014 19:24:16 2125 | 2126 | Several instances can use the same security group, which defines a kind of profile 2127 | ========== 2128 | AWS OpsWorks User Guide (Amazon Web Services) 2129 | - Your Highlight at location 91-92 | Added on Friday, 15 August 2014 09:32:07 2130 | 2131 | stack is the core AWS OpsWorks component. It is basically a container for AWS resources— 2132 | ========== 2133 | AWS OpsWorks User Guide (Amazon Web Services) 2134 | - Your Highlight at location 96-97 | Added on Friday, 15 August 2014 09:32:40 2135 | 2136 | A layer is basically a blueprint that specifies how to configure a set of Amazon EC2 instances for a particular purpose, 2137 | ========== 2138 | AWS OpsWorks User Guide (Amazon Web Services) 2139 | - Your Highlight at location 122-126 | Added on Friday, 15 August 2014 09:35:00 2140 | 2141 | Load-based instances are automatically started and stopped by AWS OpsWorks, based on specified load metrics, such as CPU utilization. They allow your stack to automatically adjust the number of instances to accommodate variations in incoming traffic. Time-based instances are run by AWS OpsWorks on a specified daily and weekly schedule. They allow your stack to automatically adjust the number of instances to accommodate predictable usage patterns. 2142 | ========== 2143 | AWS OpsWorks User Guide (Amazon Web Services) 2144 | - Your Highlight at location 126-127 | Added on Friday, 15 August 2014 09:35:11 2145 | 2146 | AWS OpsWorks automatically stops and restarts the instance. 2147 | ========== 2148 | AWS OpsWorks User Guide (Amazon Web Services) 2149 | - Your Highlight at location 163-164 | Added on Friday, 15 August 2014 09:43:55 2150 | 2151 | AWS Identity and Access Management (IAM) to provide robust ways of controlling how users access AWS OpsWorks, including the following: 2152 | ========== 2153 | AWS OpsWorks User Guide (Amazon Web Services) 2154 | - Your Highlight at location 171-174 | Added on Friday, 15 August 2014 09:44:44 2155 | 2156 | CloudWatch monitoring, which is summarized for your convenience on the OpsWorks Monitoring page. A Ganglia master layer that can be used to collect and display detailed monitoring data for the instances in your stack. An event log that lists all events in your stack. Chef logs that describe the details of what transpired for each lifecycle event on each instance, such as which recipes were run and what errors occurred. 2157 | ========== 2158 | AWS CloudHSM Getting Started Guide (Amazon Web Services) 2159 | - Your Highlight at location 21-22 | Added on Friday, 15 August 2014 09:47:38 2160 | 2161 | AWS CloudHSM helps you meet corporate, contractual and regulatory compliance requirements for data security by using dedicated HSM appliances within the AWS cloud. 2162 | ========== 2163 | Getting Started with AWS: Deploying a Web Application (Amazon Web Services) 2164 | - Your Highlight at location 60-61 | Added on Monday, 18 August 2014 10:13:05 2165 | 2166 | Amazon SNS is a push messaging service that can deliver notifications over various protocols. For our app, we'll push notifications to an email address. 2167 | ========== 2168 | Getting Started with AWS: Deploying a Web Application (Amazon Web Services) 2169 | - Your Highlight at location 116-116 | Added on Monday, 18 August 2014 10:17:56 2170 | 2171 | Elastic Beanstalk requires that your application be bundled as a .zip or .war 2172 | ========== 2173 | Amazon Redshift Getting Started Guide (Amazon Web Services) 2174 | - Your Highlight at location 37-37 | Added on Monday, 18 August 2014 10:21:59 2175 | 2176 | Amazon Redshift data warehouse service is to launch an Amazon Redshift cluster, 2177 | ========== 2178 | Amazon Redshift Getting Started Guide (Amazon Web Services) 2179 | - Your Highlight at location 75-77 | Added on Monday, 18 August 2014 10:23:23 2180 | 2181 | You will incur the standard Amazon Redshift usage fees for the cluster until you terminate it. If you complete the exercise described here in one sitting and terminate your cluster when you are finished, the total charges will be minimal. 2182 | ========== 2183 | AWS Data Pipeline Developer Guide (Amazon Web Services) 2184 | - Your Highlight at location 75-76 | Added on Monday, 18 August 2014 10:25:18 2185 | 2186 | With AWS Data Pipeline, you can define data-driven workflows, so that tasks can be dependent on the successful completion of previous tasks. 2187 | ========== 2188 | Amazon CloudSearch Developer Guide (Amazon Web Services) 2189 | - Your Highlight at location 69-69 | Added on Monday, 18 August 2014 10:28:31 2190 | 2191 | easy to set up, manage, and scale a search solution for your website or application. 2192 | ========== 2193 | Amazon CloudSearch Developer Guide (Amazon Web Services) 2194 | - Your Highlight at location 83-83 | Added on Monday, 18 August 2014 12:46:34 2195 | 2196 | search domain includes your searchable data and the search instances that handle your search requests. 2197 | ========== 2198 | Amazon CloudSearch Developer Guide (Amazon Web Services) 2199 | - Your Highlight at location 85-85 | Added on Monday, 18 August 2014 12:47:04 2200 | 2201 | Amazon CloudSearch indexes your data and deploys the search index to one or more search instances. 2202 | ========== 2203 | Elastic Load Balancing Developer Guide (Services, Amazon Web) 2204 | - Your Highlight at location 76-77 | Added on Wednesday, 27 August 2014 07:27:13 2205 | 2206 | Support for the sticky session feature, which is the ability to "stick" user sessions to specific Amazon EC2 instances. 2207 | ========== 2208 | Elastic Load Balancing Developer Guide (Services, Amazon Web) 2209 | - Your Highlight at location 84-85 | Added on Wednesday, 27 August 2014 07:28:01 2210 | 2211 | you pay for each hour or portion of an hour that the service is running, and you pay for each gigabyte of data that is transferred through your load balancer. 2212 | ========== 2213 | Amazon Simple Queue Service (SQS) Developer Guide (Services, Amazon Web) 2214 | - Your Highlight at location 57-58 | Added on Wednesday, 27 August 2014 07:35:48 2215 | 2216 | One of the resulting tradeoffs is that SQS does not guarantee first in, first out delivery of messages. 2217 | ========== 2218 | Amazon CloudSearch Developer Guide (Amazon Web Services) 2219 | - Your Highlight at location 122-123 | Added on Monday, 1 September 2014 19:59:20 2220 | 2221 | Whether the field is searchable (text and text-array fields are always searchable) 2222 | ========== 2223 | Amazon CloudSearch Developer Guide (Amazon Web Services) 2224 | - Your Highlight at location 131-131 | Added on Monday, 1 September 2014 19:59:58 2225 | 2226 | (This is often referred to as faceted navigation or faceted search.) 2227 | ========== 2228 | Amazon CloudSearch Developer Guide (Amazon Web Services) 2229 | - Your Highlight at location 133-134 | Added on Monday, 1 September 2014 20:00:20 2230 | 2231 | Only buckets that have matches are included in the facet results. 2232 | ========== 2233 | agile_contracts_primer 2234 | - Your Highlight on page 4-4 | Added on Saturday, 18 January 2014 06:17:44 2235 | 2236 | key difference is the approach to and understanding of operational process and delivery and how this is captured in or intersects with contracts 2237 | ========== 2238 | agile_contracts_primer 2239 | - Your Highlight on page 4-4 | Added on Saturday, 18 January 2014 06:19:00 2240 | 2241 | Contracts reflect people’s hopes and, especially, fears. Successful projects are not ultimately born from contracts, but from relationships based on collaboration, transparency, and trust.‘Successful’ contracts contain mechanisms that support the building of collaboration, transparency, and trust. As trust builds between a customer and supplier, the commercial and contract model should ‘relax’ to support increasing “customer collaboration over contract negotiation. ” 2242 | ========== 2243 | agile_contracts_primer 2244 | - Your Highlight on page 6-6 | Added on Saturday, 18 January 2014 06:23:40 2245 | 2246 | First, it is common that they view it as similar to a construction project—relatively predictable—rather than the highly uncertain and variable research and development that it usually is. 2247 | ========== 2248 | agile_contracts_primer 2249 | - Your Highlight on page 7-7 | Added on Saturday, 18 January 2014 06:28:37 2250 | 2251 | These assumptions are invalidated in agile development. 2252 | ========== 2253 | agile_contracts_primer 2254 | - Your Highlight on page 7-7 | Added on Saturday, 18 January 2014 06:29:25 2255 | 2256 | The first and perhaps most common misunderstanding is to misinterpret the agile values in terms of a false dichotomy; that is, “customer collaboration is good and contract negotiation is bad” rather than, to quote the Agile Manifesto, …while there is value in the items on the right, we value the items on the left more 2257 | ========== 2258 | agile_contracts_primer 2259 | - Your Highlight on page 8-8 | Added on Saturday, 18 January 2014 06:31:15 2260 | 2261 | The very thing the contract is ultimately about, the expectation of a deliverable (for example, software that will accelerate bills to be processed), is not in the top ten issues 2262 | ========== 2263 | agile_contracts_primer 2264 | - Your Highlight on page 9-9 | Added on Saturday, 18 January 2014 06:32:59 2265 | 2266 | win-win” approach is really what is mutually optimal 2267 | ========== 2268 | agile_contracts_primer 2269 | - Your Highlight on page 9-9 | Added on Monday, 20 January 2014 08:10:38 2270 | 2271 | without understanding the larger impact of their choices and actions or ignoring higher-level goals of the system. 2272 | ========== 2273 | agile_contracts_primer 2274 | - Your Highlight on page 9-9 | Added on Monday, 20 January 2014 08:11:10 2275 | 2276 | On this last point: Measurement and incentives not only inject dysfunction and locally optimizing behavior into project delivery, they do likewise in contract writing. If professionals in a legal department are rewarded on the basis of legal outcomes, there may be fewer legal issues—but not greater project success 2277 | ========== 2278 | agile_contracts_primer 2279 | - Your Highlight on page 9-9 | Added on Monday, 20 January 2014 08:17:41 2280 | 2281 | also of the legal professionals’ ability to foster a framework for collaboration and success 2282 | ========== 2283 | agile_contracts_primer 2284 | - Your Highlight on page 10-10 | Added on Monday, 20 January 2014 08:18:48 2285 | 2286 | how important are they in the larger picture of ensuring the success of the underlying focus of the contract—the project? There is an amusing story [Parkinson57] told by the British civil servant, C. Northcote Parkinson, illustrating his Law of Triviality: Time spent on any item of an agenda is inversely proportional to the cost of the item. He shares the story of a government steering committee with two items on the agenda: 1) the choice of technology for a nuclear power plant, and 2) the choice of coffee for the meetings. The government mandarins, overwhelmed by the technical complexities and science, quickly pass the technology recommendation of the advising engineer, but everybody has an opinion on the coffee—and wants to discuss it at length. A similar dynamic plays out amongst lawyers writing project contracts: There is an inverse relationship between time spent on the terms that are being negotiated and what is being dealt with on a day-to-day level during execution of the project. But there is good news with respect to negotiating issues: An agile and iterative approach can—by design—decrease risk.Therefore, pressure on negotiating “big issue” terms (such as liability) is alleviated because agile methods imply early and frequent incremental delivery of done slices of the system. The early feedback and delivery of a working system every two weeks (for example) fundamentally changes the dynamics behind negotiating some terms, whose excruciating negotiation in traditional ‘waterfall’ projects is driven by the assumption (and fear) of a long delay before delivery. One can understand how extreme pressure comes to bear on articulating terms, when viewed in the light of a big “all or nothing” delivery model. Because of the small, iterative nature of deliverables in an agile approach and the ability to stop the project at any two-week boundary (since each incrementally small slice of the system is done and potentially deployable or ‘shippable’), there should be less pressure on concepts such as liability multiples and indemnity. In The Fifth Discipline, Peter Senge states that systems thinking and a learning organization are ultimately aimed at building “…organizations where people continually expand their capacity to create results they truly desire, where new and expansive patterns of thinking are nurtured, where collec-10 2287 | ========== 2288 | agile_contracts_primer 2289 | - Your Highlight on page 10-10 | Added on Monday, 20 January 2014 23:25:17 2290 | 2291 | An agile and iterative approach can—by design—decrease risk 2292 | ========== 2293 | agile_contracts_primer 2294 | - Your Highlight on page 11-11 | Added on Monday, 20 January 2014 23:27:11 2295 | 2296 | …Lawyers study the impact of potentially deployable two-week increments on assumptions and contracts 2297 | ========== 2298 | agile_contracts_primer 2299 | - Your Highlight on page 11-11 | Added on Monday, 20 January 2014 23:28:29 2300 | 2301 | This means that a supplier cannot fully be comfortable with the deliverable until the end of the project, and may not therefore be able to recognize total order value until the final deliverable. 2302 | ========== 2303 | agile_contracts_primer 2304 | - Your Highlight on page 11-11 | Added on Monday, 20 January 2014 23:29:14 2305 | 2306 | aims to build not partial components of a project iteratively, but rather to build a deployable working model of value to the customer that can be accepted and used at each two-week iteration 2307 | ========== 2308 | agile_contracts_primer 2309 | - Your Highlight on page 11-11 | Added on Monday, 20 January 2014 23:29:48 2310 | 2311 | agile model of delivering a useful deployable system after each short iteration 2312 | ========== 2313 | agile_contracts_primer 2314 | - Your Highlight on page 12-12 | Added on Monday, 20 January 2014 23:31:23 2315 | 2316 | The customer has something of value that she has paid for and accepted 2317 | ========== 2318 | agile_contracts_primer 2319 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:33:57 2320 | 2321 | An agile approach contemplates that requirements will be articulated in an iterative and evolutionary manner so that time and money is not wasted in developing software for requirements that are not ultimately needed 2322 | ========== 2323 | agile_contracts_primer 2324 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:35:10 2325 | 2326 | money may be better spent for requirements that were not recognized at the beginning 2327 | ========== 2328 | agile_contracts_primer 2329 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:35:34 2330 | 2331 | Requirements identified and developed in a sequential-development project may never be used, because they were ill-conceived or lacked effective engagement with real users. 2332 | ========== 2333 | agile_contracts_primer 2334 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:36:00 2335 | 2336 | that “conforms to the contract,” requirements still need to be added to meet the true needs. From a contractual perspective, this means that a contract based on a sequential 2337 | ========== 2338 | agile_contracts_primer 2339 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:36:24 2340 | 2341 | a contractual perspective, this means that a contract based on a sequential approach will actually increase 2342 | ========== 2343 | agile_contracts_primer 2344 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:36:34 2345 | 2346 | From a contractual perspective, this means that a contract based on a sequential approach will actually increase the risk that the client pays more and gets less than she expects 2347 | ========== 2348 | agile_contracts_primer 2349 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:37:35 2350 | 2351 | The attendant contract will not protect against this scenario but will actually promote it by incorrectly assuming that it is quite possible to define and deliver a large set of requirements without ongoing feedback and evolution of understanding. 2352 | ========== 2353 | agile_contracts_primer 2354 | - Your Highlight on page 13-13 | Added on Monday, 20 January 2014 23:39:20 2355 | 2356 | Hence, once a lawyer knows about agile principles, she will be neglectful if she does not protect her client’s interests by continuing to allow (by continuing to write traditional contracts) that client to pay for what she doesn’t need and then allowing that client to pay extra to realize what she truly needed 2357 | ========== 2358 | agile_contracts_primer 2359 | - Your Highlight on page 14-14 | Added on Tuesday, 21 January 2014 01:03:41 2360 | 2361 | Heighten lawyer sensitivity to software project complexity by analogies to legal work 2362 | ========== 2363 | agile_contracts_primer 2364 | - Your Highlight on page 14-14 | Added on Tuesday, 21 January 2014 01:04:20 2365 | 2366 | want a fully complete project contract for my new project: A new enterprise-wide financial management system that will probably involve around 200 development people in six countries involving four outsourcing service providers never used before, and that takes between two and four years to complete. To the exact hour, how long will it take you to negotiate and write the contract with the four providers? To the exact word count, how many words will be in the contract? What will be the exact cost?” 2367 | ========== 2368 | agile_contracts_primer 2369 | - Your Highlight on page 15-15 | Added on Tuesday, 21 January 2014 01:05:41 2370 | 2371 | there is ample evidence incentives lead to increased gaming, a reduction in transparency and quality, and other dysfunctions. Research was summarized in the Organization chapter of our book Scaling Lean & Agile Development. 2372 | ========== 2373 | agile_contracts_primer 2374 | - Your Highlight on page 16-16 | Added on Tuesday, 21 January 2014 01:12:00 2375 | 2376 | Contract lawyers need to understand the Definition of Done because it changes how agile contacts are framed, and how projects are done. In short, the Scrum Definition of Done defines the “doneness” of the product increment each iteration in terms of activities and artifacts 2377 | ========== 2378 | agile_contracts_primer 2379 | - Your Highlight on page 16-16 | Added on Tuesday, 21 January 2014 01:12:34 2380 | 2381 | coded, integrated, functional/performance/usability tested, documented 2382 | ========== 2383 | agile_contracts_primer 2384 | - Your Highlight on page 19-19 | Added on Tuesday, 21 January 2014 01:17:16 2385 | 2386 | However, the content of these topics in the contract—and legal professional’s mindset behind it—contains elements that support collaboration, learning, and evolution. 2387 | ========== 2388 | agile_contracts_primer 2389 | - Your Highlight on page 19-19 | Added on Tuesday, 21 January 2014 01:17:53 2390 | 2391 | At the end of each two-week (or up to four-week) timeboxed iteration, deliver a deployable system with useful features. – it may have insufficient functionality to be of interest to deploy, but each cycle it is closer to interesting deployment 2392 | ========== 2393 | agile_contracts_primer 2394 | - Your Highlight on page 20-20 | Added on Tuesday, 21 January 2014 01:18:24 2395 | 2396 | doneness and deployability—each iteration delivery is done, programmed, tested, and so on, and is in theory deployable - duration—smaller, usually two weeks - timeboxing—fixed time but variable scope 2397 | ========== 2398 | agile_contracts_primer 2399 | - Your Highlight on page 20-20 | Added on Tuesday, 21 January 2014 01:26:10 2400 | 2401 | Agile contracts do not define an exact and unchanging project scope 2402 | ========== 2403 | agile_contracts_primer 2404 | - Your Highlight on page 20-20 | Added on Tuesday, 21 January 2014 01:26:56 2405 | 2406 | target-cost contracts, in which the overall project scope and details are identified at the start as best as possible 2407 | ========== 2408 | agile_contracts_primer 2409 | - Your Highlight on page 20-20 | Added on Tuesday, 21 January 2014 01:27:20 2410 | 2411 | progressive contracts, in which no (necessary) scope is defined beyond one iteration 2412 | ========== 2413 | agile_contracts_primer 2414 | - Your Highlight on page 21-21 | Added on Monday, 9 March 2015 20:44:58 2415 | 2416 | The issue of change is largely inherently addressed within the overall philosophy of an agile approach because of a re-prioritizable backlog and adaptive iterative planning 2417 | ========== 2418 | agile_contracts_primer 2419 | - Your Highlight on page 21-21 | Added on Monday, 9 March 2015 20:46:50 2420 | 2421 | change in relationships between parties 2422 | ========== 2423 | agile_contracts_primer 2424 | - Your Highlight on page 21-21 | Added on Monday, 9 March 2015 20:47:22 2425 | 2426 | change in project scope – This area requires the most care in contracting, to prevent subverting the point of agile development: to make change easy and frequent in the collaboration between customer and vendor. Avoid mandating change-management boards, change requests, or special change processes. – But, as with project scope, there are variations in change-management flexibility, ranging from high flexibility without penalty when using flexible-scope progressive contracts, to medium flexibility with shared gain/pain when using target-cost models. 2427 | ========== 2428 | agile_contracts_primer 2429 | - Your Highlight on page 21-21 | Added on Monday, 9 March 2015 20:47:50 2430 | 2431 | early termination should be viewed as a positive, desirable event in an agile project 2432 | ========== 2433 | agile_contracts_primer 2434 | - Your Highlight on page 22-22 | Added on Monday, 9 March 2015 20:48:38 2435 | 2436 | both parties will have clear and up-to-date views on the state of the deliverable. These are crucial points for legal professionals to grasp 2437 | ========== 2438 | agile_contracts_primer 2439 | - Your Highlight on page 22-22 | Added on Monday, 9 March 2015 20:49:45 2440 | 2441 | Is it done?”—“What to do if not done?”—“We have now decided to change our minds and reject the iteration delivery from three iterations ago. Do you mind 2442 | ========== 2443 | agile_contracts_primer 2444 | - Your Highlight on page 22-22 | Added on Monday, 9 March 2015 20:50:08 2445 | 2446 | Clarity (in so far as practically feasible) regarding doneness, acceptance, and correction both in the minds of the parties and the contract language should be a leading concern for legal professionals 2447 | ========== 2448 | agile_contracts_primer 2449 | - Your Highlight on page 22-22 | Added on Monday, 9 March 2015 20:50:24 2450 | 2451 | negotiating a contractual framework for acceptance that encourages collaboration 2452 | ========== 2453 | agile_contracts_primer 2454 | - Your Highlight on page 22-22 | Added on Monday, 9 March 2015 20:51:14 2455 | 2456 | only the framework for acceptance must be contractually clear 2457 | ========== 2458 | agile_contracts_primer 2459 | - Your Highlight on page 22-22 | Added on Monday, 9 March 2015 20:51:53 2460 | 2461 | Legal professionals concerned with a successful project should ask, “Are the right people—the hands-on users—involved in acceptance, and at each iteration are they collaborating with the supplier?” 22 2462 | ========== 2463 | agile_contracts_primer 2464 | - Your Highlight on page 23-23 | Added on Monday, 9 March 2015 20:52:24 2465 | 2466 | Sample clauses 2467 | ========== 2468 | agile_contracts_primer 2469 | - Your Highlight on page 24-24 | Added on Monday, 9 March 2015 21:02:09 2470 | 2471 | an agile approach, the same problematic bills could be sent. But it is also possible that those bills would be sent early to a much smaller subset of customers, using an early release of the system with just-sufficient functionality to field-test this critical feature 2472 | ========== 2473 | agile_contracts_primer 2474 | - Your Highlight on page 24 | Added on Monday, 9 March 2015 21:02:55 2475 | 2476 | Warranty 2477 | ========== 2478 | agile_contracts_primer 2479 | - Your Highlight on page 24-24 | Added on Monday, 9 March 2015 21:03:38 2480 | 2481 | leads to an increase in waste activities rather than a focus on working software, and there is a presumption—possibly untrue—of knowing what artifacts are valuable. - There is a focus on negotiating and conforming to “quality plans” rather than cooperating to create useful software24 2482 | ========== 2483 | agile_contracts_primer 2484 | - Your Highlight on page 25-25 | Added on Monday, 9 March 2015 21:04:46 2485 | 2486 | reinforces (the illusory) command-control predictive-planning mindset rather than learning and responding to change. - It reinforces the (untrue) belief that a fully defined system can be predictably ordered and delivered as though it were a meal in a restaurant rather than creative discovery work. 2487 | ========== 2488 | agile_contracts_primer 2489 | - Your Highlight on page 25-25 | Added on Tuesday, 10 March 2015 10:14:33 2490 | 2491 | On occasion, technical documentation to support maintenance is valuable 2492 | ========== 2493 | agile_contracts_primer 2494 | - Your Highlight on page 25-25 | Added on Tuesday, 10 March 2015 10:15:36 2495 | 2496 | could be wasteful to require it as an early deliverable. 2497 | ========== 2498 | agile_contracts_primer 2499 | - Your Highlight on page 25-25 | Added on Tuesday, 10 March 2015 10:16:21 2500 | 2501 | after the system is finished. 2502 | ========== 2503 | agile_contracts_primer 2504 | - Your Highlight on page 25-25 | Added on Tuesday, 10 March 2015 10:16:52 2505 | 2506 | Timing of Payment 2507 | ========== 2508 | agile_contracts_primer 2509 | - Your Highlight on page 26-26 | Added on Tuesday, 10 March 2015 10:19:51 2510 | 2511 | Fixed price per iteration (per unit of time 2512 | ========== 2513 | agile_contracts_primer 2514 | - Your Highlight on page 26-26 | Added on Tuesday, 10 March 2015 10:21:09 2515 | 2516 | key issue (or cost) for customers is that the supplier adds a contingency fee to the rate because of the risk associated with variability in research and development work. 2517 | ========== 2518 | agile_contracts_primer 2519 | - Your Highlight on page 27-27 | Added on Tuesday, 10 March 2015 10:23:51 2520 | 2521 | pay-per-use contracts with their customers 2522 | ========== 2523 | agile_contracts_primer 2524 | - Your Highlight on page 29-29 | Added on Tuesday, 10 March 2015 10:25:51 2525 | 2526 | Avoid…Fixed-price, fixed-scope (FPFS) contracts 2527 | ========== 2528 | agile_contracts_primer 2529 | - Your Highlight on page 29-29 | Added on Tuesday, 10 March 2015 10:29:10 2530 | 2531 | suppliers can easily lose money. And in an effort to deliver something within the constraints of price and scope, suppliers will often degrade the quality of their work 2532 | ========== 2533 | agile_contracts_primer 2534 | - Your Highlight on page 30-30 | Added on Tuesday, 10 March 2015 10:30:42 2535 | 2536 | supplier generates further revenue—in India, outsourcers call this ‘rent’—through a series of follow-on change requests, each for an additional cost beyond the original fixed price 2537 | ========== 2538 | agile_contracts_primer 2539 | - Your Highlight on page 31-31 | Added on Tuesday, 10 March 2015 10:34:41 2540 | 2541 | Do not allow any changes in requirements or scope, or only allow new requirements to displace existing requirements if they are of equal effort 2542 | ========== 2543 | agile_contracts_primer 2544 | - Your Highlight on page 31-31 | Added on Tuesday, 10 March 2015 10:35:05 2545 | 2546 | Increase the margin of the contract price, to reflect the significant risk inherent in FPFS software development—a domain that is fraught with discovery, variability, and nasty surprises. - Employ experienced domain experts with towering technical excellence 2547 | ========== 2548 | agile_contracts_primer 2549 | - Your Highlight on page 31-31 | Added on Tuesday, 10 March 2015 10:36:26 2550 | 2551 | displace existing requirements with new ones of equal effort 2552 | ========== 2553 | agile_contracts_primer 2554 | - Your Highlight on page 31-31 | Added on Tuesday, 10 March 2015 10:36:50 2555 | 2556 | Customer may request additional releases at any time, priced with T&M. 2557 | ========== 2558 | agile_contracts_primer 2559 | - Your Highlight on page 32-32 | Added on Tuesday, 10 March 2015 10:37:21 2560 | 2561 | Customer may terminate early if satisfied early, for a payment to supplier of 20% of remaining unbilled value 2562 | ========== 2563 | agile_contracts_primer 2564 | - Your Highlight on page 32-32 | Added on Tuesday, 10 March 2015 10:37:44 2565 | 2566 | There is evidence that sequential life cycle development is correlated with higher cost, slower delivery, lower productivity, more defects, or higher failure rates, compared with iterative, incremental, or agile methods 2567 | ========== 2568 | agile_contracts_primer 2569 | - Your Highlight on page 33-33 | Added on Tuesday, 10 March 2015 10:39:13 2570 | 2571 | Try…Variable-price variable-scope progressive contracts 2572 | ========== 2573 | agile_contracts_primer 2574 | - Your Highlight on page 33-33 | Added on Tuesday, 10 March 2015 10:43:51 2575 | 2576 | Contract Evolution on a Large Agile Project 2577 | ========== 2578 | agile_contracts_primer 2579 | - Your Highlight on page 34-34 | Added on Tuesday, 10 March 2015 10:48:28 2580 | 2581 | the goals for iteration N are clarified during iteration N-2 2582 | ========== 2583 | agile_contracts_primer 2584 | - Your Highlight on page 34-34 | Added on Tuesday, 10 March 2015 10:48:55 2585 | 2586 | price variable-scope progressive contract is common; there is an overall project price cap 2587 | ========== 2588 | agile_contracts_primer 2589 | - Your Highlight on page 34-34 | Added on Tuesday, 10 March 2015 10:49:16 2590 | 2591 | This backlog is included as an appendix to the contract.However, it is agreed that nothing in the original backlog is binding 2592 | ========== 2593 | agile_contracts_primer 2594 | - Your Highlight on page 35-35 | Added on Tuesday, 10 March 2015 10:49:59 2595 | 2596 | frequent pattern (not a recommendation) is 1. 2.early contracts that are variations of fixed price and fixed scope later, a shift to progressive contracts with simple T&M or capped T&M per iteration 2597 | ========== 2598 | agile_contracts_primer 2599 | - Your Highlight on page 35-35 | Added on Tuesday, 10 March 2015 10:54:43 2600 | 2601 | …Increase flexibility in project and contract variables 2602 | ========== 2603 | agile_contracts_primer 2604 | - Your Highlight on page 35-35 | Added on Tuesday, 10 March 2015 11:12:29 2605 | 2606 | If trust is low, customers can bound their risk (and fear) by using a series of short-duration, flexible contracts. For example, one year-long, fixed-price, fixed-date, variable-scope contract may be viewed with trepidation. But a series of two-month, fixed-price, fixed-date, variable-scope contracts—with the ability to terminate at the end any cycle—is more palatable 2607 | ========== 2608 | Plano de Negócios_Como Elaborar_Sebrae_2013 2609 | - Your Highlight on page 19-19 | Added on Friday, 13 March 2015 16:28:25 2610 | 2611 | sumário contendo seus pontos mais importantes 2612 | ========== 2613 | Plano de Negócios_Como Elaborar_Sebrae_2013 2614 | - Your Highlight on page 19-19 | Added on Friday, 13 March 2015 16:28:43 2615 | 2616 | Missão da empresa 2617 | ========== 2618 | agile_contracts_primer 2619 | - Your Highlight on page 36-36 | Added on Monday, 16 March 2015 13:54:35 2620 | 2621 | They are used in Toyota with their suppliers, reflecting the pillar of respect for people in lean thinking 2622 | ========== 2623 | agile_contracts_primer 2624 | - Your Highlight on page 36-36 | Added on Monday, 16 March 2015 13:55:06 2625 | 2626 | target-cost contracts must realistically account for overall effort and cost as best as possible.20. That usually means placing requirement-related risks (‘what’) in the hands of the customer, and placing implementation and technical-related risks (‘how’) in the hands of the supplier36 2627 | ========== 2628 | agile_contracts_primer 2629 | - Your Highlight on page 37-37 | Added on Monday, 16 March 2015 13:57:17 2630 | 2631 | As will be seen, Adjustment may be positive or negative 2632 | ========== 2633 | agile_contracts_primer 2634 | - Your Highlight on page 39-39 | Added on Monday, 16 March 2015 14:02:28 2635 | 2636 | One Valtech multi-phase variable-model example reflects the common Scrum pattern 2637 | ========== 2638 | AgileINAFlash 2639 | - Your Highlight on page 22-22 | Added on Monday, 16 March 2015 14:08:47 2640 | 2641 | o y o t a Production System (TPS) Principles 2642 | ========== 2643 | AgileINAFlash 2644 | - Your Highlight on page 43-43 | Added on Monday, 16 March 2015 19:21:22 2645 | 2646 | cards are tokens; the card isn’t the real thing—it’s a placeholder for the real thing 2647 | ========== 2648 | AgileINAFlash 2649 | - Your Highlight on page 46-46 | Added on Monday, 16 March 2015 19:22:53 2650 | 2651 | Acceptable Acceptance T e s t 2652 | ========== 2653 | AgileINAFlash 2654 | - Your Highlight on page 49-49 | Added on Monday, 16 March 2015 19:24:16 2655 | 2656 | A failing production AT should trigger a stop-the-production-line mentality. 2657 | ========== 2658 | AgileINAFlash 2659 | - Your Highlight on page 50-50 | Added on Monday, 16 March 2015 19:24:37 2660 | 2661 | Story Estimation Fundamentals 2662 | ========== 2663 | AgileINAFlash 2664 | - Your Highlight on page 54-54 | Added on Monday, 16 March 2015 19:25:19 2665 | 2666 | Iterate with Principle 2667 | ========== 2668 | AgileINAFlash 2669 | - Your Highlight on page 56-56 | Added on Monday, 16 March 2015 19:26:28 2670 | 2671 | Communication-SMITH with Information Radiators 2672 | ========== 2673 | AgileINAFlash 2674 | - Your Highlight on page 58-58 | Added on Monday, 16 March 2015 19:27:34 2675 | 2676 | Shu-Ha-Ri 2677 | ========== 2678 | AgileINAFlash 2679 | - Your Highlight on page 67-67 | Added on Monday, 16 March 2015 19:30:14 2680 | 2681 | prevent participants from predetermining solutions. The team can then analyze the facts to uncover the underlying problem they must tackle. Only then should they discuss solutions and plan a course of action. 2682 | ========== 2683 | AgileINAFlash 2684 | - Your Highlight on page 72-72 | Added on Monday, 16 March 2015 19:31:10 2685 | 2686 | Collective Code Ownership 2687 | ========== 2688 | AgileINAFlash 2689 | - Your Highlight on page 74-74 | Added on Monday, 16 March 2015 19:31:42 2690 | 2691 | Coding Standards 2692 | ========== 2693 | AgileINAFlash 2694 | - Your Highlight on page 76-76 | Added on Monday, 16 March 2015 19:33:31 2695 | 2696 | Is Y o u r T e a m Circling the Drain? 2697 | ========== 2698 | AgileINAFlash 2699 | - Your Highlight on page 80-80 | Added on Monday, 16 March 2015 19:37:00 2700 | 2701 | Stop the Bad T e s t Death Spiral 2702 | ========== 2703 | AgileINAFlash 2704 | - Your Highlight on page 83-83 | Added on Monday, 16 March 2015 19:37:33 2705 | 2706 | Stay professional As long as you are on the job, you are an ambassador of your profession. Learn and model those attitudes, skills, and techniques that improve the quality of work for the team (including customers and managers). As much as possible, be helpful and diligent in your work. Remember that you are building a reputation, and make it a good one. 2707 | ========== 2708 | AgileINAFlash 2709 | - Your Highlight on page 84-84 | Added on Monday, 16 March 2015 19:37:51 2710 | 2711 | Eight Crucial Practices of Agile Programmers 2712 | ========== 2713 | AgileINAFlash 2714 | - Your Highlight on page 86-86 | Added on Monday, 16 March 2015 19:38:13 2715 | 2716 | Build Superior Systems with Simple Design 2717 | ========== 2718 | AgileINAFlash 2719 | - Your Highlight on page 92-92 | Added on Monday, 16 March 2015 19:39:18 2720 | 2721 | A Rhythm f o r Success: The TDD Cycle 2722 | ========== 2723 | AgileINAFlash 2724 | - Your Highlight on page 98-98 | Added on Monday, 16 March 2015 19:41:16 2725 | 2726 | Prevent Code Rot Through Refactoring 2727 | ========== 2728 | AgileINAFlash 2729 | - Your Highlight on page 100-100 | Added on Monday, 16 March 2015 19:41:50 2730 | 2731 | Refactoring Inhibitors 2732 | ========== 2733 | AgileINAFlash 2734 | - Your Highlight on page 101-101 | Added on Monday, 16 March 2015 19:42:05 2735 | 2736 | Make it run, make it right, and only then make it fast. 2737 | ========== 2738 | AgileINAFlash 2739 | - Your Highlight on page 102-102 | Added on Monday, 16 March 2015 19:43:35 2740 | 2741 | Field Guide to Mocks 2742 | ========== 2743 | Getting Started with Laravel 4 2744 | - Your Highlight on page 11-11 | Added on Tuesday, 7 April 2015 10:00:30 2745 | 2746 | it is possible to attach filter functions that are executed on particular routes 2747 | ========== 2748 | Getting Started with Laravel 4 2749 | - Your Highlight on page 11-11 | Added on Tuesday, 7 April 2015 10:00:52 2750 | 2751 | Laravel lets you define settings for each environment and then automatically selects the right settings depending on where the app is running 2752 | ========== 2753 | Getting Started with Laravel 4 2754 | - Your Highlight on page 12-12 | Added on Tuesday, 7 April 2015 10:04:02 2755 | 2756 | Since user authentication is such a common feature in web applications, Laravel provides you with the tools to register, authenticate, and even send password reminders to users 2757 | ========== 2758 | Getting Started with Laravel 4 2759 | - Your Highlight on page 12-12 | Added on Tuesday, 7 April 2015 10:04:55 2760 | 2761 | Queues: Laravel integrates with several queue services, such as Amazon SQS and IronMQ, to allow you to delay resource-intensive tasks, such as the e-mailing of a large number of users, and run them in the background rather than keep the user waiting for the task to complete 2762 | ========== 2763 | Getting Started with Laravel 4 2764 | - Your Highlight on page 12-12 | Added on Tuesday, 7 April 2015 10:05:02 2765 | 2766 | Redis: It is an in-memory key-value store that has a reputation for being extremely fast. If you give Laravel a Redis instance that it can connect to, it can use it as a session and general-purpose cache and also give you the possibility to interact with it directly. • Queues: Laravel integrates with several queue services, such as Amazon SQS and IronMQ, to allow you to delay resource-intensive tasks, such as the e-mailing of a large number of users, and run them in the background rather than keep the user waiting for the task to complete. Expressiveness and simplicity At the heart of Laravel's philosophy is simplicity and expressiveness. This means that particular attention has been given to the naming of classes to effectively convey their actions in plain English. Consider the following code example: where('id, '[0-9]+'); Downloading the example code You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.[ 12 ] www.it-ebooks.info 2767 | ========== 2768 | Getting Started with Laravel 4 2769 | - Your Highlight on page 12 | Added on Tuesday, 7 April 2015 10:05:26 2770 | 2771 | Queues 2772 | ========== 2773 | Getting Started with Laravel 4 2774 | - Your Highlight on page 12 | Added on Tuesday, 7 April 2015 10:05:36 2775 | 2776 | Redis 2777 | ========== 2778 | Getting Started with Laravel 4 2779 | - Your Highlight on page 18-18 | Added on Tuesday, 7 April 2015 10:10:04 2780 | 2781 | Every single one of them is meant to be reusable and used independently from the framework 2782 | ========== 2783 | Getting Started with Laravel 4 2784 | - Your Highlight on page 24-24 | Added on Tuesday, 7 April 2015 10:18:20 2785 | 2786 | gitkeep file. 2787 | ========== 2788 | Getting Started with Laravel 4 2789 | - Your Highlight on page 26-26 | Added on Tuesday, 7 April 2015 10:19:42 2790 | 2791 | composer install 2792 | ========== 2793 | Getting Started with Laravel 4 2794 | - Your Highlight on page 27-27 | Added on Tuesday, 7 April 2015 10:20:52 2795 | 2796 | Composer's diagnose command and the verbosity flags (-v|vv|vvv) can help you identify common problems and will make it easier for people to help you on IRC, Stack Overflow, and forums 2797 | ========== 2798 | Getting Started with Laravel 4 2799 | - Your Highlight on page 31-31 | Added on Tuesday, 7 April 2015 10:25:32 2800 | 2801 | adding a _method 2802 | ========== 2803 | Getting Started with Laravel 4 2804 | - Your Highlight on page 32-32 | Added on Tuesday, 7 April 2015 10:26:43 2805 | 2806 | built-in development server that is bundled with PHP 5.4 2807 | ========== 2808 | Getting Started with Laravel 4 2809 | - Your Highlight on page 33-33 | Added on Tuesday, 7 April 2015 10:27:52 2810 | 2811 | app/routes.php 2812 | ========== 2813 | Getting Started with Laravel 4 2814 | - Your Highlight on page 35-35 | Added on Tuesday, 7 April 2015 10:29:03 2815 | 2816 | App::missing(function($exception){ return Response::make("Page not found", 404); }); 2817 | ========== 2818 | Getting Started with Laravel 4 2819 | - Your Highlight on page 35-35 | Added on Tuesday, 7 April 2015 10:30:14 2820 | 2821 | The most frequent object that you will return from your routes is the View object 2822 | ========== 2823 | Getting Started with Laravel 4 2824 | - Your Highlight on page 35-35 | Added on Tuesday, 7 April 2015 10:33:36 2825 | 2826 | inside app/views 2827 | ========== 2828 | Getting Started with Laravel 4 2829 | - Your Highlight on page 37-37 | Added on Tuesday, 7 April 2015 10:41:29 2830 | 2831 | The $fillable array defines the list of fields that Laravel can fill by mass assignment 2832 | ========== 2833 | Getting Started with Laravel 4 2834 | - Your Highlight on page 37-37 | Added on Tuesday, 7 April 2015 10:41:57 2835 | 2836 | By default, Laravel expects a created_at and updated_at timestamp field in the database table. Since we are not interested in storing these timestamps with the breeds, we disable them in the model by setting the $timestamps property to false 2837 | ========== 2838 | Getting Started with Laravel 4 2839 | - Your Highlight on page 37-37 | Added on Tuesday, 7 April 2015 10:42:52 2840 | 2841 | php artisan migrate:make add_cats_and_breeds_table 2842 | ========== 2843 | Getting Started with Laravel 4 2844 | - Your Highlight on page 38-38 | Added on Tuesday, 7 April 2015 10:43:41 2845 | 2846 | we can use the seeding helpers offered by Laravel 2847 | ========== 2848 | Getting Started with Laravel 4 2849 | - Your Highlight on page 39-39 | Added on Tuesday, 7 April 2015 10:44:10 2850 | 2851 | You can bulk insert an array but you could also insert arbitrary code in the run() method to load data from a CSV or JSON file. There are also third-party libraries that can help you generate large amounts of test data to fill your database 2852 | ========== 2853 | Getting Started with Laravel 4 2854 | - Your Highlight on page 39-39 | Added on Tuesday, 7 April 2015 10:45:16 2855 | 2856 | make sure that you use the triple brace notation to avoid XSS vulnerabilities 2857 | ========== 2858 | Getting Started with Laravel 4 2859 | - Your Highlight on page 52-52 | Added on Tuesday, 7 April 2015 10:50:08 2860 | 2861 | Laravel expects all passwords to be hashed with the Hash::make helper, 2862 | ========== 2863 | Getting Started with Laravel 4 2864 | - Your Highlight on page 53-53 | Added on Tuesday, 7 April 2015 10:52:37 2865 | 2866 | you open app/filters.php and look at the auth filter, you will see that it redirects guests to the login route with the Redirect::guest() method 2867 | ========== 2868 | Getting Started with Laravel 4 2869 | - Your Highlight on page 53-53 | Added on Tuesday, 7 April 2015 10:52:58 2870 | 2871 | This method stores the requested path in a session variable, which is then used by the intended() method. The parameter passed to this method is the fallback route to which users should be redirected if there is no request path in the session information 2872 | ========== 2873 | Getting Started with Laravel 4 2874 | - Your Highlight on page 55-55 | Added on Tuesday, 7 April 2015 10:54:18 2875 | 2876 | We also need to protect the PUT and POST routes by adding a condition that checks whether the currently logged-in user is allowed to edit the page 2877 | ========== 2878 | Getting Started with Laravel 4 2879 | - Your Highlight on page 58-58 | Added on Tuesday, 7 April 2015 11:33:24 2880 | 2881 | Multiple filters can be passed as a string separated by the pipe symbol 2882 | ========== 2883 | Getting Started with Laravel 4 2884 | - Your Highlight on page 59-59 | Added on Tuesday, 7 April 2015 11:37:09 2885 | 2886 | the values in an array as a second argument to the raw method: 2887 | ========== 2888 | Getting Started with Laravel 4 2889 | - Your Highlight on page 60-60 | Added on Tuesday, 7 April 2015 11:38:08 2890 | 2891 | define a blacklist with the $guarded property 2892 | ========== 2893 | Getting Started with Laravel 4 2894 | - Your Highlight on page 60-60 | Added on Tuesday, 7 April 2015 11:38:30 2895 | 2896 | Laravel makes it very easy to create, read, and expire cookies with its Cookie class 2897 | ========== 2898 | Getting Started with Laravel 4 2899 | - Your Highlight on page 60-60 | Added on Tuesday, 7 April 2015 11:38:54 2900 | 2901 | This also means that you will not be able to read them from the client side using JavaScript 2902 | ========== 2903 | Getting Started with Laravel 4 2904 | - Your Highlight on page 69-69 | Added on Tuesday, 7 April 2015 11:46:07 2905 | 2906 | This is possible by using the be() method and passing a User instance to it or whichever Eloquent model you use along with Laravel's authentication class: 2907 | ========== 2908 | Getting Started with Laravel 4 2909 | - Your Highlight on page 69-69 | Added on Tuesday, 7 April 2015 11:47:08 2910 | 2911 | To write tests that depend on a database, we need to override the setUp() method in our tests to migrate and seed the database each time a test is run. It is also important to run the parent setUp() method, otherwise, the test case will not be able to start properly: 2912 | ========== 2913 | Getting Started with Laravel 4 2914 | - Your Highlight on page 71-71 | Added on Tuesday, 7 April 2015 11:47:45 2915 | 2916 | Since Laravel ships with Symfony's DomCrawler and CssSelector components, it is possible to inspect the contents of a rendered view. By issuing a request through the test client instance with $this->client->request(), you can filter its contents with CSS queries as follows: 2917 | ========== 2918 | Getting Started with Laravel 4 2919 | - Your Highlight on page 73-73 | Added on Tuesday, 7 April 2015 11:50:42 2920 | 2921 | Speed up your workflow by using generators 2922 | ========== 2923 | Getting Started with Laravel 4 2924 | - Your Highlight on page 74-74 | Added on Tuesday, 7 April 2015 11:51:33 2925 | 2926 | With the help of a short script like Artisan Anywhere, available at https://github.com/antonioribeiro/ artisan-anywhere, it is also possible to run artisan from any subfolder in your project. 2927 | ========== 2928 | Getting Started with Laravel 4 2929 | - Your Highlight on page 74-74 | Added on Tuesday, 7 April 2015 11:52:28 2930 | 2931 | This is probably the quickest way to get acquainted with a Laravel application that someone else has built 2932 | ========== 2933 | Getting Started with Laravel 4 2934 | - Your Highlight on page 75-75 | Added on Tuesday, 7 April 2015 11:53:45 2935 | 2936 | Artisan provides a command called tinker, which boots up the application and lets you interact with 2937 | ========== 2938 | Getting Started with Laravel 4 2939 | - Your Highlight on page 76-76 | Added on Tuesday, 7 April 2015 11:54:26 2940 | 2941 | This will put your application into maintenance mode. To define what happens when a visitor lands on your application when it is in this state, simply edit the App:down handler inside app/global/start.php to add a custom message, render a view, or redirect the user. To exit the maintenance mode, simply run 2942 | ========== 2943 | Getting Started with Laravel 4 2944 | - Your Highlight on page 76-76 | Added on Tuesday, 7 April 2015 11:55:09 2945 | 2946 | PHP accelerator such as APC, eAccelerator, or XCache. In 2947 | ========== 2948 | Getting Started with Laravel 4 2949 | - Your Highlight on page 76-76 | Added on Tuesday, 7 April 2015 11:55:34 2950 | 2951 | php artisan optimize This will trim and merge many common classes into one single file located inside bootstrap/compiled.php. The optimize command is something you could, for example, include in a deployment script 2952 | ========== 2953 | Getting Started with Laravel 4 2954 | - Your Highlight on page 77-77 | Added on Tuesday, 7 April 2015 11:56:21 2955 | 2956 | these generators facilitate the creation of migrations, seeds, models, views, controllers, tests, and forms. 2957 | ========== 2958 | Getting Started with Laravel 4 2959 | - Your Highlight on page 77-77 | Added on Tuesday, 7 April 2015 11:56:33 2960 | 2961 | To install the generators package, simply run: $ composer require way/generators:dev-master -- 2962 | ========== 2963 | Getting Started with Laravel 4 2964 | - Your Highlight on page 77-77 | Added on Tuesday, 7 April 2015 11:57:03 2965 | 2966 | To enable the commands in Artisan, you have to open app/config/app.php and add Way\Generators\GeneratorsServiceProvider to the array of service providers 2967 | ========== 2968 | Getting Started with Laravel 4 2969 | - Your Highlight on page 79-79 | Added on Tuesday, 7 April 2015 11:59:42 2970 | 2971 | Rocketeer, it is now possible to write deployment scripts exclusively with PHP and, therefore, reduce the learning curve as well as the number of external dependencies. 2972 | ========== 2973 | Getting Started with Laravel 4 2974 | - Your Highlight on page 85-85 | Added on Tuesday, 7 April 2015 12:04:45 2975 | 2976 | Include your own PHP classes and functions • Use Laravel's automatic JSON serialization and deserialization features 2977 | ========== 2978 | Getting Started with Laravel 4 2979 | - Your Highlight on page 86-86 | Added on Tuesday, 7 April 2015 12:06:47 2980 | 2981 | start using repositories, you can even swap out entire classes when you instantiate the controller 2982 | ========== 2983 | Getting Started with Laravel 4 2984 | - Your Highlight on page 87-87 | Added on Tuesday, 7 April 2015 12:07:30 2985 | 2986 | Finally, to tell Laravel which controller action to use, simply shorten the route declaration as follows 2987 | ========== 2988 | Getting Started with Laravel 4 2989 | - Your Highlight on page 87-87 | Added on Tuesday, 7 April 2015 12:08:36 2990 | 2991 | Another argument in favor of explicit routing is that it makes it much easier to browse a codebase and allows Artisan to generate a cleaner table when using php artisan routes 2992 | ========== 2993 | Getting Started with Laravel 4 2994 | - Your Highlight on page 89-89 | Added on Tuesday, 7 April 2015 12:10:27 2995 | 2996 | To avoid this, make sure you tell Laravel the relations it should preload by using the with method: 2997 | ========== 2998 | Getting Started with Laravel 4 2999 | - Your Highlight on page 89-89 | Added on Tuesday, 7 April 2015 12:11:02 3000 | 3001 | If you are curious about what happens behind the scene when you execute a query on an Eloquent object, you should install a profiler package. You can choose between https://github.com/loic-sharma/profiler, 3002 | ========== 3003 | Getting Started with Laravel 4 3004 | - Your Highlight on page 89-89 | Added on Tuesday, 7 April 2015 12:11:24 3005 | 3006 | or https://github.com/barryvdh/laravel-debugbar 3007 | ========== 3008 | Getting Started with Laravel 4 3009 | - Your Highlight on page 90-90 | Added on Tuesday, 7 April 2015 12:15:23 3010 | 3011 | , when a record is deleted from the database, it is gone forever. If you want to give the users of your application the ability to recover accidentally deleted data, simply enable soft deletes on your models by giving them a protected $softDelete = true; property. You will also need to add a DATETIME column called deleted_at to the model. This column then remains empty until the record is removed with the delete() method. 3012 | ========== 3013 | Getting Started with Laravel 4 3014 | - Your Highlight on page 90-90 | Added on Tuesday, 7 April 2015 12:15:47 3015 | 3016 | If you want to override this behavior, you can chain the withTrashed() method or, alternatively use onlyTrashed() to get only the records that were deleted: Cat::onlyTrashed()->get(); To force the deletion of a model, you need to use the forceDelete() method. More control with SQL If you are used to writing SQL by hand, you will probably appreciate Eloquent's expressiveness, but at the same time, in some instances, you will miss the finegrained control you had with SQL.Fortunately, it is possible to run lower-level commands by using Laravel's query builder, which allows you to call methods to issue advanced WHERE clauses and JOIN or GROUP BY statements. The overhead in terms of performance is negligible and you still have the benefit to have a more readable syntax. Not to mention that your code will be free from SQL injection vulnerabilities. If you do need to execute raw SQL in a select clause, for example, because you need to use a feature that does not exist in Laravel's query builder or because the SQL code is specific to a particular database engine, you can use the DB::raw method.DB::table('cats')->select(DB::raw('count(* ) as cats_count')) If you need to execute a complete statement and not just a SELECT statement, you can use DB::statement(): 3017 | ========== 3018 | Getting Started with Laravel 4 3019 | - Your Highlight on page 90-90 | Added on Tuesday, 7 April 2015 12:16:21 3020 | 3021 | If you want to override this behavior, you can chain the withTrashed() method or, alternatively use onlyTrashed() to get only the 3022 | ========== 3023 | Getting Started with Laravel 4 3024 | - Your Highlight on page 90-90 | Added on Tuesday, 7 April 2015 12:17:11 3025 | 3026 | If you need to execute a complete statement and not just a SELECT statement, you can use DB::statement(): 3027 | ========== 3028 | Getting Started with Laravel 4 3029 | - Your Highlight on page 91-91 | Added on Tuesday, 7 April 2015 12:17:48 3030 | 3031 | The last really useful feature of Eloquent that we will look at is model events. Eloquent models fire events before and after they are created, saved, updated, deleted, or restored. It is very easy to listen for those events and execute a function when they occur. You could, for example, add an event listener to log changes to database records or send yourself an e-mail whenever a new user signs up 3032 | ========== 3033 | Getting Started with Laravel 4 3034 | - Your Highlight on page 91-91 | Added on Tuesday, 7 April 2015 12:18:05 3035 | 3036 | These event listeners can be defined in a separate file, for example, app/events.php, which is loaded when the app starts (we will see how to do that later in this chapter). In simple cases, however, it is absolutely fine to keep them inside the model. 3037 | ========== 3038 | Getting Started with Laravel 4 3039 | - Your Highlight on page 92-92 | Added on Tuesday, 7 April 2015 12:19:24 3040 | 3041 | $cats->links() }} This will output the complete HTML markup, which is compatible with Twitter Bootstrap 3042 | ========== 3043 | Getting Started with Laravel 4 3044 | - Your Highlight on page 92-92 | Added on Tuesday, 7 April 2015 12:20:36 3045 | 3046 | Luckily, Laravel makes it very easy to override the default configuration settings found inside app/config/. The mechanism to detect and apply the correct settings depending on the environment is very simple. All you have to do is define the names of the different environments along with a list of corresponding host names or IP addresses (for example, localhost, 127.0.0.1, or dev.example.com) inside bootstrap/start.php: 3047 | ========== 3048 | Getting Started with Laravel 4 3049 | - Your Highlight on page 93-93 | Added on Tuesday, 7 April 2015 12:21:18 3050 | 3051 | Then, if the app is served from example.com, Laravel will automatically apply any settings that are defined inside the app/config/production/ folder 3052 | ========== 3053 | Getting Started with Laravel 4 3054 | - Your Highlight on page 93-93 | Added on Tuesday, 7 April 2015 12:22:03 3055 | 3056 | For example, if you have a development environment named local, to migrate your database, you would run: $ php artisan migrate --env=local 3057 | ========== 3058 | Getting Started with Laravel 4 3059 | - Your Highlight on page 93-93 | Added on Tuesday, 7 April 2015 12:22:20 3060 | 3061 | Alternatively, if you want to avoid appending the env flag to every command, you can add the hostname of your machine to the list in bootstrap/start.php. To find it out, run Artisan's tinker command and enter 3062 | ========== 3063 | Getting Started with Laravel 4 3064 | - Your Highlight on page 94-94 | Added on Tuesday, 7 April 2015 12:23:22 3065 | 3066 | retrieve and use them in your code, Laravel provides a Config::get($setting, $default) method that accepts an optional second parameter for a fallback value if the parameter is not set. 3067 | ========== 3068 | Getting Started with Laravel 4 3069 | - Your Highlight on page 94-94 | Added on Tuesday, 7 April 2015 12:40:22 3070 | 3071 | This only leaves you with the problem of making sure that the code is callable. It turns out that there are at least three ways in which this can be achieved, all of which require you to edit composer.json. 3072 | ========== 3073 | Getting Started with Laravel 4 3074 | - Your Highlight on page 95-95 | Added on Tuesday, 7 April 2015 12:40:54 3075 | 3076 | The last method adds a "psr-0" object. As its name implies, it is best suited with namespaced classes of PSR- 3077 | ========== 3078 | Getting Started with Laravel 4 3079 | - Your Highlight on page 95-95 | Added on Tuesday, 7 April 2015 12:41:23 3080 | 3081 | With every method described, do not forget to run composer dump-autoload to refresh the classmap and make sure that PHP can find your classes 3082 | ========== 3083 | Getting Started with Laravel 4 3084 | - Your Highlight on page 95-95 | Added on Tuesday, 7 April 2015 12:47:57 3085 | 3086 | Playing nice with the frontend 3087 | ========== 3088 | Getting Started with Laravel 4 3089 | - Your Highlight on page 100-100 | Added on Tuesday, 7 April 2015 12:49:41 3090 | 3091 | Str::slug( 3092 | ========== 3093 | Getting Started with Laravel 4 3094 | - Your Highlight on page 101-101 | Added on Tuesday, 7 April 2015 12:50:21 3095 | 3096 | Laravel's file manipulation functions make it easier to write the web and console applications that deal with the uploads along with the filesystem 3097 | ========== 3098 | Getting Started with Laravel 4 3099 | - Your Highlight on page 106-106 | Added on Tuesday, 7 April 2015 12:51:27 3100 | 3101 | Laravel is compatible with the following queue drivers: • Beanstalkd, with the pda/pheanstalk package • Amazon SQS, with the aws/aws-sdk-php package • IronMQ, with the iron-io/iron_mq package 3102 | ========== 3103 | Mastering Nginx 3104 | - Your Highlight on page 22-22 | Added on Tuesday, 7 April 2015 13:13:09 3105 | 3106 | There are no open and closing braces ({}) surrounding the global section. 3107 | ========== 3108 | Mastering Nginx 3109 | - Your Highlight on page 30-30 | Added on Tuesday, 7 April 2015 13:19:06 3110 | 3111 | Any context beginning with the keyword server is considered a "virtual server" section. It 3112 | ========== 3113 | Mastering Nginx 3114 | - Your Highlight on page 30-30 | Added on Tuesday, 7 April 2015 13:21:01 3115 | 3116 | virtual server is defined by a combination of the listen and server_name directives. listen defines an IP address/port combination or path to a UNIX-domain socket 3117 | ========== 3118 | Mastering Nginx 3119 | - Your Highlight on page 30-30 | Added on Tuesday, 7 April 2015 13:22:06 3120 | 3121 | default_server Defines this address:port combination as being the default for the requests bound here 3122 | ========== 3123 | Mastering Nginx 3124 | - Your Highlight on page 31-31 | Added on Tuesday, 7 April 2015 13:22:55 3125 | 3126 | Indicates that only HTTPS connections will be made on this port. 3127 | ========== 3128 | Mastering Nginx 3129 | - Your Highlight on page 32-32 | Added on Tuesday, 7 April 2015 13:23:32 3130 | 3131 | The wildcard can replace the subdomain part: *. example.com • The wildcard can replace the top-level-domain part: www.example.* • A special form will match the subdomain or the domain itself: . example.com (matches *. example.com as well as example.com) 3132 | ========== 3133 | Mastering Nginx 3134 | - Your Highlight on page 32-32 | Added on Tuesday, 7 April 2015 13:23:47 3135 | 3136 | A regular expression can also be used as a parameter to server_name by prepending the name with a tilde (~): 3137 | ========== 3138 | Mastering Nginx 3139 | - Your Highlight on page 32-32 | Added on Tuesday, 7 April 2015 13:24:24 3140 | 3141 | NGINX uses the following logic when determining which virtual server should serve a specific request: 3142 | ========== 3143 | Mastering Nginx 3144 | - Your Highlight on page 34-34 | Added on Tuesday, 7 April 2015 13:25:11 3145 | 3146 | The location directive may be used within a virtual server section and indicates a URI that comes either from the client or from an internal redirect. Locations may be nested with a few exceptions. They are used for processing requests with as specific a configuration as possible. 3147 | ========== 3148 | Mastering Nginx 3149 | - Your Highlight on page 34-34 | Added on Tuesday, 7 April 2015 13:26:10 3150 | 3151 | Table: Location modifiers 3152 | ========== 3153 | Mastering Nginx 3154 | - Your Highlight on page 35-35 | Added on Tuesday, 7 April 2015 13:29:07 3155 | 3156 | Defines another name for the location, as found on the filesystem. If the location is specified with a regular expression, alias should reference captures defined in that regular expression. alias replaces the part of the URI matched by the location, such that the rest of the URI not matched will be searched for in that filesystem location. Using the alias directive is fragile when moving bits of the configuration around, so using the root directive is preferred, unless the URI needs to be modified in order to find the file. 3157 | ========== 3158 | Mastering Nginx 3159 | - Your Highlight on page 36-36 | Added on Tuesday, 7 April 2015 13:31:30 3160 | 3161 | Best practice dictates that regular expression locations be nested inside string-based locations. An example of this is as follows: 3162 | ========== 3163 | Mastering Nginx 3164 | - Your Highlight on page 41-41 | Added on Tuesday, 7 April 2015 13:33:06 3165 | 3166 | NGINX was designed to not only serve web traffic, but also to provide a means of proxying mail services. In this chapter you will learn how to configure NGINX as a mail proxy for POP3, IMAP, and SMTP services 3167 | ========== 3168 | Lean Architecture 3169 | - Your Highlight on page 22-22 | Added on Wednesday, 8 April 2015 16:03:38 3170 | 3171 | We will deliver code just in time instead of stockpiling software library warehouses ahead of time 3172 | ========== 3173 | Lean Architecture 3174 | - Your Highlight on page 24-24 | Added on Sunday, 12 April 2015 14:15:50 3175 | 3176 | that 70% of the software they build is never used 3177 | ========== 3178 | Lean Architecture 3179 | - Your Highlight on page 26-26 | Added on Sunday, 12 April 2015 14:19:35 3180 | 3181 | Lean focuses on what’s important now, whenever ‘‘now’’ is – whether that is hitting the target for next week’s delivery or doing long-term planning 3182 | ========== 3183 | --------------------------------------------------------------------------------