This file contains 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._ |
This file contains 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 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 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 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 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
#!/usr/bin/env clisp | |
(setf *bookpaths* '( | |
("platform/architecture" "book") | |
("platform/requirements" "book") | |
("zszj/userGuide/agents" "book"))) | |
(setf *root* (namestring (cd))) | |
(defun make-books (paths) | |
(if (null paths) |
This file contains 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
;; Put autosave files (ie #foo#) and backup files (ie foo~) in ~/.emacs.d/. | |
(custom-set-variables | |
'(auto-save-file-name-transforms '((".*" "~/.emacs.d/autosaves/\\1" t))) | |
'(backup-directory-alist '((".*" . "~/.emacs.d/backups/")))) | |
;; create the autosave dir if necessary, since emacs won't. | |
(make-directory "~/.emacs.d/autosaves/" t) | |
;;(setq load-path (cons "~/.emacs.d/emacs-rails" load-path)) | |
;;(require 'rails) |
This file contains 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 ch19.sec02 | |
import scala.util.parsing.combinator._ | |
class ExprParser extends RegexParsers { | |
val number = "[0-9]+".r | |
def expr: Parser[Any] = term ~ opt("+" | "-") ~ expr | |
def term: Parser[Any] = factor ~ rep("*" ~ factor) | |
def factor: Parser[Any] = number | "(" ~ expr ~ ")" | |
} |
This file contains 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.util.parsing | |
import scala.util.parsing.combinator._ | |
import scala.util.matching.Regex | |
case class Table(name: String, alias: Option[String]) | |
case class Join(tableName: String, alias: Option[String], leftTable: String, leftField: String, rightTable: String, rightField: String) | |
case class Column(table: Option[String] = None, | |
field: Option[String] = None, | |
formula: Option[String] = None, | |
asTitle: Option[String] = None) { |
This file contains 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
/* | |
// Setting this in bootstrap.liftweb.Boot.scala | |
// Use HTML5 for rendering | |
LiftRules.htmlProperties.default.set((r: Req) => | |
new StarXHtmlInHtml5OutProperties(r.userAgent)) | |
*/ | |
package bootstrap.liftweb | |
import java.io.InputStream |
OlderNewer