This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| case class Message(username: String, content: String) | |
| val list = List(Message("aaa", "111"), Message("aaa", "222"), | |
| Message("bbb", "333"), Message("aaa", "444")) | |
| if (list.isEmpty) Nil | |
| else | |
| list.head :: ( | |
| for (List(m1, m2) <- list.sliding(2)) | |
| yield if (m1.username == m2.username) | |
| m2.copy(username = "") else m2).toList |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object Test { | |
| /* 简介 */ | |
| type A = Double // 一组对象A | |
| type B = Long // 一组对象B | |
| type C = String // 一组对象C | |
| val f: A => B = // 一组态射f | |
| (a: Double) => a.round |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package star.oa | |
| package service | |
| import impl.mongo.WorkflowEntry | |
| import impl.mongo.CurrentStep | |
| import impl.mongo.HistoryStep | |
| import impl.mongo.WorkflowComment | |
| import star.oa.workflow._ | |
| import net.liftweb.http.S | |
| import java.util.Date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class WfEntry < ActiveRecord::Base | |
| has_many :history_steps, :foreign_key => :entry_id, :class_name => 'WfHistoryStep', :dependent => :destroy | |
| has_many :current_steps, :foreign_key => :entry_id, :class_name => 'WfCurrentStep', :dependent => :destroy | |
| has_many :comments, :as => :container, :dependent => :destroy | |
| belongs_to :document, :polymorphic => true | |
| named_scope :todo_of_workflow_name_and_owner, lambda { |workflow_name, owner_name| | |
| {:include => :current_steps, | |
| :conditions =>["name = ? and #{WfCurrentStep.table_name}.owner = ?", workflow_name, owner_name ]} | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ebb | |
| package snippet | |
| import net.liftweb.http._ | |
| import net.liftweb.util._ | |
| import net.liftweb.common._ | |
| import ebb.model.Models._ | |
| import ebb.util.FaqReader | |
| import org.squeryl._ | |
| import PrimitiveTypeMode._ |
NewerOlder